Merge pull request #3510 from dataease/pr@dev_eslint_auto_fix

fix: S2报错修复
This commit is contained in:
fit2cloud-chenyw 2022-10-28 12:28:17 +08:00 committed by GitHub
commit b95a3b2396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 24 deletions

View File

@ -263,7 +263,7 @@ const data = {
} else { } else {
state.componentData.push(component) state.componentData.push(component)
} }
this.commit('setCurComponent', { component: component, index: index ? index : state.componentData.length - 1 }) this.commit('setCurComponent', { component: component, index: index || state.componentData.length - 1 })
}, },
removeViewFilter(state, componentId) { removeViewFilter(state, componentId) {
state.componentData = state.componentData.map(item => { state.componentData = state.componentData.map(item => {

View File

@ -3,7 +3,6 @@ import { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table
import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart' import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart'
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import Vue from 'vue'
export function baseTableInfo(s2, container, chart, action, tableData) { export function baseTableInfo(s2, container, chart, action, tableData) {
const containerDom = document.getElementById(container) const containerDom = document.getElementById(container)
@ -12,7 +11,6 @@ export function baseTableInfo(s2, container, chart, action, tableData) {
if (!fields || fields.length === 0) { if (!fields || fields.length === 0) {
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2()
} }
return return
} }
@ -140,7 +138,6 @@ export function baseTableInfo(s2, container, chart, action, tableData) {
// 开始渲染 // 开始渲染
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2
} }
s2 = new TableSheet(containerDom, s2DataConfig, s2Options) s2 = new TableSheet(containerDom, s2DataConfig, s2Options)
@ -163,7 +160,6 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
if (!fields || fields.length === 0) { if (!fields || fields.length === 0) {
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2
} }
return return
} }
@ -278,7 +274,6 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
// 开始渲染 // 开始渲染
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2()
} }
s2 = new TableSheet(containerDom, s2DataConfig, s2Options) s2 = new TableSheet(containerDom, s2DataConfig, s2Options)
@ -315,7 +310,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
if (!fields || fields.length === 0) { if (!fields || fields.length === 0) {
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2()
} }
return return
} }
@ -437,7 +431,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
// 开始渲染 // 开始渲染
if (s2) { if (s2) {
s2.destroy() s2.destroy()
destroyS2()
} }
s2 = new PivotSheet(containerDom, s2DataConfig, s2Options) s2 = new PivotSheet(containerDom, s2DataConfig, s2Options)
@ -451,13 +444,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
return s2 return s2
} }
function destroyS2(s2) {
for (const i in s2) {
Vue.$delete(s2, i)
}
s2 = null
}
function getCurrentField(valueFieldList, field) { function getCurrentField(valueFieldList, field) {
let list = [] let list = []
let res = null let res = null

View File

@ -225,7 +225,6 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.scrollTimer) clearInterval(this.scrollTimer)
this.destroyS2()
}, },
methods: { methods: {
initData() { initData() {
@ -268,13 +267,6 @@ export default {
}) })
} }
}, },
destroyS2() {
if (!this.myChart) return
for (const i in this.myChart) {
this.$delete(this.myChart, i)
}
this.myChart = null
},
drawView() { drawView() {
const chart = this.chart const chart = this.chart
// type // type
@ -300,7 +292,6 @@ export default {
if (this.myChart) { if (this.myChart) {
this.antVRenderStatus = false this.antVRenderStatus = false
this.myChart.destroy() this.myChart.destroy()
this.destroyS2()
} }
} }