| | |
| | | <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> |
| | |
| | | <ChatInput v-model="inputText" @sendClick="sendClick" @toggleHistory="toggleHistory" :showHistory="showHistory" /> |
| | | </div> |
| | | </div> |
| | | <Teleport to="body"> |
| | | <WorkOrderDlg v-model="optDlgIsShow" :item="optDlgMapRow" @insert="submitDlg" @cancelSubmit="cancelSubmit"></WorkOrderDlg> |
| | | </Teleport> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import userPic from '/static/images/role/user-200x206.png'; |
| | | import { useDrag } from '/@/hooks/useDrag'; |
| | | import { cloneDeep, defaults } from 'lodash-es'; |
| | | |
| | | import WorkOrderDlg from './WorkOrderDlg.vue'; |
| | | const props = defineProps<{ |
| | | olMap?: OLMap; |
| | | }>(); |
| | |
| | | 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); |
| | | |
| | |
| | | const result = last.role === 'assistant' ? last : null; |
| | | return result as ChatMessage<AssistantContent>; |
| | | }; |
| | | |
| | | //#region ====================== 添加工单 ====================== |
| | | const optDlgIsShow = ref(false); |
| | | const optDlgMapRow = ref(null); |
| | | |
| | | const openOptDlg = (row?: any) => { |
| | | optDlgMapRow.value = row; |
| | | optDlgIsShow.value = true; |
| | | }; |
| | | |
| | | const submit = () => {}; |
| | | //#endregion |
| | | |
| | | const mockCommand = (question: string) => { |
| | | if (question === `切换${gaoDeSourceTypeMap[GaoDeSourceType.Vector]}`) { |
| | |
| | | const startStream = (question: string) => { |
| | | if (lastIsInit) { |
| | | showHistory.value = false; |
| | | } |
| | | if (question === '松福大道DN800松岗联通监测设备没有数据,创建一个设备维修工单,请及时派人维修。') { |
| | | setTimeout(() => { |
| | | openOptDlg(); |
| | | }, 400); |
| | | return; |
| | | } |
| | | |
| | | // mockCommand(question); |
| | |
| | | |
| | | const handleMapCommand = (command: any) => { |
| | | if (!command) return; |
| | | // openOptDlg(); |
| | | switch (command.operate) { |
| | | case '放大': |
| | | props.olMap.zoomIn(); |
| | |
| | | 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; |
| | | case '隐藏设备': |
| | |
| | | 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 '聚焦设备': |