From 5228bb30bb0f8ac4f45f9270d3d3e69977b9f08f Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期三, 27 十一月 2024 13:53:44 +0800
Subject: [PATCH] 地图剩余部分

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue |   68 +++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 18 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue
index 6f21cbb..9581ee6 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue
@@ -1,29 +1,47 @@
 <template>
-	<el-dialog :destroy-on-close="true" v-model="isShow" draggable :close-on-click-modal="false" :title="chartValues?.title">
-		<RecordSet chartHeight="30rem" ref="recordSetRef" :data="chartValues">
-			<TimeRange class="flex-0 m-1" @change="timeRangeChange" />
+	<el-dialog
+		:destroy-on-close="true"
+		v-model="isShow"
+		draggable
+		:close-on-click-modal="false"
+		:title="chartValues?.title"
+		v-if="computedIsDialog"
+	>
+		<RecordSet :chartHeight="computedHeight" ref="recordSetRef" :data="chartValues">
+			<TimeRange ref="timeRangeRef" v-model="queryRange" class="flex-0 m-1" @change="timeRangeChange" />
 			<List class="flex-0 m-1" v-model="stepTime" :data="listData" @change="selectStepChange" />
 		</RecordSet>
 	</el-dialog>
+	<div v-else v-show="isShow">
+		<RecordSet :chartHeight="computedHeight" ref="recordSetRef" :data="chartValues">
+			<TimeRange ref="timeRangeRef" v-model="queryRange" class="flex-0 m-1" @change="timeRangeChange" />
+			<List class="flex-0 m-1" v-model="stepTime" :data="listData" @change="selectStepChange" />
+		</RecordSet>
+	</div>
 </template>
 
 <script setup lang="ts">
-import { ref, watch } from 'vue';
+import { computed, nextTick, ref, watch } from 'vue';
 import RecordSet from './RecordSet.vue';
+import List from './components/List.vue';
+import TimeRange from './components/TimeRange.vue';
 import { queryScadaTimeValues } from '/@/api/ai/chat';
+import { formatDate } from '/@/utils/formatTime';
 import { useCompRef } from '/@/utils/types';
 import { getRecentDateRange } from '/@/utils/util';
-import { formatDate } from '/@/utils/formatTime';
-import TimeRange from './components/TimeRange.vue';
-import List from './components/List.vue';
 
-const props = defineProps(['otype', 'oname']);
+const props = defineProps(['otype', 'oname', 'indexName', 'isDialog', 'height']);
+// SDVAL_FULL_FLOW true 25 DEV_FLOW_W
+
+const computedIsDialog = computed(() => props.isDialog ?? true);
+const computedHeight = computed(() => props.height ?? '30rem');
 
 const isShow = defineModel({
 	type: Boolean,
 });
 
 const recordSetRef = useCompRef(RecordSet);
+const timeRangeRef = useCompRef(TimeRange);
 
 const listData = {
 	list: [
@@ -40,25 +58,37 @@
 
 const queryRange = ref<string[]>(null);
 const timeRangeChange = (val) => {
-	queryRange.value = val;
-	setChartData(queryRange.value);
+	setChartData();
 };
 
 const selectStepChange = (val) => {
-	setChartData(queryRange.value);
+	setChartData();
 };
 const stepTime = ref('5 minutes');
 const chartValues = ref(null);
-const setChartData = async (timeRange: string[]) => {
+const setChartData = async () => {
 	const res = await queryScadaTimeValues({
-		otype: props.otype,
-		oname: props.oname,
-		start_time: timeRange[0],
-		end_time: timeRange[1],
+		// 璁惧绫诲瀷
+		ptype: props.otype,
+		// 璁惧鍚嶇О
+		pname: props.oname,
+		otype: props.indexName,
+		start_time: timeRangeRef.value.formatDateValue[0],
+		end_time: timeRangeRef.value.formatDateValue[1],
 		step_time: stepTime.value,
 	});
 	chartValues.value = res.values;
-	recordSetRef.value.drawChart();
+	chartValues.value.chart = 'single_line';
+	nextTick(() => {
+		setTimeout(() => {
+			if (recordSetRef.value.isMultiCompare) {
+				recordSetRef.value.handleData();
+				recordSetRef.value.handleMultiCompare();
+			} else {
+				recordSetRef.value.drawChart();
+			}
+		}, 0);
+	});
 };
 
 watch(
@@ -68,7 +98,9 @@
 			return;
 		}
 		queryRange.value = getRecentDateRange(1).map((item) => formatDate(item));
-		setChartData(queryRange.value);
+		nextTick(() => {
+			setChartData();
+		});
 	}
 );
 </script>

--
Gitblit v1.9.3