Compare commits

..

No commits in common. "58e80d590e1e0739abf0a90b374bc8a849dc34b8" and "a6e6f450c5d73a81c2a96643220b9a0622cc60ce" have entirely different histories.

3 changed files with 6 additions and 16 deletions

View File

@ -52,7 +52,7 @@ watch(() => props.item.answer, (newVal) => {
const onSave = () =>{
editTempResult({id: props.item.resultId, content: textarea.value}).then( res =>{
editTempResult({id: props.item.reultId, content: textarea.value}).then( res =>{
isDialog.value = false
ElMessage.success('操作成功')
emitter.emit('onGetChild', textarea.value)

View File

@ -84,7 +84,7 @@
<script setup>
import { ref, reactive, onMounted, watch, onUnmounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
import { tempSave, completion, modelList, removeChildTemp, tempResult } from '@/api/mode/index'
import { sessionStore } from '@/utils/store'
import keywordDialog from './keyword-dialog.vue';
import AdjustDialog from './adjust-dialog.vue'
@ -155,13 +155,13 @@ const getChildTemplate = () => {
//
const getTempResult = () => {
tempResult({ mainModelId: curTemplate.id, pageNum: 1, pageSize: 10000 }).then(res => {
tempResult({ mainModelId: curTemplate.id }).then(res => {
let rows = res.rows
childTempList.value.forEach(item => {
rows.forEach(el => {
if (item.id == el.modelId) {
item.answer = el.content
item.resultId = el.id
item.reultId = el.id
}
})
})
@ -268,7 +268,7 @@ const againResult = async (index, item) => {
let answer = data.answer
childTempList.value[index].oldAnswer = answer
childTempList.value[index].answer = getResult(answer);
onEditSave(item)
onSaveTemp(item)
} finally {
childTempList.value[index].loading = false
}
@ -290,15 +290,6 @@ 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 data = {

View File

@ -143,8 +143,7 @@ const getCompletion = async () => {
for (let item of childTempList.value) {
try {
item.loading = true
// params.prompt = `${curNode.edustage}${curNode.edusubject}${item.prompt}`
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
const { data } = await completion(params)
let answer = data.answer
item.oldAnswer = answer