NEZ-1263 fix: Chart legend 匹配内容有误
This commit is contained in:
@@ -640,15 +640,19 @@ export default {
|
|||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dealLegendAlias (legend, expression) {
|
dealLegendAlias: function (legend, expression) {
|
||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -542,11 +542,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -618,11 +618,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1784,11 +1784,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1579,7 +1579,7 @@ export default {
|
|||||||
this.echartModalStore.showLoading();
|
this.echartModalStore.showLoading();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
let self = this
|
const self = this
|
||||||
let axiosArr = []
|
let axiosArr = []
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let startTime = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss')
|
let startTime = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss')
|
||||||
@@ -1827,11 +1827,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -696,11 +696,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1010,11 +1010,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1023,11 +1023,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -494,11 +494,15 @@ export default {
|
|||||||
if (/\{\{.+\}\}/.test(expression)) {
|
if (/\{\{.+\}\}/.test(expression)) {
|
||||||
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
const labelValue = expression.replace(/(\{\{.+?\}\})/g, function (i) {
|
||||||
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
|
||||||
const reg = new RegExp(label + '=".+?"')
|
const reg = new RegExp(',' + label + '=".+?"')
|
||||||
|
const reg1 = new RegExp('{' + label + '=".+?"')
|
||||||
let value = null
|
let value = null
|
||||||
if (reg.test(legend)) {
|
if (reg.test(legend)) {
|
||||||
const find = legend.match(reg)[0]
|
const find = legend.match(reg)[0]
|
||||||
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
|
} else if (reg1.test(legend)) {
|
||||||
|
const find = legend.match(reg1)[0]
|
||||||
|
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
|
||||||
}
|
}
|
||||||
return value || label
|
return value || label
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user