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

main
wu.jian2 2 years ago
commit f4ae03f660

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,6 +1,6 @@
// 组件配置转化 // 组件配置转化
import _ from 'lodash' 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 { getScreenInfo, getDataSetDetails, getDataByDataSetId } from '../api/bigScreenApi'
import { stringToFunction } from '../utils/evalFunctions' import { stringToFunction } from '../utils/evalFunctions'
import { EventBus } from '../utils/eventBus' import { EventBus } from '../utils/eventBus'
@ -65,21 +65,74 @@ export function handleResData (data) {
// 如果pageConfig中的cacheDataSets为null赋值[] // 如果pageConfig中的cacheDataSets为null赋值[]
pageInfo.pageConfig.cacheDataSets = pageInfo.pageConfig.cacheDataSets || [] pageInfo.pageConfig.cacheDataSets = pageInfo.pageConfig.cacheDataSets || []
pageInfo.pageConfig.refreshConfig = pageInfo.pageConfig.refreshConfig || [] pageInfo.pageConfig.refreshConfig = pageInfo.pageConfig.refreshConfig || []
let originalConfig = {}
pageInfo.chartList.forEach((chart) => { pageInfo.chartList.forEach((chart) => {
if (!['customComponent', 'remoteComponent'].includes(chart.type)) { 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 { } else {
originalConfig = plotList?.find(plot => plot.name === chart.name)
chart.option = stringToFunction(chart.option) chart.option = stringToFunction(chart.option)
// 如果是自定义组件,且没配数据集,就给前端的模拟数据 // 如果是自定义组件,且没配数据集,就给前端的模拟数据
if (!chart?.dataSource?.businessKey) { if (!chart?.dataSource?.businessKey) {
chart.option.data = plotList?.find(plot => plot.name === chart.name)?.option?.data chart.option.data = plotList?.find(plot => plot.name === chart.name)?.option?.data
} }
chart = compatibility(chart, originalConfig)
} }
chart.key = chart.code chart.key = chart.code
}) })
return pageInfo 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) { function emitDataToChart (dataSetId, data) {
if (data && data.length) { if (data && data.length) {

Loading…
Cancel
Save