From 4c20089472b20319746649decbce3a11f16cb6a0 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期五, 07 二月 2025 18:43:24 +0800
Subject: [PATCH] 切换主题,自身设置颜色、大小

---
 src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue |   72 +++++++++++++++---------------------
 1 files changed, 30 insertions(+), 42 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue
index f63fb3f..23cd988 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue
@@ -5,7 +5,7 @@
 			<template v-if="visibleParams && visibleParams.length > 0 && showFilter">
 				<component
 					class="flex-0 m-2 first-of-type:ml-0"
-					:class="{ invisible: showMode2 === DisplayModeType2.Map }"
+					:class="{ hidden: isMap && showMode2 === DisplayModeType2.Map }"
 					v-model="visibleParams[index].value"
 					v-for="(item, index) in visibleParams as any"
 					:key="item.id"
@@ -61,8 +61,8 @@
 					class="w-full h-full"
 					highlightCurrentRow
 					:rowClassName="tableRowClassName"
-					cellClassName="text-sm"
-					headerCellClassName="text-sm"
+					cellClassName=""
+					headerCellClassName=""
 				>
 					<DefineColumns v-slot="{ cols }">
 						<template v-for="item in colList" :key="item.prop">
@@ -122,22 +122,8 @@
 		<div class="flex-auto" v-resize="debounceResizeChart" v-show="showMode === DisplayModeType.Chart">
 			<div ref="chartRef" style="height: 25rem"></div>
 		</div>
-		<div class="mt-5 relative" v-if="chartDlgIsShow && metricsList.length > 0">
-			<span
-				class="absolute right-[10px] top-[5px] ywifont ywicon-guanbi text-[#528abe] font-bold cursor-pointer"
-				style="z-index: 2"
-				@click="closeChartDlg"
-			></span>
-			<el-tabs>
-				<el-tab-pane lazy v-for="(item, index) in metricsList" :key="`${chartDlgKey}_${index}`" :label="item.title" :name="index">
-					<el-tabs v-model="activeTab" type="card">
-						<el-tab-pane lazy v-for="(item, index) in metricsList" :key="`${chartDlgKey}_${index}`" :label="item.title" :name="index"
-							><RecordSetDialog :modelValue="true" :isDialog="false" height="20rem" :metrics="item"
-						/></el-tab-pane>
-					</el-tabs>
-				</el-tab-pane>
-			</el-tabs>
-		</div>
+
+		<EquipCurve v-model:isShow="chartDlgIsShow" class="mt-5" :data="equipCurveMapRow" :quotaChartCol="data?.quota_chart?.col" />
 
 		<InfoDetail class="text-base" v-model="infoDetailIsShow" :item="detailMapRow" :colList="colList" />
 	</div>
@@ -148,6 +134,7 @@
 import * as echarts from 'echarts';
 import type { TableInstance } from 'element-plus';
 import { chunk, sortBy } from 'lodash-es';
+import EquipCurve from './components/EquipCurve.vue';
 import type { CSSProperties } from 'vue';
 import { computed, nextTick, onMounted, reactive, ref, shallowRef, watchEffect, type PropType } from 'vue';
 import { PATH_ICON } from '../../../common';
@@ -160,11 +147,11 @@
 import MapView from './map/Map.vue';
 import { curveQuery } from '/@/api/ai/chat';
 import ColFilter from '/@/components/table/colFilter/ColFilter.vue';
-import { TableCol } from '/@/components/table/colFilter/types';
+import type { TableCol } from '/@/components/table/colFilter/types';
 import { axisLabelFormatter } from '/@/utils/chart';
 import { LocalPlus } from '/@/utils/storage';
 import { debounce, getTextWidth, toPercent } from '/@/utils/util';
-import RecordSetDialog from '../recordSet/RecordSetDialog.vue';
+import { isSharePage } from '/@/stores/chatRoom';
 
 const props = defineProps({
 	data: {
@@ -188,6 +175,13 @@
 		type: Boolean,
 		default: false,
 	},
+	reportIndex: {
+		type: Number,
+		default: 0,
+	},
+	historyId: {
+		type: String,
+	},
 });
 
 const [DefineColumns, ReuseColumns] = createReusableTemplate<{
@@ -207,10 +201,13 @@
 
 const isTotalTable = computed(() => checkIsTotalTable(props.data));
 
+const checkHasAddRateCol = (current) => {
+	return current.find((item) => item.title === '姣斾緥' && item.type === 'text');
+};
 const getTableCols = (propsData) => {
 	const current = propsData?.cols ?? [];
 
-	if (checkIsTotalTable(propsData)) {
+	if (checkIsTotalTable(propsData) && !checkHasAddRateCol(current)) {
 		current.push({
 			title: '姣斾緥',
 			type: 'text',
@@ -231,7 +228,8 @@
 const getTableValues = (propsData) => {
 	const agg_count_col = propsData?.agg_count_col;
 	const current = (propsData?.values ?? []) as Array<any[]>;
-	if (checkIsTotalTable(propsData)) {
+
+	if (checkIsTotalTable(propsData)&& !current.find(item=>item[0]==='鍚堣') ) {
 		const last = current[current.length - 1];
 		const lastItemIndex = last?.length > 0 ? last.length - 1 : 0;
 		valueColIndex = agg_count_col ?? lastItemIndex;
@@ -544,7 +542,7 @@
 		borderColor: BORDER_COLOR,
 		borderWidth: `${THICK_BORDER_WIDTH}px`,
 		color: '#7331a5',
-		fontSize: '0.875rem',
+		// fontSize: '0.875rem',
 		...extraStyle,
 	};
 };
@@ -563,7 +561,7 @@
 		borderWidth: `${THICK_BORDER_WIDTH}px`,
 		backgroundColor: COL_HEADER_CELL_BG_COLOR,
 		fontWeight: 700,
-		fontSize: '0.875rem',
+		// fontSize: '0.875rem',
 		color: '#000',
 		...extraStyle,
 	};
@@ -694,7 +692,7 @@
 const queryLoading = ref(false);
 let orderDimName = '';
 const queryUpdate = async (val?: any, item?: any) => {
-	const historyId = (props as any).originData.historyId;
+	const historyId = props.historyId;
 	let res = null;
 
 	if (item) {
@@ -717,6 +715,7 @@
 			agent_key: props.data.agent_key,
 			filter_json: JSON.stringify(filterList),
 			order_dim_name: orderDimName,
+			result_group_index: props.reportIndex,
 		};
 		res = await curveQuery(params);
 		queryLoading.value = true;
@@ -1158,30 +1157,19 @@
 };
 
 const chartDlgIsShow = ref(false);
-const chartDlgKey = ref('');
-const activeTab = ref(0);
-const metricsList = ref([]);
-const resetTab = () => {
-	activeTab.value = 0;
-};
+const equipCurveMapRow = ref(null);
 const showCurve = (row) => {
-	resetTab();
+	if (isSharePage.value) return;
+	if (!row) return;
+	equipCurveMapRow.value = row;
 	chartDlgIsShow.value = true;
-	const quotaChartCol = props.data?.quota_chart?.col;
-	if (!quotaChartCol) {
-		chartDlgKey.value = '';
-		metricsList.value = [];
-	} else {
-		const str = row[quotaChartCol] ?? '[]';
-		chartDlgKey.value = str;
-		metricsList.value = JSON.parse(str);
-	}
 };
 const closeInfoWindow = () => {
 	closeChartDlg();
 };
 const closeChartDlg = () => {
 	chartDlgIsShow.value = false;
+	equipCurveMapRow.value = null;
 };
 
 const tableRowClick = (row) => {

--
Gitblit v1.9.3