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

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

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

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

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

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

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

@ -47,22 +47,6 @@ export default {
}
},
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 () {
this.getRemoteComponent()

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

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

Loading…
Cancel
Save