shaun-sheep 5 роки тому
батько
коміт
87b758207f

+ 6 - 2
src/api/relation/api.js

@@ -43,8 +43,12 @@ export function buildSpace(param, success) {
 
 
 // 管网系统设备分块 1
+// export function calcSpecial(param, success) {
+//   let url = ` /api/datacenter/calc_special/sys-block?Domain=${param.Domain}&SystemName=${param.SystemName}`
+//   httpUtil.postJson(url, param, success)
+// }
 export function calcSpecial(param, success) {
-  let url = ` /api/datacenter/calc_special/sys-block?Domain=${param.Domain}&SystemName=${param.SystemName}`
+  let url = ` /api/datacenter/calc_special/sys-block?relationType=${param.RelationType}`
   httpUtil.postJson(url, param, success)
 }
 
@@ -167,7 +171,7 @@ export function addSource(param, success) {
 
 //查看源设备
 export function sourceQuery(param, success) {
-  let url = '/api/datacenter//mep-system-calc/source/query'
+  let url = '/api/datacenter/mep-system-calc/source/query'
   httpUtil.postJson(url, param, success)
 
 }

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

@@ -241,7 +241,7 @@
           if (relation.IsSource) {
             this.values.existComputed = `根据现有数据自动计算 <${relation.RelationTypeName}>`
             this.$refs.maintain.dialogTableVisibleMore = true
-            this.$refs.maintain.showCascader()
+            this.$refs.maintain.showCascader(relation)
           } else {
             this.values.autoComputed = `根据现有数据自动计算 <${relation.RelationTypeName}>`
             this.$refs.maintain.dialogTableVisible = true

+ 41 - 20
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -29,7 +29,7 @@
       >
         <p class="font-big">{{values.existComputed}}</p>
         <p class="exist-title">{{values.existTitle}}</p>
-        <getCascader  :RelationTypeName="RelationTypeName"/>
+        <getCascader :RelationTypeName="RelationTypeName" :number="number"/>
         <!--        <el-row :span="24" style="margin-top: 10px">-->
         <!--          <el-col :span="8">-->
         <!--            <p class="demonstration">{{values.originEquipment}}</p>-->
@@ -181,6 +181,8 @@
           :on-progress="progress"
           :on-success="success"
           :on-error="error"
+
+
           accept="xlsx,xls"
       >
         <i class="el-icon-upload"/>
@@ -234,16 +236,19 @@
   import storage from '@/framework/utils/storage'
   import setCascader from "./setCascader";
   import getCascader from "./getCascader";
-  import {addSource} from "@/api/relation/api";
+  import {addSource, calcSpecial} from "@/api/relation/api";
 
   export default {
     name: "RelationMaintain",
     props: ['values', 'isComputed', 'source', 'TableVisibleMoreLoading', 'ManualMaintenance'],
     components: {setCascader,getCascader},
     created() {
-      this.showCascader()
+      // this.showCascader()
     },
     mounted() {
+      this.$nextTick(() => {
+        console.log(this.$refs.child1, '===')
+      })
     },
     data() {
       return {
@@ -291,8 +296,10 @@
         RelationTypeName: '',//卡片名称
         deviceGroup: [],
         deviceValue: '',
+        number: 0
       }
     },
+
     computed: {
       ...mapGetters('layout', ['projectId']),
       headers() {
@@ -345,24 +352,31 @@
           Content: this.sourceList
         }
         addSource(params, res => {
+          ++this.number
           this.$message.success('保存成功')
         })
         this.dialogEquipment = false
       },
-      showCascader() {
-        ++this.isResouceShow
-        let copy = this.deepCopy(this.source)
-        copy.forEach(item => {
-          item.Items.forEach(child => {
-            child.lId = this.list.length
-            this.list.push(child)
-            child.Items.forEach(i => {
-              i.lId = i.Id + i.BlockId
-              i.IsSource == true && this.ops.push([child.lId, i.lId])
-              i.IsSource == false && this.filterOps.push([child.lId, i.lId])
-            })
-          })
-        })
+      // showCascader() {
+      //   ++this.isResouceShow
+      //   let copy = this.deepCopy(this.source)
+      //   copy.forEach(item => {
+      //     item.Items.forEach(child => {
+      //       child.lId = this.list.length
+      //       this.list.push(child)
+      //       child.Items.forEach(i => {
+      //         i.lId = i.Id + i.BlockId
+      //         i.IsSource == true && this.ops.push([child.lId, i.lId])
+      //         i.IsSource == false && this.filterOps.push([child.lId, i.lId])
+      //       })
+      //     })
+      //   })
+      // },
+      showCascader(relation) {
+        this.RelationTypeName = relation.RelationTypeName
+        // this.$refs.getUpdate.getData()
+
+
       },
       downloadProject(str) {
         let relType = this.ManualMaintenance.RelationType ? `?relType=${this.ManualMaintenance.RelationType}` : ''
@@ -371,7 +385,7 @@
         if (str === 'excel') {
           relType = this.ManualMaintenance.RelationType ? `&relType=${this.ManualMaintenance.RelationType}` : ''
           // url = `/api/datacenter/graphic/export?code=对象ID${relType}${zoneType}`
-          if(zoneType) {
+          if (zoneType) {
             url = '/api/datacenter/graphic/export?code=对象ID' + relType + zoneType
 
           } else {
@@ -468,9 +482,16 @@
         //   this.dialogTableVisibleMore = false
         //
         // }
-        this.resultOrigin.push(...this.resultEnd)
-        this.$emit('openComputed', this.resultOrigin)
+        // this.resultOrigin.push(...this.resultEnd)
+        // this.$emit('openComputed', this.resultOrigin)
         this.dialogTableVisibleMore = false
+        let params = {
+          ProjectId: this.projectId,
+          RelationType: this.isComputed.RelationType
+        }
+        calcSpecial(params, res => {
+          this.$message.success('计算成功')
+        })
 
       },
     }

+ 6 - 0
src/components/relation/overview/Modal/getCascader.vue

@@ -54,6 +54,9 @@
       },
       RelationTypeName: {
         type: String
+      },
+      number: {
+        type: Number
       }
     },
     computed: {
@@ -85,6 +88,9 @@
       },
       RelationTypeName() {
         this.getData();
+      },
+      number() {
+        this.getData();
       }
     },
     methods: {

+ 4 - 2
src/components/relation/overview/Modal/setCascader.vue

@@ -52,7 +52,8 @@
       },
       RelationTypeName: {
         type: String
-      }
+      },
+
     },
     computed: {
       ...mapGetters("layout", ["projectId"])
@@ -82,7 +83,8 @@
       },
       RelationTypeName() {
         this.getData();
-      }
+      },
+
     },
     methods: {
       setValue(val) {

+ 0 - 1
src/views/relation/overview/index.vue

@@ -181,7 +181,6 @@
       calcSpecial(relation) {
         this.currentRelationTypeName = relation.RelationTypeName
         if (relation.IsSource) { //配置云末端
-          console.log(123)
           // this.TableVisibleMoreLoading = true//会很慢,加loading
           // let param = {
           //   BuildingId: '',