From cd1a1f68caaa30034186e7a1fe21183a4236e437 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Fri, 28 Mar 2025 20:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E5=A0=86?= =?UTF-8?q?=E4=B9=B1=E4=B8=83=E5=85=AB=E7=B3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Department-entry/Drawer-Template.vue | 27 +++++--- .../inspect/inspecttemplate/TemplateForm.vue | 69 +++++++++++-------- src/views/inspect/inspecttemplate/index.vue | 21 +++--- 3 files changed, 71 insertions(+), 46 deletions(-) diff --git a/src/views/Department-entry/Drawer-Template.vue b/src/views/Department-entry/Drawer-Template.vue index a136e0b..15e8754 100644 --- a/src/views/Department-entry/Drawer-Template.vue +++ b/src/views/Department-entry/Drawer-Template.vue @@ -25,8 +25,8 @@ class="!w-160px" /> - - + + @@ -37,12 +37,12 @@ - - + + - + 搜索 重置 @@ -63,8 +63,8 @@ @row-click="handleRowClick" :header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px', color: '#333333' }" > - - + + @@ -158,6 +158,9 @@ const visible = computed({ watch(visible, (newVal) => { if (newVal) { Type.value = props.templateType + // 清除模板名称和部位的输入框内容 + queryParams.contentName = undefined + queryParams.category = undefined getList() getCategoryOptions() // 获取所有模板类别 } @@ -166,7 +169,15 @@ watch(visible, (newVal) => { /** 获取所有模板类别 */ const getCategoryOptions = async () => { try { - const categories = await TemplateApi.getAllCategories() + let categories; + if (Type.value = '汇总') { + // 如果是汇总标签页,调用getCategory接口但不传递类型参数 + categories = await TemplateApi.getAllCategories() + } else { + // 否则按模板类型获取相应的部位 + categories = await TemplateApi.getCategory(Type.value) + } + categoryOptions.value = categories.map(category => ({ label: category, value: category diff --git a/src/views/inspect/inspecttemplate/TemplateForm.vue b/src/views/inspect/inspecttemplate/TemplateForm.vue index a92e682..f63f8ec 100644 --- a/src/views/inspect/inspecttemplate/TemplateForm.vue +++ b/src/views/inspect/inspecttemplate/TemplateForm.vue @@ -7,8 +7,8 @@ label-width="100px" v-loading="formLoading" > - - + + @@ -19,12 +19,20 @@ - - - + + + - + @@ -34,17 +42,16 @@ - + - -