Procházet zdrojové kódy

1,优化冗余代码。
2,修复redmine分配的bug,未发现的bug

shaun-sheep před 5 roky
rodič
revize
bc7e59a81c

+ 0 - 1
src/components/echarts/reportDoughnut.vue

@@ -101,7 +101,6 @@ export default {
         }
       }
       this.myCharts = echarts.init(document.getElementById(this.id))
-      console.log(this.id,'----id-')
       this.myCharts.setOption(options)
     }
   },

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

@@ -158,7 +158,6 @@
         :isComputed="isComputed"
         :ManualMaintenance="ManualMaintenance"
         :TableVisibleMoreLoading="TableVisibleMoreLoading"
-        @template="templateDown"
         @openComputed="openComputed"
         @RelationType="RelationType"
     />
@@ -262,9 +261,7 @@
         }
         this.ManualMaintenance = relation
       },
-      templateDown() { //下载模板
-        this.$emit('template')
-      },
+
       openComputed(result) {
         this.$emit('openComputed', result)
       },

+ 14 - 55
src/components/relation/overview/Modal/RelationMaintain.vue

@@ -218,7 +218,7 @@
           value: 'lId',
           children: 'Items',
 
-        }, // 级联
+        },
         activities: [{
           content: '数据文件处理中..',
           size: 'large',
@@ -260,7 +260,6 @@
           projectId: this.projectId
         }
       },
-      //    末端数据添加disabled
       disOptions() {
         let arr = this.list.length && this.deepCopy(this.list).map(item => {
           item.Items.length && item.Items.map(i => {
@@ -280,42 +279,18 @@
         return JSON.parse(JSON.stringify(obj))
       },
       showCascader() {
-        this.$nextTick(() => {
-          ++this.isResouceShow
-          let allList = []
-          this.deepCopy(this.source).forEach(item => allList.push(...item.Items))
-          this.list = allList.map((item, index) => {
-            item = {
-              ...item,
-              lId: index
-            }
-            item.Items.map(i => {
-              i.lId = i.Id + i.BlockId //添加唯一标识
-              // i.Source = true //判断源末端
-              return i
-            })
-            return item
-          })
-          this.deepCopy(this.list).forEach(k => {
-            k.Items.forEach(j => {
-              if (j.isSource != null && j.isSource === true) {
-                this.ops.push([k.lId, j.lId])
-              }
-              if (j.isSource != null && j.isSource === false) {
-                this.filterOps.push([k.lId, j.lId])
-              }
+        ++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])
             })
           })
-          //末端
-          // this.filterOps = this.deepCopy(this.list).map(item => {
-          //   item.Items.length && item.Items.map(i => {
-          //     if (this.idArr.includes(i.lId)) {
-          //       i.disabled = true
-          //     }
-          //     return i
-          //   })
-          //   return item
-          // })
         })
       },
       downloadProject(str) {
@@ -336,7 +311,6 @@
       success(event, file, fileList) {
         this.dialogManualOption = true
         this.dialogProcess = true
-        console.log(event, file, fileList, ' file success')
 
       },
       error(event, file, fileList) {
@@ -350,29 +324,21 @@
         this.dialogProcess = false
         this.dialogManualOption = false
       },
-      templateDownload() {
-        this.$emit('template')
-      },
       promptly() {
         if (this.isComputed.IsAutomatic && !this.isComputed.IsSource) { //需要自动计算并且不需要配置云末端
-          console.log(this.isComputed.RelationType, 'this.isComputed.RelationType')
           this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
         }
         this.dialogTableVisible = false
       },
       sourceOptions(val) {
-        this.ops = val
+        // this.ops = val
         this.idArr = val.map(item => item[1])
-        //二级数据
-        this.secondary = []
         this.deepCopy(this.list).forEach(item => this.secondary.push(...item.Items))
-        //last filter
         let filterList = this.secondary.filter(item => this.idArr.includes(item.lId))
         //接口需要的数据格式
-        let result = []
         filterList.forEach(item => {
           let {BlockId, BuildingId, Domain, Id, MepSystemType, ProjectId, Type, Statistics} = item
-          result.push({
+          this.resultOrigin.push({
             BlockId,
             BuildingId,
             Domain,
@@ -385,21 +351,15 @@
             Statistics
           })
         })
-        this.resultOrigin = result
       },
       endOptions(val) {
         this.idArr = val.map(item => item[1])
-        //二级数据
-        this.secondary = []
         this.deepCopy(this.list).forEach(item => this.secondary.push(...item.Items))
-        //last filter
         let filterList = this.secondary.filter(item => this.idArr.includes(item.lId))
-        console.log(filterList, 'filterList-end')
         //接口需要的数据格式
-        let result = []
         filterList.forEach(item => {
           let {BlockId, BuildingId, Domain, Id, MepSystemType, ProjectId, Type, Statistics} = item
-          result.push({
+          this.resultEnd.push({
             BlockId,
             BuildingId,
             Domain,
@@ -412,7 +372,6 @@
             Statistics
           })
         })
-        this.resultEnd = result
       },
       computedUpdate() {
         if (!this.resultOrigin.length && !this.ops.length) {