fix: 修复 domain 数据重复请求问题
This commit is contained in:
@@ -185,23 +185,6 @@ export default {
|
|||||||
...this.entity,
|
...this.entity,
|
||||||
...extraParams
|
...extraParams
|
||||||
}
|
}
|
||||||
if (this.isSingleValue) {
|
|
||||||
if (chartParams && chartParams.dataKey) {
|
|
||||||
get(replaceUrlPlaceholder(chartParams.url), this.queryParams).then(response =>{
|
|
||||||
if (response.code === 200) {
|
|
||||||
if (response.data.result && (response.data.result[chartParams.dataKey] || response.data.result[chartParams.dataKey] === 0)) {
|
|
||||||
this.chartData = response.data.result[chartParams.dataKey]
|
|
||||||
} else {
|
|
||||||
this.chartData = ''
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.isError = true
|
|
||||||
this.noData = true
|
|
||||||
this.errorInfo = response.msg || response.message || 'Unknown'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const requestUrl = url || (chartParams && chartParams.url)
|
const requestUrl = url || (chartParams && chartParams.url)
|
||||||
if (requestUrl) {
|
if (requestUrl) {
|
||||||
get(replaceUrlPlaceholder(requestUrl, this.queryParams)).then(response => {
|
get(replaceUrlPlaceholder(requestUrl, this.queryParams)).then(response => {
|
||||||
@@ -216,6 +199,13 @@ export default {
|
|||||||
this.table.tableColumns = this.getTableTitle(response.data.result)
|
this.table.tableColumns = this.getTableTitle(response.data.result)
|
||||||
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
|
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
|
||||||
this.resultType = response.data.resultType
|
this.resultType = response.data.resultType
|
||||||
|
if (this.isSingleValue) {
|
||||||
|
if (chartParams && chartParams.dataKey) {
|
||||||
|
if (response.data.result && (response.data.result[chartParams.dataKey] || response.data.result[chartParams.dataKey] === 0)) {
|
||||||
|
this.chartData = response.data.result[chartParams.dataKey]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.isError = false
|
this.isError = false
|
||||||
} else {
|
} else {
|
||||||
this.isError = true
|
this.isError = true
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
handleSingleValue () {
|
handleSingleValue () {
|
||||||
const value = this.chartData ? this.chartData : ''
|
const value = this.$_.isEmpty(this.chartData) ? this.chartData : ''
|
||||||
const unitType = this.chartInfo.params.unitType
|
const unitType = this.chartInfo.params.unitType
|
||||||
const result = unitConvert(value, unitType)
|
const result = unitConvert(value, unitType)
|
||||||
switch (unitType) {
|
switch (unitType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user