feat: 优化默认建档模板和时间轴

This commit is contained in:
Nixevol
2026-07-05 01:21:34 +08:00
parent 7a51814307
commit b51f26213b
6 changed files with 74 additions and 11 deletions
+9 -1
View File
@@ -205,7 +205,15 @@
"edit": "Edit Template",
"namePlaceholder": "Enter template name",
"fieldKeyTip": "Unique key, e.g. craft",
"sortHint": "Field order = display order on consumer page; use arrows to reorder"
"sortHint": "Field order = display order on consumer page; use arrows to reorder",
"defaultFields": {
"craft": "Craft",
"year": "Creation Era / Release Time",
"size": "Dimensions",
"material": "Material / Medium",
"certificationOrg": "Certification Body",
"dataOwner": "Data Ownership"
}
},
"audit": {
"status": "Audit Status",
+9 -1
View File
@@ -205,7 +205,15 @@
"edit": "编辑模板",
"namePlaceholder": "请输入模板名称",
"fieldKeyTip": "英文唯一标识,如 craft",
"sortHint": "字段顺序即客户端展示顺序,可用上下箭头调整"
"sortHint": "字段顺序即客户端展示顺序,可用上下箭头调整",
"defaultFields": {
"craft": "工艺",
"year": "创作年代 / 出品时间",
"size": "规格尺寸",
"material": "材质 / 媒介",
"certificationOrg": "认证机构",
"dataOwner": "数据权属"
}
},
"audit": {
"status": "审核状态",
+14 -3
View File
@@ -60,7 +60,7 @@
<div v-for="(f, i) in form.fields" :key="i" class="field-row">
<span class="field-order">{{ i + 1 }}</span>
<n-input v-model:value="f.fieldKey" :placeholder="t('pages.template.fieldKeyTip')" style="width: 120px" />
<n-input v-model:value="f.label" :placeholder="t('pages.template.fieldLabel')" style="width: 110px" />
<n-input v-model:value="f.label" :placeholder="t('pages.template.fieldLabel')" style="width: 180px" />
<n-select v-model:value="f.type" :options="fieldTypeOptions" style="width: 110px" />
<n-checkbox v-model:checked="f.required">{{ t('pages.template.required') }}</n-checkbox>
<span class="field-ops">
@@ -133,6 +133,17 @@ const formRef = ref<FormInst | null>(null);
const form = reactive<{ name: string; remark: string; status: string; fields: any[] }>({ name: '', remark: '', status: 'ENABLED', fields: [] });
const rules: FormRules = { name: { required: true, message: () => t('pages.template.namePlaceholder'), trigger: 'blur' } };
function createDefaultTemplateFields() {
return [
{ fieldKey: 'craft', label: t('pages.template.defaultFields.craft'), type: FieldType.TEXT, required: true },
{ fieldKey: 'year', label: t('pages.template.defaultFields.year'), type: FieldType.TEXT, required: false },
{ fieldKey: 'size', label: t('pages.template.defaultFields.size'), type: FieldType.TEXT, required: false },
{ fieldKey: 'material', label: t('pages.template.defaultFields.material'), type: FieldType.TEXT, required: false },
{ fieldKey: 'certificationOrg', label: t('pages.template.defaultFields.certificationOrg'), type: FieldType.TEXT, required: false },
{ fieldKey: 'dataOwner', label: t('pages.template.defaultFields.dataOwner'), type: FieldType.TEXT, required: false },
];
}
const columns: DataTableColumns<any> = [
{
title: 'ID',
@@ -246,7 +257,7 @@ function openCreate() {
form.name = '';
form.remark = '';
form.status = 'ENABLED';
form.fields = [{ fieldKey: '', label: '', type: FieldType.TEXT, required: false }];
form.fields = createDefaultTemplateFields();
showModal.value = true;
}
function openEdit(r: any) {
@@ -309,7 +320,7 @@ onMounted(load);
align-items: center;
gap: 8px;
margin-bottom: 8px;
min-width: 560px;
min-width: 660px;
}
.field-editor {
width: 100%;