From: root Date: Mon, 28 Sep 2026 07:09:00 +0000 (+0800) Subject: 领域方案导入页:补齐与编辑页一致的字段(缩写必英文大写、所属领域、版本号、状态) X-Git-Url: http://acesimba.cloud/gitweb/?a=commitdiff_plain;h=48e205b310f3088d49b0e868e3a80e80d98611d6;p=StationBuilder-vue.git 领域方案导入页:补齐与编辑页一致的字段(缩写必英文大写、所属领域、版本号、状态) - 新增「缩写(英文大写)」必填项,输入自动转大写并校验 /^[A-Z]+$/ - 新增「状态」下拉(可用 / 编辑中) - 字段顺序与标签对齐领域方案编辑页:方案名称、缩写、所属领域、版本号、状态、方案说明 - submit 时一并提交 abbr 与 status --- diff --git a/src-vue/pages/domain/ImportDomainPackage.vue b/src-vue/pages/domain/ImportDomainPackage.vue index c4bdb0c..9ca94a5 100644 --- a/src-vue/pages/domain/ImportDomainPackage.vue +++ b/src-vue/pages/domain/ImportDomainPackage.vue @@ -21,7 +21,9 @@ const props = defineProps({ const file = ref(null); const domainId = ref(0); const name = ref(""); +const abbr = ref(""); const version = ref("1.0"); +const status = ref("available"); const description = ref(""); const busy = ref(false); @@ -54,6 +56,10 @@ async function submit() { props.notify("请填写方案名称和所属领域"); return; } + if (!/^[A-Z]+$/.test((abbr.value || "").trim())) { + props.notify("缩写必须为英文大写字母"); + return; + } busy.value = true; try { const row = await fetchDb("/domain-templates", { @@ -62,8 +68,9 @@ async function submit() { body: JSON.stringify({ domain_id: domainId.value, name: name.value.trim(), + abbr: (abbr.value || "").trim().toUpperCase(), description: description.value.trim() || `由 ${file.value.name} 人工导入的领域方案`, - status: "available", + status: status.value, version: version.value.trim() || "1.0", creator: CURRENT_USER_EMAIL, }), @@ -90,14 +97,23 @@ async function submit() {
+ + + - - + + + + + + + +