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