fix:修改chartStat 显示不正确的问题
This commit is contained in:
@@ -55,6 +55,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
initStatData (chartInfo, originalDatas) {
|
initStatData (chartInfo, originalDatas) {
|
||||||
|
this.statData = []
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let colorIndex = 0
|
let colorIndex = 0
|
||||||
originalDatas.forEach((originalData, expressionIndex) => {
|
originalDatas.forEach((originalData, expressionIndex) => {
|
||||||
|
|||||||
@@ -6,16 +6,37 @@ export default {
|
|||||||
const q = this.$route.query
|
const q = this.$route.query
|
||||||
lodash.forIn(searchKeys, (val, key) => {
|
lodash.forIn(searchKeys, (val, key) => {
|
||||||
let qv = lodash.get(q, key)
|
let qv = lodash.get(q, key)
|
||||||
|
console.log(qv, q, key, val)
|
||||||
if (qv && val.type == 'number') {
|
if (qv && val.type == 'number') {
|
||||||
qv = lodash.toNumber(qv)
|
qv = lodash.toNumber(qv)
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setSearchInput(val, qv)
|
||||||
|
}, 200)
|
||||||
qv && this.$set(val.target, val.propertyName, qv)
|
qv && this.$set(val.target, val.propertyName, qv)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 更新path,包含请求参数
|
// 更新path,包含请求参数
|
||||||
updatePath (param, path) {
|
updatePath (param, path) {
|
||||||
console.log(param)
|
// console.log(param)
|
||||||
this.$router.replace({ path: path, query: param }).catch(err => {})
|
this.$router.replace({ path: path, query: param }).catch(err => {})
|
||||||
|
},
|
||||||
|
setSearchInput (val, qv) {
|
||||||
|
let dataList = ''
|
||||||
|
if (this.detailType !== 'view') {
|
||||||
|
dataList = 'dataList'
|
||||||
|
} else {
|
||||||
|
dataList = 'detailList'
|
||||||
|
}
|
||||||
|
if (val.isSearchInput) {
|
||||||
|
setTimeout(() => {
|
||||||
|
const obj = lodash.cloneDeep(val.defaultJson)
|
||||||
|
obj[val.jsonKey] = qv
|
||||||
|
this.$refs[dataList].$refs.searchInput.select_list.push(obj)
|
||||||
|
this.$refs[dataList].$refs.searchInput.sreach_num++
|
||||||
|
// this.$refs[dataList].$refs.searchInput.searchLabelList = this.$refs[dataList].$refs.searchInput.searchLabelList.filter(item => item.label !== 'projectIds')
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,9 +344,38 @@ export default {
|
|||||||
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
||||||
ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' },
|
ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' },
|
||||||
severityIds: { target: this.searchLabel, propertyName: 'severityIds', type: 'string' },
|
severityIds: { target: this.searchLabel, propertyName: 'severityIds', type: 'string' },
|
||||||
type: { target: this.searchLabel, propertyName: 'type', type: 'number' },
|
type: {
|
||||||
name: { target: this.searchLabel, propertyName: 'name', type: 'string' }
|
target: this.searchLabel,
|
||||||
|
propertyName: 'type',
|
||||||
|
type: 'number',
|
||||||
|
isSearchInput: true,
|
||||||
|
defaultJson:
|
||||||
|
{
|
||||||
|
name: 'Type',
|
||||||
|
id: 5,
|
||||||
|
type: 'alertTypes',
|
||||||
|
label: 'type',
|
||||||
|
disabled: false,
|
||||||
|
readonly: true,
|
||||||
|
val: 'Metrics',
|
||||||
|
valnum: 1,
|
||||||
|
valString: ''
|
||||||
|
},
|
||||||
|
jsonKey: 'valnum'
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
target: this.searchLabel,
|
||||||
|
propertyName: 'name',
|
||||||
|
type: 'string',
|
||||||
|
isSearchInput: true,
|
||||||
|
defaultJson: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Object.keys(this.$route.query).forEach(key => {
|
||||||
|
this.$set(searchKeys[key].target, key, this.$route.query[key])
|
||||||
|
})
|
||||||
this.initQueryFromPath(searchKeys)
|
this.initQueryFromPath(searchKeys)
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
Reference in New Issue
Block a user