1
0
This commit is contained in:
lucashu 2025-08-20 22:08:55 +08:00
parent ad4d7388ad
commit cc9e0f01b4
3 changed files with 71 additions and 43 deletions

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,7 +1,7 @@
{ {
"source": [ "source": [
{ {
"name": "调漆作业室", "name": "危化品库",
"icon": "warehouse", "icon": "warehouse",
"metrics": [ "metrics": [
{ "label": "场景总数", "value": 262 }, { "label": "场景总数", "value": 262 },
@ -9,7 +9,7 @@
] ]
}, },
{ {
"name": "喷漆作业室", "name": "危废品库",
"icon": "warehouse", "icon": "warehouse",
"metrics": [ "metrics": [
{ "label": "智控场景", "value": 6852 }, { "label": "智控场景", "value": 6852 },

View File

@ -8,19 +8,29 @@
<a class="link" :style="{ color: option.linkColor }">{{ option.linkText }}</a> <a class="link" :style="{ color: option.linkColor }">{{ option.linkText }}</a>
</div> </div>
<div class="content"> <div class="content">
<div v-for="(scene, index) in option.dataset" :key="index" class="scene-row" :class="{ reverse: index % 2 !== 0 }"> <div
v-for="(scene, index) in option.dataset"
:key="index"
class="scene-row"
:class="{ reverse: index % 2 !== 0 }"
:style="{ backgroundImage: `url(${backgrounds[index]})` }"
>
<div class="scene-icon-container"> <div class="scene-icon-container">
<div class="yellow-dot"></div>
<svg-icon :icon-class="scene.icon" class="scene-icon"></svg-icon> <svg-icon :icon-class="scene.icon" class="scene-icon"></svg-icon>
</div> </div>
<div class="scene-name" :style="{ color: option.sceneNameColor, fontSize: option.sceneNameSize + 'px' }">{{ scene.name }}</div> <div class="scene-name" :style="{ color: option.sceneNameColor, fontSize: option.sceneNameSize + 'px' }">{{ scene.name }}</div>
<div class="metrics-container"> <div class="metrics-container">
<div v-for="(metric, mIndex) in scene.metrics" :key="mIndex" class="metric"> <template v-for="(metric, mIndex) in scene.metrics" :key="mIndex">
<div class="metric">
<div class="metric-label"> <div class="metric-label">
<span class="point" :style="{ backgroundColor: mIndex === 0 ? option.pointColor1 : option.pointColor2 }"></span> <span class="point" :style="{ backgroundColor: mIndex === 0 ? option.pointColor1 : option.pointColor2 }"></span>
<span :style="{ color: option.labelColor, fontSize: option.labelSize + 'px' }">{{ metric.label }}</span> <span :style="{ color: option.labelColor, fontSize: option.labelSize + 'px' }">{{ metric.label }}</span>
</div> </div>
<div class="metric-value" :style="{ color: option.valueColor, fontSize: option.valueSize + 'px' }">{{ metric.value }}</div> <div class="metric-value" :style="{ color: option.valueColor, fontSize: option.valueSize + 'px' }">{{ metric.value }}</div>
</div> </div>
<div class="separator" v-if="mIndex < scene.metrics.length - 1"></div>
</template>
</div> </div>
</div> </div>
</div> </div>
@ -30,6 +40,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { PropType, computed } from 'vue' import { PropType, computed } from 'vue'
import { option as configOption } from './config' import { option as configOption } from './config'
import bg1 from '/6.png'
import bg2 from '/04.png'
const backgrounds = [bg1, bg2]
const props = defineProps({ const props = defineProps({
chartConfig: { chartConfig: {
@ -86,35 +100,29 @@ const option = computed(() => props.chartConfig.option)
.scene-row { .scene-row {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: rgba(26, 56, 90, 0.5); padding: 0 30px;
border-radius: 50px;
padding: 10px 20px;
margin: 10px 0; margin: 10px 0;
height: 90px;
background-size: 100% 100%;
background-repeat: no-repeat;
&.reverse { &.reverse {
flex-direction: row-reverse; flex-direction: row-reverse;
.scene-icon-container {
margin-right: 0;
margin-left: 15px;
}
.scene-name { .scene-name {
margin-right: 0; margin-right: 0;
margin-left: auto; margin-left: 20px;
} }
.metrics-container { .metrics-container {
flex-direction: row-reverse; margin-right: auto;
.metric {
margin-left: 0; margin-left: 0;
margin-right: 20px;
}
} }
} }
} }
.scene-icon-container { .scene-icon-container {
position: relative;
width: 60px; width: 60px;
height: 60px; height: 60px;
border-radius: 50%; border-radius: 50%;
@ -122,7 +130,16 @@ const option = computed(() => props.chartConfig.option)
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 15px;
.yellow-dot {
position: absolute;
top: 5px;
right: 5px;
width: 10px;
height: 10px;
background-color: #FFD700;
border-radius: 50%;
}
.scene-icon { .scene-icon {
font-size: 32px; font-size: 32px;
@ -132,16 +149,27 @@ const option = computed(() => props.chartConfig.option)
.scene-name { .scene-name {
font-weight: bold; font-weight: bold;
margin-right: auto; margin-left: 20px;
} }
.metrics-container { .metrics-container {
display: flex; display: flex;
align-items: center;
margin-left: auto;
.separator {
width: 1px;
height: 40px;
background-color: #00E5FF;
margin: 0 20px;
}
}
.metric { .metric {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: flex-start;
margin-left: 20px;
.metric-label { .metric-label {
display: flex; display: flex;
align-items: center; align-items: center;
@ -150,12 +178,12 @@ const option = computed(() => props.chartConfig.option)
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
margin-right: 5px; margin-right: 8px;
} }
} }
.metric-value { .metric-value {
font-weight: bold; font-weight: bold;
} margin-left: 16px;
} }
} }
} }