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

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

@ -9,7 +9,6 @@
:right-fold="rightVisiable" :right-fold="rightVisiable"
@updateRightVisiable="updateRightVisiable" @updateRightVisiable="updateRightVisiable"
@showPageInfo="showPageInfo" @showPageInfo="showPageInfo"
@updateTheme="updateTheme"
@empty="empty" @empty="empty"
/> />
<div class="drag-wrap"> <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 { handleResData } from 'data-room-ui/js/store/actions.js'
import { EventBus } from 'data-room-ui/js/utils/eventBus' import { EventBus } from 'data-room-ui/js/utils/eventBus'
import NotPermission from 'data-room-ui/NotPermission' import NotPermission from 'data-room-ui/NotPermission'
import { themeToSetting } from 'data-room-ui/js/utils/themeFormatting'
export default { export default {
name: 'BigScreenDesign', name: 'BigScreenDesign',
components: { components: {
@ -411,12 +409,6 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
//
updateTheme (theme) {
const pageInfo = this.pageInfo
pageInfo.chartList = themeToSetting(pageInfo.chartList, theme)
this.changePageInfo(pageInfo)
},
// //
updateSetting (config) { updateSetting (config) {
if (config.type === 'map' || config.type === 'video' ||config.type === 'flyMap') { 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 { mapMutations, mapState } from 'vuex'
import innerRemoteComponents, { getRemoteComponents } from 'data-room-ui/RemoteComponents/remoteComponentsList' import innerRemoteComponents, { getRemoteComponents } from 'data-room-ui/RemoteComponents/remoteComponentsList'
import { getBizComponentInfo } from 'data-room-ui/js/api/bigScreenApi' import { getBizComponentInfo } from 'data-room-ui/js/api/bigScreenApi'
import {settingToTheme} from "data-room-ui/js/utils/themeFormatting"; import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from "lodash"; import _ from 'lodash'
import cloneDeep from 'lodash/cloneDeep'
export default { export default {
name: 'LcdpRemoteComponent', name: 'LcdpRemoteComponent',
mixins: [linkageMixins, commonMixins], mixins: [linkageMixins, commonMixins],
@ -50,10 +51,18 @@ export default {
'config.option.theme': { 'config.option.theme': {
handler (val) { handler (val) {
if (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 () { created () {
this.getRemoteComponent() this.getRemoteComponent()
@ -133,13 +142,19 @@ export default {
// export default // export default
settingContent = settingContent.replace(/export default[\s\S]*/, '') settingContent = settingContent.replace(/export default[\s\S]*/, '')
eval(settingContent) eval(settingContent)
// this.config.option = {
// ...this.config.option,
// ...option
// }
this.config.option = { this.config.option = {
...this.config.option, ...option,
...option ...this.config.option
} }
this.config.setting = setting this.config.setting = setting
//
// this.config.theme = settingToTheme(cloneDeep(this.config), this.customTheme)
// settingtheme // settingtheme
this.config.theme = settingToTheme(this.config, this.customTheme) // this.config.theme = settingToTheme(this.config, this.customTheme)
return { return {
option, option,
@ -196,10 +211,8 @@ export default {
return config return config
}, },
// config // config
changeStyle (config) { changeStyle (config, isUpdateTheme) {
config = { ...this.config, ...config } config = { ...this.config, ...config }
//
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
config = this.transformSettingToOption(config, 'custom') config = this.transformSettingToOption(config, 'custom')
// optionsettingeval,optionHandlerdataHandler // optionsettingeval,optionHandlerdataHandler
const option = config.option const option = config.option
@ -212,6 +225,10 @@ export default {
console.error(e) console.error(e)
} }
} }
//
if (!isUpdateTheme) {
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
}
if (this.chart) { if (this.chart) {
this.chart.update(config.option) this.chart.update(config.option)
} }

Loading…
Cancel
Save