Commit 8f212b31 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化

parent e113ab7b
......@@ -22,10 +22,10 @@
<!-- 部门管理 -->
<div class="department-list">
<a-spin :spinning="deptLoading">
<div v-if="department.length">
<div v-if="departList.length">
<div
:class="{ department_off: true, active: active === i }"
v-for="(v, i) in department"
v-for="(v, i) in departList"
:key="v.id"
@click="changeDept(v.id, i)"
>
......@@ -331,6 +331,7 @@ export default {
visibleWork: false,
visibleAdd: false,
department: [], // 部门列表
departList: [], // 部门列表
deptTotal: 0, // 部门总数
windowData: [], // 窗口列表数据
page: 1,
......@@ -360,7 +361,8 @@ export default {
watch: {
deptSearchVal(newVal) {
if (newVal === "") {
this.getDeptListData();
this.departList = this.department;
// this.getDeptListData();
}
},
},
......@@ -407,12 +409,12 @@ export default {
siteId: this.siteId,
page: 1,
size: -1,
name: `%${this.deptSearchVal}%`,
});
this.deptLoading = false;
let { code, data } = res.data;
if (code === 1) {
this.department = data.data;
this.departList = data.data;
this.deptTotal = data.total;
}
},
......@@ -566,7 +568,10 @@ export default {
// 左边搜索
onSearch(val) {
if (val != "") {
this.getDeptListData();
this.departList = this.department.filter((v) => {
return v.name.includes(val);
});
// this.getDeptListData();
}
},
// 右边搜索
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment