123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742 |
- import _ from 'lodash-es';
- import { Config } from './types';
- export const ModuleSizeMap = {
- 'width:450px;height:280px;': '标准尺寸(450*280)',
- 'width:450px;height:570px;': '纵向拉伸(450*570)',
- 'width:450px;height:860px;': '纵向填充(450*860)',
- 'width:1000px;height:280px;': '横向拉伸(1000*280)',
- 'width:1920px;height:280px;': '横向填充(1920*280)',
- };
- /** 默认的模块宽高选项 */
- export const ModuleSizeOptions = _.map(ModuleSizeMap, (v, k) => ({
- value: k,
- label: v,
- }));
- /** 默认的模块版本选项,即外边框样式 */
- export const ModuleVersionOptions = _.map(['原版', '新版'], (k) => ({
- value: k,
- label: k,
- }));
- export const ModulePositionMap = {
- 'display:none;': '不展示',
- 'top:60px;left:0;': '左上',
- 'top:350px;left:0;': '左中',
- 'top:640px;left:0;': '左下',
- 'top:60px;right:0;': '右上',
- 'top:350px;right:0;': '右中',
- 'top:640px;right:0;': '右下',
- 'top:640px;left:460px;': '中下',
- };
- /** 默认的模块定位选项 */
- export const ModulePositionOptions = _.map(ModulePositionMap, (v, k) => ({
- value: k,
- label: v,
- }));
- /** 默认的模块预设选项,每个预设对应着一种写好的配置 */
- export const ModulePresetOptions = _.map(
- [
- '告示版(1*1)',
- '折线图(1*1)',
- '面积图(1*1)',
- '饼状图(1*1)',
- '柱状图(2*1)',
- '画廊(1*1)',
- '列表(1*1)',
- '表格(1*1)',
- '爆炸三角形(1*1)',
- ],
- (k) => ({
- value: k,
- label: k,
- })
- );
- /** 默认的模块预设表 */
- export const ModulePresetMap: Record<
- string,
- {
- moduleData: Config['moduleData'];
- showStyle: Partial<Config['showStyle']>;
- }
- > = {
- '告示版(1*1)': {
- moduleData: {
- header: {
- show: true,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'image',
- link: '',
- },
- layout: ['board'],
- board: [
- {
- type: 'A',
- layout: 'val-top',
- readFrom: 'readData',
- items: [
- {
- value: '${Fan1StartStatus_str}',
- label: '一号机状态',
- },
- {
- value: '${Fan2StartStatus_str}',
- label: '二号机状态',
- },
- ],
- },
- ],
- list: [],
- chart: [],
- table: [],
- gallery: [],
- preset: [],
- complex_list: [],
- },
- showStyle: {
- size: 'width:450px;height:280px;',
- },
- },
- '折线图(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['chart'],
- board: [],
- list: [],
- chart: [
- {
- type: 'line',
- readFrom: 'majorpath.paths',
- xAxis: [{ label: '${name}' }],
- yAxis: [
- { label: 'Drag', align: 'left' },
- { label: 'M3', align: 'right' },
- ],
- series: [
- { label: 'Drag', value: '${drag}' },
- { label: 'M3', value: '${m3}' },
- // { label: '回2', value: '${hui2}' },
- ],
- },
- ],
- gallery: [],
- table: [],
- preset: [],
- complex_list: [],
- },
- showStyle: {
- size: 'width:450px;height:280px;',
- },
- },
- '面积图(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['chart'],
- board: [],
- list: [],
- chart: [
- {
- type: 'line_area',
- readFrom: 'majorpath.paths',
- xAxis: [{ label: '${name}' }],
- yAxis: [
- { label: 'Drag', align: 'left' },
- { label: 'M3', align: 'right' },
- ],
- series: [
- { label: 'Drag', value: '${drag}' },
- { label: 'M3', value: '${m3}' },
- // { label: '回2', value: '${hui2}' },
- ],
- },
- ],
- gallery: [],
- table: [],
- preset: [],
- complex_list: [],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '饼状图(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['chart'],
- board: [],
- list: [],
- chart: [
- {
- type: 'pie',
- readFrom: 'history',
- xAxis: [],
- yAxis: [],
- series: [
- { label: 'Drag', value: '${drag}' },
- { label: 'M3', value: '${m3}' },
- // { label: '回2', value: '${hui2}' },
- ],
- },
- ],
- gallery: [],
- table: [],
- preset: [],
- complex_list: [],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '柱状图(2*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: false,
- showSlot: false,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['chart'],
- board: [],
- list: [],
- table: [],
- preset: [],
- gallery: [],
- complex_list: [],
- chart: [
- {
- type: 'bar',
- readFrom: 'sysdata.history',
- xAxis: [{ label: '${time}' }],
- yAxis: [{ label: '回1', align: 'left' }],
- series: [{ label: '回1', value: '${hui1}' }],
- },
- ],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '画廊(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: false,
- showSlot: false,
- selector: {
- value: '${devicePos}',
- },
- slot: {
- value: '${devicePos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['gallery'],
- board: [],
- gallery: [
- {
- type: 'A',
- readFrom: 'device',
- items: [
- {
- value: '${gate}',
- label: '风门',
- // label: '光纤预警',
- color: 'blue',
- },
- {
- value: '${window}',
- label: '风窗',
- // label: '喷雾开启数',
- color: 'blue',
- },
- {
- value: '${windrect}',
- label: '测风',
- // label: '联网数量',
- color: 'blue',
- },
- {
- value: '${stationtype}',
- label: '空位',
- // label: '断网数量',
- color: 'blue',
- },
- ],
- },
- ],
- list: [],
- table: [],
- chart: [],
- preset: [],
- complex_list: [],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '列表(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: false,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${网络异常:}${netstatus.val} 台',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['list'],
- board: [],
- chart: [],
- table: [],
- preset: [],
- complex_list: [],
- gallery: [],
- list: [
- {
- type: 'timeline',
- readFrom: '',
- items: [
- {
- label: '正常',
- value: '${blue}.val',
- color: 'blue',
- info: '',
- },
- {
- label: '告警',
- value: '${orange}.val',
- color: 'orange',
- info: '',
- },
- {
- label: '报警',
- value: '${yellow}.val',
- color: 'yellow',
- info: '',
- },
- {
- label: '危险',
- value: '${red}.val',
- color: 'red',
- info: '',
- },
- {
- label: '错误',
- value: '${alarm}.val',
- color: 'green',
- info: '',
- },
- ],
- },
- ],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '表格(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${devicePos}',
- },
- slot: {
- value: '${devicePos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['table'],
- board: [],
- list: [],
- preset: [],
- gallery: [],
- complex_list: [],
- table: [
- {
- type: 'B',
- readFrom: 'history',
- columns: [
- {
- prop: 'cate',
- label: '类别',
- },
- {
- prop: 'temp',
- label: '温度',
- },
- {
- prop: 'wspd',
- label: '风速',
- },
- {
- prop: 'spst',
- label: '喷雾状态',
- },
- ],
- },
- ],
- chart: [],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '爆炸三角形(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: false,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${strinstallpos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['blast_delta'],
- board: [],
- gallery: [],
- list: [],
- table: [],
- chart: [],
- complex_list: [],
- preset: [{}],
- },
- showStyle: { size: 'width:450px;height:280px;' },
- },
- '采空区火情综合预警(1*1)': {
- moduleData: {
- header: {
- show: false,
- showSelector: false,
- showSlot: true,
- selector: {
- value: '${strinstallpos}',
- },
- slot: {
- value: '${网络异常:}${netstatus.val} 台',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['complex_list', 'list'],
- // layout: ['list'],
- board: [],
- chart: [],
- gallery: [],
- table: [],
- list: [
- {
- type: 'B',
- readFrom: '',
- items: [
- {
- label: '堵塞状态',
- value: '${fsectarea}',
- color: 'yellow',
- info: '',
- },
- {
- label: '甲烷浓度',
- value: '${stationname}',
- color: 'yellow',
- info: '',
- },
- ],
- },
- ],
- complex_list: [
- {
- type: 'A',
- readFrom: '',
- items: [
- {
- label: '火情状态',
- value: '${fsectarea}',
- color: 'yellow',
- info: '',
- },
- {
- label: '回采位置',
- value: '${stationname}',
- color: 'white',
- info: '',
- },
- {
- label: '硐室火情',
- value: '${stationtype}',
- color: 'blue',
- info: '',
- },
- {
- label: '联动设备状态',
- value: '${typeName}',
- color: 'blue',
- info: '',
- },
- ],
- galleryItems: [
- {
- value: '${低风险}',
- label: '',
- color: 'white',
- },
- {
- value: '${CO}',
- label: '',
- color: 'white',
- },
- ],
- },
- ],
- preset: [],
- },
- showStyle: {
- size: 'width:450px;height:280px;',
- },
- },
- '重点区域实时火情(1*2)': {
- moduleData: {
- header: {
- show: false,
- showSelector: true,
- showSlot: true,
- selector: {
- value: '${devicePos}',
- },
- slot: {
- value: '${devicePos}',
- },
- },
- background: {
- show: false,
- type: 'video',
- link: '',
- },
- layout: ['complex_list', 'blast_delta', 'list'],
- board: [],
- gallery: [],
- list: [
- {
- type: 'E',
- readFrom: '',
- items: [
- {
- label: '火情状态',
- value: '${fsectarea}',
- color: 'yellow',
- info: '',
- },
- {
- label: '回采位置',
- value: '${stationname}',
- color: 'white',
- info: '',
- },
- {
- label: '硐室火情',
- value: '${stationtype}',
- color: 'blue',
- info: '',
- },
- {
- label: '联动设备状态',
- value: '${typeName}',
- color: 'blue',
- info: '',
- },
- {
- label: '火情状态',
- value: '${fsectarea}',
- color: 'yellow',
- info: '',
- },
- {
- label: '回采位置',
- value: '${stationname}',
- color: 'white',
- info: '',
- },
- {
- label: '硐室火情',
- value: '${stationtype}',
- color: 'blue',
- info: '',
- },
- {
- label: '联动设备状态',
- value: '${typeName}',
- color: 'blue',
- info: '',
- },
- // {
- // label: '火情状态',
- // value: '${fsectarea}',
- // color: 'yellow',
- // info: '',
- // },
- // {
- // label: '回采位置',
- // value: '${stationname}',
- // color: 'white',
- // info: '',
- // },
- // {
- // label: '硐室火情',
- // value: '${stationtype}',
- // color: 'blue',
- // info: '',
- // },
- // {
- // label: '联动设备状态',
- // value: '${typeName}',
- // color: 'blue',
- // info: '',
- // },
- ],
- },
- ],
- table: [],
- chart: [],
- preset: [{}],
- complex_list: [
- {
- type: 'B',
- readFrom: '',
- items: [
- {
- label: '火情状态',
- value: '${fsectarea}',
- color: 'yellow',
- info: '',
- },
- {
- label: '回采位置',
- value: '${stationname}',
- color: 'white',
- info: '',
- },
- {
- label: '硐室火情',
- value: '${stationtype}',
- color: 'blue',
- info: '',
- },
- {
- label: '联动设备状态',
- value: '${typeName}',
- color: 'blue',
- info: '',
- },
- ],
- galleryItems: [
- {
- value: '${低风险}',
- label: '风险等级',
- color: 'white',
- },
- ],
- },
- ],
- },
- showStyle: {
- size: 'width:450px;height:570px;',
- },
- },
- };
- // export const ModuleChartTypeMap = {
- // pie: '饼状图',
- // bar: '柱状图',
- // line: '折线图',
- // };
- // export const ModuleChartTypeOptions = _.map(ModuleChartTypeMap, (v, k) => ({
- // value: k,
- // label: v,
- // }));
|