fix: 停用溯源模板前增加确认
This commit is contained in:
@@ -151,6 +151,7 @@
|
||||
- 追溯码导出按钮交互(2026-07-05):全局追溯码管理页和档案内追溯码管理页共用 `TraceCodePanel`,导出按钮由下拉菜单改为单击即导出;导出范围按“已勾选 > 当前筛选 > 全部”自动判断,按钮文案分别显示“导出(已选x项)”“导出(当前筛选)”或“导出”。固定档案页自身的 `artworkId` 不算用户筛选,全局页 URL/表头/关键词筛选会计入“当前筛选”。
|
||||
- 客户端主题切换与导出防重复(2026-07-05):客户端新增轻量主题状态 `apps/client/src/composables/useTheme.ts` 和 `ThemeSwitch.vue`,首页与溯源详情页均显示主题切换按钮;默认主题为 `auto` 跟随系统,手动选择浅色/深色时写入 `localStorage: artveris_client_theme` 并通过 `html[data-theme]` 覆盖 CSS 变量。追溯码管理导出按钮新增 `exporting` loading/禁用状态,下载处理过程中会阻止重复点击。
|
||||
- 溯源模板字段标识提示(2026-07-05):模板字段配置中“英文标识”输入框占位提示缩短为“英文唯一标识”(英文:`Unique English key`),避免窄输入框内示例文本过长导致显示不全。
|
||||
- 溯源模板停用确认(2026-07-05):溯源模板列表操作列的停用按钮不再一键直接停用;当模板从启用切换到停用时会先弹出确认框,说明停用后新建档案不能再选择该模板,确认后才调用更新接口。启用仍保持直接执行。
|
||||
|
||||
## 当前代码基准与注意事项
|
||||
|
||||
|
||||
@@ -203,6 +203,8 @@
|
||||
"useCount": "Used By",
|
||||
"create": "New Template",
|
||||
"edit": "Edit Template",
|
||||
"disableConfirmTitle": "Disable Template",
|
||||
"disableConfirmContent": "Disable \"{name}\"? It will no longer be available when creating new artwork files.",
|
||||
"namePlaceholder": "Enter template name",
|
||||
"fieldKeyTip": "Unique English key",
|
||||
"sortHint": "Field order = display order on consumer page; use arrows to reorder",
|
||||
|
||||
@@ -203,6 +203,8 @@
|
||||
"useCount": "使用作品数",
|
||||
"create": "新建模板",
|
||||
"edit": "编辑模板",
|
||||
"disableConfirmTitle": "确认停用模板",
|
||||
"disableConfirmContent": "确认停用“{name}”?停用后新建档案时将不能选择该模板。",
|
||||
"namePlaceholder": "请输入模板名称",
|
||||
"fieldKeyTip": "英文唯一标识",
|
||||
"sortHint": "字段顺序即客户端展示顺序,可用上下箭头调整",
|
||||
|
||||
@@ -213,9 +213,22 @@ const columns: DataTableColumns<any> = [
|
||||
|
||||
async function toggleStatus(r: any) {
|
||||
const next = r.status === TemplateStatus.ENABLED ? TemplateStatus.DISABLED : TemplateStatus.ENABLED;
|
||||
await templateApi.update(r.id, { status: next });
|
||||
message.success(t('common.msg.updated'));
|
||||
load();
|
||||
const update = async () => {
|
||||
await templateApi.update(r.id, { status: next });
|
||||
message.success(t('common.msg.updated'));
|
||||
load();
|
||||
};
|
||||
if (next === TemplateStatus.DISABLED) {
|
||||
dialog.warning({
|
||||
title: t('pages.template.disableConfirmTitle'),
|
||||
content: t('pages.template.disableConfirmContent', { name: r.name || '-' }),
|
||||
positiveText: t('common.action.confirm'),
|
||||
negativeText: t('common.action.cancel'),
|
||||
onPositiveClick: update,
|
||||
});
|
||||
return;
|
||||
}
|
||||
await update();
|
||||
}
|
||||
|
||||
async function load() {
|
||||
|
||||
Reference in New Issue
Block a user