表格排序
This commit is contained in:
@@ -119,7 +119,9 @@ export default {
|
|||||||
value: 'id',
|
value: 'id',
|
||||||
checkStrictly: true,
|
checkStrictly: true,
|
||||||
},
|
},
|
||||||
chooseUserList: []
|
chooseUserList: [],
|
||||||
|
sortFiled: '',
|
||||||
|
sortRule: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -155,7 +157,8 @@ export default {
|
|||||||
...this.page,
|
...this.page,
|
||||||
...this.search,
|
...this.search,
|
||||||
current: this.current,
|
current: this.current,
|
||||||
|
sortFiled: this.sortFiled,
|
||||||
|
sortRule: this.sortRule
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res?.data) {
|
if(res?.data) {
|
||||||
@@ -166,16 +169,12 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
selectPerson(val) {
|
selectPerson(val) {
|
||||||
this.personList = val
|
if (val) {
|
||||||
this.form.ids = [...this.personList.map(e => e.id)]
|
this.personList = val
|
||||||
// .concat(this.chooseUserList.map(v=>v.id))
|
this.form.ids = [...this.personList.map(e => e.id)]
|
||||||
// if (val) {
|
} else {
|
||||||
// this.form.residentId = val.id
|
this.form.ids = this.chooseUserList.map(e => e.id)
|
||||||
// this.personList = [{...val}]
|
}
|
||||||
// } else {
|
|
||||||
// this.form.residentId = ""
|
|
||||||
// this.personList = []
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
changeIntegral(row,type) {
|
changeIntegral(row,type) {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
@@ -186,7 +185,7 @@ export default {
|
|||||||
id: row.id,
|
id: row.id,
|
||||||
name: row.userName
|
name: row.userName
|
||||||
}]
|
}]
|
||||||
// this.personList = this.chooseUserList.map(e => e.id)
|
this.form.ids = this.chooseUserList.map(e => e.id)
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -226,21 +225,42 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
changeTableSort(col) {
|
changeTableSort(col) {
|
||||||
console.log(col);
|
// console.log(col);
|
||||||
if(col.prop === 'integral') { // 剩余积分
|
if(col.prop === 'integral') { // 剩余积分
|
||||||
// col.order === 'ascending' &&
|
if(col.order === 'ascending') {
|
||||||
// col.order === 'descending' &&
|
this.sortFiled = 0
|
||||||
// col.order === null &&
|
this.sortRule = true
|
||||||
|
} else if(col.order === 'descending') {
|
||||||
|
this.sortFiled = 0
|
||||||
|
this.sortRule = false
|
||||||
|
} else if(col.order === null) {
|
||||||
|
this.sortFiled = ''
|
||||||
|
this.sortRule = ''
|
||||||
|
}
|
||||||
} else if(col.prop === 'totalIntegral') { // 累计积分
|
} else if(col.prop === 'totalIntegral') { // 累计积分
|
||||||
// col.order === 'ascending' &&
|
if(col.order === 'ascending') {
|
||||||
// col.order === 'descending' &&
|
this.sortFiled = 1
|
||||||
// col.order === null &&
|
this.sortRule = true
|
||||||
|
} else if(col.order === 'descending') {
|
||||||
|
this.sortFiled = 1
|
||||||
|
this.sortRule = false
|
||||||
|
} else if(col.order === null) {
|
||||||
|
this.sortFiled = ''
|
||||||
|
this.sortRule = ''
|
||||||
|
}
|
||||||
} else if(col.prop === 'usedIntegral') { // 已用积分
|
} else if(col.prop === 'usedIntegral') { // 已用积分
|
||||||
// col.order === 'ascending' &&
|
if(col.order === 'ascending') {
|
||||||
// col.order === 'descending' &&
|
this.sortFiled = 2
|
||||||
// col.order === null &&
|
this.sortRule = true
|
||||||
|
} else if(col.order === 'descending') {
|
||||||
|
this.sortFiled = 2
|
||||||
|
this.sortRule = false
|
||||||
|
} else if(col.order === null) {
|
||||||
|
this.sortFiled = ''
|
||||||
|
this.sortRule = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// this.getTableData()
|
this.getTableData()
|
||||||
},
|
},
|
||||||
|
|
||||||
onConfirm() {
|
onConfirm() {
|
||||||
|
|||||||
Reference in New Issue
Block a user