s
This commit is contained in:
parent
1045234b98
commit
e7edf1db32
@ -0,0 +1,26 @@
|
||||
import { PublicConfigClass } from '@/packages/public'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { ParkingSceneConfig } from './index'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const option = {
|
||||
dataset: dataJson.source,
|
||||
title: '场景分布概况',
|
||||
titleColor: '#ffffff',
|
||||
titleSize: 20,
|
||||
linkColor: '#00E5FF',
|
||||
linkText: '查看更多>>',
|
||||
sceneNameColor: '#ffffff',
|
||||
sceneNameSize: 16,
|
||||
labelColor: '#B0E0E6',
|
||||
labelSize: 14,
|
||||
valueColor: '#00E5FF',
|
||||
valueSize: 20,
|
||||
borderColor: '#4A90E2'
|
||||
}
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key = ParkingSceneConfig.key
|
||||
public chartConfig = ParkingSceneConfig
|
||||
public option = option
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div class="go-parking-scene-config">
|
||||
<n-form-item label="标题">
|
||||
<n-input v-model:value="option.title" />
|
||||
</n-form-item>
|
||||
<n-form-item label="标题大小">
|
||||
<n-input-number v-model:value="option.titleSize" />
|
||||
</n-form-item>
|
||||
<n-form-item label="场景名称大小">
|
||||
<n-input-number v-model:value="option.sceneNameSize" />
|
||||
</n-form-item>
|
||||
<n-form-item label="标签大小">
|
||||
<n-input-number v-model:value="option.labelSize" />
|
||||
</n-form-item>
|
||||
<n-form-item label="数值大小">
|
||||
<n-input-number v-model:value="option.valueSize" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { option } from './config'
|
||||
|
||||
defineProps({
|
||||
option: {
|
||||
type: Object as PropType<typeof option>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
{
|
||||
"source": [
|
||||
{
|
||||
"name": "电动自行车停放区",
|
||||
"metrics": [
|
||||
{ "label": "场景总数", "value": 5, "icon": "folder" },
|
||||
{ "label": "智控场景", "value": 60, "icon": "server" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "电动汽车停车场",
|
||||
"metrics": [
|
||||
{ "label": "场景总数", "value": 5, "icon": "folder" },
|
||||
{ "label": "智控场景", "value": 60, "icon": "server" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "生产用电动车停放区",
|
||||
"metrics": [
|
||||
{ "label": "场景总数", "value": 5, "icon": "folder" },
|
||||
{ "label": "智控场景", "value": 60, "icon": "server" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
|
||||
export const ParkingSceneConfig: ConfigType = {
|
||||
key: 'ParkingScene',
|
||||
chartKey: 'VParkingScene',
|
||||
conKey: 'VCParkingScene',
|
||||
title: '停车场景',
|
||||
category: 'MyComponents',
|
||||
categoryName: '自定义组件',
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.COMMON,
|
||||
image: 'parking_scene.png'
|
||||
}
|
||||
export default ParkingSceneConfig
|
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div class="go-parking-scene">
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="rocket" class="title-icon"></svg-icon>
|
||||
<span :style="{ color: option.titleColor, fontSize: option.titleSize + 'px' }">{{ option.title }}</span>
|
||||
</div>
|
||||
<a class="link" :style="{ color: option.linkColor }">{{ option.linkText }}</a>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div v-for="(scene, index) in option.dataset" :key="index" class="scene-item">
|
||||
<div class="scene-header">
|
||||
<span class="dots">···</span>
|
||||
<span class="scene-name" :style="{ color: option.sceneNameColor, fontSize: option.sceneNameSize + 'px' }">{{ scene.name }}</span>
|
||||
</div>
|
||||
<div class="metrics-wrapper">
|
||||
<div v-for="(metric, mIndex) in scene.metrics" :key="mIndex" class="metric-box" :style="{ borderColor: option.borderColor }">
|
||||
<div class="metric-icon-container">
|
||||
<svg-icon :icon-class="metric.icon" class="metric-icon"></svg-icon>
|
||||
</div>
|
||||
<div class="metric-details">
|
||||
<span class="metric-label" :style="{ color: option.labelColor, fontSize: option.labelSize + 'px' }">{{ metric.label }}</span>
|
||||
<span class="metric-value" :style="{ color: option.valueColor, fontSize: option.valueSize + 'px' }">{{ metric.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, computed } from 'vue'
|
||||
import { option as configOption } from './config'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<{ option: typeof configOption }>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const option = computed(() => props.chartConfig.option)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.go-parking-scene {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #0F1C3D;
|
||||
padding: 15px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #1A385A;
|
||||
padding: 5px 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.title-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 10px;
|
||||
color: #00E5FF;
|
||||
}
|
||||
}
|
||||
|
||||
.link {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.scene-item {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.scene-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.dots {
|
||||
color: #4A90E2;
|
||||
font-weight: bold;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.scene-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.metrics-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.metric-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: rgba(26, 56, 90, 0.5);
|
||||
border-bottom: 2px solid;
|
||||
padding: 10px;
|
||||
width: 48%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.metric-icon-container {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: rgba(255, 215, 0, 0.2);
|
||||
border: 1px solid #FFD700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 10px;
|
||||
|
||||
.metric-icon {
|
||||
font-size: 24px;
|
||||
color: #FFD700;
|
||||
}
|
||||
}
|
||||
|
||||
.metric-details {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
.metric-value {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -5,7 +5,8 @@ import { SmartCampusMetricsConfig } from './SmartCampusMetrics/index'
|
||||
import { SceneDistributionConfig } from './SceneDistribution/index'
|
||||
import { TopAlarmsConfig } from './TopAlarms/index'
|
||||
import { AlarmTrendConfig } from './AlarmTrend'
|
||||
import { DetailedSceneConfig } from './DetailedScene'
|
||||
import { DetailedSceneConfig } from './DetailedScene/index'
|
||||
import { ParkingSceneConfig } from './ParkingScene'
|
||||
|
||||
export default [
|
||||
Componet1,
|
||||
@ -15,5 +16,6 @@ export default [
|
||||
SceneDistributionConfig,
|
||||
TopAlarmsConfig,
|
||||
AlarmTrendConfig,
|
||||
DetailedSceneConfig
|
||||
DetailedSceneConfig,
|
||||
ParkingSceneConfig
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user