Просмотр исходного кода

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

haojianlong 4 лет назад
Родитель
Сommit
e2af363889

+ 8 - 2
src/components/baseEditer.vue

@@ -309,9 +309,10 @@ export default {
         });
         saveGroup(data).then(res => {
           Message.close()
-          console.log("aaaaaaaaaaaaaa", res);
           this.graphId = res.Data;
-        });
+        }).catch((err)=>{
+
+        })
       });
       bus.$on("exportByKey", val => {
         const list = this.fParser.spaceList
@@ -428,6 +429,11 @@ export default {
         setTimeout(() => {
         }, 100);
       })
+      // 更改图例数据工程化数据
+       bus.$on('changeAttachObjectIds', arr => {
+        this.scene.upadatAttachObjectIds(arr);
+      })
+
     },
     // 读取数据
     readGroup() {

+ 10 - 3
src/components/edit/attr_select.vue

@@ -467,6 +467,10 @@ export default {
     // 编辑图例说明
     changeitemExplain(){
       bus.$emit("changeitemExplain",this.itemExplain);
+    },
+    // 更改工程信息化数据
+    changeAttachObjectIds(arr){
+      bus.$emit('changeAttachObjectIds',arr)
     }
   },
   watch: {
@@ -508,10 +512,13 @@ export default {
           }
         }
       }
+      let  location =[];
+      Item.data.AttachObjectIds.map(item=>{
+        location.push(item.id)
+      })
      if(newval.itemType == 'Zone'){
-       const location = Item.location;
        this.spinning = true;
-       queryGlsmsLocation({plazaId: '1000423'},{location:'1890'}).then(res=>{
+       queryGlsmsLocation({plazaId: '1000423'},{location:location}).then(res=>{
          this.spinning = false;
          if(res.data.result =='success'){
            this.attrCards = res.data.data;
@@ -521,7 +528,7 @@ export default {
        })
      }else if(newval.itemType == 'Image'){
        this.spinning = true;
-       queryGlsmsAsset({plazaId: '1000423'},{assetnum:'21784'}).then(res=>{
+       queryGlsmsAsset({plazaId: '1000423'},{assetnum:location}).then(res=>{
          this.spinning = false;
          if(res.data.result =='success'){
            this.attrCards = res.data.data;

+ 16 - 11
src/components/edit/edit-dialog.vue

@@ -41,7 +41,7 @@
           <searchTree  @getTreeId="getTreeId" :treeData="treeData"/>
         </div>
         <div class="checkbox">
-          <a-table :pagination="false" row-key='id' :columns="typeEdit=='Image'?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
+          <a-table :pagination="false" row-key='location||assetnum' :columns="typeEdit=='Image'?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
           <a-pagination v-if="total>0" v-model="page" :total="total" show-less-items style="margin-left: auto;"  @change="handleTableChange"/>
         </div>
       </div>
@@ -148,7 +148,11 @@
                 setTimeout(() => {
                     this.visible = false;
                     this.loading = false;
-                  console.log(this.selectedRowKeys);
+                    let lists = [];
+                    this.selectList.map(item =>{
+                      lists.push({id:item.location||item.assetnum,name:item.wzjc||item.sbjc})
+                    })
+                  console.log(lists);
                 }, 3000);
             },
             handleCancel(e) {
@@ -245,6 +249,7 @@
           },
           // 中间表格勾选
           onSelectChange(selectedRowKeys,selectedRows) {
+            console.log(selectedRows);
             this.selectedRowKeys = selectedRowKeys;
               if(this.selectedRowKeys.length>this.sysNum){
                 this.selectedRowKeys.pop();
@@ -254,15 +259,15 @@
             selectedRows.map(item=>{
               this.selectList.push(item)
             })
-            let obj = {}
-
-            this.selectList = this.selectList.reduce (function(item,next){
-
-              obj[next.id] ? ' ' : obj[next.id]  = true && item.push(next)
-
-              return item;
-
-            },[])
+            // let obj = {}
+            //
+            // this.selectList = this.selectList.reduce (function(item,next){
+            //
+            //   obj[next.id] ? ' ' : obj[next.id]  = true && item.push(next)
+            //
+            //   return item;
+            //
+            // },[])
           },
           //右侧删除
           deleteItem(item,index){

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

@@ -7,7 +7,7 @@
         v-for="(item,i) in baseChoice"
         :key="i"
         @click="toolActionClick(item)"
-        v-bind:class="{ actives:item.isChoice}"
+        :class="{ actives:item.isChoice}"
       >
         <div class="item">
           <img
@@ -406,7 +406,6 @@ export default {
     params = decodeURIComponent(params);
     // params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
     const paramsArr = params.split("&");
-    console.log("paramsArr", paramsArr);
     const obj = {};
     paramsArr.map(item => {
       const arr = item.split("=");
@@ -455,6 +454,7 @@ export default {
       align-items: center;
       justify-content: center;
       position: relative;
+      cursor: pointer;
       .item {
         margin: 0 auto;
         display: flex;

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

@@ -195,11 +195,12 @@ export default {
         });
         this.aspectRatio = 1;
       } else {
+        // 属性输入框宽高显示的数值
+        let inputW,inputH;
         this.msgList.forEach(item => {
           const Item = newVal.itemList[0];
           const width = Item.boundingRect().width;
           const height = Item.boundingRect().height;
-          this.aspectRatio = width / height;
           if (item.name == "X") {
             item.msg = Item.mapToScene(
               Item.boundingRect().left,
@@ -224,6 +225,7 @@ export default {
             } else {
               item.disable = true;
             }
+            inputW = item.msg;
           }
           if (item.name == "Height") {
             item.msg = height;
@@ -237,8 +239,10 @@ export default {
             } else {
               item.disable = true;
             }
+            inputH = item.msg;
           }
         });
+        this.aspectRatio = inputW / inputH;
       }
     }
   }

+ 21 - 6
src/components/mapClass/EditScence.ts

@@ -237,14 +237,16 @@ export class EditScence extends SGraphScene {
      * 增加多边形item lenged
      */
     addPolygonItem(event: SMouseEvent): void {
-        const SubType = this._legend.SubType ? this._legend.SubType : ''
+        const SubType = this._legend.SubType ? this._legend.SubType : '';
+        //获取信息工程化相关参数
+        const AttachObjectIds = this._legend.InfoLocal ? this._legend.InfoLocal : [];
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
             GraphElementType: this._legend.Type,
             Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
+            AttachObjectIds: AttachObjectIds,
             Type: "Zone",
             Pos: { X: event.x, Y: event.y },
             OutLine: [{ X: event.x, Y: event.y }],
@@ -291,14 +293,15 @@ export class EditScence extends SGraphScene {
         if (this.isSelecting && this._legend) {
             //@ts-ignore
             item.isExtracted = true
-            const SubType = this._legend.SubType ? this._legend.SubType : ''
+            const SubType = this._legend.SubType ? this._legend.SubType : '';
+            const AttachObjectIds = this._legend.InfoLocal ? this._legend.InfoLocal : [];
             const LegendData: Legend = {
                 ID: uuid(),
                 Name: this._legend.Name,
                 GraphElementType: this._legend.Type,
                 Num: 1,
                 GraphElementId: this._legend.Id,
-                AttachObjectIds: [],
+                AttachObjectIds: AttachObjectIds,
                 Type: "Zone",
                 Pos: { X: item.x, Y: item.y },
                 OutLine: item.pointArr[0],
@@ -406,13 +409,15 @@ export class EditScence extends SGraphScene {
      * 增加图标lenged图标
      */
     addIconItem(event: SMouseEvent): void {
+           //获取信息工程化相关参数
+        const AttachObjectIds = this._legend.InfoLocal ? this._legend.InfoLocal : [];
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
             GraphElementType: this._legend.Type,
             Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
+            AttachObjectIds: AttachObjectIds,
             Pos: { X: event.x, Y: event.y },
             Scale: { X: 1, Y: 1, Z: 1 },          // 缩放
             Rolate: { X: 0, Y: 0, Z: 0 },
@@ -644,6 +649,16 @@ export class EditScence extends SGraphScene {
         }
     }
 
+   /**
+    * 更新工程信息化的相关数据
+    * @param AttachObjectIds Array
+    */
+    upadatAttachObjectIds(AttachObjectIds: []): void {
+        if (this.focusItem) {
+            this.focusItem.data.AttachObjectIds = AttachObjectIds;
+        }
+    }
+
     /**
      * 删除指定item
      */
@@ -836,7 +851,7 @@ export class EditScence extends SGraphScene {
 
     /**
      * 设置结束锚点
-     * 
+     *
     */
     setTipeEndanchor(event: SMouseEvent): void {
         if (this.grabItem instanceof TipelineItem) {