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"
v-loading="tableLoading"
:data="tableData"
default-expand-all
row-key="id"
lazy
:load="nextTree"
:tree-props="{ children: 'children',hasChildren: 'hasChildren'}"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
:height="tableHeight"
@ -290,19 +291,40 @@ export default {
let params = {
limit: this.pageSize,
page: this.pageNo,
parentId:0,
...this.formData,
};
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
// this.total = data.total;
data.forEach(item=>{
item.hasChildren =true;
})
this.tableData = data;
} else {
this.$message.error(msg);
}
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) {
if (type) {
const lable = this.unitList.filter((item) => item.value == type)[0]

Loading…
Cancel
Save