1
This commit is contained in:
parent
0dc2ef85ce
commit
91ffc20537
@ -2,14 +2,39 @@ import { PublicConfigClass } from '@/packages/public'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { WorkshopSceneConfig } from './index'
|
||||
import dataJson from './data.json'
|
||||
export enum FontWeightEnum {
|
||||
NORMAL = '常规',
|
||||
BOLD = '加粗',
|
||||
}
|
||||
|
||||
export enum FontStyleEnum {
|
||||
NORMAL = '常规',
|
||||
ITALIC = '斜体',
|
||||
}
|
||||
|
||||
export const FontWeightObject = {
|
||||
[FontWeightEnum.NORMAL]: 'normal',
|
||||
[FontWeightEnum.BOLD]: 'bold',
|
||||
}
|
||||
|
||||
export const FontStyleObject = {
|
||||
[FontStyleEnum.NORMAL]: 'normal',
|
||||
[FontStyleEnum.ITALIC]: 'italic',
|
||||
}
|
||||
export const option = {
|
||||
dataset: dataJson.source,
|
||||
title: '场景分布概况',
|
||||
titleColor: '#ffffff',
|
||||
titleSize: 20,
|
||||
titleSize: 17,
|
||||
iconColor: '#00E5FF',
|
||||
fontWeight: 'normal',
|
||||
fontStyle: 'normal',
|
||||
paddingX: 40,
|
||||
paddingY: -19,
|
||||
letterSpacing: 2,
|
||||
isShowButton: false,
|
||||
linkColor: '#00E5FF',
|
||||
linkText: '查看更多>>',
|
||||
linkText: '',
|
||||
sceneNameColor: '#ffffff',
|
||||
sceneNameSize: 18,
|
||||
labelColor: '#B0E0E6',
|
||||
|
@ -1,31 +1,87 @@
|
||||
<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>
|
||||
<collapse-item name="信息" :expanded="true">
|
||||
<setting-item-box name="标题" :alone="true">
|
||||
<setting-item>
|
||||
<n-input v-model:value="optionData.title" type="textarea" size="small"></n-input>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
|
||||
<collapse-item name="样式" :expanded="true">
|
||||
<setting-item-box name="标题">
|
||||
<setting-item name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.titleColor"></n-color-picker>
|
||||
</setting-item>
|
||||
<setting-item name="字体大小">
|
||||
<n-input-number v-model:value="optionData.titleSize" size="small" placeholder="字体大小"></n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="字体粗细">
|
||||
<n-select v-model:value="optionData.fontWeight" size="small" :options="fontWeightOptions" />
|
||||
</setting-item>
|
||||
<setting-item name="字体风格">
|
||||
<n-select v-model:value="optionData.fontStyle" size="small" :options="fontStyleOptions" />
|
||||
</setting-item>
|
||||
<setting-item name="X轴内边距">
|
||||
<n-input-number v-model:value="optionData.paddingX" size="small" placeholder="输入内边距"></n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="Y轴内边距">
|
||||
<n-input-number v-model:value="optionData.paddingY" size="small" placeholder="输入内边距"></n-input-number>
|
||||
</setting-item>
|
||||
|
||||
|
||||
<setting-item name="字间距">
|
||||
<n-input-number v-model:value="optionData.letterSpacing" size="small" placeholder="输入字间距"></n-input-number>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
<collapse-item name="内容" :expanded="true">
|
||||
<setting-item-box name="场景">
|
||||
<setting-item name="名称大小">
|
||||
<n-input-number v-model:value="optionData.sceneNameSize" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="标签">
|
||||
<setting-item name="大小">
|
||||
<n-input-number v-model:value="optionData.labelSize" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="数值">
|
||||
<setting-item name="大小">
|
||||
<n-input-number v-model:value="optionData.valueSize" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { option } from './config'
|
||||
|
||||
defineProps({
|
||||
option: {
|
||||
import { option, FontWeightEnum, FontWeightObject, FontStyleEnum, FontStyleObject } from './config'
|
||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||
const props = defineProps({
|
||||
optionData: {
|
||||
type: Object as PropType<typeof option>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const fontWeightOptions = [
|
||||
{
|
||||
label: FontWeightEnum.NORMAL,
|
||||
value: FontWeightObject[FontWeightEnum.NORMAL]
|
||||
},
|
||||
{
|
||||
label: FontWeightEnum.BOLD,
|
||||
value: FontWeightObject[FontWeightEnum.BOLD]
|
||||
}
|
||||
]
|
||||
const fontStyleOptions = [
|
||||
{
|
||||
label: FontStyleEnum.NORMAL,
|
||||
value: FontStyleObject[FontStyleEnum.NORMAL]
|
||||
},
|
||||
{
|
||||
label: FontStyleEnum.ITALIC,
|
||||
value: FontStyleObject[FontStyleEnum.ITALIC]
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
@ -1,40 +1,50 @@
|
||||
<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 }"
|
||||
:style="{ backgroundImage: `url(${backgrounds[index]})` }"
|
||||
>
|
||||
<div class="scene-icon-container">
|
||||
<div class="yellow-dot"></div>
|
||||
<svg-icon :icon-class="scene.icon" class="scene-icon"></svg-icon>
|
||||
<SmallBorder>
|
||||
<div class="go-workshop-scene">
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<div class="title-text">
|
||||
<span :style="{
|
||||
color: option.titleColor,
|
||||
fontSize: option.titleSize + 'px',
|
||||
fontWeight: option.fontWeight,
|
||||
fontStyle: option.fontStyle,
|
||||
marginLeft: option.paddingX + 'px',
|
||||
marginTop: option.paddingY + 'px',
|
||||
letterSpacing: option.letterSpacing + 'px'
|
||||
}">{{ option.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scene-name" :style="{ color: option.sceneNameColor, fontSize: option.sceneNameSize + 'px' }">{{ scene.name }}</div>
|
||||
<div class="metrics-container">
|
||||
<template v-for="(metric, mIndex) in scene.metrics" :key="mIndex">
|
||||
<div 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>
|
||||
<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 }" :style="{ backgroundImage: `url(${backgrounds[index]})` }">
|
||||
<div class="scene-icon-container">
|
||||
<div class="yellow-dot"></div>
|
||||
<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">
|
||||
<template v-for="(metric, mIndex) in scene.metrics" :key="mIndex">
|
||||
<div 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 class="metric-value" :style="{ color: option.valueColor, fontSize: option.valueSize + 'px' }">{{ metric.value }}</div>
|
||||
</div>
|
||||
<div class="separator" v-if="mIndex < scene.metrics.length - 1"></div>
|
||||
</template>
|
||||
<div class="separator" v-if="mIndex < scene.metrics.length - 1"></div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SmallBorder>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -42,6 +52,7 @@ import { PropType, computed } from 'vue'
|
||||
import { option as configOption } from './config'
|
||||
import bg1 from './assets/6.png'
|
||||
import bg2 from './assets/04.png'
|
||||
import SmallBorder from '../SmallBorder/index.vue'
|
||||
|
||||
const backgrounds = [bg1, bg2]
|
||||
|
||||
@ -57,10 +68,12 @@ const option = computed(() => props.chartConfig.option)
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.go-workshop-scene {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #0F1C3D;
|
||||
padding: 15px;
|
||||
padding: 12px;
|
||||
margin-top: 5px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -69,18 +82,18 @@ const option = computed(() => props.chartConfig.option)
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #1A385A;
|
||||
padding: 5px 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 3px;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.title-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 10px;
|
||||
color: #00E5FF;
|
||||
margin-top: -5px;
|
||||
|
||||
.title-text {
|
||||
height: 35px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px 0 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,6 +187,7 @@ const option = computed(() => props.chartConfig.option)
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 5px;
|
||||
|
||||
.point {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
@ -181,6 +195,7 @@ const option = computed(() => props.chartConfig.option)
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.metric-value {
|
||||
font-weight: bold;
|
||||
margin-left: 16px;
|
||||
|
Loading…
Reference in New Issue
Block a user