初始化
This commit is contained in:
68
frontend/packages/js/config/basicComponentsConfig.js
Normal file
68
frontend/packages/js/config/basicComponentsConfig.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* @description: 基础的bigScreen展示组件
|
||||
* @Date: 2023-03-13 10:04:59
|
||||
* @Author: xing.heng
|
||||
* @LastEditors: wujian
|
||||
* @LastEditTime: 2023-06-01 15:55:48
|
||||
*/
|
||||
|
||||
// import _ from 'lodash'
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import getComponentConfig from "data-room-ui/js/utils/getComponentConfig";
|
||||
// 批量引入配置文件
|
||||
import { setModules, dataModules } from "data-room-ui/js/utils/configImport";
|
||||
const typeList = [
|
||||
"texts",
|
||||
"numbers",
|
||||
"linkChart",
|
||||
"horizontalLine", // 横线
|
||||
"verticalLine", // 竖线
|
||||
"picture",
|
||||
"timeCountDown",
|
||||
"currentTime",
|
||||
"customHtml",
|
||||
"iframeChart",
|
||||
"digitalFlop",
|
||||
"tables",
|
||||
"screenScrollRanking",
|
||||
"screenScrollBoard",
|
||||
"video",
|
||||
"input",
|
||||
"button",
|
||||
"marquee",
|
||||
"chartTab",
|
||||
"themeSwitcher",
|
||||
"themeSelect",
|
||||
"select",
|
||||
"timePicker",
|
||||
"dateTimePicker",
|
||||
"indicatorCard",
|
||||
"indicatorCard2",
|
||||
"indexCard",
|
||||
"indexCard2",
|
||||
];
|
||||
let basicConfigList = [];
|
||||
basicConfigList = typeList.map((type) => {
|
||||
console.log('getComponentConfig(type): ', getComponentConfig(type));
|
||||
|
||||
return getComponentConfig(type);
|
||||
});
|
||||
basicConfigList = basicConfigList.map((item) => {
|
||||
return basicComponentsConfig(item);
|
||||
});
|
||||
// 生成基本配置
|
||||
export function basicComponentsConfig(item) {
|
||||
return {
|
||||
...item,
|
||||
border: {
|
||||
type: "",
|
||||
titleHeight: 60,
|
||||
fontSize: 30,
|
||||
isTitle: true,
|
||||
padding: [0, 0, 0, 0],
|
||||
},
|
||||
option: cloneDeep(setModules[item.type]),
|
||||
...cloneDeep(dataModules[item.type]),
|
||||
};
|
||||
}
|
||||
export default basicConfigList;
|
||||
40
frontend/packages/js/config/borderComponentsConfig.js
Normal file
40
frontend/packages/js/config/borderComponentsConfig.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// import _ from 'lodash'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import getComponentConfig from 'data-room-ui/js/utils/getBorderComponentsConfig'
|
||||
// 批量引入配置文件
|
||||
import { setModules, dataModules } from 'data-room-ui/js/utils/configImport'
|
||||
const typeLIst = [
|
||||
'border1',
|
||||
'border2',
|
||||
'border3',
|
||||
'border4',
|
||||
'border5',
|
||||
'border6',
|
||||
'border7',
|
||||
'border8',
|
||||
'border9',
|
||||
'border10',
|
||||
'border11',
|
||||
'border12',
|
||||
'border13',
|
||||
'border14',
|
||||
'border15'
|
||||
]
|
||||
let basicConfigList = []
|
||||
basicConfigList = typeLIst.map((type) => {
|
||||
// 装饰组件的className保持一致
|
||||
return getComponentConfig(type, 'ScreenBorder')
|
||||
})
|
||||
basicConfigList = basicConfigList.map((item) => {
|
||||
return basicComponentsConfig(item)
|
||||
})
|
||||
// 生成基本配置
|
||||
export function basicComponentsConfig (item) {
|
||||
// let type = `${upperFirst(item.type)}`
|
||||
return {
|
||||
...item,
|
||||
option: cloneDeep(setModules[item.type]),
|
||||
...cloneDeep(dataModules[item.type])
|
||||
}
|
||||
}
|
||||
export default basicConfigList
|
||||
94
frontend/packages/js/config/commonConfig.js
Normal file
94
frontend/packages/js/config/commonConfig.js
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* @description: 大屏组件通用属性
|
||||
* @Date: 2023-03-13 10:04:59
|
||||
* @Author: xing.heng
|
||||
* @LastEditors: wujian
|
||||
* @LastEditTime: 2023-06-01 10:23:13
|
||||
*/
|
||||
|
||||
import getComponentConfig from 'data-room-ui/js/utils/getComponentConfig'
|
||||
import linkageConfig from 'data-room-ui/js/config/linkageConfig'
|
||||
// 关于设置组件在右侧面板可以展示哪些属性配置
|
||||
export const displayOption = {
|
||||
serverPagination: {
|
||||
// 服务端分页
|
||||
enable: false
|
||||
},
|
||||
pageSize: {
|
||||
// 分页长度
|
||||
enable: false
|
||||
},
|
||||
metricField: {
|
||||
// 指标
|
||||
label: '指标',
|
||||
enable: true,
|
||||
multiple: true // 是否多选
|
||||
},
|
||||
dimensionField: {
|
||||
// 维度
|
||||
label: '维度', // 维度/查询字段
|
||||
enable: true,
|
||||
multiple: true // 是否多选
|
||||
},
|
||||
dimensionList: {
|
||||
// 维度(只有多折线图会存在两个维度)
|
||||
label: '维度', // 维度/查询字段
|
||||
enable: false,
|
||||
multiple: true // 是否多选
|
||||
},
|
||||
seriesField: {
|
||||
// 数据细分
|
||||
enable: false,
|
||||
required: true // 必填
|
||||
},
|
||||
dataAllocation: {
|
||||
// 是否存在数据配置
|
||||
enable: true
|
||||
},
|
||||
params: {
|
||||
// 参数配置
|
||||
enable: true
|
||||
},
|
||||
dataSourceType: {
|
||||
// 数据源(数据集或者其他方式:静态数据)
|
||||
enable: true
|
||||
}
|
||||
}
|
||||
export default function (customConfig) {
|
||||
|
||||
|
||||
return {
|
||||
...getComponentConfig(customConfig.type),
|
||||
z: 0, // z轴图层支持
|
||||
locked: false, // 是否锁定组件
|
||||
group: '', // 组合组件, 相同group的组件会被组合在一起
|
||||
code: null,
|
||||
showTitle: true,
|
||||
...customConfig.root,
|
||||
dataSource: {
|
||||
className:
|
||||
'com.gccloud.dataroom.core.module.chart.components.datasource.DataSetDataSource',
|
||||
dataSourceKey: '', // 数据源,选择不同数据库
|
||||
source: 'dataset',
|
||||
businessKey: '', // 数据集标识
|
||||
dimensionField: '', // 维度
|
||||
metricField: '', // 指标
|
||||
seriesField: '', // 分类字段
|
||||
dimensionFieldList: [], // 唯独列表
|
||||
metricFieldList: [], // 指标列表
|
||||
seriesFieldList: [], // 分类列表
|
||||
serverPagination: false, // 服务端分页
|
||||
pageSize: 10,
|
||||
params: {},
|
||||
dataSetType: '1', // 数据集类型,
|
||||
formCode: '',
|
||||
...customConfig.dataSource // 非通用数据配置
|
||||
},
|
||||
customize: {
|
||||
...customConfig.customize
|
||||
}, // 自定义设置
|
||||
...linkageConfig, // 数据联动配置
|
||||
filterList: [],
|
||||
dataFlag: false // 判断数据为模拟数据还是真实数据
|
||||
}
|
||||
}
|
||||
30
frontend/packages/js/config/configurationComponentsConfig.js
Normal file
30
frontend/packages/js/config/configurationComponentsConfig.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// import _ from 'lodash'
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import getComponentConfig from "data-room-ui/js/utils/getConfigurationComponentsConfig";
|
||||
// 批量引入配置文件
|
||||
import { setModules, dataModules } from "data-room-ui/js/utils/configImport";
|
||||
|
||||
const typeLIst = [
|
||||
"horizontalLine2",
|
||||
"verticalLine2",
|
||||
"warning",
|
||||
];
|
||||
let basicConfigList = [];
|
||||
basicConfigList = typeLIst.map((type) => {
|
||||
return getComponentConfig(type, "ScreenConfiguration"); // 组态组件的className保持一致
|
||||
});
|
||||
basicConfigList = basicConfigList.map((item) => {
|
||||
return basicComponentsConfig(item);
|
||||
});
|
||||
|
||||
// 生成基本配置
|
||||
export function basicComponentsConfig(item) {
|
||||
// let type = `lcdp${upperFirst(item.type)}`
|
||||
return {
|
||||
...item,
|
||||
option: cloneDeep(setModules[item.type]),
|
||||
...cloneDeep(dataModules[item.type]),
|
||||
};
|
||||
}
|
||||
|
||||
export default basicConfigList;
|
||||
38
frontend/packages/js/config/decorationComponentsConfig.js
Normal file
38
frontend/packages/js/config/decorationComponentsConfig.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// import _ from 'lodash'
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import getComponentConfig from "data-room-ui/js/utils/getDecorationComponentsConfig";
|
||||
// 批量引入配置文件
|
||||
import { setModules, dataModules } from "data-room-ui/js/utils/configImport";
|
||||
const typeLIst = [
|
||||
"decoration1",
|
||||
"decoration3",
|
||||
"decoration2",
|
||||
"decoration2Reverse",
|
||||
"decoration4",
|
||||
"decoration4Reverse",
|
||||
"decoration5",
|
||||
"decoration6",
|
||||
"decoration8",
|
||||
"decoration8Reverse",
|
||||
"decoration9",
|
||||
"decoration10",
|
||||
"decoration11",
|
||||
];
|
||||
let basicConfigList = [];
|
||||
basicConfigList = typeLIst.map((type) => {
|
||||
// 装饰组件的className保持一致
|
||||
return getComponentConfig(type, "ScreenDecoration");
|
||||
});
|
||||
basicConfigList = basicConfigList.map((item) => {
|
||||
return basicComponentsConfig(item);
|
||||
});
|
||||
// 生成基本配置
|
||||
export function basicComponentsConfig(item) {
|
||||
// let type = `lcdp${upperFirst(item.type)}`
|
||||
return {
|
||||
...item,
|
||||
option: cloneDeep(setModules[item.type]),
|
||||
...cloneDeep(dataModules[item.type]),
|
||||
};
|
||||
}
|
||||
export default basicConfigList;
|
||||
13
frontend/packages/js/config/index.js
Normal file
13
frontend/packages/js/config/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* @description: 抛出组件的配置
|
||||
* @Date: 2023-03-13 10:04:59
|
||||
* @Author: xing.heng
|
||||
* @LastEditors: xing.heng
|
||||
* @LastEditTime: 2023-03-13 11:26:13
|
||||
*/
|
||||
|
||||
import commonConfig, { displayOption } from './commonConfig'
|
||||
|
||||
export {
|
||||
commonConfig, displayOption // commonConfig个函数,传入参数type,动态生成配置,displayOption是决定组件具有哪些属性配置
|
||||
}
|
||||
24
frontend/packages/js/config/linkageConfig.js
Normal file
24
frontend/packages/js/config/linkageConfig.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @description: 通用的联动参数
|
||||
* @Date: 2023-01-10 09:58:10
|
||||
* @Author: xing.heng
|
||||
* @LastEditors: xing.heng
|
||||
* @LastEditTime: 2023-04-18 17:19:29
|
||||
*/
|
||||
export default {
|
||||
inParams: [
|
||||
// {
|
||||
// // 组件用于入参的参数列表
|
||||
// name: '', // 参数名
|
||||
// code: '' // 参数值
|
||||
// }
|
||||
],
|
||||
// 查询表单联动
|
||||
linkage: {
|
||||
action: {
|
||||
type: 'js',
|
||||
script: '' // 联动执行的逻辑
|
||||
},
|
||||
components: []
|
||||
}
|
||||
}
|
||||
3
frontend/packages/js/config/svgComponentsConfig.js
Normal file
3
frontend/packages/js/config/svgComponentsConfig.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import Icon from 'packages/Svgs/export'
|
||||
const svgList = Icon.getSvgList()
|
||||
export default svgList
|
||||
Reference in New Issue
Block a user