Jelajahi Sumber

添加上下移动接口

shaun-sheep 4 tahun lalu
induk
melakukan
cb33c958be
3 mengubah file dengan 27 tambahan dan 9 penghapusan
  1. 2 1
      public/systemConf.js
  2. 7 0
      src/api/legendLibrary.js
  3. 18 8
      src/views/legendRules/index.vue

+ 2 - 1
public/systemConf.js

@@ -26,7 +26,8 @@ var __systemConf = {
         // TODO: 修改为对应的地址
         // 开发环境地址 ip+port
         editerUrl: 'http://192.168.200.1:8091/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://192.168.200.1:8090/wandaBmGuide/', // 管理书地址
+        // wandaBmGuideUrl: 'http://192.168.200.1:8090/wandaBmGuide/', // 管理书地址
+        wandaBmGuideUrl: 'http://192.168.200.100:8090/wandaBmGuide/', // 管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 7 - 0
src/api/legendLibrary.js

@@ -94,6 +94,13 @@ export function graphElementSearch({
     return httputils.postJson(`/serve/topology-wanda/graphElement/search`, postParams)
 
 }
+// 更新图例关系信息
+export function graphElementUpdate({
+    postParams
+}) {
+    return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
+
+}
 
 // 业下设备分类和位置分类树形结构
 export function queryDeviceAndPOsition({

+ 18 - 8
src/views/legendRules/index.vue

@@ -67,7 +67,7 @@
 </template>
 <script>
 import addLegend from '../legendLibrary/addLegend'
-import { getLegendTree, queryRelation, deleteRelation } from '@/api/legendLibrary.js'
+import { getLegendTree, queryRelation, deleteRelation, graphElementUpdate } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend },
     data() {
@@ -135,10 +135,6 @@ export default {
         }
     },
     methods: {
-        /**
-         * 点击工具栏按钮回调方法
-         * @param {Object} Obj {tool:{icon:'icon组件名称',name:'按钮名称',type:'icon组件type'},item:当前行数据}
-         */
         buttonClickHandle(obj) {
             let index = Number(obj.item.index.split('-')[1])
             let _this = this
@@ -161,6 +157,8 @@ export default {
                     _this.tableData.splice(index - 1, 1)
                     _this.tableData.splice(index, 0, upDate)
                 }
+                let ids = _this.tableData.map(({ Id }) => Id)
+                _this.upDateGraphy(ids)
             }
 
             function down() {
@@ -171,15 +169,27 @@ export default {
                     _this.tableData.splice(index + 1, 1)
                     _this.tableData.splice(index, 0, downDate)
                 }
+                let ids = _this.tableData.map(({ Id }) => Id)
+                _this.upDateGraphy(ids)
             }
         },
+        // 更新图例关系信息
+        upDateGraphy(ids) {
+            let posParams = {
+                GraphCategoryId: this.GraphCategoryId[0],
+                GraphElementIds: ids,
+                Move: true
+            }
+            graphElementUpdate({ posParams }).then(res => {
+                this.getData()
+            })
+        },
 
         handleNodeClick(data, e) {
             this.GraphCategoryId = [e.node.eventKey]
             this.getData()
         },
         deleteClick(row) {
-            console.log(row)
             let postParams = [
                 {
                     GraphCategoryId: this.GraphCategoryId[0],
@@ -268,8 +278,8 @@ export default {
         flex: 1;
         display: flex;
         .legend-rules-left {
-            width: 288px;
-            padding: 26px;
+            // width: 288px;
+            // padding: 26px;
         }
         .legend-rules-right {
             padding: 16px;