fix: 修改 system 回显错误的问题
This commit is contained in:
@@ -85,7 +85,7 @@ export default {
|
|||||||
let expressionIndex = expressionIndexs
|
let expressionIndex = expressionIndexs
|
||||||
let legend = '' // up
|
let legend = '' // up
|
||||||
let alias = ''
|
let alias = ''
|
||||||
if (expressionIndex >= chartInfo.elements.length) {
|
if (chartInfo.elements && (expressionIndex >= chartInfo.elements.length)) {
|
||||||
expressionIndex -= chartInfo.elements.length
|
expressionIndex -= chartInfo.elements.length
|
||||||
legend += 'Previous '
|
legend += 'Previous '
|
||||||
alias += 'Previous '
|
alias += 'Previous '
|
||||||
|
|||||||
@@ -399,7 +399,6 @@ export default {
|
|||||||
unitChange (val) {
|
unitChange (val) {
|
||||||
this.$emit('update:chartInfo', 'unit', val)
|
this.$emit('update:chartInfo', 'unit', val)
|
||||||
this.chartInfo.unit = val
|
this.chartInfo.unit = val
|
||||||
console.log(this.chartInfo.unit)
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart()
|
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
unit: {
|
unit: {
|
||||||
immediate: true,
|
|
||||||
handler (n, o) {
|
handler (n, o) {
|
||||||
this.$emit('unitChange', n)
|
this.$emit('unitChange', n)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export default {
|
|||||||
this.$put('visual/panel/chart', params).then(response => {
|
this.$put('visual/panel/chart', params).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
this.$emit('on-create-success')
|
this.$emit('on-create-success', { id: this.panelId, name: this.panelName })
|
||||||
this.esc(true)
|
this.esc(true)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg)
|
this.$message.error(response.msg)
|
||||||
@@ -204,7 +204,7 @@ export default {
|
|||||||
this.$post('visual/panel/chart', params).then(response => {
|
this.$post('visual/panel/chart', params).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
this.$emit('on-create-success')
|
this.$emit('on-create-success', { id: this.panelId, name: this.panelName })
|
||||||
this.esc(true)
|
this.esc(true)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg)
|
this.$message.error(response.msg)
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectList (n) {
|
selectList (n) {
|
||||||
if (n.length === 1 && !this.chartConfig.param.datasource[0].systemSelect) {
|
if (!this.chartConfig.param.datasource[0].systemSelect) {
|
||||||
this.chartConfig.param.datasource[0].systemSelect = this.selectList[0].name
|
this.chartConfig.param.datasource[0].systemSelect = this.selectList[0].name
|
||||||
this.systemSelectChange(0)
|
this.systemSelectChange(0)
|
||||||
}
|
}
|
||||||
@@ -547,7 +547,7 @@ export default {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.systemData = JSON.parse(res.data.paramValue)
|
this.systemData = JSON.parse(res.data.paramValue)
|
||||||
if (this.systemData.length) {
|
if (this.systemData.length) {
|
||||||
if (!this.chartConfig.param.system) {
|
if (!this.chartConfig.param.datasource[0].type) {
|
||||||
this.chartConfig.param.datasource[0].type = this.systemData[0].name
|
this.chartConfig.param.datasource[0].type = this.systemData[0].name
|
||||||
this.groupList = this.systemData[0].group
|
this.groupList = this.systemData[0].group
|
||||||
this.selectList = this.systemData[0].select
|
this.selectList = this.systemData[0].select
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createSuccess (type, response, param, panel) {
|
createSuccess (panel) {
|
||||||
this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), {
|
this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), {
|
||||||
confirmButtonText: this.$t('tip.yes'),
|
confirmButtonText: this.$t('tip.yes'),
|
||||||
cancelButtonText: this.$t('tip.no'),
|
cancelButtonText: this.$t('tip.no'),
|
||||||
|
|||||||
Reference in New Issue
Block a user