瀏覽代碼

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

zhangyu 4 年之前
父節點
當前提交
54c45bdc22

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 .DS_Store
 node_modules
 /dist
+/wandaEditer
 package-lock.json
 
 # local env files

+ 10 - 1
src/api/editer.js

@@ -1,6 +1,7 @@
 // 登录校验接口
 import httputils from '@/api/httputils'
 const testApi = '/serve/topology-wanda';
+const dataApi = '/data';
 // const testApi = '/serve'
 //获取图例分类结构
 export function queryByGroup(params) {
@@ -25,4 +26,12 @@ export function uploadImg({
     postParams
 }) {
     return httputils.postJson(`${testApi}/Picture/create`, postParams)
-}
+}
+//查询图元素类型信息
+export function getGraphElementType(params){
+    return httputils.postJson(`${testApi}/graphElement/type/query`, params)
+}
+//查询工程信息化tree数据
+export function querySystem(params){
+    return httputils.postJson(`${dataApi}/data/t_system_wzfl/query`, params)
+}

+ 33 - 32
src/components/baseEditer.vue

@@ -15,6 +15,7 @@ import bus from "@/bus";
 import { saveGroup, readGroup } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until"
+import store from '../store'
 
 let fengmap = null;
 
@@ -51,6 +52,7 @@ export default {
     this.init();
     // 挂在bus
     this.getBus();
+    store.dispatch('getElementType',{PageSize:1000})
   },
   methods: {
     init() {
@@ -60,17 +62,17 @@ export default {
       this.scene = new EditScence();
       fengmap = new SFengParser(
         "fengMap",
-        this.mapServerURL + '/'+this.fmapID,
+        this.mapServerURL + "/" + this.fmapID,
         this.key,
         this.appName,
         null
       );
-      const floorid = 'f1';
+      const floorid = "f1";
       fengmap.loadMap(this.fmapID, resp => {
-        console.log('load-map-succ', resp)
-        this.floorList = resp
-        this.parserData(floorid)
-      })
+        console.log("load-map-succ", resp);
+        this.floorList = resp;
+        this.parserData(floorid);
+      });
       this.readGroup().then(data => {
         const parserData = new STopologyParser(null);
         parserData.parseData(data.data.Data[0].Elements);
@@ -101,28 +103,28 @@ export default {
       if (this.floorList[floor]) {
         fengmap.parseData(this.floorList[floor], res => {
           if (res.err) {
-            console.log(res.err)
-            return
+            console.log(res.err);
+            return;
           }
-          this.fParser = new SFloorParser(null)
-          this.fParser.parseData(res)
+          this.fParser = new SFloorParser(null);
+          this.fParser.parseData(res);
           this.fParser.spaceList.forEach(t => {
-            t.selectable = true
-            this.scene.addItem(t)
-          })
-          this.fParser.wallList.forEach(t => this.scene.addItem(t))
-          this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
-          this.fParser.doorList.forEach(t => this.scene.addItem(t))
-          this.fParser.columnList.forEach(t => this.scene.addItem(t))
-          this.fParser.casementList.forEach(t => this.scene.addItem(t))
-          this.view.scene = this.scene
-          this.view.fitSceneToView()
-          this.loading = false
-          this.isQuerying = false
-          console.log('success')
-        })
+            t.selectable = true;
+            this.scene.addItem(t);
+          });
+          this.fParser.wallList.forEach(t => this.scene.addItem(t));
+          this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
+          this.fParser.doorList.forEach(t => this.scene.addItem(t));
+          this.fParser.columnList.forEach(t => this.scene.addItem(t));
+          this.fParser.casementList.forEach(t => this.scene.addItem(t));
+          this.view.scene = this.scene;
+          this.view.fitSceneToView();
+          this.loading = false;
+          this.isQuerying = false;
+          console.log("success");
+        });
       } else {
-        console.log('楼层不正确')
+        console.log("楼层不正确");
       }
     },
     // 监听变化
@@ -200,10 +202,9 @@ export default {
         const Elements = this.scene.saveMsgItem();
         const data = {
           Elements,
-          ID: "66332f264a5c4c0c95fb68dea93d43fd", // 如果id为空则为地图
           Name: "1", // 名称
-          CategoryID: "", // 图分类ID
-          ProjectID: "2", // 项目ID
+          categoryId: "NTXT",
+          ProjectID: "3", // 项目ID
           BuildingID: "1", // 建筑ID
           FloorID: "1", // 楼层id
           Note: "1" // 图说明
@@ -218,8 +219,8 @@ export default {
             if (t.data.Type == val.key) {
               return {
                 ID: uuid(),
-                Name: t.name,
-                GraphElementType: "Zone",
+                Name: val.name,
+                GraphElementType: val.properties.Type,
                 GraphElementId: "273d633cc5c54a4882794b34843d1a00",
                 AttachObjectIds: [],
                 Pos: { x: t.x, y: t.y },
@@ -256,8 +257,8 @@ export default {
     // 读取数据
     readGroup() {
       const data = {
-        graphId: "66332f264a5c4c0c95fb68dea93d43fd",
-        projectId: 2
+        categoryId: "NTXT",
+        projectId: 3
       };
       return readGroup(data);
     }

+ 8 - 7
src/components/edit/attr_select.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="attr-select">
     <!--选中-->
-    <div class="attr-select" v-if="type==='line'">
+    <div class="attr-select" v-if="type==='baseLine'">
       <span class="grid-title">外观</span>
       <div class="row">
         <div class="row-tit">线宽</div>
@@ -36,7 +36,7 @@
       </div>
     </div>
     <!--文字内容-->
-    <div class="attr-select" v-if="type==='text'">
+    <div class="attr-select" v-if="type==='baseText'">
       <span class="grid-title">文字内容</span>
       <div class="grid-content">
         <a-textarea
@@ -65,7 +65,7 @@
       </div>
     </div>
     <!--图片-->
-    <div class="attr-select" v-if="type=='images'">
+    <div class="attr-select" v-if="type=='baseImage'">
       <span class="grid-title">文字内容</span>
       <section class="grid">
         <div class="grid-content">
@@ -104,7 +104,7 @@
     <!--针对“设备/位置/管线/分区”属性示例-->
     <div
       class="attr-select"
-      v-if="type =='equipment' || type =='pipeline' ||type == 'fire-area' ||type == 'position'"
+      v-if="type =='Zone' || type =='Image' ||type == 'fire-Zone' ||type == 'Line'"
     >
       <div class="row-tit" v-if="type == 'fire-area'">颜色</div>
       <div class="row" v-if="type == 'fire-area'">
@@ -159,7 +159,7 @@
     <!--设备/工程信息化ID/工程信息化中的位置类型-->
     <div
       class="attr-select attr-select-bottom"
-      v-if="type =='equipment' || type =='pipeline' || type =='fire-area' ||type == 'position'"
+      v-if="type =='Zone' || type =='Image' ||type == 'fire-Zone' ||type == 'Line'"
     >
       <div class="row">
         <span>{{`工程信息化ID`}}</span>
@@ -321,14 +321,15 @@ export default {
   },
   watch: {
     focusItemList: function(newval) {
+      console.log("newval", newval);
       const Item = newval.itemList[0];
       if (newval.itemList.length == 1) {
-        if (newval.itemType == "text") {
+        if (newval.itemType == "baseText") {
           this.textMsg = Item.text;
           this.fontSize = Item.font.size;
           this.fontColor = Item.color;
           this.backColor = Item.backgroundColor;
-        } else if (newval.itemType == "line") {
+        } else if (newval.itemType == "baseLine") {
           this.lineWidth = Item.lineWidth;
           this.borderColor = Item.strokeColor;
         } else if (newval.itemType == "position") {

+ 4 - 1
src/components/edit/edit-dialog.vue

@@ -35,7 +35,7 @@
           </div>
         </div>
         <div class="tree">
-          <searchTree/>
+          <searchTree  @getTreeId="getTreeId"/>
         </div>
         <div class="checkbox">
           <a-checkbox-group @change="ChangeCheckbox">
@@ -122,6 +122,9 @@
             },
             pressEnter(e) {
                 console.log(e)
+            },
+          getTreeId(id){
+              console.log(id);
             }
         }
 

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

@@ -250,7 +250,8 @@ export default {
   },
   computed: {
     ...mapState({
-      GraphCategoryIds: "GraphCategoryIds"
+      GraphCategoryIds: "GraphCategoryIds",
+      TypeIdToGraphElement: "TypeIdToGraphElement"
     })
   },
   methods: {
@@ -322,7 +323,11 @@ export default {
     },
     getBus() {
       bus.$on("exportItem", data => {
-        this.data = data;
+        this.data = data.map(t => {
+          t.name = this.TypeIdToGraphElement[t.key].Name,
+          t.properties = this.TypeIdToGraphElement[t.key];
+          return t;
+        });
       });
     },
     pickUp(text, record, index) {

+ 59 - 92
src/components/edit/search_tree.vue

@@ -1,114 +1,81 @@
 <template>
   <div>
     <a-input-search style="margin: 10px;width: 90%" placeholder="搜索" @change="onChange" />
-    <a-tree
-        :expanded-keys="expandedKeys"
-        :auto-expand-parent="autoExpandParent"
-        :tree-data="gData"
-        @expand="onExpand"
-    >
-      <template slot="title" slot-scope="{ title }">
-        <span v-if="title.indexOf(searchValue) > -1">
-          {{ title.substr(0, title.indexOf(searchValue)) }}
-          <span style="color: #f50">{{ searchValue }}</span>
-          {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
-        </span>
-        <span v-else>{{ title }}</span>
-      </template>
-    </a-tree>
+    <el-tree
+            class="filter-tree"
+            :data="treeData"
+            :props="defaultProps"  :default-expand-all="false"
+            :filter-node-method="filterNode" highlight-current  @node-click="checkChange"
+            ref="tree">
+    </el-tree>
   </div>
 </template>
 
 <script>
-    const x = 3;
-    const y = 2;
-    const z = 1;
-    const gData = [];
+    import {querySystem} from "@/api/editer";
 
-    const generateData = (_level, _preKey, _tns) => {
-        const preKey = _preKey || '0';
-        const tns = _tns || gData;
-
-        const children = [];
-        for (let i = 0; i < x; i++) {
-            const key = `${preKey}-${i}`;
-            tns.push({ title: key, key, scopedSlots: { title: 'title' } });
-            if (i < y) {
-                children.push(key);
-            }
-        }
-        if (_level < 0) {
-            return tns;
-        }
-        const level = _level - 1;
-        children.forEach((key, index) => {
-            tns[index].children = [];
-            return generateData(level, key, tns[index].children);
-        });
-    };
-    generateData(z);
-
-    const dataList = [];
-    const generateList = data => {
-        for (let i = 0; i < data.length; i++) {
-            const node = data[i];
-            const key = node.key;
-            dataList.push({ key, title: key });
-            if (node.children) {
-                generateList(node.children);
-            }
-        }
-    };
-    generateList(gData);
-
-    const getParentKey = (key, tree) => {
-        let parentKey;
-        for (let i = 0; i < tree.length; i++) {
-            const node = tree[i];
-            if (node.children) {
-                if (node.children.some(item => item.key === key)) {
-                    parentKey = node.key;
-                } else if (getParentKey(key, node.children)) {
-                    parentKey = getParentKey(key, node.children);
-                }
-            }
-        }
-        return parentKey;
-    };
     export default {
         data() {
             return {
-                expandedKeys: [],
-                searchValue: '',
-                autoExpandParent: true,
-                gData,
+              treeData: [],
+              filterText: '',
+              defaultProps: {
+                children: 'children',
+                label: 'label'
+              }
             };
         },
         methods: {
-            onExpand(expandedKeys) {
-                this.expandedKeys = expandedKeys;
-                this.autoExpandParent = false;
+          onChange(e){
+            this.$refs.tree.filter(e.target.value);
+            if(e.target.value==''){
+              for(let i=0;i<this.$refs.tree.$children.length;i++){
+                this.$refs.tree.$children[i].expanded = false;
+              }
+            }
+          },
+            filterNode(value, data) {
+              if (!value) return true;
+              return data.label.indexOf(value) !== -1;
             },
-            onChange(e) {
-                const value = e.target.value;
-                const expandedKeys = dataList
-                    .map(item => {
-                        if (item.title.indexOf(value) > -1) {
-                            return getParentKey(item.key, gData);
-                        }
-                        return null;
+            querySystem(){
+              querySystem().then(res =>{
+                if(res.result == 'success') {
+                  let data = res.data;
+                  (function recursion(newObj) {
+                    newObj.map(item=>{
+                      item.label = item.name;
+                      if(item.children){
+                        recursion(item.children);
+                      }
                     })
-                    .filter((item, i, self) => item && self.indexOf(item) === i);
-                Object.assign(this, {
-                    expandedKeys,
-                    searchValue: value,
-                    autoExpandParent: true,
-                });
+                  })(data)
+
+                  this.treeData = data;
+                }else{
+                  this.$message.error('获取失败');
+                }
+              })
+            },
+            checkChange(data) {
+              this.$emit('getTreeId',data.id)
             },
         },
+      mounted() {
+          this.querySystem();
+      }
     };
 </script>
 
-<style scoped>
-
+<style scoped lang="less">
+.filter-tree{
+  padding: 0 10px;
+  /deep/ .el-tree-node__content{
+    height:38px;
+  }
+  /deep/.el-tree-node:focus >.el-tree-node__content {
+    background-color: #E1F2FF!important;
+    color: #0091FF!important;
+  }
+}
 </style>

+ 55 - 49
src/components/edit/top_toolbar.vue

@@ -30,14 +30,23 @@
           <a-dropdown :trigger="['click']">
             <div class="ant-dropdown-link dropdown-flex" @click="e => e.preventDefault()">
               <div>
-                <img class="lock" :src="require(`./../../assets/images/t-format.png`)" alt/>
+                <img class="lock" :src="require(`./../../assets/images/t-format.png`)" alt />
                 <div>对齐</div>
               </div>
-              <a-icon type="caret-down" class="down-icon"/>
+              <a-icon type="caret-down" class="down-icon" />
             </div>
             <a-menu slot="overlay">
-              <a-menu-item  v-for="item in alignmentOptions" :key="item.value" @click="changeAlignItem(item.value)">
-                <img style="width: 16px;margin-right: 5px;" :src="require(`./../../assets/images/`+item.img+`.png`)" alt/> <span>{{item.label}}</span>
+              <a-menu-item
+                v-for="item in alignmentOptions"
+                :key="item.value"
+                @click="changeAlignItem(item.value)"
+              >
+                <img
+                  style="width: 16px;margin-right: 5px;"
+                  :src="require(`./../../assets/images/`+item.img+`.png`)"
+                  alt
+                />
+                <span>{{item.label}}</span>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
@@ -74,52 +83,53 @@
 </template>
 <script>
 import bus from "@/bus";
-import {SGraphLayoutType} from "@saga-web/graph/lib";
+import { SGraphLayoutType } from "@saga-web/graph/lib";
 export default {
   data() {
     return {
       isLock: false, //是否锁定
       focusItem: null,
-      alignmentOptions:[  //对齐数据
+      alignmentOptions: [
+        //对齐数据
         {
-          value:SGraphLayoutType.Left,
-          label:'左对齐',
+          value: SGraphLayoutType.Left,
+          label: "左对齐",
           img: "t-left"
         },
         {
-          value:SGraphLayoutType.Right,
-          label:'右对齐',
+          value: SGraphLayoutType.Right,
+          label: "右对齐",
           img: "t-right"
         },
         {
-          value:SGraphLayoutType.Top,
-          label:'顶对齐',
+          value: SGraphLayoutType.Top,
+          label: "顶对齐",
           img: "t-top"
         },
         {
-          value:SGraphLayoutType.Bottom,
-          label:'底对齐',
+          value: SGraphLayoutType.Bottom,
+          label: "底对齐",
           img: "t-bottom"
         },
         {
-          value:SGraphLayoutType.Center,
-          label:'水平居中对齐',
-          img:'t-center'
+          value: SGraphLayoutType.Center,
+          label: "水平居中对齐",
+          img: "t-center"
         },
         {
-          value:SGraphLayoutType.Middle,
-          label:'垂直居中对齐',
-          img:'t-topandbottm'
+          value: SGraphLayoutType.Middle,
+          label: "垂直居中对齐",
+          img: "t-topandbottm"
         },
         {
-          value:SGraphLayoutType.Vertical,
-          label:'垂直分布',
-          img:'t-vertical'
+          value: SGraphLayoutType.Vertical,
+          label: "垂直分布",
+          img: "t-vertical"
         },
         {
-          value:SGraphLayoutType.Horizontal,
-          label:'水平分布',
-          img:'t-level'
+          value: SGraphLayoutType.Horizontal,
+          label: "水平分布",
+          img: "t-level"
         }
       ]
     };
@@ -128,14 +138,8 @@ export default {
     FocusItemChanged(itemMsg) {
       this.focusItem = null;
       if (itemMsg.itemList.length == 1) {
-        if (
-          itemMsg.itemType == "images" ||
-          itemMsg.itemType == "text" ||
-          itemMsg.itemType == "position"
-        ) {
-          this.isLock = itemMsg.itemList[0].moveable;
-          this.focusItem = itemMsg.itemList[0];
-        }
+        this.isLock = itemMsg.itemList[0].moveable;
+        this.focusItem = itemMsg.itemList[0];
       }
     },
     lockItem() {
@@ -148,10 +152,11 @@ export default {
     },
     saveMsg() {
       // this.$message.success("保存成功!", 1);
-       bus.$emit("saveMsgItem");
+      bus.$emit("saveMsgItem");
     },
     // 删除item
     deleteItem() {
+      console.log(this.focusItem);
       if (this.focusItem) {
         bus.$emit("deleiteItem");
         this.focusItem = null;
@@ -162,11 +167,12 @@ export default {
     },
     // 对齐item
     changeAlignItem(val) {
-      bus.$emit("changeAlignItem",val);
+      bus.$emit("changeAlignItem", val);
     }
   },
   mounted() {
     bus.$on("FocusItemChanged", itemMsg => {
+      console.log("itemMsg", itemMsg);
       this.FocusItemChanged(itemMsg);
     });
   }
@@ -212,25 +218,25 @@ li {
           width: 16px;
           height: 16px;
         }
-        .percentage{
-          border-bottom: 1px solid #C3C7CB;
+        .percentage {
+          border-bottom: 1px solid #c3c7cb;
           margin: 0 13px;
           font-size: 14px;
         }
-        .dropdown-flex{
+        .dropdown-flex {
           display: flex;
           align-items: center;
-          .down-icon{
+          .down-icon {
             margin-left: 12px;
           }
         }
       }
-      li:hover{
-        background: #F5F6F7;
+      li:hover {
+        background: #f5f6f7;
       }
-      .zoom-window{
-        border-left:1px solid #8D9399;
-        border-right:1px solid #8D9399;
+      .zoom-window {
+        border-left: 1px solid #8d9399;
+        border-right: 1px solid #8d9399;
       }
     }
   }
@@ -250,8 +256,8 @@ li {
     }
   }
 }
-  /deep/ .ant-dropdown-menu-item{
-    display: flex;
-    align-items: center;
-  }
+/deep/ .ant-dropdown-menu-item {
+  display: flex;
+  align-items: center;
+}
 </style>

+ 24 - 20
src/components/mapClass/EditScence.ts

@@ -65,26 +65,28 @@ export class EditScence extends SGraphScene {
     };
     set setlegend(obj: any) {
         this._legend = obj;
+        console.log('aaaaaa', obj)
     }
     /**
      * 监听变化
      * @param obj 变化后的对象
      */
     listChange(obj: any) {
-        console.log('obj', obj)
-        let itemType: string = 'equipment'
+        let itemType: string = 'equipment';
+
         if (obj.itemList[0] instanceof STextMarkerItem) {
-            itemType = 'text'
+            itemType = 'baseText'
+            console.log('obj.itemList[0]', itemType, obj.itemList[0])
         } else if (obj.itemList[0] instanceof SImageMarkerItem) {
-            itemType = 'images'
+            itemType = 'baseImage'
         } else if (obj.itemList[0] instanceof SLineMarkerItem) {
-            itemType = 'line'
-        } else if (obj.itemList[0] instanceof SPolylineItem) {
-            itemType = 'pipeline'
+            itemType = 'baseLine'
         } else if (obj.itemList[0] instanceof SZoneLegendItem) {
-            itemType = 'position'
-        } else if (obj.itemList[0] instanceof SImgTextItem) {
-            itemType = 'equipment'
+            itemType = 'Zone'
+        } else if (obj.itemList[0] instanceof SImageLegendItem) {
+            itemType = 'Image'
+        } else if (obj.itemList[0] instanceof TipelineItem) {
+            itemType = 'Line'
         } else {
             itemType = ''
         };
@@ -120,7 +122,6 @@ export class EditScence extends SGraphScene {
                 Line: [{ x: event.x, y: event.y }]
             }
         }
-
         const item = new SLineMarkerItem(null, data);
         item.status = SItemStatus.Create;
         item.zOrder = ItemOrder.lineOrder;
@@ -255,6 +256,7 @@ export class EditScence extends SGraphScene {
      * 增加图标
      */
     addIconItem(event: SMouseEvent): void {
+        console.log('this._legend.url', this._legend)
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
@@ -267,7 +269,7 @@ export class EditScence extends SGraphScene {
             Rolate: { X: 0, Y: 0, Z: 0 },
             Size: { Width: 0, Height: 0 },         // 大小
             Properties: {
-                url: '/serve/topology-wanda/Picture/query/' + this._legend.url;
+                Url: '/serve/topology-wanda/Picture/query/' + this._legend.url
             },
         }
         const item = new SImageLegendItem(null, LegendData);
@@ -437,26 +439,29 @@ export class EditScence extends SGraphScene {
     deleiteItem(): void {
         if (this.focusItem) {
             this.removeItem(this.focusItem);
-            let i = -1
+            let a = -1
             this.Nodes.forEach((item: any, index: number) => {
                 if (item.id == this.focusItem.id) {
-                    i = index
+                    a = index
                 }
             });
-            this.Nodes.splice(i, 1);
+            this.Nodes.splice(a, 1);
+            let b = -1;
             this.Markers.forEach((item: any, index: number) => {
                 if (item.id == this.focusItem.id) {
-                    i = index
+                    b = index
                 }
             });
-            this.Markers.splice(i, 1);
+            this.Markers.splice(b, 1);
+            let c = -1;
             this.Relations.forEach((item: any, index: number) => {
                 if (item.id == this.focusItem.id) {
-                    i = index
+                    c = index
                 }
             });
-            this.Relations.splice(i, 1);
+            this.Relations.splice(c, 1);
             this.focusItem = null;
+           console.log('this.Nodes',this.Nodes)
         }
         if (this.view) {
             this.view.update();
@@ -468,7 +473,6 @@ export class EditScence extends SGraphScene {
      * @param v
      */
     changeAlignItem(v: any): void {
-        console.log(v);
         this.selectContainer.layout(v);
     }
 

+ 12 - 6
src/router/index.ts

@@ -1,23 +1,29 @@
 import Vue from 'vue'
 import VueRouter, { RouteConfig } from 'vue-router'
-import editer from '../views/editer.vue'
-import drafts from '../views/drafts.vue'
+const Editer = () => import('../views/editer.vue')
+const Drafts = () => import('../views/drafts.vue')
 Vue.use(VueRouter)
 
-  const routes: Array<RouteConfig> = [
+const routes: Array<RouteConfig> = [
   {
     path: '/',
+    redirect: '/editer'
+  },
+  {
+    path: '/editer',
     name: 'editer',
-    component: editer
+    component: Editer
   },
   {
     path: '/drafts',
     name: 'drafts',
-    component: drafts
+    component: Drafts
   }
 ]
-
+// 使用histroy模式
 const router = new VueRouter({
+  mode: 'history',
+  base: process.env.BASE_URL,
   routes
 })
 

+ 16 - 1
src/store/index.ts

@@ -1,15 +1,30 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
+import { getGraphElementType } from "@/api/editer.js"
 
 Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-    GraphCategoryIds: ['NTXT'] //系统类型
+    GraphCategoryIds: ['NTXT'], //系统类型
+    TypeIdToGraphElement:{}, //typeid到图例元素的映射
   },
   mutations: {
+    TypeIdToGraphElement(state,data){
+      if (data.length) {
+        state.TypeIdToGraphElement = {}
+        data.forEach(t => {
+          state.TypeIdToGraphElement[t.Id] = t;
+        })
+      }
+    }
   },
   actions: {
+    getElementType({ commit }, params) {
+      getGraphElementType(params).then(res => {
+        commit('TypeIdToGraphElement',res.Content)
+      })
+    }
   },
   modules: {
   }

+ 1 - 0
src/views/editer.vue

@@ -60,6 +60,7 @@ export default {
     },
     setCmdType(cmdType) {
       this.cmdType = cmdType;
+      console.log(cmdType,'12313')
     },
     changeFocusItem(item) {
       this.focusItemList = item;

+ 13 - 0
vue.config.js

@@ -22,6 +22,14 @@ module.exports = {
                     "^/serve": "",
                 },
             },
+            "/data": {
+                target: "http://192.168.200.87:9003",
+                changeOrigin: true,
+                secure: false,
+                pathRewrite: {
+                    "^/data": "",
+                },
+            },
         }
     },
     chainWebpack: (config) => {
@@ -36,4 +44,9 @@ module.exports = {
     },
     lintOnSave: false,
     // publicPath: '/dist',
+    publicPath: '/wandaEditer',
+    // 打包名称
+    outputDir: 'wandaEditer',
+    // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
+    assetsDir: "static",
 }