feat:暂时提交业务组件主题设置

main
liu.shiyi 2 years ago
parent d4e3b24d5a
commit 8dd8e289bc

@ -9,7 +9,6 @@
:right-fold="rightVisiable"
@updateRightVisiable="updateRightVisiable"
@showPageInfo="showPageInfo"
@updateTheme="updateTheme"
@empty="empty"
/>
<div class="drag-wrap">
@ -137,7 +136,6 @@ import { isFirefox } from 'data-room-ui/js/utils/userAgent'
import { handleResData } from 'data-room-ui/js/store/actions.js'
import { EventBus } from 'data-room-ui/js/utils/eventBus'
import NotPermission from 'data-room-ui/NotPermission'
import { themeToSetting } from 'data-room-ui/js/utils/themeFormatting'
export default {
name: 'BigScreenDesign',
components: {
@ -411,12 +409,6 @@ export default {
})
.catch(() => {})
},
//
updateTheme (theme) {
const pageInfo = this.pageInfo
pageInfo.chartList = themeToSetting(pageInfo.chartList, theme)
this.changePageInfo(pageInfo)
},
//
updateSetting (config) {
if (config.type === 'map' || config.type === 'video' ||config.type === 'flyMap') {

@ -19,8 +19,9 @@ import remoteVueLoader from 'remote-vue-loader'
import { mapMutations, mapState } from 'vuex'
import innerRemoteComponents, { getRemoteComponents } from 'data-room-ui/RemoteComponents/remoteComponentsList'
import { getBizComponentInfo } from 'data-room-ui/js/api/bigScreenApi'
import {settingToTheme} from "data-room-ui/js/utils/themeFormatting";
import _ from "lodash";
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash'
import cloneDeep from 'lodash/cloneDeep'
export default {
name: 'LcdpRemoteComponent',
mixins: [linkageMixins, commonMixins],
@ -50,10 +51,18 @@ export default {
'config.option.theme': {
handler (val) {
if (val) {
this.changeStyle(this.config)
this.changeStyle(this.config, true)
}
}
}
// customTheme: {
// handler (val) {
// if (val) {
// this.changeStyle(this.config, true)
// }
// },
// deep: true
// }
},
created () {
this.getRemoteComponent()
@ -133,13 +142,19 @@ export default {
// export default
settingContent = settingContent.replace(/export default[\s\S]*/, '')
eval(settingContent)
// this.config.option = {
// ...this.config.option,
// ...option
// }
this.config.option = {
...this.config.option,
...option
...option,
...this.config.option
}
this.config.setting = setting
//
// this.config.theme = settingToTheme(cloneDeep(this.config), this.customTheme)
// settingtheme
this.config.theme = settingToTheme(this.config, this.customTheme)
// this.config.theme = settingToTheme(this.config, this.customTheme)
return {
option,
@ -196,10 +211,8 @@ export default {
return config
},
// config
changeStyle (config) {
changeStyle (config, isUpdateTheme) {
config = { ...this.config, ...config }
//
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
config = this.transformSettingToOption(config, 'custom')
// optionsettingeval,optionHandlerdataHandler
const option = config.option
@ -212,6 +225,10 @@ export default {
console.error(e)
}
}
//
if (!isUpdateTheme) {
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
}
if (this.chart) {
this.chart.update(config.option)
}

Loading…
Cancel
Save