Преглед изворни кода

Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop

haojianlong пре 4 година
родитељ
комит
a12789305b

+ 13 - 2
src/components/editClass/big-edit/BigEditFactory.ts

@@ -32,8 +32,8 @@ import {
     SBaseRectEdit,
     SBaseTextEdit
 } from "./../edit/";
-import {Marker, SBaseArrow, SBaseExpainEdit, SBaseArrowPolyEdit} from "./"
-import {SItemFactory} from "@persagy-web/big"
+import {Marker, SBaseArrow, SBaseExpainEdit, SBaseArrowPolyEdit, SBaseEquipment, Legend} from "./"
+import { SItemFactory } from "@persagy-web/big"
 
 /**
  * item 创建工厂
@@ -137,4 +137,15 @@ export class BigEditFactory extends SItemFactory {
     createBasePolygonArrowEdit(data: Marker): SBaseArrowPolyEdit {
         return new SBaseArrowPolyEdit(null, data);
     } // Function SBaseArrowPolyEdit()
+    
+    /*
+    * 创建基础设备
+    *
+    * @param data     数据
+    * @return  注释
+    */
+    createBaseEquipment(data: Legend): SBaseEquipment {
+        return new SBaseEquipment(null, data);
+    } // Function createBaseEquipment()
+
 } // Class BigEditFactory

+ 2 - 1
src/components/editClass/big-edit/SBaseEditScene.ts

@@ -178,7 +178,8 @@ export class SBaseEditScene extends SGraphEditScene {
         const data = {
             /** 名称 */
             name: '基础设备',
-            num: 1,
+            /** 返回物理世界对象 ID 列表 */
+            attachObjectIds: [],
             size: { width: 50, height: 50 },
             /** 图标 (Image),线类型 (Line) */
             type: "Image",

+ 85 - 22
src/components/editClass/big-edit/items/SBaseEquipment.ts

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-import { SGraphItem } from "@persagy-web/graph/lib";
+import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib";
 import { Marker } from "./../types/Marker";
 import { Legend } from "./../types/Legend";
 import { SBaseIconTextEdit } from './../../edit/';
@@ -36,7 +36,14 @@ import { SBaseIconTextEdit } from './../../edit/';
  */
 export class SBaseEquipment extends SBaseIconTextEdit {
     /** 设备图例 */
-    legendData: Legend;
+    _legendData: Legend | null = null;
+    set legendData(val) {
+        this._legendData = val;
+        this.initData()
+    }
+    get legendData(): Legend | null {
+        return this._legendData
+    }
     /**
      * 构造函数
      *
@@ -44,40 +51,96 @@ export class SBaseEquipment extends SBaseIconTextEdit {
      * @param data      数据
      */
     constructor(parent: SGraphItem | null, data: Legend) {
-        const markData = {
-            /** 名称 */
-            name: data.name,
-            /** 图标(Image),线类型(Line) */
-            type: data.type,
-            /** 位置 */
-            pos: data.pos,
-            /** 由应用自己定义 */
-            properties: data.properties,
-            style: data.style
-        }
-        super(parent, markData);
+        super(parent);
         this.legendData = data;
     } // Constructor
 
     /**
+     * 设置legendData 时 对 item 做设置
+     */
+    initData() {
+        if (!this.legendData) return;
+        if (this.legendData.size) {
+            this.sWidth = this.legendData.size.width;
+            this.sHeight = this.legendData.size.height;
+        }
+        // this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
+        if (this.legendData.anchorList && this.legendData.anchorList.length) {
+            this.anchorList = this.legendData.anchorList.map(t => {
+                let item = new SAnchorItem(this);
+                if (t.id) {
+                    item.id = t.id;
+                }
+                item.moveTo(t.pos.x, t.pos.y);
+                return item;
+            });
+        } else {
+            const anchorPoint = [
+                { x: this.img.x, y: this.img.y, id: "" },
+            ];
+            this.anchorList = anchorPoint.map(t => {
+                let item = new SAnchorItem(this);
+                if (t.id) {
+                    item.id = t.id;
+                }
+                item.moveTo(t.x, t.y);
+                return item;
+            });
+        }
+
+        this.showAnchor = false;
+        this.textItem.text = this.legendData.style.default.text || '';
+        this.textItem.font.size = this.legendData.style.default.font || 12;
+        this.img.url = this.legendData.style.default.url;
+        this.x = this.legendData.pos.x;
+        this.y = this.legendData.pos.y;
+        // 偏移二分之一文本高度
+        this.textItem.moveTo(
+            this.img.width * 0.5,
+            -(this.font.size * 1.25 * 0.5)
+        );
+        this.moveable = true;
+        this.selectable = true;
+    }// Function initData()
+
+    /**
      * 返回对象储存的相关数据
      *
      * @return	对象储存的相关数据
      */
     toData(): any {
-        super.toData();
-        if (this.data) {
-            const list = this.legendData.anchorList.map((item) => {
+        if (this.legendData) {
+            const list = this.anchorList.map((item) => {
                 return {
                     id: item.id,
-                    x: item.x,
-                    y: item.y
+                    pos: {
+                        x: this.x,
+                        y: this.y
+                    }
                 }
             })
-            this.legendData.anchorList = list
+            this.legendData.anchorList = list;
+            // 反馈大小
+            if (this.legendData.size) {
+                this.legendData.size.width = this.sWidth;
+                this.legendData.size.height = this.sHeight
+            } else {
+                this.legendData.size = {
+                    width: this.sWidth,
+                    height: this.sHeight
+                }
+            }
+            // 反馈文本
+            this.legendData.style.default.text = this.textItem.text ? this.textItem.text : '';
+            // 文本大小
+            this.legendData.style.default.font = this.font.size;
+            // 位置
+            this.legendData.pos = {
+                x: this.x,
+                y: this.y
+            };
+            return this.legendData
         }
-
-
     } // Function toData
 
 } // Class SBaseEquipment

+ 2 - 2
src/components/editClass/big-edit/types/Anchor.ts

@@ -33,7 +33,7 @@ import { Point } from "./../../edit/type/Point";
  */
 export interface Anchor {
     /** 锚点 ID */
-    ID: string;
+    id: string;
     /** 锚点的坐标 */
-    Pos: Point;
+    pos: Point;
 } // Interface Anchor

+ 4 - 8
src/components/editClass/big-edit/types/Legend.ts

@@ -36,17 +36,13 @@ import { SPoint } from '@persagy-web/draw/';
  */
 export interface Legend {
     /** ID */
-    id: string;
+    id?: string;
     /** 名称 */
     name: string;
-    /** 返回工程信息化对象 ID 列表 */
+    /** 返回物理世界对象 ID 列表 */
     attachObjectIds?: any[];
-    /** 图标,区域类型 */
-    graphElementType: string;
-    /** 对应的图例 ID */
-    graphElementId: string;
-    /** 图例数量 */
-    num?: number;
+    /** 对应的图元 ID */
+    graphElementId?: string;
     /** 位置 */
     pos: Point;
     /** item 类型 */

+ 6 - 2
src/components/editClass/edit/SGraphEdit.ts

@@ -50,8 +50,12 @@ export class SGraphEdit extends SGraphItem {
         this.update();
     } // Set status
 
-    /** 存储数据 */
-    data: any
+    /** 存储数据 Mark */
+    data: any;
+     /** 存储数据 legend */
+    legendData:any;
+     /** 存储数据 Relation */
+    relationData:any
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //函数
     /**

+ 1 - 1
src/components/editClass/edit/items/SBaseIconTextEdit.ts

@@ -261,7 +261,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
     } // Constructor
 
     /**
-     * 计算并移动锚点的位置
+     * 如果 data 设置;初始化data
      */
     initData() {
         if (!this.data) return;

+ 1 - 1
src/components/editClass/edit/type/Relation.ts

@@ -34,7 +34,7 @@ import { Point } from "./Point";
  */
 export interface Relation {
     /** ID */
-    iD: string;
+    id: string;
     /** 名称 */
     name: string;
     /** 对应的图例 ID */

+ 23 - 20
src/components/editClass/persagy-edit/PTopoParser.ts

@@ -44,7 +44,7 @@ export class PTopoParser extends SParser {
      * 解析拓扑图绘制数据
      *
      * @param   data    业务空间数据
-     * */
+     */
     parseData(data: ElementData): void {
         // 生成遍历基本图例
         if (data.markers && data.markers.length) {
@@ -55,8 +55,8 @@ export class PTopoParser extends SParser {
 
         // 生成遍历Node图例
         if (data.nodes && data.nodes.length) {
-            data.nodes.forEach(() => {
-
+            data.nodes.forEach((item: any) => {
+                this.addNode(item)
             })
         }
         // 生成遍历关系图例
@@ -67,6 +67,11 @@ export class PTopoParser extends SParser {
 
     } // Function parseData()
 
+    /**
+     * 添加生成 mark 实例
+     *
+     * @param data Marker 图例类型数据
+     */
     addMarker(data: Marker) {
         if (data.properties && data.properties.type) {
             switch (data.properties.type) {
@@ -98,22 +103,20 @@ export class PTopoParser extends SParser {
                     this.markers.push(this.factory.createBasePolygonArrowEdit(data));
             }
         }
-        // if (data.properties.type == "BaseArrow") {
-        //     this.markers.push(this.factory.createBaseArrow(data))
-        // }
-        // if (data.properties.type == "BaseRect") {
-        //     this.markers.push(this.factory.createBaseExpainEdit(data))
-        // }
-        // if (data.properties.type == "BaseTriangle") {
-        //     this.markers.push(this.factory.createBaseExpainEdit(data))
-        // }
-        // // 基础文字
-        // if (data.properties.type == "BaseText") {
-        //     this.Markers.push(this.factory.createBaseTextEdit(data))
-        // }
-        // // 基础图片
-        // if (data.properties.type == "BaseImage") {
-        //     this.Markers.push(this.factory.createBaseImageEdit(data))
-        // }
+    } // Function addMarker()
+
+    /**
+     * 添加生成 Node 实例
+     *
+     * @param data Legend 图例类型数据
+     */
+    addNode(data: Legend) {
+        if (data.properties && data.properties.type) {
+            switch (data.properties.type) {
+                case "BaseEquipment":
+                    this.nodes.push(this.factory.createBaseEquipment(data));
+                    break;
+            }
+        }
     }
 }

+ 6 - 4
src/components/editClass/persagy-edit/PTopoScene.ts

@@ -218,7 +218,7 @@ export class PTopoScene extends SBaseEditScene {
     save(isAll: boolean = true) {
         if (!this.view) return;
         const Marktype: string[] = ['BasePolygon', 'BaseLine', 'BaseText', 'BaseExplain', 'BaseImage', 'BaseCircle', 'BaseArrow', 'BaseTriangle', 'BaseRect', 'BaseArrowPolygon'];
-        const NodeType: string[] = [];
+        const NodeType: string[] = ['BaseEquipment'];
         const RelationType: string[] = [];
         const markers: any = [];   /**图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
         const nodes: any = [];   /**图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
@@ -232,15 +232,17 @@ export class PTopoScene extends SBaseEditScene {
         nodeList.forEach(item => {
             if ((item instanceof SGraphEdit) && !(item instanceof SGraphSelectContainer)) {
                 // 添加节点数据
-                if (Marktype.includes(item.data.properties.type)) {
+                if (item.data && Marktype.includes(item.data.properties.type)) {
                     markers.push(item.toData())
                 }
-                if (NodeType.includes(item.data.properties.type)) {
+                if (item.legendData && NodeType.includes(item.legendData.properties.type)) {
+                    console.log('nodes',item.toData())
                     nodes.push(item.toData())
                 }
-                if (RelationType.includes(item.data.properties.type)) {
+                if (item.relationData && RelationType.includes(item.data.properties.type)) {
                     relations.push(item.toData())
                 }
+                console.log('nodes',item)
             }
         });
         return {

+ 46 - 40
src/components/editview/baseTopoEditer.vue

@@ -16,13 +16,19 @@
   </div>
 </template>
 <script>
-import { PTopoScene, PTopoParser, } from "@/components/editClass/persagy-edit";
+import { PTopoScene, PTopoParser } from "@/components/editClass/persagy-edit";
 import { SGraphView } from "@persagy-web/graph";
 import { SFloorParser } from "@persagy-web/big/lib";
 import topoTooltip from "./topoTooltip.vue";
 import { mapState, mapMutations } from "vuex";
 import bus from "@/bus/bus";
-import { saveGroup, readGroup, uploadGroup, getImageGroup, readPubGroup } from "@/api/editer";
+import {
+  saveGroup,
+  readGroup,
+  uploadGroup,
+  getImageGroup,
+  readPubGroup,
+} from "@/api/editer";
 export default {
   components: { topoTooltip },
   data() {
@@ -37,7 +43,15 @@ export default {
     };
   },
   computed: {
-    ...mapState(["editCmd", "legendObj", "graphId", "id", "isPub", "categoryId","projectId"]),
+    ...mapState([
+      "editCmd",
+      "legendObj",
+      "graphId",
+      "id",
+      "isPub",
+      "categoryId",
+      "projectId",
+    ]),
   },
   mounted() {
     this.canvasWidth = this.$refs.baseTopo.offsetWidth;
@@ -59,8 +73,6 @@ export default {
     };
     // 读取底图
     this.readtopoMsg();
-    // 读取平面图-------测试代码
-    // this.readMapmsg();
   },
   methods: {
     ...mapMutations([
@@ -155,19 +167,19 @@ export default {
           // 设置发布状态为 未发布
           this.SETISPUB(0);
           const gid = res.entityList[0].graphId;
-          const id = res.entityList[0].id
+          const id = res.entityList[0].id;
           // 重设图id 与 id
-          this.SETPROJECT({graphId: gid, id: id});
+          this.SETPROJECT({ graphId: gid, id: id });
           // 修改url参数
           this.$router.push({
-            name: 'Editer',
+            name: "Editer",
             query: {
               graphId: gid,
               id: id,
               categoryName: encodeURI(this.categoryName),
-              isPub: 0
-            }
-          })
+              isPub: 0,
+            },
+          });
         });
       });
       // 设置实例置顶置底
@@ -183,43 +195,37 @@ export default {
     readtopoMsg() {
       const obj = {
         graphId: this.graphId,
-        id: this.id
+        id: this.id,
       };
-      if (this.isPub == 1) { // 已发布
-        readPubGroup(obj).then(res => {
+      if (this.isPub == 1) {
+        // 已发布
+        readPubGroup(obj).then((res) => {
           this.getDataSuc(res);
-        })
+        });
       } else {
         readGroup(obj).then((res) => {
-          this.getDataSuc(res)
+          this.getDataSuc(res);
         });
       }
     },
     // 读图成功回调
     getDataSuc(res) {
-        this.SETCATEGROY(res.content.categoryId);
-        this.topoContent = res.content;
-        const parse = new PTopoParser();
-        parse.parseData(res.content.elements);
-        parse.markers.forEach((item) => {
-          item.selectable = true;
-          item.moveable = true;
-          item.connect("finishCreated", this.scene, this.scene.finishCreated);
-          item.connect("onContextMenu", this, this.scene.getItem);
-          this.scene.addItem(item);
-        });
-    },
-    readMapmsg() {
-      let parser = new SFloorParser();
-      const msg = require("./../../assets/map/1.json");
-      parser.parseData(msg.EntityList[0].Elements);
-      parser.spaceList.forEach((t) => this.scene.addItem(t));
-      parser.wallList.forEach((t) => this.scene.addItem(t));
-      parser.virtualWallList.forEach((t) => this.scene.addItem(t));
-      parser.doorList.forEach((t) => this.scene.addItem(t));
-      parser.columnList.forEach((t) => this.scene.addItem(t));
-      parser.casementList.forEach((t) => this.scene.addItem(t));
-      this.view.fitSceneToView();
+      this.SETCATEGROY(res.content.categoryId);
+      this.topoContent = res.content;
+      const parse = new PTopoParser();
+      parse.parseData(res.content.elements);
+      parse.markers.forEach((item) => {
+        item.selectable = true;
+        item.moveable = true;
+        item.connect("finishCreated", this.scene, this.scene.finishCreated);
+        item.connect("onContextMenu", this, this.scene.getItem);
+        this.scene.addItem(item);
+      });
+      parse.nodes.forEach((item) => {
+        item.connect("finishCreated", this.scene, this.scene.finishCreated);
+        item.connect("onContextMenu", this, this.scene.getItem);
+        this.scene.addItem(item);
+      });
     },
   },
   watch: {
@@ -240,7 +246,7 @@ export default {
   created() {
     this.SETPROJECT(this.$route.query);
     this.SETISPUB(this.$route.query.isPub);
-    this.categoryName = decodeURI(this.$route.query.categoryName)
+    this.categoryName = decodeURI(this.$route.query.categoryName);
   },
 };
 </script>

+ 1 - 1
src/components/editview/leftToolBar.vue

@@ -23,7 +23,7 @@
       size="220px"
       :with-header="false"
       :destroy-on-close="true"
-      :visible="true"
+      :visible.sync="drawer"
       :direction="direction"
       :modal="false"
       :modal-append-to-body="false"

+ 115 - 96
src/components/editview/leftToolBar/addItemModel.vue

@@ -39,57 +39,60 @@
             ></Cascader> -->
             <Input
               iconType="search"
-              v-model="inputVal2"
+              v-model="queryText"
+              placeholder="搜索设备名称或本地编码"
               @pressEnter="pressEnter"
             />
           </div>
-          <el-table
-            v-if="tableHeight > 0"
-            size="small"
-            ref="multipleTable"
-            :data="equiptable"
-            tooltip-effect="dark"
-            style="width: 100%"
-            :height="tableHeight"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column type="selection" width="55"> </el-table-column>
-            <el-table-column type="localName" label="本地名称" width="300">
-              <template slot-scope="scope">{{
-                scope.row.localName ? scope.row.localName : "--"
-              }}</template>
-            </el-table-column>
-            <el-table-column prop="localId" label="本地编码" width="300">
-              <template slot-scope="scope">{{
-                scope.row.localId ? scope.row.localId : "--"
-              }}</template>
-            </el-table-column>
-            <el-table-column
-              prop="bimLocation"
-              label="位置"
-              show-overflow-tooltip
-              width="300"
-            >
-              <template slot-scope="scope">{{
-                scope.row.building || scope.row.floor
-                  ? scope.row.building && scope.row.floor
-                    ? scope.row.building.localName +
-                      "-" +
-                      scope.row.floor.localName
-                    : scope.row.building
-                    ? scope.row.building.localName
-                    : scope.row.floor.localName
-                  : "--"
-              }}</template>
-            </el-table-column>
-            <el-table-column
-              prop="codeName"
-              label="类型"
-              show-overflow-tooltip
-              width="300"
+          <div class="localDom" ref="localDom">
+            <el-table
+              v-if="tableHeight > 0"
+              size="small"
+              ref="multipleTable"
+              :data="equiptable"
+              tooltip-effect="dark"
+              style="width: 100%"
+              :height="tableHeight"
+              @selection-change="handleSelectionChange"
             >
-            </el-table-column>
-          </el-table>
+              <el-table-column type="selection" width="55"> </el-table-column>
+              <el-table-column type="localName" label="本地名称" width="300">
+                <template slot-scope="scope">{{
+                  scope.row.localName ? scope.row.localName : "--"
+                }}</template>
+              </el-table-column>
+              <el-table-column prop="localId" label="本地编码" width="300">
+                <template slot-scope="scope">{{
+                  scope.row.localId ? scope.row.localId : "--"
+                }}</template>
+              </el-table-column>
+              <el-table-column
+                prop="bimLocation"
+                label="位置"
+                show-overflow-tooltip
+                width="300"
+              >
+                <template slot-scope="scope">{{
+                  scope.row.building || scope.row.floor
+                    ? scope.row.building && scope.row.floor
+                      ? scope.row.building.localName +
+                        "-" +
+                        scope.row.floor.localName
+                      : scope.row.building
+                      ? scope.row.building.localName
+                      : scope.row.floor.localName
+                    : "--"
+                }}</template>
+              </el-table-column>
+              <el-table-column
+                prop="codeName"
+                label="类型"
+                show-overflow-tooltip
+                width="300"
+              >
+              </el-table-column>
+            </el-table>
+          </div>
           <Pagination
             class="page-box"
             :pageCountShow="true"
@@ -104,7 +107,7 @@
               <span class="equip-title">已选实例</span>
               <span class="equip-num">{{ choiceEquipList.length }}</span>
             </div>
-            <div class="top-r">清空</div>
+            <div class="top-r" @click="clearChoiceEqipment">清空</div>
           </div>
           <ul class="choiceList">
             <li class="choiceList-item">
@@ -130,7 +133,9 @@
                       v-for="(item, key) in items.children"
                       :key="key"
                     >
-                      <div class="item-title">{{ item.localName }}</div>
+                      <div class="item-title">
+                        {{ item.localName ? item.localName : "空" }}
+                      </div>
                       <i
                         class="el-icon-error"
                         @click="deleteItem(items, key)"
@@ -168,7 +173,7 @@ export default {
   data() {
     return {
       inputVal2: "",
-      isShowModel: true,
+      isShowModel: false,
       equipTypeString: "", //设备类型选中条件
       buildIdString: "", //建筑id 类型string
       floorIdString: "", // 楼层id 类型string
@@ -177,9 +182,12 @@ export default {
       equipData: [], //选中得设备数组
       buildFloorList: [], // 建筑查询数据
       categoryList: [], //设备类型
-      currentPage2: 5,
       tableHeight: 0, //table的高度
       choiceEquipList: [], // 选中得设备数组//非树机构
+      pageSize: 20,
+      currentPage: 1,
+      local: null,
+      queryText: "", //搜索框数据
     };
   },
   methods: {
@@ -196,26 +204,8 @@ export default {
       this.equipTypeString = classCode.length
         ? ";classCode in " + JSON.stringify(classCode)
         : "";
-
-      let data = {
-        Cascade: [
-          {
-            Name: "building",
-            Projection: ["id", "name", "localName"],
-          },
-          {
-            Name: "floor",
-            Projection: ["id", "name", "localName"],
-          },
-        ],
-        Orders: "name asc, createTime desc",
-        PageNumber: 1,
-        PageSize: 20,
-        Filters: `projectId='${this.projectId}'${this.filtIdListString}${this.buildIdString}${this.floorIdString}${this.equipTypeString}`,
-      };
-      queryEquip(data).then((res) => {
-        this.tableTotal = res.total;
-      });
+      // 调用设备接口
+      this.queryEquip();
     },
     // 筛选楼层
     changeFloor(list) {
@@ -261,6 +251,11 @@ export default {
         : isfloornull
         ? ";" + isfloornull
         : "";
+      // 调用设备接口
+      this.queryEquip();
+    },
+    // 搜索设备
+    queryEquip() {
       let data = {
         Cascade: [
           {
@@ -273,17 +268,22 @@ export default {
           },
         ],
         Orders: "name asc, createTime desc",
-        PageNumber: 1,
-        PageSize: 20,
-        Filters: `projectId='${this.projectId}'${this.filtIdListString}${this.buildIdString}${this.floorIdString}${this.equipTypeString}`,
+        PageNumber: this.currentPage,
+        PageSize: this.pageSize,
+        Filters: `projectId='${this.projectId}'${this.filtIdListString}${this.buildIdString}${this.floorIdString}${this.equipTypeString};localName contain "${this.queryText}" or localId contain "${this.queryText}"`,
       };
-      queryEquip(data).then((res) => {
-        this.tableTotal = res.total;
-        this.equiptable = res.content;
-      });
+      this.localLoading();
+      queryEquip(data)
+        .then((res) => {
+          this.tableTotal = res.total;
+          this.equiptable = res.content;
+          this.$loading.close(this.local);
+        })
+        .catch((error) => {
+          console.log("it is error!", error);
+          this.$loading.close(this.local);
+        });
     },
-    // 切换分页
-    currentChangeHandle() {},
     // 关闭弹窗
     modalClose() {
       this.isShowModel = false;
@@ -291,17 +291,15 @@ export default {
     },
     // 确认/提交
     finish() {
-      // 获取数组
-      let list = [];
-      this.equipData.forEach((items) => {
-        list = list.concat([...items.children]);
-      });
       // 将选中的设备类存到vuex中
-      this.SETEQUIPLIST(list);
+      this.SETEQUIPLIST(this.choiceEquipList);
+      // 获取专业和设备类型
       this.modalClose();
     },
     // 搜索回车
-    pressEnter() {},
+    pressEnter() {
+      this.queryEquip();
+    },
     // /是否下拉折叠
     collapse(item) {
       item.showChildren = !item.showChildren;
@@ -310,17 +308,20 @@ export default {
     deleteItem(items, key) {
       let deleteItem = items.children.splice(key, 1);
       items.number = items.children.length;
-      console.log("deleteItem");
+      this.$refs.multipleTable.toggleRowSelection(deleteItem[0]);
       let index = -1;
       this.choiceEquipList.forEach((item, i) => {
         if (item.id == deleteItem[0].id) {
           index = i;
         }
       });
-      if(index>=0){
-         this.choiceEquipList.splice(key,1)
+      if (index >= 0) {
+        this.choiceEquipList.splice(key, 1);
       }
-      this.handleSelectionChange(this.choiceEquipList)
+      this.handleSelectionChange(this.choiceEquipList);
+    },
+    clearChoiceEqipment() {
+      this.$refs.multipleTable.clearSelection();
     },
     /**
      * 构建树list
@@ -382,8 +383,8 @@ export default {
             let obj = {
               id: item.classCode,
               title: item.codeName,
-              children: [],
-              number: 0,
+              children: [item],
+              number: 1,
               showChildren: true,
             };
             arr.push(obj);
@@ -393,16 +394,29 @@ export default {
             id: item.classCode,
             title: item.codeName,
             children: [],
-            number: 0,
+            number: 1,
             showChildren: true,
           };
+          obj.children.push(item);
           arr.push(obj);
+          console.log("this.equipData", arr);
         }
       });
       this.equipData = arr;
     },
+    // 切换分页
     currentChangeHandle(pageMsg) {
-      console.log(pageMsg);
+      this.pageSize = pageMsg.newPageSize;
+      this.currentPage = pageMsg.newPage;
+      this.queryEquip();
+    },
+    //  局部加载
+    localLoading() {
+      this.local = this.$loading({
+        el: this.$refs.localDom,
+        type: "local",
+        size: "min",
+      });
     },
   },
   watch: {
@@ -428,7 +442,12 @@ export default {
       );
     });
     const domLeft = document.getElementById("left");
-    this.tableHeight = domLeft.offsetHeight - 140;
+    if (domLeft) {
+      this.tableHeight = domLeft.offsetHeight - 140;
+    }
+
+    // 调取设备接口
+    // this.queryEquip()
   },
 };
 </script>

+ 9 - 4
src/components/editview/leftToolBar/equipmentList.vue

@@ -1,6 +1,7 @@
 <!-- 设备列表 -->
 <template>
   <div class="equip-list">
+    <!-- 筛选 -->
     <div class="clp">
       <Input
         class="baseItemInput"
@@ -23,7 +24,6 @@
                 width="300"
                 @change="changeItem"
                 @confirm="changeItem"
-                v-model="abc"
               ></Cascader>
             </div>
             <div>
@@ -36,7 +36,6 @@
                 width="300"
                 @change="changeItem"
                 @confirm="changeItem"
-                v-model="abc"
               ></Cascader>
             </div>
             <el-button class="reset" type="text">重置</el-button>
@@ -48,6 +47,7 @@
         ></span>
       </Popover>
     </div>
+    <!-- 设备 list -->
     <div class="porfess" v-for="(items, index) in equipmentList" :key="index">
       <div @click="collapse(items)" class="porfess-title">
         <span>{{ items.porfess }}</span>
@@ -71,7 +71,7 @@
               <span>{{ item.equipType }}</span>
             </div>
             <el-collapse-transition>
-              <ul @mouseout="deletehover(b)" v-show="item.isShow">
+              <ul @mouseout="deletehover" v-show="item.isShow">
                 <li
                   @click="getEquipItem('lengganji.svg')"
                   v-for="(a, b) in item.children"
@@ -179,6 +179,7 @@ export default {
       ],
       equipmentList: [],
       hoverIndex: -1,
+      baseItemVal: "",
     };
   },
   methods: {
@@ -227,9 +228,13 @@ export default {
     collapse(item) {
       item.isShow = !item.isShow;
     },
+    //
+    changeItem() {},
+    pressEnter(){}
   },
   computed: {
     ...mapState(["editCmd"]),
+    // equipmentList
   },
   mounted() {
     let list = [];
@@ -343,7 +348,7 @@ li {
 
   .addbtn {
     width: 100%;
-    height: 40px;
+    height: 46px;
     position: absolute;
     bottom: 0;
     left: 0;

+ 1 - 1
src/components/editview/leftToolBar/legendList.vue

@@ -14,7 +14,7 @@
     <!-- 新增实例对象 -->
     <addItemModel
       @closeModel="showAddItemModel = false"
-      :showAddItemModel="true"
+      :showAddItemModel="showAddItemModel"
       :filtIdList="[]"
     ></addItemModel>
     <!-- :showAddItemModel="showAddItemModel" -->

+ 1 - 1
src/components/editview/rightPropertyBar/BaseEquipment.vue

@@ -29,7 +29,7 @@
               class="avatar-uploader"
               action="https://jsonplaceholder.typicode.com/posts/"
               :show-file-list="false"
-              :before-upload="beforeAvatarUpload"
+
             >
               <i class="el-icon-link"></i>
             </el-upload>

+ 16 - 4
src/components/editview/rightPropertyBar/property.vue

@@ -69,7 +69,13 @@ const arrowType = {
   5: "Circle",
 };
 export default {
-  components: { baseTextPro, baseLinePro, BaseGraphy, BaseImagePro,BaseEquipment },
+  components: {
+    baseTextPro,
+    baseLinePro,
+    BaseGraphy,
+    BaseImagePro,
+    BaseEquipment,
+  },
   data() {
     return {
       itemType: "", // item 类型
@@ -93,9 +99,15 @@ export default {
   methods: {
     emitChoice(itemList) {
       if (itemList.length == 1) {
-        this.itemType = itemList[0].data.properties.type
-          ? itemList[0].data.properties.type
-          : "";
+        const data = itemList[0].data
+          ? itemList[0].data
+          : itemList[0].legendData
+          ? itemList[0].legendData
+          : itemList[0].relationData
+          ? itemList[0].relationData
+          : null;
+        this.itemType = data.properties.type ? data.properties.type : "";
+        console.log("datadata", this.itemType);
       } else {
         this.itemType = "";
       }

+ 2 - 1
src/main.ts

@@ -6,7 +6,7 @@ import './assets/font/iconfont.css';
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 Vue.use(ElementUI);
-import { Input, Modal, Cascader, Popover,Icon,Pagination  } from 'meri-design';
+import { Input, Modal, Cascader, Popover, Icon, Pagination, Loading } from 'meri-design';
 import { Select } from 'ant-design-vue';
 // 按需引入公共组件
 Vue.use(Input)
@@ -16,6 +16,7 @@ Vue.use(Cascader)
 Vue.use(Popover)
 Vue.use(Icon)
 Vue.use(Pagination)
+Vue.prototype.$loading = Loading;
 
 Vue.config.productionTip = false;
 new Vue({