Commit baaa07e4 authored by leon's avatar leon

feat:fix some bug

parent 9e7f2148
...@@ -130,10 +130,12 @@ ...@@ -130,10 +130,12 @@
} }
if(chart) { if(chart) {
const option = chart.getOption() const option = chart.getOption()
if(option) {
option.series = dealSeries option.series = dealSeries
// 重新setOption,使得设置的formatter生效 // 重新setOption,使得设置的formatter生效
chart.setOption(option) chart.setOption(option)
} }
}
}) })
}, },
......
...@@ -33,6 +33,10 @@ export default { ...@@ -33,6 +33,10 @@ export default {
async handleDynamicData (value) { async handleDynamicData (value) {
const that = this const that = this
let { dataUrl, dataMethod, dataFormatter, dataProcessing, dataConfig } = { ...value } let { dataUrl, dataMethod, dataFormatter, dataProcessing, dataConfig } = { ...value }
if (!dataUrl.length) {
return
}
if(value.queryFormatter) dataFormatter = {...dataFormatter, ...value.queryFormatter} if(value.queryFormatter) dataFormatter = {...dataFormatter, ...value.queryFormatter}
dataUrl = dataUrl.replace(/^(\/(dashboardCharts|dashboardAPI))?/, '') dataUrl = dataUrl.replace(/^(\/(dashboardCharts|dashboardAPI))?/, '')
dataFormatter = that.$u.common.filterRequestParams({...dataFormatter}) dataFormatter = that.$u.common.filterRequestParams({...dataFormatter})
...@@ -214,7 +218,7 @@ export default { ...@@ -214,7 +218,7 @@ export default {
}, },
'elementData.dataList': { 'elementData.dataList': {
handler(newVal,oldVal) { handler(newVal,oldVal) {
if (JSON.stringify(newVal) !== JSON.stringify(oldVal) ) { if (JSON.stringify(newVal) !== '{}' && JSON.stringify(newVal) !== JSON.stringify(oldVal) ) {
this.setStorageData() this.setStorageData()
this.initChart() this.initChart()
} }
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
if (Status === 'true') { if (Status === 'true') {
if(info.dataUrl) { if(info.dataUrl) {
that.getGlobalData(info, list) that.getGlobalData(info, list)
if(info.dataPollingInterval) { if(info.dataPolling && info.dataPollingInterval > 0) {
that.timename = setInterval(() => { that.timename = setInterval(() => {
that.getGlobalData(info, list) that.getGlobalData(info, list)
}, parseInt(info.dataPollingInterval) * 1000) }, parseInt(info.dataPollingInterval) * 1000)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment