Browse Source

党建移风列表改成懒加载

master
mk 1 year ago
parent
commit
d88f7da28e
  1. 28
      src/views/modules/communityParty/partyBuilding/activitys.vue

28
src/views/modules/communityParty/partyBuilding/activitys.vue

@ -75,8 +75,9 @@
class="resi-table" class="resi-table"
v-loading="tableLoading" v-loading="tableLoading"
:data="tableData" :data="tableData"
default-expand-all
row-key="id" row-key="id"
lazy
:load="nextTree"
:tree-props="{ children: 'children',hasChildren: 'hasChildren'}" :tree-props="{ children: 'children',hasChildren: 'hasChildren'}"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" :header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
:height="tableHeight" :height="tableHeight"
@ -290,19 +291,40 @@ export default {
let params = { let params = {
limit: this.pageSize, limit: this.pageSize,
page: this.pageNo, page: this.pageNo,
parentId:0,
...this.formData, ...this.formData,
}; };
const { data, code, msg } = await requestGet(url, params); const { data, code, msg } = await requestGet(url, params);
if (code === 0) { if (code === 0) {
// this.total = data.total; // this.total = data.total;
data.forEach(item=>{
item.hasChildren =true;
})
this.tableData = data; this.tableData = data;
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
this.tableLoading = false; this.tableLoading = false;
}, },
async nextTree(tree, treeNode, resolve){
const url = "/resi/partymember/icpartyplace/getPageList";
let params = {
limit: this.pageSize,
page: this.pageNo,
parentId:tree.id,
...this.formData,
};
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
data.forEach(item=>{
item.hasChildren =true;
})
resolve(data)
} else {
resolve(null)
this.$message.error(msg);
}
},
getTypeLable(type) { getTypeLable(type) {
if (type) { if (type) {
const lable = this.unitList.filter((item) => item.value == type)[0] const lable = this.unitList.filter((item) => item.value == type)[0]

Loading…
Cancel
Save