feat:修复业务组件数据回显问题

main
liu.shiyi 2 years ago
parent 62ff66f146
commit 9f7dc56519

@ -13,8 +13,10 @@ import * as $dataRoomAxios from 'data-room-ui/js/utils/http.js'
import { registerConfig } from '@gcpaas/data-room-ui' import { registerConfig } from '@gcpaas/data-room-ui'
import remoteComponents from '@/remoteComponents/exports.js' import remoteComponents from '@/remoteComponents/exports.js'
import customDatasetComponents from '@/customDatasetComponents/exports.js' import customDatasetComponents from '@/customDatasetComponents/exports.js'
import { Column } from '@antv/g2plot';
// import customPlots from '@/customPlots/exports' // import customPlots from '@/customPlots/exports'
Vue.use(ElementUI, { size: 'mini' }) Vue.use(ElementUI, { size: 'mini' })
Vue.prototype.Column = Column
registerConfig( registerConfig(
{ {
routers: { routers: {

@ -85,7 +85,7 @@ export default {
const data = await getBizComponentInfo(this.$route.query?.code) const data = await getBizComponentInfo(this.$route.query?.code)
this.vueContentInner = data.vueContent this.vueContentInner = data.vueContent
this.settingContentInner = data.settingContent this.settingContentInner = data.settingContent
this.dataFormatting(this.config) this.config = this.dataFormatting(this.config)
this.remoteComponent = remoteVueLoader('data:text/plain,' + encodeURIComponent(this.vueContentInner)) this.remoteComponent = remoteVueLoader('data:text/plain,' + encodeURIComponent(this.vueContentInner))
this.loading = false this.loading = false
} }
@ -105,7 +105,7 @@ export default {
// //
getRemoteComponent () { getRemoteComponent () {
this.loading = true this.loading = true
this.dataFormatting(this.config, { success: false }) this.config = this.dataFormatting(this.config, { success: false })
this.remoteComponent = remoteVueLoader('data:text/plain,' + encodeURIComponent(this.vueContentInner)) this.remoteComponent = remoteVueLoader('data:text/plain,' + encodeURIComponent(this.vueContentInner))
this.loading = false this.loading = false
}, },
@ -115,6 +115,7 @@ export default {
*/ */
// config.settingoption // config.settingoption
transformSettingToOption (config, type) { transformSettingToOption (config, type) {
let option = null let option = null
config.setting.forEach(set => { config.setting.forEach(set => {
if (set.optionField) { if (set.optionField) {
@ -154,7 +155,7 @@ export default {
config.option.data = data config.option.data = data
} else { } else {
// //
config.option.data = this.plotList?.find(plot => plot.name === config.name)?.option?.data config.option.data = this.plotList?.find(plot => plot.name === config.name)?.option?.data || config.option.data
} }
return config return config
}, },

Loading…
Cancel
Save