From a3079a87d01166e8627531eb2e5fa88a18ee112d Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 13 Dec 2024 10:58:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?edit=20=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/keyword-dialog.vue | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/components/template-study/container/keyword-dialog.vue b/src/renderer/src/components/template-study/container/keyword-dialog.vue index 4eb1cd2..bdd6c29 100644 --- a/src/renderer/src/components/template-study/container/keyword-dialog.vue +++ b/src/renderer/src/components/template-study/container/keyword-dialog.vue @@ -40,7 +40,7 @@ const props = defineProps({ type: Number, default: 1 }, - item: { // 子模板 + item: { // 当前操作的模板 type: Object, default: () => { return { ex3: '' } @@ -73,23 +73,25 @@ const loading = ref(false) const saveAdd = async () => { loading.value = true if (props.item.ex3 == '1') { - + let id; // id 为主模板id if (props.item.isAdd) { - try { - // 系统预设模板 copy一份 - const { msg } = await addKeyWords({ name: form.name, id: props.item.id }) - emitter.emit('onGetMain') - ElMessage.success(msg) - mode.value = false - } finally { - loading.value = false - } + id = props.item.id } else{ - onAddChildTemp(props.item.parentId) + // 编辑状态下 item 为子模板 主模板则是item.parentId + id = props.item.parentId } + try { + // 系统预设模板 copy一份 + const { msg } = await addKeyWords({ name: form.name, id }) + emitter.emit('onGetMain') + ElMessage.success(msg) + mode.value = false + } finally { + loading.value = false + } + } else { - if (props.item.isAdd) { onAddChildTemp(props.item.id) } -- 2.44.0.windows.1 From 08db70a3f2da6628c67892982e4397b11e897ea7 Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 16 Dec 2024 09:50:17 +0800 Subject: [PATCH 2/2] edit --- .../template-study/container/left.vue | 9 +- .../template-study/container/right.vue | 22 +-- .../src/components/template-study/index.vue | 13 +- .../container/keyword-dialog.vue | 159 ++++++++++++++++++ .../views/teachingDesign/container/left.vue | 63 +++++-- .../views/teachingDesign/container/right.vue | 129 ++++++++++++-- 6 files changed, 337 insertions(+), 58 deletions(-) create mode 100644 src/renderer/src/views/teachingDesign/container/keyword-dialog.vue diff --git a/src/renderer/src/components/template-study/container/left.vue b/src/renderer/src/components/template-study/container/left.vue index 02db0d4..d2b9285 100644 --- a/src/renderer/src/components/template-study/container/left.vue +++ b/src/renderer/src/components/template-study/container/left.vue @@ -16,12 +16,12 @@ \ No newline at end of file diff --git a/src/renderer/src/views/teachingDesign/container/left.vue b/src/renderer/src/views/teachingDesign/container/left.vue index ab6f38b..7df70fa 100644 --- a/src/renderer/src/views/teachingDesign/container/left.vue +++ b/src/renderer/src/views/teachingDesign/container/left.vue @@ -2,6 +2,7 @@
教学模式
+
{{ item.name }} @@ -29,27 +30,33 @@ + \ No newline at end of file -- 2.44.0.windows.1