Explorar o código

接口参数调整 甘特图显示调整

fujunwen %!s(int64=4) %!d(string=hai) anos
pai
achega
045cc04c1f

+ 20 - 16
src/utils/ganttChart/GanttChart_day.js

@@ -50,7 +50,7 @@ export function GanttChartDay(options) {
   // 当前视图开始时间,向前推N天
   // 当前视图开始时间,向前推N天
   this.startAt = moment().subtract(this.daysCount / 3, 'days');
   this.startAt = moment().subtract(this.daysCount / 3, 'days');
   this.endAt = moment(this.startAt).add(this.daysCount, 'days');
   this.endAt = moment(this.startAt).add(this.daysCount, 'days');
-  this.graphDiv = document.getElementById(options['chartContainer']);
+  this.graphDiv = document.getElementById(options['chartParentContainer']);
   // 图形容器组
   // 图形容器组
   this.graphGroup = null;
   this.graphGroup = null;
   // 上一次拖动的事件
   // 上一次拖动的事件
@@ -168,7 +168,7 @@ let lastClickAt = null;
  * 改变graphDiv 滚动距离
  * 改变graphDiv 滚动距离
  * 到达边界距离后,刷新页面
  * 到达边界距离后,刷新页面
  */
  */
-GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {  
+GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {
   if (sEvent == null) {
   if (sEvent == null) {
     sEvent = this.startEvent;
     sEvent = this.startEvent;
   }
   }
@@ -192,6 +192,7 @@ GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {
     this.offsetDis = this.viewWidth;
     this.offsetDis = this.viewWidth;
     this.pageTo('next');
     this.pageTo('next');
   }
   }
+  // console.log()
   this.graphDiv.scrollLeft = this.offsetDis;
   this.graphDiv.scrollLeft = this.offsetDis;
 }
 }
 
 
@@ -200,7 +201,7 @@ GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {
  */
  */
 GanttChartDay.prototype.initDragHandler = function() {
 GanttChartDay.prototype.initDragHandler = function() {
   this.graphDiv.scrollLeft = this.offsetDis;
   this.graphDiv.scrollLeft = this.offsetDis;
-  let _canvas = document.getElementsByTagName('canvas')[1];
+  let _canvas = this._canvas;
   _canvas.addEventListener('mousedown', (ev) => {
   _canvas.addEventListener('mousedown', (ev) => {
     this.draging = true;
     this.draging = true;
     this.startEvent = ev;
     this.startEvent = ev;
@@ -256,6 +257,7 @@ GanttChartDay.prototype.drawTimeZone = function() {
   console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
   console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
   let start = moment(this.startAt);
   let start = moment(this.startAt);
   let timeGroup = this.gCanvas.addGroup();
   let timeGroup = this.gCanvas.addGroup();
+  this.timeGroupEl = timeGroup
   timeGroup._tname = 'TimeGroup';
   timeGroup._tname = 'TimeGroup';
   // 绘制第一级
   // 绘制第一级
   timeGroup.addShape('text', {
   timeGroup.addShape('text', {
@@ -464,19 +466,21 @@ GanttChartDay.prototype.drawTasks = function() {
         taskGroup = this.graphGroup.addGroup();
         taskGroup = this.graphGroup.addGroup();
         taskGroup._tname = 'TaskGroup_' + topTask.id;
         taskGroup._tname = 'TaskGroup_' + topTask.id;
         topTask.gGroup = taskGroup;
         topTask.gGroup = taskGroup;
-  
-        // 组名背景矩形
-        let TopGroupRectEl = taskGroup.addShape('rect', {
-          attrs: {
-            x: 0,
-            y: topTask.renderOptions.startY,
-            width: this.cWidth,
-            height: this.taskRowHeight,
-            fill: '#F5F6F7',
-            radius: [2, 4],
-          },
-        });
-        TopGroupRectEl.setZIndex(-1)
+        
+        if (false) {
+          // 组名背景矩形
+          let TopGroupRectEl = taskGroup.addShape('rect', {
+            attrs: {
+              x: 0,
+              y: topTask.renderOptions.startY,
+              width: this.cWidth,
+              height: this.taskRowHeight,
+              fill: '#F5F6F7',
+              radius: [2, 4],
+            },
+          });
+          TopGroupRectEl.setZIndex(-1)
+        }
         // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
         // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
         topTask.dataList.forEach((taskP, index) => {
         topTask.dataList.forEach((taskP, index) => {
           let taskPGroup = taskGroup.addGroup()
           let taskPGroup = taskGroup.addGroup()

+ 14 - 12
src/utils/ganttChart/GanttChart_month.js

@@ -457,18 +457,20 @@ GanttChartMonth.prototype.drawTasks = function() {
         taskGroup._tname = 'TaskGroup_' + topTask.id;
         taskGroup._tname = 'TaskGroup_' + topTask.id;
         topTask.gGroup = taskGroup;
         topTask.gGroup = taskGroup;
   
   
-        // 组名背景矩形
-        let TopGroupRectEl = taskGroup.addShape('rect', {
-          attrs: {
-            x: 0,
-            y: topTask.renderOptions.startY,
-            width: this.cWidth,
-            height: this.taskRowHeight,
-            fill: '#F5F6F7',
-            radius: [2, 4],
-          },
-        });
-        TopGroupRectEl.setZIndex(-1)
+        if(false){
+          // 组名背景矩形
+          let TopGroupRectEl = taskGroup.addShape('rect', {
+            attrs: {
+              x: 0,
+              y: topTask.renderOptions.startY,
+              width: this.cWidth,
+              height: this.taskRowHeight,
+              fill: '#F5F6F7',
+              radius: [2, 4],
+            },
+          });
+          TopGroupRectEl.setZIndex(-1)
+        }
         // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
         // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...
         topTask.dataList.forEach((taskP, index) => {
         topTask.dataList.forEach((taskP, index) => {
           let taskPGroup = taskGroup.addGroup()
           let taskPGroup = taskGroup.addGroup()

+ 1 - 3
src/views/analysis/CoreDeviceReport.vue

@@ -172,7 +172,6 @@ import {
 } from "../../api/coreDeviceReport";
 } from "../../api/coreDeviceReport";
 import _ from "lodash";
 import _ from "lodash";
 import moment from "moment";
 import moment from "moment";
-import { log } from "util";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -290,7 +289,6 @@ export default {
     getEquipmentOfSystem() {
     getEquipmentOfSystem() {
       let param = {
       let param = {
         plazaId: this.plazaId,
         plazaId: this.plazaId,
-        ccode: 1002347
       };
       };
       if (this.systemId !== "") {
       if (this.systemId !== "") {
         param.smsxt = this.systemId;
         param.smsxt = this.systemId;
@@ -352,7 +350,7 @@ export default {
           return o.isActive;
           return o.isActive;
         }).category_code
         }).category_code
       };
       };
-      let url = `/data/sms_asset/query?plazaId=${this.plazaId}3&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`;
+      let url = `/data/sms_asset/query?plazaId=${this.plazaId}&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`;
       if (_.trim(this.searchKey) !== "") {
       if (_.trim(this.searchKey) !== "") {
         url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`;
         url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`;
       }
       }

+ 13 - 15
src/views/analysis/SpecificationUpdateRecord.vue

@@ -90,6 +90,8 @@ export default {
       let endTime = new Date(),
       let endTime = new Date(),
           startTime = new Date(endTime.getTime() - 1000*60*60*24*30);
           startTime = new Date(endTime.getTime() - 1000*60*60*24*30);
       this.timeVal = [startTime, endTime];
       this.timeVal = [startTime, endTime];
+      this.startTime = moment.unix(new Date(startTime).getTime() / 1000).format('YYYYMMDDHHmmss');
+      this.endTime = moment.unix(new Date(endTime).getTime() / 1000).format('YYYYMMDDHHmmss');
     },
     },
     /**
     /**
      * 获取事件类型
      * 获取事件类型
@@ -105,14 +107,16 @@ export default {
         const { result, data } = res;
         const { result, data } = res;
         if (result === 'success') {
         if (result === 'success') {
           let newData = [this.oraginIncidentList[0]];
           let newData = [this.oraginIncidentList[0]];
-          _.forEach(data.rpt_change_record.objtype, (item) => {
-            newData.push({
-              id: item.key,
-              name: _.find(this.oraginIncidentList, (o) => {return item.key === o.id}).name
+          if (!_.isEmpty(data)) {
+            _.forEach(data.rpt_change_record.objtype, (item) => {
+              newData.push({
+                id: item.key,
+                name: _.find(this.oraginIncidentList, (o) => {return item.key === o.id}).name
+              })
             })
             })
-          })
-          this.incidentList = newData;
-          this.getTableData();
+            this.incidentList = newData;
+            this.getTableData();
+          }
         }
         }
       })
       })
     },
     },
@@ -124,14 +128,8 @@ export default {
         page: this.curPage,
         page: this.curPage,
         size: this.pageSize,
         size: this.pageSize,
         plazaId: this.plazaId,
         plazaId: this.plazaId,
-        // changeDateStartDate: 20171027000000,
-        // changeDateEndDate: 20171028000000,
-      }
-      if (this.startTime !== '') {
-        param.changeDateStartDate = this.startTime;
-      }
-      if (this.endTime !== '') {
-        param.changeDateEndDate = this.endTime;
+        changeDateStartDate: this.startTime,
+        changeDateEndDate: this.endTime,
       }
       }
       if (this.incidentType !== 'all') {
       if (this.incidentType !== 'all') {
         param.objtype = this.incidentType;
         param.objtype = this.incidentType;