Parcourir la source

adm:feat > 建筑楼层管理

shaun-sheep il y a 4 ans
Parent
commit
5174749922

+ 10 - 4
src/api/scan/request.js

@@ -1740,8 +1740,12 @@ export function manageCreateFloor(param, success) {
 }
 
 //建筑楼层管理-删除楼层
+// export function manageDeleteFloor(param, success) {
+//   let url = `${baseUrl}/datacenter/floor/delete`;
+//   http.postJson(url, param, success)
+// }
 export function manageDeleteFloor(param, success) {
-  let url = `${baseUrl}/datacenter/floor/delete`;
+  let url = `${baseUrl}/datacenter/object/floor/delete`;
   http.postJson(url, param, success)
 }
 
@@ -1757,7 +1761,7 @@ export function manageUpdateFloor(param, success) {
 //   http.postJson(url, param, success)
 // }
 export function createRelationInFloor(param, success) {
-  let url = `${baseUrl}/datacenter/rel/fl-through-fl/link-fl`;
+  let url = `${baseUrl}/datacenter/rel/fl-through-fl/link-or`;
   http.postJson(url, param, success)
 }
 
@@ -1775,13 +1779,15 @@ export function floorUpdate(param, success) {
 
 //楼层接口-----更新楼层轮廓
 export function floorUpdateOutline(param, success) {
-  let url = `${baseUrl}/datacenter/object/floor/update-outline`;
+  // let url = `${baseUrl}/datacenter/object/floor/update-outline`;
+  let url = `${baseUrl}/datacenter/object/floor/outline/update`;
   http.postJson(url, param, success)
 }
 
 //楼层接口-----查询楼层轮廓
 export function floorQueryOutline(param, success) {
-  let url = `${baseUrl}/datacenter/object/floor/query-outline`;
+  // let url = `${baseUrl}/datacenter/object/floor/query-outline`;
+  let url = `${baseUrl}/datacenter/object/floor/outline/query`;
   http.postJson(url, param, success)
 }
 

+ 148 - 151
src/components/ready/buildfloor/addBuild.vue

@@ -14,49 +14,48 @@
       ref="ruleForm"
     >
       <template v-for="(val,key) in buildMessage">
-        <h4>{{key}}</h4>
+        <h4 v-text="key != 'undefined' ? key :'信息'"></h4>
 
         <div
           :key="item.InfoPointCode"
           v-for="item in val"
-          :class="[{'upload-file':item.InputMode == 'F2' ||  item.Path === 'BuildingInfo.BuildingType.Pic'}]"
+          :class="[{'upload-file':item.inputMode == 'F2' ||  item.Path === 'infos.pic'}]"
           style="width: 50%;display: inline-block">
 
           <el-form-item
-            :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+            :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' || item.InputMode == 'B2'"
+              v-if="item.inputMode == 'B1' || item.inputMode == 'B2'"
               v-model="form[item.Path]"/>
 
             <el-input
-              v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'"
+              v-else-if="item.inputMode == 'A1'||item.inputMode == 'A2'"
               type="number"
               v-model="form[item.Path]">
-              <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+              <template slot="append" v-if="item.Unit">{{ item.Unit }}</template>
             </el-input>
 
             <el-select
-              v-else-if="item.InputMode == 'D1' || item.InputMode == 'E2'"
+              v-else-if="item.inputMode == 'D1' || item.inputMode == 'E2'"
               placeholder="请选择"
               v-model="form[item.Path]">
-              <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+              <el-option :key="op.name" :label="op.name" :value="op.code" v-for="op in item.options"></el-option>
             </el-select>
 
             <el-select
-              v-else-if="item.InputMode == 'D2'"
+              v-else-if="item.inputMode == 'D2'"
               placeholder="请选择"
               v-model="form[item.Path]"
               multiple
               collapse-tags>
-              <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+              <el-option :key="op.name" :label="op.name" :value="op.code" v-for="op in item.options"></el-option>
             </el-select>
 
             <el-date-picker
-              v-else-if="item.InputMode == 'C6'"
+              v-else-if="item.inputMode == 'C6'"
               v-model="form[item.Path]"
               type="daterange"
               value-format="yyyy-MM-dd"
@@ -65,7 +64,7 @@
               end-placeholder="结束日期"/>
 
             <el-cascader
-              v-else-if="item.InputMode == 'D1L'"
+              v-else-if="item.inputMode == 'D1L'"
               placeholder="请选择"
               :options="item.options"
               v-model="form[item.Path]"
@@ -76,20 +75,20 @@
               style="width: 200px"/>
 
             <el-input
-              v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'"
+              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>
+              <template slot="append" v-if="item.Unit">{{ item.Unit }}</template>
             </el-input>
 
             <el-date-picker
-              v-else-if="item.InputMode == 'C5'" v-model="form[item.Path]"
+              v-else-if="item.inputMode == 'C5'" v-model="form[item.Path]"
               placeholder="选择日期"
               value-format="yyyy-MM-dd"
               type="date">
             </el-date-picker>
 
             <uploadImgs
-              v-else-if="item.InputMode == 'F2'&& item.Path === 'BuildingInfo.BuildingType.Pic'"
+              v-else-if="item.inputMode == 'F2'&& item.Path === 'infos.Pic'"
               :readOnly="false"
               v-model="form[item.Path]"
               :keysArr="Array.isArray(buildData[item.Path]) ? buildData[item.Path]:[]"
@@ -98,7 +97,7 @@
               @change="changeItem"/>
 
             <upload-files
-              v-else-if="item.InputMode == 'F2'"
+              v-else-if="item.inputMode == 'F2'"
               v-model="form[item.Path]"
               :readOnly="false"
               :isShow="1"
@@ -125,162 +124,160 @@
   </el-dialog>
 </template>
 <script>
-  import uploadFiles from "@/components/business_space/lib/uploadFiles";
-  import uploadImgs from "@/components/business_space/lib/uploadImgsName";
-
-  function flattenKeys(obj) {
-    let res = {}
-
-    function isObject(val) {
-      return typeof val === 'object' && !Array.isArray(val)
-    }
-
-    function digKeys(prev, obj) {
-      Object.entries(obj).forEach(([key, value]) => {
-        const currentKey = prev ? `${prev}.${key}` : key
-        if (isObject(value)) {
-          digKeys(currentKey, value)
-        } else {
-          res[currentKey] = value
-        }
-      })
-    }
+import uploadFiles from "@/components/business_space/lib/uploadFiles";
+import uploadImgs from "@/components/business_space/lib/uploadImgsName";
 
-    digKeys('', obj)
+function flattenKeys(obj) {
+  let res = {}
 
-    return res
+  function isObject(val) {
+    return typeof val === 'object' && !Array.isArray(val)
   }
 
-  export default {
-    data() {
-
-      return {
-        buildName: '',
-        keysArr: [], //保存临时的文件key
-        buildDialogVis: false,
-        form: {},
-        dialogImageUrl: '',
-        dialogVisible: false,
-        all: true,
-        rules: {
-          "BuildLocalID": [
-            {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
-          ],
-          "BuildLocalName": [
-            {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
-          ]
-        },
-        buildData: {},
-        buildDisabled: false,
+  function digKeys(prev, obj) {
+    Object.entries(obj).forEach(([key, value]) => {
+      const currentKey = prev ? `${prev}.${key}` : key
+      if (isObject(value)) {
+        digKeys(currentKey, value)
+      } else {
+        res[currentKey] = value
       }
-    },
-    components: {uploadFiles, uploadImgs},
-    props: ['buildTitle', 'buildMessage', 'currentBuild'],
-    computed: {},
-    mounted() {
-
+    })
+  }
 
-    },
-    watch: {},
-    methods: {
-      deepCopy(obj) {
-        return JSON.parse(JSON.stringify(obj))
+  digKeys('', obj)
+
+  return res
+}
+
+export default {
+  data() {
+
+    return {
+      buildName: '',
+      keysArr: [], //保存临时的文件key
+      buildDialogVis: false,
+      form: {},
+      dialogImageUrl: '',
+      dialogVisible: false,
+      all: true,
+      rules: {
+        "localId": [
+          {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
+        ],
+        "localName": [
+          {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
+        ]
       },
-      showDialog(data) {
-        //获取信息
-        let buildData = data || {};  // string =>array key
-        buildData = flattenKeys(buildData);
-        for (let key in this.buildMessage) {
-          let arr = this.buildMessage[key];
-          if (Array.isArray(arr)) {
-            let list = arr.filter(i => i.InputMode == 'D2' || i.InputMode == 'C6');
-            list.forEach(j => {
-              if (buildData.hasOwnProperty(j.Path)) {
-                if (!Array.isArray(buildData[j.Path])) {
-                  buildData[j.Path] = buildData[j.Path].split(',');
-                }
+      buildData: {},
+      buildDisabled: false,
+    }
+  },
+  components: {uploadFiles, uploadImgs},
+  props: ['buildTitle', 'buildMessage', 'currentBuild'],
+  computed: {},
+  mounted() {
+  },
+  watch: {},
+  methods: {
+    deepCopy(obj) {
+      return JSON.parse(JSON.stringify(obj))
+    },
+    showDialog(data) {
+      //获取信息
+      let buildData = data || {};  // string =>array key
+      buildData = flattenKeys(buildData);
+      for (let key in this.buildMessage) {
+        let arr = this.buildMessage[key];
+        if (Array.isArray(arr)) {
+          let list = arr.filter(i => i.inputMode == 'D2' || i.inputMode == 'C6');
+          list.forEach(j => {
+            if (buildData.hasOwnProperty(j.Path)) {
+              if (!Array.isArray(buildData[j.Path])) {
+                buildData[j.Path] = buildData[j.Path].split(',');
               }
+            }
 
-            })
-          }
+          })
         }
-        this.buildData = buildData;
-        this.timeoutSetVal()
-        this.buildDialogVis = true
-      },
+      }
+      this.buildData = buildData;
+      this.timeoutSetVal()
+      this.buildDialogVis = true
+    },
 
-      timeoutSetVal() {
-        let that = this
-        setTimeout(() => {
-          if (that.form) {
-            that.form = that.buildData
-          } else {
-            this.timeoutSetVal()
-          }
-        })
-      },
-      closeDialog() {
-        this.buildDialogVis = false
-      },
-      submitForm(formName) {
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            this.buildDisabled = true
-            for (let key in this.buildMessage) {
-              let arr = this.buildMessage[key];
-              if (Array.isArray(arr)) {
-                let list = arr.filter(i => i.InputMode == 'D2' || i.InputMode == 'C6');
-                list.forEach(j => {
-                  if (this.form.hasOwnProperty(j.Path)) {
-                    if (Array.isArray(this.form[j.Path])) {
-                      this.form[j.Path] = this.form[j.Path].join(',');
-                    }
+    timeoutSetVal() {
+      let that = this
+      setTimeout(() => {
+        if (that.form) {
+          that.form = that.buildData
+        } else {
+          this.timeoutSetVal()
+        }
+      })
+    },
+    closeDialog() {
+      this.buildDialogVis = false
+    },
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.buildDisabled = true
+          for (let key in this.buildMessage) {
+            let arr = this.buildMessage[key];
+            if (Array.isArray(arr)) {
+              let list = arr.filter(i => i.inputMode == 'D2' || i.inputMode == 'C6');
+              list.forEach(j => {
+                if (this.form.hasOwnProperty(j.Path)) {
+                  if (Array.isArray(this.form[j.Path])) {
+                    this.form[j.Path] = this.form[j.Path].join(',');
                   }
-                })
-              }
+                }
+              })
             }
-            this.$emit('handleBuild', this.form)
-            setTimeout(() => {
-              this.buildDisabled = false
-            }, 2500)
-          } else {
-            return false;
           }
-        });
-      },
-      changeItem(val) {
-        console.log(val)
-        let _key = Object.keys(val)[0] + '';
-        this.form[_key] = val[_key];
+          this.$emit('handleBuild', this.form)
+          setTimeout(() => {
+            this.buildDisabled = false
+          }, 2500)
+        } else {
+          return false;
+        }
+      });
+    },
+    changeItem(val) {
+      console.log(val)
+      let _key = Object.keys(val)[0] + '';
+      this.form[_key] = val[_key];
 
-      },
+    },
 
-    }
   }
+}
 </script>
 <style lang="less" scoped>
 
-  #messageDialog {
-    /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner, /deep/ .el-select {
-      width: 200px;
-    }
+#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;
-    }
+  /deep/ .FloorTypeSelect .el-form-item__content {
+    width: 200px;
+  }
 
-    /deep/ .el-dialog__body {
-      height: 420px;
-      overflow: auto;
-    }
+  /deep/ .el-dialog__body {
+    height: 420px;
+    overflow: auto;
+  }
 
-    .upload-file {
-      width: 100% !important;
-      display: block !important;
-    }
+  .upload-file {
+    width: 100% !important;
+    display: block !important;
+  }
 
-    /deep/ .el-input--small {
-      width: 200px
-    }
+  /deep/ .el-input--small {
+    width: 200px
   }
+}
 </style>

+ 28 - 14
src/components/ready/buildfloor/addConnectivity.vue

@@ -1,9 +1,9 @@
 <template>
-  <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="730px" id="messageDialog" >
+  <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="730px" id="messageDialog">
     <el-row style="height: 80px">
-      <div style="line-height:32px;">添加与{{floor.FloorLocalName}}层有贯通关系的楼层 : </div>
+      <div style="line-height:32px;">添加与{{ floor.FloorLocalName }}层有贯通关系的楼层 :</div>
       <div style="width:70%">
-        <bfCascader ref="bfCascader" :FloorID="floor.FloorID"></bfCascader>
+        <bfCascader ref="bfCascader" :FloorID="floor.id"></bfCascader>
       </div>
     </el-row>
     <span slot="footer" class="dialog-footer">
@@ -14,7 +14,8 @@
 </template>
 <script>
 import bfCascader from '@/components/ready/buildfloor/buildfloorCascader'
-import { createRelationInFloor } from "@/api/scan/request";
+import {createRelationInFloor} from "@/api/scan/request";
+
 export default {
   data() {
     return {
@@ -31,11 +32,11 @@ export default {
       this.connectDialogVis = true
       this.$nextTick(() => {
         this.$refs.bfCascader.getCascader()
-        let arr = this.floor.FloorThroughList || [];
+        let arr = this.floor.floorThroughList || [];
         let value = []
         if (arr.length) {
           arr.map(t => {
-            value.push([t.BuildID, t.FloorID])
+            value.push([t.buildingId, t.id])
           })
         }
         this.$refs.bfCascader.value = value
@@ -44,35 +45,48 @@ export default {
     save() {
       let arr = this.$refs.bfCascader.value;
       let param = {
-        FloorId: this.floor.FloorID,
-        FloorOtherIdList: []
+        floorId: this.floor.id,
+        floorOtherIdList: []
       }
+      let flag = false
       arr.map(t => {
-        param.FloorOtherIdList.push(t[1])
+        if (t[1]) {
+          param.floorOtherIdList.push(t[1])
+          flag = true
+        } else {
+          flag = false
+        }
       })
-      createRelationInFloor(param, res => {
+      if (flag) {
+        createRelationInFloor(param, res => {
+          this.connectDialogVis = false;
+          this.$message.success('关联成功');
+          this.$emit('refresh')
+        })
+      } else {
         this.connectDialogVis = false;
-        this.$message.success('关联成功');
-        this.$emit('refresh')
-      })
+      }
     }
   }
 }
 </script>
 <style lang="less" scoped>
 #messageDialog {
-  .el-row{
+  .el-row {
     height: 50px;
     max-height: 200px;
     overflow-y: auto;
     overflow-x: hidden;
   }
+
   .el-row > div {
     float: left;
   }
+
   .el-row > div + div {
     margin-left: 10px;
   }
+
   /deep/ .el-input__inner {
     vertical-align: baseline;
   }

+ 1 - 1
src/components/ready/buildfloor/buildfloorCascader.vue

@@ -49,7 +49,7 @@ export default {
         // })
         // this.options = res.content
         this.options = res.content
-        console.log(this.options)
+        console.log(this.options,'options')
       })
     },
   }

+ 18 - 17
src/components/ready/buildfloor/formItems.vue

@@ -3,9 +3,9 @@
     <el-form ref="ruleForm" :model="form" label-width="150px" :rules="rules" :inline="true" :label-position="'right'">
       <div v-for="item in InforsList" :key="item.infoPointCode" style="width:50%;display: inline-block">
         <el-form-item
-          :label="item.infoPointName"
-          :prop="item.infoPointCode"
-          v-if="all||item.Visible"
+          :label="item.name"
+          :prop="item.code"
+          v-if="all||item.visible"
           :class="{FloorTypeSelect:item.inputMode == 'D1'||item.unit}">
 
           <el-input
@@ -43,8 +43,8 @@
           <!--/二维码相关-->
           <span v-else-if="item.inputMode == 'B1'">
             <el-input v-model="form[item.path]"
-                      :placeholder="(item.inputMode === 'B1' && item.path==='FloorLocalID') ? '填写示例:F1、B1?':'' "/>
-              <div v-if="item.inputMode === 'B1' && item.path==='FloorLocalID' && isShowTitle"
+                      :placeholder="(item.inputMode === 'B1' && item.path==='localId') ? '填写示例:F1、B1?':'' "/>
+              <div v-if="item.inputMode === 'B1' && item.path==='localId' && isShowTitle"
                    style="color: gray;font-size: 12px">
                 用于楼层平面图切换
               </div>
@@ -86,7 +86,7 @@ import {getDataDictionary} from "@/api/dict";
 export default {
   props: {
     type: {
-      default: 'Floor'
+      default: 'floor'
     }
   },
   data() {
@@ -106,13 +106,13 @@ export default {
       InforsList: [],
       all: true, // 默认显示全部
       rules: {
-        "FloorLocalID": [
+        "localId": [
           {validator: validateId, trigger: 'blur', "required": true}
         ],
-        "FloorLocalName": [
+        "localName": [
           {"required": true, "message": "请输入楼层本地名称", "trigger": "blur"}
         ],
-        "FloorSequenceID": [
+        "floorSequenceID": [
           {"required": true, "message": "请输入楼层顺序号", "trigger": "blur"}
         ]
       }
@@ -134,7 +134,8 @@ export default {
       getDataDictionary(params, res => {
         let arr = res.content.map(item => {
           if ((item.inputMode === 'D1' || item.inputMode === 'D2' || item.inputMode === 'E2' || item.inputMode === 'D1L') && item.dataSource) {
-            item.options = JSON.parse(item.dataSource)
+            // item.options = JSON.parse(item.dataSource)
+            item.options = item.dataSource
             if (item.options[0] && item.options[0].content) {
               item.props = {
                 value: 'code',
@@ -144,19 +145,19 @@ export default {
               }
             }
           }
-          switch (item.infoPointCode) { //过滤掉待删除的
-            case 'FloorIdentity':
-            case 'RelatedSchedule':
-            case 'OutPeopleFlow':
-            case 'InPeopleFlow':
-            case 'ExsitPeopleNum':
+          switch (item.code) { //过滤掉待删除的
+            case 'floorIdentity':
+            case 'relatedSchedule':
+            case 'outPeopleFlow':
+            case 'inPeopleFlow':
+            case 'exsitPeopleNum':
               break;
             default:
               return item
           }
         })
         //手动删除掉数据字典中不存在的字段,等待后台同步
-        this.InforsList = arr.filter(t => t && t.infoPointCode != 'FloorQRCode')
+        this.InforsList = arr.filter(t => t && t.code != 'FloorQRCode')
       })
     },
     submitForm(call) {

+ 3 - 1
src/components/relation/overview/CardList.vue

@@ -4,7 +4,9 @@
       :key="index"
       v-for="(item,index) in content"
     >
-      <p class="slave-relation-title">{{item.GraphTypeName}}</p>
+      <p class="slave-relation-title">{{item.GraphTypeName}}
+      <span>(主要连接对象按照标准字典显示)</span>
+      </p>
       <section
         :key="child.GraphTypeId"
         class="container"

+ 1 - 1
src/views/data_admin/buildData/index.vue

@@ -685,7 +685,7 @@
             getFloorData() {
                 let param = {
                     Filters: `BuildID='${this.buildId}'`,
-                    Orders: 'FloorSequenceID desc'
+                    Orders: 'localId desc'
                 };
                 floorQuery(param, res => {
                     this.floorList = res.Content

+ 83 - 78
src/views/ready/buildfloor/addFloor/index.vue

@@ -1,94 +1,97 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="850px" @close="handleClose" id="messageDialog">
     <el-row>
-      <formItems :type="'Floor'" ref="formItems"></formItems>
+      <formItems :type="'floor'" ref="formItems"></formItems>
     </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible=false">取消</el-button>
-      <el-button size="small" type="primary" @click="confirm" >确认</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
     </span>
   </el-dialog>
 </template>
 <script>
-  import {manageCreateFloor, manageUpdateFloor} from "@/api/object/floor";
-  import formItems from "@/components/ready/buildfloor/formItems";
-  import tools from "@/utils/buildfloor/tools";
+import {manageCreateFloor, manageUpdateFloor} from "@/api/object/floor";
+import formItems from "@/components/ready/buildfloor/formItems";
+import tools from "@/utils/buildfloor/tools";
 
-  export default {
-    props: {
-      title: {
-        default: '提示'
-      },
-      type: {
-        default: 'Floor'
-      },
-      curBuildId: {
-        default: ''
-      },
-        curFloorId: {
-          default: ''
-        }
-      },
-      components: {
-        formItems
-      },
-      data() {
-        return {
-          dialogVisible: false, //弹窗显示与隐藏
-          floorData: {},
-        };
-      },
-      methods: {
-        showDialog(data) {
-          this.floorData = data || {};
-          this.floorData = tools.desFormatData(this.floorData)
-          this.floorData.Outline = this.floorData.Outline ? JSON.stringify(this.floorData.Outline) : null
-          //===测试代码===
-          // this.floorData.DefaultQRCode = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
-          // this.floorData.QRCodePic = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
-          //=====
+export default {
+  props: {
+    title: {
+      default: '提示'
+    },
+    type: {
+      default: 'Floor'
+    },
+    curBuildId: {
+      default: ''
+    },
+    curFloorId: {
+      default: ''
+    }
+  },
+  components: {
+    formItems
+  },
+  data() {
+    return {
+      dialogVisible: false, //弹窗显示与隐藏
+      floorData: {},
+    };
+  },
+  methods: {
+    showDialog(data) {
+      this.floorData = data || {};
+      this.floorData = tools.desFormatData(this.floorData)
+      this.floorData.Outline = this.floorData.Outline ? JSON.stringify(this.floorData.Outline) : null
+      //===测试代码===
+      // this.floorData.DefaultQRCode = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
+      // this.floorData.QRCodePic = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
+      //=====
+      this.timeoutSetVal()
+      this.dialogVisible = true;
+    },
+    timeoutSetVal() {
+      setTimeout(() => {
+        if (this.$refs.formItems) {
+          this.$refs.formItems.form = this.floorData
+        } else {
           this.timeoutSetVal()
-          this.dialogVisible = true;
-        },
-        timeoutSetVal() {
-          setTimeout(() => {
-            if (this.$refs.formItems) {
-              this.$refs.formItems.form = this.floorData
-            } else {
-              this.timeoutSetVal()
-            }
-          }, 500)
-        },
-        handleClose() { },
-        //创建
-        confirm() {
-          this.$refs.formItems.submitForm(this.save)
-        },
-        save() {
-          let form = this.$refs.formItems.form
-          let newform = tools.formatData(form)
-          newform.BuildID = this.curBuildId
-          newform.Outline = newform.Outline ? JSON.parse(newform.Outline) : null
-          let Param = {
-            Content: [newform]
-          }
-          if (newform.FloorID) {
-            manageUpdateFloor(Param, res => {
-              this.$message.success('更新成功')
-              this.$emit('refresh')
-              this.dialogVisible = false;
-            })
-          } else {
-            manageCreateFloor(Param, res => {
-              this.$message.success('创建成功')
-              this.$emit('refresh')
-              this.dialogVisible = false;
-            })
-          }
         }
-      },
-      mounted() { },
-      created() { }
+      }, 500)
+    },
+    handleClose() {
+    },
+    //创建
+    confirm() {
+      this.$refs.formItems.submitForm(this.save)
+    },
+    save() {
+      let form = this.$refs.formItems.form
+      let newform = tools.formatData(form)
+      newform.buildingId = this.curBuildId
+      newform.outline = newform.outline ? JSON.parse(newform.outline) : undefined
+      let Param = {
+        content: [newform]
+      }
+      if (newform.FloorID) {
+        manageUpdateFloor(Param, res => {
+          this.$message.success('更新成功')
+          this.$emit('refresh')
+          this.dialogVisible = false;
+        })
+      } else {
+        manageCreateFloor(Param, res => {
+          this.$message.success('创建成功')
+          this.$emit('refresh')
+          this.dialogVisible = false;
+        })
+      }
+    }
+  },
+  mounted() {
+  },
+  created() {
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -97,11 +100,13 @@
     height: 420px;
     overflow: auto;
   }
+
   .el-form-item {
     /deep/ label.el-form-item__label {
       font-size: 12px;
     }
   }
+
   /deep/ .FloorTypeSelect .el-form-item__content {
     width: 200px;
   }

+ 1 - 1
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -132,7 +132,7 @@ export default {
     // 获取楼层数据
     getFloorData() {
       let pa = {
-        Filters: `FloorID='${this.FloorID}'`
+        filters: `id='${this.FloorID}'`
       }
       floorQueryOutline(pa, res => {
         this.floorData = res.Content[0];

+ 42 - 53
src/views/ready/buildfloor/index.vue

@@ -5,17 +5,6 @@
         <div class="action-box">
           <div>
             <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="delBuild" icon="el-icon-minus" size="small" type="default"
                        :disabled="!buildList.length"/>
             <el-button @click="editBuild" icon="el-icon-edit-outline" size="small" type="default"
@@ -25,12 +14,13 @@
         <h4>建筑</h4>
         <div class="build-list">
           <div :class="{'floor-item':true,active:item.active}"
-               :key="item.BuildID"
+               :key="item.id"
                @click="changeBuild(index)"
+               style="cursor: pointer"
                v-for="(item,index) in buildList">
             <span>
-              {{ item.BuildLocalName || item.BuildName }}
-              <el-badge :value="item.Count" class="mark" v-if="item.Count>0"/>
+              {{ item.localName || item.name }}
+              <el-badge :value="item.count" class="mark" v-if="item.count>0"/>
             </span>
           </div>
         </div>
@@ -44,10 +34,10 @@
           <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>
+              <template slot-scope="scope">{{ scope.row.localName }}</template>
             </el-table-column>
             <el-table-column label="楼层顺序号">
-              <template slot-scope="scope">{{ scope.row.FloorSequenceID }}</template>
+              <template slot-scope="scope">{{ scope.row.floorSequenceID }}</template>
             </el-table-column>
             <el-table-column label="楼层信息">
               <template slot-scope="scope">
@@ -56,14 +46,14 @@
             </el-table-column>
             <el-table-column label="平面图" prop="dataSource">
               <template slot-scope="scope">
-                <p @click="checkDrawImg(scope.row,2)" v-if="scope.row.Sign>0">
+                <p @click="checkDrawImg(scope.row,2)" v-if="scope.row.sign>0">
                   <el-badge is-dot>
                     <i class="iconfont icon-floorplan"/>
                   </el-badge>
                   平面图重复
                 </p>
                 <p @click="checkDrawImg(scope.row,1)"
-                   v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false">
+                   v-else-if="scope.row.infos?scope.row.infos.floorMap:false">
                   <i class="iconfont icon-floorplan"/>
                   查看平面图
                 </p>
@@ -77,7 +67,7 @@
               <template slot-scope="scope">
                 <span
                   style="margin-right:20px">{{
-                    scope.row.FloorThroughList ? scope.row.FloorThroughList.length : 0
+                    scope.row.floorThroughList ? scope.row.floorThroughList.length : 0
                   }}</span>
                 <el-button @click="changeConnection(scope.row)" icon="el-icon-edit-outline" plain size="mini"/>
               </template>
@@ -200,7 +190,7 @@ export default {
   methods: {
     init() {
       let bdParam = {
-        Orders: "BuildLocalName asc",
+        Orders: "localName asc",
         PageNumber: 1,
         PageSize: 500
       };
@@ -219,8 +209,8 @@ export default {
         return item;
       });
       this.buildList[index].active = true;
-      this.curBuildId = this.buildList[index].BuildID;
-      this.curBuildName = this.buildList[index].BuildLocalName || this.buildList[index].BuildName;
+      this.curBuildId = this.buildList[index].id;
+      this.curBuildName = this.buildList[index].localName || this.buildList[index].name;
       this.getFloorTableData();
       this.$forceUpdate();
     },
@@ -234,7 +224,7 @@ export default {
     },
     handleSearchBuildKey() {
       let params = {
-        type: 'Building',
+        type: 'building',
         // orders: "sort asc,infoPointCode asc",
         pageNumber: 1,
         pageSize: 1000
@@ -245,12 +235,13 @@ export default {
         let list = res.content.filter(i => (i.firstName !== '工作历') && (i.firstName !== '能耗信息') && (i.firstName !== '人员信息'))
         list.map(item => {
           if ((item.inputMode === 'D1' || item.inputMode === 'D2' || item.inputMode === 'E2' || item.inputMode === 'D1L') && item.dataSource) {
-            item.options = JSON.parse(item.dataSource)
+            // item.options = JSON.parse(item.dataSource)
+            item.options = item.dataSource
             if (item.options[0] && item.options[0].content) {
               item.props = {
-                value: 'Code',
-                label: 'Name',
-                children: 'Content',
+                value: 'code',
+                label: 'name',
+                children: 'content',
                 checkStrictly: true
               }
             }
@@ -259,22 +250,18 @@ export default {
           } else {
             first[item.firstName] = []
           }
-          if (
-            item.path !== 'BuildingInfo.AreaInfo.AreaTree' &&
-            item.path !== 'DefaultQRCode' &&
-            item.path !== 'BuildQRCode'
-          ) {
+          if (item.path !== 'infos.areaTree') { //DefaultQRCode,BuildQRCode 不再维护
             first[item.firstName].push({
-              InfoPointName: item.infoPointName,
-              InfoPointCode: item.infoPointCode,
+              InfoPointName: item.name,
+              InfoPointCode: item.code,
               Visible: item.visible,
               UnDisabled: item.unDisabled,
               SecondName: item.secondName ? item.secondName : "",
               inputMode: item.inputMode,
-              options: item.options,
+              options: item.dataSource,
               props: item.props,
               Unit: item.unit,
-              path: item.path
+              Path: item.path
             })
           }
         })
@@ -291,7 +278,7 @@ export default {
     editBuild() {
       this.buildTitle = '编辑建筑';
       this.handleSearchBuildKey()
-      let list = this.currentBuildList.filter(i => i.BuildID === this.curBuildId)
+      let list = this.currentBuildList.filter(i => i.id === this.curBuildId)
       let obj = {}
       for (let i = 0; i < list.length; i++) {
         obj = list[i]
@@ -306,7 +293,7 @@ export default {
       let Param = {
         content: [newform]
       }
-      if (newform.BuildID) {
+      if (newform.id) {
         objectUpdateBuild(Param, res => {
           this.$message.success('更新成功')
           this.$refs.addBuildDialog.closeDialog()
@@ -335,7 +322,7 @@ export default {
     handleDelete(floor) {
       this.delText = "楼层";
       this.delDialogVis = true;
-      this.curFloorId = floor.FloorID;
+      this.curFloorId = floor.id;
     },
     //确认删除弹窗关闭
     handleClose() {
@@ -348,17 +335,17 @@ export default {
     // 获取列表
     getFloorTableData() {
       let floorParam = {
-        Cascade: [{Name: "floorThroughList"}],
-        Orders: "FloorSequenceID desc",
-        PageNumber: this.page.pageNumber,
-        PageSize: this.page.pageSize,
-        Filters: `BuildID='${this.curBuildId}'`
+        cascade: [{name: "floorThroughList"}],
+        orders: "floorSequenceID desc",
+        pageNumber: this.page.pageNumber,
+        pageSize: this.page.pageSize,
+        filters: `buildingId='${this.curBuildId}'`
       };
       floorQueryAndSign(floorParam, res => {
         this.tableData = res.content;
         this.page.total = res.total;
         this.alreadyRelatedModel = res.content.map(t => {
-          return t.ModelId
+          return t.modelId
         }).filter(t => t);
       });
     },
@@ -374,7 +361,7 @@ export default {
     confirmDel() {
       this.buildDisabled = true
       if (this.delText == "楼层") {
-        let delParam = [{FloorID: this.curFloorId}];
+        let delParam = [{id: this.curFloorId}];
         this.delDialogVis = false;
         manageDeleteFloor(delParam, res => {
           this.$message.success("删除成功");
@@ -388,7 +375,7 @@ export default {
           this.$message.error("当前建筑中包含楼层,不可删除");
           this.delDialogVis = false;
         } else {
-          let param = [{BuildId: this.curBuildId}];
+          let param = [{id: this.curBuildId}];
           this.delDialogVis = false;
           objectDeleteBuild(param, res => {
             this.$message.success("删除成功");
@@ -402,8 +389,9 @@ export default {
     },
     // 修改楼层信息
     editFloorData(floor) {
+      console.log(floor, 'floor')
       this.floorTitle = "编辑楼层信息";
-      this.curFloorId = floor.FloorID;
+      this.curFloorId = floor.id;
       this.$refs.addFloorDialog.showDialog(floor);
     },
     // 修改楼层贯通关系
@@ -417,12 +405,13 @@ export default {
         this.$refs.checkGraphy.showDialog(row);
         this.modelId = "";
       } else if (index == 1) {
-        this.modelId = row.StructureInfo.FloorMap
-        let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID, BuildName: this.curBuildName};
+        // this.modelId = row.StructureInfo.FloorMap
+        this.modelId = row.infos.floorMap
+        let pa = {modelId: this.modelId, FloorID: row.id, BuildID: row.buildingId, BuildName: this.curBuildName};
         this.$router.push({name: "repetitionGraphy", query: pa});
       } else {
-        this.modelId = row.ModelId;
-        let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID, BuildName: this.curBuildName};
+        this.modelId = row.modelId;
+        let pa = {modelId: this.modelId, FloorID: row.id, BuildID: row.buildingId, BuildName: this.curBuildName};
         this.$router.push({name: "repetitionGraphy", query: pa});
       }
     },
@@ -435,7 +424,7 @@ export default {
         PageSize: 500
       };
       objectQueryBuild(param, res => {
-        this.currentBuildList = res.Content
+        this.currentBuildList = res.content
       });
     },
 

+ 151 - 147
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -1,168 +1,172 @@
 <template>
-    <!-- 查看平面图页面 -->
-    <div id='repetitionGraphy'>
-        <div class='buttons'>
-            <el-button icon='el-icon-back' size='mini' @click='backRouter'></el-button>
-            <el-button v-if='!isEdit' size='mini' @click='changeGraphy'>替换平面图</el-button>
-            <el-button v-if='(sign||otherSign)&&!isEdit' size='mini' @click='editGraphy'>编辑平面图</el-button>
-            <el-button v-if='isEdit' size='mini' @click='cancel'>取消</el-button>
-            <el-button v-if='isEdit' size='mini' @click='confirm' type='primary'>确认</el-button>
-            <span style='float:right;' v-if='file.FolderName'>当前对应的模型文件:{{file.FolderName}} - {{file.FloorName}}</span>
-        </div>
-        <!-- 展示图片 -->
-        <div class='drawImg'>
-            <drawFloor ref='drawFloor' :isEdit='isEdit' :showTools='true' :id='1' @changeSign='changeSign'></drawFloor>
-        </div>
-        <!-- 查看图片弹窗 -->
-        <checkGraphy ref='checkGraphy' @refresh='refresh' :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+  <!-- 查看平面图页面 -->
+  <div id='repetitionGraphy'>
+    <div class='buttons'>
+      <el-button icon='el-icon-back' size='mini' @click='backRouter'></el-button>
+      <el-button v-if='!isEdit' size='mini' @click='changeGraphy'>替换平面图</el-button>
+      <el-button v-if='(sign||otherSign)&&!isEdit' size='mini' @click='editGraphy'>编辑平面图</el-button>
+      <el-button v-if='isEdit' size='mini' @click='cancel'>取消</el-button>
+      <el-button v-if='isEdit' size='mini' @click='confirm' type='primary'>确认</el-button>
+      <span style='float:right;' v-if='file.FolderName'>当前对应的模型文件:{{ file.FolderName }} - {{ file.FloorName }}</span>
     </div>
+    <!-- 展示图片 -->
+    <div class='drawImg'>
+      <drawFloor ref='drawFloor' :isEdit='isEdit' :showTools='true' :id='1' @changeSign='changeSign'></drawFloor>
+    </div>
+    <!-- 查看图片弹窗 -->
+    <checkGraphy ref='checkGraphy' @refresh='refresh' :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+  </div>
 </template>
 <script>
 import drawFloor from './drawGraphy/drawFloor'
 import checkGraphy from './drawGraphy/checkGraphy' //查看图片
-import { floorUpdateOutline, floorQueryAndSign } from '@/api/scan/request'
-import { getFileNameById } from '@/api/model/file'
+import {floorUpdateOutline, floorQueryAndSign} from '@/api/scan/request'
+import {getFileNameById} from '@/api/model/file'
+
 export default {
-    components: {
-        drawFloor,
-        checkGraphy,
+  components: {
+    drawFloor,
+    checkGraphy,
+  },
+  data() {
+    return {
+      modelId: '', //
+      isEdit: false, // 是否编辑模式
+      file: {},
+      alreadyRelatedModel: [],
+      sign: false,
+      otherSign: false,
+    }
+  },
+  created() {
+    this.modelId = this.$route.query.modelId
+    this.FloorID = this.$route.query.FloorID
+    this.BuildID = this.$route.query.BuildID
+    this.BuildName = this.$route.query.BuildName
+    if (this.modelId.split('.')[1].toString() == 'png' || this.modelId.split('.')[1].toString() == 'jpg') {
+      return
+    } else {
+      this.init()
+    }
+
+  },
+  mounted() {
+  },
+  methods: {
+    init() {
+      this.getFileName(this.modelId)
+      this.getFloorData()
     },
-    data() {
-        return {
-            modelId: '', //
-            isEdit: false, // 是否编辑模式
-            file: {},
-            alreadyRelatedModel: [],
-            sign: false,
-            otherSign: false,
-        }
+    // 返回路由
+    backRouter() {
+      this.$router.push({name: 'buildFloor'})
     },
-    created() {
-        this.modelId = this.$route.query.modelId
-        this.FloorID = this.$route.query.FloorID
-        this.BuildID = this.$route.query.BuildID
-        this.BuildName = this.$route.query.BuildName
-        if (this.modelId.split('.')[1].toString() == 'png' || this.modelId.split('.')[1].toString() == 'jpg') {
+    // 替换模型文件
+    changeGraphy() {
+      this.$refs.checkGraphy.showDialog({FloorID: this.FloorID, BuildID: this.BuildID})
+    },
+    // 确认保存
+    confirm() {
+      let sceneMark = this.$refs.drawFloor.drawMainScene.sceneMark,
+        Outline = null
+      if (sceneMark) {
+        if (sceneMark.outLine.length < 3) {
+          this.$message.warning('请添加轮廓线')
+          return
+        }
+        if (!sceneMark.closeFlag) {
+          this.$message.warning('请按回车闭合轮廓线')
+          this.$refs.drawFloor.focus()
           return
-        }else{
-           this.init()
         }
-       
+        Outline = this.$refs.drawFloor.drawMainScene.sceneMark.outLine
+        Outline = Outline.map((t) => {
+          return {
+            x: t.x.toFixed(2),
+            y: -t.y.toFixed(2),
+          }
+        })
+      }
+      let pa = {
+        content: [{id: this.FloorID, outline: Outline}],
+        Projection: ['outline'],
+      }
+      floorUpdateOutline(pa, (res) => {
+        this.isEdit = false
+        this.$message.success('更新成功')
+      })
     },
-    mounted() {},
-    methods: {
-        init() {
-            this.getFileName(this.modelId)
-            this.getFloorData()
-        },
-        // 返回路由
-        backRouter() {
-            this.$router.push({ name: 'buildFloor' })
-        },
-        // 替换模型文件
-        changeGraphy() {
-            this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID })
-        },
-        // 确认保存
-        confirm() {
-            let sceneMark = this.$refs.drawFloor.drawMainScene.sceneMark,
-                Outline = null
-            if (sceneMark) {
-                if (sceneMark.outLine.length < 3) {
-                    this.$message.warning('请添加轮廓线')
-                    return
-                }
-                if (!sceneMark.closeFlag) {
-                    this.$message.warning('请按回车闭合轮廓线')
-                    this.$refs.drawFloor.focus()
-                    return
-                }
-                Outline = this.$refs.drawFloor.drawMainScene.sceneMark.outLine
-                Outline = Outline.map((t) => {
-                    return {
-                        x: t.x.toFixed(2),
-                        y: -t.y.toFixed(2),
-                    }
-                })
-            }
-            let pa = {
-                Content: [{ FloorID: this.FloorID, Outline: Outline }],
-                Projection: ['Outline'],
-            }
-            floorUpdateOutline(pa, (res) => {
-                this.isEdit = false
-                this.$message.success('更新成功')
-            })
-        },
-        // 取消
-        cancel() {
-            this.isEdit = false
-            this.$refs.drawFloor.init()
-        },
-        // 编辑平面图
-        editGraphy() {
-            this.isEdit = true
-        },
-        // 替换模型文件成功
-        refresh(modelId) {
-            this.modelId = modelId
-            this.getFileName(this.modelId)
-        },
-        // 获取文件夹名称
-        getFileName(modelId) {
-            if (!modelId) return
-            let pa = {
-                Id: modelId,
-            }
-            getFileNameById(pa, (res) => {
-                this.file = res
-            })
-        },
-        // 获取楼层
-        getFloorData() {
-            let floorParam = {
-                PageSize: 1000,
-                Filters: `BuildID='${this.BuildID}'`,
-            }
-            floorQueryAndSign(floorParam, (res) => {
-                this.alreadyRelatedModel = res.Content.map((t) => {
-                    if (t.FloorID != this.FloorID) return t.ModelId
-                    this.sign = t.Sign > 0
-                    this.FloorName = t.FloorLocalName || t.FloorName
-                    this.$refs.drawFloor.buildFloorName = `${this.BuildName}-${this.FloorName}`
-                }).filter((t) => t)
-            })
-        },
-        changeSign(flag) {
-            this.otherSign = flag
-        },
+    // 取消
+    cancel() {
+      this.isEdit = false
+      this.$refs.drawFloor.init()
     },
-    watch: {
-        modelId(n, o) {
-            if (o && n != o) {
-                console.log(n.split('.')[1])
-                if (n.split('.')[1].toString() == 'png' || n.split('.')[1].toString() == 'jpg') {
-                    this.$refs.drawFloor.initGraphy(n, 3)
-                } else {
-                    this.$refs.drawFloor.initGraphy(n, 1)
-                }
-            }
-        },
+    // 编辑平面图
+    editGraphy() {
+      this.isEdit = true
     },
+    // 替换模型文件成功
+    refresh(modelId) {
+      this.modelId = modelId
+      this.getFileName(this.modelId)
+    },
+    // 获取文件夹名称
+    getFileName(modelId) {
+      if (!modelId) return
+      let pa = {
+        Id: modelId,
+      }
+      getFileNameById(pa, (res) => {
+        this.file = res
+      })
+    },
+    // 获取楼层
+    getFloorData() {
+      let _this = this
+      let floorParam = {
+        PageSize: 1000,
+        Filters: `buildingId='${this.BuildID}'`,
+      }
+      floorQueryAndSign(floorParam, (res) => {
+        this.alreadyRelatedModel = res.content.map((t) => {
+          if (t.id != _this.FloorID) return t.modelId
+          this.sign = t.sign > 0
+          this.FloorName = t.localName
+          this.$refs.drawFloor.buildFloorName = `${this.name}-${this.localName}`
+        }).filter((t) => t)
+      })
+    },
+    changeSign(flag) {
+      this.otherSign = flag
+    },
+  },
+  watch: {
+    modelId(n, o) {
+      if (o && n != o) {
+        console.log(n.split('.')[1])
+        if (n.split('.')[1].toString() == 'png' || n.split('.')[1].toString() == 'jpg') {
+          this.$refs.drawFloor.initGraphy(n, 3)
+        } else {
+          this.$refs.drawFloor.initGraphy(n, 1)
+        }
+      }
+    },
+  },
 }
 </script>
 <style lang="less">
 #repetitionGraphy {
+  width: 100%;
+  height: 100%;
+  background: #fff;
+  position: relative;
+  padding: 10px;
+  box-sizing: border-box;
+
+  .drawImg {
     width: 100%;
-    height: 100%;
-    background: #fff;
-    position: relative;
-    padding: 10px;
-    box-sizing: border-box;
-    .drawImg {
-        width: 100%;
-        margin-top: 10px;
-        height: calc(100% - 40px);
-    }
+    margin-top: 10px;
+    height: calc(100% - 40px);
+  }
 }
 </style>