Browse Source

adm:feat > 总览接口替换,解决楼层修改时信息存储问题

shaun-sheep 4 years ago
parent
commit
60864be9e6

+ 10 - 9
src/api/relation/api.js

@@ -1,7 +1,7 @@
 import httpUtil from "../scan/httpUtil";
 import fetch from "../scan/fetch";
 import storage from '@/framework/utils/storage'
-import { baseUrl, graphicUrl, dataCenter, dictCustom } from "@/api/scan/config.js"
+import { baseUrl, graphicUrl, dataCenter, dictCustom } from "@/api/scan/config"
 
 
 //查询总览
@@ -77,7 +77,7 @@ export function sysDirection(param, success) {
 //************************无需配置源末端关系计算15种********************************//
 // 建筑下的业务空间
 export function businessSpaceAll(param) {
-  let {relation_type, zone_type, proId} = param
+  let { relation_type, zone_type, proId } = param
   let userName = storage.get("user_name")
   let ProjectId = localStorage.getItem("projectId")
   let objectTypes = zone_type ? "?objectTypes=" + zone_type : ''
@@ -85,19 +85,19 @@ export function businessSpaceAll(param) {
     method: 'POST',
     url: `${baseUrl}${dataCenter}/relation-calc/` + relation_type + objectTypes,
     data: proId,
-    headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName}
+    headers: { 'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName }
   })
 }
 
 //************************数据转换********************************//
 
-// 项目化字典-统计数量
+// 项目化字典-统计数量 修改过大小写
 export function dictCount(param, success) {
   let url = `${baseUrl}${dictCustom}/project-dict-count`
   httpUtil.postJson(url, param, success)
 }
 
-// 项目化字典-需补充转换规则数量
+// 项目化字典-需补充转换规则数量 修改过大小写
 export function dictSwitchCount(param, success) {
   let url = `${baseUrl}${dictCustom}/project-dict-switch-count`
   httpUtil.postJson(url, param, success)
@@ -112,7 +112,7 @@ export function dectInfo(param) {
     method: 'POST',
     url: `${baseUrl}${dictCustom}/project-dict-info`,
     data,
-    headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName}
+    headers: { 'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName }
   })
 }
 
@@ -141,11 +141,12 @@ export function dictUpdate(param, success) {
 }
 
 // 查询关系数据
-export function relQuery(param,success) {
+export function relQuery(param, success) {
   // let url = `${baseUrl}${dataCenter}/relation-manual-calc/rel-query`
   let url = `${baseUrl}${dataCenter}/rel-manual-calc/query`
-  httpUtil.postJson(url,param,success)
+  httpUtil.postJson(url, param, success)
 }
+
 //添加关系数据
 export function relAdd(data) {
   let userName = storage.get("user_name")
@@ -155,7 +156,7 @@ export function relAdd(data) {
     // url: `${baseUrl}${dataCenter}/relation-manual-calc/rel-add`,
     url: `${baseUrl}${dataCenter}/rel-manual-calc/add`,
     data,
-    headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName}
+    headers: { 'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName }
   })
 }
 

+ 4 - 4
src/components/relation/overview/CardList.vue

@@ -109,7 +109,7 @@
                     >
                       <el-button
                         @click="computed(relation)"
-                        :disabled="!relation.isSource && !relation.isAutomatic"
+                        :disabled="!relation.source && !relation.automatic"
                         circle
                         type="primary"
                         plain
@@ -141,7 +141,7 @@
                   <el-tooltip
                     content="设定设备对象源/末端"
                     placement="top"
-                    v-if="relation.isSource"
+                    v-if="relation.source"
                   >
                     <el-button
                       @click="equipment(relation)"
@@ -232,14 +232,14 @@
       },
       RelationType() {
         // this.cardDisabled = true
-        this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
+        this.$emit('RelationType', this.isComputed.relationType, this.isComputed.zoneType)
 
       },
       computed(relation) {
         this.isComputed = relation // 当前要计算的对象
         if (relation.relationType) {
           this.$emit('calcSpecial', relation)
-          if (relation.isSource) {
+          if (relation.source) {
             this.values.existComputed = `根据现有数据自动计算 <${relation.relationTypeName}>`
             this.$refs.maintain.dialogTableVisibleMore = true
             this.$refs.maintain.showCascader(relation)

+ 3 - 3
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -520,7 +520,7 @@
 
       promptly() {
 
-        if (this.isComputed.IsAutomatic && !this.isComputed.IsSource) { //需要自动计算并且不需要配置云末端
+        if (this.isComputed.automatic && !this.isComputed.source) { //需要自动计算并且不需要配置云末端
           this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
         }
         this.dialogTableVisible = false
@@ -588,8 +588,8 @@
         // this.$emit('openComputed', this.resultOrigin)
         this.dialogTableVisibleMore = false
         let params = {
-          ProjectId: this.projectId,
-          RelationType: this.isComputed.RelationType
+          projectId: this.projectId,
+          relationType: this.isComputed.relationType
         }
         calcSpecial(params, res => {
           this.$message.success('计算成功')

+ 1 - 1
src/views/ready/buildfloor/addFloor/index.vue

@@ -72,7 +72,7 @@ export default {
       let Param = {
         content: [newform]
       }
-      if (newform.FloorID) {
+      if (newform.id) {
         manageUpdateFloor(Param, res => {
           this.$message.success('更新成功')
           this.$emit('refresh')

+ 5 - 5
src/views/relation/data/index.vue

@@ -105,12 +105,12 @@
           projectId: this.projectId
         }
         dictCount(count, res => {
-          this.allCount = res.Count
+          this.allCount = res.count
         })
         //需要转换数量
         dictSwitchCount(count, res => {
-          this.replenishCount = res.Count
-          if (res.Count === 0) {
+          this.replenishCount = res.count
+          if (res.count === 0) {
             this.isDisabled = true
             return
           }
@@ -126,10 +126,10 @@
         //条件查询数量
         let filterCount = {
           projectId: this.projectId,
-          "Filters": "type!=1;dcCategory isnull"
+          "filters": "type!=1;dcCategory isnull"
         }
         dictCount(filterCount, res => {
-          this.filterCount = res.Count
+          this.filterCount = res.count
         })
         this.diss()
       },

+ 26 - 25
src/views/relation/overview/index.vue

@@ -49,8 +49,8 @@ export default {
         //                     GraphicId: 'ksaajdk',//图类型编码
         //                     Note: '边类型说明(待补充)',//说明
         //                     ConneObject: '项目→建筑体',//连接对象
-        //                     IsSource: true,//是否需要配置源末端
-        //                     IsAutomatic: true,//是否自动计算类型
+        //                     source: true,//是否需要配置源末端
+        //                     automatic: true,//是否自动计算类型
         //                     Manual: 2,//123选一个手动计算类型1禁用2提示引导3手动维护
         //                     Prompting: '【设备台账】,【系统台账】',//提示信息
         //                     ProjectId: 'Pj1245',//项目id
@@ -96,7 +96,8 @@ export default {
   computed: {
     ...mapGetters("layout", ["projectId"])
   },
-  mounted() {},
+  mounted() {
+  },
   components: { CardList },
   methods: {
     init() {
@@ -143,14 +144,14 @@ export default {
         }
       });
       changeList.length &&
-        changeList.forEach(item => {
-          let name = item.graphTypeName;
-          let rList = item.relationTypeProjectList;
-          rList.forEach(r => {
-            r.count = countInfo[name][r.id];
-            // this.$set(r, 'cardDisabled', false)
-          });
+      changeList.forEach(item => {
+        let name = item.graphTypeName;
+        let rList = item.relationTypeProjectList;
+        rList.forEach(r => {
+          r.count = countInfo[name][r.id];
+          // this.$set(r, 'cardDisabled', false)
         });
+      });
     },
     RelationType(relation_type, zone_type) {
       let param = {
@@ -161,19 +162,19 @@ export default {
         }
       };
       businessSpaceAll(param).then(res => {
-        if (res.data.Result === "failure") {
+        if (res.data.result === "failure") {
           this.$message({
             message: "计算失败",
             type: "error"
           });
         }
-      this.init();
+        this.init();
       });
       this.init();
     },
     calcSpecial(relation) {
       this.currentRelationTypeName = relation.RelationTypeName;
-      if (relation.IsSource) {
+      if (relation.source) {
         //配置云末端
         // this.TableVisibleMoreLoading = true//会很慢,加loading
         // let param = {
@@ -198,27 +199,27 @@ export default {
     openComputed(result) {
       let param = {
         // BuildingId: '',
-        Domain: "DomainPiping",
-        MepSystemType: "冷冻水供水管",
-        ProjectId: this.projectId,
-        SourceList: result
+        domain: "DomainPiping",
+        mepSystemType: "冷冻水供水管",
+        projectId: this.projectId,
+        sourceList: result
       };
       blockSource(param, res => {
         //覆盖源端数据
         //确定流向
         result.forEach(i => {
-          let { BlockId, BuildingId, Domain, Source } = i;
-          this.DataSorting(BlockId, BuildingId, Domain, Source);
+          let { blockId, buildingId, domain, source } = i;
+          this.DataSorting(blockId, buildingId, domain, source);
         });
       });
     },
-    DataSorting(BlockId, BuildingId, Domain, isSource) {
+    DataSorting(BlockId, BuildingId, Domain, source) {
       let param = {
-        BlockId,
-        Domain,
-        isSource,
-        BuildingId,
-        SystemName: this.currentRelationTypeName
+        blockId: BlockId,
+        domain: Domain,
+        source,
+        buildingId: BuildingId,
+        systemName: this.currentRelationTypeName
       };
       sysDirection(param, res => {
         this.init();