NEZ-2681 fix:panel更改为dashboard

This commit is contained in:
zyh
2023-03-15 15:39:06 +08:00
parent 0ad70b7463
commit 90692487f0
68 changed files with 371 additions and 1383 deletions

View File

@@ -234,7 +234,7 @@ export default {
const arr = [this.$refs.chartForm.validate()]
arr.push(this.$refs['childrenFrom' + this.editChart.datasource].$refs.chartForm.validate())
Promise.all(arr).then(res => {
this.editChart.panelId = this.panelId
this.editChart.dashboardId = this.dashboardId
const params = JSON.parse(JSON.stringify(this.editChart))
if (params.param.valueMapping) {
params.param.valueMapping.forEach(item => {
@@ -284,19 +284,19 @@ export default {
params.param.datasource[0].filter = params.param.datasource[0].filter.filter(item => item.value)
}
if (params.id) { // 修改
this.$put('visual/panel/chart', params).then(response => {
this.$put('visual/dashboard/chart', params).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
if (resetFlag) {
bus.$emit('creat-chart-success', {
...params,
cb: function () {
self.$emit('on-create-success', { id: this.panelId, name: this.panelName })
self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName })
self.esc(true)
}
})
} else {
self.$emit('on-create-success', { id: this.panelId, name: this.panelName })
self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName })
self.esc(true)
}
} else {
@@ -304,19 +304,19 @@ export default {
}
})
} else { // 新增
this.$post('visual/panel/chart', params).then(response => {
this.$post('visual/dashboard/chart', params).then(response => {
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
if (resetFlag) {
bus.$emit('creat-chart-success', {
...params,
cb: function () {
self.$emit('on-create-success', { id: this.panelId, name: this.panelName })
self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName })
self.esc(true)
}
})
} else {
self.$emit('on-create-success', { id: this.panelId, name: this.panelName })
self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName })
self.esc(true)
}
} else {
@@ -332,9 +332,9 @@ export default {
selectPanel (panel) {
this.panelName = panel.name
this.editChart.panelName = panel.name
this.panelId = panel.id
this.dashboardId = panel.id
this.editChart.groupId = ''
this.$get('visual/panel/chart?panelId=' + this.panelId + '&pageSize=-1').then(response => {
this.$get('visual/dashboard/chart?dashboardId=' + this.dashboardId + '&pageSize=-1').then(response => {
if (response.code === 200) {
this.groupArr = []
response.data.list.forEach((item, index) => {
@@ -352,7 +352,7 @@ export default {
this.$emit('reloadOnlyPanel')
},
getGroupList () {
this.$get('visual/panel/chart?panelId=' + this.panelId + '&pageSize=-1').then(response => {
this.$get('visual/dashboard/chart?dashboardId=' + this.dashboardId + '&pageSize=-1').then(response => {
if (response.code === 200) {
this.groupArr = []
response.data.list.forEach((item, index) => {
@@ -525,7 +525,7 @@ export default {
deep: true,
handler () {
if (this.showPanel && (this.showPanel.id || this.from === 'chartTemp')) {
this.panelId = this.showPanel.id
this.dashboardId = this.showPanel.id
this.panelName = this.showPanel.name
this.editChart.panelName = this.showPanel.name
}