refactor: 删除旧报警列表组件
删除了报警列表组件的相关文件,包括配置、数据、模板和样式文件。
This commit is contained in:
parent
1b4064f655
commit
9bec16e4b8
@ -1,55 +0,0 @@
|
||||
import { PublicConfigClass } from '@/packages/public'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { AlarmListConfig } 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,
|
||||
header: ['报警事件', '时间', '所属企业', '状态'],
|
||||
headerTextColor: '#B4B4B4',
|
||||
textColor: '#ffffff',
|
||||
headerBackgroundColor: '#17325F',
|
||||
itemBackgroundColor: '#242834',
|
||||
statusColors: {
|
||||
'未解决': '#FF4D4F',
|
||||
'已解决': '#ffffff'
|
||||
},
|
||||
headerHeight: 28,
|
||||
itemHeight: 28,
|
||||
fontSize: 12,
|
||||
title: '近60分钟报警信息',
|
||||
titleSize: 16,
|
||||
titleColor: '#eee',
|
||||
fontWeight: 'normal',
|
||||
fontStyle: 'italic',
|
||||
paddingX: 50,
|
||||
paddingY: -30,
|
||||
letterSpacing: 0.5,
|
||||
isShowButton: false
|
||||
}
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key = AlarmListConfig.key
|
||||
public chartConfig = AlarmListConfig
|
||||
public option = option
|
||||
|
||||
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
<template>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
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 +0,0 @@
|
||||
{
|
||||
"source": [
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "未解决"
|
||||
},
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "已解决"
|
||||
},
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "未解决"
|
||||
},
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "未解决"
|
||||
},
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "未解决"
|
||||
},
|
||||
{
|
||||
"event": "报警报警报警报警",
|
||||
"time": "10:13:24",
|
||||
"enterprise": "企业简称企业简称",
|
||||
"status": "未解决"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
export const AlarmListConfig: ConfigType = {
|
||||
key: 'AlarmListHaz',
|
||||
chartKey: 'VAlarmListHaz',
|
||||
conKey: 'VCAlarmListHaz',
|
||||
title: '报警列表',
|
||||
category: 'HazardousChemicalsSpace',
|
||||
categoryName: '危化品场景',
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.COMMON,
|
||||
image: 'alarm_list.png'
|
||||
}
|
||||
export default AlarmListConfig
|
@ -1,184 +0,0 @@
|
||||
<template>
|
||||
<SmallBorder class="SmallBorder">
|
||||
<div class="go-alarm-list">
|
||||
<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 v-if="option.isShowButton" class="header-right-squares">
|
||||
<div class="square" style="background-color: #2e69e0"></div>
|
||||
<div class="square" style="background-color: #2e9bf0"></div>
|
||||
<div class="square" style="background-color: #2ef0b3"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-header" :style="{
|
||||
height: option.headerHeight + 'px'
|
||||
}">
|
||||
<div v-for="header in option.header" :key="header" class="header-item"
|
||||
:style="{ color: option.headerTextColor, fontSize: option.fontSize + 'px' }">
|
||||
{{ header }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div v-for="(item, index) in option.dataset" :key="index" class="table-row"
|
||||
:style="{ backgroundColor: option.itemBackgroundColor, height: option.itemHeight + 'px' }">
|
||||
<div class="row-item" :style="{ color: option.textColor, fontSize: option.fontSize + 'px' }">
|
||||
{{ item.event }}
|
||||
</div>
|
||||
<div class="row-item" :style="{ color: option.textColor, fontSize: option.fontSize + 'px' }">
|
||||
{{ item.time }}
|
||||
</div>
|
||||
<div class="row-item" :style="{ color: option.textColor, fontSize: option.fontSize + 'px' }">
|
||||
{{ item.enterprise }}
|
||||
</div>
|
||||
<div class="row-item" :style="{ color: getStatusColor(item.status), fontSize: option.fontSize + 'px' }">
|
||||
{{ item.status }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SmallBorder>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, computed } from 'vue'
|
||||
import { option as configOption } from './config'
|
||||
import SmallBorder from '../SmallBorder/index.vue'
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<{ option: typeof configOption }>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const option = computed(() => props.chartConfig.option)
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
return props.chartConfig.option.statusColors[status] || '#ffffff'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.SmallBorder {
|
||||
position: relative;
|
||||
// background-color: #ffffff;
|
||||
}
|
||||
|
||||
.go-alarm-list {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #ffffff;
|
||||
padding: 12px;
|
||||
margin-top: 5px;
|
||||
box-sizing: border-box;
|
||||
// background-color: #4da6ff;
|
||||
z-index: 10;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.title-text {
|
||||
height: 35px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2px 20px 0 20px;
|
||||
|
||||
font-family: 'CustomFont';
|
||||
font-style: italic;
|
||||
letter-spacing: 0.5px;
|
||||
color: #eee;
|
||||
text-shadow: 1px 3px 10px #000000;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.header-right-squares {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.square {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
background: linear-gradient(to top, #226493c8, #0f2448);
|
||||
border-bottom: 2px solid #4da6ff;
|
||||
margin-top: 10px;
|
||||
|
||||
.header-item {
|
||||
flex: 1 0 25%;
|
||||
margin-right: 1.5em;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.table-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* 隐藏滚动条 */
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
scrollbar-width: none;
|
||||
|
||||
.table-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
margin-bottom: 4px;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.row-item {
|
||||
flex: 1 0 25%;
|
||||
margin-right: 1.5em;
|
||||
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user