feat: chartBox 添加关闭页面的编辑

This commit is contained in:
zhangyu
2021-07-05 11:47:29 +08:00
parent 20215b4906
commit 3c073186ef
2 changed files with 23 additions and 1 deletions

View File

@@ -499,6 +499,7 @@ import nezhaColor from '../../common/nezhaColor'
import i18n from '../../common/i18n'
import { fromRoute } from '@/components/common/js/constants'
import diagram from '@/components/common/ChartDiagram/diagram'
import rightBoxMain from '@/components/common/mixin/rightBox'
const rz = {
methods: {
rz (e) {
@@ -519,7 +520,7 @@ export default {
default: false
}
},
mixins: [rz],
mixins: [rz, rightBoxMain],
data () {
return {
fromRoute,
@@ -1753,12 +1754,16 @@ export default {
created () {
this.getSuggestMetric()
this.queryMetrics()
console.log(this.isEdit)
},
watch: {
chart: {
deep: true,
immediate: true,
handler (n) {
if (n.id) {
this.isEdit = true
}
if ((n.param && n.param.valueMapping) && (n.type === 'singleStat' || n.type === 'table')) {
n.param.valueMapping.mapping.forEach(item => {
this.showPicker.push({ bac: false, text: false })