fix: 抽取修改别名方法为全局 修改正则

This commit is contained in:
zhangyu
2021-11-17 18:24:30 +08:00
parent c76c0511c9
commit 170b6a4749
13 changed files with 40 additions and 209 deletions

View File

@@ -293,7 +293,7 @@ import chartGroup from './chart-group'
import logs from './logs'
import { fromRoute } from '@/components/common/js/constants'
import chartTempData from '@/components/charts/chartTempData'
import { chartResizeTool } from '@/components/common/js/tools'
import { chartResizeTool, dealLegendAlias } from '@/components/common/js/tools'
export default {
name: 'chartList',
props: {
@@ -1164,7 +1164,7 @@ export default {
host = chartItem.elements[innerPos].expression
}
// 处理legend别名
let alias = this.$refs['editChart' + chartItem.id][0].dealLegendAlias(host, chartItem.elements[innerPos].legend)
let alias = dealLegendAlias(host, chartItem.elements[innerPos].legend)
if (!alias || alias === '') {
alias = host
}
@@ -1404,7 +1404,7 @@ export default {
host += '}'
}
// 处理legend别名
let alias = this.$refs['editChart' + chartInfo.id][0].dealLegendAlias(host, chartInfo.elements[0].legend)
let alias = dealLegendAlias(host, chartInfo.elements[0].legend)
if (!alias || alias === '') {
alias = host
}