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 @@