From 2112e8a24871f74421d04359b8b008f29fbdb6a2 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 06 八月 2024 15:59:50 +0800
Subject: [PATCH] fix: 新增存销比页面

---
 src/views/project/ch/demo/CreditRateRank.html |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/views/project/ch/demo/CreditRateRank.html b/src/views/project/ch/demo/CreditRateRank.html
index 59be82b..475073e 100644
--- a/src/views/project/ch/demo/CreditRateRank.html
+++ b/src/views/project/ch/demo/CreditRateRank.html
@@ -8,6 +8,7 @@
 		<script src="/customer_list/ch/ai_html/views/demo/js/vue.global.js"></script>
 		<script src="/customer_list/ch/ai_html/views/demo/js/iframe-resizer/child-5.1.5.js" async></script>
 		<script src="/customer_list/ch/ai_html/views/demo/js/index.full.js"></script>
+		<script src="/customer_list/ch/ai_html/views/demo/js/customInstruction.js"></script>
 		<link href="/customer_list/ch/static/fonts/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
 		<link href="/customer_list/ch/ai_html/views/demo/css/ele-index.css" rel="stylesheet" type="text/css" />
 		<script src="/customer_list/ch/ai_html/views/demo/js/echarts.min.js"></script>
@@ -40,8 +41,8 @@
 	</head>
 
 	<body>
-		<div class="w-[50%] h-full bg-[#f2f4f8]" id="creditRateRank">
-			<div class="mx-[5px] my-[5px] space-y-1 bg-[rgb(242,244,248)]">
+		<div class="w-full h-full bg-[#f2f4f8] px-[5px] py-[5px]" id="creditRateRank">
+			<div class="space-y-1 bg-[rgb(242,244,248)]">
 				<div class="bg-white">
 					<div class="item_title">
 						<div class="leader_left"></div>
@@ -57,7 +58,7 @@
 						</div>
 					</div>
 				</div>
-				<div class="w-full h-full bg-white">
+				<div class="w-full h-full bg-white" v-resize="chartContainerResize">
 					<div class="item_title">
 						<div class="leader_left"></div>
 						<span>鐢ㄦ埛璇勫垎鍒嗗竷</span>
@@ -65,7 +66,7 @@
 					</div>
 					<div class="w-full h-[250px] mt-[10px]" id="CreditRateRank"></div>
 				</div>
-				<div class="w-full bg-white h-[320px]" id="CreditRatePieRank"></div>
+				<div class="w-full bg-white h-[320px]" id="CreditRatePieRank" v-resize="chartContainerResize"></div>
 			</div>
 		</div>
 	</body>
@@ -131,7 +132,7 @@
 							text: '鎬昏瘎鍒嗘暟',
 							subtext: '789897' + '\n浜�',
 							itemGap: 8,
-							left: '29%',
+							left: '29.5%',
 							top: '40%',
 							textAlign: 'center',
 							textStyle: {
@@ -204,6 +205,9 @@
 					var creditRatePieRankDom = echarts.init(chartDom);
 					creditRatePieRankRef.value = creditRatePieRankDom;
 					var option = {
+						tooltip: {
+							trigger: 'axis',
+						},
 						xAxis: {
 							type: 'category',
 							data: barXData,
@@ -228,20 +232,21 @@
 					};
 					option && creditRatePieRankDom.setOption(option);
 				};
+				const chartContainerResize = ({ width, height }) => {
+					creditRateRankRef.value.resize();
+					creditRatePieRankRef.value.resize();
+				};
 				onMounted(() => {
-					window.addEventListener('resize', () => {
-						creditRateRankRef.value.resize();
-						creditRatePieRankRef.value.resize();
-					});
 					// 椤甸潰鍔犺浇瀹屾垚鍚庡垵濮嬪寲鍥捐〃
 					initCreditRateRankChart();
 					initCreditRateRankBarChart();
 				});
 
-				return { state };
+				return { state, chartContainerResize };
 			},
 		});
 		App.use(ElementPlus);
+		elementResizeDirective(App);
 		App.mount('#creditRateRank');
 	</script>
 </html>

--
Gitblit v1.9.3