|
|
|
@ -6,8 +6,8 @@ |
|
|
|
<span>维护机巢固件版本,发布后供用户对设备升级</span> |
|
|
|
</div> |
|
|
|
<div class="page-actions"> |
|
|
|
<button class="icon-command" title="刷新" @click="load"><svg><use href="#i-refresh" /></svg></button> |
|
|
|
<button class="primary-command" @click="openAdd"><svg><use href="#i-plus" /></svg>新增固件</button> |
|
|
|
<t-button shape="square" variant="outline" title="刷新" @click="load"><svg><use href="#i-refresh" /></svg></t-button> |
|
|
|
<t-button theme="primary" @click="openAdd"><svg><use href="#i-plus" /></svg>新增固件</t-button> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
|
|
|
|
@ -54,8 +54,8 @@ |
|
|
|
<td>{{ f.createdAt }}</td> |
|
|
|
<td> |
|
|
|
<div class="row-actions"> |
|
|
|
<button @click="openEdit(f)">编辑</button> |
|
|
|
<button class="more-action" @click="remove(f)"><svg><use href="#i-trash" /></svg></button> |
|
|
|
<t-button variant="text" theme="primary" @click="openEdit(f)">编辑</t-button> |
|
|
|
<t-button variant="text" theme="danger" shape="square" @click="remove(f)"><svg><use href="#i-trash" /></svg></t-button> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
@ -65,12 +65,12 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="table-footer"> |
|
|
|
<span>共 {{ total }} 个固件版本 · 第 {{ pageNum }} / {{ pages }} 页</span> |
|
|
|
<div> |
|
|
|
<button @click="goPage(pageNum - 1)"><svg><use href="#i-chevron" /></svg></button> |
|
|
|
<b>{{ pageNum }}</b> |
|
|
|
<button @click="goPage(pageNum + 1)"><svg><use href="#i-chevron" /></svg></button> |
|
|
|
</div> |
|
|
|
<t-pagination |
|
|
|
v-model:current="pageNum" |
|
|
|
:total="total" |
|
|
|
:page-size="pageSize" |
|
|
|
@current-change="load" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -105,8 +105,8 @@ |
|
|
|
<div class="form-error">{{ formError }}</div> |
|
|
|
</form> |
|
|
|
<template #footer> |
|
|
|
<button class="plain-command" type="button" @click="modalVisible = false">取消</button> |
|
|
|
<button class="primary-command" type="button" @click="submit">{{ editingId ? '保存' : '确认新增' }}</button> |
|
|
|
<t-button variant="outline" @click="modalVisible = false">取消</t-button> |
|
|
|
<t-button theme="primary" @click="submit">{{ editingId ? '保存' : '确认新增' }}</t-button> |
|
|
|
</template> |
|
|
|
</t-dialog> |
|
|
|
</section> |
|
|
|
@ -123,7 +123,6 @@ const list = ref([]) |
|
|
|
const total = ref(0) |
|
|
|
const pageNum = ref(1) |
|
|
|
const pageSize = ref(10) |
|
|
|
const pages = ref(1) |
|
|
|
const keyword = ref('') |
|
|
|
const statusFilter = ref('') |
|
|
|
|
|
|
|
@ -177,7 +176,6 @@ async function load() { |
|
|
|
if (statusFilter.value) params.status = statusFilter.value |
|
|
|
const page = await request.get(urls.FIRMWARES, { params }) |
|
|
|
total.value = page?.total || 0 |
|
|
|
pages.value = page?.pages || 1 |
|
|
|
list.value = (page?.records || []).map((f) => ({ |
|
|
|
id: String(f.id), |
|
|
|
version: f.version, |
|
|
|
@ -201,11 +199,6 @@ function reload() { |
|
|
|
load() |
|
|
|
} |
|
|
|
|
|
|
|
function goPage(p) { |
|
|
|
if (p < 1 || p > pages.value) return |
|
|
|
pageNum.value = p |
|
|
|
load() |
|
|
|
} |
|
|
|
|
|
|
|
function openAdd() { |
|
|
|
Object.assign(form, { version: '', component: '', description: '', fileUrl: '', sha256: '', signature: '', fileSizeMb: undefined, mandatory: 0, status: 'draft' }) |
|
|
|
|