合并画布代码
This commit is contained in:
@@ -80,6 +80,7 @@ import { useStore } from "vuex";
|
||||
import { Modal,message,Upload,CascaderProps } from 'ant-design-vue';
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
@@ -88,6 +89,7 @@ export default defineComponent({
|
||||
emits:['chatChange'],
|
||||
setup(props,{emit}) {
|
||||
const store = useStore();
|
||||
const route = useRoute()
|
||||
const data = reactive({
|
||||
chatContent:'',
|
||||
openChat:true,
|
||||
@@ -107,6 +109,7 @@ export default defineComponent({
|
||||
watch(()=>data.selectObject.id,(newValue,oldValue)=>{
|
||||
if(newValue && (data.selectObject.httpType == 'SERIES_DESIGN' || data.selectObject.httpType == 'SINGLE_DESIGN')){
|
||||
data.chatList = []
|
||||
if(route.query?.create)return
|
||||
nextTick(()=>{
|
||||
getChatHistory(newValue)
|
||||
})
|
||||
@@ -146,7 +149,7 @@ export default defineComponent({
|
||||
// data.chatList[data.chatList.length-1].content.message+=JSON.parse(event.data).content
|
||||
// }
|
||||
const container = dataDom.chatBox;
|
||||
container.scrollTop = container.scrollHeight;
|
||||
if(container?.scrollHeight)container.scrollTop = container.scrollHeight;
|
||||
|
||||
const eventData = JSON.parse(event.data)
|
||||
if(eventData.type == 'text'){
|
||||
@@ -155,6 +158,11 @@ export default defineComponent({
|
||||
data.chatList[data.chatList.length-1].content.think+=eventData.content
|
||||
}else if(eventData.type == "tools_response"){
|
||||
let nameList = ['moodboard','printboard','sketchboard','generate_color_code']
|
||||
let nameData = {
|
||||
moodboard:'moodBoard',
|
||||
printboard:'printBoard',
|
||||
sketchboard:'sketchBoard',
|
||||
} as any
|
||||
let getData = ''
|
||||
if(nameList.indexOf(eventData.tools_name) > -1){
|
||||
if(data.chatList[data.chatList.length - 1].content.message)data.chatList.push({content:{message:''},role:'system'})
|
||||
@@ -163,16 +171,14 @@ export default defineComponent({
|
||||
getData = 'colorboard'
|
||||
}else{
|
||||
data.chatList[data.chatList.length-1].content.img = JSON.parse(JSON.parse(event.data).content).receiveCollectionElementList
|
||||
getData = eventData.tools_name
|
||||
getData = nameData[eventData.tools_name]
|
||||
}
|
||||
data.chatList.push({content:{message:''},role:'system'})
|
||||
}else{
|
||||
|
||||
}else if(eventData.tools_name == 'design_control_signal'){
|
||||
emit('chatChange',{type:eventData.tools_name,design:true})
|
||||
}
|
||||
emit('chatChange',{type:eventData.type,module:getData})
|
||||
|
||||
}else if(eventData.type == "design_control_signal"){
|
||||
emit('chatChange',{type:eventData.type,design:true})
|
||||
}
|
||||
//emit('chatChange',{type:JSON.parse(event.data).status})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user