From 393587848f5d15d5c0736550b9dd480f078526e4 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 26 Nov 2024 14:52:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/adjust-dialog.vue | 6 +- .../template-study/container/edit-dialog.vue | 5 +- .../template-study/container/header.vue | 149 ------ .../container/keyword-dialog.vue | 17 +- .../container/{dialog.vue => left-dialog.vue} | 0 .../template-study/container/left.vue | 60 +++ .../template-study/container/pdf.vue | 28 - .../template-study/container/result.vue | 505 ------------------ .../template-study/container/right.vue | 451 ++++++++++++++++ .../src/components/template-study/index.vue | 39 +- 10 files changed, 542 insertions(+), 718 deletions(-) delete mode 100644 src/renderer/src/components/template-study/container/header.vue rename src/renderer/src/components/template-study/container/{dialog.vue => left-dialog.vue} (100%) create mode 100644 src/renderer/src/components/template-study/container/left.vue delete mode 100644 src/renderer/src/components/template-study/container/pdf.vue delete mode 100644 src/renderer/src/components/template-study/container/result.vue create mode 100644 src/renderer/src/components/template-study/container/right.vue diff --git a/src/renderer/src/components/template-study/container/adjust-dialog.vue b/src/renderer/src/components/template-study/container/adjust-dialog.vue index 0258471..3ac07da 100644 --- a/src/renderer/src/components/template-study/container/adjust-dialog.vue +++ b/src/renderer/src/components/template-study/container/adjust-dialog.vue @@ -45,6 +45,7 @@ import { conversation, completion } from '@/api/mode/index' import { sessionStore } from '@/utils/store' import { ElMessage } from 'element-plus' import { dataSetJson } from '@/utils/comm.js' +import emitter from '@/utils/mitt'; const textarea = ref('') @@ -109,13 +110,16 @@ const getCompletion = async (val) => { } const saveAdjust = (item) =>{ - emit('saveAdjust', item.msg) + isDialog.value = false ElMessage.success('操作成功') + emitter.on('saveAdjust', item.msg) + } onMounted(() => { let data = sessionStore.get('subject.curNode') + Object.assign(curNode, data); let text = props.modeType == 1 ? '课标': props.modeType == 2 ? '教材' : '考试' diff --git a/src/renderer/src/components/template-study/container/edit-dialog.vue b/src/renderer/src/components/template-study/container/edit-dialog.vue index fa7ff5d..97dda43 100644 --- a/src/renderer/src/components/template-study/container/edit-dialog.vue +++ b/src/renderer/src/components/template-study/container/edit-dialog.vue @@ -29,6 +29,7 @@ import { ref, watch} from 'vue' import { ElMessage } from 'element-plus' import { editTempResult } from '@/api/mode/index.js' +import emitter from '@/utils/mitt'; const textarea = ref('') @@ -49,12 +50,12 @@ watch(() => props.item.answer, (newVal) => { } },{ deep: true }) -const emit = defineEmits(['saveEdit']) + const onSave = () =>{ editTempResult({id: props.item.reultId, content: textarea.value}).then( res =>{ isDialog.value = false ElMessage.success('操作成功') - emit('saveEdit', textarea.value) + emitter.emit('onGetChild', textarea.value) }) } diff --git a/src/renderer/src/components/template-study/container/header.vue b/src/renderer/src/components/template-study/container/header.vue deleted file mode 100644 index b6b368b..0000000 --- a/src/renderer/src/components/template-study/container/header.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - \ No newline at end of file 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 4821d6e..a9888ed 100644 --- a/src/renderer/src/components/template-study/container/keyword-dialog.vue +++ b/src/renderer/src/components/template-study/container/keyword-dialog.vue @@ -1,5 +1,5 @@