From d9f69001a5090200d74bf5d192842c570e676a10 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Sun, 20 Jul 2025 16:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF=E8=A7=81-?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 829f6a34..1696d7ad 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -531,7 +531,11 @@ export default { dlgShow: false }, rightTypeId: {}, - catalogSortDialogShow: false + catalogSortDialogShow: false, + selectedOrg: { + orgId: null, + name: '' + } }; }, created() { @@ -559,10 +563,18 @@ export default { handler(newVal) { //需要保存 this.requireSaveCourse = true; - console.log("newVal.orgId = ",newVal.orgId) - this.checkOrgPermission(newVal.orgId); }, deep: true + }, + 'selectedOrg.orgId': { + handler(newVal, oldVal) { + if (newVal !== oldVal) { + console.log("--- watch newVal.orgId = ",newVal.orgId) + this.checkOrgPermission(newVal.orgId); + } + }, + deep: false, // 因为只是监听 orgId,不是整个对象内容变化,所以不需要 deep + immediate: false // 如果不需要立即执行,设为 false } }, mounted() {