From 787a83c55087fd40691010469282947c2ebface3 Mon Sep 17 00:00:00 2001 From: bot_dev2 Date: Thu, 6 Aug 2026 16:11:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20version=20=E9=A1=B5=E6=94=B9=20antd=20a-?= =?UTF-8?q?table=20+=20=E5=88=9D=E5=A7=8B=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E6=8E=A2=E6=B5=8B=EF=BC=88=E5=8F=91=E5=B8=83=3D=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=88=B0=E6=9C=8D=E5=8A=A1=E7=AB=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/iaop/studio/version.vue | 62 +++++++++---------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/iaop/studio/version.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/iaop/studio/version.vue index efacba1..e8236bb 100644 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/iaop/studio/version.vue +++ b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/iaop/studio/version.vue @@ -2,16 +2,15 @@ /** * 模板版本发布(issue #183 [E2]):发布 = 注册新版本到服务端注册表; * 注册表离线时降级本地记录并标注。 + * 表格:antd a-table(响应式直绑,规避 vxe-grid proxy 时序)。 */ -import { ref } from 'vue'; +import { onMounted, ref } from 'vue'; import { Page, VbenButton } from '@vben/common-ui'; import { MaterialSymbolsAdd } from '@vben/icons'; import { message } from 'antdv-next'; -import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import { useVbenVxeGrid } from '#/adapter/vxe-table'; -import { registerModel } from '#/api/iaop/registry'; +import { fetchRegistryModels, registerModel } from '#/api/iaop/registry'; interface VersionRow { version: string; @@ -28,37 +27,31 @@ const rows = ref([ { version: 'v0.8.0', stage: 'dev', time: '2026-08-03 09:00', author: 'bot_dev1', note: '布局资产初版' }, ]); -const gridOptions: VxeTableGridOptions = { - rowConfig: { keyField: 'version' }, - height: 'auto', - stripe: true, - columns: [ - { title: '版本', field: 'version', width: 110 }, - { title: '阶段', field: 'stage', width: 100, slots: { default: 'stage' } }, - { title: '时间', field: 'time', width: 170 }, - { title: '作者', field: 'author', width: 110 }, - { title: '说明', field: 'note', minWidth: 200 }, - ], - proxy: { - query: async ({ page } = {}) => { - // page 可能缺省(分页未就绪的首次查询),兜底返回全量 - const cur = page?.currentPage ?? 1; - const size = page?.pageSize ?? (rows.value.length || 10); - return { - items: rows.value.slice((cur - 1) * size, cur * size), - total: rows.value.length, - }; - }, - }, -}; +const columns = [ + { title: '版本', dataIndex: 'version', key: 'version', width: 120 }, + { title: '阶段', dataIndex: 'stage', key: 'stage', width: 110 }, + { title: '时间', dataIndex: 'time', key: 'time', width: 180 }, + { title: '作者', dataIndex: 'author', key: 'author', width: 120 }, + { title: '说明', dataIndex: 'note', key: 'note' }, +]; -const [Grid, gridApi] = useVbenVxeGrid({ gridOptions }); +const tagColor = (stage: string) => + stage === 'prod' ? 'green' : stage === 'staging' ? 'orange' : 'blue'; + +onMounted(async () => { + // 初始探测服务端在线状态(注册表可达 → 在线) + try { + await fetchRegistryModels(); + online.value = true; + } catch { + online.value = false; + } +}); async function publish() { const version = `v${Date.now() % 100000}`; const name = 'iaop-template'; try { - // 发布 = 注册新版本到服务端注册表(staging) await registerModel({ name, version, stage: 'staging', description: '手动发布(前端)' }); online.value = true; rows.value.unshift({ @@ -76,7 +69,6 @@ async function publish() { }); message.warning('注册表服务不可达:本次发布仅本地记录'); } - gridApi.query(); } @@ -85,10 +77,12 @@ async function publish() { - -