From 8c6fbc506e9a2c8cde56a794d8319cc55f4be666 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 11 二月 2025 15:56:48 +0800
Subject: [PATCH] 修复问题

---
 src/components/chat/smallChat/index.vue |   42 +++++++++++++++++++++++++++++-------------
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/components/chat/smallChat/index.vue b/src/components/chat/smallChat/index.vue
index 969e0ae..6e1a57f 100644
--- a/src/components/chat/smallChat/index.vue
+++ b/src/components/chat/smallChat/index.vue
@@ -92,7 +92,7 @@
 									<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
@@ -105,7 +105,7 @@
 												</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>
@@ -138,10 +138,8 @@
 			</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>
 
@@ -182,7 +180,12 @@
 		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([
@@ -190,6 +193,7 @@
 	{ title: '鍦板浘缂╂斁', question: '鏀惧ぇ' },
 	{ title: '璁惧鏄鹃殣', question: '闅愯棌璁惧' },
 	{ title: '璁惧鑱氱劍', question: '鑱氱劍璁惧' },
+	{ title: '鍒涘缓宸ュ崟', question: '鏉剧澶ч亾DN800鏉惧矖鑱旈�氱洃娴嬭澶囨病鏈夋暟鎹紝鍒涘缓涓�涓澶囩淮淇伐鍗曪紝璇峰強鏃舵淳浜虹淮淇��' },
 ]);
 const chatContentRef = ref<HTMLDivElement>(null);
 
@@ -208,10 +212,7 @@
 	optDlgIsShow.value = true;
 };
 
-
-const submit = () => {
-	
-};
+const submit = () => {};
 //#endregion
 
 const mockCommand = (question: string) => {
@@ -236,10 +237,20 @@
 	}
 };
 
+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;
@@ -257,6 +268,12 @@
 				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') {
@@ -318,7 +335,7 @@
 			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;
@@ -327,9 +344,8 @@
 			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 '鑱氱劍璁惧':

--
Gitblit v1.9.3