From d0d936ca2df512892f38d60361799575c7aa7416 Mon Sep 17 00:00:00 2001 From: hwj Date: Tue, 14 Apr 2026 16:58:46 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E4=BB=BB=E5=8A=A1=E5=88=B6?= =?UTF-8?q?=E5=8D=95-=E4=BB=BB=E5=8A=A1=E5=8D=95=E6=98=8E=E7=BB=86-?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/task/components/TaskDetailList.vue | 38 ++++++++++--------- src/views/mes/task/index.vue | 11 +++++- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/views/mes/task/components/TaskDetailList.vue b/src/views/mes/task/components/TaskDetailList.vue index a7b53aae..c0c7dd33 100644 --- a/src/views/mes/task/components/TaskDetailList.vue +++ b/src/views/mes/task/components/TaskDetailList.vue @@ -2,6 +2,7 @@ () + showCreateButton?: boolean +}>(), { + showCreateButton: true +}) const loading = ref(false) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 @@ -116,21 +120,6 @@ const queryParams = reactive({ taskId: undefined as unknown }) -/** 监听主表的关联字段的变化,加载对应的子表数据 */ -watch( - () => props.taskId, - (val: number) => { - if (!val) { - list.value = [] - total.value = 0 - return - } - queryParams.taskId = val - handleQuery() - }, - { immediate: true, deep: true } -) - /** 查询列表 */ const getList = async () => { loading.value = true @@ -149,6 +138,21 @@ const handleQuery = () => { getList() } +/** 监听主表的关联字段的变化,加载对应的子表数据 */ +watch( + () => props.taskId, + (val: number) => { + if (!val) { + list.value = [] + total.value = 0 + return + } + queryParams.taskId = val + handleQuery() + }, + { immediate: true, deep: true } +) + /** 添加/修改操作 */ const formRef = ref() const openForm = (type: string, id?: number) => { diff --git a/src/views/mes/task/index.vue b/src/views/mes/task/index.vue index 96913633..ff3dea1f 100644 --- a/src/views/mes/task/index.vue +++ b/src/views/mes/task/index.vue @@ -168,14 +168,21 @@ - + - + +