YaolongHan 4 vuotta sitten
vanhempi
commit
e52a795228

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.22",
-    "@saga-web/big": "1.0.83",
+    "@saga-web/big": "1.0.84",
     "@saga-web/draw": "2.1.102",
     "@saga-web/feng-map": "1.0.25",
-    "@saga-web/graph": "2.1.111",
+    "@saga-web/graph": "2.1.112",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 11 - 7
src/components/baseEditer.vue

@@ -90,7 +90,7 @@ export default {
     // 自动保存(时间差为一分钟)
     this.autoSave = setInterval(() => {
       this.saveMsgNoMessage();
-    }, 10000);
+    }, 60000);
   },
   methods: {
     init() {
@@ -256,15 +256,19 @@ export default {
             // 设置锚点
             if (t.anchor1ID) {
               const startAnc = itemMap[t.anchor1ID];
-              startAnc.isConnected = true;
-              startAnc.parent?.connect("changePos", t, t.changePos);
-              t.startAnchor = startAnc || null;
+              if (startAnc) {
+                startAnc.isConnected = true;
+                startAnc.parent?.connect("changePos", t, t.changePos);
+                t.startAnchor = startAnc || null;
+              }
             }
             if (t.anchor2ID) {
               const endAnc = itemMap[t.anchor2ID];
-              endAnc.isConnected = true;
-              endAnc.parent?.connect("changePos", t, t.changePos);
-              t.endAnchor = endAnc || null;
+              if (endAnc) {
+                endAnc.isConnected = true;
+                endAnc.parent?.connect("changePos", t, t.changePos);
+                t.endAnchor = endAnc || null;
+              }
             }
           });
         }

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

@@ -117,8 +117,8 @@
           <div class="row-tit">显示名称</div>
           <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
         </div>
-        <div class="row">
-          <a-textarea :disabled="type == 'Line'"
+        <div :class="['row' ,type == 'Line'?'disabled-textarea':'']">
+          <a-textarea :disabled="type == 'Line' "
                   placeholder=""
                   v-model="lengedName"
                   allow-clear
@@ -718,6 +718,11 @@ export default {
 </script>
 
 <style scoped lang="less">
+  .disabled-textarea{
+    /deep/ .ant-input{
+      resize: none;
+    }
+  }
 /deep/ .ant-spin-nested-loading {
   height: 100% !important;
   .ant-spin-container {

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

@@ -53,8 +53,11 @@
 
                     </div>
                 </div>
-                <div class="tree">
+                <div class="tree" >
+                    <a-spin :spinning="spinning">
+                    <a-input-search placeholder="请输入关键字" v-if="majorId||sysId" style="width: 235px;margin: 10px 10px;"  v-model="selectVal"  @search="onSearchTree" />
                     <Tree @change="getTreeId" :data="treeData"/>
+                    </a-spin>
                 </div>
                 <div class="checkbox">
                     <a-table :pagination="false" :row-key='typeEdit=="Zone"?"location":"assetnum"'
@@ -113,6 +116,7 @@
         },
         data() {
             return {
+                spinning:false,
                 loading: false,
                 visible: false,
                 model: 'test1',
@@ -181,6 +185,8 @@
                 arrList: [],
                 selectList: [],
                 typeEdit: '',
+                selectVal:'',
+                sysId:''
             }
         },
         watch: {
@@ -188,6 +194,17 @@
                 if (val == '') {
                     this.queryGlsmsasset();
                 }
+            },
+            selectVal(val){
+                if(val==''){
+                    if(this.sysId!=''){
+                        this.getQuerySmsxtBy(this.sysId, this.typeEdit)
+                    }else{
+                        this.getQuerySmsxtBy(this.majorId,'Image')
+                    }
+
+                }
+
             }
         },
         methods: {
@@ -245,8 +262,10 @@
             },
             handleChange(val) {
                 console.log(val);
+                this.selectVal='';
                 this.tableData = [];
                 this.typeEdit = val.type;
+                this.sysId = val.id;
                 this.getQuerySmsxtBy(val.id, val.type)
             },
             handleMajor(val) {
@@ -260,6 +279,43 @@
                 console.log(e)
             },
             //获取treeId --classstructureid
+            onSearchTree(val){
+                let arr = [];
+                const reg = new RegExp(val, 'g');
+                let flag= false;
+              if(this.typeEdit=='Zone'){
+                  this.treeData.map((item)=>{
+                      if(item.name.indexOf(val)!=-1){
+                          item.name=item.name.replace(reg, `<span style="color:#F96600">${val}</span>`);
+                          arr.push(item)
+                      }
+                  });
+
+              }
+                if(this.typeEdit=='Image'){
+                    console.log(this.treeData);
+                    this.treeData.map(item=>{
+                        if(item.name.indexOf(val)!=-1){
+                            item.name=item.name.replace(reg, `<span style="color:#F96600">${val}</span>`);
+                            arr.push(item)
+                        }else{
+                            item.children.map(item1=>{
+                                if(item1.name.indexOf(val)!=-1){
+                                    flag = true;
+                                    item.open=true;
+                                    item1.name=item1.name.replace(reg, `<span style="color:#F96600">${val}</span>`);
+                                }
+                            })
+                            if(flag){
+                                arr.push(item)
+                            }
+                        }
+
+                    })
+
+                }
+                this.treeData = arr;
+            },
             getTreeId(id) {
                 if (this.typeEdit == 'Image') {
                     this.classstructureid = id.id;
@@ -430,11 +486,14 @@
             },
             // 获取设备大类下的分类和位置大类下的分类
             getQuerySmsxtBy(smsxt, type) {
+
                 if (type == 'Image') {
                     const data = {
                         smsxt: smsxt
                     }
+                    this.spinning = true
                     getQuerySmsxtBy(data, {}).then(res => {
+                        this.spinning = false;
                         if (res.result == 'success') {
                             if (res.data) {
                                 const data = res.data;
@@ -475,12 +534,16 @@
                         } else {
                             this.$message.error('获取失败');
                         }
+                    }).catch(()=>{
+                        this.spinning = false;
                     })
                 } else if (type == 'Zone') {
                     const data = {
                         dl: smsxt
                     }
+                    this.spinning = true
                     queryWzflByDl(data, {}).then(res => {
+                        this.spinning = false;
                         if (res.result == 'success') {
                             if (res.data) {
                                 const data = res.data;
@@ -498,6 +561,8 @@
                         } else {
                             this.$message.error('获取失败');
                         }
+                    }).catch(()=>{
+                        this.spinning = false;
                     })
                 }
 
@@ -508,6 +573,7 @@
             //如果有专业就带过来
             console.log(this.getmajorId);
             if (this.getmajorId) {
+                this.typeEdit = 'Image';
                 this.getQuerySmsxtBy(this.getmajorId, 'Image')
             }
             if (this.attrCards.length) {

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

@@ -304,7 +304,7 @@ export default {
       items.isChoice = true;
       this.$emit("setCmdType", items.type);
     },
-    showDrawer(item) {
+   async showDrawer(item) {
       this.showDrawerItem = item;
       this.isExtract = false;
       if (item.isChoice) {
@@ -327,16 +327,14 @@ export default {
           GraphCategoryIds: this.categoryId,
           Type: item.type
         };
-
-        queryGroup(data).then(res => {
+      await  queryGroup(data).then(res => {
           this.itemList = res.Data;
         });
         const arr = {
           InfoSystems: this.categoryIdS,
           Type: item.type
         };
-
-        graphElementGroup(arr).then(res => {
+       await graphElementGroup(arr).then(res => {
           this.spinning = false;
           res.Data.map(item => {
             this.itemList.push(item);

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

@@ -1261,32 +1261,42 @@ export class EditScence extends SGraphScene {
         let minAnchor = null;
         let len: number = -1;
         this.Nodes.forEach(image => {
-            image.showAnchor = false;
+            // image.showAnchor = false;
             if (image.anchorList && image.anchorList.length) {
-                image.anchorList.forEach(anchor => {
-                    let anchorPoint = anchor.mapToScene(0, 0);
-                    let dis = SMathUtil.pointDistance(
-                        event.x,
-                        event.y,
-                        anchorPoint.x,
-                        anchorPoint.y
-                    );
-                    if (len < 0) {
-                        len = anchor.sceneDis;
-                    }
-                    if (dis < len) {
-                        minAnchor = anchor;
-                        len = dis;
-                    }
-                })
+                let scenePoint = image.mapFromScene(event.x, event.y);
+                if (image.contains(scenePoint.x, scenePoint.y)) {
+                    image.anchorList.forEach(anchor => {
+                        let anchorPoint = anchor.mapToScene(0, 0);
+                        let dis = SMathUtil.pointDistance(
+                            event.x,
+                            event.y,
+                            anchorPoint.x,
+                            anchorPoint.y
+                        );
+                        // let dis = SMathUtil.pointDistance(
+                        //     scenePoint.x,
+                        //     scenePoint.y,
+                        //     anchorPoint.x,
+                        //     anchorPoint.y
+                        // );
+                        console.log(dis)
+                        if (len < 0) {
+                            len = anchor.sceneDis;
+                        }
+                        if (dis < len) {
+                            minAnchor = anchor;
+                            len = dis;
+                        }
+                    })
+                }
             }
         })
         console.log('-----------------------')
         console.log(minAnchor)
         console.log('-----------------------')
-        if (minAnchor&&minAnchor.parent) {
-            minAnchor.parent.showAnchor = true
-        }
+        // if (minAnchor&&minAnchor.parent) {
+        //     minAnchor.parent.showAnchor = true
+        // }
         return minAnchor;
     }