fix: 视图插件切换别的视图报错

This commit is contained in:
fit2cloud-chenyw 2022-03-21 14:06:46 +08:00
parent dba486d9b0
commit 7d5452b64b
4 changed files with 12 additions and 11 deletions

View File

@ -83,11 +83,11 @@
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.2</version>
</dependency>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -16,7 +16,6 @@ import io.dataease.plugins.view.entity.*;
import io.dataease.plugins.view.service.ViewPluginBaseService;
import io.dataease.provider.ProviderFactory;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.datasource.DatasourceProvider;
import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.dataset.DataSetTableUnionService;
import org.apache.commons.lang3.ObjectUtils;

View File

@ -585,7 +585,7 @@ export default {
const current = this.$refs[this.element.propValue.id]
if (this.chart.isPlugin) {
current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: null })
current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: null })
} else {
current && current.registerDynamicMap && current.registerDynamicMap(null)
}
@ -615,7 +615,7 @@ export default {
this.currentAcreaNode = tempNode
const current = this.$refs[this.element.propValue.id]
if (this.chart.isPlugin) {
current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: this.currentAcreaNode.code })
current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: this.currentAcreaNode.code })
} else {
current && current.registerDynamicMap && current.registerDynamicMap(this.currentAcreaNode.code)
}
@ -636,7 +636,7 @@ export default {
this.currentAcreaNode = nextNode
const current = this.$refs[this.element.propValue.id]
if (this.chart.isPlugin) {
nextNode && current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: nextNode.code })
nextNode && current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: nextNode.code })
} else {
nextNode && current && current.registerDynamicMap && current.registerDynamicMap(nextNode.code)
}
@ -670,7 +670,7 @@ export default {
const current = this.$refs[this.element.propValue.id]
if (this.chart.isPlugin) {
current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: areaNode.code })
current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: areaNode.code })
} else {
current && current.registerDynamicMap && current.registerDynamicMap(areaNode.code)
}

View File

@ -1394,11 +1394,13 @@ export default {
this.fieldFilter(val)
},
'chartType': function(newVal, oldVal) {
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal)
if ((newVal === 'map' || newVal === 'buddle-map') && newVal !== oldVal) {
this.initAreas()
}
this.$emit('typeChange', newVal)
},
'view.type': function(newVal, oldVal) {
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal)
}
},
created() {
@ -2383,7 +2385,7 @@ export default {
this.currentAcreaNode = null
const current = this.$refs.dynamicChart
if (this.view.isPlugin) {
current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: null })
current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: null })
} else {
current && current.registerDynamicMap && current.registerDynamicMap(null)
}
@ -2416,7 +2418,7 @@ export default {
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(this.currentAcreaNode.code)
const current = this.$refs.dynamicChart
if (this.view.isPlugin) {
current && current.callPluginInner({
current && current.callPluginInner && current.callPluginInner({
methodName: 'registerDynamicMap',
methodParam: this.currentAcreaNode.code
})
@ -2443,7 +2445,7 @@ export default {
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
const current = this.$refs.dynamicChart
if (this.view.isPlugin) {
nextNode && current && current.callPluginInner({
nextNode && current && current.callPluginInner && current.callPluginInner({
methodName: 'registerDynamicMap',
methodParam: nextNode.code
})