feat:Data link编辑页面开发
This commit is contained in:
@@ -261,7 +261,8 @@ export default {
|
||||
label: '',
|
||||
min: undefined,
|
||||
max: undefined
|
||||
}
|
||||
},
|
||||
dataLink: []
|
||||
},
|
||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
||||
panel: '',
|
||||
@@ -275,12 +276,6 @@ export default {
|
||||
pageSize: -1, // 此处获取所有数据
|
||||
total: 0
|
||||
},
|
||||
blankChartTemp: {
|
||||
varType: 1,
|
||||
pid: '',
|
||||
dashboardId: '',
|
||||
varIds: []
|
||||
},
|
||||
panelData: [],
|
||||
panelDataDragTmp: [],
|
||||
searchMsg: { // 给搜索框子组件传递的信息
|
||||
@@ -566,11 +561,6 @@ export default {
|
||||
this.$refs.addChartModal.isStable = 'stable'
|
||||
})
|
||||
},
|
||||
addChartByTemp () {
|
||||
this.chart = JSON.parse(JSON.stringify(this.blankChartTemp))
|
||||
this.chart.dashboardId = this.showPanel.id
|
||||
this.rightBox.chartTemp.show = true
|
||||
},
|
||||
addGroupItem (groupId) {
|
||||
this.chart = this.newChart()
|
||||
this.chart.groupId = groupId
|
||||
@@ -604,6 +594,23 @@ export default {
|
||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||
this.chart.groupId = ''
|
||||
}
|
||||
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||
this.chart.param.rightYAxis = {
|
||||
elementNames: [],
|
||||
style: 'line',
|
||||
unit: 2,
|
||||
label: '',
|
||||
min: undefined,
|
||||
max: undefined
|
||||
}
|
||||
}
|
||||
if (this.chart.type === 'stat') {
|
||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||
}
|
||||
if (!this.chart.param.dataLink) {
|
||||
this.chart.param.dataLink = []
|
||||
}
|
||||
} else {
|
||||
this.rightBox.loading = true
|
||||
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
||||
@@ -618,7 +625,10 @@ export default {
|
||||
} else {
|
||||
this.chart.param = {}
|
||||
}
|
||||
if (!this.chart.param.rightYAxis) {
|
||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||
this.chart.groupId = ''
|
||||
}
|
||||
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||
this.chart.param.rightYAxis = {
|
||||
elementNames: [],
|
||||
style: 'line',
|
||||
@@ -628,13 +638,13 @@ export default {
|
||||
max: undefined
|
||||
}
|
||||
}
|
||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||
this.chart.groupId = ''
|
||||
}
|
||||
if (this.chart.type === 'stat') {
|
||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||
}
|
||||
if (!this.chart.param.dataLink) {
|
||||
this.chart.param.dataLink = []
|
||||
}
|
||||
if (this.chart.type == 'table') {
|
||||
const arr = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
|
||||
this.chart.param.tags = arr.map((item) => {
|
||||
|
||||
Reference in New Issue
Block a user