From 87e19b5a396ac8fed6a551828b87d263f6425c31 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 16 十月 2025 10:26:12 +0800
Subject: [PATCH] 2025.10.16 修改季度报告生成逻辑
---
src/components/monitor/FactorLegend.vue | 116 ++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 76 insertions(+), 40 deletions(-)
diff --git a/src/components/monitor/FactorLegend.vue b/src/components/monitor/FactorLegend.vue
index bcd447d..caba203 100644
--- a/src/components/monitor/FactorLegend.vue
+++ b/src/components/monitor/FactorLegend.vue
@@ -1,44 +1,66 @@
<template>
- <BaseCard>
+ <transition
+ name="el-zoom-in-left"
+ @before-enter="onBeforeEnter"
+ @after-leave="onAfterLeave"
+ >
+ <BaseCard v-show="show">
+ <template #content>
+ <el-row justify="space-between" align="middle">
+ <el-row align="middle">
+ <img src="@/assets/mipmap/data_chart.png" class="ff-img m-r-4" />
+ <span>璧拌埅鍥句緥</span>
+ <span v-if="factor.factorName">锛坽{ factor.factorName }}锛�</span>
+ </el-row>
+ <span @click="show = !show" class="btn-show">
+ <el-icon v-if="show"><ArrowLeftBold /></el-icon>
+ <el-icon v-else><ArrowRightBold /></el-icon>
+ </span>
+ </el-row>
+ <div
+ v-for="(item, index) in legends"
+ :key="index"
+ class="flexbox align-items margin-top"
+ >
+ <div
+ class="rectangle"
+ :style="'background-color: ' + item.color"
+ ></div>
+ <el-row v-if="item.max">
+ <span class="w-40 text-right">{{ item.min }}</span>
+ <span class="w-20 text-center">~</span>
+ <span class="w-40 text-right">{{ item.max }}</span>
+ <span class="w-60 m-l-8">{{ item.unit }}</span>
+ </el-row>
+ <el-row v-else>
+ <span class="w-40 text-right"></span>
+ <span class="w-20 text-center">></span>
+ <span class="w-40 text-right">{{ item.min }}</span>
+ <span class="w-60 m-l-8">{{ item.unit }}</span>
+ </el-row>
+ </div>
+ <div>
+ 鍒囨崲缁樺浘妯″紡锛�
+ <el-switch
+ v-model="legendType"
+ width="60"
+ inline-prompt
+ style=""
+ active-text="鍔ㄦ��"
+ inactive-text="鏍囧噯"
+ @change="handleChange"
+ />
+ </div>
+ </template>
+ </BaseCard>
+ </transition>
+ <BaseCard v-show="btnShow">
<template #content>
- <el-row justify="space-between" align="middle">
- <el-row align="middle">
- <img src="@/assets/mipmap/data_chart.png" class="ff-img m-r-4" />
- <span>璧拌埅鍥句緥</span>
- </el-row>
- <span>{{ factor.factorName }}</span>
- </el-row>
- <div
- v-for="(item, index) in legends"
- :key="index"
- class="flexbox align-items margin-top"
- >
- <div class="rectangle" :style="'background-color: ' + item.color"></div>
- <el-row v-if="item.max">
- <span class="w-40 text-right">{{ item.min }}</span>
- <span class="w-20 text-center">~</span>
- <span class="w-40 text-right">{{ item.max }}</span>
- <span class="w-60 m-l-8">{{ item.unit }}</span>
- </el-row>
- <el-row v-else>
- <span class="w-40 text-right"></span>
- <span class="w-20 text-center">></span>
- <span class="w-40 text-right">{{ item.min }}</span>
- <span class="w-60 m-l-8">{{ item.unit }}</span>
- </el-row>
- </div>
- <div>
- 鍒囨崲缁樺浘妯″紡锛�
- <el-switch
- v-model="legendType"
- width="60"
- inline-prompt
- style=""
- active-text="鍔ㄦ��"
- inactive-text="鏍囧噯"
- @change="handleChange"
- />
- </div>
+ <span @click="show = !show" class="btn-show">
+ <img src="@/assets/mipmap/data_chart.png" class="ff-img m-r-4" />
+ <el-icon v-if="show"><ArrowLeftBold /></el-icon>
+ <el-icon v-else><ArrowRightBold /></el-icon>
+ </span>
</template>
</BaseCard>
</template>
@@ -60,7 +82,9 @@
return {
// 缁樺浘妯″紡锛宖alse: 鏍囧噯妯″紡锛泃rue锛氬姩鎬佹ā寮�
legendType: false,
- legends: []
+ legends: [],
+ show: true,
+ btnShow: false
};
},
watch: {
@@ -149,6 +173,12 @@
this.factor.max
);
});
+ },
+ onBeforeEnter() {
+ this.btnShow = false;
+ },
+ onAfterLeave() {
+ this.btnShow = true;
}
}
};
@@ -166,4 +196,10 @@
--el-switch-on-color: #1f9956;
--el-switch-off-color: #8b8b8b;
}
+.btn-show {
+ cursor: pointer;
+}
+.btn-show:hover {
+ color: #23dad1;
+}
</style>
--
Gitblit v1.9.3