Merge pull request #7832 from ulleo/dev

feat: 优化antv组合图插件页面加载速度
This commit is contained in:
ulleo 2024-01-25 16:28:21 +08:00 committed by GitHub
commit 23dd0ee9a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 6 deletions

View File

@ -32,7 +32,9 @@ import '@/utils/DateUtil'
import draggable from 'vuedraggable'
import deWebsocket from '@/websocket'
import { GaodeMap } from '@antv/l7-maps'
import { Mix } from '@antv/g2plot'
import * as echarts from 'echarts'
import { clear } from 'size-sensor'
import UmyUi from 'umy-ui'
// 全屏插件
import fullscreen from 'vue-fullscreen'
@ -58,6 +60,8 @@ Vue.prototype.$api = api
Vue.prototype.$echarts = echarts
Vue.prototype.$gaodeMap = GaodeMap
Vue.prototype.$Mix = Mix
Vue.prototype.$G2SizeSensorClear = clear
Vue.use(UmyUi)

View File

@ -31,6 +31,8 @@ import '@/utils/DateUtil'
import draggable from 'vuedraggable'
import deWebsocket from '@/websocket'
import { GaodeMap } from '@antv/l7-maps'
import { Mix } from '@antv/g2plot'
import { clear } from 'size-sensor'
import * as echarts from 'echarts'
import UmyUi from 'umy-ui'
// 全屏插件
@ -57,6 +59,8 @@ Vue.prototype.$api = api
Vue.prototype.$echarts = echarts
Vue.prototype.$gaodeMap = GaodeMap
Vue.prototype.$Mix = Mix
Vue.prototype.$G2SizeSensorClear = clear
Vue.use(UmyUi)

View File

@ -11,11 +11,9 @@
"buildPlugin": "node build/build-async-plugins.js"
},
"dependencies": {
"@antv/g2plot": "^2.4.31",
"@babel/polyfill": "^7.12.1",
"@babel/runtime": "^7.18.9",
"@riophae/vue-treeselect": "0.4.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"vue": "2.6.10",
"vue-i18n": "7.3.2",

View File

@ -32,7 +32,6 @@
</template>
<script>
import {Mix} from '@antv/g2plot'
import {uuid, hexColorToRGBA, setGradientColor} from '../../../utils/chartmix'
import ViewTrackBar from '../../../components/views/ViewTrackBar'
import {getRemark} from "../../../components/views/utils";
@ -44,7 +43,6 @@ import {
} from '../../../utils/map';
import ChartTitleUpdate from '../../../components/views/ChartTitleUpdate';
import {map, filter, join, flatten, cloneDeep} from 'lodash-es';
import {clear} from 'size-sensor'
import {valueFormatter} from '../../../utils/formatter'
export default {
@ -176,7 +174,7 @@ export default {
}
},
created() {
!this.$chartmix && (this.$chartmix = Mix)
!this.$chartmix && (this.$chartmix = this.$Mix)
},
mounted() {
this.preDraw()
@ -1153,7 +1151,7 @@ export default {
beforeDestroy() {
if (this.myChart.container) {
if (typeof this.myChart.container.getAttribute === 'function') {
clear(this.myChart.container)
this.$G2SizeSensorClear(this.myChart.container)
}
}
if (this.myChart) {