浏览代码

'更换导入excel接口,滚动锚点实现'

shaun-sheep 5 年之前
父节点
当前提交
f1ccecc070

+ 2 - 1
config/index.js

@@ -18,7 +18,8 @@ module.exports = {
         }
       },
       '/api': {
-        target: 'http://192.168.20.236:8080',
+        // target: 'http://192.168.20.236:8080',
+        target: 'http://192.168.20.234:8080',
         changeOrigin: true,
         pathRewrite: {
           "^/api": "/"

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

@@ -71,10 +71,16 @@ export function sysDirection(param, success) {
 
 //************************无需配置源末端关系计算15种********************************//
 // 建筑下的业务空间
-export function businessSpaceAll(param, success) {
-  let {sclc_url, zone_time, proId} = param
-  let url = `/api/datacenter/relation-calc/${sclc_url}${zone_time ? +'/' + zone_time : ''}`
-  httpUtil.postJson(url, proId, success)
+export function businessSpaceAll(param) {
+  let {relation_type, zone_type, proId} = param
+  let userName = storage.get("user_name")
+  let ProjectId = localStorage.getItem("projectId")
+  return fetch({
+    method: 'POST',
+    url: `/api/datacenter/relation-calc/${relation_type}${zone_type ? +'/' + zone_type : ''}`,
+    data: proId,
+    headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName}
+  })
 }
 
 //************************数据转换********************************//

+ 8 - 8
src/components/business_space/table/equipTable.vue

@@ -104,7 +104,7 @@
                     code: "EquipXSpace"
                 }],
                 activeRelation: "EquipinSpace",
-                relationType: {
+                CalcUrl: {
                     "code": "GeneralZone",
                     "name": "默认分区",
                     "rel_type": "99"
@@ -133,7 +133,7 @@
                     secret: this.secret
                 };
                 this.isLoading = true
-                if (this.relationType.rel_type == 99 && this.activeRelation == "EquipinSpace") {
+                if (this.CalcUrl.rel_type == 99 && this.activeRelation == "EquipinSpace") {
                     this.dataChange(param);
                 } else {
                     this.getRlations()
@@ -174,13 +174,13 @@
             getRlations() {
                 this.isLoading = true
                 this.relType = 0
-                if (this.relationType.rel_type == 99) {
+                if (this.CalcUrl.rel_type == 99) {
                     this.relType = "1"
                 } else {
-                    if (this.relationType.rel_type > 9) {
-                        this.relType = (this.relationType.rel_type * 100).toString()
+                    if (this.CalcUrl.rel_type > 9) {
+                        this.relType = (this.CalcUrl.rel_type * 100).toString()
                     } else {
-                        this.relType = '0' + (this.relationType.rel_type * 100)
+                        this.relType = '0' + (this.CalcUrl.rel_type * 100)
                     }
                 }
                 let param = {
@@ -280,7 +280,7 @@
              */
             getData(data, type) {
                 this.activeRelation = "EquipinSpace"
-                this.relationType = type
+                this.CalcUrl = type
                 this.page = {
                     size: 50,
                     sizes: [10, 30, 50, 100, 150, 200],
@@ -307,7 +307,7 @@
                     secret: this.secret
                 };
                 this.isLoading = true
-                if (this.relationType.rel_type == 99) {
+                if (this.CalcUrl.rel_type == 99) {
                     this.dataChange(param);
                 } else {
                     this.getRlations()

+ 6 - 3
src/components/relation/overview/CardList.vue

@@ -136,10 +136,11 @@
         :source="source"
         ref="maintain"
         :isComputed="isComputed"
+        :ManualMaintenance="ManualMaintenance"
         :TableVisibleMoreLoading="TableVisibleMoreLoading"
         @template="templateDown"
         @openComputed="openComputed"
-        @CalcUrl="CalcUrl"
+        @RelationType="RelationType"
     />
   </div>
 
@@ -186,6 +187,7 @@
           downloadFile: ' 下载报告文件'
         },
         isComputed: {}, // 当前要计算的对象
+        ManualMaintenance:{},//手动编辑对象
       }
     },
     computed: {},
@@ -194,8 +196,8 @@
       explain() {
         // alert('explain click')
       },
-      CalcUrl() {
-        this.$emit('CalcUrl',this.isComputed.CalcUrl, this.isComputed.ZoneTime)
+      RelationType() {
+        this.$emit('RelationType',this.isComputed.RelationType, this.isComputed.ZoneType)
 
       },
       computed(relation) {
@@ -228,6 +230,7 @@
           this.values={...this.values,optionTips,lastTime}
           this.$refs.maintain.dialogManualOption = true
         }
+        this.ManualMaintenance = relation
       },
       templateDown() { //下载模板
         this.$emit('template')

+ 24 - 11
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -115,7 +115,8 @@
             <i class="iconfont icon-doc-line"/>
             {{values.currentNum}} 0
           </p>
-          <a href="/api/datacenter/graphic/template-downloads">
+          <!--          <a href="/api/datacenter/graphic/template-downloads">-->
+          <a :href="downloadProject('excel')">
             <el-button
                 type="primary"
                 class="mt-10"
@@ -133,6 +134,7 @@
           drag
           action="/api/datacenter/graphic/import"
           multiple
+          :show-file-list='false'
           name="file"
           :headers="headers"
           :data="dataId"
@@ -169,7 +171,7 @@
         </el-timeline>
       </div>
       <!--            下载报告-->
-      <a href="/api/datacenter//graphic/report-downloads">
+      <a :href="downloadProject('report')">
         <el-button>{{values.downloadFile}}</el-button>
       </a>
       <footer
@@ -193,7 +195,7 @@
 
   export default {
     name: "RelationMaintain",
-    props: ['values', 'isComputed', 'source', 'TableVisibleMoreLoading'],
+    props: ['values', 'isComputed', 'source', 'TableVisibleMoreLoading', 'ManualMaintenance'],
     created() {
 
     },
@@ -223,7 +225,7 @@
           icon: 'el-icon-check',
           color: '#0bbd87'
         }, {
-          content: '数据处理失败',
+          content: '数据处理成功',
           color: '#0bbd87',
           icon: 'el-icon-check',
           size: 'large',
@@ -242,9 +244,6 @@
     },
     computed:{
       ...mapGetters('layout', ['projectId']),
-      fileHeaders() {
-        return  {'Content-Type': 'multipart/form-data'}
-      },
       headers() {
         return {
           'ProjectId': this.projectId,
@@ -254,6 +253,8 @@
       },
       dataId() {
         return {
+          relType: this.ManualMaintenance.RelationType || '',
+          zoneType: this.ManualMaintenance.ZoneType || '',
           projectId:this.projectId
         }
       },
@@ -296,6 +297,18 @@
       deepCopy(obj) {
         return JSON.parse(JSON.stringify(obj))
       },
+      downloadProject(str) {
+        let relType = this.ManualMaintenance.RelationType ? `?relType=${this.ManualMaintenance.RelationType}` : ''
+        let zoneType = this.ManualMaintenance.ZoneType ? `&zoneType=${this.ManualMaintenance.ZoneType}` : ''
+        let url;
+        if (str === 'excel') {
+          relType = this.ManualMaintenance.RelationType ? `&relType=${this.ManualMaintenance.RelationType}` : ''
+          url = `/api/datacenter/graphic/export?code=对象ID${relType}${zoneType}`
+        } else {
+          url = `/api/datacenter/graphic/report-downloads${relType}${zoneType}`
+        }
+        return url
+      },
       progress(event, file, fileList) {
         // console.log(event.file, fileList)
       },
@@ -323,8 +336,8 @@
       },
       promptly() {
         if(this.isComputed.IsAutomatic && !this.isComputed.IsSource) { //需要自动计算并且不需要配置云末端
-          console.log(this.isComputed.CalcUrl,'this.isComputed.CalcUrl')
-          this.$emit('CalcUrl',this.isComputed.CalcUrl, this.isComputed.ZoneTime)
+          console.log(this.isComputed.RelationType, 'this.isComputed.RelationType')
+          this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
 
         }
         this.dialogTableVisible = false
@@ -337,7 +350,7 @@
         this.deepCopy(this.list).forEach(item => this.secondary.push(...item.Items))
         //最终过滤
         let filterList = this.secondary.filter(item => this.idArr.includes(item.lId))
-        //    组合成接口需要的数据格式
+        //组合成接口需要的数据格式
         let result = []
         filterList.forEach(item => {
           let {BlockId, BuildingId, Domain, Id, MepSystemType, ProjectId, Source, SourceId, Type, Statistics} = item
@@ -345,7 +358,7 @@
             BlockId,
             BuildingId,
             Domain,
-            // Id,
+            Id,
             MepSystemType,
             ProjectId,
             Source,

文件差异内容过多而无法显示
+ 1139 - 989
src/views/ready/collectsetting/index.vue


+ 14 - 8
src/views/relation/overview/index.vue

@@ -10,7 +10,7 @@
         @template="templateDown"
         @calcSpecial="calcSpecial"
         @openComputed="openComputed"
-        @CalcUrl="CalcUrl"
+        @RelationType="RelationType"
     />
   </div>
 </template>
@@ -124,7 +124,6 @@
           projectId: this.projectId
         }
         graphic(dataNumber, res => {
-
           graphicNumber(dataNumber, resCount => {
             this.countNumber = resCount.Content
             this.loading = false
@@ -132,8 +131,6 @@
             this.content = res.Content
           })
         })
-
-
       },
       transform(list1, list2) {
         let countInfo = {} // { GraphTypeName: { Id: count } }
@@ -159,15 +156,24 @@
           })
         })
       },
-      CalcUrl(sclc_url,zone_time) {
+      RelationType(relation_type,zone_type) {
         let param = {
-          sclc_url,
-          zone_time,
+          relation_type,
+          zone_type,
           proId: {
             projectId: this.projectId
           }
         }
-        businessSpaceAll(param, res => {
+        // businessSpaceAll(param, res => {
+        //
+        // })
+        businessSpaceAll(param).then(res=> {
+          if(res.data.Result === 'failure') {
+            this.$message({
+              message: '计算失败',
+              type: 'error'
+            })
+          }
         })
       },
       templateDown() { //下载模板