fix: 修改 system 回显错误的问题
This commit is contained in:
@@ -85,7 +85,7 @@ export default {
|
||||
let expressionIndex = expressionIndexs
|
||||
let legend = '' // up
|
||||
let alias = ''
|
||||
if (expressionIndex >= chartInfo.elements.length) {
|
||||
if (chartInfo.elements && (expressionIndex >= chartInfo.elements.length)) {
|
||||
expressionIndex -= chartInfo.elements.length
|
||||
legend += 'Previous '
|
||||
alias += 'Previous '
|
||||
|
||||
@@ -399,7 +399,6 @@ export default {
|
||||
unitChange (val) {
|
||||
this.$emit('update:chartInfo', 'unit', val)
|
||||
this.chartInfo.unit = val
|
||||
console.log(this.chartInfo.unit)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart()
|
||||
})
|
||||
|
||||
@@ -163,7 +163,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
unit: {
|
||||
immediate: true,
|
||||
handler (n, o) {
|
||||
this.$emit('unitChange', n)
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ export default {
|
||||
this.$put('visual/panel/chart', params).then(response => {
|
||||
if (response.code === 200) {
|
||||
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)
|
||||
} else {
|
||||
this.$message.error(response.msg)
|
||||
@@ -204,7 +204,7 @@ export default {
|
||||
this.$post('visual/panel/chart', params).then(response => {
|
||||
if (response.code === 200) {
|
||||
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)
|
||||
} else {
|
||||
this.$message.error(response.msg)
|
||||
|
||||
@@ -529,7 +529,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
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.systemSelectChange(0)
|
||||
}
|
||||
@@ -547,7 +547,7 @@ export default {
|
||||
if (res.code === 200) {
|
||||
this.systemData = JSON.parse(res.data.paramValue)
|
||||
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.groupList = this.systemData[0].group
|
||||
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'), {
|
||||
confirmButtonText: this.$t('tip.yes'),
|
||||
cancelButtonText: this.$t('tip.no'),
|
||||
|
||||
Reference in New Issue
Block a user