|
|
@ -82,9 +82,10 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import { ref, reactive, onMounted, computed, 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 } from '@/api/mode/index'
|
|
|
|
|
|
|
|
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'
|
|
|
|
import EditDialog from './edit-dialog.vue'
|
|
|
|
import EditDialog from './edit-dialog.vue'
|
|
|
@ -187,7 +188,7 @@ const changeTemplate = (val) => {
|
|
|
|
const removeItem = async (item, isChild) => {
|
|
|
|
const removeItem = async (item, isChild) => {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* item: 当前操作的模板
|
|
|
|
* item: 当前操作的模板
|
|
|
|
* isChild: 子模板中的移除为 true 否则为false
|
|
|
|
* isChild: 子模板中的移除为 true
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (item.ex3 != '1') {
|
|
|
|
if (item.ex3 != '1') {
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
ElMessageBox.confirm(
|
|
|
@ -213,15 +214,11 @@ const removeItem = async (item, isChild) => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editKeyWord(item,!isChild)
|
|
|
|
editKeyWord(item,!isChild)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ai对话调整
|
|
|
|
// Ai对话调整
|
|
|
|
const curIndex = ref(-1)
|
|
|
|
const curIndex = ref(-1)
|
|
|
|
const isAdjust = ref(false)
|
|
|
|
const isAdjust = ref(false)
|
|
|
@ -240,11 +237,21 @@ const onEdit = (index, item) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const modeType = computed(() => {
|
|
|
|
const modeType = ref('课标')
|
|
|
|
if (props.type == 1) return '课标';
|
|
|
|
watch(() => props.type, (newVal) => {
|
|
|
|
if (props.type == 2) return '教材';
|
|
|
|
if (newVal == 1){
|
|
|
|
if (props.type == 3) return '考试';
|
|
|
|
modeType.value = '课标'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
if (newVal == 2){
|
|
|
|
|
|
|
|
modeType.value = '教材'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (newVal == 2){
|
|
|
|
|
|
|
|
modeType.value = '考试'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, { immediate: false })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重新研读
|
|
|
|
// 重新研读
|
|
|
|
const params = reactive(
|
|
|
|
const params = reactive(
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -256,7 +263,7 @@ const params = reactive(
|
|
|
|
const againResult = async (index, item) => {
|
|
|
|
const againResult = async (index, item) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
childTempList.value[index].loading = true
|
|
|
|
childTempList.value[index].loading = true
|
|
|
|
params.prompt = `按照${item.name}的要求,针对${props.curNode.edustage}${props.curNode.edusubject}${modeType} 对${props.curNode.itemtitle}进行教学分析`
|
|
|
|
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
|
|
|
const { data } = await completion(params)
|
|
|
|
const { data } = await completion(params)
|
|
|
|
let answer = data.answer
|
|
|
|
let answer = data.answer
|
|
|
|
childTempList.value[index].oldAnswer = answer
|
|
|
|
childTempList.value[index].oldAnswer = answer
|
|
|
@ -271,7 +278,7 @@ 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 = `按照${item.name}的要求,针对${props.curNode.edustage}${props.curNode.edusubject}${modeType} 对${props.curNode.itemtitle}进行教学分析`
|
|
|
|
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${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
|
|
|
@ -286,7 +293,7 @@ const getCompletion = async () => {
|
|
|
|
// 保存模板
|
|
|
|
// 保存模板
|
|
|
|
const onSaveTemp = (item) => {
|
|
|
|
const onSaveTemp = (item) => {
|
|
|
|
const data = {
|
|
|
|
const data = {
|
|
|
|
mainModelId: props.tempId,
|
|
|
|
mainModelId: curTemplate.id,
|
|
|
|
modelId: item.id,
|
|
|
|
modelId: item.id,
|
|
|
|
examDocld: '',
|
|
|
|
examDocld: '',
|
|
|
|
content: item.oldAnswer
|
|
|
|
content: item.oldAnswer
|
|
|
@ -324,10 +331,12 @@ emitter.on('onGetMain', () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const curNode = reactive({})
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getTemplateList()
|
|
|
|
getTemplateList()
|
|
|
|
let jsonKey = `${modeType}-${props.curNode.edustage}-${props.curNode.edusubject}`
|
|
|
|
let data = sessionStore.get('subject.curNode')
|
|
|
|
|
|
|
|
Object.assign(curNode, data);
|
|
|
|
|
|
|
|
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
|
|
|
|
params.dataset_id = dataSetJson[jsonKey]
|
|
|
|
params.dataset_id = dataSetJson[jsonKey]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|