shaun-sheep 5 years ago
parent
commit
fc5740003f
4 changed files with 502 additions and 344 deletions
  1. 2 2
      config/index.js
  2. 26 3
      src/api/scan/request.js
  3. 126 116
      src/components/ready/buildfloor/addBuild.vue
  4. 348 223
      src/views/ready/buildfloor/index.vue

+ 2 - 2
config/index.js

@@ -101,14 +101,14 @@ module.exports = {
 
     proxyTable: {
         '/admin': {
-            target: 'http://192.168.20.236:8080',
+            target: 'http://192.168.20.235:8080',
             changeOrigin: true,
             pathRewrite: {
                 "^/admin": "/"
             }
         },
         '/api': {
-            target: 'http://192.168.20.236:8080',
+            target: 'http://192.168.20.235:8080',
             changeOrigin: true,
             pathRewrite: {
                 "^/api": "/"

+ 26 - 3
src/api/scan/request.js

@@ -1866,12 +1866,35 @@ export function notSyncObject(param, success) {
 
 // 岗位和关联的资产信息点值不一致
 export function postRelationInforAtpism(param, success) {
-    let url = `${baseUrl}/datacenter/statistics/eq2pe-count`
-    http.postJson(url, param, success)
+  let url = `${baseUrl}/datacenter/statistics/eq2pe-count`
+  http.postJson(url, param, success)
 }
 
 // 查询所有设备和部件的类型
 export function getAllEqPaType(param, success) {
   let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
   http.postJson(url, param, success)
-}
+}
+
+//创建建筑信息
+export function objectCreateBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/create`
+  http.postJson(url, param, success)
+}
+
+//更新建筑信息
+export function objectUpdateBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/update`
+  http.postJson(url, param, success)
+}
+//查询建筑信息
+export function objectQueryBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/query`
+  http.postJson(url, param, success)
+}
+//根据id删除建筑信息
+export function objectDeleteBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/delete`
+  http.postJson(url, param, success)
+}
+

+ 126 - 116
src/components/ready/buildfloor/addBuild.vue

@@ -3,160 +3,170 @@
     :title="buildTitle"
     :visible.sync="buildDialogVis"
     id="messageDialog"
-    width="40%"
+    width="50%"
   >
     <el-form
       :inline="true"
       :model="form"
       label-width="125px"
-      ref="form"
+      :rules="rules"
+      ref="ruleForm"
     >
-      <h4>基本信息</h4>
-      <el-form-item
-        label="建筑本地编码"
-        required
-      >
-        <el-input
-          v-model="form.name"
-          :disabled="currentType==='edit'"
-        />
-      </el-form-item>
-      <el-form-item
-        label="建筑本地名称"
-        required
-      >
-        <el-input
-          v-model="form.name"
-          :disabled="currentType==='edit'"
-        />
-      </el-form-item>
-      <el-form-item label="建筑年代">
-        <el-date-picker
-          placeholder="选择日期"
-          type="date"
-          v-model="form.year">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="空调冷源类型">
-        <el-select
-          collapse-tags
-          multiple
-          placeholder="请选择"
-          v-model="form.value2">
-          <el-option
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-            v-for="item in form.options">
-          </el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="动态获取信息">
-        <el-input v-model="form.name"/>
-      </el-form-item>
-      <el-form-item label="动态获取信息">
-        <el-input v-model="form.name"/>
-      </el-form-item>
-      <h4>建筑信息-建筑类型</h4>
-      <div>
-        <p class="el-form-item__label"
-           style="width: 125px"
-        >建筑图片:</p>
-        <!--            :on-preview="handlePictureCardPreview"-->
-        <!--            :on-remove="handleRemove"-->
-        <el-upload
-          action="https://jsonplaceholder.typicode.com/posts/"
-          list-type="picture-card"
-          style="margin-left: 130px">
-          <i class="el-icon-plus"/>
-        </el-upload>
-        <el-dialog :visible.sync="dialogVisible">
-          <img
-            :src="dialogImageUrl"
-            alt=""
-            width="100%"
-          >
-        </el-dialog>
-      </div>
-      <h4>建筑文档</h4>
-      <uploadFile name="建筑图纸"/>
-      <uploadFile name="档案"/>
-      <uploadFile name="建筑能耗模型"/>
+      <template v-for="(val,key,index) in buildMessage">
+        <h4>{{key}}</h4>
+
+        <span :key="item.InfoPointCode" v-for="(item,index) in val">
+        <el-form-item
+          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+          :label="item.InfoPointName"
+          :prop="item.InfoPointCode"
+          v-if="all||item.Visible"
+        >
+
+          <el-input v-if="item.InputMode == 'B1'" v-model="form[item.Path]"></el-input>
+          <el-input type="number" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'" v-model="form[item.Path]">
+            <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+          </el-input>
+          <el-select placeholder="请选择" v-else-if="item.InputMode == 'D1'" v-model="form[item.Path]">
+            <el-option :key="op.Code" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+
+          </el-select>
+          <el-input v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'"
+                    v-model="form[item.Path]">
+            <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+          </el-input>
+          <el-date-picker
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            type="date" v-else-if="item.InputMode == 'C5'" v-model="form[item.Path]">
+          </el-date-picker>
+          <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"></el-input>
+          <!--          {{item.InputMode}}-->
+        </el-form-item>
+      </span>
+      </template>
+      <!--      <h4>建筑信息-建筑类型</h4>-->
+      <!--      <div>-->
+      <!--        <p class="el-form-item__label"-->
+      <!--           style="width: 125px"-->
+      <!--        >建筑图片:</p>-->
+      <!--        &lt;!&ndash;            :on-preview="handlePictureCardPreview"&ndash;&gt;-->
+      <!--        &lt;!&ndash;            :on-remove="handleRemove"&ndash;&gt;-->
+      <!--        <el-upload-->
+      <!--          action="https://jsonplaceholder.typicode.com/posts/"-->
+      <!--          list-type="picture-card"-->
+      <!--          style="margin-left: 130px">-->
+      <!--          <i class="el-icon-plus"/>-->
+      <!--        </el-upload>-->
+      <!--        <el-dialog :visible.sync="dialogVisible">-->
+      <!--          <img-->
+      <!--            :src="dialogImageUrl"-->
+      <!--            alt=""-->
+      <!--            width="100%"-->
+      <!--          >-->
+      <!--        </el-dialog>-->
+      <!--      </div>-->
+      <!--      <h4>建筑文档</h4>-->
+      <!--      <uploadFile name="建筑图纸"/>-->
+      <!--      <uploadFile name="档案"/>-->
+      <!--      <uploadFile name="建筑能耗模型"/>-->
     </el-form>
     <span
       class="dialog-footer"
       slot="footer"
     >
     <el-button @click="buildDialogVis = false">取 消</el-button>
-    <el-button @click="buildDialogVis = false" type="primary">确 定</el-button>
+    <el-button @click="submitForm('ruleForm')" type="primary">确 定</el-button>
   </span>
   </el-dialog>
 </template>
 <script>
   import uploadFile from "./uploadFile";
+  import tools from "@/utils/buildfloor/tools";
 
   export default {
     data() {
       return {
         buildName: '',
         buildDialogVis: false,
-        form: {
-          name: '',
-          region: '',
-          date1: '',
-          date2: '',
-          delivery: false,
-          resource: '',
-          desc: '',
-          year: '',
-          options: [{
-            value: '选项1',
-            label: '黄金糕'
-          }, {
-            value: '选项2',
-            label: '双皮奶'
-          }, {
-            value: '选项3',
-            label: '蚵仔煎'
-          }, {
-            value: '选项4',
-            label: '龙须面'
-          }, {
-            value: '选项5',
-            label: '北京烤鸭'
-          }],
-          value2: ''
-        },
+        form: {},
         dialogImageUrl: '',
-        dialogVisible: false
+        dialogVisible: false,
+        all: true,
+        rules: {
+          "BuildLocalID": [
+            {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
+          ],
+          "BuildLocalName": [
+            {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
+          ]
+        },
+        floorData:{}
       }
     },
     components: {uploadFile},
-    props: ['buildTitle', 'currentType'],
+    props: ['buildTitle', 'buildMessage','currentBuild'],
+    computed: {},
+    mounted() {
+
+
+    },
     methods: {
-      showDialog() {
+      showDialog(data) {
+        this.floorData = data || {};
+        this.floorData = tools.desFormatData(this.floorData)
+        this.timeoutSetVal()
         this.buildDialogVis = true
       },
-      onSubmit() {
-        console.log('submit!');
+      timeoutSetVal() {
+        setTimeout(() => {
+          if (this.form) {
+            this.form = this.floorData
+          } else {
+            this.timeoutSetVal()
+          }
+        }, 500)
       },
-      save() {
-      }
-    },
-    // handleRemove(file, fileList) {
-    //   console.log(file, fileList);
-    // },
-    // handlePictureCardPreview(file) {
-    //   this.dialogImageUrl = file.url;
-    //   this.dialogVisible = true;
-    // }
+      closeDialog() {
+        this.buildDialogVis = false
+      },
+      submitForm(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            // console.log(valid, 'valid', this.form);
+            // for (let i in this.form) {
+            //   console.log(i, this.form[i])
+            // }
+            this.$emit('handleBuild',this.form)
+          } else {
+            return false;
+          }
+        });
+      },
+
+      // handleRemove(file, fileList) {
+      //   console.log(file, fileList);
+      // },
+      // handlePictureCardPreview(file) {
+      //   this.dialogImageUrl = file.url;
+      //   this.dialogVisible = true;
+      // }
+    }
   }
 </script>
 <style lang="less" scoped>
+  /deep/ .el-dialog__body {
+    height: 420px;
+    overflow: auto;
+  }
+
   #messageDialog {
     /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner, /deep/ .el-select {
       width: 200px;
     }
 
+    /deep/ .FloorTypeSelect .el-form-item__content {
+      width: 200px;
+    }
   }
 </style>

+ 348 - 223
src/views/ready/buildfloor/index.vue

@@ -4,28 +4,41 @@
       <div class="l-list">
         <div class="action-box">
           <div>
-            <el-button size="small" type="default" icon="el-icon-plus" @click="addBuild" />
-            <el-button size="small" type="default" icon="el-icon-minus" @click="delBuild" />
-            <el-button size="small" type="default" icon="el-icon-edit-outline" @click="editBuild" />
+            <el-button @click="addBuild" icon="el-icon-plus" size="small" type="default"/>
+
+            <el-popover
+              placement="top"
+              width="160"
+              v-model="visible">
+              <p>确定删除吗?</p>
+              <div style="text-align: right; margin: 0">
+                <el-button size="mini" type="text" @click="visible = false">取消</el-button>
+                <el-button type="primary" size="mini" @click="delBuild">确定</el-button>
+              </div>
+              <el-button slot="reference" icon="el-icon-minus" size="small" type="default"/>
+            </el-popover>
+            <el-button @click="editBuild" icon="el-icon-edit-outline" size="small" type="default"/>
           </div>
         </div>
         <h4>建筑</h4>
         <div class="build-list">
-          <div v-for="(item,index) in buildList" :key="item.BuildID" :class="{'floor-item':true,active:item.active}" @click="changeBuild(index)">
+          <div :class="{'floor-item':true,active:item.active}" :key="item.BuildID" @click="changeBuild(index)"
+               v-for="(item,index) in buildList">
             <span>
               {{item.BuildLocalName || item.BuildName}}
-              <el-badge v-if="item.Count>0" class="mark" :value="item.Count" />
+              <el-badge :value="item.Count" class="mark" v-if="item.Count>0"/>
             </span>
           </div>
         </div>
       </div>
       <div class="r-table">
         <div class="action-box">
-          <el-button size="small" type="default" @click="addFloor">添加楼层
+          <el-button @click="addFloor" size="small" type="default">添加楼层
           </el-button>
         </div>
         <div class="table-box">
-          <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
+          <el-table :data="tableData" :header-cell-style="headerStyle" height="100%" style="width: 100%"
+                    v-loading="loading">
             <el-table-column label="楼层本地名">
               <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
             </el-table-column>
@@ -34,35 +47,38 @@
             </el-table-column>
             <el-table-column label="楼层信息">
               <template slot-scope="scope">
-                <el-button size="mini" @click="editFloorData(scope.row)" plain icon="el-icon-edit-outline"></el-button>
+                <el-button @click="editFloorData(scope.row)" icon="el-icon-edit-outline" plain size="mini"></el-button>
               </template>
             </el-table-column>
-            <el-table-column prop="Datasource" label="平面图">
+            <el-table-column label="平面图" prop="Datasource">
               <template slot-scope="scope">
-                <p v-if="scope.row.Sign>0" @click="checkDrawImg(scope.row,2)">
+                <p @click="checkDrawImg(scope.row,2)" v-if="scope.row.Sign>0">
                   <el-badge is-dot>
-                    <i class="iconfont icon-floorplan" />
-                  </el-badge>平面图重复
+                    <i class="iconfont icon-floorplan"/>
+                  </el-badge>
+                  平面图重复
                 </p>
-                <p v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false" @click="checkDrawImg(scope.row,1)">
-                  <i class="iconfont icon-floorplan" />
+                <p @click="checkDrawImg(scope.row,1)"
+                   v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false">
+                  <i class="iconfont icon-floorplan"/>
                   查看平面图
                 </p>
-                <p v-else @click="checkDrawImg(scope.row,3)">
-                  <i class="iconfont icon-nopicture" />
+                <p @click="checkDrawImg(scope.row,3)" v-else>
+                  <i class="iconfont icon-nopicture"/>
                   暂无平面图
                 </p>
               </template>
             </el-table-column>
-            <el-table-column prop="SubTypeName" label="楼层贯通关系">
+            <el-table-column label="楼层贯通关系" prop="SubTypeName">
               <template slot-scope="scope">
-                <span style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
-                <el-button size="mini" @click="changeConnection(scope.row)" plain icon="el-icon-edit-outline" />
+                <span
+                  style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
+                <el-button @click="changeConnection(scope.row)" icon="el-icon-edit-outline" plain size="mini"/>
               </template>
             </el-table-column>
-            <el-table-column prop="action" label="操作">
+            <el-table-column label="操作" prop="action">
               <template slot-scope="scope">
-                <el-button size="mini" @click="handleDelete(scope.row)" type="danger" plain icon="el-icon-delete" />
+                <el-button @click="handleDelete(scope.row)" icon="el-icon-delete" plain size="mini" type="danger"/>
               </template>
             </el-table-column>
           </el-table>
@@ -70,21 +86,28 @@
       </div>
     </el-row>
     <!-- 添加-修改楼层 -->
-    <addFloor :title="floorTitle" ref="addFloorDialog" :curBuildId="curBuildId" :curFloorId="curFloorId" @refresh="refresh" />
-    <!-- 添加-修改建筑 -->
-    <addBuild :title="buildTitle" ref="addBuildDialog" :currentType="currentType"/>
+    <addFloor :curBuildId="curBuildId" :curFloorId="curFloorId" :title="floorTitle" @refresh="refresh"
+              ref="addFloorDialog"/>
+    <!-- 添加-修改建筑 :currentType="currentType"-->
+    <addBuild
+      :buildTitle="buildTitle"
+      ref="addBuildDialog"
+      :buildMessage="buildMessage"
+      @handleBuild="handleBuild"
+      :curBuildId="curBuildId"
+    />
     <!-- 删除建筑-删除楼层 -->
-    <el-dialog title="提示" :visible.sync="delDialogVis" width="20%" @close="handleClose" id="messageDialog">
+    <el-dialog :visible.sync="delDialogVis" @close="handleClose" id="messageDialog" title="提示" width="20%">
       <div>确定要删除该{{delText}}?</div>
-      <span slot="footer" class="dialog-footer">
-        <el-button size="small" @click="delDialogVis=false">取消</el-button>
-        <el-button size="small" type="primary" @click="confirmDel">确认</el-button>
+      <span class="dialog-footer" slot="footer">
+        <el-button @click="delDialogVis=false" size="small">取消</el-button>
+        <el-button @click="confirmDel" size="small" type="primary">确认</el-button>
       </span>
     </el-dialog>
     <!-- 添加贯通关系弹窗 -->
-    <addConnectivity ref="addConnectivity" @refresh="refresh" />
+    <addConnectivity @refresh="refresh" ref="addConnectivity"/>
     <!-- 查看图片弹窗 -->
-    <checkGraphy ref="checkGraphy" @refresh="refresh" :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+    <checkGraphy :alreadyRelatedModel='alreadyRelatedModel' @refresh="refresh" ref="checkGraphy"></checkGraphy>
   </div>
 
 </template>
@@ -95,7 +118,17 @@
   import {mapGetters} from "vuex";
   import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
   import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
-  import {buildingQueryAndCount, floorQueryAndSign, manageDeleteFloor} from "@/api/scan/request";
+  import tools from "@/utils/buildfloor/tools";
+  import {
+    buildingQueryAndCount,
+    floorQueryAndSign,
+    getDataDictionary,
+    manageDeleteFloor,
+    objectCreateBuild,
+    objectDeleteBuild,
+    objectQueryBuild,
+    objectUpdateBuild
+  } from "@/api/scan/request";
 
   export default {
     components: {
@@ -108,16 +141,16 @@
       return {
         repetitionGraphyVisible: false, // 替换平面图弹窗
         floorTitle: "添加楼层",
-      buildTitle: "添加建筑",
-      delDialogVis: false,
-      delText: "建筑",
-      headerStyle: {
-        backgroundColor: "#d9d9d9",
-        color: "#2b2b2b",
-        lineHeight: "30px"
-      },
-      buildList: [],
-      tableData: [],
+        buildTitle: "添加建筑",
+        delDialogVis: false,
+        delText: "建筑",
+        headerStyle: {
+          backgroundColor: "#d9d9d9",
+          color: "#2b2b2b",
+          lineHeight: "30px"
+        },
+        buildList: [],
+        tableData: [],
         page: {
           pageSize: 500,
           pageSizes: [10, 20, 50, 100],
@@ -129,223 +162,315 @@
         curFloorId: "", //当前选中的楼层id
         modelId: "",
         alreadyRelatedModel: [],
-        currentType: 'add'
+        // currentType: 'add'
+        buildMessage: {},
+        visible: false,
+        currentBuild: {},//当前建筑
       };
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId"])
-  },
-  mounted() { },
-  created() {
-    this.init();
-  },
-  methods: {
-    init() {
-      let bdParam = {
-        Orders: "BuildLocalName asc",
-        PageNumber: 1,
-        PageSize: 500
-      };
-      buildingQueryAndCount(bdParam, res => {
-        this.buildList = res.Content;
-        if (this.buildList.length) {
-          this.changeBuild(0);
-        }
-      });
-    },
-    //change build
-    changeBuild(index) {
-      this.buildList.map(item => {
-        item.active = false;
-        return item;
-      });
-      this.buildList[index].active = true;
-      this.curBuildId = this.buildList[index].BuildID;
-      this.getFloorTableData();
-      this.$forceUpdate();
-    },
-    //add build
-    addBuild() {
-      // this.$message.warning("开发中...");
-      // return;
-      this.$refs.addBuildDialog.showDialog();
-    },
-    //delete build
-    delBuild() {
-      this.$message.warning("开发中...");
-      return;
-      this.delText = "建筑";
-      this.delDialogVis = true;
-    },
-    //edit build
-    editBuild() {
-      this.currentType = 'edit'
-      this.buildTitle = '编辑建筑'
-      this.$refs.addBuildDialog.showDialog();
     },
-    //delete floor
-    handleDelete(floor) {
-      this.delText = "楼层";
-      this.delDialogVis = true;
-      this.curFloorId = floor.FloorID;
+    computed: {
+      ...mapGetters("layout", ["projectId"])
     },
-    //确认删除弹窗关闭
-    handleClose() { },
-    addFloor() {
-      this.curFloorId = "";
-      this.$refs.addFloorDialog.showDialog();
+    mounted() {
     },
-    // 获取列表
-    getFloorTableData() {
-      let floorParam = {
-        Cascade: [{ Name: "floorThroughList" }],
-        Orders: "FloorSequenceID desc",
-        PageNumber: this.page.pageNumber,
-        PageSize: this.page.pageSize,
-        Filters: `BuildID='${this.curBuildId}'`
-      };
-      floorQueryAndSign(floorParam, res => {
-        this.tableData = res.Content;
-        this.page.total = res.Total;
-        this.alreadyRelatedModel = res.Content.map(t => {
-          return t.ModelId
-        }).filter(t => t);
-      });
-    },
-    // 创建楼层成功-修改关系成功
-    refresh() {
-      this.getFloorTableData();
+    created() {
+      this.init();
     },
-    // 确认删除(删除建筑-楼层公用)
-    confirmDel() {
-      if (this.delText == "楼层") {
-        let delParam = [{ FloorID: this.curFloorId }];
-        manageDeleteFloor(delParam, res => {
+    methods: {
+      init() {
+        let bdParam = {
+          Orders: "BuildLocalName asc",
+          PageNumber: 1,
+          PageSize: 500
+        };
+        buildingQueryAndCount(bdParam, res => {
+          this.buildList = res.Content;
+          if (this.buildList.length) {
+            this.changeBuild(0);
+          }
+        });
+      },
+      //change build
+      changeBuild(index) {
+        this.buildList.map(item => {
+          item.active = false;
+          return item;
+        });
+        this.buildList[index].active = true;
+        this.curBuildId = this.buildList[index].BuildID;
+        this.currentBuild = this.buildList[index]
+        this.getFloorTableData();
+        this.$forceUpdate();
+      },
+      //add build
+      addBuild() {
+        // this.$message.warning("开发中...");
+        // return;
+        this.buildTitle = '添加建筑';
+        let params = {
+          projectId: this.projectId,
+          data: {
+            Orders: "sort asc,InfoPointCode asc",
+            PageNumber: 1,
+            PageSize: 50
+          },
+          type: 'Building'
+        };
+        getDataDictionary(params, res => {
+          let list = res.Content.map(item => {
+            if (item.InputMode === 'D1' && item.DataSource != undefined) {
+              item.options = JSON.parse(item.DataSource)
+            }
+            return item
+          })
+          let first = {}
+          //一级循环出来一级标签
+          list.map(item => {
+            if (item.InputMode === 'D1' && item.DataSource != undefined) {
+              item.options = JSON.parse(item.DataSource)
+            }
+            if (first[item.FirstName] && first[item.FirstName].length) {
+            } else {
+              first[item.FirstName] = []
+            }
+            first[item.FirstName].push({
+              InfoPointName: item.InfoPointName,
+              InfoPointCode: item.InfoPointCode,
+              Visible: item.Visible,
+              UnDisabled: item.UnDisabled,
+              SecondName: item.SecondName ? item.SecondName : "",
+              Path: item.Path,
+              InputMode: item.InputMode,
+              options: item.options,
+              Unit: item.Unit
+            })
+          })
+          this.buildMessage = first
+
+        })
+        this.$refs.addBuildDialog.showDialog();
+      },
+      //delete build ,根据id删除建筑信息
+      delBuild() {
+        // this.$message.warning("开发中...");
+        // return;
+        // this.delText = "建筑";
+        // this.delDialogVis = true;
+        let param = [{BuildId: this.curBuildId}];
+        objectDeleteBuild(param, res => {
+          setTimeout(() => {
+            this.handleBuildQuery()
+            this.init()
+          })
+          this.visible = false
           this.$message.success("删除成功");
-          this.delDialogVis = false;
-          this.getFloorTableData();
+        })
+      },
+      //edit build
+      editBuild() {
+        // this.currentType = 'edit';
+        this.buildTitle = '编辑建筑';
+        this.$refs.addBuildDialog.showDialog(this.currentBuild);
+      },
+      // handleBuild 获取建筑信息
+      handleBuild(val) {
+        let newform = tools.formatData(val)
+        newform.BuildID = this.curBuildId || ''
+        let Param = {
+          Content: [newform]
+        }
+        if (newform.curBuildId) {
+          objectUpdateBuild(Param, res => {
+            this.$message.success('更新成功')
+            this.$refs.addBuildDialog.closeDialog()
+          })
+        } else {
+          objectCreateBuild(Param, res => {
+            this.$message.success('创建成功')
+            this.$refs.addBuildDialog.closeDialog()
+          })
+        }
+        setTimeout(() => {
+          this.handleBuildQuery()
+          this.init()
+        })
+      },
+      //delete floor
+      handleDelete(floor) {
+        this.delText = "楼层";
+        this.delDialogVis = true;
+        this.curFloorId = floor.FloorID;
+      },
+      //确认删除弹窗关闭
+      handleClose() {
+      },
+      addFloor() {
+        this.curFloorId = "";
+        this.$refs.addFloorDialog.showDialog();
+      },
+      // 获取列表
+      getFloorTableData() {
+        let floorParam = {
+          Cascade: [{Name: "floorThroughList"}],
+          Orders: "FloorSequenceID desc",
+          PageNumber: this.page.pageNumber,
+          PageSize: this.page.pageSize,
+          Filters: `BuildID='${this.curBuildId}'`
+        };
+        floorQueryAndSign(floorParam, res => {
+          this.tableData = res.Content;
+          this.page.total = res.Total;
+          this.alreadyRelatedModel = res.Content.map(t => {
+            return t.ModelId
+          }).filter(t => t);
         });
-      } else {
-        //todo
-      }
-    },
-    // 修改楼层信息
-    editFloorData(floor) {
-      this.floorTitle = "编辑楼层信息";
-      this.curFloorId = floor.FloorID;
-      this.$refs.addFloorDialog.showDialog(floor);
-    },
-    // 修改楼层贯通关系
-    changeConnection(row) {
-      this.$refs.addConnectivity.showDialog();
-      this.$refs.addConnectivity.floor = row;
+      },
+      // 创建楼层成功-修改关系成功
+      refresh() {
+        this.getFloorTableData();
+      },
+      // 确认删除(删除建筑-楼层公用)
+      confirmDel() {
+        if (this.delText == "楼层") {
+          let delParam = [{FloorID: this.curFloorId}];
+          manageDeleteFloor(delParam, res => {
+            this.$message.success("删除成功");
+            this.delDialogVis = false;
+            this.getFloorTableData();
+          });
+        } else {
+          //todo
+        }
+      },
+      // 修改楼层信息
+      editFloorData(floor) {
+        this.floorTitle = "编辑楼层信息";
+        this.curFloorId = floor.FloorID;
+        this.$refs.addFloorDialog.showDialog(floor);
+      },
+      // 修改楼层贯通关系
+      changeConnection(row) {
+        this.$refs.addConnectivity.showDialog();
+        this.$refs.addConnectivity.floor = row;
+      },
+      // 查看平面图
+      checkDrawImg(row, index) {
+        if (3 == index) {
+          this.$refs.checkGraphy.showDialog(row);
+          this.modelId = "";
+        } else {
+          this.modelId = row.ModelId;
+          let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID};
+          this.$router.push({name: "repetitionGraphy", query: pa});
+        }
+      },
+      //  查询建筑信息
+      handleBuildQuery() {
+        let floorParam = {
+          projectId: this.projectId
+        };
+        objectQueryBuild(floorParam, res => {
+
+        });
+      },
+
     },
-    // 查看平面图
-    checkDrawImg(row, index) {
-      if (3 == index) {
-        this.$refs.checkGraphy.showDialog(row)
-        this.modelId = "";
-      } else {
-        this.modelId = row.ModelId;
-        let pa = { modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID }
-        this.$router.push({ name: "repetitionGraphy", query: pa });
+    watch: {
+      projectId() {
+        this.init();
       }
     }
-  },
-  watch: {
-    projectId() {
-      this.init();
-    }
-  }
-};
+  };
 </script>
 <style lang="less" scoped>
-#bd-fl-manage {
-  overflow: hidden;
-  height: 100%;
-  position: relative;
-
-  .el-row {
+  #bd-fl-manage {
+    overflow: hidden;
     height: 100%;
+    position: relative;
 
-    .el-col-4 {
-      width: 17%;
-    }
-    .el-col-20 {
-      width: 82%;
-    }
-    & > div {
-      float: left;
+    .el-row {
       height: 100%;
-      overflow: hidden;
-      background-color: #fff;
-      box-sizing: border-box;
-      border: 1px solid #dfe6ec;
 
-      .action-box {
-        padding: 10px;
+      .el-col-4 {
+        width: 17%;
+      }
+
+      .el-col-20 {
+        width: 82%;
+      }
+
+      & > div {
+        float: left;
+        height: 100%;
+        overflow: hidden;
+        background-color: #fff;
+        box-sizing: border-box;
+        border: 1px solid #dfe6ec;
+
+        .action-box {
+          padding: 10px;
 
-        .el-button--small {
-          padding: 10px 11px;
+          .el-button--small {
+            padding: 10px 11px;
+          }
         }
       }
-    }
 
-    .l-list {
-      width: 17%;
-      overflow-y: auto;
+      .l-list {
+        width: 17%;
+        overflow-y: auto;
 
-      h4 {
-        padding-left: 10px;
-        border-top: 1px solid #d9d9d9;
-        border-bottom: 1px solid #d9d9d9;
-        background: #d9d9d9;
-        color: #2b2b2b;
-        line-height: 44px;
-      }
+        h4 {
+          padding-left: 10px;
+          border-top: 1px solid #d9d9d9;
+          border-bottom: 1px solid #d9d9d9;
+          background: #d9d9d9;
+          color: #2b2b2b;
+          line-height: 44px;
+        }
 
-      .build-list {
-        line-height: 48px;
+        .build-list {
+          line-height: 48px;
 
-        .floor-item {
-          white-space: nowrap;
-          overflow: hidden;
-          text-overflow: ellipsis;
+          .floor-item {
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
 
-          span {
-            margin-left: 10px;
+            span {
+              margin-left: 10px;
+            }
           }
-        }
 
-        .floor-item.active,
-        .floor-item:hover {
-          background-color: #f5f7fa;
-          color: #000;
+          .floor-item.active,
+          .floor-item:hover {
+            background-color: #f5f7fa;
+            color: #000;
+          }
         }
       }
-    }
 
-    .r-table {
-      width: 82%;
-      margin-left: 1%;
+      .r-table {
+        width: 82%;
+        margin-left: 1%;
 
-      .table-box {
-        height: calc(100% - 54px);
-        margin-bottom: 8px;
+        .table-box {
+          height: calc(100% - 54px);
+          margin-bottom: 8px;
 
-        .iconfont {
-          vertical-align: middle;
-        }
+          .iconfont {
+            vertical-align: middle;
+          }
 
-        /deep/ .el-badge__content.is-fixed {
-          transform: translateY(-6%) translateX(-100%);
-        }
+          /deep/ .el-badge__content.is-fixed {
+            transform: translateY(-6%) translateX(-100%);
+          }
 
-        p {
-          cursor: pointer;
+          p {
+            cursor: pointer;
+          }
         }
       }
     }
   }
-}
 </style>