Commit 632f1b51 by chenwq

refactor(residentManage): 移除重复员工数据合并逻辑

原代码将全部员工和已选员工列表合并,但实际只需要全部员工数据。移除冗余的concat操作以简化逻辑并提高性能。
1 parent a008fa3c
...@@ -245,7 +245,8 @@ export default { ...@@ -245,7 +245,8 @@ export default {
}, },
async getStaff() { async getStaff() {
const { startTime, endTime } = this.templateData const { startTime, endTime } = this.templateData
const staff = (await getAllStaff({ startTime, endTime })) // 过滤了已绑定的 // 全部员工
const staff = (await getAllStaff({ startTime, endTime }))
const params = { const params = {
typeName: this.templateData.typeName, typeName: this.templateData.typeName,
templateCode: this.templateData.code, templateCode: this.templateData.code,
...@@ -253,7 +254,7 @@ export default { ...@@ -253,7 +254,7 @@ export default {
endTime endTime
} }
const selectStaff = await getStaffList(params) const selectStaff = await getStaffList(params)
const allStaff = staff.concat(selectStaff) const allStaff = staff
// console.log(allStaff); // console.log(allStaff);
allStaff.forEach((item, index) => { allStaff.forEach((item, index) => {
item.key = index item.key = index
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!