Browse Source

wanda-adm:feat > 面包屑,总览字段修改

shaun-sheep 3 years ago
parent
commit
aff5a65c3a

+ 1 - 7
src/api/datacenter.ts

@@ -149,13 +149,7 @@ export function relDel(postParams: any) {
 
 // 关系计算
 export function relationCalc(postParams: any) {
-    let url = "";
-    const { zoneType, relationType } = postParams
-    if (zoneType) {
-        url = `${ baseApi }/relation-calc/${ relationType }?objectTypes=${ zoneType }`
-    } else {
-        url = `${ baseApi }/relation-calc/${ relationType }?relationType=${ relationType }`
-    }
+    const url = `${ baseApi }/relation-calc${ postParams.requestUrl }?objectTypes=${ postParams.objectTypes }&graphCode=${ postParams.graphCode }&relType=${ postParams.relType }`
     return httputils.postJson(url, {})
 }
 

+ 1 - 1
src/api/httputils.ts

@@ -7,7 +7,7 @@ let cancel;
 
 // 创建axios实例
 const axiosservice = axios.create({
-    timeout: 30000, // 请求超时时间
+    timeout: 3000000, // 请求超时时间
     // @ts-ignore
     retry: 4, //重新请求次数
     retryDelay: 1000, //重新请求的间隔

+ 17 - 11
src/components/Breadcrumb/index.vue

@@ -38,8 +38,8 @@ export default class extends Vue {
         let matched = this.$route.matched.filter((item) => item.meta && item.meta.title);
         const first = matched[0];
         //针对关系模块添加面包屑
-        if(first) {
-        matched = this.relationModel(matched)
+        if (first) {
+            matched = this.relationModel(matched)
         }
 
         this.breadcrumbs = matched.filter((item) => {
@@ -51,15 +51,21 @@ export default class extends Vue {
      * 关系模块
      *
      */
-    relationModel(matched:any = []){
-        if(matched.length >= 2 && matched[1].path == '/maintain/relation'){
-            matched[2] = {
-              path: "/maintain/relationship",
-              meta:{
-                  title:this.$route.query.relationTypeName,
-                  hidden: true,
-              }
-            }
+    relationModel(matched: any = []) {
+        if (matched.length >= 2 && matched[1].path == '/maintain/relation') {
+            matched[1] = {
+                path: "/maintain/relationship",
+                meta: {
+                    title: '关系',
+                }
+            },
+                matched[2] = {
+                    path: "/maintain/relationship",
+                    meta: {
+                        title: this.$route.query.relationTypeName,
+                        hidden: true,
+                    }
+                }
         }
         return matched
     }

+ 8 - 8
src/views/maintain/relationship/index.vue

@@ -169,24 +169,24 @@ export default class extends Vue {
 
     computed(relation: object) {
         this.$set(relation, 'times', moment(Date.now()).format("YYYY-MM-DD HH:mm:ss"))
-        console.log(relation.relationType, relation.zoneType)
         if (relation.enableCalc == 0) { // 0 不可计算
             let param = {
                 graphCode: relation.graphicType,
                 relType: relation.relationType,
-                computedTime: moment(Date.now()).format("YYYY-MM-DD HH:mm:ss")
+                computingTime: moment(Date.now()).format("YYYY-MM-DD HH:mm:ss")
             }
             updateCalcTime(param).then(res => {
-                console.log(res)
+                this.init()
             })
         } else {
             let param = {
-                relationType: relation.relationType,
-                zoneType: relation.zoneType,
+                relType: relation.relationType,
+                objectTypes: relation.zoneType,
+                requestUrl: relation.requestUrl,
+                graphCode: relation.graphicType
             }
-            relationCalc(param).then(res => {
-                console.log(res)
-            })
+            relationCalc(param).then(res => {})
+            this.init()
         }
     }
 

+ 1 - 1
src/views/maintain/relationship/relation/components/addRelationDialog.vue

@@ -129,7 +129,7 @@ export default class extends Vue {
     // },
     {
       value: "id",
-      label: "设备ID",
+      label: "ID",
     },
     {
       value: "localId",