Kaynağa Gözat

位置标签接口调整

haojianlong 4 yıl önce
ebeveyn
işleme
4bcc102f4f

+ 1 - 7
src/api/scan/request.js

@@ -182,7 +182,7 @@ export function updateLocationPoint(param, success) {
 
 //根据点位标签推荐业务空间
 export function zoneQueryByPoint(param, success) {
-  let url = `${baseUrl}${compSpace}/in-bdfl-zonespacebase?X=${param.X}&Y=${param.Y}`;
+  let url = `${baseUrl}${compSpace}/in-bdfl-zonespacebase?X=${param.x}&Y=${param.y}`;
   http.postJson(url, param.data, success)
 }
 
@@ -1488,12 +1488,6 @@ export function countGeneralSys(param, success) {
   http.postJson(url, param, success)
 }
 
-//头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
-export function queryPhysicsAllType(param, success) {
-  let url = `${baseUrl}${classDef}/category?type=${param}`;
-  http.postJson(url, {}, success)
-}
-
 //查询所有设备族信息
 export function queryFamilyAll(success) {
   let url = `${baseUrl}${dataCenter}/data-dictionary/family-query-All`;

+ 43 - 25
src/components/data_admin/zoneInput.vue

@@ -3,18 +3,18 @@
     <el-form label-position="left" :label-width="labelWidth" :model="form">
       <div v-for="(titem, tkey) in inputTypeList" :key="tkey">
         <h4>{{ tkey }}</h4>
-        <el-form-item v-for="(item, key) in titem" :key="key" :label="item.InfoPointName" class="input-item">
-          <el-input v-model="item.inputValue" v-if="item.InputMode == 'A1'|| item.InputMode == 'A2'" type="number">
+        <el-form-item v-for="(item, key) in titem" :key="key" :label="item.name" class="input-item">
+          <el-input v-model="item.inputValue" v-if="item.inputMode == 'A1'|| item.inputMode == 'A2'" type="number">
             <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
           </el-input>
-          <el-input v-model="item.inputValue" v-else-if="item.InputMode == 'B1' || item.InputMode == 'L' || item.InputMode == 'M'"></el-input>
-          <el-select v-model="item.inputValue" v-else-if="item.InputMode == 'D1'" placeholder="请选择">
-            <el-option v-for="(soption,skey) in item.options" :key="skey" :label="soption.Name" :value="soption.Code">
+          <el-input v-model="item.inputValue" v-else-if="item.inputMode == 'B1' || item.inputMode == 'L' || item.inputMode == 'M'"></el-input>
+          <el-select v-model="item.inputValue" v-else-if="item.inputMode == 'D1'" placeholder="请选择">
+            <el-option v-for="(soption,skey) in item.options" :key="skey" :label="soption.name" :value="soption.code">
             </el-option>
           </el-select>
-          <el-cascader v-model="item.inputValue" v-else-if="item.InputMode == 'D1L'" placeholder="请在台账中维护该类型信息点"
+          <el-cascader v-model="item.inputValue" v-else-if="item.inputMode == 'D1L'" placeholder="请在台账中维护该类型信息点"
             :props="item.props" :options="item.options" filterable clearable disabled :show-all-levels="false"></el-cascader>
-          <el-input v-model="item.inputValue" v-else></el-input>
+          <el-input v-model="item.inputValue" v-else disabled placeholder="请在台账中维护该类型信息点"></el-input>
         </el-form-item>
       </div>
     </el-form>
@@ -51,31 +51,41 @@ export default {
     //数据过滤
     filterInput() {
       this.inputData = this.inputData.filter(item => {
-        return item.Editable == true && item.Visible == true && item.FirstName && item.InfoPointCode;
+        return item.editable == true && item.visible == true && item.code;
       })
       let numbersInput = ['A1', 'A2'];
       let stringInput = ['B1', 'L', 'M'];
       let arrayInput = ['D1'];
       let cascaderInput = ['D1L'];
       this.inputData.map(item => {
-        if (numbersInput.indexOf(item.InputMode) != -1) {
+        if (numbersInput.indexOf(item.inputMode) != -1) {
           item.inputValue = null;
         }
-        else if (stringInput.indexOf(item.InputMode) != -1) {
+        else if (stringInput.indexOf(item.inputMode) != -1) {
           item.inputValue = '';
         }
-        else if (arrayInput.indexOf(item.InputMode) != -1) {
-          let options = JSON.parse(item.DataSource)
+        else if (arrayInput.indexOf(item.inputMode) != -1) {
+          let options;
+          if (item.dataSource instanceof Array) {
+            options = item.dataSource;
+          } else {
+            options = JSON.parse(item.dataSource)
+          }
           item.inputValue = '';
           item.options = options;
         }
-        else if(cascaderInput.indexOf(item.InputMode) != -1){
-          let options = JSON.parse(item.DataSource);
-          if (options[0] && options[0].Content) {
+        else if(cascaderInput.indexOf(item.inputMode) != -1){
+          let options;
+          if (item.dataSource instanceof Array) {
+            options = item.dataSource;
+          } else {
+            options = JSON.parse(item.dataSource)
+          }
+          if (options[0] && options[0].content) {
             item.props = {
-              value: 'Code',
-              label: 'Name',
-              children: 'Content',
+              value: 'code',
+              label: 'name',
+              children: 'content',
               checkStrictly: true
             }
           }
@@ -86,19 +96,27 @@ export default {
           item.inputValue = '';
         }
       });
-
     },
     //数据分组
     inputGroup() {
+      this.inputTypeList['item.firstName']
       this.inputData.map(item => {
-        if (!this.inputTypeList[item.FirstName]) {
-          this.inputTypeList[item.FirstName] = [];
+        if (item.firstName) {
+          if (!this.inputTypeList[item.firstName]) {
+            this.inputTypeList[item.firstName] = [];
+          }
+          this.inputTypeList[item.firstName].push(item)
+        } else {
+          item.firstName = "信息"
+          if (!this.inputTypeList[item.firstName]) {
+            this.inputTypeList[item.firstName] = [];
+          }
+          this.inputTypeList[item.firstName].push(item)
         }
-        this.inputTypeList[item.FirstName].push(item)
       })
       for (let key in this.inputTypeList) {
         if (this.inputTypeList[key] instanceof Array) {
-          this.inputTypeList[key].sort((item1, item2) => { return item1.Sort < item2.Sort });
+          this.inputTypeList[key].sort((item1, item2) => { return item1.sort < item2.sort });
         }
       }
     },
@@ -109,10 +127,10 @@ export default {
         this.inputTypeList[key].map(item => {
           if (item.inputValue != '' && item.inputValue != null) {
             if (item.inputValue instanceof Array) {
-              tools.setDataForKey(f, item.Path, item.inputValue.pop());
+              tools.setDataForKey(f, item.path, item.inputValue.pop());
             }
             else {
-              tools.setDataForKey(f, item.Path, item.inputValue);
+              tools.setDataForKey(f, item.path, item.inputValue);
             }
           }
         })

+ 29 - 31
src/views/data_admin/buildGraphy/createPointZone.vue

@@ -10,7 +10,7 @@
           <span>基本信息:</span>
           <div>
             <label><span style="color:red;">*</span>业务空间名称</label>
-            <el-input placeholder="请输入业务空间名称" v-model="RoomLocalName" clearable
+            <el-input placeholder="请输入业务空间名称" v-model="localName" clearable
                       style="width:215px;margin-right:10px;"></el-input>
             <label>业务空间编码</label>
             <el-input placeholder="请输入业务空间编码" v-model="localId" clearable
@@ -23,7 +23,7 @@
                          style="width:215px;margin-right:10px;"></el-cascader>
             <label><span style="color:red;">*</span>业务空间类型</label>
             <el-select v-model="space" placeholder="请选择空间" style="width:215px;margin-right:10px;" @change="changeSpace">
-              <el-option v-for="item in spaceList" :key="item.Code" :label="item.Name" :value="item.Code">
+              <el-option v-for="item in spaceList" :key="item.code" :label="item.name" :value="item.code">
               </el-option>
             </el-select>
           </div>
@@ -33,7 +33,7 @@
           <i style="cursor: pointer;" :class="showEx"
              @click="showEx = (showEx == 'el-icon-arrow-up' ? 'el-icon-arrow-down' : 'el-icon-arrow-up')"></i>
           <div v-show="showEx == 'el-icon-arrow-up'" v-loading="loadingOtherMsg">
-            <zoneInput v-show="otherList.length" :inputList="otherList" labelWidth="140px" ref="zoneInput"></zoneInput>
+            <zoneInput v-show="otherList.length" labelWidth="140px" ref="zoneInput"></zoneInput>
             <p v-show="!otherList.length">请选择业务空间类型</p>
           </div>
         </div>
@@ -48,9 +48,8 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead, zoneCreate } from '@/api/scan/request';
-import { getDataDictionary } from "@/api/dict";
-
+import { zoneCreate } from '@/api/scan/request';
+import { getDataDictionary, queryPhysicsAllType } from "@/api/dict";
 import { mapGetters } from 'vuex'
 import zoneInput from '@/components/data_admin/zoneInput'
 
@@ -58,19 +57,17 @@ export default {
   data() {
     return {
       floorProps: {
-        value: 'BuildID',
-        label: 'BuildLocalName',
-        children: 'Floor'
+        value: 'id',
+        label: 'localName',
+        children: 'floor'
       },
       options: [],//建筑楼层
       spaceList: [],//空间列表
       space: '',//当前空间
       buildFloor: [],//建筑楼层信息
-      zoneName: '',//业务空间名称
-      zoneLocalId: '',//业务空间编码
       showEx: 'el-icon-arrow-down',//下拉菜单
-      RoomLocalID: '',//业务空间本地编码
-      RoomLocalName: '',//业务空间名称
+      localId: '',//业务空间本地编码
+      localName: '',//业务空间名称
       otherList: [],//可补充信息list
       loadingOtherMsg: false,
     }
@@ -91,33 +88,33 @@ export default {
     //创建
     createZ() {
       let param = {
-        Content: []
+        content: []
       }
       let zObj = this.$refs.zoneInput.getFormData();
-      zObj.Pic = this.$refs.pointMsg.choImg.concat();
-      zObj.Pic = zObj.Pic.map(item => ({
-        Id: item.ObjectId,
-        Key: item.Key,
-        Name: item.Name,
-        Type: item.Type
+      zObj.pic = this.$refs.pointMsg.choImg.concat();
+      zObj.pic = zObj.pic.map(item => ({
+        id: item.ObjectId,
+        key: item.Key,
+        name: item.Name,
+        type: item.Type
       }))
-      if (this.RoomLocalName && this.buildFloor.length && this.space) {
+      if (this.localName && this.buildFloor.length && this.space) {
         zObj.classCode = this.space;
-        zObj.localName = this.RoomLocalName;
-        zObj.localId = this.RoomLocalID;
+        zObj.localName = this.localName;
+        zObj.localId = this.localId;
         zObj.buildingId = this.buildFloor[0];
         zObj.floorId = this.buildFloor[1];
         param.content = [zObj];
         zoneCreate(param, res => {
           this.$message.success("创建成功");
           this.$refs.pointMsg.clearImg();
-          this.RoomLocalName = ''
-          this.RoomLocalID = ''
+          this.localName = ''
+          this.localId = ''
           this.buildFloor = []
           this.space = ''
           this.otherList = []
         })
-      } else if (!this.RoomLocalName) {
+      } else if (!this.localName) {
         this.$message("请输入业务空间名称");
       } else if (!this.buildFloor.length) {
         this.$message("请选择所属建筑楼层");
@@ -128,11 +125,11 @@ export default {
     //获取空间列表
     getSpaceList() {
       let pa = {
-        Filters: `parentId='Space'`
+        type: `space`
       }
-      queryDictionaryHead(pa, res => {
-        this.spaceList = res.Content.filter((item => {
-          return item.Name != '元空间'
+      queryPhysicsAllType(pa, res => {
+        this.spaceList = res.content.filter((item => {
+          return item.name != '元空间'
         }));
       });
     },
@@ -153,7 +150,8 @@ export default {
           item.inputValue = null;
           return filterCode.indexOf(item.code) == -1
         });
-        this.otherList = res.Content;
+        this.otherList = res.content;
+        console.log(this.otherList);
         this.$refs.zoneInput.init(this.otherList);
       })
     },

+ 4 - 4
src/views/data_admin/buildGraphy/locationPointMsg.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="locationPointMsg" style="width:100%;border:1px solid rgb(204,204,204)">
     <div style="padding:5px 10px;border-bottom:1px solid rgb(204,204,204);">
-      <label class="item">位置标签名称:{{pointObj.Name || '--'}}</label>
-      <label class="item">本地编码:{{pointObj.LocalId || '--'}}</label>
-      <label class="item">备注:{{pointObj.Note || '--'}}</label>
+      <label class="item">位置标签名称:{{pointObj.name || '--'}}</label>
+      <label class="item">本地编码:{{pointObj.localId || '--'}}</label>
+      <label class="item">备注:{{pointObj.note || '--'}}</label>
     </div>
     <div style="padding:5px 10px;">
       <p>勾选需要补充到业务空间的图片信息</p>
-      <div v-if="pointObj.ImageList && pointObj.ImageList.length">
+      <div v-if="pointObj.imageList && pointObj.imageList.length">
         <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"><span style="padding-left:25px;vertical-align: text-bottom;">全选</span></el-checkbox>
         <div style="margin: 15px 0;"></div>
         <el-checkbox-group v-model="choImg" @change="handleCheckedCitiesChange">

+ 9 - 8
src/views/data_admin/buildGraphy/updatePointZone.vue

@@ -38,8 +38,9 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead, zoneQueryByPoint, zoneQuery, updateZonePic } from '@/api/scan/request';
+import { zoneQueryByPoint, zoneQuery, updateZonePic } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
+import { getDataDictionary, queryPhysicsAllType } from "@/api/dict";
 export default {
   data() {
     let that = this;
@@ -108,15 +109,15 @@ export default {
     //获取空间列表
     getSpaceList() {
       let pa = {
-        X: this.pointItem.X,
-        Y: this.pointItem.Y,
+        x: this.pointItem.x,
+        y: this.pointItem.y,
         data: {
-          Filters: `buildingId = '${this.pointItem.BuildId}' and floorId = '${this.pointItem.FloorId}'`,
-          "Cascade": [{ "Name": "floor" }, { "Name": "building" }, { "Name": "zoneName" }]
+          filters: `buildingId='${this.pointItem.buildId}' and floorId='${this.pointItem.floorId}'`,
+          cascade: [{ name: "floor" }, { name: "building" }, { name: "zoneName" }]
         }
       }
       zoneQueryByPoint(pa, res => {
-        this.zoneList = res.Content;
+        this.zoneList = res.content;
       });
     },
     //级联node
@@ -148,9 +149,9 @@ export default {
         }
         else {
           let pa = {
-            Filters: `parentId='Space'`
+            type: `space`
           }
-          queryDictionaryHead(pa, res => {
+          queryPhysicsAllType(pa, res => {
             this.zoneTypeList = res.Content.filter((item => { return item.Name != '元空间' })).map(item => ({
               value: item.Code,
               label: item.Name,