fix: 简化追溯码导出按钮
This commit is contained in:
@@ -148,6 +148,7 @@
|
||||
- 后台顶部操作栏粘性规则(2026-07-05):全局 `.page-toolbar` 改为内容区顶部 sticky 工具栏,带背景、边线和轻阴影,覆盖艺术品列表/详情、追溯码管理、模板、出库、审核、查询日志、操作日志、用户等所有统一页面工具栏,滚动长表单/详情时返回、保存、新增、导出等顶部操作不会被顶走。备份恢复组件的局部 `backup-toolbar` 也增加 sticky 兜底;设置页底部保存和个人中心表单按钮不是顶部工具栏,保持原位置。
|
||||
- 追溯码管理入口与筛选修正(2026-07-05):全局 `/trace-codes` 从隐藏页恢复为左侧独立导航“追溯码管理”,仍保留艺术品详情页的数据管理入口;艺术品档案列表中点击“档案编号”改为进入作品编辑/详情页,右侧“数据管理”图标继续进入该档案追溯码管理。追溯码管理搜索框加宽,后端关键词搜索扩展到追溯码、完整编码、链接、档案编号、名称、艺术家、批次编号、分组名称和备注。分组管理接口不带参数时仍返回全部分组;生成追溯码弹窗会预加载作品下拉,避免初次点开显示无数据,并在选择作品后按该作品已有追溯码使用过的分组加载分组选项。
|
||||
- 追溯码搜索框宽度微调(2026-07-05):追溯码管理工具栏搜索框按扩展后的占位提示加宽,桌面端使用 `width: min(560px, 46vw)` 且最小 420px,小屏仍由媒体查询切换为 100% 宽,避免提示文案被过早截断。
|
||||
- 追溯码导出按钮交互(2026-07-05):全局追溯码管理页和档案内追溯码管理页共用 `TraceCodePanel`,导出按钮由下拉菜单改为单击即导出;导出范围按“已勾选 > 当前筛选 > 全部”自动判断,按钮文案分别显示“导出(已选x项)”“导出(当前筛选)”或“导出”。固定档案页自身的 `artworkId` 不算用户筛选,全局页 URL/表头/关键词筛选会计入“当前筛选”。
|
||||
|
||||
## 当前代码基准与注意事项
|
||||
|
||||
|
||||
@@ -17,12 +17,10 @@
|
||||
<template #icon><n-icon :component="FolderOutline" /></template>
|
||||
{{ t('pages.traceCode.manageGroups') }}
|
||||
</n-button>
|
||||
<n-dropdown v-if="auth.canWrite" trigger="click" :options="exportOptions" @select="onExport">
|
||||
<n-button>
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
{{ t('common.action.export') }}
|
||||
</n-button>
|
||||
</n-dropdown>
|
||||
<n-button v-if="auth.canWrite" @click="onExport">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
{{ exportButtonText }}
|
||||
</n-button>
|
||||
<n-button v-if="auth.canWrite" type="primary" @click="openGenerate">
|
||||
<template #icon><n-icon :component="AddOutline" /></template>
|
||||
{{ t('pages.traceCode.generate') }}
|
||||
@@ -562,22 +560,25 @@ async function showQr(r: any) {
|
||||
qrModal.value = true;
|
||||
}
|
||||
|
||||
const exportOptions = computed(() => {
|
||||
const cur = t('pages.traceCode.exportCurrent');
|
||||
const opts: Array<{ label: string; key: string }> = [
|
||||
{ label: cur, key: 'filter' },
|
||||
];
|
||||
if (checkedKeys.value.length) {
|
||||
const sel = t('pages.traceCode.selected', { n: checkedKeys.value.length });
|
||||
opts.push({ label: sel, key: 'selected' });
|
||||
}
|
||||
return opts;
|
||||
const hasActiveExportFilter = computed(() => Boolean(
|
||||
query.keyword ||
|
||||
query.groupId ||
|
||||
query.batchId ||
|
||||
query.status ||
|
||||
query.outboundStatus ||
|
||||
(!fixedArtworkId.value && query.artworkId),
|
||||
));
|
||||
|
||||
const exportButtonText = computed(() => {
|
||||
const base = t('common.action.export');
|
||||
if (checkedKeys.value.length) return `${base}(${t('pages.traceCode.selected', { n: checkedKeys.value.length })})`;
|
||||
if (hasActiveExportFilter.value) return `${base}(${t('pages.traceCode.exportCurrent')})`;
|
||||
return base;
|
||||
});
|
||||
|
||||
async function onExport(key: string) {
|
||||
const scope = key;
|
||||
async function onExport() {
|
||||
const params: Record<string, unknown> = {};
|
||||
if (scope === 'selected') {
|
||||
if (checkedKeys.value.length) {
|
||||
params.ids = checkedKeys.value.map(String).join(',');
|
||||
} else {
|
||||
const aid = currentArtworkId();
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
"registerOutbound": "登记出库/上链",
|
||||
"enableOne": "启用",
|
||||
"disableOne": "禁用",
|
||||
"selected": "已选 {n} 项",
|
||||
"selected": "已选{n}项",
|
||||
"assignGroup": "设为分组"
|
||||
},
|
||||
"outbound": {
|
||||
|
||||
Reference in New Issue
Block a user