Browse Source

11.14

master
lichong 5 months ago
parent
commit
84127872da
  1. 23
      src/renderer/src/views/chufang.vue

23
src/renderer/src/views/chufang.vue

@ -95,24 +95,13 @@ export default {
//
async updateSeach() {
this.loading = true
let allChufangList = _.cloneDeep(await myDatabase.chufang.toArray())
let dataTemp = []
if (_.trim(this.searchParams.xingming)) {
for (let i = 0; i < allChufangList.length; i++) {
let element = allChufangList[i];
if (element.xingming.includes(_.trim(this.searchParams.xingming))) {
dataTemp.push({ ...element })
}
}
} else {
dataTemp = _.cloneDeep(allChufangList)
}
let dataTempSort = dataTemp
if (_.get(this.sortObj, ["sort"], "")) {
//
dataTempSort = _.orderBy(dataTemp, [this.sortObj.prop], [_.get(this.sortObj, ["sort"], "") === 1 ? 'desc' : 'asc'])
let that = this
let collection = myDatabase.chufang
if (that.searchParams.xingming) {
let reg = new RegExp(that.searchParams.xingming, "i")
collection = collection.filter((equip) => reg.test(equip.xingming))
}
this.tableData = _.uniqBy(dataTempSort, "id")
this.tableData = await collection.toArray();
this.loading = false
},
//

Loading…
Cancel
Save