Browse Source

甘特图弹框调整

fujunwen 4 years ago
parent
commit
683ca484c5
1 changed files with 40 additions and 4 deletions
  1. 40 4
      src/views/analysis/GanttChart.vue

+ 40 - 4
src/views/analysis/GanttChart.vue

@@ -48,14 +48,14 @@
               <PlanTime class="icon" />
               <div class="title">计划时间</div>
             </div>
-            <div class="info">2020.05.02 09:00-2020.05.30 12:00</div>
+            <div class="info">{{this.ganttDetail.planTime}}</div>
           </div>
           <div class="row">
             <div>
               <RealTime class="icon" />
               <div class="title">实际执行时间</div>
             </div>
-            <div class="info">2020.05.02 09:00-</div>
+            <div class="info">{{this.ganttDetail.realTime}}</div>
           </div>
           <div class="row picture">
             <div>
@@ -112,7 +112,7 @@
 
 <script>
 import { queryGanttChart, queryGanttDetail } from '../../api/ganttChart';
-import { querySystemList } from '../../api/coreDeviceReport';
+import { querySystemList, queryDetailData } from '../../api/coreDeviceReport';
 import { Tree } from 'meri-design';
 import _ from 'lodash';
 import moment from 'moment';
@@ -150,6 +150,7 @@ export default {
         {id: 1, imgSrc: require('../../assets/imgs/analysis/report_pdf.png'), title: '2019年5月高压用具检测报告.pdf'},
         {id: 2, imgSrc: require('../../assets/imgs/analysis/report_word.png'), title: '2019年5月高压用具检测报告.docx'},
       ], // 报告
+      ganttDetail: {}, // 甘特图明细
       tableData: [], // 表数据
     }
   },
@@ -301,6 +302,8 @@ export default {
       this.showDetail = true;
       this.detailTitle = task._pdata.description;
       this.getGanttDetailData();
+      this.getPictureOrReportData(0);
+      this.getPictureOrReportData(1);
     },
     /**
      * 获取甘特图详情
@@ -313,6 +316,39 @@ export default {
       }
       queryGanttDetail('/data/base/queryGanttChartDetails', param).then((res) => {
         console.log('res', res)
+        const { result, data } = res;
+        if (result === 'success') {
+          const { status, planStartDate, planEndDate, realStartDate, realEndDate } = data;
+          let newData = {
+            status,
+            color: '',
+            planTime: this.dealDetailTime(planStartDate, planEndDate),
+            realTime: this.dealDetailTime(realStartDate, realEndDate)
+          }
+          console.log('newData', newData)
+          this.ganttDetail = newData;
+        }
+      })
+    },
+    /**
+     * 处理时间
+     */
+    dealDetailTime(startTime, endTime) {
+      let start = moment.unix(startTime / 1000).format('YYYY.MM.DD HH:mm:ss'),
+          end = moment.unix(endTime / 1000).format('YYYY.MM.DD HH:mm:ss');
+      return `${start}-${end}`
+    },
+    /**
+     * 获取甘特图的图片/报告详情
+     */
+    getPictureOrReportData() {
+      let param = {
+        file_type: 1,
+        file_type_id: 1985,
+        type: 0
+      }
+      queryDetailData('/data/base/queryFileDetails', param).then((res) => {
+        console.log('photo', res)
       })
     }
   }
@@ -439,7 +475,6 @@ export default {
         font-size: 14px;
         line-height: 22px;
         font-weight: 400;
-        cursor: pointer;
       }
       .num{
         margin-right: 22px;
@@ -447,6 +482,7 @@ export default {
       }
       .more{
         color: #025BAA;
+        cursor: pointer;
       }
     }
     .pictrue-container{