楼栋统计
This commit is contained in:
		| @@ -1,66 +1,63 @@ | ||||
| <template> | ||||
|   <section class="AppPetitionManage"> | ||||
|     <ai-detail> | ||||
|       <!-- 标题 --> | ||||
|   <ai-list class="AppPetitionManage"> | ||||
|       <ai-title slot="title" title="楼栋管理" isShowBottomBorder /> | ||||
|       <template #content> | ||||
|       <template #left> | ||||
|          | ||||
|         <ai-tree-menu title="楼栋管理" @search="(v) => $refs.gridTree.filter(v)"> | ||||
|           <el-tree :data="treeData" ref="gridTree" :filter-node-method="handleTreeFilter" @node-click="handleSelectGrid" highlight-current node-key="id" :props="{ label: 'name', children: 'children' }" :default-expanded-keys="[defaultShowNodes]" /> | ||||
|           <el-tree :data="treeData" ref="gridTree" :filter-node-method="handleTreeFilter" @node-click="handleSelectGrid" highlight-current node-key="id" :props="{ label: 'name', children: 'children' }" /> | ||||
|         </ai-tree-menu> | ||||
|  | ||||
|         <div class="flex"> | ||||
|           <ai-search-bar bottomBorder> | ||||
|             <template slot="left"> | ||||
|               <!-- 定位状态 --> | ||||
|               <ai-select v-model="search.locationStatus" placeholder="定位状态" clearable :selectList="$dict.getDict('BuildLocationStatus')" @change=";(page.current = 1), getList()"></ai-select> | ||||
|             </template> | ||||
|  | ||||
|             <!-- 搜索 --> | ||||
|             <template slot="right"> | ||||
|               <el-input v-model="search.managerName" size="small" placeholder="楼栋号/楼长/联系方式" clearable @keyup.enter.native=";(page.current = 1), getList()" @clear=";(page.current = 1), (search.managerName = ''), getList()" suffix-icon="iconfont iconSearch" /> | ||||
|             </template> | ||||
|           </ai-search-bar> | ||||
|  | ||||
|           <ai-search-bar class="ai-search-ba"> | ||||
|             <template slot="left"> | ||||
|               <el-button icon="iconfont iconAdd" type="primary" size="small" @click="onAdd('')" :disabled="!isAdd">添加 </el-button> | ||||
|               <el-button icon="iconfont iconDelete" size="small" @click="removeAll" :disabled="ids.length == 0">删除 </el-button> | ||||
|             </template> | ||||
|  | ||||
|             <!-- 导入导出 --> | ||||
|             <template #right> | ||||
|               <ai-import :instance="instance" :dict="dict" type="appcommunitybuildinginfo" :importParams="{ areaId: user.info && user.info.areaId }" name="楼栋管理" @success="getList()"> | ||||
|                 <el-button icon="iconfont iconImport">导入</el-button> | ||||
|               </ai-import> | ||||
|               <ai-download :instance="instance" url="/app/appcommunitybuildinginfo/listExport" :params="param" fileName="楼栋管理模板" :disabled="tableData.length == 0"> | ||||
|                 <el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button> | ||||
|               </ai-download> | ||||
|             </template> | ||||
|           </ai-search-bar> | ||||
|  | ||||
|           <ai-table :tableData="tableData" :col-configs="colConfigs" :total="total" ref="aitableex" style="margin-top: 20px;" :current.sync="page.current" :size.sync="page.size" @getList="getList" @selection-change="(v) => (ids = v.map((e) => e.id))"> | ||||
|             <el-table-column slot="locationStatus" label="定位状态" align="center"> | ||||
|               <template slot-scope="{ row }"> | ||||
|                 <span style="color:red" v-if="row.locationStatus == 0">{{ dict.getLabel('BuildLocationStatus', row.locationStatus) }}</span> | ||||
|                 <span style="color:green" v-if="row.locationStatus == 1">{{ dict.getLabel('BuildLocationStatus', row.locationStatus) }}</span> | ||||
|               </template> | ||||
|             </el-table-column> | ||||
|  | ||||
|             <el-table-column slot="options" label="操作" align="center" width="240px" fixed="right"> | ||||
|               <div class="table-options" slot-scope="{ row }"> | ||||
|                 <el-button type="text" @click="onAdd(row.id)">编辑</el-button> | ||||
|                 <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||
|                 <el-button type="text" @click="toBuildMsg(row)">房屋信息</el-button> | ||||
|                 <el-button type="text" @click="$router.push({ name: '63', query: { communityId: row.communityId, buildingId: row.id, unitNum: 1, buildingNumber: row.buildingNumber } })"> | ||||
|                   楼栋模型 | ||||
|                 </el-button> | ||||
|               </div> | ||||
|             </el-table-column> | ||||
|           </ai-table> | ||||
|         </div> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|   </section> | ||||
|       <template #content> | ||||
|         <ai-search-bar bottomBorder> | ||||
|           <template slot="left"> | ||||
|             <!-- 定位状态 --> | ||||
|             <ai-select v-model="search.locationStatus" placeholder="定位状态" clearable :selectList="$dict.getDict('BuildLocationStatus')" @change=";(page.current = 1), getList()"></ai-select> | ||||
|           </template> | ||||
|  | ||||
|           <!-- 搜索 --> | ||||
|           <template slot="right"> | ||||
|             <el-input v-model="search.managerName" size="small" placeholder="楼栋号/楼长/联系方式" clearable @keyup.enter.native=";(page.current = 1), getList()" @clear=";(page.current = 1), (search.managerName = ''), getList()" suffix-icon="iconfont iconSearch" /> | ||||
|           </template> | ||||
|         </ai-search-bar> | ||||
|  | ||||
|         <ai-search-bar style="margin-top: 16px;"> | ||||
|           <template slot="left"> | ||||
|             <el-button icon="iconfont iconAdd" type="primary" size="small" @click="onAdd('')" :disabled="!isAdd">添加 </el-button> | ||||
|             <el-button icon="iconfont iconDelete" size="small" @click="removeAll" :disabled="ids.length == 0">删除 </el-button> | ||||
|           </template> | ||||
|  | ||||
|           <!-- 导入导出 --> | ||||
|           <template #right> | ||||
|             <ai-import :instance="instance" :dict="dict" type="appcommunitybuildinginfo" :importParams="{ areaId: user.info && user.info.areaId }" name="楼栋管理" @success="getList()"> | ||||
|               <el-button icon="iconfont iconImport">导入</el-button> | ||||
|             </ai-import> | ||||
|             <ai-download :instance="instance" url="/app/appcommunitybuildinginfo/listExport" :params="param" fileName="楼栋管理模板" :disabled="tableData.length == 0"> | ||||
|               <el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button> | ||||
|             </ai-download> | ||||
|           </template> | ||||
|         </ai-search-bar> | ||||
|  | ||||
|         <ai-table :tableData="tableData" :col-configs="colConfigs" :total="total" ref="aitableex" style="margin-top: 20px;" :current.sync="page.current" :size.sync="page.size" @getList="getList" @selection-change="(v) => (ids = v.map((e) => e.id))"> | ||||
|           <el-table-column slot="locationStatus" label="定位状态" align="center"> | ||||
|             <template slot-scope="{ row }"> | ||||
|               <span style="color:red" v-if="row.locationStatus == 0">{{ dict.getLabel('BuildLocationStatus', row.locationStatus) }}</span> | ||||
|               <span style="color:green" v-if="row.locationStatus == 1">{{ dict.getLabel('BuildLocationStatus', row.locationStatus) }}</span> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|  | ||||
|           <el-table-column slot="options" label="操作" align="center" width="240px" fixed="right"> | ||||
|             <div class="table-options" slot-scope="{ row }"> | ||||
|               <el-button type="text" @click="onAdd(row.id)">编辑</el-button> | ||||
|               <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||
|               <el-button type="text" @click="toBuildMsg(row)">房屋信息</el-button> | ||||
|               <el-button type="text" @click="$router.push({ name: '63', query: { communityId: row.communityId, buildingId: row.id, unitNum: 1, buildingNumber: row.buildingNumber } })"> | ||||
|                 楼栋模型 | ||||
|               </el-button> | ||||
|             </div> | ||||
|           </el-table-column> | ||||
|         </ai-table> | ||||
|       </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -158,11 +155,13 @@ export default { | ||||
|  | ||||
|   methods: { | ||||
|     getListinfo() { | ||||
|       this.instance.post(`/app/appcommunityinfo/queryCommunityTree?id=${this.user.info.areaId}`).then((res) => { | ||||
|       this.instance.post(`/app/appcommunityinfo/queryCommunityTree`).then((res) => { | ||||
|         if (res.data) { | ||||
|           this.treeData = [res.data] | ||||
|           this.treeData = res.data?.filter(e => !e.parentId) | ||||
|           this.treeData.map(p => this.addChild(p, res.data, {parent: 'parentId'})) | ||||
|           this.$nextTick(() => { | ||||
|             this.defaultShowNodes = this.treeData[0].id | ||||
|             this.$refs.gridTree.setCurrentKey(this.treeData[0].id) | ||||
|           }) | ||||
|         } | ||||
|       }) | ||||
| @@ -230,7 +229,6 @@ export default { | ||||
|     }, | ||||
|  | ||||
|     handleSelectGrid(data) { | ||||
|       console.log(data) | ||||
|       this.isAdd = false | ||||
|       if (data.type == 1) { | ||||
|         this.isAdd = true | ||||
| @@ -281,29 +279,47 @@ export default { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   ::v-deep .el-tree { | ||||
|     .el-tree-node__content { | ||||
|       display: inline-flex; | ||||
|       min-width: 100%; | ||||
|  | ||||
|       &:hover { | ||||
|         background: #e8efff; | ||||
|         color: #222222; | ||||
|         border-radius: 2px; | ||||
|       } | ||||
|   ::v-deep .el-tree { | ||||
|     background: transparent; | ||||
|  | ||||
|     .el-tree-node__expand-icon.is-leaf { | ||||
|       color: transparent!important; | ||||
|     } | ||||
|  | ||||
|     .el-tree-node__content > .el-tree-node__expand-icon { | ||||
|       padding: 4px; | ||||
|     } | ||||
|  | ||||
|     .el-tree-node__content { | ||||
|       height: 32px; | ||||
|     } | ||||
|  | ||||
|     .el-tree__empty-text { | ||||
|       color: #222; | ||||
|       font-size: 14px; | ||||
|     } | ||||
|  | ||||
|     .el-tree-node__children .el-tree-node__content { | ||||
|       height: 32px; | ||||
|     } | ||||
|  | ||||
|     .el-tree-node__content:hover { | ||||
|       background: #E8EFFF; | ||||
|       color: #222222; | ||||
|       border-radius: 2px; | ||||
|     } | ||||
|  | ||||
|     .is-current > .el-tree-node__content { | ||||
|       background: #2266ff; | ||||
|  | ||||
|       &:hover { | ||||
|         background: #2266ff; | ||||
|         background: #2266FF; | ||||
|         color: #fff; | ||||
|       } | ||||
|  | ||||
|       background: #2266FF; | ||||
|        | ||||
|       span { | ||||
|         color: #fff; | ||||
|         font-weight: bold; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user