|
@@ -47,7 +47,7 @@
|
|
|
<ScrollToBottom :target="scrollbar" ref="scrollToBottomRef" />
|
|
|
</div>
|
|
|
|
|
|
- <Tools :disHistory="sendLoading" :upload="type === FunctionList.File_Operation || !!formInfo" @read-click="readClick" @upload-file="(file) => createFileObj(file)" @handle-capture="handleCapture" @his-records="hisRecords"
|
|
|
+ <Tools v-if="selectModal" :disHistory="sendLoading" :upload="type === FunctionList.File_Operation || !!formInfo" @read-click="readClick" @upload-file="(file) => createFileObj(file)" @handle-capture="handleCapture" @his-records="hisRecords"
|
|
|
@add-new-dialogue="addNewDialogue" @handle-current-change="handleCurrentChange"
|
|
|
@handel-intelligent-filling-click="handelIntelligentFillingClick" />
|
|
|
|
|
@@ -114,7 +114,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, nextTick, inject, useTemplateRef, reactive } from 'vue'
|
|
|
+import { ref, onMounted, nextTick, inject, useTemplateRef, reactive,onBeforeMount } from 'vue'
|
|
|
import { ElScrollbar, ElAvatar, ElInput, ElButton } from 'element-plus'
|
|
|
import moment from 'moment'
|
|
|
import fileLogo from '@/assets/svg/file.svg'
|
|
@@ -162,7 +162,7 @@ const disSend = computed(() => {
|
|
|
})
|
|
|
// 获取父组件提供的 Hook 实例
|
|
|
const msgStore = useMsgStore()
|
|
|
-const { pageInfoList, messages, msgUuid, AIModel,page,hasNext,msgLoading } = storeToRefs(useMsgStore())
|
|
|
+const { pageInfoList, messages, msgUuid, AIModel,page,hasNext,msgLoading,selectModal } = storeToRefs(useMsgStore())
|
|
|
const formInfo = ref('')
|
|
|
const {
|
|
|
taklToHtml,
|
|
@@ -316,18 +316,12 @@ async function handelIntelligentFillingClick() {
|
|
|
}
|
|
|
|
|
|
function handleCurrentChange(e) {
|
|
|
- options.forEach((item) => {
|
|
|
- item.options.forEach((item2) => {
|
|
|
- if (item2.value === e) {
|
|
|
- msgStore.updateAIModel(item2)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- if (AIModel.value.file === true) {
|
|
|
- isShowPage.value = false
|
|
|
- taklToHtml.value = false
|
|
|
- pageInfoList.value = []
|
|
|
- }
|
|
|
+ msgStore.updateAIModel(e)
|
|
|
+ // if (AIModel.value.file === true) {
|
|
|
+ // isShowPage.value = false
|
|
|
+ // taklToHtml.value = false
|
|
|
+ // pageInfoList.value = []
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
async function handleCurrentData(e) {
|
|
@@ -493,12 +487,14 @@ async function createWS(msg) {
|
|
|
const websocketId= uuidv4()
|
|
|
const wsUrl = `${import.meta.env.VITE_API_WS_URL}/webSocket/clue/${websocketId}`;
|
|
|
const socket = new WebSocket(wsUrl);
|
|
|
+ console.log(selectModal.value);
|
|
|
+
|
|
|
askQues({
|
|
|
conversationId: msgUuid.value,
|
|
|
websocketId,
|
|
|
- modelName: '通义千问-Max',
|
|
|
+ modelName: selectModal.value.modelName,
|
|
|
question: type.value === FunctionList.File_Operation ? msg.rawContent : buildObjPrompt(xlsxData.value,formInfo.value),
|
|
|
- id: '699637194561691650',
|
|
|
+ id: selectModal.value.id,
|
|
|
redisKey:msg.redisKey
|
|
|
}).catch(res => {
|
|
|
obj.rawContent = '接口出错,请重试。'
|
|
@@ -684,9 +680,12 @@ async function getFileValue(file) {
|
|
|
}
|
|
|
let a = null
|
|
|
// 组件挂载时滚动到底部
|
|
|
-onMounted(async () => {
|
|
|
- msgStore.updateAIModel(options[0].options[0])
|
|
|
+onBeforeMount(async () => {
|
|
|
await msgStore.initMsg()
|
|
|
+ await msgStore.initModal()
|
|
|
+})
|
|
|
+onMounted(async () => {
|
|
|
+ // msgStore.updateAIModel(options[0].options[0])
|
|
|
useAutoResizeTextarea(tareRef, inputMessage)
|
|
|
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
|
if (message.type === 'TO_SIDE_PANEL_PAGE_INFO') {
|