Merge remote-tracking branch 'origin/optimize' into optimize

main
wu.jian2 2 years ago
commit f4ae03f660

@ -36,6 +36,9 @@ const customConfig = {
type: 'button',
// 名称
title: '查询',
root: {
version: 0
},
// 自定义属性
customize: {
bindComponents: [],

@ -15,6 +15,7 @@ const customConfig = {
type: 'currentTime',
root: {
version : '0.0.1',
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
customize: {

@ -31,6 +31,7 @@ export const settingConfig = {
const customConfig = {
type: 'digitalFlop',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -11,6 +11,9 @@ export const settingConfig = {
}
const customConfig = {
type: 'horizontalLine',
root: {
version: 0
},
customize: {
// 边框线颜色
borderColor: 'rgba(131, 191, 246, 0)',

@ -18,6 +18,7 @@ export const settingConfig = {
const customConfig = {
type: 'iframeChart',
root: {
version : '0.0.1',
url: 'https://www.runoob.com/'
},
customize: {

@ -11,8 +11,10 @@ export const settingConfig = {
}
const customConfig = {
type: 'input',
root: {
version: 0
},
// 自定义属性
// 输入框的值
customize: {
value: '',
// 是否显示标题

@ -29,6 +29,7 @@ export const settingConfig = {
const customConfig = {
type: 'linkChart',
root: {
version : '0.0.1',
url: 'https://www.runoob.com/'
},
customize: {

@ -37,6 +37,7 @@ export const settingConfig = {
const customConfig = {
type: 'map',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,9 @@ export const settingConfig = {
}
const customConfig = {
type: 'picture',
root: {
version: 0
},
customize: {
url: '',
radius: 0,

@ -31,6 +31,7 @@ export const settingConfig = {
const customConfig = {
type: 'screenScrollBoard',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -25,6 +25,7 @@ export const settingConfig = {
const customConfig = {
type: 'screenScrollRanking',
root: {
version: '0.0.1',
contribution: false
},
customize: {

@ -33,6 +33,7 @@ export const settingConfig = {
const customConfig = {
type: 'tables',
root: {
version: '0.0.1',
contribution: false
},
customize: {

@ -29,6 +29,7 @@ export const settingConfig = {
const customConfig = {
type: 'texts',
root: {
version : '0.0.1',
url: 'https://www.runoob.com/'
},
customize: {

@ -14,6 +14,7 @@ export const settingConfig = {
const customConfig = {
type: 'timeCountDown',
root: {
version : '0.0.1',
endTime: ''
},
customize: {

@ -11,6 +11,9 @@ export const settingConfig = {
}
const customConfig = {
type: 'verticalLine',
root: {
version: 0
},
customize: {
// 边框线颜色
borderColor: 'rgba(131, 191, 246, 0)',

@ -11,6 +11,9 @@ export const settingConfig = {
}
const customConfig = {
type: 'video',
root: {
version: 0
},
customize: {
videoType: 'application/x-mpegURL',
videoUrl: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border1',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border10',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border11',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border12',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border13',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border2',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border3',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border4',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border5',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border6',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border7',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border8',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -20,6 +20,7 @@ export const settingConfig = {
const customConfig = {
type: 'border9',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -129,8 +129,8 @@
<div class="left-tab-box">
<ul>
<li
v-for="_type in datasetTypeList"
:key="_type.name"
v-for="(_type,index) in datasetTypeList"
:key="index"
:class="{ 'tab-style': true, 'tab-active': _type.datasetType == curType }"
@click="getTypeData(_type.datasetType)"
>

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration1',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration10',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration11',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration12',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration2',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration2Reverse',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration3',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration4',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration4Reverse',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration5',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration6',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration8',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration8Reverse',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -16,6 +16,7 @@ export const settingConfig = {
const customConfig = {
type: 'decoration9',
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -3,7 +3,8 @@
* @Date: 2023-03-27 14:38:23
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -582,6 +583,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -571,6 +573,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -448,6 +450,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -678,6 +680,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -1365,6 +1367,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -561,6 +563,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Line'
// 标题
@ -700,6 +702,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'TinyLine'
// 标题
@ -104,6 +106,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'TinyArea'
// 标题
@ -131,6 +133,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Bar'
// 标题
@ -666,6 +668,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Bar'
// 标题
@ -610,6 +612,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Column'
// 标题
@ -606,6 +608,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Column'
// 标题
@ -621,6 +623,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Column'
// 标题
@ -538,6 +540,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Column'
// 标题
@ -604,6 +606,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Funnel'
// 标题
@ -288,6 +290,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Funnel'
// 标题
@ -284,6 +286,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Funnel'
// 标题
@ -288,6 +290,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Treemap'
// 标题
@ -224,6 +226,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'WordCloud'
// 标题
@ -613,6 +615,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Gauge'
// 标题
@ -194,6 +196,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Progress'
// 标题
@ -117,6 +119,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Liquid'
// 标题
@ -201,6 +203,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Liquid'
// 标题
@ -196,6 +198,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Gauge'
// 标题
@ -160,6 +162,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Progress'
// 标题
@ -109,6 +111,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,3 +1,5 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'RingProgress'
// 标题
@ -176,6 +178,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Liquid'
// 标题
@ -193,6 +195,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Radar'
// 标题
@ -327,6 +329,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Radar'
// 标题
@ -223,6 +225,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Area'
// 标题
@ -595,6 +597,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Area'
// 标题
@ -687,6 +689,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,8 @@
* @Author: xing.heng
*/
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Area'
// 标题
@ -556,6 +558,7 @@ const option = {
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Pie'
// 标题
@ -384,6 +386,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Pie'
// 标题
@ -263,6 +265,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -1,4 +1,6 @@
// 配置版本号
const version = '0.0.1'
// 分类
const category = 'Rose'
// 标题
@ -216,6 +218,7 @@ const option = {
}
export default {
category,
version,
title,
chartType,
name,

@ -4,6 +4,7 @@ export const settingConfig = {
}
const customConfig = {
root: {
version: '0.0.1',
contribution: false
},
customize: {

@ -4,6 +4,7 @@ export const settingConfig = {
}
const customConfig = {
root: {
version : '0.0.1',
contribution: false
},
customize: {

@ -1,6 +1,6 @@
// 组件配置转化
import _ from 'lodash'
import { setModules } from 'packages/js/utils/configImport'
import { setModules, dataModules } from 'packages/js/utils/configImport'
import { getScreenInfo, getDataSetDetails, getDataByDataSetId } from '../api/bigScreenApi'
import { stringToFunction } from '../utils/evalFunctions'
import { EventBus } from '../utils/eventBus'
@ -65,21 +65,74 @@ export function handleResData (data) {
// 如果pageConfig中的cacheDataSets为null赋值[]
pageInfo.pageConfig.cacheDataSets = pageInfo.pageConfig.cacheDataSets || []
pageInfo.pageConfig.refreshConfig = pageInfo.pageConfig.refreshConfig || []
let originalConfig = {}
pageInfo.chartList.forEach((chart) => {
if (!['customComponent', 'remoteComponent'].includes(chart.type)) {
chart.option = _.cloneDeep(setModules[chart.type])
// chart.option = _.cloneDeep(setModules[chart.type])
originalConfig = { option: { ...setModules[chart.type] }, ...dataModules[chart.type] }
chart = compatibility(chart, originalConfig)
} else {
originalConfig = plotList?.find(plot => plot.name === chart.name)
chart.option = stringToFunction(chart.option)
// 如果是自定义组件,且没配数据集,就给前端的模拟数据
if (!chart?.dataSource?.businessKey) {
chart.option.data = plotList?.find(plot => plot.name === chart.name)?.option?.data
}
chart = compatibility(chart, originalConfig)
}
chart.key = chart.code
})
return pageInfo
}
// 组件属性兼容
function compatibility (config, originalConfig) {
const newConfig = config
newConfig.dataSource = objCompare(newConfig.dataSource, originalConfig.dataSource)
newConfig.customize = objCompare(newConfig.customize, originalConfig.customize)
newConfig.option = { ...objCompare(newConfig.option, originalConfig.option), displayOption: originalConfig.option.displayOption }
newConfig.setting = arrCompare(newConfig.setting, originalConfig.setting)
return newConfig
}
// 对象比较
function objCompare (obj1, obj2) {
const keys1 = obj1 ? Object.keys(obj1) : []
const keys2 = obj2 ? Object.keys(obj2) : []
// 交集
const intersection = keys1?.filter(function (v) { return keys2.indexOf(v) > -1 }) || []
// 差集
const differenceSet = keys2?.filter(function (v) { return keys1.indexOf(v) === -1 }) || []
const obj = {}
for (const item of intersection) {
obj[item] = obj1[item]
}
for (const item of differenceSet) {
obj[item] = obj2[item]
}
return obj
}
// 数组比较
function arrCompare (list1, list2) {
const fieldList = list1?.map(item => item.field) || []
const list = list2?.map(item => {
let value = null
// 如果存在交集
if (fieldList.includes(item.field)) {
// 保留旧数据的value
// console.log(list1.filter(j => j.field === item.field))
value = (list1.filter(j => {
return j.field === item.field
}))[0].value
} else {
// 不存在交集,直接覆盖
value = item.value
}
return {
...item,
value
}
}) || []
return list
}
// 推送数据到各个组件
function emitDataToChart (dataSetId, data) {
if (data && data.length) {

Loading…
Cancel
Save