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 35de365..5cf6251 100644
--- a/src/renderer/src/components/template-study/container/adjust-dialog.vue
+++ b/src/renderer/src/components/template-study/container/adjust-dialog.vue
@@ -1,5 +1,5 @@
-
+
@@ -68,7 +70,6 @@
-
@@ -89,6 +90,7 @@ import { sessionStore } from '@/utils/store'
import keywordDialog from './keyword-dialog.vue';
import AdjustDialog from './adjust-dialog.vue'
import EditDialog from './edit-dialog.vue'
+import TypingEffect from '@/components/typing-effect/index.vue'
import emitter from '@/utils/mitt';
import { dataSetJson } from '@/utils/comm.js'
@@ -109,7 +111,6 @@ const onAdd = () => {
isAdd.value = true
Object.assign(editItem, curTemplate)
isWordDialog.value = true
-
}
const editKeyWord = (item, val) => {
@@ -263,12 +264,14 @@ const params = reactive(
const againResult = async (index, item) => {
try {
childTempList.value[index].loading = true
+ item.aiShow = true
+ childTempList.value[index].oldAnswer = ''
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
const { data } = await completion(params)
let answer = data.answer
childTempList.value[index].oldAnswer = answer
childTempList.value[index].answer = getResult(answer);
- onEditSave(item)
+ // onEditSave(item)
} finally {
childTempList.value[index].loading = false
}
@@ -278,18 +281,29 @@ const getCompletion = async () => {
for (let item of childTempList.value) {
try {
item.loading = true
+ item.aiShow = true
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
const { data } = await completion(params)
let answer = data.answer
item.oldAnswer = answer
item.answer = getResult(answer);
- onSaveTemp(item)
+
} finally {
item.loading = false
}
}
}
+// 替换分析结果
+emitter.on('onSaveAdjust', (item) => {
+ childTempList.value[curIndex.value].oldAnswer = item
+ let answer = getResult(item);
+ childTempList.value[curIndex.value].oldAnswer = item
+ childTempList.value[curIndex.value].answer = answer
+ onEditSave(childTempList.value[curIndex.value])
+})
+
+
// 保存 重新研读后的结果
const onEditSave = async (item) =>{
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
@@ -297,30 +311,18 @@ const onEditSave = async (item) =>{
getChildTemplate()
}
-
-
// 保存模板
const onSaveTemp = (item) => {
+ if(item.oldAnswer == '') return
const data = {
mainModelId: curTemplate.id,
modelId: item.id,
examDocld: '',
content: item.oldAnswer
}
- tempSave(data).then(res => {
- console.log(res)
- })
+ tempSave(data).then(res => {})
}
-
-
-// 替换分析结果
-emitter.on('saveAdjust', (item) => {
- childTempList.value[curIndex.value].oldAnswer = item
- let answer = getResult(item);
- childTempList.value[curIndex.value].answer = answer
-})
-
// 分析获取课标对话结果
let getResult = (text) => {
text = text.replace(/^\n\n(.*?)\n\n$/s, '$1
');
@@ -351,8 +353,9 @@ onMounted(() => {
// 解绑
onUnmounted(() => {
+ emitter.off('onGetMain');
emitter.off('onGetChild');
- emitter.off('saveAdjust');
+ emitter.off('onSaveAdjust');
})
@@ -422,6 +425,7 @@ onUnmounted(() => {
.item-answer {
flex-direction: column;
padding-top: 5px;
+ width: 100%;
:deep(.text-tit) {
font-weight: bold;
diff --git a/src/renderer/src/components/typing-effect/index.vue b/src/renderer/src/components/typing-effect/index.vue
new file mode 100644
index 0000000..0817b05
--- /dev/null
+++ b/src/renderer/src/components/typing-effect/index.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/renderer/src/components/window-tools/index.vue b/src/renderer/src/components/window-tools/index.vue
index da66f80..2e40c52 100644
--- a/src/renderer/src/components/window-tools/index.vue
+++ b/src/renderer/src/components/window-tools/index.vue
@@ -8,9 +8,10 @@