NEZ-3142 fix:新建图表引用dashboard变量选择多个值后点击刷新按钮,group重复显示
This commit is contained in:
@@ -198,7 +198,6 @@ export default {
|
|||||||
const series = this.$lodash.cloneDeep(this.series)
|
const series = this.$lodash.cloneDeep(this.series)
|
||||||
const dataArg = series.filter((seriesItem, seriesIndex) => !this.isGrey[seriesIndex])
|
const dataArg = series.filter((seriesItem, seriesIndex) => !this.isGrey[seriesIndex])
|
||||||
const option = this.renderYAxis(dataArg, chartInfo, 'legend')
|
const option = this.renderYAxis(dataArg, chartInfo, 'legend')
|
||||||
console.log(option)
|
|
||||||
getChart(this.chartId) && getChart(this.chartId).setOption({
|
getChart(this.chartId) && getChart(this.chartId).setOption({
|
||||||
yAxis: [
|
yAxis: [
|
||||||
...option.yAxis
|
...option.yAxis
|
||||||
|
|||||||
@@ -594,7 +594,6 @@ export default {
|
|||||||
})
|
})
|
||||||
this.onScroll(this.scrollTop)
|
this.onScroll(this.scrollTop)
|
||||||
},
|
},
|
||||||
|
|
||||||
// group设置repeat 便利变量重复渲染图表
|
// group设置repeat 便利变量重复渲染图表
|
||||||
repeatVariableFn () {
|
repeatVariableFn () {
|
||||||
// 防止group中的chartList执行
|
// 防止group中的chartList执行
|
||||||
@@ -742,7 +741,6 @@ export default {
|
|||||||
handler (newVal, oldVal) {
|
handler (newVal, oldVal) {
|
||||||
// 比较变量 图表是否显示/隐藏
|
// 比较变量 图表是否显示/隐藏
|
||||||
this.compareVariables()
|
this.compareVariables()
|
||||||
|
|
||||||
this.repeatVariableFn()
|
this.repeatVariableFn()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -785,7 +783,8 @@ export default {
|
|||||||
const position = getLayoutPosition(n)
|
const position = getLayoutPosition(n)
|
||||||
this.$store.commit('setChartLastPosition', position)
|
this.$store.commit('setChartLastPosition', position)
|
||||||
}
|
}
|
||||||
const tempList = n.map(item => {
|
const cloneDataList = this.$lodash.cloneDeep(n)
|
||||||
|
const tempList = cloneDataList.map(item => {
|
||||||
let param = ''
|
let param = ''
|
||||||
let height = item.height || ''
|
let height = item.height || ''
|
||||||
if (this.isPhone && item.type !== 'group') {
|
if (this.isPhone && item.type !== 'group') {
|
||||||
@@ -848,11 +847,10 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.copyDataList = JSON.parse(JSON.stringify(tempList))
|
this.copyDataList = this.$lodash.cloneDeep(tempList)
|
||||||
this.tempList = JSON.parse(JSON.stringify(this.copyDataList))
|
this.tempList = JSON.parse(JSON.stringify(this.copyDataList))
|
||||||
// 比较变量 图表是否显示/隐藏
|
// 比较变量 图表是否显示/隐藏
|
||||||
this.compareVariables()
|
this.compareVariables()
|
||||||
|
|
||||||
this.repeatVariableFn()
|
this.repeatVariableFn()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.gridLayoutShow = true
|
this.gridLayoutShow = true
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
renderYAxis (chartDatas, chartInfo, type) {
|
renderYAxis (chartDatas, chartInfo, type) {
|
||||||
let chartData = lodash.cloneDeep(chartDatas)
|
let chartData = lodash.cloneDeep(chartDatas)
|
||||||
console.log(chartData)
|
|
||||||
if (type === 'legend') {
|
if (type === 'legend') {
|
||||||
chartData.forEach(item => {
|
chartData.forEach(item => {
|
||||||
item.values = item.data
|
item.values = item.data
|
||||||
@@ -32,7 +31,6 @@ export default {
|
|||||||
// 左y轴
|
// 左y轴
|
||||||
const leftData = chartData.filter(item => item[0] && !item[0].yAxisIndex)
|
const leftData = chartData.filter(item => item[0] && !item[0].yAxisIndex)
|
||||||
const leftInfo = this.getMinMaxFromData(leftData, chartInfo.unit, chartInfo.param) //
|
const leftInfo = this.getMinMaxFromData(leftData, chartInfo.unit, chartInfo.param) //
|
||||||
console.log(leftData, leftInfo)
|
|
||||||
chartOption.yAxis[0].minInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'min')
|
chartOption.yAxis[0].minInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'min')
|
||||||
chartOption.yAxis[0].maxInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'max') * Math.ceil(this.series.length / 5)
|
chartOption.yAxis[0].maxInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'max') * Math.ceil(this.series.length / 5)
|
||||||
if (chartInfo.param.stack) {
|
if (chartInfo.param.stack) {
|
||||||
@@ -65,7 +63,6 @@ export default {
|
|||||||
const allRight = this.series.every(item => item.yAxisIndex == 1)
|
const allRight = this.series.every(item => item.yAxisIndex == 1)
|
||||||
chartOption.yAxis[1].splitLine.show = allRight
|
chartOption.yAxis[1].splitLine.show = allRight
|
||||||
const rightData = chartData.filter(item => item[0] && item[0].yAxisIndex)
|
const rightData = chartData.filter(item => item[0] && item[0].yAxisIndex)
|
||||||
console.log(rightData, unit)
|
|
||||||
const rightInfo = this.getMinMaxFromData(rightData, lodash.get(chartInfo, 'param.rightYAxis.unit', 2), lodash.get(chartInfo, 'param.rightYAxis', {}))//
|
const rightInfo = this.getMinMaxFromData(rightData, lodash.get(chartInfo, 'param.rightYAxis.unit', 2), lodash.get(chartInfo, 'param.rightYAxis', {}))//
|
||||||
chartOption.yAxis[1].minInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'min')
|
chartOption.yAxis[1].minInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'min')
|
||||||
chartOption.yAxis[1].maxInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'max') * Math.ceil(this.series.length / 5)
|
chartOption.yAxis[1].maxInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'max') * Math.ceil(this.series.length / 5)
|
||||||
@@ -95,7 +92,6 @@ export default {
|
|||||||
delete chartOption.yAxis[1].max
|
delete chartOption.yAxis[1].max
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(chartOption)
|
|
||||||
return chartOption
|
return chartOption
|
||||||
},
|
},
|
||||||
getMinMaxFromData (originalDatas, chartUnit = 2, params) {
|
getMinMaxFromData (originalDatas, chartUnit = 2, params) {
|
||||||
|
|||||||
@@ -114,9 +114,6 @@ export default {
|
|||||||
const consoleBox = document.getElementById('ternimalContainer' + this.idIndex)
|
const consoleBox = document.getElementById('ternimalContainer' + this.idIndex)
|
||||||
const width = document.body.clientWidth - 10// 可视宽度
|
const width = document.body.clientWidth - 10// 可视宽度
|
||||||
const height = parseInt(consoleBox.offsetHeight) - 10
|
const height = parseInt(consoleBox.offsetHeight) - 10
|
||||||
console.log(width, height)
|
|
||||||
console.log(this.term.cols)
|
|
||||||
console.log(this.term.rows)
|
|
||||||
const winStyle = {
|
const winStyle = {
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
@@ -367,14 +364,12 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
renderTerminalSetting () {
|
renderTerminalSetting () {
|
||||||
console.log('renderTerminalSetting')
|
|
||||||
this.showWatermark = this.terminalSetting.watermark
|
this.showWatermark = this.terminalSetting.watermark
|
||||||
this.wordSeparator = this.terminalSetting.wordSeparator
|
this.wordSeparator = this.terminalSetting.wordSeparator
|
||||||
this.term.options = {
|
this.term.options = {
|
||||||
scrollback: this.terminalSetting.scrollbackLines,
|
scrollback: this.terminalSetting.scrollbackLines,
|
||||||
wordSeparator: this.terminalSetting.wordSeparator
|
wordSeparator: this.terminalSetting.wordSeparator
|
||||||
}
|
}
|
||||||
console.log(this.term)
|
|
||||||
},
|
},
|
||||||
copySelection () {
|
copySelection () {
|
||||||
let str = this.term.getSelection()
|
let str = this.term.getSelection()
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
init () {
|
init () {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(this.alertLabelData)
|
|
||||||
},
|
},
|
||||||
getRemoteText (record) {
|
getRemoteText (record) {
|
||||||
return `${record.loginUser}@${record.host}:${record.port}`
|
return `${record.loginUser}@${record.host}:${record.port}`
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ export default {
|
|||||||
if (simpleTemp.indexOf(',') !== -1) {
|
if (simpleTemp.indexOf(',') !== -1) {
|
||||||
simpleTemp = simpleTemp.substr(0, simpleTemp.length - 1)
|
simpleTemp = simpleTemp.substr(0, simpleTemp.length - 1)
|
||||||
}
|
}
|
||||||
console.log(simpleTemp)
|
|
||||||
tableData.tableDateAll = simpleTemp
|
tableData.tableDateAll = simpleTemp
|
||||||
tableDates.push(tableData)
|
tableDates.push(tableData)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 创建连接
|
// 创建连接
|
||||||
create () {
|
create () {
|
||||||
console.log('create')
|
|
||||||
const that = this
|
const that = this
|
||||||
if (this.terminalSocket) {
|
if (this.terminalSocket) {
|
||||||
this.terminalSocket.close()
|
this.terminalSocket.close()
|
||||||
@@ -206,7 +205,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
consoleResize () {
|
consoleResize () {
|
||||||
console.log('consoleResize')
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.termFitAddon.fit()
|
this.termFitAddon.fit()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -383,8 +383,7 @@ export default {
|
|||||||
this.$set(this.$parent.showPanel, 'starred', this.starredList.some(item => item.id === this.showPanel.id) ? 1 : 0)
|
this.$set(this.$parent.showPanel, 'starred', this.starredList.some(item => item.id === this.showPanel.id) ? 1 : 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
}, 300, true),
|
||||||
300, true),
|
|
||||||
// 删除收藏
|
// 删除收藏
|
||||||
delStarred: bus.debounceFn(function (data) {
|
delStarred: bus.debounceFn(function (data) {
|
||||||
this.$delete('/sys/user/starred?type=dashboard&tid=' + data.id).then(async response => {
|
this.$delete('/sys/user/starred?type=dashboard&tid=' + data.id).then(async response => {
|
||||||
|
|||||||
@@ -459,7 +459,6 @@ export default {
|
|||||||
reader.onload = (evt) => { // 读取完文件之后会回来这里
|
reader.onload = (evt) => { // 读取完文件之后会回来这里
|
||||||
let fileString = evt.target.result // 读取文件内容
|
let fileString = evt.target.result // 读取文件内容
|
||||||
fileString = JSON.parse(fileString)
|
fileString = JSON.parse(fileString)
|
||||||
console.log(fileString)
|
|
||||||
if (!fileString.topo) {
|
if (!fileString.topo) {
|
||||||
this.$message.error(this.$t('IMPORT_FORMAT_ERROR', { 0: '' }))
|
this.$message.error(this.$t('IMPORT_FORMAT_ERROR', { 0: '' }))
|
||||||
return
|
return
|
||||||
@@ -468,7 +467,6 @@ export default {
|
|||||||
fileString.topo.pens.forEach(item => {
|
fileString.topo.pens.forEach(item => {
|
||||||
item.imageId = ''
|
item.imageId = ''
|
||||||
})
|
})
|
||||||
console.log(fileString)
|
|
||||||
this.$post(this.importUrl, fileString).then(response => {
|
this.$post(this.importUrl, fileString).then(response => {
|
||||||
if (response.code == 200 && response.msg == 'success') {
|
if (response.code == 200 && response.msg == 'success') {
|
||||||
this.$message.success(this.$t('overall.result.success'))
|
this.$message.success(this.$t('overall.result.success'))
|
||||||
|
|||||||
@@ -332,7 +332,6 @@ export default {
|
|||||||
this.renderTopology()
|
this.renderTopology()
|
||||||
},
|
},
|
||||||
renderTopology () {
|
renderTopology () {
|
||||||
console.log('render')
|
|
||||||
getTopology(this.meta2dId).render()
|
getTopology(this.meta2dId).render()
|
||||||
},
|
},
|
||||||
penEnter (pen, e) { // 移入节点
|
penEnter (pen, e) { // 移入节点
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$emit('clickProfile', false)
|
this.$emit('clickProfile', false)
|
||||||
}
|
}
|
||||||
console.log(this.editProfile)
|
|
||||||
localStorage.setItem('nz-userInfo', JSON.stringify(this.editProfile))
|
localStorage.setItem('nz-userInfo', JSON.stringify(this.editProfile))
|
||||||
bus.$emit('login')
|
bus.$emit('login')
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ export default {
|
|||||||
changeInr () {
|
changeInr () {
|
||||||
if (!this.editRecordRule.inr) {
|
if (!this.editRecordRule.inr) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log(123123)
|
|
||||||
this.editRecordRule.inr = undefined
|
this.editRecordRule.inr = undefined
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ export default {
|
|||||||
this.esc(false)
|
this.esc(false)
|
||||||
},
|
},
|
||||||
iconActive (subItem) {
|
iconActive (subItem) {
|
||||||
console.log(subItem, this.editSoftwareType.icon)
|
|
||||||
if (this.editSoftwareType.icon === subItem.value) {
|
if (this.editSoftwareType.icon === subItem.value) {
|
||||||
this.editSoftwareType.icon = undefined
|
this.editSoftwareType.icon = undefined
|
||||||
this.$set(this.editSoftwareType, 'icon', '')
|
this.$set(this.editSoftwareType, 'icon', '')
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ export default {
|
|||||||
if (timePickerLocked) {
|
if (timePickerLocked) {
|
||||||
const timePickerRange = localStorage.getItem('nz-time-picker-range') ? JSON.parse(localStorage.getItem('nz-time-picker-range')) : {}
|
const timePickerRange = localStorage.getItem('nz-time-picker-range') ? JSON.parse(localStorage.getItem('nz-time-picker-range')) : {}
|
||||||
this.$store.dispatch('dispatchTimePickerRange', timePickerRange)
|
this.$store.dispatch('dispatchTimePickerRange', timePickerRange)
|
||||||
console.log('mounted', timePickerRange, this.timePickerLocked)
|
|
||||||
}
|
}
|
||||||
this.$store.dispatch('dispatchTimePickerLocked', timePickerLocked)
|
this.$store.dispatch('dispatchTimePickerLocked', timePickerLocked)
|
||||||
},
|
},
|
||||||
@@ -353,7 +352,6 @@ export default {
|
|||||||
localStorage.setItem('nz-time-picker-locked', JSON.stringify(this.timePickerLocked))
|
localStorage.setItem('nz-time-picker-locked', JSON.stringify(this.timePickerLocked))
|
||||||
this.$store.dispatch('dispatchTimePickerLocked', this.timePickerLocked)
|
this.$store.dispatch('dispatchTimePickerLocked', this.timePickerLocked)
|
||||||
if (this.timePickerLocked) {
|
if (this.timePickerLocked) {
|
||||||
console.log(this.searchTime, this.nowTimeType)
|
|
||||||
this.$store.dispatch('dispatchTimePickerRange', {
|
this.$store.dispatch('dispatchTimePickerRange', {
|
||||||
time: this.searchTime,
|
time: this.searchTime,
|
||||||
nowTimeType: this.nowTimeType
|
nowTimeType: this.nowTimeType
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ export default {
|
|||||||
if (timePickerLocked) {
|
if (timePickerLocked) {
|
||||||
const timePickerRange = localStorage.getItem('nz-time-picker-range') ? JSON.parse(localStorage.getItem('nz-time-picker-range')) : {}
|
const timePickerRange = localStorage.getItem('nz-time-picker-range') ? JSON.parse(localStorage.getItem('nz-time-picker-range')) : {}
|
||||||
this.$store.dispatch('dispatchTimePickerRange', timePickerRange)
|
this.$store.dispatch('dispatchTimePickerRange', timePickerRange)
|
||||||
console.log('mounted', timePickerRange, this.timePickerLocked)
|
|
||||||
}
|
}
|
||||||
this.$store.dispatch('dispatchTimePickerLocked', timePickerLocked)
|
this.$store.dispatch('dispatchTimePickerLocked', timePickerLocked)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -457,7 +457,6 @@ export default {
|
|||||||
if (!q.startAt) {
|
if (!q.startAt) {
|
||||||
this.searchTime[2] = 'all'
|
this.searchTime[2] = 'all'
|
||||||
}
|
}
|
||||||
console.log(this.searchTime[2], this.searchTime[0], this.searchTime[1])
|
|
||||||
switch (this.searchTime[2]) {
|
switch (this.searchTime[2]) {
|
||||||
case '5m' :
|
case '5m' :
|
||||||
this.defaultPick = 1
|
this.defaultPick = 1
|
||||||
@@ -864,7 +863,6 @@ export default {
|
|||||||
const path = this.fromRoute.alertMessage
|
const path = this.fromRoute.alertMessage
|
||||||
const routePathParams = this.$lodash.cloneDeep(param)
|
const routePathParams = this.$lodash.cloneDeep(param)
|
||||||
delete routePathParams.statistics
|
delete routePathParams.statistics
|
||||||
console.log(this.searchTime)
|
|
||||||
routePathParams.body.startAt = this.searchTime[0] ? this.momentStrToTimestamp(this.searchTime[0]) : ''
|
routePathParams.body.startAt = this.searchTime[0] ? this.momentStrToTimestamp(this.searchTime[0]) : ''
|
||||||
routePathParams.body.endAt = this.searchTime[1] ? this.momentStrToTimestamp(this.searchTime[1]) : ''
|
routePathParams.body.endAt = this.searchTime[1] ? this.momentStrToTimestamp(this.searchTime[1]) : ''
|
||||||
routePathParams.body.timeType = this.searchTime[2]
|
routePathParams.body.timeType = this.searchTime[2]
|
||||||
|
|||||||
@@ -3658,7 +3658,6 @@ export default {
|
|||||||
},
|
},
|
||||||
setTimePickerRange () {
|
setTimePickerRange () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
console.log(this.timePickerLocked, !this.timePickerRange.nowTimeType)
|
|
||||||
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const timePicker = {
|
|||||||
store.commit('setTimePickerLocked', flag)
|
store.commit('setTimePickerLocked', flag)
|
||||||
},
|
},
|
||||||
dispatchTimePickerRange (store, range) {
|
dispatchTimePickerRange (store, range) {
|
||||||
console.log('dispatchTimePickerRange', range)
|
|
||||||
store.commit('setTimePickerRange', range)
|
store.commit('setTimePickerRange', range)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user