Compare commits
No commits in common. "cebf864b828e4a571541bd204eab7b35a40cbe5b" and "0b6039f9d845bae2609734a4fbb0797884d6d188" have entirely different histories.
cebf864b82
...
0b6039f9d8
|
@ -59,7 +59,6 @@ import { completion, docList } from '@/api/mode/index'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { dataSetJson } from '@/utils/comm.js'
|
import { dataSetJson } from '@/utils/comm.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { sendChart } from '@/api/ai/index'
|
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
|
|
||||||
const userInfo = useUserStore().user
|
const userInfo = useUserStore().user
|
||||||
|
@ -78,14 +77,6 @@ const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1
|
default: 1
|
||||||
},
|
|
||||||
curMode:{
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
conversation_id: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: ''
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -109,8 +100,7 @@ const curNode = reactive({})
|
||||||
const params = reactive(
|
const params = reactive(
|
||||||
{
|
{
|
||||||
prompt: '',
|
prompt: '',
|
||||||
dataset_id: '',
|
dataset_id: ''
|
||||||
template: ''
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -118,24 +108,7 @@ const params = reactive(
|
||||||
const getCompletion = async (val) => {
|
const getCompletion = async (val) => {
|
||||||
try {
|
try {
|
||||||
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||||
params.template = props.item.prompt
|
const { data } = await completion(params)
|
||||||
|
|
||||||
let data = null;
|
|
||||||
// 教学大模型
|
|
||||||
if(props.curMode == 1){
|
|
||||||
const res = await sendChart({
|
|
||||||
content: params.prompt,
|
|
||||||
conversationId: props.conversation_id,
|
|
||||||
stream: false
|
|
||||||
})
|
|
||||||
data = res.data
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// 知识库模型
|
|
||||||
const res = await completion(params)
|
|
||||||
data = res.data
|
|
||||||
}
|
|
||||||
|
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
msgList.value.push({
|
msgList.value.push({
|
||||||
type: 'robot',
|
type: 'robot',
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
<!--编辑结果-->
|
<!--编辑结果-->
|
||||||
<EditDialog v-model="isEdit" :item="editItem" />
|
<EditDialog v-model="isEdit" :item="editItem" />
|
||||||
<!--AI 对话调整-->
|
<!--AI 对话调整-->
|
||||||
<AdjustDialog v-model="isAdjust" :type="type" :item="editItem" :curMode="curMode" :conversation_id="conversation_id"/>
|
<AdjustDialog v-model="isAdjust" :type="type" :item="editItem" />
|
||||||
<!--添加、编辑提示词-->
|
<!--添加、编辑提示词-->
|
||||||
<keywordDialog v-model="isWordDialog" :item="editItem" />
|
<keywordDialog v-model="isWordDialog" :item="editItem" />
|
||||||
</template>
|
</template>
|
||||||
|
@ -323,7 +323,7 @@ const againResult = async (index, item) => {
|
||||||
|
|
||||||
let data = null;
|
let data = null;
|
||||||
// 教学大模型
|
// 教学大模型
|
||||||
if (curMode.value == 1) {
|
if (mode.value == 1) {
|
||||||
const res = await sendChart({
|
const res = await sendChart({
|
||||||
content: params.prompt,
|
content: params.prompt,
|
||||||
conversationId: conversation_id.value,
|
conversationId: conversation_id.value,
|
||||||
|
|
|
@ -42,10 +42,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import { completion } from '@/api/mode/index'
|
import { completion } from '@/api/mode/index'
|
||||||
import { dataSetJson } from '@/utils/comm.js'
|
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { sendChart } from '@/api/ai/index'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const textarea = ref('')
|
const textarea = ref('')
|
||||||
|
|
||||||
|
@ -57,14 +56,6 @@ const props = defineProps({
|
||||||
default: () => {
|
default: () => {
|
||||||
return { name: '11' }
|
return { name: '11' }
|
||||||
}
|
}
|
||||||
},
|
|
||||||
curMode:{
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
conversation_id: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: ''
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -86,36 +77,13 @@ const send = () => {
|
||||||
}
|
}
|
||||||
const curNode = reactive({})
|
const curNode = reactive({})
|
||||||
|
|
||||||
const params = reactive(
|
// 获取会话ID
|
||||||
{
|
|
||||||
prompt: '',
|
|
||||||
dataset_id: '',
|
|
||||||
template: ''
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// 大模型对话
|
|
||||||
const getConversation = async (val) => {
|
const getConversation = async (val) => {
|
||||||
try {
|
try {
|
||||||
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}课标,对${curNode.itemtitle}进行教学分析`
|
const { data } = await completion({
|
||||||
params.template = props.item.prompt
|
dataset_id: 'cee3062a9fcf11efa6910242ac140006',
|
||||||
|
prompt: val
|
||||||
let data = null;
|
})
|
||||||
// 教学大模型
|
|
||||||
if(props.curMode == 1){
|
|
||||||
const res = await sendChart({
|
|
||||||
content: params.prompt,
|
|
||||||
conversationId: props.conversation_id,
|
|
||||||
stream: false
|
|
||||||
})
|
|
||||||
data = res.data
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// 知识库模型
|
|
||||||
const res = await completion(params)
|
|
||||||
data = res.data
|
|
||||||
}
|
|
||||||
|
|
||||||
msgList.value.push({
|
msgList.value.push({
|
||||||
type: 'robot',
|
type: 'robot',
|
||||||
msg: data.answer,
|
msg: data.answer,
|
||||||
|
@ -126,16 +94,15 @@ const getConversation = async (val) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveAdjust = (item) => {
|
const saveAdjust = (item) => {
|
||||||
|
// emit('saveAdjust', item.msg)
|
||||||
|
emitter.emit('changeAdjust', item.msg)
|
||||||
isDialog.value = false
|
isDialog.value = false
|
||||||
emitter.emit('onSaveAdjust', item.msg)
|
ElMessage.success('操作成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let data = sessionStore.get('subject.curNode')
|
let data = sessionStore.get('subject.curNode')
|
||||||
Object.assign(curNode, data);
|
Object.assign(curNode, data);
|
||||||
// 框架设计 用课标的dataset_id
|
|
||||||
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
|
|
||||||
params.dataset_id = dataSetJson[jsonKey]
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
<div class="container-right flex">
|
<div class="container-right flex">
|
||||||
<div class="right-header flex">
|
<div class="right-header flex">
|
||||||
<div class="header-left">
|
<div class="header-left">
|
||||||
<!-- <el-button type="primary" link>
|
<el-button type="primary" link>
|
||||||
<i class="iconfont icon-jiahao"></i>新活动
|
<i class="iconfont icon-jiahao"></i>新活动
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" link>
|
<el-button type="primary" link>
|
||||||
<i class="iconfont icon-baocun"></i>保存为教学模式
|
<i class="iconfont icon-baocun"></i>保存为教学模式
|
||||||
</el-button> -->
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<el-select v-model="curMode" placeholder="Select" class="mr-4 w-30">
|
<el-select v-model="curMode" placeholder="Select" class="mr-4 w-30">
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<EditDialog v-model="isEdit" :item="curItem" />
|
<EditDialog v-model="isEdit" :item="curItem" />
|
||||||
<AdjustDialog v-model="isAdjust" :item="curItem" :curMode="curMode" :conversation_id="conversation_id" />
|
<AdjustDialog v-model="isAdjust" :item="curItem" />
|
||||||
<PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog" />
|
<PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog" />
|
||||||
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
|
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
|
||||||
<!--添加、编辑提示词-->
|
<!--添加、编辑提示词-->
|
||||||
|
@ -393,7 +393,7 @@ const againResult = async (index, item) => {
|
||||||
|
|
||||||
let data = null;
|
let data = null;
|
||||||
// 教学大模型
|
// 教学大模型
|
||||||
if (curMode.value == 1) {
|
if (mode.value == 1) {
|
||||||
const res = await sendChart({
|
const res = await sendChart({
|
||||||
content: params.prompt,
|
content: params.prompt,
|
||||||
conversationId: conversation_id.value,
|
conversationId: conversation_id.value,
|
||||||
|
@ -421,21 +421,11 @@ const onAdjust = (index, item) => {
|
||||||
Object.assign(curItem, item)
|
Object.assign(curItem, item)
|
||||||
isAdjust.value = true
|
isAdjust.value = true
|
||||||
}
|
}
|
||||||
|
emitter.on('changeAdjust', (item) => {
|
||||||
// 替换分析结果
|
|
||||||
emitter.on('onSaveAdjust', (item) => {
|
|
||||||
resultList.value[curIndex.value].answer = item
|
resultList.value[curIndex.value].answer = item
|
||||||
onEditSave(resultList.value[curIndex.value])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 保存 重新研读后的结果
|
|
||||||
const onEditSave = async (item) => {
|
|
||||||
const { msg } = await editTempResult({ id: item.resultId, content: item.answer })
|
|
||||||
ElMessage.success(msg)
|
|
||||||
getChildTemplate()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const onEdit = (index, item) => {
|
const onEdit = (index, item) => {
|
||||||
curIndex.value = index
|
curIndex.value = index
|
||||||
|
@ -595,7 +585,7 @@ onMounted(() => {
|
||||||
let data = sessionStore.get('subject.curNode')
|
let data = sessionStore.get('subject.curNode')
|
||||||
Object.assign(curNode, data);
|
Object.assign(curNode, data);
|
||||||
courseObj.node = data
|
courseObj.node = data
|
||||||
// 框架设计 用课标的dataset_id
|
|
||||||
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
|
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
|
||||||
params.dataset_id = commUtils.dataSetJson[jsonKey]
|
params.dataset_id = commUtils.dataSetJson[jsonKey]
|
||||||
|
|
||||||
|
@ -615,7 +605,7 @@ onUnmounted(() => {
|
||||||
emitter.off('changeMode')
|
emitter.off('changeMode')
|
||||||
emitter.off('changeResult')
|
emitter.off('changeResult')
|
||||||
emitter.off('changeAdjust')
|
emitter.off('changeAdjust')
|
||||||
emitter.off('onSaveAdjust');
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -640,7 +630,7 @@ onUnmounted(() => {
|
||||||
background: #F6F6F6;
|
background: #F6F6F6;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-y: auto;
|
overflow-y: scroll;
|
||||||
|
|
||||||
.con-item {
|
.con-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
Loading…
Reference in New Issue