Browse Source

合并冲突

YaolongHan 3 years ago
parent
commit
873ff39af8

+ 2 - 2
package.json

@@ -69,13 +69,13 @@
     "eslint-plugin-vue": "^7.1.0",
     "sass": "^1.28.0",
     "sass-loader": "^10.0.4",
-    "style-resources-loader": "^1.3.3",
     "spark-md5": "^3.0.0",
     "stompjs": "^2.3.3",
+    "style-resources-loader": "^1.3.3",
     "typescript": "^4.0.5",
-    "vue-simple-uploader": "^0.7.4",
     "vue-cli-plugin-element": "^1.0.1",
     "vue-cli-plugin-style-resources-loader": "^0.1.4",
+    "vue-simple-uploader": "^0.7.4",
     "vue-template-compiler": "^2.6.12",
     "webpack": "^4.46.0"
   }

+ 10 - 0
src/api/datacenter.ts

@@ -57,6 +57,11 @@ export function queryEquip(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/equip/query`, postParams)
 }
 
+// 根据id删除设备信息
+export function deleteEquip(postParams: any): any {
+    return httputils.postJson(`${ baseApi }/object/equip/delete`, postParams)
+}
+
 // 创建设备信息
 export function createEquip(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/equip/create`, postParams)
@@ -92,6 +97,11 @@ export function updateZone(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/zone/update`, postParams)
 }
 
+// 更新空间
+export function deleteZone(postParams: any): any {
+    return httputils.postJson(`${ baseApi }/object/zone/delete`, postParams)
+}
+
 // 查询设备统计
 export function queryCount(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/equip/count`, postParams)

+ 1 - 1
src/components/public/adm-multi-table.vue

@@ -19,7 +19,7 @@
                 <el-table-column
                     v-for="(child, index) in item.data"
                     :key="index"
-                    :label="child.unit ? child.name + ' (' + child.unit + ')' : child.name"
+                    :label="child.unit ? child.aliasName + ' (' + child.unit + ')' : child.aliasName"
                     :prop="child.path"
                     :formatter="formatContent"
                     align="center"

+ 0 - 1
src/main.ts

@@ -19,7 +19,6 @@ import "@/permission";
 import moment from "moment";
 Vue.prototype.moment = moment;
 moment.locale('zh-cn')
-
 Vue.use(uploader);
 Vue.use(ElementUI, { size: "small", zIndex: 1000 });
 Vue.use(SvgIcon, {

+ 78 - 6
src/utils/graph/CustomWall.ts

@@ -1,15 +1,16 @@
 import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/lib";
-import { SItemStatus } from "@persagy-web/big/lib";
+import { ItemOrder, SItemStatus } from "@persagy-web/big/lib";
 import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
 import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw/lib";
 import { SGraphItem, SGraphPointListDelete, SGraphPointListInsert, SGraphPointListUpdate, SGraphStyleItem, SLineStyle } from "@persagy-web/graph/lib";
+import { generate } from "./generate";
 
 /**
  * 折线编辑类
  *
  * @author  郝建龙
  */
- export class CustomWall extends SGraphStyleItem {
+export class CustomWall extends SGraphStyleItem {
     /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
     /** X 坐标最大值 */
@@ -20,6 +21,8 @@ import { SGraphItem, SGraphPointListDelete, SGraphPointListInsert, SGraphPointLi
     private maxY = Number.MIN_SAFE_INTEGER;
     /** 折点信息 */
     pointList: SPoint[] = [];
+    /** Z 轴坐标 */
+    Z: number = 0;
     /** 是否绘制完成 */
     _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
@@ -70,9 +73,16 @@ import { SGraphItem, SGraphPointListDelete, SGraphPointListInsert, SGraphPointLi
             this.lastPoint = data;
         }
         this.fillColor = new SColor("#2196f3");
+        this.lineWidth = 2;
         this.selectable = true;
+        this.zOrder = ItemOrder.wallOrder;
+        this.data = {
+            SourceId: +new Date(),
+            OutLine: [],
+            Width: 200
+        }
     } // Constructor
-    
+
     /**
      * 添加点至数组中
      *
@@ -315,9 +325,9 @@ import { SGraphItem, SGraphPointListDelete, SGraphPointListInsert, SGraphPointLi
      */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
-                p,
-                new SLine(this.pointList[0], this.pointList[1])
-            ),
+            p,
+            new SLine(this.pointList[0], this.pointList[1])
+        ),
             index = 0;
         if (this.pointList.length > 2) {
             for (let i = 1; i < this.pointList.length - 1; i++) {
@@ -507,6 +517,68 @@ import { SGraphItem, SGraphPointListDelete, SGraphPointListInsert, SGraphPointLi
      * @return 对象储存的相关数据
      */
     toData(): any {
+        this.pointList = generate.simplyOutline(this.pointList)
+        if (this.pointList.length == 2) {
+            const fGroup = generate.getVertical(this.pointList[0], this.pointList[1], this.data.Width);
+            const sGroup = generate.getVertical(this.pointList[1], this.pointList[0], this.data.Width);
+            const doubleGroup = generate.generateOrderLine(fGroup, sGroup, new SLine(this.pointList[0], this.pointList[1]));
+            this.data.OutLine = [
+                [
+                    {
+                        X: Number(doubleGroup[0][0].toFixed(2)),
+                        Y: -Number(doubleGroup[0][1].toFixed(2)),
+                        Z: this.Z
+                    },
+                    {
+                        X: Number(doubleGroup[0][2].toFixed(2)),
+                        Y: -Number(doubleGroup[0][3].toFixed(2)),
+                        Z: this.Z
+                    },
+                    {
+                        X: Number(doubleGroup[1][2].toFixed(2)),
+                        Y: -Number(doubleGroup[1][3].toFixed(2)),
+                        Z: this.Z
+                    },
+                    {
+                        X: Number(doubleGroup[1][0].toFixed(2)),
+                        Y: -Number(doubleGroup[1][1].toFixed(2)),
+                        Z: this.Z
+                    }
+                ]
+            ]
+        } else if (this.pointList.length > 2) {
+            const list = this.pointList;
+            let fGroup = generate.getVertical(list[0], list[1], this.data.Width);
+            let lGroup = generate.getVertical(list[list.length - 1], list[list.length - 2], this.data.Width);
+            let array = [], outline1 = [], outline2 = [];
+            outline1.push({ X: fGroup[0], Y: -fGroup[1], Z: this.Z });
+            outline2.push({ X: fGroup[2], Y: -fGroup[3], Z: this.Z });
+            for (let i = 1; i < list.length - 1; i++) {
+                const midGroup = generate.getBisector(list[i - 1], list[i], list[i + 1], this.data.Width);
+                const midDoubleGroup = generate.generateOrderLine(fGroup, midGroup, new SLine(list[i - 1], list[i]));
+                fGroup = [...midGroup]
+                array.push(midDoubleGroup);
+                if (generate.isEqual(midDoubleGroup[0][0], outline1[outline1.length - 1].X) && generate.isEqual(midDoubleGroup[0][1], -outline1[outline1.length - 1].Y)) {
+                    outline1.push({ X: midDoubleGroup[0][2], Y: -midDoubleGroup[0][3], Z: this.Z });
+                    outline2.push({ X: midDoubleGroup[1][2], Y: -midDoubleGroup[1][3], Z: this.Z });
+                } else {
+                    outline1.push({ X: midDoubleGroup[1][2], Y: -midDoubleGroup[1][3], Z: this.Z });
+                    outline2.push({ X: midDoubleGroup[0][2], Y: -midDoubleGroup[0][3], Z: this.Z });
+                }
+            }
+            let temp = generate.generateOrderLine(fGroup, lGroup, new SLine(list[list.length - 2], list[list.length - 1]));
+            array.push(temp)
+            if (generate.isEqual(temp[0][0], outline1[outline1.length - 1].X) && generate.isEqual(temp[0][1], -outline1[outline1.length - 1].Y)) {
+                outline1.push({ X: temp[0][2], Y: -temp[0][3], Z: this.Z });
+                outline2.push({ X: temp[1][2], Y: -temp[1][3], Z: this.Z });
+            } else {
+                outline1.push({ X: temp[1][2], Y: -temp[1][3], Z: this.Z });
+                outline2.push({ X: temp[0][2], Y: -temp[0][3], Z: this.Z });
+            }
+            this.data.OutLine = [
+                outline1.concat(outline2.reverse())
+            ]
+        }
         return this.data;
     }
 

+ 21 - 5
src/utils/graph/DivideFloorScene.ts

@@ -69,6 +69,23 @@ export class DivideFloorScene extends FloorScene {
                 this.removeItem(t)
             })
             this.customWall = []
+            this.grabItem = null;
+        }
+    }
+
+    /**
+     * 删除墙功能
+    */
+    delWall() {
+        if (this.grabItem && this.grabItem instanceof CustomWall && this.grabItem.status == SItemStatus.Create) {
+            this.deleteItem(this.grabItem);
+            this.grabItem = null;
+        } else if (this.selectContainer.count > 0) {
+            const item = this.selectContainer.itemList[0];
+            if (item instanceof SWallItem || item instanceof CustomWall) {
+                this.deleteItem(item);
+                this.selectContainer.itemList.shift();
+            }
         }
     }
 
@@ -568,7 +585,7 @@ export class DivideFloorScene extends FloorScene {
      * 
      * @param fName 文件名
     */
-    generateFile(fName: string) {
+    generateFile(fName: string, _fn: Function) {
         if (this.json) {
             // const zip = new JSZip();
             // // // // // // 名称-文件内容
@@ -610,7 +627,7 @@ export class DivideFloorScene extends FloorScene {
             // unzip(blob);
             // console.log(blob)
             // const file = new File([bl], '111')
-            this.upload(fName, blob)
+            this.upload(fName, blob, _fn)
         }
     }
 
@@ -620,7 +637,7 @@ export class DivideFloorScene extends FloorScene {
      * @param key 当前显示的楼层平面图的key
      * @param blob 上传的blob对象
     */
-    upload(key: string, blob: Blob) {
+    upload(key: string, blob: Blob, _fn: Function) {
         let reader = new FileReader();
         reader.onloadstart = function () {
             // 这个事件在读取开始时触发
@@ -643,9 +660,8 @@ export class DivideFloorScene extends FloorScene {
             xhr.send(reader.result);
             xhr.onreadystatechange = function () {
                 if (xhr.readyState == 4) {
-                    console.log(xhr)
                     if (xhr.status == 200) {
-                        console.log(324234);
+                        _fn()
                     } else {
                     }
                 }

+ 9 - 0
src/utils/graph/FloorScene.ts

@@ -289,6 +289,15 @@ export class FloorScene extends SGraphScene {
     }
 
     /**
+     * 初始化墙颜色
+    */
+    initWallColor(): void {
+        this.wallList.forEach((t: SWallItem, i: number) => {
+            t.fillColor = ItemColor.wallColor;
+        })
+    }
+
+    /**
      * 清空业务空间
      */
     removeAllZone() {

+ 138 - 9
src/utils/graph/generate.ts

@@ -1,6 +1,6 @@
-import { SPoint } from "@persagy-web/draw/lib";
+import { SLine, SPoint } from "@persagy-web/draw/lib";
 // @ts-ignore
-import { intersect, polygon, segments, combine, selectUnion, selectDifference, selectDifferenceRev} from "polybooljs";
+import { intersect, polygon, segments, combine, selectUnion, selectDifference, selectDifferenceRev } from "polybooljs";
 
 export class generate {
     /**
@@ -10,8 +10,9 @@ export class generate {
      * @param p2 第二个点 也是2条线的交点
      * @param p3 第三个点
      * @param l  距离2条线的距离
+     * @return number Array(4) 两个点
     */
-    static getBisector(p1: SPoint, p2: SPoint, p3: SPoint, l: number) {
+    static getBisector(p1: SPoint, p2: SPoint, p3: SPoint, l: number): [number, number, number, number] {
         const dy1 = p1.y - p2.y;
         const dx1 = p1.x - p2.x;
 
@@ -24,16 +25,24 @@ export class generate {
         const k2 = dy2 / dx2;
         // 线1与x轴的夹角
         const temp1 = Math.atan(k1)
-        const a1 = k1 >= 0 ? temp1 : temp1 + Math.PI;
+        let a1 = dx1 >= 0 ? temp1 : temp1 + Math.PI;
         // 线2与x轴的夹角
         const temp2 = Math.atan(k2)
-        const a2 = k2 >= 0 ? temp2 : temp2 + Math.PI;
+        let a2 = dx2 >= 0 ? temp2 : temp2 + Math.PI;
         // 角平分线斜率
         const k = Math.tan((a1 + a2) / 2);
         // 角平分线b
         const b = p2.y - k * p2.x;
         // 距离两条线l的点 到交点p2的距离
         const Lb2 = l / Math.sin(Math.abs(a1 - a2) / 2);
+        // 特殊情况-角分线垂直或平行X轴
+        if (k1 / k2 == -1) {
+            if (dx2 * dx1 > 0 && dy2 * dy1 < 0) { // 上下开角
+                return [Number((p2.x - Lb2).toFixed(6)), Number(p2.y.toFixed(6)), Number((p2.x + Lb2).toFixed(6)), Number(p2.y.toFixed(6))]
+            } else if (dx2 * dx1 < 0 && dy2 * dy1 > 0) { // 左右开角
+                return [Number(p2.x.toFixed(6)), Number((p2.y - Lb2).toFixed(6)), Number(p2.x.toFixed(6)), Number((p2.y + Lb2).toFixed(6))]
+            }
+        }
         // 将距离公式与直线方程连立,并且将直线方程代入,得到一元二次方程 Ax^2 + Bx + C = 0;然后根据得根公式得到2个解
         const A = k * k + 1;
         const B = 2 * k * b - 2 * p2.x - 2 * k * p2.y;
@@ -44,20 +53,29 @@ export class generate {
         const Y1 = k * X1 + b;
         const Y2 = k * X2 + b;
 
-        return [Number(X1.toFixed(2)), Number(Y1.toFixed(2)), Number(X2.toFixed(2)), Number(Y2.toFixed(2))]
+        return [Number(X1.toFixed(6)), Number(Y1.toFixed(6)), Number(X2.toFixed(6)), Number(Y2.toFixed(6))]
     }
 
     /**
-     * 计算一条线的垂线上距离线l的2个点
+     * 计算一条线的过p1垂线上距离线l的2个点
      * 
      * @param p1 点1
      * @param p2 点2
      * @param l  距离这条线的距离
+     * @return number Array(4) 两个点
     */
-    static getVertical(p1: SPoint, p2: SPoint, l: number) {
+    static getVertical(p1: SPoint, p2: SPoint, l: number): [number, number, number, number] {
         const dy1 = p1.y - p2.y;
         const dx1 = p1.x - p2.x;
 
+        if (dy1 == 0) {
+            return [Number(p1.x.toFixed(6)), Number((p1.y - l).toFixed(6)), Number(p1.x.toFixed(6)), Number((p1.y + l).toFixed(6))]
+        }
+
+        if (dx1 == 0) {
+            return [Number((p1.x - l).toFixed(6)), Number(p1.y.toFixed(6)), Number((p1.x + l).toFixed(6)), Number(p1.y.toFixed(6))]
+        }
+
         // 线1的斜率
         const k1 = dy1 / dx1;
         // 垂线的斜率
@@ -74,7 +92,7 @@ export class generate {
         const Y1 = k * X1 + b;
         const Y2 = k * X2 + b;
 
-        return [Number(X1.toFixed(2)), Number(Y1.toFixed(2)), Number(X2.toFixed(2)), Number(Y2.toFixed(2))]
+        return [Number(X1.toFixed(6)), Number(Y1.toFixed(6)), Number(X2.toFixed(6)), Number(Y2.toFixed(6))]
     }
 
     /**
@@ -108,6 +126,117 @@ export class generate {
         return null;
     }
 
+    /**
+     * 一条线生成的4个点,根据这4个点和这条线,将轮廓线排序
+     * 
+     * @description 计算3条线的斜率,差值小的一组
+     * 
+     * @param [number, number, number, number]
+     * @param [number, number, number, number]
+     * @param SLine
+     * @return 两组线的数组
+    */
+    static generateOrderLine(arr1: [number, number, number, number], arr2: [number, number, number, number], line: SLine) {
+        if (arr1.length && arr2.length) {
+            // 排除特殊情况
+            if (line.dy == 0) { // 线本身是水平的
+                if (generate.isEqual(arr1[1], arr2[1])) {
+                    return [
+                        [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                        [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                    ]
+                } else {
+                    return [
+                        [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                        [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                    ]
+                }
+            }
+
+            if (line.dx == 0) { // 线本身是垂直的
+                if (generate.isEqual(arr1[0], arr2[0])) { // 与另外一组的第一个点的连线是水平的
+                    return [
+                        [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                        [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                    ]
+                } else { // 与另外一组的第二个点的连线是竖直的
+                    return [
+                        [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                        [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                    ]
+                }
+            }
+
+            // 标准线的斜率
+            const k = line.dy / line.dx;
+            // 第一条线
+            const l1 = new SLine(arr1[0], arr1[1], arr2[0], arr2[1]);
+            // 第一条线的斜率
+            const k1 = l1.dy / l1.dx;
+            // 第一条线斜率差值
+            const dk1 = Math.abs(k1 - k);
+            // 第二条线
+            const l2 = new SLine(arr1[0], arr1[1], arr2[2], arr2[3]);
+            // 第二条线的斜率
+            const k2 = l2.dy / l2.dx;
+            // 第二条线斜率差值
+            const dk2 = Math.abs(k2 - k);
+
+            // 判断差值小的放一组
+            if (dk1 < dk2) {
+                return [
+                    [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                    [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                ]
+            } else {
+                return [
+                    [Number(arr1[0].toFixed(6)), Number(arr1[1].toFixed(6)), Number(arr2[2].toFixed(6)), Number(arr2[3].toFixed(6))],
+                    [Number(arr1[2].toFixed(6)), Number(arr1[3].toFixed(6)), Number(arr2[0].toFixed(6)), Number(arr2[1].toFixed(6))],
+                ]
+            }
+        }
+        return []
+    }
+
+    /**
+     * 删除轮廓线中共线的点
+     * 
+     * @description 连续2条线的斜率相等则这3点共线,删除中间的一个点
+     * @param outline 轮廓线数据
+     * @return 简化后的轮廓线数据
+    */
+    static simplyOutline(outline: SPoint[]): SPoint[] {
+        if (outline.length > 2) {
+            for (let i = 1; i < outline.length - 1; i++) {
+                if (outline[i].y - outline[i - 1].y == 0 && outline[i + 1].y - outline[i].y == 0) {
+                    outline.splice(i, 1);
+                    i--;
+                } else if (outline[i].x - outline[i - 1].x == 0 && outline[i + 1].x - outline[i].x == 0) {
+                    outline.splice(i, 1);
+                    i--;
+                } else if (
+                    outline[i].y - outline[i - 1].y == outline[i + 1].y - outline[i].y &&
+                    outline[i].x - outline[i - 1].x == outline[i + 1].x - outline[i].x
+                ) {
+                    outline.splice(i, 1);
+                    i--;
+                }
+            }
+        }
+        return outline
+    }
+
+    /**
+     * 解决0.1+0.2!=0.3的问题
+     * 
+     * @param a 第一个数
+     * @param b 第二个数
+     * @return 是否相等
+    */
+    static isEqual(a: number, b: number) {
+        return Math.abs(a - b) < Math.pow(2, -52);
+    }
+
 
     static llll() {
         const a = {

+ 27 - 8
src/views/maintain/device/index.vue

@@ -34,21 +34,21 @@
         <el-scrollbar style="height:400px;">
             <el-dialog
                 :title="deviceMsg"
+                :width="!isWidth ? '20%':''"
                 :visible.sync="dialogVisible"
-                @close="close"
-            >
+                @close="close">
                 <template slot="title">
                     <div class="alertTitle">
                         <span>{{ deviceMsg }}</span>
-                        <el-button type="text" >
-                            <span class="el-icon-question" />
+                        <el-button type="text">
+                            <span class="el-icon-question"/>
                             <a href="/datacenter/object/equip/downloads" download="维护帮助"> 维护帮助</a>
-                           </el-button>
+                        </el-button>
                     </div>
                 </template>
                 <template v-if="deviceMsg == '添加设备'">
                     <template v-if="next">
-                        <div class="align" style="height: 400px">
+                        <div class="align " :style="{ 'height': isWidth ? '400px':'200px' }">
                             <span class="text ">设备类别</span>
                             <el-cascader :options="list" clearable v-model="deviceVal"
                                          :props="optionProps"
@@ -82,6 +82,7 @@
                     <template v-else>
                         <dataForm :deviceHeaders="deviceHeaders" ref="dataForm" :currRowContent="currRowContent"/>
                         <span slot="footer" class="dialog-footer">
+                              <el-button type="danger" style="float: left" @click="deleteDevice">删除设备</el-button>
                          <el-button type="primary" @click="handleDataForm">确 定</el-button>
                          <el-button @click="handlePosition">维护位置</el-button>
                     </span>
@@ -97,7 +98,7 @@
 import { Component, Vue, Watch } from "vue-property-decorator";
 import { AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics } from '../components/index'
 import { allDevice, BeatchQueryParam, dictInfo } from "@/api/equipComponent";
-import { createEquip, queryCount, queryEquip, updateEquip } from "@/api/datacenter";
+import { createEquip, queryCount, queryEquip, updateEquip, deleteEquip } from "@/api/datacenter";
 import { UserModule } from "@/store/modules/user";
 import deviceGraph from "./components/deviceGraph.vue"
 import tools from "@/utils/maintain"
@@ -123,6 +124,8 @@ export default class extends Vue {
         total: 0
 
     }
+    // 设置高度
+    isWidth = false
     // 设备类值
     deviceType = ''
     // 弹窗设备类值
@@ -239,6 +242,7 @@ export default class extends Vue {
     async handleNext() {
         if (this.deviceVal[1]) {
             this.next = false
+            this.isWidth = true
             let param = {
                 category: this.deviceVal[1]
             }
@@ -387,7 +391,7 @@ export default class extends Vue {
 
     // 维护位置
     handlePosition() {
-        this.currentRow= this.$refs.dataForm.form
+        this.currentRow = this.$refs.dataForm.form
         this.$refs.dataForm.submitForm(this.handlePositionSave)
     }
 
@@ -401,6 +405,18 @@ export default class extends Vue {
         this.$refs.dataForm.submitForm(this.handleDataFormSave)
     }
 
+    // 删除设备
+    deleteDevice() {
+        deleteEquip([{ id: this.currRowContent.id }]).then(res => {
+            if (res.result == 'success') {
+                this.$message.success('删除成功')
+                this.handleChangeDevice()
+                this.dialogVisible = false;
+            }
+
+        })
+    }
+
     handleDataFormSave() {
         const eq = tools.formatData(this.$refs.dataForm.form);
         if (eq.id) {
@@ -424,6 +440,7 @@ export default class extends Vue {
     // close
     close() {
         this.next = true
+        this.isWidth = false
         if (this.deviceType) {
             this.deviceVal = this.deviceType
         } else {
@@ -605,6 +622,8 @@ $border: 1px solid #E1E7EA;
 </style>
 <style lang="scss">
 .adm-device {
+
+
     .el-dialog__header {
         padding: 10px;
     }

+ 2 - 2
src/views/maintain/relationship/components/tableHeader.ts

@@ -6,7 +6,7 @@ const tableHeader = {
     '设备所在供电空间': [['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['建筑', 'objectInfo-localName'], ['楼层', 'objectInfo-floorName'], ['BIM构件名称', 'bimTypeId'], ['系统分类', 'systemCategory'], ['设备类型名称', 'codeName'], ['设备本地编码', "localId"]],
     '空间所在建筑': [['建筑', 'localName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['楼层', 'objectInfo-floorName']],
     '空间所在楼层': [['建筑', 'buildingName'], ['楼层', 'localName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"]],
-    '空间服务空间': [['空间本地名称', "buildingName"], ['空间本地编码', "localId"], ['建筑', 'buildingName'], ['楼层', 'floorName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['楼层', 'objectInfo-floorName']] ,
-    '系统下的设备': [['系统分类', 'systemCategory'], ['系统名称', ''], ['系统编码', ''], ['BIM构件名称', 'bimTypeId'], ['系统分类', 'systemCategory'], ['设备类型名称', 'codeName'], ['设备本地编码', "localId"]],
+    '空间服务空间': [['空间本地名称', "buildingName"], ['空间本地编码', "localId"], ['建筑', 'buildingName'], ['楼层', 'floorName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['楼层', 'objectInfo-floorName']],
+    '系统下的设备': [['系统分类', 'systemCategory'], ['系统名称', 'localName'], ['系统编码', 'localId'], ['BIM构件名称', 'objectInfo-bimTypeId'], ['系统分类', 'objectInfo-systemCategory'], ['设备类型名称', 'objectInfo-codeName'], ['设备本地编码', "objectInfo-localId"]],
 }
 export default tableHeader

+ 92 - 96
src/views/maintain/space/components/spaceGraph.vue

@@ -2,44 +2,30 @@
     <div id="graphContainer" ref="graphContainer">
         <div v-show="floorKey" v-loading="canvasLoading">
             <el-row class="buttons-box">
-                <div>
-                    <el-autocomplete popper-class="my-autocomplete" v-model="search" :fetch-suggestions="querySearch"
-                        placeholder="输入平面图中已有的业务空间名称进行查找" width="180px" @select="handleSelect">
-                        <i class="el-icon-search el-input__icon" slot="suffix"></i>
-                        <template slot-scope="{ item }">
-                            <div class="name"
-                                style="position: relative;padding-right:40px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"
-                                :title="item.data.RoomLocalName">
-                                {{ item.data.RoomLocalName }}
-                                <span class="addr" style="position: absolute;right:0;color:#409EFF;">定位</span>
-                            </div>
-                        </template>
-                    </el-autocomplete>
-                </div>
                 <div class="button-group">
                     <!-- 默认操作模式 -->
                     <div v-if="type==1">
                         <el-dropdown split-button type="primary" @click="editGraphy" @command="handleCommand">
-                            创建业务空间
+                            创建空间
                             <el-dropdown-menu slot="dropdown">
                                 <!-- <el-dropdown-item command="groupCreateBSpace">批量创建业务空间</el-dropdown-item> -->
                                 <el-dropdown-item command="createWall">创建墙体</el-dropdown-item>
                             </el-dropdown-menu>
                         </el-dropdown>
                         <!-- 点击已经关联的业务空间 -->
-                        <el-button plain @click="refactorBSP" :disabled="zoneDisable" style="margin-left:10px;">编辑业务空间</el-button>
+                        <!-- <el-button plain @click="refactorBSP" :disabled="zoneDisable" style="margin-left:10px;">编辑业务空间</el-button> -->
                         <!-- <el-button plain :disabled="zoneDisable" style="margin-left:10px;">维护空间信息</el-button> -->
-                        <el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
+                        <!-- <el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button> -->
                     </div>
                     <!-- 点击未关联的业务空间 -->
                     <div v-if="type==3">
-                        <el-button plain @click="createNewZone">创建单个全新的业务空间</el-button>
+                        <el-button plain @click="createNewZone">创 建</el-button>
                         <el-button plain @click="cancelGraphy">取 消</el-button>
                     </div>
                     <!-- 重新划分业务空间 -->
                     <div v-if="type==4">
+                        <el-button type="primary" @click="saveRefactorBSP">保 存</el-button>
                         <el-button plain @click="cancelGraphy">取 消</el-button>
-                        <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
                     </div>
                     <!-- 批量创建所选业务空间 -->
                     <div v-if="type==5">
@@ -48,8 +34,13 @@
                     </div>
                     <!-- 保存墙 -->
                     <div v-if="type==6">
+                        <el-button type="primary" @click="saveMap">保 存</el-button>
+                        <el-button plain @click="cancelGraphy">取 消</el-button>
+                    </div>
+                    <!-- 删除业务空间 -->
+                    <div v-if="type==7">
+                        <el-button type="primary" @click="deleteRoom">删 除</el-button>
                         <el-button plain @click="cancelGraphy">取 消</el-button>
-                        <el-button type="primary" @click="saveMap">保存</el-button>
                     </div>
                 </div>
             </el-row>
@@ -81,11 +72,12 @@ import {
     queryIspace,
     createZone,
     updateZone,
+    deleteZone,
 } from "@/api/datacenter";
 import createBSP from "./createBSP";
 import colorArr from "@/utils/graph/config/zoneColor";
 import { SObject } from "@persagy-web/base/lib";
-import { ItemColor } from "@persagy-web/big/lib";
+import { ItemColor, SItemStatus } from "@persagy-web/big/lib";
 import { SSpaceItem } from "@persagy-web/big/lib/items/floor/SSpaceItem";
 import { SZoneItem } from "@persagy-web/big/lib/items/floor/ZoneItem";
 import { AppModule } from "@/store/modules/app";
@@ -102,15 +94,14 @@ export default class spaceGraph extends Vue {
     view: FloorView | null = null;
     scene: DivideFloorScene | null = null;
     canvasLoading = false;
-    type = 1;
+    type = -1;
     config = {
         isEdit: false,
         divide: true,
         groupSelect: false,
         drawWall: false,
     };
-    search = ""; //搜索
-    zoneDisable = true;
+    // zoneDisable = true;
     curZoneItem = {};
     zoneList = [];
     buildFloor: string[] = [];
@@ -155,18 +146,21 @@ export default class spaceGraph extends Vue {
     noMap() {
         this.floorKey = "";
         this.canvasLoading = false;
+        this.$emit('initCreatBtn', true)
     }
     // 初始化
     init(initType: number): void {
-        this.type = 1;
+        this.type = -1;
         if (this.scene) {
             this.scene.selectContainer.clear();
             this.scene.initSpaceColor();
+            this.scene.initWallColor();
             this.scene.clearCut();
-            this.scene.clearWalls()
-            this.zoneDisable = true;
+            this.scene.clearWalls();
+            // this.zoneDisable = true;
             this.scene.isZoneSelectable = true;
             this.scene.isSpaceSelectable = false;
+            this.scene.isWallSelectable = false
         }
         if (
             this.buildFloor.indexOf("all") > -1 ||
@@ -174,7 +168,7 @@ export default class spaceGraph extends Vue {
         ) {
             return;
         }
-
+        this.$emit('initCreatBtn', false)
         if (initType == 1) {
             // 底图
             this.getGraph();
@@ -201,7 +195,7 @@ export default class spaceGraph extends Vue {
         this.canvasLoading = true;
         this.clearGraphy();
         this.scene = null;
-        scene.loadUrl(this.mapBaseUrl + this.floorKey).then((res) => {
+        scene.loadUrl(this.mapBaseUrl + this.floorKey + `&${+new Date()}`).then((res) => {
             if (this.view) {
                 this.view.scene = scene;
             }
@@ -239,29 +233,14 @@ export default class spaceGraph extends Vue {
         }
         this.view = new FloorView("spaceCanvas");
     }
-    // 搜索
-    querySearch(queryString: string, cb: Function) {
-        let restaurants = this.zoneList;
-        let results = queryString
-            ? restaurants.filter(this.createFilter(queryString))
-            : restaurants;
-        // 调用 callback 返回建议列表的数据
-        cb(results);
-    }
-    // 过滤器
-    createFilter(queryString: any) {
-        return (restaurant: any) => {
-            return restaurant.data.RoomLocalName.indexOf(queryString) > -1;
-        };
-    }
     // 查询选中,定位
-    handleSelect(zone) {
+    handleSelect(zone: SZoneItem) {
         // 清空选中
         this.scene?.selectContainer.clear();
         this.curZoneItem = zone;
         this.scene?.selectContainer.setItem(zone);
-        this.zoneDisable = false;
-        this.view.fitSelectedToView();
+        // this.zoneDisable = false;
+        this.view?.fitSelectedToView();
     }
     // 点击创建业务空间
     editGraphy() {
@@ -273,6 +252,7 @@ export default class spaceGraph extends Vue {
         if (this.scene) {
             this.scene.isSpaceSelectable = true;
             this.scene.isZoneSelectable = false;
+            this.scene.isWallSelectable = false
             this.scene.selectContainer.clear();
         }
         this.view?.update();
@@ -314,6 +294,7 @@ export default class spaceGraph extends Vue {
             if (this.scene) {
                 this.scene.isSpaceSelectable = false;
                 this.scene.isZoneSelectable = false;
+                this.scene.isWallSelectable = true
             }
         }
     }
@@ -326,6 +307,7 @@ export default class spaceGraph extends Vue {
         if (this.scene) {
             this.scene.isZoneSelectable = false;
             this.scene.isSpaceSelectable = true;
+            this.scene.isWallSelectable = false
             this.scene.selectContainer.clear();
         }
         this.type = 4;
@@ -380,11 +362,10 @@ export default class spaceGraph extends Vue {
                     Color: colorArr[i % colorArr.length],
                 };
             }).filter((item) => item);
-            console.log(this.scene);
-            this.scene.removeAllZone();
-            this.scene.addZoneList(tempArr);
-            this.zoneList = this.scene.zoneList;
-            this.view.update();
+            this.scene?.removeAllZone();
+            this.scene?.addZoneList(tempArr);
+            this.$emit("getZoneSuc", this.scene?.zoneList);
+            this.view?.update();
             this.canvasLoading = false;
             // }
         });
@@ -429,16 +410,20 @@ export default class spaceGraph extends Vue {
                     this.scene?.initSpaceColor();
                 } else if (data[0][0] instanceof SZoneItem) {
                     this.scene?.initZoneColor();
-                    this.zoneDisable = false;
+                    // this.zoneDisable = false;
+                    this.type = 7;
                     this.curZoneItem = data[0][0];
                 }
             } else {
                 this.scene?.initSpaceColor();
                 if (this.type == 3) {
                     console.log(3);
-                } else {
+                } else if (this.type == 6) {
+                    console.log(6)
+                } else  {
                     this.scene?.initZoneColor();
-                    this.zoneDisable = true;
+                    this.type = -1;
+                    // this.zoneDisable = true;
                 }
             }
             data[0].forEach((t) => {
@@ -447,7 +432,8 @@ export default class spaceGraph extends Vue {
         } else {
             this.scene?.initSpaceColor();
             this.scene?.initZoneColor();
-            this.zoneDisable = true;
+            this.type = -1;
+            // this.zoneDisable = true;
         }
     }
 
@@ -474,12 +460,33 @@ export default class spaceGraph extends Vue {
     }
 
     /**
+     * 删除业务空间
+     */
+    deleteRoom() {
+        let arr = this.scene?.selectContainer.itemList || [];
+        if (arr.length) {
+            let temp = arr
+                .map((t) => {
+                    if (t instanceof SZoneItem) {
+                        return { id: t.data.RoomID };
+                    }
+                })
+                .filter((item) => item);
+            if (temp.length) {
+                this.handleDeleteZone(temp);
+            }
+        }
+    }
+
+    /**
      * 生成底图json
      */
     saveMap() {
         if (this.scene) {
-            const json = this.scene.getMapObject()
-            console.log(json);
+            this.scene.generateFile(this.floorKey, () => {
+                this.$message.success('修改模型成功');
+                this.init(1)
+            });
         }
     }
 
@@ -591,7 +598,7 @@ export default class spaceGraph extends Vue {
             pa.content = zoneObj;
         }
         this.canvasLoading = true;
-        createZone(pa).then((res) => {
+        createZone(pa).then(() => {
             this.$message.success("创建成功");
             this.init(2);
         });
@@ -608,12 +615,27 @@ export default class spaceGraph extends Vue {
             pa.content = zoneObj;
         }
         this.canvasLoading = true;
-        updateZone(pa).then((res) => {
+        updateZone(pa).then(() => {
             this.$message.success("更新成功");
             this.init(2);
         });
     }
 
+    /**
+     * 删除业务空间接口
+     */
+    handleDeleteZone(zone: any) {
+        let pa = [zone]
+        if (Array.isArray(zone)) {
+            pa = zone;
+        }
+        this.canvasLoading = true;
+        deleteZone(pa).then(() => {
+            this.$message.success("删除成功");
+            this.init(2);
+        });
+    }
+
     // 适配底图到窗口
     fit() {
         this.view?.fitSceneToView();
@@ -646,7 +668,7 @@ export default class spaceGraph extends Vue {
     // 清除切割划分
     clearDivide() {
         // @ts-ignore
-        this.view!.scene.clearCut();
+        this.view.scene.clearCut();
     }
     // 缩放
     scale(val: number) {
@@ -674,12 +696,7 @@ export default class spaceGraph extends Vue {
      */
     clearWall() {
         if (this.scene) {
-            if (this.scene.selectContainer.itemList.length) {
-                const item = this.scene.selectContainer.itemList[0];
-                if (item instanceof SWallItem || item instanceof CustomWall) {
-                    this.scene.deleteItem(item)
-                }
-            }
+            this.scene.delWall();
         }
     }
 
@@ -718,40 +735,19 @@ export default class spaceGraph extends Vue {
     }
     .buttons-box {
         position: absolute;
-        top: 16px;
+        bottom: 68px;
         left: 0;
         padding: 0 16px;
         width: 100%;
         z-index: 999;
         & > div {
-            float: left;
-        }
-        .el-autocomplete {
-            display: inline-block;
-            width: 320px;
-            margin-right: 10px;
-        }
-        .button-group button,
-        .button-group .el-dropdown {
-            display: block;
-            float: left;
-        }
-        .my-autocomplete {
-            li {
-                line-height: normal;
-                padding: 7px;
-                .name {
-                    text-overflow: ellipsis;
-                    overflow: hidden;
-                }
-                .addr {
-                    font-size: 12px;
-                    color: #b4b4b4;
-                }
-                .highlighted .addr {
-                    color: #ddd;
-                }
-            }
+            margin: 0 auto;
+        }
+        .button-group {
+            width: 300px;
+            height: 35px;
+            margin: 0 auto;
+            text-align: center;
         }
     }
 }

+ 167 - 37
src/views/maintain/space/index.vue

@@ -9,20 +9,47 @@
             </el-tabs>
             <div class="tab-content">
                 <div class="search" :class="{ 'borderBottom': activeName==='picture' }">
-                    <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options"
-                                 v-model="building" filterable size="small"
-                                 @change="changeCascader" style="margin-right: 12px"
-                                 v-if="activeName==='table'"></el-cascader>
-                    <admSearch @SearchValue="searchValue" class="item" v-if="activeName==='table'"/>
-
-                    <el-cascader clearable ref="graphCascader" placeholder="请选择建筑楼层" :options="graphOptions"
-                                 v-model="graphBuilding" filterable
-                                 size="small" @change="changeGraphCascader" style="margin-right: 12px"
-                                 v-if="activeName==='picture'" :props="graphProps">
-                    </el-cascader>
-                    <el-cascader v-model="zoneTypeVal" :options="zoneTypeOption" @change="changeZoneType"
-                                 placeholder="请选择分区" class="item"
-                                 v-if="activeName==='picture'"></el-cascader>
+                    <template v-if="activeName==='table'">
+                        <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options"
+                                     v-model="building" filterable size="small"
+                                     @change="changeCascader" style="margin-right: 12px"
+                        ></el-cascader>
+                        <el-cascader v-model="zoneTypeValue" :options="zoneTypeOption" placeholder="请选择分区"
+                                     @change="changeZoneTypes"
+                                     class="item"></el-cascader>
+                        <admSearch @SearchValue="searchValue" class="item"/>
+                    </template>
+                    <template v-if="activeName==='picture'">
+                        <el-cascader clearable ref="graphCascader" placeholder="请选择建筑楼层" :options="graphOptions"
+                                     v-model="graphBuilding" filterable size="small"
+                                     @change="changeGraphCascader" style="margin-right: 12px" :props="graphProps">
+                        </el-cascader>
+                        <el-cascader v-model="zoneTypeVal" :options="zoneTypeOption" @change="changeZoneType"
+                                     placeholder="请选择分区" class="item"></el-cascader>
+                        <el-autocomplete popper-class="my-autocomplete" v-model="autoCompleteSearch"
+                                         :fetch-suggestions="querySearch"
+                                         placeholder="输入平面图中已有的业务空间名称进行查找" width="180" @select="handleSelect">
+                            <i class="el-icon-search el-input__icon" slot="suffix"></i>
+                            <template slot-scope="{ item }">
+                                <div class="name"
+                                     style="position: relative;padding-right:40px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"
+                                     :title="item.data.RoomLocalName">
+                                    {{ item.data.RoomLocalName }}
+                                    <span class="addr" style="position: absolute;right:0;color:#409EFF;">定位</span>
+                                </div>
+                            </template>
+                        </el-autocomplete>
+                        <div style="float:right;position: relative;">
+                            <div v-if="createDisable" class="createMask"></div>
+                            <el-dropdown split-button type="primary" @click="editGraphy" @command="handleCommand">
+                                创建空间
+                                <el-dropdown-menu slot="dropdown">
+                                    <!-- <el-dropdown-item command="groupCreateBSpace">批量创建业务空间</el-dropdown-item> -->
+                                    <el-dropdown-item command="createWall">创建墙体</el-dropdown-item>
+                                </el-dropdown-menu>
+                            </el-dropdown>
+                        </div>
+                    </template>
                 </div>
                 <div v-if="activeName==='table'" v-loading="loading" style="height: calc(100% - 100px);padding: 0 12px">
                     <template style="height: 100%;" v-if="building.length > 0">
@@ -42,7 +69,7 @@
                     </div>
                 </div>
                 <div class="graph" v-if="activeName==='picture'">
-                    <spaceGraph ref="spaceGraph"/>
+                    <spaceGraph @getZoneSuc="getZoneSuc" @initCreatBtn="initCreatBtn" ref="spaceGraph"/>
                 </div>
             </div>
         </div>
@@ -59,13 +86,13 @@
 </template>
 
 <script lang="ts">
-import { Component, Vue } from "vue-property-decorator";
-import { AdmMultiTable, AdmSearch, baseDataForm, Pagination, Statistics } from "../components/index";
+import {Component, Vue} from "vue-property-decorator";
+import {AdmMultiTable, AdmSearch, baseDataForm, Pagination, Statistics} from "../components/index";
 import spaceGraph from "./components/spaceGraph.vue";
-import { buildingQuery, dictQuery, floorQuery, queryCountSpace, queryZone, updateZone } from "@/api/datacenter";
+import {buildingQuery, dictQuery, floorQuery, queryCountSpace, queryZone, updateZone} from "@/api/datacenter";
 import tools from "@/utils/maintain";
-import { BeatchQueryParam } from "@/api/equipComponent";
-import { UserModule } from "@/store/modules/user";
+import {BeatchQueryParam} from "@/api/equipComponent";
+import {UserModule} from "@/store/modules/user";
 
 @Component({
     name: "adm-space",
@@ -90,6 +117,7 @@ export default class spaceIndex extends Vue {
     building = ["all"];
 
     zoneTypeVal = ["FunctionZone"];
+    zoneTypeValue = ["FunctionZone"];
     // 分页
     private paginationList = {
         page: 1,
@@ -102,19 +130,19 @@ export default class spaceIndex extends Vue {
     zoneTypeOption = [
         {
             value: "FunctionZone",
-            label: "功能分区",
+            label: "功能空间",
         },
         {
             value: "Zone",
-            label: "业务分区",
+            label: "业务空间",
             children: [
                 {
                     value: "FireZone",
-                    label: "防火空间",
+                    label: "防火分区",
                 },
                 {
                     value: "PowerSupplyZone",
-                    label: "供电空间",
+                    label: "供电分区",
                 },
             ],
         },
@@ -142,7 +170,13 @@ export default class spaceIndex extends Vue {
     currRowContent = {}
     // 弹窗开关
     dialogVisible = false
-    //
+    // 搜索
+    autoCompleteSearch = "";
+    // 业务空间列表
+    zoneList = []
+    // 禁用
+    createDisable = true
+
     // 项目id
     private get projectId(): string {
         return UserModule.projectId;
@@ -155,6 +189,58 @@ export default class spaceIndex extends Vue {
         this.changeCascader();
     }
 
+    // 业务空间下拉搜索
+    querySearch(queryString: string, cb: Function) {
+        let restaurants = this.zoneList;
+        let results = queryString
+            ? restaurants.filter(this.createFilter(queryString))
+            : restaurants;
+        // 调用 callback 返回建议列表的数据
+        cb(results);
+    }
+
+    // 过滤器
+    createFilter(queryString: any) {
+        return (restaurant: any) => {
+            return restaurant.data.RoomLocalName.indexOf(queryString) > -1;
+        };
+    }
+
+    // 查询选中,定位
+    handleSelect(zone: any) {
+        if (this.$refs.spaceGraph) {
+            this.$refs.spaceGraph.handleSelect(zone)
+        }
+    }
+
+    // 子组件中获取业务空间成功
+    getZoneSuc(list: []) {
+        this.zoneList = list
+    }
+
+    // 创建空间
+    editGraphy() {
+        if (this.$refs.spaceGraph) {
+            this.createDisable = true
+            this.$refs.spaceGraph.editGraphy()
+        }
+    }
+
+    // 下拉菜单
+    handleCommand(command: string) {
+        if (this.$refs.spaceGraph) {
+            this.createDisable = true
+            this.$refs.spaceGraph.handleCommand(command)
+        }
+    }
+
+    /**
+     * 初始化创建按钮
+     */
+    initCreatBtn(flag: boolean) {
+        this.createDisable = flag
+    }
+
     //查询统计数量
     dataCount() {
         queryCountSpace({}).then((res) => {
@@ -252,7 +338,7 @@ export default class spaceIndex extends Vue {
         const pa = {
             pageSize: 1000,
             orders: "localName asc",
-            cascade: [{ name: "floor", orders: "floorSequenceId desc" }],
+            cascade: [{name: "floor", orders: "floorSequenceId desc"}],
         };
         buildingQuery(pa).then((res) => {
             try {
@@ -281,7 +367,8 @@ export default class spaceIndex extends Vue {
         if (this.building.length > 0) {
             this.loading = true;
             let param = {
-                type: "FunctionZone",
+                // type: "FunctionZone",
+                type: this.zoneTypeValue[this.zoneTypeValue.length - 1],
                 orders: "sort asc, name desc",
                 pageNumber: 1,
                 pageSize: 1000,
@@ -289,24 +376,25 @@ export default class spaceIndex extends Vue {
             let param2 = {
                 // 级联查建筑楼层信息
                 cascade: [
-                    { name: "building" },
-                    { name: "floor", orders: "floorSequenceId desc" },
+                    {name: "building"},
+                    {name: "floor", orders: "floorSequenceId desc"},
                 ],
-                zoneType: "FunctionZone",
+                // zoneType: "FunctionZone",
+                zoneType: this.zoneTypeValue[this.zoneTypeValue.length - 1],
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime asc, localName asc, localId desc, id asc",
             };
-            let search = this.inputSearch ? `;localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'` : ''
+            let search = this.inputSearch ? `;localName contain '${this.inputSearch}' or localId contain '${this.inputSearch}'` : ''
             if (this.building.length === 1) {
                 param2.filters = "";
                 switch (this.building[0]) {
                     case "noKnow":
-                        param2.filters = `buildingId='isnull'${ search }`;
+                        param2.filters = `buildingId='isnull'${search}`;
                         break;
                     case "all":
                         if (this.inputSearch) {
-                            param2.filters = `localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`
+                            param2.filters = `localName contain '${this.inputSearch}' or localId contain '${this.inputSearch}'`
                         } else {
                             delete param2.filters;
                         }
@@ -315,14 +403,14 @@ export default class spaceIndex extends Vue {
             } else if (this.building.length === 2) {
                 switch (this.building[1]) {
                     case "noKnow":
-                        param2.filters = `buildingId='${ this.building[0] }';floorId='isnull'${ search }`;
+                        param2.filters = `buildingId='${this.building[0]}';floorId='isnull'${search}`;
 
                         break;
                     case "all":
-                        param2.filters = `buildingId='${ this.building[0] }'${ search }`;
+                        param2.filters = `buildingId='${this.building[0]}'${search}`;
                         break;
                     default:
-                        param2.filters = `buildingId='${ this.building[0] }';floorId='${ this.building[1] }'${ search }`;
+                        param2.filters = `buildingId='${this.building[0]}';floorId='${this.building[1]}'${search}`;
                 }
             }
 
@@ -369,7 +457,7 @@ export default class spaceIndex extends Vue {
 
                 this.headersStage = {
                     basicInfos: {
-                        name: "模型解析",
+                        name: "基础信息台账",
                         data: basicInfos,
                     },
                     dictStages: {
@@ -494,6 +582,12 @@ export default class spaceIndex extends Vue {
         this.toGraph();
     }
 
+    // 修改表格分区类型
+    changeZoneTypes() {
+        this.changeCascader();
+    }
+
+
     // 当前分页
     handleCurrentChange(val: number) {
         this.paginationList.page = val;
@@ -617,6 +711,15 @@ export default class spaceIndex extends Vue {
                 & > .item + .item {
                     margin-left: 16px;
                 }
+
+                .createMask {
+                    position: absolute;
+                    width: 100%;
+                    height: 100%;
+                    background: #ffffff80;
+                    cursor: not-allowed;
+                    z-index: 9;
+                }
             }
 
             .borderBottom {
@@ -651,5 +754,32 @@ export default class spaceIndex extends Vue {
     .el-select, .el-date-editor.el-input, .el-date-editor.el-input__inner {
         width: 100%;
     }
+
+    .el-autocomplete {
+        display: inline-block;
+        width: 320px;
+        margin-left: 12px;
+    }
+
+    .my-autocomplete {
+        li {
+            line-height: normal;
+            padding: 7px;
+
+            .name {
+                text-overflow: ellipsis;
+                overflow: hidden;
+            }
+
+            .addr {
+                font-size: 12px;
+                color: #b4b4b4;
+            }
+
+            .highlighted .addr {
+                color: #ddd;
+            }
+        }
+    }
 }
 </style>

+ 20 - 10
src/views/maintain/system/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="adm-system">
-        <statistics :statistics-msg="statisticsMsg" />
+        <statistics :statistics-msg="statisticsMsg"/>
         <div class="hr"></div>
         <div class="operation">
             <el-cascader :options="list" ref="floorCascader" clearable v-model="systemType" :props="optionProps"
@@ -27,16 +27,20 @@
                     />
                 </template>
                 <div v-else class="void align">
-                    <svg-icon :height="String(123)" :width="String(120)" name="void" />
+                    <svg-icon :height="String(123)" :width="String(120)" name="void"/>
                     <p class="void-title">暂无内容</p>
                     <p class="void-tips">可点击左上角选择系统类型</p>
                 </div>
             </div>
         </div>
         <!--        添加/编辑 系统-->
-        <el-dialog :title="systemMsg" :visible.sync="dialogVisible" @close="close">
+        <el-dialog
+            :title="systemMsg"
+            :width="!isWidth ? '20%':''"
+            :visible.sync="dialogVisible"
+            @close="close">
             <template v-if="next">
-                <div class="align" style="height: 400px">
+                <div class="align" :style="{ 'height': isWidth ? '400px':'200px' }">
                     <span class="text">系统类别</span>
                     <el-cascader :options="list" clearable v-model="systemVal"
                                  :props="optionProps"
@@ -77,7 +81,8 @@ export default class extends Vue {
         label: 'name',
         children: 'children'
     }
-
+    // 设置高度
+    isWidth = false
     // loading
     loading = false;
     // 下拉数据
@@ -117,6 +122,7 @@ export default class extends Vue {
     // 搜索内容
     inputSearch = "";
     systemHeaders = {}
+
     // 项目id
     get projectId(): string {
         return UserModule.projectId;
@@ -161,7 +167,7 @@ export default class extends Vue {
                 });
             }
         });
-        if (param.data.length >0 ) {
+        if (param.data.length > 0) {
             BeatchQueryParam(param).then((res) => {
                 this.tableData = data.map((item) => {
                     res.data.map((child) => {
@@ -222,6 +228,7 @@ export default class extends Vue {
     async handleNext() {
         if (this.systemVal[1]) {
             this.next = false
+            this.isWidth = true
             let param = {
                 type: this.systemVal[1],
                 orders: "sort asc, name desc",
@@ -258,6 +265,7 @@ export default class extends Vue {
             this.systemVal = ''
         }
         this.next = true;
+        this.isWidth = false
     }
 
     // 编辑当前行
@@ -271,7 +279,7 @@ export default class extends Vue {
 
     //信息点重组
     informationArrangement(arr: []): any {
-        let basicInfos = [{ path: "classification", name: "系统分类"}],
+        let basicInfos = [{ path: "classification", name: "系统分类" }],
             dictStages: any[] = [];
         this.all = arr;
         arr.forEach((item: any) => {
@@ -311,11 +319,11 @@ export default class extends Vue {
                 filters: this.systemType[1] ? `classCode='${ this.systemType[1] }'` : undefined,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
-                orders: "createTime asc, id asc",
+                orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.inputSearch != "") {
-                param2.filters = `localName contain '${this.inputSearch}' or localId contain '${this.inputSearch}'`;
+                param2.filters = `localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`;
             }
             let promise = new Promise((resolve) => {
                 dictQuery(param).then((res) => {
@@ -407,7 +415,8 @@ $border: 1px solid #e1e7ea;
     justify-content: center;
     flex-direction: column;
     flex-wrap: wrap;
-    .text{
+
+    .text {
         margin-right: 150px;
         margin-bottom: 10px;
     }
@@ -493,6 +502,7 @@ $border: 1px solid #e1e7ea;
     .el-select, .el-date-editor.el-input, .el-date-editor.el-input__inner {
         width: 100%;
     }
+
     .el-dialog__header {
         border-bottom: 1px solid #D8D8D8;
     }

+ 11 - 8
src/views/scene/tiepoint/components/equipTab/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="tab-content">
+    <div class="tab-content" >
         <div class="search">
             <el-cascader
                 :options="deviceOptions"
@@ -9,7 +9,7 @@
                 @change="handleChangeDevice"
                 class="item"
             ></el-cascader>
-            <admSearch @SearchValue="searchValue" class="item" />
+            <admSearch @SearchValue="searchValue" class="item"/>
             <el-upload
                 style="float: right"
                 action="https://jsonplaceholder.typicode.com/posts/"
@@ -38,7 +38,7 @@
                 />
             </template>
             <div v-else class="void align">
-                <svg-icon name="void" :width="String(120)" :height="String(123)" />
+                <svg-icon name="void" :width="String(120)" :height="String(123)"/>
                 <p class="void-title">暂无内容</p>
                 <p class="void-tips">可点击左上角筛选</p>
             </div>
@@ -46,7 +46,7 @@
         <!--编辑 设备-->
         <el-dialog title="编辑设备" :visible.sync="dialogVisible">
             <template>
-                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm" />
+                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm"/>
                 <span slot="footer" class="dialog-footer">
                     <el-button @click="dialogVisible = false">取消</el-button>
                     <el-button type="primary" @click="handleDataForm">完成</el-button>
@@ -75,6 +75,7 @@ import tools from "@/utils/maintain";
 export default class EquipTab extends Vue {
     // 信息点输入组组件
     @Ref("baseDataForm") readonly baseDataForm!: baseDataForm;
+
     // 项目id
     private get projectId(): string {
         return UserModule.projectId;
@@ -147,14 +148,14 @@ export default class EquipTab extends Vue {
                 category: this.deviceType,
             };
             let param2 = {
-                filters: `classCode='${this.deviceType}'`,
+                filters: `classCode='${ this.deviceType }'`,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.keyWord != "") {
-                param2.filters += `;codeName contain '${this.keyWord}' or systemCategory contain '${this.keyWord}' or bimTypeId contain '${this.keyWord}' or localId contain '${this.keyWord}'`;
+                param2.filters += `;codeName contain '${ this.keyWord }' or systemCategory contain '${ this.keyWord }' or bimTypeId contain '${ this.keyWord }' or localId contain '${ this.keyWord }'`;
             }
             let promise = new Promise((resolve) => {
                 dictInfo(param).then((res: any) => {
@@ -188,14 +189,14 @@ export default class EquipTab extends Vue {
         if (this.deviceType) {
             this.loading = true;
             let params = {
-                filters: `classCode='${this.deviceType}'`,
+                filters: `classCode='${ this.deviceType }'`,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.keyWord != "") {
-                params.filters += `;codeName contain '${this.keyWord}' or systemCategory contain '${this.keyWord}' or bimTypeId contain '${this.keyWord}' or localId contain '${this.keyWord}'`;
+                params.filters += `;codeName contain '${ this.keyWord }' or systemCategory contain '${ this.keyWord }' or bimTypeId contain '${ this.keyWord }' or localId contain '${ this.keyWord }'`;
             }
             const res = await queryEquip(params);
             if (res.result === "success") {
@@ -340,11 +341,13 @@ export default class EquipTab extends Vue {
 
     .search {
         padding: 12px;
+
         & > .item {
             margin-right: 12px;
         }
     }
 }
+
 // 数据暂未
 .align {
     height: 100%;

+ 1 - 1
src/views/scene/tiepoint/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="adm-tiepoint">
+    <div class="adm-tiepoint"style="display: none">
         <div class="tabs">
             <el-tabs v-model="activeName" type="card" @tab-click="tabChange">
                 <el-tab-pane label="设备" name="equip">