huangmp 4 년 전
부모
커밋
61ceba3b33

+ 3 - 0
src/api/community/agency.js

@@ -65,3 +65,6 @@ export const getAgencyInfo = (id) => {
   })
 }
 
+
+
+

+ 13 - 8
src/components/agency/agencymng.vue

@@ -1,6 +1,6 @@
 <template>
-  <el-dialog :title="title" center width="70%" :visible.sync="agencymngShow" :destroy-on-close="true" :modal-append-to-body="true"
-    :append-to-body="true">
+  <el-dialog :title="title" center width="70%" @close="agencymng.isClose=true;" :visible.sync="agencymngShow"
+    :destroy-on-close="true" :modal-append-to-body="true" :append-to-body="true">
     <div style="margin-top:-15px;padding-bottom:20px;display:flex;cursor: pointer">
       <span style="font-size:14px">管理:</span>
       <el-breadcrumb separator-class="el-icon-arrow-right">
@@ -13,7 +13,8 @@
     <div class="full">
       <el-row :gutter="0">
         <el-col :span="4">
-          <tree ref="tree" @nodeClick="nodeClick"></tree>
+          <tree ref="tree" @nodeClick="nodeClick" v-if="$isNotEmpty(agencymng.agencyId)&&!this.agencymng.isClose">
+          </tree>
         </el-col>
         <el-col :span="20">
           <residential v-if="listShow(0)"></residential>
@@ -55,6 +56,7 @@
       return {
         breadcrumbList: [],
         agencymng: {
+          isClose: false,
           level: 0,
           agencyId: "",
           residentialId: '',
@@ -71,7 +73,7 @@
     computed: {
       listShow() {
         return data => {
-          if (this.agencymng.level == data && this.agencymng.agencyId) {
+          if (this.agencymng.level == data && this.$isNotEmpty(this.agencymng.agencyId) && !this.agencymng.isClose) {
             return true
           } else {
             return false
@@ -79,9 +81,12 @@
         }
       }
     },
+    destroyed() {
+      console.log("我已经摧毁了");
+    },
     methods: {
       breadcrumbClick(item, index) {
-        console.log(item,"breadcrumbClick");
+        console.log(item, "breadcrumbClick");
         let list = this.breadcrumbList.reverse()
         list.splice(0, list.length - index - 1)
         this.breadcrumbList = list.reverse()
@@ -121,7 +126,7 @@
           floorId,
           roomId,
         }
-        if (level==4||level==5) {
+        if (level == 4 || level == 5) {
           this.getRoomList()
         }
       },
@@ -134,15 +139,15 @@
       },
       nodeClick(obj) {
         this.breadcrumbList = obj.list
-        console.log(this.breadcrumbList,"this.breadcrumbList");
         this.initBreadcrumbList()
         let node = obj.node
         let level = node.level
         let id = node.data.id
         this.updateAgencymng(level, id)
-        console.log(this.breadcrumbList,"this.breadcrumbList");
       },
       showDialog(item) {
+        this.agencymng.isClose=false
+        this.breadcrumbList = []
         this.agencymngShow = true
         this.title = item.name
         this.agency = item

+ 1 - 1
src/components/agency/form/floor.vue

@@ -33,7 +33,7 @@
     watch: {
       agencymng: {
         handler: (value) => {
-          _this.refreshChange()
+         _this.refreshChange()
         },
         deep: true
       }

+ 7 - 7
src/components/agency/form/unit.vue

@@ -111,7 +111,7 @@
               slot: true,
               type: "select",
               search: true,
-              hide:true,
+              hide: true,
               cascaderItem: ['buildingId'],
               // remote: true,
               //回显的时候有问题,如果所选不在前十条内,下拉框只会显示id
@@ -131,12 +131,12 @@
               }]
             },
             {
-              prop:'residentialName',
-              label:"所属区域"
+              prop: 'residentialName',
+              label: "所属区域"
             },
             {
-              label:'所属楼栋',
-              prop:'buildingName'
+              label: '所属楼栋',
+              prop: 'buildingName'
             },
             {
               label: "所属楼栋",
@@ -145,7 +145,7 @@
               slot: true,
               type: "select",
               search: true,
-              hide:true,
+              hide: true,
               dicUrl: `/api/cyzh-community/building/list?residentialId={{key}}`,
               dicFormatter: (res) => {
                 return res.data.records; //返回字典的层级结构
@@ -389,7 +389,7 @@
           this.data = data.records;
           this.loading = false;
           this.selectionClear();
-          this.$emit('getList',this.data)
+          this.$emit('getList', this.data)
         });
       }
     }

+ 4 - 7
src/views/businessmng/agencymng/agency.vue

@@ -35,15 +35,12 @@
       </template>
       <template slot-scope="scope" slot="menu">
         <el-button type="text" size="small" icon="el-icon-edit" plain class="none-border"
-          @click.stop="agencymng(scope.row.id)">管理
+          @click.stop="agencymng(scope.row)">管理
         </el-button>
       </template>
     </avue-crud>
-
-    
-      <agencymng></agencymng>
     
-
+     <agencymng ref="agencymng"></agencymng>
   </basic-container>
 </template>
 
@@ -417,8 +414,8 @@
       }
     },
     methods: {
-      agencymng(id) {
-
+      agencymng(row) {
+        this.$refs.agencymng.showDialog(row)
       },
       rowSave(row, done, loading) {
         row.residentialCount = 0;

+ 0 - 89
src/views/dashboard/smartoperationcenter/smartoperationcenter - 副本.vue

@@ -1,89 +0,0 @@
-<template>
-  <div class="body">
-    <el-row>
-      <el-col :span="18">
-        <div style="box-sizing: border-box;margin: 0.625rem;margin-top: 0;">
-
-          <grid-list></grid-list>
-
-          <agency-info></agency-info>
-
-          <div class="my-layout">
-            <div class="layout">
-              <access-records></access-records>
-            </div>
-            <div class="layout">
-              <device></device>
-            </div>
-          </div>
-
-          <div class="my-layout">
-            <div class="layout">
-              <air-quality></air-quality>
-            </div>
-            <div class="layout">
-              <energy></energy>
-            </div>
-          </div>
-
-        </div>
-      </el-col>
-      <el-col :span="6">
-        <work-order></work-order>
-      </el-col>
-    </el-row>
-
-    <div style="height: 1.25rem;"></div>
-  </div>
-</template>
-
-<script>
-  import agencyInfo from "./comps/agency_info.vue"
-  import gridList from "./comps/grid_list.vue"
-  import workOrder from './comps/work_order.vue'
-  import accessRecords from './comps/access_records.vue'
-  import device from './comps/device.vue'
-  import airQuality from './comps/air_quality.vue'
-  import energy from './comps/energy.vue'
-  export default {
-    components: {
-      agencyInfo,
-      gridList,
-      workOrder,
-      accessRecords,
-      device,
-      airQuality,
-      energy
-    },
-    data() {
-      return {
-
-      };
-    }
-  };
-</script>
-
-<style>
-  .avue-main {
-    background-color: #F5F5F5 !important;
-  }
-</style>
-
-<style lang="scss" scoped>
-  .body {
-    box-sizing: border-box;
-    background-color: #F5F5F5;
-    height: 100%;
-  }
-
-  .my-layout {
-    margin-top: 0.625rem;
-    display: flex;
-    width: 100%;
-    justify-content: space-between;
-
-    .layout {
-      width: calc(50% - 5px);
-    }
-  }
-</style>

+ 79 - 23
src/views/dashboard/smartoperationcenter/smartoperationcenter.vue

@@ -1,33 +1,89 @@
 <template>
-  <basic-container style="justify-content: center;">
-    <button @click="open">打开</button>
-    <agencymng ref="agencymng"></agencymng>
-  </basic-container>
+  <div class="body">
+    <el-row>
+      <el-col :span="18">
+        <div style="box-sizing: border-box;margin: 0.625rem;margin-top: 0;">
+
+          <grid-list></grid-list>
+
+          <agency-info></agency-info>
+
+          <div class="my-layout">
+            <div class="layout">
+              <access-records></access-records>
+            </div>
+            <div class="layout">
+              <device></device>
+            </div>
+          </div>
+
+          <div class="my-layout">
+            <div class="layout">
+              <air-quality></air-quality>
+            </div>
+            <div class="layout">
+              <energy></energy>
+            </div>
+          </div>
+
+        </div>
+      </el-col>
+      <el-col :span="6">
+        <work-order></work-order>
+      </el-col>
+    </el-row>
+
+    <div style="height: 1.25rem;"></div>
+  </div>
 </template>
 
 <script>
-import agencymng from "@/components/agency/agencymng.vue"
-export default {
-  components:{
-    agencymng
-  },
-  data() {
-    return {
-
-    };
-  },
-  methods:{
-    open(){
-      let item = {
-        id: '1321081130731597825',
-        name: '阅海万家社区'
-      }
-      this.$refs.agencymng.showDialog(item)
+  import agencyInfo from "./comps/agency_info.vue"
+  import gridList from "./comps/grid_list.vue"
+  import workOrder from './comps/work_order.vue'
+  import accessRecords from './comps/access_records.vue'
+  import device from './comps/device.vue'
+  import airQuality from './comps/air_quality.vue'
+  import energy from './comps/energy.vue'
+  export default {
+    components: {
+      agencyInfo,
+      gridList,
+      workOrder,
+      accessRecords,
+      device,
+      airQuality,
+      energy
+    },
+    data() {
+      return {
+
+      };
     }
-  }
-};
+  };
 </script>
 
+<style>
+  .avue-main {
+    background-color: #F5F5F5 !important;
+  }
+</style>
+
 <style lang="scss" scoped>
+  .body {
+    box-sizing: border-box;
+    background-color: #F5F5F5;
+    height: 100%;
+  }
 
+  .my-layout {
+    margin-top: 0.625rem;
+    display: flex;
+    width: 100%;
+    justify-content: space-between;
+
+    .layout {
+      width: calc(50% - 5px);
+    }
+  }
 </style>