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() { async updateSeach() {
this.loading = true this.loading = true
let allChufangList = _.cloneDeep(await myDatabase.chufang.toArray()) let that = this
let dataTemp = [] let collection = myDatabase.chufang
if (_.trim(this.searchParams.xingming)) { if (that.searchParams.xingming) {
for (let i = 0; i < allChufangList.length; i++) { let reg = new RegExp(that.searchParams.xingming, "i")
let element = allChufangList[i]; collection = collection.filter((equip) => reg.test(equip.xingming))
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'])
} }
this.tableData = _.uniqBy(dataTempSort, "id") this.tableData = await collection.toArray();
this.loading = false this.loading = false
}, },
// //

Loading…
Cancel
Save