ソースを参照

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

haojianlong 4 年 前
コミット
ce08b2b939

ファイルの差分が大きいため隠しています
+ 0 - 12972
package-lock.json


+ 4 - 0
src/api/editer.js

@@ -84,4 +84,8 @@ export function deleteGraph(params){
 // 发布系统图
 export function publishGraph(params){
     return httputils.postJson(`${testApi}/graph/publish`, params)
+}
+// 查询设备台账
+export function queryGlsmsAsset(data,params){
+    return httputils.fetchJson(`${dataApi}/data/glsms_asset/query`,data, params)
 }

+ 17 - 10
src/components/baseEditer.vue

@@ -143,7 +143,7 @@ export default {
             console.log("success");
             // 设置初始化缩放比例
             this.initScale = this.view.scale
-            bus.$emit('initScale', this.view.scale)
+            bus.$emit('initScale', this.view.scale);
           });
         } else {
           console.log("楼层不正确");
@@ -291,6 +291,7 @@ export default {
         saveGroup(data).then(res => {
           Message.close()
           console.log("aaaaaaaaaaaaaa", res);
+          this.graphId = res.Data;
         });
       });
       bus.$on("exportByKey", val => {
@@ -388,12 +389,16 @@ export default {
       }),
       //发布图
       bus.$on("publishMap", () => {
+        if(this.graphId==''){
+          this.$message.error('请先保存');
+          return false;
+        }
        this.publishBtn()
       })
       /**
        * @name changeScale缩放底图
        * @param { Number } zoom 缩放比例
-       * 
+       *
        */
       // TODO: changeScale缩放底图
       bus.$on('changeScale', zoom => {
@@ -436,13 +441,15 @@ export default {
       publishGraph(data).then(res => {
         loadings.close();
         if (res.Result == "success") {
-          this.$message.success(res.Message);
-          const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
-          const url =
-                  window.location.origin +
-                  "/wandaEditer/drafts?" +
-                  encodeURIComponent(data);
-          window.open(url, true);
+          this.$message.success('发布成功');
+         setTimeout(()=>{
+           const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
+           const url =
+                   window.location.origin +
+                   "/wandaEditer/drafts?" +
+                   encodeURIComponent(data);
+           window.open(url, true);
+         },1000);
         } else {
           this.$message.error(res.Message);
         }
@@ -474,7 +481,7 @@ export default {
       },
       deep: true
     },
-    // 监听scale的变化 
+    // 监听scale的变化
     'view.scale': {
       handler(scale) {
 

+ 48 - 13
src/components/edit/attr_select.vue

@@ -104,10 +104,6 @@
     <!--针对“设备/位置/管线/分区”属性示例-->
     <div class="attr-select" v-show="type =='Image'|| type == 'Line' || type == 'Zone'">
       <div v-if="type =='Image'|| type == 'Line'">
-        <div class="row-tit" v-if="true">颜色</div>
-        <div class="row" v-if="true">
-          <swatches @input="changefillColor" :swatches="swatchess" v-model="fillColor" inline></swatches>
-        </div>
         <div class="row">
           <div class="row-tit">名称显示</div>
           <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{editStatus[type]}}</a-button>
@@ -149,7 +145,7 @@
           </div>
         </div>
       </div>
-      <div v-else>
+      <div v-if="type == 'Zone'">
         <div v-if="SubType=='FHFQ'">
           <!-- 防火分区 -->
           <div class="row-tit">颜色</div>
@@ -244,20 +240,21 @@
     </div>
 
     <!--设备/工程信息化ID/工程信息化中的位置类型-->
+
     <div
       class="attr-select attr-select-bottom"
       v-if="type =='Zone' || type =='Image' ||type == 'fire-Zone' ||type == 'Line'"
     >
+      <a-spin :spinning="spinning">
       <div class="row">
-        <span>{{`工程信息化ID`}}</span>
+        <span>{{type =='Zone'?`工程信息化中的位置类型`:'工程信息化中的设备类型'}}</span>
         <a-button type="link" class="edit-option-btn" @click="handleEdit">选择编辑</a-button>
       </div>
 
-      <div class="grid-content">
-        <a-card class="attr-card">福建三明万达-供电系统-6楼-工程信息化中的区域编NDDKJD4</a-card>
-        <a-card class="attr-card">福建三明万达-供电系统-6楼-工程信息化中的区域编NDDKJD</a-card>
-        <a-card class="attr-card">福建三明万达-供电系统-6楼-工程信息化中的区域编NDDKJD</a-card>
-      </div>
+        <div class="grid-content">
+          <a-card class="attr-card" v-for="(item,index) in attrCards" :key="index">{{item.wzjc ||item.sbjc}}</a-card>
+        </div>
+      </a-spin>
     </div>
     <!--    快捷操作提示-->
     <div style="position: fixed;bottom: 0;width: 280px;" class="key-boards">
@@ -297,7 +294,7 @@ import Swatches from "vue-swatches";
 import bus from "@/bus";
 import "vue-swatches/dist/vue-swatches.css";
 import { ItemColor } from "@saga-web/big/lib";
-import { uploadImg } from "@/api/editer.js";
+import { uploadImg, queryGlsmsLocation,queryGlsmsAsset } from "@/api/editer.js";
 export default {
   name: "attr_select",
   props: ["type", "focusItemList"],
@@ -373,7 +370,9 @@ export default {
       imageNum: 1, //设备数量
       fillColor: "", //修改填充色 (主要针对防火风区以及石材铺装)
       SubType: "", //空间类型,区分石材铺装
-      itemExplain:'' //图例说明 只针对石材铺装
+      itemExplain:'', //图例说明 只针对石材铺装
+      attrCards:[],
+      spinning:false
     };
   },
   methods: {
@@ -464,6 +463,7 @@ export default {
   },
   watch: {
     focusItemList: function(newval) {
+      console.log(111111111,newval);
       const Item = newval.itemList[0];
       if (Item.data && Item.data.SubType) {
         this.SubType = Item.data.SubType;
@@ -483,6 +483,11 @@ export default {
           newval.itemType == "Image"
         ) {
           this.lengedName = Item.data.Name;
+          this.itemExplain = '';
+          if(Item.data.Properties.ItemExplain){
+          this.itemExplain = Item.data.Properties.ItemExplain ? Item.data.Properties.ItemExplain : '';
+          }
+
           if (newval.itemType == "Image") {
             this.imageNum = Item.num;
             this.color = Item.color.value;
@@ -495,12 +500,42 @@ export default {
           }
         }
       }
+     if(newval.itemType == 'Zone'){
+       let location = Item.location;
+       this.spinning = true;
+       queryGlsmsLocation({plazaId: '1000423'},{location:'1890'}).then(res=>{
+         this.spinning = false;
+         if(res.data.result =='success'){
+           this.attrCards = res.data.data;
+         }else{
+           this.$message.error('工程信息化中的位置信息获取失败')
+         }
+       })
+     }else if(newval.itemType == 'Image'){
+       this.spinning = true;
+       queryGlsmsAsset({plazaId: '1000423'},{assetnum:'21784'}).then(res=>{
+         this.spinning = false;
+         if(res.data.result =='success'){
+           this.attrCards = res.data.data;
+         }else{
+           this.$message.error('工程信息化中的设备信息获取失败')
+         }
+       })
+     }
+
     }
   }
 };
 </script>
 
 <style scoped lang="less">
+  /deep/ .ant-spin-nested-loading{
+    height: 100% !important;
+    .ant-spin-container{
+      height: 100% !important;
+
+    }
+  }
 .attr-select {
   padding: 12px 16px;
   box-sizing: border-box;

+ 2 - 1
src/components/edit/left_toolbar.vue

@@ -82,7 +82,7 @@
           <a-spin :spinning="spinning">
           <div class="drawer-model-body" v-if="!isExtract">
             <div class="btn-list">
-              <a-radio-group default-value="draw" button-style="solid" @change="changeDrawType">
+              <a-radio-group v-show="showDrawerItem.type == 'Zone'" default-value="draw" button-style="solid" @change="changeDrawType">
                 <a-radio-button value="draw">
                   绘制
                 </a-radio-button>
@@ -290,6 +290,7 @@ export default {
     },
     showDrawer(item) {
       this.showDrawerItem = item;
+      console.log('showDrawerItem',this.showDrawerItem)
       this.isExtract = false;
       if (item.isChoice) {
         this.systemChoice.forEach(a => {

+ 1 - 0
src/components/edit/right_toolbar.vue

@@ -177,6 +177,7 @@ export default {
   watch: {
     focusItemList: function(newVal) {
       this.attrType = newVal.itemType;
+      console.log(' this.attrType',this.attrType)
       if (newVal.itemList.length !== 1) {
         this.msgList.forEach(item => {
           if (item.name == "X") {

+ 1 - 1
src/components/edit/top_toolbar.vue

@@ -177,7 +177,7 @@ export default {
         return false
       }
       // emit 缩放比例 this.scale / oldScale
-      let oldScale = this.scale
+      const oldScale = this.scale
       this.scale = Number((oldScale + type * this.scaleStep).toFixed(2))
       bus.$emit('changeScale', this.scale / oldScale)
     },

+ 4 - 4
src/components/mapClass/EditScence.ts

@@ -625,12 +625,12 @@ export class EditScence extends SGraphScene {
         }
     }
     /**
-   * 更改图例说明数量
-   * @param num number item数量 (只对icon设备类)
+   * 更改图例说
+   * @param num number
    */
-    upadatitemExplain(itemExplain: string): void {
+    upadatitemExplain(ItemExplain: string): void {
         if (this.focusItem) {
-            this.focusItem.itemExplain = itemExplain;
+            this.focusItem.data.Properties.ItemExplain = ItemExplain;
         }
     }