s
This commit is contained in:
parent
e7edf1db32
commit
218d6e1c30
@ -0,0 +1,27 @@
|
|||||||
|
import { PublicConfigClass } from '@/packages/public'
|
||||||
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
|
import { WorkshopSceneConfig } from './index'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
|
export const option = {
|
||||||
|
dataset: dataJson.source,
|
||||||
|
title: '场景分布概况',
|
||||||
|
titleColor: '#ffffff',
|
||||||
|
titleSize: 20,
|
||||||
|
linkColor: '#00E5FF',
|
||||||
|
linkText: '查看更多>>',
|
||||||
|
sceneNameColor: '#ffffff',
|
||||||
|
sceneNameSize: 18,
|
||||||
|
labelColor: '#B0E0E6',
|
||||||
|
labelSize: 14,
|
||||||
|
valueColor: '#ffffff',
|
||||||
|
valueSize: 24,
|
||||||
|
pointColor1: '#00E5FF',
|
||||||
|
pointColor2: '#FFD700'
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||||
|
public key = WorkshopSceneConfig.key
|
||||||
|
public chartConfig = WorkshopSceneConfig
|
||||||
|
public option = option
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div class="go-workshop-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,20 @@
|
|||||||
|
{
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"name": "调漆作业室",
|
||||||
|
"icon": "warehouse",
|
||||||
|
"metrics": [
|
||||||
|
{ "label": "场景总数", "value": 262 },
|
||||||
|
{ "label": "智控场景", "value": 6852 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "喷漆作业室",
|
||||||
|
"icon": "warehouse",
|
||||||
|
"metrics": [
|
||||||
|
{ "label": "智控场景", "value": 6852 },
|
||||||
|
{ "label": "场景总数", "value": 262 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||||
|
|
||||||
|
export const WorkshopSceneConfig: ConfigType = {
|
||||||
|
key: 'WorkshopScene',
|
||||||
|
chartKey: 'VWorkshopScene',
|
||||||
|
conKey: 'VCWorkshopScene',
|
||||||
|
title: '作业室场景',
|
||||||
|
category: 'MyComponents',
|
||||||
|
categoryName: '自定义组件',
|
||||||
|
package: PackagesCategoryEnum.CHARTS,
|
||||||
|
chartFrame: ChartFrameEnum.COMMON,
|
||||||
|
image: 'workshop_scene.png'
|
||||||
|
}
|
||||||
|
export default WorkshopSceneConfig
|
@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<div class="go-workshop-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-row" :class="{ reverse: index % 2 !== 0 }">
|
||||||
|
<div class="scene-icon-container">
|
||||||
|
<svg-icon :icon-class="scene.icon" class="scene-icon"></svg-icon>
|
||||||
|
</div>
|
||||||
|
<div class="scene-name" :style="{ color: option.sceneNameColor, fontSize: option.sceneNameSize + 'px' }">{{ scene.name }}</div>
|
||||||
|
<div class="metrics-container">
|
||||||
|
<div v-for="(metric, mIndex) in scene.metrics" :key="mIndex" class="metric">
|
||||||
|
<div class="metric-label">
|
||||||
|
<span class="point" :style="{ backgroundColor: mIndex === 0 ? option.pointColor1 : option.pointColor2 }"></span>
|
||||||
|
<span :style="{ color: option.labelColor, fontSize: option.labelSize + 'px' }">{{ metric.label }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="metric-value" :style="{ color: option.valueColor, fontSize: option.valueSize + 'px' }">{{ metric.value }}</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-workshop-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-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(26, 56, 90, 0.5);
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
margin: 10px 0;
|
||||||
|
|
||||||
|
&.reverse {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
|
.scene-icon-container {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scene-name {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-container {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
.metric {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scene-icon-container {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: radial-gradient(circle, #00E5FF 0%, rgba(15, 28, 61, 0) 70%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 15px;
|
||||||
|
|
||||||
|
.scene-icon {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scene-name {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-container {
|
||||||
|
display: flex;
|
||||||
|
.metric {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 20px;
|
||||||
|
.metric-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
.point {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.metric-value {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -6,7 +6,8 @@ import { SceneDistributionConfig } from './SceneDistribution/index'
|
|||||||
import { TopAlarmsConfig } from './TopAlarms/index'
|
import { TopAlarmsConfig } from './TopAlarms/index'
|
||||||
import { AlarmTrendConfig } from './AlarmTrend'
|
import { AlarmTrendConfig } from './AlarmTrend'
|
||||||
import { DetailedSceneConfig } from './DetailedScene/index'
|
import { DetailedSceneConfig } from './DetailedScene/index'
|
||||||
import { ParkingSceneConfig } from './ParkingScene'
|
import { ParkingSceneConfig } from './ParkingScene/index'
|
||||||
|
import { WorkshopSceneConfig } from './WorkshopScene'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
Componet1,
|
Componet1,
|
||||||
@ -17,5 +18,6 @@ export default [
|
|||||||
TopAlarmsConfig,
|
TopAlarmsConfig,
|
||||||
AlarmTrendConfig,
|
AlarmTrendConfig,
|
||||||
DetailedSceneConfig,
|
DetailedSceneConfig,
|
||||||
ParkingSceneConfig
|
ParkingSceneConfig,
|
||||||
|
WorkshopSceneConfig
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user