Jelajahi Sumber

xxd 合并代码

fujunwen 4 tahun lalu
induk
melakukan
d32dff86cb

+ 9 - 2
src/App.vue

@@ -21,8 +21,11 @@ export default {
     };
   },
   mounted() {
+    const state = this.$store.state;
+    sessionStorage.setItem("STATE", JSON.stringify(state));
     // 监听页面刷新事件
     window.addEventListener("unload", this.unload);
+
     // 页面加载完成后,移除session里的存储的信息
     window.addEventListener("load", this.load);
     // 请求该项目下的楼层数据
@@ -34,10 +37,14 @@ export default {
   methods: {
     ...mapActions(["getfmapID"]),
     ...mapMutations(["SETHAVEFENGMAP"]),
+    load () {
+      const state = this.$store.state;
+      sessionStorage.setItem("STATE", JSON.stringify(state));
+    },
     unload() {
       // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
-      const state = this.$store.state;
-      sessionStorage.setItem("state", JSON.stringify(state));
+       sessionStorage.clear()
+      
     },
     mounted() {
         // 监听页面刷新事件

+ 14 - 0
src/api/specificationUpdateRecord.js

@@ -1,6 +1,20 @@
 // 说明说更新记录 接口
 import httputils from "@/api/httputils";
 
+/**
+ * 获取事件类型
+ * @param {*} url 
+ * @param {*} param 
+ */
+export function queryEventypes(url, param) {
+  return httputils.postJson(url, param);
+}
+
+/**
+ * 获取表数据
+ * @param {*} url 
+ * @param {*} param 
+ */
 export function getSpecificaltionData(url, param) {
   return httputils.getJson(url, param);
 }

src/assets/images/图标/提示.png → src/assets/images/icons/notice.png


TEMPAT SAMPAH
src/assets/images/图标/notice.png


+ 0 - 5
src/router/index.js

@@ -5,11 +5,6 @@ import { query } from '@/utils/query'
 
 Vue.use(VueRouter)
 const routes = [
-    //登陆页面
-    // {
-    //     path: '/',
-    //     redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
-    // },
     {
         path:'/group',
         component: () => import('../views/statistics/index')

+ 3 - 1
src/store/index.js

@@ -122,6 +122,9 @@ export default new Vuex.Store({
         STOREACCESSLEVEL(state, data) {
             state.accessLevel = data
         },
+        STOREPLAZAID(state, id) {
+            state.plazaId = id
+        }
     },
     actions: {
         // 获取项目列表、userId
@@ -131,7 +134,6 @@ export default new Vuex.Store({
                 console.log(res)
                 if (res.result === 'success') {
                     commit('STOREACCESSLEVEL', res.level)
-                    console.log("res.level", res.level)
                     let level = res.level
                     if (level === 0) {
                         router.push({ path: './home/homepage' })

+ 73 - 45
src/utils/ganttChart/GanttChart_day.js

@@ -1,5 +1,9 @@
 import moment from 'moment';
 /**
+ * 数据定义区域
+ *
+ */
+/**
  * 甘特图
  * @param {} options 
  */
@@ -24,7 +28,7 @@ export function GanttChartDay(options) {
   // 拖动过程事件
   this.dragingEvent = null;
   // 拖动偏移量
-  this.offsetDis = (options['viewWidth']/2) || 800;
+  this.offsetDis = options['viewWidth'] || 800;
   // 拖动定时器
   this.dragTimer = null;
   // 每天的间隔宽度
@@ -39,14 +43,14 @@ export function GanttChartDay(options) {
   this.daysCount = options['daysCount'] || 60;
   // 任务图距离顶部高度
   this.graphTopDis = 60
-  
+  // 任务矩形最小宽度
+  this.minTaskRectWidth = 5
   // 每像素代表的小时数
   this.timePerPix = this.cWidth/this.daysCount/24/3600
   // 当前视图开始时间,向前推N天
   this.startAt = moment().subtract(this.daysCount / 3, 'days');
   this.endAt = moment(this.startAt).add(this.daysCount, 'days');
-  this.graphDiv = document.getElementById(options['chartParentContainer']);
-  this.chartContainer = options['chartContainer']
+  this.graphDiv = document.getElementById(options['chartContainer']);
   // 图形容器组
   this.graphGroup = null;
   // 上一次拖动的事件
@@ -66,6 +70,7 @@ export function GanttChartDay(options) {
  */
 GanttChartDay.prototype.changeTasks = function(_tasks){
   this.tasks = _tasks
+  this.forceRefreshGraph()
 }
 
 /**
@@ -113,12 +118,12 @@ GanttChartDay.prototype.processData = function() {
 
 /**
  * 强制清空图像,重绘
+ * keepTimeZone 表示保持当前时间状态
  */
-GanttChartDay.prototype.forceRefreshGraph = function() {
+GanttChartDay.prototype.forceRefreshGraph = function(keepTimeZone = false) {
   this.tasks.forEach((topTask) => {
     topTask.gGroup = null;
   });
-  this.todayTimeLineEl = null
   this.gCanvas.destroy();
   this.initDrawingReady();
 }
@@ -128,13 +133,11 @@ GanttChartDay.prototype.forceRefreshGraph = function() {
  */
 GanttChartDay.prototype.initDrawingReady = function() {
   this.initCanvas();
-  setTimeout(() => {
-    this.initDragHandler();
-    this.drawTimeZone();
-    this.processData();
-    this.drawTasks();
-    this.graphGroup = null
-  }, 200);
+  this.initDragHandler();
+  this.drawTimeZone();
+  this.processData();
+  this.drawTasks();
+  this.graphGroup = null
 }
 
 /**
@@ -183,7 +186,7 @@ GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {
     this.offsetDis = this.viewWidth;
     this.pageTo('prev');
   }
-  if ((this.offsetDis - 20) >= this.viewWidth*2.2 ){ //cWidth - viewWidth) {
+  if (this.offsetDis - 20 >= 2964 ){ //cWidth - viewWidth) {
     // 向后滑动,向后翻页
     console.log('此处应该向后翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
     this.offsetDis = this.viewWidth;
@@ -197,7 +200,7 @@ GanttChartDay.prototype.doDrag = function(sEvent, eEvent) {
  */
 GanttChartDay.prototype.initDragHandler = function() {
   this.graphDiv.scrollLeft = this.offsetDis;
-  let _canvas = this._canvas
+  let _canvas = document.getElementsByTagName('canvas')[1];
   _canvas.addEventListener('mousedown', (ev) => {
     this.draging = true;
     this.startEvent = ev;
@@ -208,13 +211,6 @@ GanttChartDay.prototype.initDragHandler = function() {
     this.lastDragEv = ev;
   });
 
-
-  _canvas.addEventListener('mouseleave', (ev) => {
-    console.log('leave...恢复')
-    this.draging = false;
-    this.endEvent = ev;
-  });
-
   _canvas.addEventListener('mouseup', (ev) => {
     this.draging = false;
     this.endEvent = ev;
@@ -231,6 +227,11 @@ GanttChartDay.prototype.initDragHandler = function() {
       this.lastDragEv = ev;
     }
   });
+  _canvas.addEventListener('mouseleave', (ev) => {
+    console.log('leave...恢复')
+    this.draging = false;
+    this.endEvent = ev;
+  });
 }
 /**
  * 初始化画布
@@ -240,9 +241,9 @@ GanttChartDay.prototype.initDragHandler = function() {
 GanttChartDay.prototype.initCanvas = function() {
   console.error('初始化画布...')
   this.gCanvas = new G.Canvas({
-    container: this.chartContainer,
+    container: 'ganttContainer',
     width: this.cWidth,
-    height: this.cHeight,
+    height: 800,
   });
   this._canvas = document.querySelector('#ganttContainer>canvas');
 }
@@ -255,12 +256,9 @@ GanttChartDay.prototype.drawTimeZone = function() {
   console.log('时间段', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'));
   let start = moment(this.startAt);
   let timeGroup = this.gCanvas.addGroup();
-  this.timeGroupEl = timeGroup
   timeGroup._tname = 'TimeGroup';
-  let startSecond = moment(this.startAt);
-
-  // 顶部底部边框
-  timeGroup.addShape('rect',{
+  // 绘制第一级
+  timeGroup.addShape('text', {
     attrs: {
       x: 0,
       y: 0,
@@ -269,7 +267,28 @@ GanttChartDay.prototype.drawTimeZone = function() {
       fill: '#F8F9FA',
       radius: [2, 4],
     },
-  })
+  });
+  timeGroup.addShape('text', {
+    attrs: {
+      x: 20 + this.viewWidth,
+      y: 20,
+      fontSize: 12,
+      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
+    },
+  });
+  timeGroup.addShape('text', {
+    attrs: {
+      x: 20 + this.viewWidth * 2,
+      y: 20,
+      fontSize: 12,
+      text: start.add(this.daysCount / 3, 'days').format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
+    },
+  });
+  let startSecond = moment(this.startAt);
   // 绘制第二级
   let nowAtStr = moment().format('YYYY-MM-DD')
   this.timeZoneLineEls = []
@@ -320,7 +339,7 @@ GanttChartDay.prototype.drawTimeZone = function() {
     }
     timeGroup.addShape('text', {
       attrs: {
-        x: this.dayStep * i,
+        x: 40 * i,
         y: 40,
         fontSize: 10,
         text: timeText,
@@ -360,18 +379,17 @@ GanttChartDay.prototype.handleClick = function(task, flag, ev) {
  * 
  */
 GanttChartDay.prototype.statusColor =function(task) {
-  switch (task.status) {
-    case '按时完成':
-      return 'aqua';
-      break;
-    case '计划批准':
-      return '#ff9800';
-      break;
-    case '已完成':
-      return '#19b720';
-      break;
+  switch (task.statusType) {
+    case 1:
+      return ['#c3c7cb', '#e7e9ea'];
+    case 2:
+      return ['#5b8ff9', '#5b8ff933'];
+    case 3:
+      return ['#f58300', '#fbce99'];
+    case 4:
+      return ['#f54e45', '#fbb8b5'];
     default:
-      break;
+      return ['#f54e45', '#fbb8b5'];
   }
 }
 
@@ -382,6 +400,11 @@ GanttChartDay.prototype.statusColor =function(task) {
 GanttChartDay.prototype.isInView = function(task) {
   let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
   let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
+  if(task.startDate == task.endDate){
+    // console.error('任务宽度为0',task)
+    return true
+  }
+  // console.log('isInView', `${task.startDate} -- ${task.endDate}`, this.startAt.format('YYYY-MM-DD'), this.endAt.format('YYYY-MM-DD'), (!(isLessThanEndAt || isGreaterThanStartAt)))
   return !(isLessThanEndAt || isGreaterThanStartAt)
 }
 
@@ -463,7 +486,7 @@ GanttChartDay.prototype.drawTasks = function() {
             let tempTaskContainerEl = taskPGroup.addShape('rect', {
               attrs: {
                 x: 0,
-                y: topTask.renderOptions.startY + ((index+2)* (this.taskRowHeight + this.rowSpanDis))-5,
+                y: topTask.renderOptions.startY + ((index+1)* (this.taskRowHeight + this.rowSpanDis))-5,
                 width: this.cWidth,
                 height: this.taskRowHeight+10,
                 fill: '#fff',
@@ -504,8 +527,8 @@ GanttChartDay.prototype.drawTasks = function() {
                   y: topTask.renderOptions.startY + ((index + 1)* (this.taskRowHeight + this.rowSpanDis)),
                   width: pos.width,
                   height: this.taskRowHeight,
-                  fill: this.statusColor(_taskItem),
-                  stroke: 'black',
+                  fill: this.statusColor(_taskItem)[0],
+                  stroke: this.statusColor(_taskItem)[1],
                   radius: [2, 4],
                 },
               });
@@ -550,6 +573,11 @@ GanttChartDay.prototype.calRectPos = function(taskItem) {
 
   let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);        
   let secondsEndAt = duraEndAt/1000
+  let width = secondsEndAt * this.timePerPix
+  if(width < this.minTaskRectWidth){
+    width = this.minTaskRectWidth
+  }
+  console.error('task rect width:', width)
   return {
     x: secondsStartAt * this.timePerPix,
     y: 0,

+ 29 - 15
src/utils/ganttChart/GanttChart_month.js

@@ -39,6 +39,8 @@ export function GanttChartMonth(options) {
   this.daysCount = options['daysCount'] || 365;
   // 任务图距离顶部高度
   this.graphTopDis = 60
+  // 任务矩形最小宽度
+  this.minTaskRectWidth = 5
   
   // 每像素代表的小时数
   this.timePerPix = this.cWidth/this.daysCount/24/3600
@@ -66,6 +68,8 @@ export function GanttChartMonth(options) {
  */
 GanttChartMonth.prototype.changeTasks = function(_tasks){
   this.tasks = _tasks
+  console.error('change tasks data here....', this.tasks)
+  this.forceRefreshGraph()
 }
 
 /**
@@ -364,18 +368,17 @@ GanttChartMonth.prototype.handleClick = function(task, flag, ev) {
  * 
  */
 GanttChartMonth.prototype.statusColor =function(task) {
-  switch (task.status) {
-    case '按时完成':
-      return 'aqua';
-      break;
-    case '计划批准':
-      return '#ff9800';
-      break;
-    case '已完成':
-      return '#19b720';
-      break;
+  switch (task.statusType) {
+    case 1:
+      return ['#e7e9ea', '#c3c7cb'];
+    case 2:
+      return ['#dee9fe', '#5b8ff9'];
+    case 3:
+      return ['#fbce99', '#f58300'];
+    case 4:
+      return ['#fbb8b5', '#f54e45'];
     default:
-      break;
+      return ['#fbb8b5', '#f54e45'];
   }
 }
 
@@ -386,6 +389,12 @@ GanttChartMonth.prototype.statusColor =function(task) {
 GanttChartMonth.prototype.isInView = function(task) {
   let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
   let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
+
+  if(task.startDate == task.endDate){
+    // console.error('任务宽度为0',task)
+    return true
+  }
+  // console.log('isInView', `${task.startDate} -- ${task.endDate}`, this.startAt.format('YYYY-MM-DD'), this.endAt.format('YYYY-MM-DD'), (!(isLessThanEndAt || isGreaterThanStartAt)))
   return !(isLessThanEndAt || isGreaterThanStartAt)
 }
 
@@ -469,7 +478,7 @@ GanttChartMonth.prototype.drawTasks = function() {
             let tempTaskContainerEl = taskPGroup.addShape('rect', {
               attrs: {
                 x: 0,
-                y: topTask.renderOptions.startY + ((index+2)* (this.taskRowHeight + this.rowSpanDis))-5,
+                y: topTask.renderOptions.startY + ((index+1)* (this.taskRowHeight + this.rowSpanDis))-5,
                 width: this.cWidth,
                 height: this.taskRowHeight+10,
                 fill: '#fff',
@@ -510,8 +519,8 @@ GanttChartMonth.prototype.drawTasks = function() {
                   y: topTask.renderOptions.startY + ((index + 1)* (this.taskRowHeight + this.rowSpanDis)),
                   width: pos.width,
                   height: this.taskRowHeight,
-                  fill: this.statusColor(_taskItem),
-                  stroke: 'black',
+                  fill: this.statusColor(_taskItem)[0],
+                  stroke: this.statusColor(_taskItem)[1],
                   radius: [2, 4],
                 },
               });
@@ -556,10 +565,15 @@ GanttChartMonth.prototype.calRectPos = function(taskItem) {
 
   let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);
   let secondsEndAt = duraEndAt/1000
+  let width = secondsEndAt * this.timePerPix
+  if(width < this.minTaskRectWidth){
+    width = this.minTaskRectWidth
+  }
+  // console.error('task rect width:', width)
   return {
     x: secondsStartAt * this.timePerPix,
     y: 0,
-    width: secondsEndAt * this.timePerPix,
+    width: width,
     height: 0,
   };
 }

+ 120 - 41
src/views/analysis/CoreDeviceReport.vue

@@ -12,9 +12,10 @@
         v-model="systemId" 
         :selectdata="systemList"
         :placeholder="'请选择'"
+        hideClear
       />
       <div class="system-content">
-        <div v-for="(item) in systemContentData" :key="'key_' + item.id" class="item-content" :class="{'active': item.isActive}" @click="changeEquipment(item.id)">
+        <div v-for="(item) in systemContentData" :key="'key_' + item.category_code" class="item-content" :class="{'active': item.isActive}" @click="changeEquipment(item.category_code)">
           <div class="first-row">
             <div>{{item.name}}</div>
             <div>{{item.isMaintenance?'维保中' : ''}}</div>
@@ -42,13 +43,13 @@
         </el-table-column>
         <el-table-column prop="photos_num" label="照片">
           <template slot-scope="scope">
-            <!-- <span style="color: #025BAA">{{ scope.row.photos_num || scope.row.photos_num === 0?(scope.row.photos_num + '张') : '—' }}</span> -->
-            <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span>
+            <span style="color: #025BAA" @click="showPicturesDetail(scope.row, 'equip')">{{ scope.row.photos_num?(scope.row.photos_num + '张') : '—' }}</span>
+            <!-- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span> -->
           </template>
         </el-table-column>
         <el-table-column prop="attachments_num" label="报告">
           <template slot-scope="scope">
-            <span style="color: #025BAA">{{ scope.row.attachments_num || scope.row.attachments_num === 0?(scope.row.attachments_num+ '张') : '—'}}</span>
+            <span style="color: #025BAA" @click="showReportDetail(scope.row, 'equip')">{{ scope.row.attachments_num?(scope.row.attachments_num+ '张') : '—'}}</span>
           </template>
         </el-table-column>
       </el-table>
@@ -62,7 +63,7 @@
           @current-change="changeTablePage">
         </el-pagination>
       </div>
-      <el-dialog title="交换机-照明系统" :visible.sync="dialogTableVisible" width="1260px">
+      <el-dialog :title="equipTitle" :visible.sync="dialogTableVisible" width="1260px">
         <el-date-picker
           style="margin-bottom: 12px;"
           v-model="dialogTime"
@@ -78,13 +79,13 @@
           <el-table-column property="taskName" label="事项名称"></el-table-column>
           <el-table-column width="100" property="photosNum" label="照片">
             <template slot-scope="scope">
-              <!-- <span style="color: #025BAA">{{ scope.row.photosNum || scope.row.photosNum === 0?(scope.row.photosNum + '张') : '—' }}</span> -->
-              <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span>
+              <span style="color: #025BAA" @click="showPicturesDetail(scope.row, 'his')">{{ scope.row.photosNum || scope.row.photosNum === 0?(scope.row.photosNum + '张') : '—' }}</span>
+              <!-- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span> -->
             </template>
           </el-table-column>
           <el-table-column width="100" property="attachmentsNum" label="报告">
             <template slot-scope="scope">
-              <span style="color: #025BAA">{{ scope.row.attachmentsNum || scope.row.attachmentsNum === 0?(scope.row.attachmentsNum+ '张') : '—'}}</span>
+              <span style="color: #025BAA" @click="showReportDetail(scope.row, 'his')">{{ scope.row.attachmentsNum?(scope.row.attachmentsNum+ '张') : '—'}}</span>
             </template>
           </el-table-column>
         </el-table>
@@ -103,19 +104,13 @@
         <el-dialog :title="detailTitle" :visible.sync="showDetail" width="1260px">
           <div class="detail-container">
             <div class="pictures-menu">
-              <!-- <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item"> -->
-              <div class="item">
-                <!-- <img :src="item.url" alt=""> -->
-                <img src="../../assets/images/login_back.png" alt="">
-                <div class="name">图层名称1.jpg</div>
-              </div>
-              <div class="item">
-                <img src="../../assets/images/login_back.png" alt="">
-                <div class="name">图层名称1.jpg</div>
+              <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item" @click="changeCurImg(item.id)" :class="{'active': item.isActive}">
+                <img :src="item.url" alt="">
+                <div class="name" :title="item.name">{{item.name}}</div>
               </div>
             </div>
             <div class="cur-img-container">
-              <img src="../../assets/images/login_back.png" alt="">
+              <img :src="curImg.url" alt="">
             </div>
           </div>
         </el-dialog>
@@ -129,6 +124,7 @@ import { Select, Input } from 'meri-design';
 import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData, queryDetailData } from '../../api/coreDeviceReport';
 import _ from 'lodash';
 import moment from 'moment';
+import { log } from 'util';
 export default {
   data () {
     return {
@@ -153,6 +149,7 @@ export default {
       dialogTableVisible: false, // 弹窗显示状态
 
       // 核心设备实例
+      equipTitle: '', // 核心设备弹窗名称
       assetnum: null, // 设备台账编码
       historyTableData: [], // 核心设备实例的所有历史事项信息
       dialogTime: null, // 弹框内的时间
@@ -164,7 +161,12 @@ export default {
 
       showDetail: false, // 显示照片、报告详情
       detailTitle: '图片预览', // 弹窗名称
-      pictureList: [], // 图片列表
+      pictureList: [
+        // {id: 1, url: require('../../assets/images/login_back.png'), name: '图层名称1.jpg'},
+        // {id: 2, url: require('../../assets/images/matter_pop3.png'), name: '图层名称2.jpg'},
+        // {id: 3, url: require('../../assets/images/login_back.png'), name: '图层名称3.jpg'},
+      ], // 图片列表
+      curImg: {}, // 当前图片
     }
   },
 
@@ -177,8 +179,6 @@ export default {
 
   mounted() {
     this.getSystemList();
-    this.getEquipmentOfSystem();
-    this.getTableData();
   },
 
   methods: {
@@ -225,14 +225,45 @@ export default {
         param.smsxt = this.systemId;
       }
       queryEquipmentList('/data/home/querySystemCard', param).then((res) => {
-        console.log('res', res)
+        const { result, data } = res;
+        if (result === 'success') {
+          let newData = [], abnormalList = [];
+
+          _.forEach(data[0].assetTypeList, (item, index) => {
+            let itemData = {
+              name: item.category_name,
+              isMaintenance: item.is_detecting,
+              statusNum: item.is_exception_num,
+              num: item.asset_num,
+              abnormal: item.is_exception_num !== 0,
+              category_code: item.category_code
+            }
+            if (!item.category_code) {
+              console.error('without category_code..', item)
+            }
+            if (item.is_exception_num === 0) {
+              newData.push(itemData)
+            } else {
+              abnormalList.push(itemData);
+            }
+          })
+          newData = abnormalList.concat(newData);
+          _.map(newData, (o, i) => {return o.isActive = i === 0});
+          const { query } = this.$route;
+          this.systemContentData = newData;
+          if (!_.isEmpty(query) && query.equipId) {
+            _.map(this.systemContentData, (o) => {return o.isActive = o.category_code == query.equipId});
+          }
+          this.getTableData();
+        }
       })
     },
     /**
      * 切换系统下的设备
      */
     changeEquipment(id) {
-      _.map(this.systemContentData, (o) => {return o.isActive = o.id === id})
+      _.map(this.systemContentData, (o) => {return o.isActive = o.category_code === id});
+      this.getTableData();
     },
     /**
      * 获取表数据
@@ -241,7 +272,7 @@ export default {
       let query = {
         category_code: _.find(this.systemContentData, (o) => {return o.isActive}).category_code
       }
-      let url = `/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`;
+      let url = `/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`;
       if (_.trim(this.searchKey) !== '') {
         url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`
       }
@@ -272,6 +303,7 @@ export default {
     showEquipmentStatus(row, column, e) {
       setTimeout(() => {
         if (this.showDetail) return
+        this.equipTitle = row.sbjc;
         this.dialogTableVisible = true;
         this.assetnum = row.assetnum;
         this.initTimePicker();
@@ -285,12 +317,13 @@ export default {
       let param = {
         page: this.hisCurPage,
         size: this.hisPageSize,
+        plazaId: 1000423,
         // assetnum: this.assetnum,
-        assetnum: 8952,
+        assetnum: 24071,
         // startDate: this.startTime,
-        startDate: 20180101000000,
+        startDate: 20000101000000,
         // endDate: this.endTime
-        endDate: 20180201000000
+        endDate: 20200201000000
       }
       queryHistoryTableData('/data/base/queryDateByAssetNum', param).then((res) => {
         const { result, data, count } = res;
@@ -300,17 +333,18 @@ export default {
           _.forEach(this.historyTableData, (item) => {
             let name;
             switch (item.type) {
-              case '0':
+              case 0:
                 name = '专维'
                 break
-              case '1':
+              case 1:
                 name = '维保专业'
                 break
-              case '2':
+              case 2:
                 name = '第三方视图'
                 break
             }
             item.typeName = name;
+            item.finishDate = moment.unix(item.finishDate / 1000).format('YYYY.MM.DD');
           })
         }
       })
@@ -347,39 +381,78 @@ export default {
     /**
      * 显示图片详情
      */
-    showPicturesDetail(val) {
+    showPicturesDetail(val, type) {
       console.log('val', val)
-      // if (!val.file_type || !val.file_type_id) {
-      //   return
-      // }
+      if (type === 'equip') {
+        if (!val.file_type || !val.file_type_id) {
+          return
+        }
+      } else {
+        if (!val.photosNum) {
+          return
+        }
+      }
       this.showDetail = true;
       this.detailTitle = '图片预览';
       this.getDetailData(val);
     },
     /**
+     * 显示附件详情
+     */
+    showReportDetail(val) {
+      console.log('val', val)
+      if (type === 'equip') {
+        if (!val.file_type || !val.file_type_id) {
+          return
+        }
+      } else {
+        if (!val.attachments_num) {
+          return
+        }
+      }
+      this.showDetail = true;
+      this.detailTitle = '附件预览';
+      this.getDetailData(val);
+    },
+    /**
      * 获取图片/报告详情
      */
-    getDetailData(val) {
+    getDetailData(val, type) {
       let param = {
-        file_type: 0, // val.file_type
-        file_type_id: 2914, // val.file_type_id
+        file_type: type === 'equip'?val.file_type : val.type, 
+        // file_type: 0,
+        file_type_id: type === 'equip'?val.file_type_id : val.id,
+        // file_type_id: 2914,
         type: this.detailTitle === '图片预览'? 0 : 1
       }
-
       queryDetailData('/data/base/queryFileDetails', param).then((res) => {
         console.log('res', res)
         const { result, data } = res;
         if (result === 'success') {
           let newData = [];
-          _.forEach(data, (item) => {
+          _.forEach(data, (item, index) => {
             newData.push({
               id: item.id,
-              url: item.urlname
+              url: item.urlname,
+              isActive: index === 0,
+              name: item.description
             })
           })
-          // this.pictureList = newData;
+          if (this.detailTitle === '图片预览') {
+            this.pictureList = newData;
+            this.curImg = this.pictureList[0];
+          } else {
+            
+          }
         }
       })
+    },
+    /**
+     * 切换当前预览大图
+     */
+    changeCurImg(id) {
+      _.map(this.pictureList, (o) => {return o.isActive = o.id === id});
+      this.curImg = _.find(this.pictureList, (o) => {return o.isActive});
     }
   }
 }
@@ -512,11 +585,17 @@ export default {
           line-height: 16px;
           margin-top: 12px;
           text-align: center;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
         }
         &:not(:last-of-type){
           margin-bottom: 20px;
         }
       }
+      .active>img{
+        border-color: rgba(31, 35, 41, 0.15);
+      }
     }
     .cur-img-container{
       padding: 20px;

+ 38 - 17
src/views/analysis/GanttChart.vue

@@ -12,6 +12,7 @@
         :selectdata="systemList"
         :placeholder="'请选择'"
         @change="changeSystem"
+        hideClear
       />
       <div class="legend-container">
         <div v-for="(item) in legends" :key="'key_' + item.id" class="item-legend">
@@ -112,19 +113,13 @@
         <el-dialog :title="'图片预览'" :visible.sync="showImgDetail" width="1260px">
           <div class="detail-container">
             <div class="pictures-menu">
-              <!-- <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item"> -->
-              <div class="item">
-                <!-- <img :src="item.url" alt=""> -->
-                <img src="../../assets/images/login_back.png" alt />
-                <div class="name">图层名称1.jpg</div>
-              </div>
-              <div class="item">
-                <img src="../../assets/images/login_back.png" alt />
-                <div class="name">图层名称1.jpg</div>
+              <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item" @click="changeCurImg(item.id)" :class="{'active': item.isActive}">
+                <img :src="item.url" alt="">
+                <div class="name">{{item.name}}</div>
               </div>
             </div>
             <div class="cur-img-container">
-              <img src="../../assets/images/login_back.png" alt />
+              <img :src="curImg.url" alt="">
             </div>
           </div>
         </el-dialog>
@@ -214,6 +209,13 @@ export default {
       ], // 报告
       ganttDetail: {}, // 甘特图明细
       tableData: [], // 表数据
+      curTask: {}, // 当前查看的任务
+      pictureList: [
+        {id: 1, url: require('../../assets/images/login_back.png'), name: '图层名称1.jpg', isActive: true},
+        {id: 2, url: require('../../assets/images/matter_pop3.png'), name: '图层名称2.jpg', isActive: false},
+        {id: 3, url: require('../../assets/images/login_back.png'), name: '图层名称3.jpg', isActive: false},
+      ], // 图片
+      curImg: {}, // 当前查看的图片
 
       showImgDetail: false, // 查看更多图片弹框显示状态
     };
@@ -235,8 +237,8 @@ export default {
     initChartTime() {
       let endTime = new Date().getTime(),
           startTime = endTime - 1000*60*60*24*365;
-      this.startTime = startTime;
-      this.endTime = endTime;
+      this.startTime = moment.unix(startTime / 1000).format('YYYYMMDDHHmmss');
+      this.endTime = moment.unix(endTime / 1000).format('YYYYMMDDHHmmss');
     },
     /**
      * 获取系统列表数据
@@ -362,8 +364,8 @@ export default {
               callback: this.showDialog,
               pageToCallback: (data)=>{
                 const { startAt, endAt } = data;
-                this.startTime = new Date(startAt).getTime();
-                this.endTime = new Date(endAt).getTime();
+                this.startTime = moment.unix(new Date(startAt).getTime() / 1000).format('YYYYMMDDHHmmss');
+                this.endTime = moment.unix(new Date(endAt).getTime() / 1000).format('YYYYMMDDHHmmss');
                 this.getGanttChartData();
               }
             });
@@ -409,6 +411,7 @@ export default {
     showDialog(task) {
       this.showDetail = true;
       this.detailTitle = task._pdata.description;
+      this.curTask = task;
       this.getGanttDetailData();
       this.getPictureOrReportData(0);
       this.getPictureOrReportData(1);
@@ -455,15 +458,30 @@ export default {
      * 获取甘特图的图片/报告详情
      */
     getPictureOrReportData(type) {
+      const { id, statusType } = this.curTask._pdata;
       let param = {
-        file_type: 1,
-        file_type_id: 1985,
+        file_type: statusType,
+        file_type_id: id,
         type: type
       };
       queryDetailData("/data/base/queryFileDetails", param).then(res => {
         console.log("photo", res);
+        const { result, data } = res;
+        if (result === 'success') {
+          
+        }
       });
+    },
+    /**
+     * 切换当前预览大图
+     */
+    changeCurImg(id) {
+      _.map(this.pictureList, (o) => {return o.isActive = o.id === id});
+      this.curImg = _.find(this.pictureList, (o) => {return o.isActive});
     }
+  },
+  beforeDestroy() {
+    window.gc = null;
   }
 };
 </script>
@@ -635,7 +653,7 @@ export default {
     margin-right: 21px;
     padding-top: 16px;
     padding-bottom: 16px;
-    width: 180px;
+    padding-right: 5px;
     height: 100%;
     overflow: auto;
     .item {
@@ -655,6 +673,9 @@ export default {
         margin-bottom: 20px;
       }
     }
+    .active>img{
+      border-color: rgba(31, 35, 41, 0.15);
+    }
   }
   .cur-img-container {
     padding: 20px;

+ 28 - 6
src/views/analysis/SpecificationUpdateRecord.vue

@@ -12,6 +12,7 @@
         v-model="incidentType" 
         :selectdata="incidentList" 
         :placeholder="'请选择'"
+        hideClear
       />
       <el-date-picker
         v-model="timeVal"
@@ -22,7 +23,7 @@
         @change="changeTime">
       </el-date-picker>
     </div>
-    <el-table :data="tableData" style="margin-bottom: 19px">
+    <el-table :data="tableData" style="margin-bottom: 19px" @row-click="changeToSystem">
       <el-table-column property="time" label="日期"></el-table-column>
       <el-table-column property="evenType" label="事项类型"></el-table-column>
       <el-table-column property="objid" label="编号"></el-table-column>
@@ -54,15 +55,15 @@ export default {
         {id: 1, name: '维保'},
         {id: 2, name: '第三方检测'},
         {id: 3, name: '重点关注'},
-      ], // 事件列表
-      incidentType: '', // 事件类型
+      ], // 事件列表字典表
+      incidentType: 'all', // 事件类型
       timeVal: '', // 时间
       tableData: [], // 表数据
       curPage: 1, // 当前页码
       pageSize: 10, // 每页条数
       tatol: 0, // 数据总量
-      startTime: 20171027000000, // 开始时间
-      endTime: 20171028000000, // 结束事件
+      startTime: null, // 开始时间
+      endTime: null, // 结束事件
     }
   },
 
@@ -129,8 +130,29 @@ export default {
         this.endTime = 20171028000000;
       }
       this.getTableData();
+    },
+    /**
+     * 跳转到工程信息化系统
+     */
+    changeToSystem(row) {
+      console.log('row', row)
+      const { objtype } = row;
+      let url;
+      switch (objtype) {
+        case 0: // 专维
+          url = `http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=GCZXWXLINE&uniqueid=${row.id}`;
+          break
+        case 1: // 维保
+          url = `http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.id}`;
+          break
+        case 2: // 第三方视图
+          url = `http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=DSF_GZGL&uniqueid=${row.id}`;
+          break
+      }
+      console.log('url', url)
+      // window.open(url, '_blank');
     }
-  }
+  },
 }
 </script>
 

+ 8 - 0
src/views/analysis/index.vue

@@ -46,6 +46,14 @@ export default {
 		GanttChart
 	},
 	mounted() {
+    const { query } = this.$route;
+    if (!_.isEmpty(query)) {
+      if (query.module === 'specification') {
+        _.map(this.navList, (o) => {return o.isActive = o.id === 2});
+      } else if (query.module === 'gantt') {
+        _.map(this.navList, (o) => {return o.isActive = o.id === 3});
+      }
+    }
 		this.findCurModule();
 	},
 	methods: {

+ 2 - 2
src/views/homepage/index.vue

@@ -111,7 +111,7 @@ export default {
         }
     },
     created () {
-        let plazaId = this.$route.query.plazaId
+        let plazaId = localStorage.getItem('PLAZAID')  // 存在localstorage中刷新不会被重置
         if (plazaId) {
             this.plazaId = plazaId
         }
@@ -157,7 +157,7 @@ export default {
             }
         },
         navToInnerPage (item, equip) {
-            this.$router.push({path:"./analysis", query:{smsxt:item.smsxt, equipId: equip.id, module:'core'}})
+            this.$router.push({path:"./analysis", query:{smsxt:item.smsxt, equipId: equip.category_code, module:'core'}})
         },
          
         /**

+ 103 - 22
src/views/statistics/index.vue

@@ -31,6 +31,7 @@
                     :isReadOnly='false'
                     :caption='"选择管理分区"'
                     :data='regulateDistrictData'
+                    placeholder="全部"
                     :disabled='false'
                     @change='selectProjectItem'
                 />
@@ -57,10 +58,10 @@
                             </div>
                             <div class='system-equipments' v-if='item.assetTypeList'>
                                 <div class='number' v-for='(equip , index) in item.assetTypeList' :key='index'>
-                                    <p>
-                                        {{equip.category_name}}
+                                    <div class="title">
+                                        <P>{{equip.category_name}}</p>
                                         <span v-if='equip.is_exception_num'>{{equip.is_exception_num}}</span>
-                                    </p>
+                                    </div>
                                     <p>
                                         <span>{{equip.asset_num}}</span>
                                         <span>台</span>
@@ -108,7 +109,14 @@
             </section>
             <section class='ratio-list'>
                 <section class='block' :style='panelStyle(item)' v-for='(item , index) in maintainList' :key='index'>
-                    <h4 class='section-title' @click='toggerPanel(item)'>{{item.title}}</h4>
+                    <h4 class='section-title' @click='toggerPanel(item)'>{{item.title}}<img @mouseenter="showToolTip(index, item.title)" @mouseleave="hideToolTip(index, item.title)" src="../../assets/images/icons/notice.png" /></h4>
+                    <transition name="selectDownUpExtendTop">
+                        <div class="tool-tip" v-if="item.showToolTip">
+                            <h5 style="font-weight:bold;">{{item.title + '比值'}}</h5>
+                            <p>{{item.title === '专维' ? '逾期未完成/即将到期任务数/任务总数' : '逾期未完成/任务总数'}}</p>
+                            <div class="tip-triangle" :style="{left: item.title === '第三方检测' ? '12.5rem': '7.8rem'}"> </div>
+                        </div>
+                    </transition>
                     <div class='list'>
                         <ul>
                             <li v-for='(option , index) in item.data' :key='index'>
@@ -157,6 +165,7 @@ import 'leaflet-contextmenu'
 export default {
     data() {
         return {
+            toolTipHtml:'',
             crumbsHtml: [],
             zoneNames: {
                 东北: 'dongbei',
@@ -254,11 +263,20 @@ export default {
         this.currentTime()
     },
     mounted() {
+    
         window.vm = this
         this.getFrameworkTreeData()
         window.addEventListener('resize', this.reinitalMap, false)
     },
-    methods: {
+    methods: {  
+        showToolTip (index, title) {
+            
+            this.maintainList.forEach(item => {item.showToolTip = false})
+            this.maintainList[index].showToolTip = true
+        },
+        hideToolTip (index, title) {
+            this.maintainList[index].showToolTip = false
+        },
         reinitalMap () {
             if (myMaps) {
                 myMaps.invalidateSize(true);
@@ -325,7 +343,9 @@ export default {
                 let res = this.provinceCities[JSONName]
                 this.pantProjectsMap(data, this.currentSysId)
             } else {
-                this.$router.push({path:'/home/homePage',query:{plazaId: data.cid}})  // 点击广场时 直接跳转到详情页  地图不用响应
+                this.$router.push({path:'/home/homePage'})  // 点击广场时 直接跳转到详情页  地图不用响应
+                this.$store.commit('SETPLAZENAME', data.cname) 
+                localStorage.setItem('PLAZAID', data.cid)
             }
         },
    
@@ -582,9 +602,9 @@ export default {
                 if (res.result === 'success') {
                     let data = res.data
                     let orginalObj = { 
-                        0:{title:'专维',data:[], expand: 0},
-                        1:{title:'维保',data:[], expand: 0},
-                        2:{title:'第三方检测',data:[], expand: 0}
+                        0:{title:'专维',data:[], expand: 0, showToolTip:false},
+                        1:{title:'维保',data:[], expand: 0, showToolTip:false},
+                        2:{title:'第三方检测',data:[], expand: 0, showToolTip:false}
                     }
                     let arr = []
                     for (let key in data) {
@@ -885,8 +905,10 @@ export default {
                             this.pantProjectsMap(data, this.currentSysId)
                         } 
                         if (type === 'project') {
-                            this.$router.push({path:'/home/homePage',query:{plazaId: data.cid}})  
-                        }
+                            this.$router.push({path:'/home/homePage' })  
+                            this.$store.commit('SETPLAZENAME', data.cname) 
+                            localStorage.setItem('PLAZAID', data.cid)
+                        }   
                     })
                 }
             }, 200)
@@ -895,7 +917,6 @@ export default {
          * 生成弹框HTML
          */
         createPopupHtmlContent(data, name) {
-            // return "<div>fdfdsfsdfdfds</div>"
             if (Array.isArray(data) && data.length) {
                 let that = this
                 let html = ''
@@ -940,12 +961,28 @@ export default {
         }
     },
     beforeDestroy() {
-        window.removeEventListener(this.reinitalMap, ture)
+        window.removeEventListener('resize', this.reinitalMap)
     }
 }
 </script>
 
 <style scoped lang="less">
+@keyframes selectDownUpExtendTop {
+    from {
+        transform: translateY(8px);
+        opacity: 0;
+    }
+    to {
+        transform: translateY(0);
+        opacity: 1;
+    }
+}
+.selectDownUpExtendTop-enter-active {
+    animation: selectDownUpExtendTop .3s
+}
+.selectDownUpExtendTop-leave-active {
+    animation: selectDownUpExtendTop .3s reverse
+}
 .overview {
     height: 100vh;
     background: rgba(247, 249, 250, 1);
@@ -1095,6 +1132,8 @@ export default {
         height: calc(100vh - 98px);
         padding: 1.2rem 1.6rem;
         .section-title {
+            display: flex;
+            align-items: center;
             padding-left: 10px;
             border-left: 4px solid #025baa;
             color: #1f2429;
@@ -1102,7 +1141,12 @@ export default {
             font-weight: bolder;
             line-height: 2rem;
             cursor: pointer;
+            img{
+                width: 2rem;
+                margin-left: 1.2rem;
+            }
         }
+        
         .system-general {
             width: 25.4%;
             box-sizing: border-box;
@@ -1112,13 +1156,15 @@ export default {
             }
             .system-list {
                 ul {
+                    height: 80vh;
                     li.system-item {
                         display: flex;
                         justify-content: flex-start;
                         align-items: center;
                         width: calc(100% - 3.2rem);
+                        height: calc(100% / 8);
                         margin-left: 1.6rem;
-                        padding: 2rem 0;
+                        // padding: 1rem 0;
                         box-sizing: border-box;
                         border: 1px solid white;
                         border-radius: 4px;
@@ -1163,14 +1209,25 @@ export default {
                             padding-left: 1.4rem;
                             .number {
                                 width: 33.3%;
-                                p:nth-of-type(1) {
+                                margin-right: 1.2rem;
+                                .title{
+                                    display: inline-block;
                                     position: relative;
-                                    color: #1f2429;
-                                    font-size: 1.4rem;
-                                    line-height: 1.6rem;
+                                    p{
+                                        display: inline-block;
+                                        position: relative;
+                                        width: 100%;
+                                        color: #1f2429;
+                                        font-size: 1.4rem;
+                                        line-height: 1.6rem;
+                                        white-space: nowrap;
+                                        text-overflow: ellipsis;
+                                        overflow: hidden;
+                                    }
                                     span {
                                         position: absolute;
-                                        top: -10px;
+                                        top: -1.6rem;
+                                        right: -1rem;
                                         padding: 2px 4px;
                                         border-radius: 0.9rem;
                                         font-size: 1.2rem;
@@ -1247,9 +1304,9 @@ export default {
             }
             .map-container {
                 position: relative;
-                height: 70rem;
+                height: 70vh;
                 #map {
-                    height: 70rem;
+                    height: 70vh;
                     overflow: hidden;
                     pointer-events: none;
                 }
@@ -1284,11 +1341,35 @@ export default {
                 border-radius: 4px;
                 margin-bottom: 1rem;
                 background: white;
-                overflow: hidden;
+                // overflow: auto;
                 transition: height 0.3s ease-in-out;
                 .section-title {
                     font-size: 1.6rem;
                 }
+                .tool-tip{
+                    position: absolute;
+                    left: 0;
+                    top: -6.6rem;
+                    width: 100%;
+                    border-radius: 4px;
+                    padding: 0.8rem 1.6rem 1.6rem;
+                    font-size: 1.4rem;
+                    line-height: 2.2rem;
+                    background: rgba(247, 249, 250, 1);
+                    border:1px solid rgba(151,151,151, 0.2);
+                    filter: drop-shadow(0 2px 4px rgba(31, 35, 41, .1)) ;
+                    .tip-triangle{
+                        position: absolute;
+                        position: absolute;
+                        left: 7.8rem;
+                        border-style: solid;
+                        width: 0;
+                        height: 0;
+                        bottom: -6px;
+                        border-width: 6px 6px 0 6px;
+                        border-color: rgba(247, 249, 250, 1) transparent transparent transparent;
+                    }
+                }
                 .list {
                     margin-top: 1.4rem;
                     overflow: hidden;