Parcourir la source

添加移动接口

shaun-sheep il y a 4 ans
Parent
commit
30a88d6c28

+ 2 - 2
public/systemConf.js

@@ -25,8 +25,8 @@ var __systemConf = {
     conf: {
         // 阿里云
         editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
-        // wandaBmGuideUrl: 'http://192.168.200.13:8090/wandaBmGuide/', //管理书地址
+        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        wandaBmGuideUrl: 'http://192.168.200.26:8090/wandaBmGuide/', //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 5 - 5
src/api/legendLibrary.js

@@ -93,12 +93,12 @@ 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 graphElementUpdate({
+//     postParams
+// }) {
+//     return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
 
-}
+// }
 
 // 业下设备分类和位置分类树形结构
 export function queryDeviceAndPOsition({

+ 32 - 23
src/views/legendLibrary/addLegend.vue

@@ -15,23 +15,7 @@
                 <el-button type='primary' @click='save' size='small'>确 定</el-button>
             </span>
         </el-dialog>
-        <!-- <Modal :show='dialogVisible' :title='title' mode='middle' @close='dialogVisible=false'>
-            <template #content>
-                <add-form
-                    ref='add'
-                    :InfosList='InfosList'
-                    :InfoTypeIdList='InfoTypeIdList'
-                    :ruleForm='info'
-                    @addSuccess='addSuccess'
-                    @updateSuccess='updateSuccess'
-                    :title='title'
-                />
-            </template>
-            <template #handle>
-                <Button @click='dialogVisible = false,cancal()' type='default'>取 消</Button>
-                <Button @click='save' type='primary'>确 定</Button>
-            </template>
-        </Modal>-->
+
         <TransferSelectModal
             defaultExpandAll
             default-expand-all
@@ -51,7 +35,7 @@
 <script>
 import addForm from './addForm'
 import addList from '../legendRules/addList'
-import { groupByCategory, updateRelation } from '@/api/legendLibrary.js'
+import { groupByCategory, updateRelation, queryRelation } from '@/api/legendLibrary.js'
 
 export default {
     data() {
@@ -76,7 +60,8 @@ export default {
             title: '',
             GraphCategoryId: 'DTXT',
             modalShow4: false,
-            treeData: []
+            treeData: [],
+            tableData: []
         }
     },
     components: { addForm, addList },
@@ -90,6 +75,12 @@ export default {
                     this.treeData = []
                     this.treeData = res.Data.map(i => this.getTree(i))
                 })
+                //获取图例列表
+                let postParams = this.GraphCategoryId
+                let data = {}
+                queryRelation({ data, postParams }).then(res => {
+                    this.tableData = res.data.Content
+                })
                 //treeSelect
                 this.modalShow4 = true
                 this.info = {
@@ -127,8 +118,7 @@ export default {
                 // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
                 this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id }) => id)] : []
                 this.InfoTypeIdList = row.InfoTypeId
-                console.log(this.InfosList, this.InfoTypeIdList)
-                console.log(this.info)
+
                 // 图例库规则中的transform
             } else if (title == '' && this.$refs.searchList) {
                 this.$refs.searchList.queryAll()
@@ -191,11 +181,30 @@ export default {
                 // }
             }
         },
+
         treeConfirm(ids, dataObj) {
+            let tableList = [],
+                list = [],
+                totalLst = []
+            dataObj.forEach(i => {
+                list.push({
+                    Id: i.id,
+                    name: i.name
+                })
+            })
+            tableList = [...list, ...this.tableData]
+            tableList.forEach((i, index) => {
+                totalLst.push({
+                    GraphElementId: i.Id,
+                    OrderId: index
+                })
+            })
+
             let postParams = {
-                GraphCategoryId: this.GraphCategoryId.join(' '),
-                GraphElementIds: ids
+                GraphCategoryId: this.GraphCategoryId[0],
+                GraphRelations: totalLst
             }
+            console.log(totalLst, 'list')
             updateRelation({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('添加成功!')

+ 3 - 0
src/views/legendLibrary/index.vue

@@ -471,6 +471,9 @@ export default {
             })
         },
         getTableList() {
+            if (this.GraphCategoryIds || this.InfoLocals || this.InfoSystems || this.keyword) {
+                this.currentPage = 1
+            }
             let postParams = {
                 Deleted: this.state == 1 ? false : true,
                 GraphCategoryIds: this.GraphCategoryIds.length ? this.GraphCategoryIds : undefined, //说明书位置

+ 22 - 10
src/views/legendRules/index.vue

@@ -77,7 +77,7 @@
 </template>
 <script>
 import addLegend from '../legendLibrary/addLegend'
-import { getLegendTree, queryRelation, deleteRelation, graphElementUpdate } from '@/api/legendLibrary.js'
+import { updateRelation, getLegendTree, queryRelation, deleteRelation } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend },
     data() {
@@ -163,38 +163,50 @@ export default {
                     break
             }
             function up() {
+                let list = []
                 if (index == 0) {
                     _this.$message.error('处于顶端,不可再上移')
                 } else {
                     let upDate = _this.tableData[index - 1]
                     _this.tableData.splice(index - 1, 1)
                     _this.tableData.splice(index, 0, upDate)
-                    let ids = _this.tableData.map(({ Id }) => Id)
-                    _this.upDateGraphy(ids)
+
+                    _this.tableData.forEach((i, index) => {
+                        list.push({
+                            GraphElementId: i.Id,
+                            OrderId: index
+                        })
+                    })
+                    _this.upDateGraphy(list)
                 }
             }
 
             function down() {
+                let list = []
                 if (index == _this.tableData.length - 1) {
                     _this.$message.error('处于底端,不可再下移')
                 } else {
                     let downDate = _this.tableData[index + 1]
                     _this.tableData.splice(index + 1, 1)
                     _this.tableData.splice(index, 0, downDate)
-                    let ids = _this.tableData.map(({ Id }) => Id)
-                    _this.upDateGraphy(ids)
+                    _this.tableData.forEach((i, index) => {
+                        list.push({
+                            GraphElementId: i.Id,
+                            OrderId: index
+                        })
+                    })
+                    _this.upDateGraphy(list)
                 }
             }
         },
         // 更新图例关系信息
-        upDateGraphy(ids) {
-            let posParams = {
+        upDateGraphy(list) {
+            let postParams = {
                 GraphCategoryId: this.GraphCategoryId[0],
-                GraphElementIds: ids,
-                Move: true
+                GraphRelations: list
             }
 
-            graphElementUpdate({ posParams }).then(res => {
+            updateRelation({ postParams }).then(res => {
                 this.getData()
             })
         },