From 36cd40672b4717e2085d679fbb70cbdc23781754 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期一, 21 十月 2024 17:29:51 +0800
Subject: [PATCH] flex-auto': chartHeight == undefined

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
index f45bbc5..02814b4 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
@@ -1,7 +1,7 @@
 <!-- 鏄ㄦ棩渚涙按绠$綉姒傚喌 -->
 <template>
-	<div class="w-full">
-		<div class="flex mb-4 flex-wrap">
+	<div class="w-full flex-column">
+		<div class="flex mb-4 flex-wrap flex-0">
 			<!-- TimeRange v-model 璺� @change 涓殑鍊间細涓嶄竴鏍凤紝浠change 涓负鍑� -->
 			<template v-if="visibleParams && visibleParams.length > 0">
 				<component
@@ -34,8 +34,20 @@
 			<DisplayMode class="ml-auto" v-model="showMode" @change="displayModeChange" />
 		</div>
 
-		<RecordSetTable :data="tableData" v-if="tableIsShow" :key="tableKey" />
-		<div v-show="!tableIsShow" :style="{ height: chartHeight }" v-resize="chartContainerResize" v-loading="chartLoading">
+		<RecordSetTable
+			:data="tableData"
+			v-if="tableIsShow"
+			:key="tableKey"
+			:tableLimitHeight="tableLimitHeight"
+			:class="{ 'flex-auto': chartHeight == undefined }"
+		/>
+		<div
+			v-show="!tableIsShow"
+			:style="{ height: chartHeight }"
+			:class="{ 'flex-auto': chartHeight == undefined }"
+			v-resize="chartContainerResize"
+			v-loading="chartLoading"
+		>
 			<div ref="chartRef"></div>
 		</div>
 	</div>
@@ -85,12 +97,15 @@
 	},
 	chartHeight: {
 		type: String,
-		default: '20rem',
+		required: false,
 	},
 }) as {
 	data: any;
 	summaryIndex: number;
 };
+
+const tableLimitHeight = props.chartHeight == undefined ? undefined : document.body.clientHeight * 0.7;
+
 const chartLoading = ref(false);
 
 const stepOptions = [

--
Gitblit v1.9.3