Browse Source

更改名称

YaolongHan 4 năm trước cách đây
mục cha
commit
72a1793d37

+ 2 - 1
src/components/baseEditer.vue

@@ -567,7 +567,8 @@ export default {
                         : [],
                       InfoLocal: val.age.InfoLocal.length
                         ? val.age.InfoLocal
-                        : []
+                        : [],
+                      lengendName: this._legend.Name, //图例名称
                     },
                     Num: 1
                   };

+ 59 - 30
src/components/edit/attr_select.vue

@@ -320,22 +320,16 @@
             <!-- 修改图例 -->
             <div class="row-tit">图例名称</div>
             <div>
-              <a-dropdown :trigger="['click']">
-                <a class="ant-dropdown-link" @click="e => e.preventDefault()" >
-                 afdaf<a-icon type="down" />
-                </a>
-                <a-menu slot="overlay">
-                  <a-menu-item>
-                    <a href="javascript:;">1st menu item</a>
-                  </a-menu-item>
-                  <a-menu-item>
-                    <a href="javascript:;">2nd menu item</a>
-                  </a-menu-item>
-                  <a-menu-item>
-                    <a href="javascript:;">3rd menu item</a>
-                  </a-menu-item>
-                </a-menu>
-              </a-dropdown>
+              <a-spin :spinning="isGetLengend">
+                <a-dropdown :trigger="['click']">
+                  <a class="ant-dropdown-link" @click="changeLengend">{{lengendName}}</a>
+                  <a-menu slot="overlay">
+                    <a-menu-item v-for="(item,key) in lengendArr" :key="key">
+                      <a href="javascript:;">{{item.Name}}</a>
+                    </a-menu-item>
+                  </a-menu>
+                </a-dropdown>
+              </a-spin>
             </div>
           </div>
           <div class="row">
@@ -447,6 +441,7 @@
 import editDialog from "./edit-dialog";
 import Swatches from "vue-swatches";
 import bus from "@/bus";
+import bus2 from "@/bus2";
 import "vue-swatches/dist/vue-swatches.css";
 import { SLineStyle } from "@saga-web/graph/lib";
 import { SItemStatus } from "@saga-web/big";
@@ -459,6 +454,7 @@ import { getUrlMsg } from "@/components/urlMsg.js";
 // mapclass里边的没有透明度
 import { hexify } from "@/utils/rgbaUtil";
 import { SCustomLegendItem } from "@/lib/items/SCustomLegendItem";
+import { graphElementGroup } from "@/api/editer.js";
 export default {
   name: "attr_select",
   props: ["type", "focusItemList"],
@@ -564,12 +560,12 @@ export default {
       CUSTOMbgColor: "rgba(0,0,0,0.15)", // 自定义多边形背景色
       CUSTOMbdColor: "rgba(0,0,0,1)", // 自定义多边形线条色
       keys: new Date().getTime(),
-      dataSelect: [
-        { id: "totalEnergy", name: "总量" },
-        { id: "singleParty", name: "单平米" }
-      ],
-      selVal: "totalEnergy",
-      selText: "总量"
+      getCategroyIdS: [], //选择原件的数据
+      categoryId: "", //类型ide
+      lengendName: "", //lengend图例Id
+      isGetLengend: false,
+      isOpenGend: false,
+      lengendArr: [] //图例数组
     };
   },
   methods: {
@@ -695,14 +691,42 @@ export default {
     changeAttachObjectIds(arr) {
       bus.$emit("changeAttachObjectIds", arr);
     },
-    xxx(val){
-      alert(val)
+    // 下拉框获取图例数据
+    changeLengend(val) {
+      this.isGetLengend = true;
+      this.lengendArr = [];
+      const obj = {
+        InfoSystems: this.getCategroyIdS,
+        Type: "Zone",
+        categoryId: this.categoryId
+      };
+      return graphElementGroup(obj)
+        .then(res => {
+          const arr = [];
+          res.Data.forEach(res => {
+            if (res.GraphElements && res.GraphElements.length) {
+              res.GraphElements.forEach(item => {
+                if (
+                  !(item.SubType && item.SubType == "FHFQ") &&
+                  !(item.SubType && item.SubType == "SCPZ")
+                ) {
+                  arr.push(item);
+                }
+              });
+            }
+          });
+          this.isGetLengend = false;
+          this.lengendArr = arr;
+          console.log("arrarrarr",  this.lengendArr);
+        })
+        .catch(() => {
+          this.isGetLengend = false;
+        });
     }
   },
   watch: {
     focusItemList: function(newval) {
       console.log("------------");
-      console.log(FENGMAP);
       console.log("newval", newval);
       const Item = newval.itemList[0];
       this.GraphElementId = Item.data.GraphElementId;
@@ -787,6 +811,9 @@ export default {
             this.borderColor = Item.strokeColor ? Item.strokeColor.value : "";
             this.fillColor = Item.fillColor ? Item.fillColor.value : "";
             this.itemExplain = "";
+            this.lengendName = Item.data.Properties.lengendName
+              ? Item.data.Properties.lengendName
+              : Item.name; //图例名称
             if (Item.data.Properties.ItemExplain) {
               this.itemExplain = Item.data.Properties.ItemExplain
                 ? Item.data.Properties.ItemExplain
@@ -877,12 +904,14 @@ export default {
         });
       // }
       console.log(this.attrCards);
-    },
-
-    selVal(n, o) {
-      if (n === o) return;
-      this.selText = this.dataSelect.find(d => d.id === n).name;
     }
+  },
+  mounted() {
+    // 获取原件id
+    bus2.$on("getCategroyIdS", data => {
+      this.getCategroyIdS = data;
+    });
+    this.categoryId = getUrlMsg().categoryId;
   }
 };
 </script>

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

@@ -368,7 +368,6 @@ export default {
           res.Data.map(item => {
             this.itemList.push(item);
           });
-          itemList;
         });
       }
       if (this.visible) {
@@ -382,6 +381,8 @@ export default {
     getSelectId(data) {
       this.categoryIdS = data;
       this.drawerVisible = false;
+      // 同步选择原件数据
+      bus2.$emit('getCategroyIdS',data)
     },
     onClose() {
       this.visible = false;
@@ -504,21 +505,6 @@ export default {
       // bus.$emit("changeDrawType", v.target.value);
       bus.$emit("changeDrawType", v);
     },
-    // 获取左侧图例数据(无交互)
-    xxx(types = "Zone") {
-      const arr = {
-        InfoSystems: this.categoryIdS,
-        Type: types,
-        categoryId: this.categoryId
-      };
-       await graphElementGroup(arr).then(res => {
-          this.spinning = false;
-          res.Data.map(item => {
-            this.itemList.push(item);
-          });
-          // itemList
-        });
-    }
   },
   watch: {
     cmdType(cmd) {
@@ -534,7 +520,6 @@ export default {
     },
     drawerVisible(val) {
       if (this.visible) {
-        console.log("this.showDrawerItem", this.showDrawerItem);
         this.showDrawer(this.showDrawerItem);
       }
     },

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

@@ -295,7 +295,8 @@ export class EditScence extends SGraphScene {
                 TextPos: { X: 0, Y: 0 },
                 InfoTypeId: this._legend.InfoTypeId.length ? this._legend.InfoTypeId : [],
                 InfoSystemId: this._legend.InfoSystemId ? this._legend.InfoSystemId : '',
-                InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : []
+                InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : [],
+                lengendName: this._legend.Name, //图例名称
             },
         }
         let Polylines = null;
@@ -352,7 +353,8 @@ export class EditScence extends SGraphScene {
                     TextPos: { X: item.data.Location.Points[0].X, Y: -item.data.Location.Points[0].Y },
                     InfoTypeId: this._legend.InfoTypeId.length ? this._legend.InfoTypeId : [],
                     InfoSystemId: this._legend.InfoSystemId ? this._legend.InfoSystemId : '',
-                    InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : []
+                    InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : [],
+                    lengendName: this._legend.Name, //图例名称
                 },
             }
             let Polylines = null;
@@ -1299,7 +1301,7 @@ export class EditScence extends SGraphScene {
         try {
             console.log(crossPageString);
             const pageObj = JSON.parse(crossPageString)
-            
+
             const parserData = new STopologyParser(null);
             // 需要深拷贝
             parserData.parseData(JSON.parse(JSON.stringify(pageObj)))
@@ -1878,7 +1880,7 @@ export class EditScence extends SGraphScene {
 
     /**
      * 图标旋转更新角度
-     * 
+     *
      * @param   ang 旋转角度
     */
     updateItemAng(ang: number) :void{
@@ -1893,7 +1895,7 @@ export class EditScence extends SGraphScene {
         }
     }
 
-    /** 
+    /**
      * 框选
     */
     addRectSelect(event: SMouseEvent) {
@@ -1913,7 +1915,7 @@ export class EditScence extends SGraphScene {
             this.arrToSelect(this.Nodes, rect)
             this.arrToSelect(this.Markers, rect)
             this.arrToSelect(this.Relations, rect)
-        }    
+        }
     }
     /**
      * 选中item:框选

+ 0 - 1
src/components/urlMsg.js

@@ -11,7 +11,6 @@ if (!params) {
 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("=");