NEZ-1631 fix:列表页面 默认排序字段 初始化状态修复

This commit is contained in:
zhangyu
2022-03-04 13:59:25 +08:00
parent 5e8964932f
commit be959ad26b
37 changed files with 54 additions and 13 deletions

View File

@@ -26,7 +26,7 @@ export default {
data () {
return {
operationWidth: '165', // 操作列宽
orderBy: {},
orderBy: null,
severityDataWeight: this.$store.getters.severityDataWeight
}
},
@@ -131,10 +131,12 @@ export default {
if (n) {
const index = n.indexOf('-')
if (index !== -1) {
this.orderBy[n.slice(index + 1)] = 'descending'
this.orderBy = { prop: n.slice(index + 1), order: 'descending' }
} else {
this.orderBy[n] = 'descending'
this.orderBy = { prop: n, order: 'ascending' }
}
// this.orderBy = JSON.parse(JSON.stringify(this.orderBy))
console.log(n, this.orderBy)
}
}
},