Compare commits

..

No commits in common. "cebf864b828e4a571541bd204eab7b35a40cbe5b" and "0b6039f9d845bae2609734a4fbb0797884d6d188" have entirely different histories.

4 changed files with 21 additions and 91 deletions

View File

@ -59,7 +59,6 @@ import { completion, docList } from '@/api/mode/index'
import { sessionStore } from '@/utils/store'
import { dataSetJson } from '@/utils/comm.js'
import useUserStore from '@/store/modules/user'
import { sendChart } from '@/api/ai/index'
import emitter from '@/utils/mitt';
const userInfo = useUserStore().user
@ -78,14 +77,6 @@ const props = defineProps({
type: {
type: Number,
default: 1
},
curMode:{
type: Number,
default: 1
},
conversation_id: {
type: [Number, String],
default: ''
}
})
@ -109,8 +100,7 @@ const curNode = reactive({})
const params = reactive(
{
prompt: '',
dataset_id: '',
template: ''
dataset_id: ''
}
)
@ -118,24 +108,7 @@ const params = reactive(
const getCompletion = async (val) => {
try {
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value}${curNode.itemtitle}进行教学分析`
params.template = props.item.prompt
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
}
const { data } = await completion(params)
let answer = data.answer
msgList.value.push({
type: 'robot',

View File

@ -81,7 +81,7 @@
<!--编辑结果-->
<EditDialog v-model="isEdit" :item="editItem" />
<!--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" />
</template>
@ -323,7 +323,7 @@ const againResult = async (index, item) => {
let data = null;
//
if (curMode.value == 1) {
if (mode.value == 1) {
const res = await sendChart({
content: params.prompt,
conversationId: conversation_id.value,

View File

@ -42,10 +42,9 @@
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { completion } from '@/api/mode/index'
import { dataSetJson } from '@/utils/comm.js'
import emitter from '@/utils/mitt';
import { sessionStore } from '@/utils/store'
import { sendChart } from '@/api/ai/index'
import { ElMessage } from 'element-plus'
const textarea = ref('')
@ -57,14 +56,6 @@ const props = defineProps({
default: () => {
return { name: '11' }
}
},
curMode:{
type: Number,
default: 1
},
conversation_id: {
type: [Number, String],
default: ''
}
})
@ -86,36 +77,13 @@ const send = () => {
}
const curNode = reactive({})
const params = reactive(
{
prompt: '',
dataset_id: '',
template: ''
}
)
//
// ID
const getConversation = async (val) => {
try {
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}课标,对${curNode.itemtitle}进行教学分析`
params.template = props.item.prompt
let data = null;
//
if(props.curMode == 1){
const res = await sendChart({
content: params.prompt,
conversationId: props.conversation_id,
stream: false
const { data } = await completion({
dataset_id: 'cee3062a9fcf11efa6910242ac140006',
prompt: val
})
data = res.data
}
else{
//
const res = await completion(params)
data = res.data
}
msgList.value.push({
type: 'robot',
msg: data.answer,
@ -126,16 +94,15 @@ const getConversation = async (val) => {
}
const saveAdjust = (item) => {
// emit('saveAdjust', item.msg)
emitter.emit('changeAdjust', item.msg)
isDialog.value = false
emitter.emit('onSaveAdjust', item.msg)
ElMessage.success('操作成功')
}
onMounted(() => {
let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data);
// dataset_id
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
params.dataset_id = dataSetJson[jsonKey]
})

View File

@ -2,12 +2,12 @@
<div class="container-right flex">
<div class="right-header flex">
<div class="header-left">
<!-- <el-button type="primary" link>
<el-button type="primary" link>
<i class="iconfont icon-jiahao"></i>新活动
</el-button>
<el-button type="primary" link>
<i class="iconfont icon-baocun"></i>保存为教学模式
</el-button> -->
</el-button>
</div>
<div class="header-right">
<el-select v-model="curMode" placeholder="Select" class="mr-4 w-30">
@ -62,7 +62,7 @@
</div>
</div>
<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" />
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
<!--添加编辑提示词-->
@ -393,7 +393,7 @@ const againResult = async (index, item) => {
let data = null;
//
if (curMode.value == 1) {
if (mode.value == 1) {
const res = await sendChart({
content: params.prompt,
conversationId: conversation_id.value,
@ -421,21 +421,11 @@ const onAdjust = (index, item) => {
Object.assign(curItem, item)
isAdjust.value = true
}
//
emitter.on('onSaveAdjust', (item) => {
emitter.on('changeAdjust', (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) => {
curIndex.value = index
@ -595,7 +585,7 @@ onMounted(() => {
let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data);
courseObj.node = data
// dataset_id
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
params.dataset_id = commUtils.dataSetJson[jsonKey]
@ -615,7 +605,7 @@ onUnmounted(() => {
emitter.off('changeMode')
emitter.off('changeResult')
emitter.off('changeAdjust')
emitter.off('onSaveAdjust');
})
@ -640,7 +630,7 @@ onUnmounted(() => {
background: #F6F6F6;
padding: 15px;
flex-direction: column;
overflow-y: auto;
overflow-y: scroll;
.con-item {
width: 100%;