优化调整

This commit is contained in:
aixianling
2024-10-23 09:44:53 +08:00
parent 055c6a4579
commit 984da801c8
2 changed files with 11 additions and 9 deletions

View File

@@ -57,9 +57,16 @@ export default {
})).then(res => {
if (res?.data) {
this.summary = res.data.total
this.tableData = res.data?.page?.records || []
return this.tableData = res.data?.page?.records || []
}
})
},
getOptions() {
const ops = {}
this.tableData.forEach(e => {
ops[e.groupCode] = e.supervisorName
})
return Object.entries(ops).map(([key, value]) => ({label: value, value: key}))
}
},
watch: {
@@ -71,9 +78,7 @@ export default {
},
created() {
this.getTableData().then(() => {
this.options = this.tableData.map(e => ({
label: e.supervisorName, value: e.groupCode
}))
this.options = this.getOptions()
})
}
}