| | |
| | | <template v-else> |
| | | <span |
| | | v-if="(historyMessages[index+1].content as AssistantContent).isError" |
| | | class="flex items-center ml-4 text-danger before:content-['('] after:content-[')']" |
| | | class="flex items-center text-nowrap ml-4 text-danger before:content-['('] after:content-[')']" |
| | | > |
| | | {{ (historyMessages[index + 1].content as AssistantContent).value }} |
| | | <el-tooltip |
| | |
| | | </el-icon> |
| | | </el-tooltip> |
| | | </span> |
| | | <span v-else class="ml-4 text-success before:content-['('] after:content-[')']"> |
| | | <span v-else class="ml-4 text-success text-nowrap before:content-['('] after:content-[')']"> |
| | | {{ (historyMessages[index + 1].content as AssistantContent).value }} |
| | | </span> |
| | | </template> |
| | |
| | | </div> |
| | | </div> |
| | | <Teleport to="body"> |
| | | <WorkOrderDlg v-model="optDlgIsShow" :item="optDlgMapRow"></WorkOrderDlg> |
| | | |
| | | <WorkOrderDlg v-model="optDlgIsShow" :item="optDlgMapRow" @insert="submitDlg" @cancelSubmit="cancelSubmit"></WorkOrderDlg> |
| | | </Teleport> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | x: 200, |
| | | }, |
| | | }); |
| | | |
| | | const cancelSubmit = (reason) => { |
| | | refreshAssistantMessage({ reason: reason }); |
| | | }; |
| | | const submitDlg = () => { |
| | | refreshAssistantMessage({ value: `成功`, isError: false }); |
| | | }; |
| | | const historyMessages = ref<ChatMessage[]>([]); |
| | | const isInit = computed(() => historyMessages.value.length === 0); |
| | | const initQuestionList = ref([ |
| | |
| | | { title: '地图缩放', question: '放大' }, |
| | | { title: '设备显隐', question: '隐藏设备' }, |
| | | { title: '设备聚焦', question: '聚焦设备' }, |
| | | { title: '创建工单', question: '松福大道DN800松岗联通监测设备没有数据,创建一个设备维修工单,请及时派人维修。' }, |
| | | ]); |
| | | const chatContentRef = ref<HTMLDivElement>(null); |
| | | |
| | |
| | | optDlgIsShow.value = true; |
| | | }; |
| | | |
| | | |
| | | const submit = () => { |
| | | |
| | | }; |
| | | const submit = () => {}; |
| | | //#endregion |
| | | |
| | | const mockCommand = (question: string) => { |
| | |
| | | } |
| | | }; |
| | | |
| | | const handleCreateWorkOrder = (formData: any) => { |
| | | openOptDlg(formData ?? {}); |
| | | }; |
| | | |
| | | const startStream = (question: string) => { |
| | | if (lastIsInit) { |
| | | showHistory.value = false; |
| | | } |
| | | // if (question === '松福大道DN800松岗联通监测设备没有数据,创建一个设备维修工单,请及时派人维修。') { |
| | | // setTimeout(() => { |
| | | // openOptDlg(); |
| | | // }, 400); |
| | | // return; |
| | | // } |
| | | |
| | | // mockCommand(question); |
| | | // return; |
| | |
| | | if (chunkRes.type === 'string') { |
| | | const jsonData = JSON.parse(chunkRes.value); |
| | | handleMapCommand(jsonData); |
| | | } |
| | | } else if (chunkRes.mode === 'create_work_order') { |
| | | haveMapOperate = true; |
| | | if(chunkRes.type==='string'){ |
| | | const jsonData = JSON.parse(chunkRes.value); |
| | | handleCreateWorkOrder(jsonData) |
| | | } |
| | | } |
| | | if (chunkRes.mode === 'finish') { |
| | |
| | | if (equipOverlay) { |
| | | equipOverlay.isVisible = true; |
| | | // 强制触发更新 |
| | | props.olMap.layerInfo.value = props.olMap.layerInfo.value.concat([]) |
| | | props.olMap.layerInfo.value = props.olMap.layerInfo.value.concat([]); |
| | | // props.olMap.toggleMarkerOverlayVisible(true); |
| | | } |
| | | break; |
| | |
| | | if (equipOverlay1) { |
| | | equipOverlay1.isVisible = false; |
| | | // 强制触发更新 |
| | | props.olMap.layerInfo.value = props.olMap.layerInfo.value.concat([]) |
| | | props.olMap.layerInfo.value = props.olMap.layerInfo.value.concat([]); |
| | | // props.olMap.toggleMarkerOverlayVisible(false); |
| | | |
| | | } |
| | | break; |
| | | case '聚焦设备': |