Compare commits
2 Commits
a6e6f450c5
...
58e80d590e
Author | SHA1 | Date |
---|---|---|
lyc | 58e80d590e | |
lyc | 8a1c5d7186 |
|
@ -52,7 +52,7 @@ watch(() => props.item.answer, (newVal) => {
|
||||||
|
|
||||||
|
|
||||||
const onSave = () =>{
|
const onSave = () =>{
|
||||||
editTempResult({id: props.item.reultId, content: textarea.value}).then( res =>{
|
editTempResult({id: props.item.resultId, content: textarea.value}).then( res =>{
|
||||||
isDialog.value = false
|
isDialog.value = false
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
emitter.emit('onGetChild', textarea.value)
|
emitter.emit('onGetChild', textarea.value)
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, watch, onUnmounted } from 'vue'
|
import { ref, reactive, onMounted, watch, onUnmounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { tempSave, completion, modelList, removeChildTemp, tempResult } from '@/api/mode/index'
|
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import keywordDialog from './keyword-dialog.vue';
|
import keywordDialog from './keyword-dialog.vue';
|
||||||
import AdjustDialog from './adjust-dialog.vue'
|
import AdjustDialog from './adjust-dialog.vue'
|
||||||
|
@ -155,13 +155,13 @@ const getChildTemplate = () => {
|
||||||
|
|
||||||
// 查询模板结果
|
// 查询模板结果
|
||||||
const getTempResult = () => {
|
const getTempResult = () => {
|
||||||
tempResult({ mainModelId: curTemplate.id }).then(res => {
|
tempResult({ mainModelId: curTemplate.id, pageNum: 1, pageSize: 10000 }).then(res => {
|
||||||
let rows = res.rows
|
let rows = res.rows
|
||||||
childTempList.value.forEach(item => {
|
childTempList.value.forEach(item => {
|
||||||
rows.forEach(el => {
|
rows.forEach(el => {
|
||||||
if (item.id == el.modelId) {
|
if (item.id == el.modelId) {
|
||||||
item.answer = el.content
|
item.answer = el.content
|
||||||
item.reultId = el.id
|
item.resultId = el.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -268,7 +268,7 @@ const againResult = async (index, item) => {
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
childTempList.value[index].oldAnswer = answer
|
childTempList.value[index].oldAnswer = answer
|
||||||
childTempList.value[index].answer = getResult(answer);
|
childTempList.value[index].answer = getResult(answer);
|
||||||
onSaveTemp(item)
|
onEditSave(item)
|
||||||
} finally {
|
} finally {
|
||||||
childTempList.value[index].loading = false
|
childTempList.value[index].loading = false
|
||||||
}
|
}
|
||||||
|
@ -290,6 +290,15 @@ const getCompletion = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存 重新研读后的结果
|
||||||
|
const onEditSave = async (item) =>{
|
||||||
|
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
|
||||||
|
ElMessage.success(res)
|
||||||
|
getChildTemplate()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 保存模板
|
// 保存模板
|
||||||
const onSaveTemp = (item) => {
|
const onSaveTemp = (item) => {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
|
@ -143,7 +143,8 @@ const getCompletion = async () => {
|
||||||
for (let item of childTempList.value) {
|
for (let item of childTempList.value) {
|
||||||
try {
|
try {
|
||||||
item.loading = true
|
item.loading = true
|
||||||
params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
|
// params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
|
||||||
|
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
item.oldAnswer = answer
|
item.oldAnswer = answer
|
||||||
|
|
Loading…
Reference in New Issue