Browse Source

区域 新增占用

master
WIN-IDGBLFHC1K6\Administrator 3 years ago
parent
commit
9b552db701
  1. 17
      src/views/farm/area/index.vue

17
src/views/farm/area/index.vue

@ -34,6 +34,16 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="区域名" align="center" prop="name" />
<el-table-column label="是否占用" align="center" prop="occupied" />
<el-table-column label="唯一占用" align="center" prop="occupied" >
<template slot-scope="scope">
<el-button type="danger" v-if="scope.row.occupied">未占用</el-button>
<el-button type="success" v-if="!scope.row.occupied">已占用</el-button>
</template>
</el-table-column>
<el-table-column label="面积(亩)" align="center" prop="area" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@ -147,20 +157,19 @@ export default {
if(filterList.length == 0){
//
this.list.forEach(t => {
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList});
oneList.push({id:one.id, name:one.name, occupied:one.occupied, createTime:one.createTime, children:twoList});
})
}else{
filterList.forEach((one) => {
let twoList = [];
this.list.forEach((two) => {
if(one.id == two.parentId){
twoList.push({id:two.id, name:two.name, createTime:two.createTime})
twoList.push({id:two.id, name:two.name, occupied:two.occupied, createTime:two.createTime})
}
})
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList});
oneList.push({id:one.id, name:one.name, occupied:one.occupied, createTime:one.createTime, children:twoList});
})
}
this.list = oneList;
this.loading = false;
});

Loading…
Cancel
Save