feat:修复业务组件和系统组件主题设置的问题

main
liu.shiyi 2 years ago
parent 02cc30e6fa
commit 847f9d21b7

@ -68,6 +68,11 @@ export default {
const pageInfo = this.pageInfo const pageInfo = this.pageInfo
pageInfo.chartList = themeToSetting(pageInfo.chartList, val) pageInfo.chartList = themeToSetting(pageInfo.chartList, val)
this.changePageInfo(pageInfo) this.changePageInfo(pageInfo)
pageInfo.chartList.forEach(chart => {
if (chart.type === 'remoteComponent') {
this.$emit('styleHandler', chart)
}
})
} }
} }
} }

@ -376,7 +376,7 @@ export default {
this.changePageInfo(pageInfo) this.changePageInfo(pageInfo)
pageInfo.chartList.forEach(chart => { pageInfo.chartList.forEach(chart => {
if (chart.type === 'remoteComponent') { if (chart.type === 'remoteComponent') {
// this.$refs['remoteComponent' + chart.code]?.changeStyle(chart) this.$emit('styleHandler', chart)
} }
}) })
}, },

@ -25,6 +25,7 @@
v-if="!chartSettingShow" v-if="!chartSettingShow"
ref="OverallSetting" ref="OverallSetting"
@close="close" @close="close"
@styleHandler="styleHandler"
/> />
</div> </div>
</div> </div>
@ -78,6 +79,9 @@ export default {
}, },
mounted () { }, mounted () { },
methods: { methods: {
styleHandler (config) {
this.$emit('styleHandler', config)
},
toggleShow () { toggleShow () {
this.$emit('update:rightVisiable', !this.rightVisiable) this.$emit('update:rightVisiable', !this.rightVisiable)
}, },

@ -87,6 +87,7 @@
@updateSetting="updateSetting" @updateSetting="updateSetting"
@updateDataSetting="updateDataSetting" @updateDataSetting="updateDataSetting"
@updatePage="updatePage" @updatePage="updatePage"
@styleHandler="styleHandler"
> >
<template #dataSetSelect="{ value }"> <template #dataSetSelect="{ value }">
<slot <slot
@ -396,9 +397,17 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
//
styleHandler (config) {
this.$nextTick(() => {
this.$refs.Render?.$refs['RenderCard' + config.code][0]?.$refs[
config.code
]?.changeStyle(cloneDeep(config), true)
})
},
// //
updateSetting (config) { updateSetting (config) {
if (config.type === 'map' || config.type === 'video' ||config.type === 'flyMap') { if (config.type === 'map' || config.type === 'video' || config.type === 'flyMap') {
config.key = new Date().getTime() config.key = new Date().getTime()
} }
this.changeChartConfig(cloneDeep(config)) this.changeChartConfig(cloneDeep(config))

@ -26,6 +26,7 @@
ref="RenderCardRef" ref="RenderCardRef"
:key="chart.key" :key="chart.key"
:config="chart" :config="chart"
@styleHandler="styleHandler"
/> />
</div> </div>
</div> </div>
@ -38,6 +39,7 @@ import RenderCard from 'data-room-ui/Render/RenderCard.vue'
import { mapActions, mapMutations, mapState } from 'vuex' import { mapActions, mapMutations, mapState } from 'vuex'
import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js' import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js'
import NotPermission from 'data-room-ui/NotPermission' import NotPermission from 'data-room-ui/NotPermission'
import cloneDeep from 'lodash/cloneDeep'
export default { export default {
name: 'BigScreenRun', name: 'BigScreenRun',
components: { components: {
@ -168,6 +170,14 @@ export default {
'changePageConfig', 'changePageConfig',
'changeChartConfig' 'changeChartConfig'
]), ]),
//
styleHandler (config) {
this.chartList.forEach((chart, index) => {
if (chart.code === config.code) {
this.$refs.RenderCardRef[index].$refs[chart.code].changeStyle(config)
}
})
},
permission () { permission () {
this.$dataRoomAxios.get(`/bigScreen/permission/check/${this.pageCode}`).then(res => { this.$dataRoomAxios.get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
this.hasPermission = res this.hasPermission = res

@ -47,22 +47,6 @@ export default {
} }
}, },
watch: { watch: {
//
'config.option.theme': {
handler (val) {
if (val) {
this.changeStyle(this.config, true)
}
}
}
// customTheme: {
// handler (val) {
// if (val) {
// this.changeStyle(this.config, true)
// }
// },
// deep: true
// }
}, },
created () { created () {
this.getRemoteComponent() this.getRemoteComponent()

@ -12,6 +12,7 @@
:ref="config.code" :ref="config.code"
:key="config.key" :key="config.key"
:config="config" :config="config"
@styleHandler="styleHandler"
/> />
</div> </div>
</template> </template>
@ -24,6 +25,7 @@ import { dataInit, destroyedEvent } from 'data-room-ui/js/utils/eventBus'
import CustomComponent from '../PlotRender/index.vue' import CustomComponent from '../PlotRender/index.vue'
import Svgs from '../Svgs/index.vue' import Svgs from '../Svgs/index.vue'
import RemoteComponent from 'data-room-ui/RemoteComponents/index.vue' import RemoteComponent from 'data-room-ui/RemoteComponents/index.vue'
import cloneDeep from 'lodash/cloneDeep'
const components = {} const components = {}
for (const key in pcComponent) { for (const key in pcComponent) {
if (Object.hasOwnProperty.call(pcComponent, key)) { if (Object.hasOwnProperty.call(pcComponent, key)) {
@ -55,6 +57,7 @@ export default {
}, },
computed: {}, computed: {},
mounted () { mounted () {
console.log(this.$refs)
// //
dataInit(this) dataInit(this)
}, },
@ -65,7 +68,11 @@ export default {
...mapMutations('bigScreen', [ ...mapMutations('bigScreen', [
'changeChartConfig' 'changeChartConfig'
]), ]),
resolveComponentType resolveComponentType,
//
styleHandler (config) {
this.$emit('styleHandler', config)
}
} }
} }
</script> </script>

@ -54,6 +54,7 @@
<RenderCard <RenderCard
:ref="'RenderCard' + chart.code" :ref="'RenderCard' + chart.code"
:config="chart" :config="chart"
@styleHandler="styleHandler"
/> />
</Configuration> </Configuration>
</vdr> </vdr>
@ -165,6 +166,14 @@ export default {
'setPresetLine', 'setPresetLine',
'saveTimeLine' 'saveTimeLine'
]), ]),
//
styleHandler (config) {
this.$nextTick(() => {
this.$refs['RenderCard' + config.code][0]?.$refs[
config.code
]?.changeStyle(cloneDeep(config), true)
})
},
// //
styleSet () { styleSet () {
const style = document.createElement('style') const style = document.createElement('style')

Loading…
Cancel
Save