Browse Source

'添加绑定工程信息化数据后将名称当作item名称'

zhangyu 4 years ago
parent
commit
64b589b16b

+ 4 - 0
src/components/edit/attr_select.vue

@@ -476,6 +476,10 @@ export default {
     },
     // 修改设备数量
     changeImageNum() {
+      if (this.imageNum < this.attrCards.length) {
+        this.imageNum = this.attrCards.length;
+        return false;
+      }
       if (!this.imageNum) {
         this.imageNum = 1;
       }

+ 8 - 3
src/components/edit/left_toolbar.vue

@@ -73,9 +73,11 @@
     </a-popover>
 
     <!-- 打开弹窗 -->
-    <div class="drawer-close" v-show="visible" @click="onClose" :style="{opacity: visible? 1: 0, }">
-      <a-icon type="left" style="color: #8D9399;font-size: 10px" />
-    </div>
+    <!-- <transition name=""> -->
+      <div class="drawer-close" v-show="visible" @click="onClose" :style="{opacity: visible? 1: 0}">
+        <a-icon type="left" style="color: #8D9399;font-size: 10px" />
+      </div>
+    <!-- </transition> -->
     <transition name="fade">
       <div class="drawer-model" id="drawer-model" v-show="visible">
         <a-drawer
@@ -620,6 +622,9 @@ export default {
       align-items: center;
       cursor: pointer;
       transition: opacity 0s linear 0.3s;
+      -moz-transition: opacity 0s linear 0.3s;; /* Firefox 4 */
+      -webkit-transition: opacity 0s linear 0.3s;; /* Safari 和 Chrome */
+      -o-transition: opacity 0s linear 0.3s;; /* Opera */
     }
   .drawer-model {
     position: absolute;

+ 13 - 1
src/components/mapClass/EditScence.ts

@@ -437,7 +437,7 @@ export class EditScence extends SGraphScene {
         //获取信息工程化相关参数
         const LegendData: Legend = {
             ID: uuid(),
-            Name: this._legend.Name,
+            Name: "",
             GraphElementType: this._legend.Type,
             Num: 1,
             GraphElementId: this._legend.Id,
@@ -720,6 +720,18 @@ export class EditScence extends SGraphScene {
             const item = this.focusItem;
             this.selectContainer.clear();
             this.selectContainer.toggleItem(item);
+            if (
+                item instanceof SImageLegendItem ||
+                item instanceof SZoneLegendItem ||
+                item instanceof SSCPZZoneLegendItem ||
+                item instanceof SFHFQZoneLegendItem
+            ) {
+                let arr = item.data.AttachObjectIds;
+                if (arr && arr.length && arr[arr.length-1].name) {
+                    item.text = arr[arr.length-1].name;
+                    item.name = arr[arr.length-1].name;
+                }
+            }
 
             // 图标绑定工程信息化数据后设置状态
             if (item instanceof SImageLegendItem) {

+ 11 - 1
src/lib/items/SImageLegendItem.ts

@@ -26,7 +26,17 @@ export class SImageLegendItem extends SIconTextItem {
             this.data.Num = 1;
         }
         this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
+        this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`;
+        this.update();
+    }
+
+    get text(): string {
+        return this.textItem.text;
+    }
+    set text(v: string) {
+        this.name = v;
+        this.data.Name = v;
+        this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`;
         this.update();
     }
 

+ 1 - 1
src/lib/types/Legend.ts

@@ -36,7 +36,7 @@ export interface Legend {
     /** 名称  */
     Name: string;
     /** 返回工程信息化对象 ID 列表 */
-    AttachObjectIds?: string[];
+    AttachObjectIds?: any[];
     /** 图标,区域类型  */
     GraphElementType: string;
     /** 对应的图例ID  */

+ 2 - 2
vue.config.js

@@ -25,8 +25,8 @@ module.exports = {
                 },
             },
             '/data': {
-                // target: 'http://192.168.200.87:9003',
-                target: 'http://60.205.177.43:9903', //阿里云
+                target: 'http://192.168.200.87:9003',
+                // target: 'http://60.205.177.43:9903', //阿里云
                 changeOrigin: true,
                 secure: false,
                 pathRewrite: {