guoxiaohuan 4 éve
szülő
commit
1fe8fa0a77
66 módosított fájl, 90953 hozzáadás és 72 törlés
  1. 3 0
      .gitignore
  2. 5 1
      package.json
  3. 72 2
      public/index.html
  4. 34 2
      src/App.vue
  5. 40 3
      src/api/coreDeviceReport.js
  6. 5 0
      src/api/ganttChart.js
  7. 34 0
      src/api/homePage.js
  8. 2 2
      src/api/httputils.js
  9. 8 0
      src/api/room.js
  10. 4 0
      src/api/specificationUpdateRecord.js
  11. 39 0
      src/assets/CHN.geo2.json
  12. 31986 0
      src/assets/china.json
  13. 1594 0
      src/assets/cityData/济南区域.json
  14. 1447 0
      src/assets/cityData/青岛区域.json
  15. BIN
      src/assets/images/icons/1001.png
  16. BIN
      src/assets/images/icons/1002.png
  17. BIN
      src/assets/images/icons/1003.png
  18. BIN
      src/assets/images/icons/1004.png
  19. BIN
      src/assets/images/icons/1005.png
  20. BIN
      src/assets/images/icons/1006.png
  21. BIN
      src/assets/images/icons/1007.png
  22. BIN
      src/assets/images/icons/audit.png
  23. BIN
      src/assets/images/icons/contract.png
  24. BIN
      src/assets/images/icons/edit_blue_b.png
  25. BIN
      src/assets/images/icons/edit_red_b.png
  26. BIN
      src/assets/images/icons/edit_yellow_b.png
  27. BIN
      src/assets/images/icons/fix_blue_b.png
  28. BIN
      src/assets/images/icons/fix_red_b.png
  29. BIN
      src/assets/images/icons/fix_yellow_b.png
  30. BIN
      src/assets/images/icons/hydrant.png
  31. BIN
      src/assets/images/icons/ratio.png
  32. BIN
      src/assets/images/icons/right.png
  33. BIN
      src/assets/images/icons/search_blue_b.png
  34. BIN
      src/assets/images/icons/search_red_b.png
  35. BIN
      src/assets/images/icons/search_yellow_b.png
  36. BIN
      src/assets/images/warning.png
  37. BIN
      src/assets/images/图标/1001.png
  38. BIN
      src/assets/images/图标/1002.png
  39. BIN
      src/assets/images/图标/1003.png
  40. BIN
      src/assets/images/图标/1004.png
  41. BIN
      src/assets/images/图标/1005.png
  42. BIN
      src/assets/images/图标/1006.png
  43. BIN
      src/assets/images/图标/1007.png
  44. BIN
      src/assets/images/图标/供电系统_n.png
  45. BIN
      src/assets/images/图标/土建系统_n.png
  46. BIN
      src/assets/images/图标/土建系统_s.png
  47. BIN
      src/assets/images/图标/弱点系统_n.png
  48. BIN
      src/assets/images/图标/提示.png
  49. BIN
      src/assets/images/图标/暖通系统_n.png
  50. BIN
      src/assets/images/图标/消防系统_n.png
  51. BIN
      src/assets/images/图标/燃气系统_n.png
  52. BIN
      src/assets/images/图标/电梯系统_n.png
  53. BIN
      src/assets/images/图标/给排水系统_n.png
  54. 3 3
      src/components/menuList.vue
  55. 1 0
      src/main.ts
  56. 3 3
      src/router/index.js
  57. 438 0
      src/utils/ganttChart/GanttChart.js
  58. 26486 0
      src/utils/ganttChart/g.js
  59. 1 2
      src/views/Device/index.vue
  60. 188 36
      src/views/analysis/CoreDeviceReport.vue
  61. 184 6
      src/views/analysis/GanttChart.vue
  62. 82 12
      src/views/analysis/SpecificationUpdateRecord.vue
  63. 422 0
      src/views/homepage/index.vue
  64. 1378 0
      src/views/statistics/index.vue
  65. 26486 0
      static/g.js
  66. 8 0
      vue.config.js

+ 3 - 0
.gitignore

@@ -1,6 +1,9 @@
 .DS_Store
 node_modules
 package-lock.json
+/src/assets/geoData
+/src/assets/regionData
+/src/assets/provinceData
 /dist
 # 忽略提交打包后的wandaBmGuide目录
 /wandaBmGuide 

+ 5 - 1
package.json

@@ -15,13 +15,16 @@
         "@saga-web/graph": "2.1.102",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",
+        "leaflet-contextmenu": "^1.4.0",
+        "meri-design": "^1.2.8",
         "core-js": "^3.4.4",
         "element-ui": "^2.13.2",
-        "meri-design": "^1.3.3",
+        "leaflet": "^1.6.0",
         "moment": "^2.24.0",
         "quill": "^1.3.7",
         "vue": "^2.6.10",
         "vue-cookie": "^1.1.4",
+        "vue-pdf": "^4.1.0",
         "vue-quill-editor": "^3.0.6",
         "vue-router": "^3.1.3",
         "vuex": "^3.4.0"
@@ -43,6 +46,7 @@
         "fengmap": "^2.5.3",
         "less": "^3.0.4",
         "less-loader": "^5.0.0",
+        "lodash": "^4.17.19",
         "polybooljs": "^1.2.0",
         "style-resources-loader": "^1.3.3",
         "stylus": "^0.54.7",

+ 72 - 2
public/index.html

@@ -1,3 +1,4 @@
+ 
 <!DOCTYPE html>
 <html lang="en">
 
@@ -8,15 +9,84 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <script src="<%= BASE_URL %>systemConf.js"></script>
     <title>万达广场管理说明书</title>
+    <style>
+        .map-p-label{
+            background-color:transparent!important;
+            border:none!important;
+            box-shadow:none!important;
+        }
+        .leaflet-container{
+            background: #f7f9fa!important;
+        }
+        
+        .leaflet-popup-content-wrapper{
+            padding: 0px!important;
+            border-radius: 0px!important;
+            box-shadow: none!important;
+        }
+        .leaflet-popup-content-wrapper .leaflet-popup-content {
+            margin: 0!important;
+            min-width: 250px;
+            background: rgba(255, 255, 255, 0.5);
+            
+        }
+        .leaflet-mypopup-content {
+            padding: 8px 12px!important;
+        }
+        .leaflet-mypopup-content .title{
+            margin-bottom: 12px;
+        }
+        .leaflet-mypopup-content .title span{
+            font-size: 14px;
+            font-weight: bold;
+        }
+        .leaflet-mypopup-content .line {
+            margin-bottom: 12px;
+        }
+        .leaflet-mypopup-content .line span{
+            margin-right: 10px;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(1){
+            font-size: 12px;
+            color: #8D9399;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(2){
+            font-size: 16px;
+            color: #1F2429;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(3) i{
+            display: inline-block;
+            width: 16px;
+            height: 16px;
+            border-radius: 8px;
+            color: #F54E45;
+        }
+        .leaflet-mypopup-content .line span:nth-of-type(3) em{
+            font-size: 12px;
+            color: #F54E45;
+        }
+    </style>
+    <script>
+        var remHandle = function () {
+            var html = document.documentElement;
+            var width = html.clientWidth;
+            html.style.fontSize = width / 192 + 'px'; 
+        }
+        remHandle();
+        window.onresize = function () {
+            remHandle();
+        }
+    </script>
 </head>
 
 <body>
     <noscript>
         <strong>We're sorry but wandaspecificationofsanming doesn't work properly without JavaScript enabled. Please enable
             it to continue.</strong>
-    </noscript>
+        </noscript>
+    <script src="http://localhost/g.js" type="text/JavaScript"></script>
     <div id="app"></div>
-    <!-- built files will be auto injected -->
+ 
 </body>
 
 </html>

+ 34 - 2
src/App.vue

@@ -54,7 +54,14 @@ export default {
         },
         getMap() {
             if (!window.fengmapData) {
-                window.fengmapData = new SFengParser(`fengMap${this.id}`, `${this.mapServerURL}/fmap/${this.fmapID}`, this.key, this.appName, null, this.mapthemeUrl)
+                window.fengmapData = new SFengParser(
+                    `fengMap${this.id}`,
+                    `${this.mapServerURL}/fmap/${this.fmapID}`,
+                    this.key,
+                    this.appName,
+                    null,
+                    this.mapthemeUrl
+                )
                 window.fengmapData.loadMap(this.fmapID, () => {
                     // 获取主题数据
                     window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
@@ -65,6 +72,28 @@ export default {
         }
     }
 }
+// getMap() {
+//   if (!window.fengmapData) {
+//     window.fengmapData = new SFengParser(
+//       `fengMap${this.id}`,
+//       `${this.mapServerURL}/fmap/${this.fmapID}`,
+//       this.key,
+//       this.appName,
+//       null,
+//       this.mapthemeUrl
+//     );
+//     window.fengmapData.loadMap(this.fmapID, () => {
+//       // 获取主题数据
+//       window.fengmapData
+//         .loadTheme(
+//           `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
+//         )
+//         .then(res => {
+//           this.SETHAVEFENGMAP();
+//         });
+//     });
+//   }
+// }
 </script>
 <style lang="less">
 body,
@@ -260,5 +289,8 @@ body {
         line-height: 26px;
         width: 8%;
     }
+    .el-date-editor .el-range__close-icon {
+        line-height: 26px;
+    }
 }
-</style>
+</style>

+ 40 - 3
src/api/coreDeviceReport.js

@@ -1,11 +1,48 @@
+/*
+ * @Author: your name
+ * @Date: 2020-07-03 19:04:47
+ * @LastEditTime: 2020-07-09 19:58:31
+ * @LastEditors: your name
+ * @Description: In User Settings Edit
+ * @FilePath: \wanda-bm-guide\src\api\coreDeviceReport.js
+ */
+
 // 核心设备报表 接口
 import httputils from '@/api/httputils'
 
 // 系统列表
-export function queryEquipmentList() {
-    return httputils.getJson(`/data/v_glsms_systemcfg/querySmsxt`)
+// export function queryEquipmentList() {
+//     return httputils.getJson(`/data/v_glsms_systemcfg/querySmsxt`)
+// }
+/**
+ * 系统下的设备
+ * @param { 接口地址 } url
+ * @param { 接口参数 } getParams
+ */
+export function queryEquipmentList(url, getParams) {
+    return httputils.getJson(url, getParams)
 }
-// 表数据
+/**
+ * 表数据
+ */
 export function queryTableData(url, postParams) {
     return httputils.postJson(url, postParams)
 }
+
+/**
+ * 设备台账下所有历史事项信息
+ * @param { 接口地址 } url
+ * @param { 接口参数 } getParams
+ */
+export function queryHistoryTableData(url, getParams) {
+    return httputils.getJson(url, getParams)
+}
+
+/**
+ * 获取图片/报告详情
+ * @param { 接口地址 } url
+ * @param { 接口参数 } getParams
+ */
+export function queryDetailData(url, getParams) {
+    return httputils.getJson(url, getParams)
+}

+ 5 - 0
src/api/ganttChart.js

@@ -0,0 +1,5 @@
+import httputils from "@/api/httputils";
+
+export function queryGanttChart(url, getParams) {
+  return httputils.getJson(url, getParams);
+}

+ 34 - 0
src/api/homePage.js

@@ -0,0 +1,34 @@
+import httputils from "@/api/httputils"
+
+// 查询首页系统卡片
+export function getCardList({ getParams }) {
+    return httputils.getJson(`/data/home/querySystemCard`, getParams)
+}
+
+ // 综合事项记录
+export function getQueryList({ getParams }) {
+    return httputils.getJson(`/data/v_glsms_zhsxjl/query`, getParams)
+}
+
+// 说明书变更记录
+export function getChangeList({ getParams }) {
+    return httputils.getJson(`/data/rpt_change_record/query`, getParams)
+}
+
+
+
+// ==================== 集团首页接口 =======================
+// 查询项目信息统计数量
+export function getPlazaInfoCount({ getParams }) {
+    return httputils.getJson(`/data/home/queryPlazaInfoCount`, getParams)
+}
+
+// 查询首页系统卡片
+export function querySystemCard({ getParams }) {
+    return httputils.getJson(`/data/home/querySystemCard`, getParams)
+}
+
+// 查询集团首页事项状态统计
+export function queryEventStatus({ getParams }) {
+    return httputils.getJson(`/data/home/queryEventStatus`, getParams)
+}

+ 2 - 2
src/api/httputils.js

@@ -21,10 +21,10 @@ axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
         let token = store.getters['ssoToken']
-        let isPreview = store.getters["isPreview"]
+        let isPreview = store.getters['isPreview']
         if (config.url.indexOf('mapapp') < 0) {
             config.headers = {
-                "sso-token": token,
+                'sso-token': token,
                 isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }

+ 8 - 0
src/api/room.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2020-06-28 13:41:05
+ * @LastEditTime: 2020-07-06 11:43:33
+ * @LastEditors: your name
+ * @Description: In User Settings Edit
+ * @FilePath: \wanda-bm-guide\src\api\room.js
+ */ 
 import httputils from '@/api/httputils'
 
 // 机房-机房布置图

+ 4 - 0
src/api/specificationUpdateRecord.js

@@ -1,2 +1,6 @@
 // 说明说更新记录 接口
 import httputils from "@/api/httputils";
+
+export function getSpecificaltionData(url, param) {
+  return httputils.getJson(url, param);
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 39 - 0
src/assets/CHN.geo2.json


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 31986 - 0
src/assets/china.json


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1594 - 0
src/assets/cityData/济南区域.json


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1447 - 0
src/assets/cityData/青岛区域.json


BIN
src/assets/images/icons/1001.png


BIN
src/assets/images/icons/1002.png


BIN
src/assets/images/icons/1003.png


BIN
src/assets/images/icons/1004.png


BIN
src/assets/images/icons/1005.png


BIN
src/assets/images/icons/1006.png


BIN
src/assets/images/icons/1007.png


BIN
src/assets/images/icons/audit.png


BIN
src/assets/images/icons/contract.png


BIN
src/assets/images/icons/edit_blue_b.png


BIN
src/assets/images/icons/edit_red_b.png


BIN
src/assets/images/icons/edit_yellow_b.png


BIN
src/assets/images/icons/fix_blue_b.png


BIN
src/assets/images/icons/fix_red_b.png


BIN
src/assets/images/icons/fix_yellow_b.png


BIN
src/assets/images/icons/hydrant.png


BIN
src/assets/images/icons/ratio.png


BIN
src/assets/images/icons/right.png


BIN
src/assets/images/icons/search_blue_b.png


BIN
src/assets/images/icons/search_red_b.png


BIN
src/assets/images/icons/search_yellow_b.png


BIN
src/assets/images/warning.png


BIN
src/assets/images/图标/1001.png


BIN
src/assets/images/图标/1002.png


BIN
src/assets/images/图标/1003.png


BIN
src/assets/images/图标/1004.png


BIN
src/assets/images/图标/1005.png


BIN
src/assets/images/图标/1006.png


BIN
src/assets/images/图标/1007.png


BIN
src/assets/images/图标/供电系统_n.png


BIN
src/assets/images/图标/土建系统_n.png


BIN
src/assets/images/图标/土建系统_s.png


BIN
src/assets/images/图标/弱点系统_n.png


BIN
src/assets/images/图标/提示.png


BIN
src/assets/images/图标/暖通系统_n.png


BIN
src/assets/images/图标/消防系统_n.png


BIN
src/assets/images/图标/燃气系统_n.png


BIN
src/assets/images/图标/电梯系统_n.png


BIN
src/assets/images/图标/给排水系统_n.png


+ 3 - 3
src/components/menuList.vue

@@ -47,7 +47,7 @@ export default {
         return {
             state: '',
             list: [
-                { name: '首页', state: false, route: 'first' },
+                { name: '首页', state: false, route: 'homepage' },
                 { name: '项目概况', state: false, route: 'overview' },
                 { name: '楼层功能', state: false, route: 'floorFunc' }, //楼层功能
                 { name: '设备设施', state: false, route: 'equipment' }, //设备设施
@@ -62,7 +62,7 @@ export default {
             timer: null, //保存定时器
             // 路由词典
             dict: {
-                first: 1,
+                homepage: 1,
                 overview: 2,
                 floorFunc: 3,
                 equipment: 4,
@@ -109,7 +109,7 @@ export default {
                 }
             try {
                 // 调用接口
-                res = await queryDraftNum(data)
+                // res = await queryDraftNum(data)
             } catch (error) {
                 console.error(error)
             }

+ 1 - 0
src/main.ts

@@ -27,6 +27,7 @@ import cookies from 'vue-cookie'
 Vue.use(cookies)
 import Pui from 'meri-design'
 import 'meri-design/dist/index.css'
+import 'leaflet/dist/leaflet.css'
 Vue.use(Pui)
 
 new Vue({

+ 3 - 3
src/router/index.js

@@ -19,11 +19,11 @@ const routes = [
         path: '/home',
         name: 'home',
         component: () => import('../views/index'),
-        redirect: '/home/first',
+        redirect: '/home/homepage',
         children: [
             {
-                path: 'first',
-                component: () => import('../views/first'),
+                path: 'homepage',
+                component: () => import('../views/homepage'),
             },
             //概览
             {

+ 438 - 0
src/utils/ganttChart/GanttChart.js

@@ -0,0 +1,438 @@
+import moment from 'moment';
+/**
+ * 数据定义区域
+ *
+ */
+/**
+ * 甘特图
+ * @param {} options 
+ */
+export function GanttChart(options) {
+  // 任务列表
+  this.tasks = options.tasks || [];
+  // AntVG Canvas
+  this.gCanvas = null;
+  // 视口宽度 800,可视区域
+  this.viewWidth = options['viewWidth'] || 800;
+  // 物理画布宽度 800
+  this.cWidth = options['cWidth'] || 2400;
+  this.cHeight = options['cHeight'] || 600;
+  // 画布偏移位置
+  this.startPos = 0;
+  // 是否拖动中
+  this.draging = false;
+  // 开始拖动事件
+  this.startEvent = null;
+  // 结束拖动事件
+  this.endEvent = null;
+  // 拖动过程事件
+  this.dragingEvent = null;
+  // 拖动偏移量
+  this.offsetDis = options['viewWidth'] || 800;
+  // 拖动定时器
+  this.dragTimer = null;
+  // 每天的间隔宽度
+  this.dayStep = 40;
+  // 分组标题高度
+  this.groupTitleHeight = 38;
+  // 任务矩形高度
+  this.taskRowHeight = 16;
+  // 每行任务的纵向间距
+  this.rowSpanDis = 22;
+  // 总天数
+  this.daysCount = options['daysCount'] || 60;
+  // 任务图距离顶部高度
+  this.graphTopDis = 20
+  
+  // 每像素代表的小时数
+  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['chartContainer']);
+  // 图形容器组
+  this.graphGroup = null;
+  // 上一次拖动的事件
+  this.lastDragEv = null;
+  // 回调事件
+  this.callback = options.callback || null;
+}
+
+
+/**
+ * 设置数据
+ * @param {*} _tasks 
+ */
+GanttChart.prototype.changeTasks = function(_tasks){
+  this.tasks = _tasks
+}
+
+/**
+ * 打开关闭分组
+ */
+
+GanttChart.prototype.toggle = function(index) {
+  if (this.tasks[index].open) {
+    this.tasks[index].open = false;
+  } else {
+    this.tasks[index].open = true;
+  }
+  this.processData();
+  this.drawTasks();
+}
+
+/**
+ * 预处理数据
+ */
+GanttChart.prototype.processData = function() {
+  for (let i = 0; i < this.tasks.length; i++) {
+    let currentTopTask = this.tasks[i];
+    let lastTopTask = null;
+    currentTopTask.renderOptions = {};
+    if (i != 0) {
+      // 非0个,要补上前面的数据
+      lastTopTask = this.tasks[i - 1];
+      currentTopTask.renderOptions.startY = lastTopTask.renderOptions.endY + 20;
+    } else {
+      // 第一个
+      currentTopTask.renderOptions.startY = this.graphTopDis;
+    }
+    if (currentTopTask.open) {
+      currentTopTask.renderOptions.endY =
+        currentTopTask.renderOptions.startY + this.rowSpanDis + this.groupTitleHeight + currentTopTask.dataList.length * this.taskRowHeight;
+    } else {
+      currentTopTask.renderOptions.endY = currentTopTask.renderOptions.startY + this.groupTitleHeight;
+    }
+  }
+}
+
+/**
+ * 强制清空图像,重绘
+ */
+GanttChart.prototype.forceRefreshGraph = function() {
+  this.tasks.forEach((topTask) => {
+    topTask.gGroup = null;
+  });
+  this.gCanvas.destroy();
+  this.initDrawingReady();
+}
+
+/**
+ * 准备绘制,用于初始化和强制刷新
+ */
+GanttChart.prototype.initDrawingReady = function() {
+  this.initCanvas();
+  this.initDragHandler();
+  this.drawTimeZone();
+  this.processData();
+  this.drawTasks();
+  this.graphGroup = null
+}
+
+/**
+ * 翻页
+ */
+GanttChart.prototype.pageTo = function(dir = 'next') {
+  if (dir == 'next') {
+    // 向后翻页`
+    this.startAt = this.startAt.add(this.daysCount, 'days');
+    this.offsetDis = 0
+  } else {
+    // 向前翻页
+    this.startAt = this.startAt.subtract(this.daysCount, 'days');
+    this.offsetDis = 2*this.viewWidth
+  }
+  this.endAt = moment(this.startAt).add(this.daysCount, 'days');
+  console.log('已翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'), this.offsetDis);
+  // offsetDis = viewWidth;
+  this.forceRefreshGraph();
+}
+// 上次点击时间,用于滚动时误触停止
+let lastClickAt = null;
+/**
+ * 执行拖动
+ * 改变graphDiv 滚动距离
+ * 到达边界距离后,刷新页面
+ */
+GanttChart.prototype.doDrag = function(sEvent, eEvent) {
+  if (sEvent == null) {
+    sEvent = this.startEvent;
+  }
+  
+  let sPos = sEvent.clientX;
+  let cPos = eEvent.clientX;
+  // 滚动距离
+  let dis = cPos - sPos;
+  let tempDis = this.offsetDis
+  // console.log('offsetDis before:', this.offsetDis, dis)
+  this.offsetDis = this.offsetDis - dis / 2;
+  // console.log('draging...',tempDis, this.offsetDis, dis)
+  if (this.offsetDis <= -20) {
+    // 向前滑动,向前翻页
+    console.log('此处应该向前翻页', this.startAt.format('YYYY-MM-DD'),this.endAt.format('YYYY-MM-DD'),this.offsetDis);
+    this.offsetDis = this.viewWidth;
+    this.pageTo('prev');
+  }
+  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;
+    this.pageTo('next');
+  }
+  this.graphDiv.scrollLeft = this.offsetDis;
+}
+
+/**
+ * 初始化抓取拖动事件
+ */
+
+GanttChart.prototype.initDragHandler = function() {
+  this.graphDiv.scrollLeft = this.offsetDis;
+  let _canvas = document.getElementsByTagName('canvas')[1];
+  _canvas.addEventListener('mousedown', (ev) => {
+    this.draging = true;
+    this.startEvent = ev;
+    this.dragingEvent = null;
+    this.endEvent = null;
+    this.lastClickAt = new Date();
+    this.lastClickAt = ev;
+    this.lastDragEv = ev;
+  });
+
+  _canvas.addEventListener('mouseup', (ev) => {
+    this.draging = false;
+    this.endEvent = ev;
+  });
+
+  _canvas.addEventListener('mousemove', (ev) => {
+    // console.log('this over', this)
+    if (this.draging) {
+      if (new Date() - this.lastClickAt < 20) {
+        return false;
+      }
+      this.dragingEvent = ev;
+      this.doDrag(this.lastDragEv, ev);
+      this.lastDragEv = ev;
+    }
+  });
+  _canvas.addEventListener('mouseleave', (ev) => {
+    console.log('leave...恢复')
+    this.draging = false;
+    this.endEvent = ev;
+  });
+}
+/**
+ * 初始化画布
+ *
+ */
+
+GanttChart.prototype.initCanvas = function() {
+  this.gCanvas = new G.Canvas({
+    container: 'ganttContainer',
+    width: this.cWidth,
+    height: 800,
+  });
+}
+
+/**
+ * 绘制时间区域
+ */
+
+GanttChart.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();
+  timeGroup._tname = 'TimeGroup';
+  // 绘制第一级
+  timeGroup.addShape('text', {
+    attrs: {
+      x: 20,
+      y: 20,
+      fontSize: 12,
+      text: start.format('YYYY-MM'),
+      lineDash: [10, 10],
+      fill: '#8D9399',
+    },
+  });
+  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);
+  // 绘制第二级
+  for (let i = 0; i < this.daysCount; i++) {
+    let timeText = startSecond.add(1, 'days').format('DD');
+    timeGroup.addShape('text', {
+      attrs: {
+        x: 40 * i,
+        y: 40,
+        fontSize: 10,
+        text: timeText,
+        lineDash: [10, 10],
+        fill: '#8D9399',
+      },
+    });
+  }
+}
+
+/**
+ * 处理点击
+ */
+GanttChart.prototype.handleClick = function(task, flag, ev) {
+  // let detailDiv = document.getElementById('detailDiv')
+  if(flag == 'enter'){
+    // detailDiv.style.display = 'block'
+    // detailDiv.style.left = ev.clientX+'px';
+    // detailDiv.style.top = ev.clientY+'px';
+    // document.getElementById('detailTaskName').textContent = task._pdata.description
+    // document.getElementById('detailTaskStatus').textContent = task._pdata.status
+    // document.getElementById('detailTaskStartDate').textContent = task._pdata.startDate
+    // document.getElementById('detailTaskEndDate').textContent = task._pdata.endDate
+    console.log('show:', task);
+  } else if (flag === 'leave'){
+    // detailDiv.style.display = 'none'
+    console.log('hide:', task);
+  } else {
+    this.callback(task);
+    console.log('click:', task);
+  }
+}
+
+
+/**
+ * 根据任务状态区分颜色
+ * 
+ */
+GanttChart.prototype.statusColor =function(task) {
+  switch (task.status) {
+    case '按时完成':
+      return 'aqua';
+      break;
+    case '计划批准':
+      return '#ff9800';
+      break;
+    case '已完成':
+      return '#19b720';
+      break;
+    default:
+      break;
+  }
+}
+
+/**
+ * 判断任务是否在视图内
+ * 
+ */ 
+GanttChart.prototype.isInView = function(task) {
+  let isLessThanEndAt = (task.endDate <= this.startAt.format('YYYY-MM-DD'))
+  let isGreaterThanStartAt = task.startDate >= this.endAt.format('YYYY-MM-DD')
+  return !(isLessThanEndAt || isGreaterThanStartAt)
+}
+
+/**
+ * 分组绘制任务块
+ *
+ */
+
+GanttChart.prototype.drawTasks = function() {
+  if (this.graphGroup) {
+    this.graphGroup.clear();
+  } else {
+    this.graphGroup = this.gCanvas.addGroup();
+    this.graphGroup._tname = 'graphGroup';
+  }
+  // 第一层循环,用于分组,例如,维保--xxxx
+  this.tasks.forEach((topTask, topIndex) => {
+    if (topTask.open) {
+      let taskGroup = null;
+      taskGroup = this.graphGroup.addGroup();
+      taskGroup._tname = 'TaskGroup_' + topTask.id;
+      topTask.gGroup = taskGroup;
+      // 第二层循环,用于 区分具体多少任务,例如,维保-商管1/商管2...    
+      topTask.dataList.forEach((taskP, index) => {                            
+        let taskPGroup = taskGroup.addGroup();
+        taskGroup.addGroup(taskPGroup);
+        // 第三层循环,用户区分每个子任务的执行时间段,例如:维保-商管1-2020.05-2020.06 / 2020.08- 2020.09
+        taskP.tasks.forEach((_taskItem, _index) => {
+          let _isInView = this.isInView(_taskItem)
+          // 在视图中才显示
+          if(_isInView){
+            let pos = this.calRectPos(_taskItem);
+            // console.log('render rect:', _taskItem, pos, topTask.renderOptions.startY + index * taskRowHeight);
+            let rectEl = taskPGroup.addShape('rect', {
+              attrs: {
+                x: pos.x,
+                y: topTask.renderOptions.startY + (index* (this.taskRowHeight + this.rowSpanDis)),
+                width: pos.width,
+                height: this.taskRowHeight,
+                fill: this.statusColor(_taskItem),
+                stroke: 'black',
+                radius: [2, 4],
+              },
+            });
+            rectEl._pdata = _taskItem;
+            rectEl.on('mouseover', (ev) => {
+              this.handleClick(ev.target, 'enter', ev);
+            });
+            rectEl.on('mouseleave', (ev) => {
+              this.handleClick(ev.target, 'leave', ev);
+            });
+            rectEl.on('click', (ev) => {
+              this.handleClick(ev.target, 'click', ev);
+            });
+          }
+        });
+      });
+
+      taskGroup.show();
+    } else {
+      if (topTask.gGroup) {
+        // topTask.gGroup.hide()
+        topTask.gGroup = null;
+      }
+    }
+  });
+}
+
+/**
+ * 根据 Task 计算矩形位置
+ *
+ */
+GanttChart.prototype.calRectPos = function(taskItem) {
+  let duraStartAt = new Date(taskItem.startDate) - new Date(this.startAt.format('YYYY-MM-DD'));
+  let secondsStartAt = duraStartAt/1000
+
+  let duraEndAt = new Date(taskItem.endDate) - new Date(taskItem.startDate);        
+  let secondsEndAt = duraEndAt/1000
+  return {
+    x: secondsStartAt * this.timePerPix,
+    y: 0,
+    width: secondsEndAt * this.timePerPix,
+    height: 0,
+  };
+}
+
+/**
+ * 主函数
+ *
+ */
+
+GanttChart.prototype.main = function() {  
+  this.initDrawingReady();
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 26486 - 0
src/utils/ganttChart/g.js


+ 1 - 2
src/views/Device/index.vue

@@ -7,8 +7,7 @@
     />
 
     <Modal
-      :obj="
-      obj"
+      :obj="obj"
       :routerName="routerName"
       @handlerouterName="handlerouterName"
     />

+ 188 - 36
src/views/analysis/CoreDeviceReport.vue

@@ -9,7 +9,7 @@
                 tipPlace='top'
                 caption='系统名称:'
                 @change='changeCurSystem'
-                v-model='systemName'
+                v-model='systemId'
                 :selectdata='systemList'
                 :placeholder='"请选择"'
             />
@@ -49,17 +49,20 @@
                             style='display: inline-block;width: 6px;height:6px;border-radius: 3px;background: #0091FF;'
                             :style='{"background": !scope.row.is_exception?"#0091FF" : "#F54E45"}'
                         ></span>
-                        <span style='margin-left: 10px'>{{ !scope.row.status?'正常' : '异常' }}</span>
+                        <span style='margin-left: 10px'>{{ !scope.row.is_exception?'正常' : '异常' }}</span>
                     </template>
                 </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 }}张</span>
+                        <!-- <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>
                     </template>
                 </el-table-column>
-                <el-table-column prop='report' label='报告'>
+                <el-table-column prop='attachments_num' label='报告'>
                     <template slot-scope='scope'>
-                        <span style='color: #025BAA'>{{ scope.row.report }}</span>
+                        <span
+                            style='color: #025BAA'
+                        >{{ scope.row.attachments_num || scope.row.attachments_num === 0?(scope.row.attachments_num+ '张') : '—'}}</span>
                     </template>
                 </el-table-column>
             </el-table>
@@ -73,32 +76,48 @@
                     @current-change='changeTablePage'
                 ></el-pagination>
             </div>
-            <el-dialog title='交换机-照明系统' :visible.sync='dialogTableVisible'>
+            <el-dialog title='交换机-照明系统' :visible.sync='dialogTableVisible' width='1260px'>
                 <el-date-picker
                     style='margin-bottom: 12px;'
                     v-model='dialogTime'
                     type='daterange'
                     range-separator='至'
+                    @change='changeTime'
                     start-placeholder='开始日期'
                     end-placeholder='结束日期'
                 ></el-date-picker>
-                <el-table :data='tableData' style='margin-bottom: 55px'>
-                    <el-table-column property='serialNumber' label='日期'></el-table-column>
-                    <el-table-column property='equipmentName' label='事项类型'></el-table-column>
-                    <el-table-column property='equipmentNumber' label='事项名称'></el-table-column>
-                    <el-table-column property='photos_num' label='照片'>
+                <el-table :data='historyTableData' style='margin-bottom: 55px;' max-height='500'>
+                    <el-table-column width='200' property='finishDate' label='日期'></el-table-column>
+                    <el-table-column width='100' property='typeName' label='事项类型'></el-table-column>
+                    <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.photos_num?scope.row.photos_num : 0 }}张</span>
+                            <!-- <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>
                         </template>
                     </el-table-column>
-                    <el-table-column property='report' label='报告'>
+                    <el-table-column width='100' property='attachmentsNum' label='报告'>
                         <template slot-scope='scope'>
-                            <span style='color: #025BAA'>{{ scope.row.report }}</span>
+                            <span
+                                style='color: #025BAA'
+                            >{{ scope.row.attachmentsNum || scope.row.attachmentsNum === 0?(scope.row.attachmentsNum+ '张') : '—'}}</span>
                         </template>
                     </el-table-column>
                 </el-table>
                 <div class='page'>
-                    <el-pagination background layout='prev, pager, next' :total='tatol'></el-pagination>
+                    <el-pagination
+                        background
+                        layout='prev, pager, next'
+                        :current-page='hisCurPage'
+                        :page-size='hisPageSize'
+                        :total='hisTotal'
+                        @current-change='changeHisTablePage'
+                    ></el-pagination>
+                </div>
+            </el-dialog>
+            <el-dialog :title='detailTitle' :visible.sync='showDetail' width='1260px'>
+                <div class='detail-container'>
+                    <div class='pictures-menu'></div>
                 </div>
             </el-dialog>
         </div>
@@ -107,12 +126,13 @@
 
 <script>
 import { Select, Input } from 'meri-design'
-import { queryEquipmentList, queryTableData } from '../../api/coreDeviceReport'
+import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData, queryDetailData } from '../../api/coreDeviceReport'
 import _ from 'lodash'
+import moment from 'moment'
 export default {
     data() {
         return {
-            systemName: '', // 系统名称
+            systemId: '', // 当前系统Id
             systemList: [], // 系统
             systemContentData: [
                 { id: 1, name: '高压配电柜', isMaintenance: true, num: 95, statusNum: 0, abnormal: false, isActive: true },
@@ -131,7 +151,19 @@ export default {
             pageSize: 10, // 每页条数
             tatol: 0, // 总数据
             dialogTableVisible: false, // 弹窗显示状态
-            dialogTime: '' // 弹框内的时间
+
+            // 核心设备实例
+            assetnum: null, // 设备台账编码
+            historyTableData: [], // 核心设备实例的所有历史事项信息
+            dialogTime: null, // 弹框内的时间
+            hisCurPage: 1, // 当前页码
+            hisPageSize: 8, // 当前页码
+            hisTotal: 0, // 总条数
+            startTime: null, // 开始时间
+            endTime: null, // 结束事件
+
+            showDetail: false, // 显示照片、报告详情
+            detailTitle: '图片预览' // 弹窗名称
         }
     },
 
@@ -144,6 +176,7 @@ export default {
 
     mounted() {
         this.getSystemList()
+        this.getEquipmentOfSystem()
         this.getTableData()
     },
 
@@ -152,23 +185,19 @@ export default {
          * 获取系统列表数据
          */
         getSystemList() {
-            queryEquipmentList()
-                .then(res => {
-                    if (res.result === 'success') {
-                        let data = res.data
-                        let newData = []
-                        _.forEach(data, item => {
-                            newData.push({
-                                id: item.code,
-                                name: item.name
-                            })
+            querySystemList().then(res => {
+                if (res.result === 'success') {
+                    let data = res.data
+                    let newData = []
+                    _.forEach(data, item => {
+                        newData.push({
+                            id: item.code,
+                            name: item.name
                         })
-                        this.systemList = newData
-                    }
-                })
-                .catch(err => {
-                    console.err(err)
-                })
+                    })
+                    this.systemList = newData
+                }
+            })
         },
         /**
          * 切换系统名称
@@ -177,6 +206,21 @@ export default {
             console.log('val', val)
         },
         /**
+         * 获取系统下的设备
+         */
+        getEquipmentOfSystem() {
+            let param = {
+                plazaId: 1000423,
+                ccode: 1002347
+            }
+            if (this.systemId !== '') {
+                param.smsxt = this.systemId
+            }
+            queryEquipmentList('/data/home/querySystemCard', param).then(res => {
+                console.log('res', res)
+            })
+        },
+        /**
          * 切换系统下的设备
          */
         changeEquipment(id) {
@@ -216,8 +260,105 @@ export default {
          * 显示设备实例的维保、专维等状态
          */
         showEquipmentStatus(row, column, e) {
-            console.log('row', row)
-            this.dialogTableVisible = true
+            setTimeout(() => {
+                if (this.showDetail) return
+                this.dialogTableVisible = true
+                this.assetnum = row.assetnum
+                this.initTimePicker()
+            }, 36)
+        },
+        /**
+         * 获取核心设备实例的所有历史事项信息
+         */
+        getEquipmentHistoryMsg() {
+            this.historyTableData = []
+            let param = {
+                page: this.hisCurPage,
+                size: this.hisPageSize,
+                // assetnum: this.assetnum,
+                assetnum: 8952,
+                // startDate: this.startTime,
+                startDate: 20180101000000,
+                // endDate: this.endTime
+                endDate: 20180201000000
+            }
+            queryHistoryTableData('/data/base/queryDateByAssetNum', param).then(res => {
+                const { result, data, count } = res
+                if (result === 'success') {
+                    this.historyTableData = data
+                    this.hisTotal = count
+                    _.forEach(this.historyTableData, item => {
+                        let name
+                        switch (item.type) {
+                            case '0':
+                                name = '专维'
+                                break
+                            case '1':
+                                name = '维保'
+                                break
+                            case '2':
+                                name = '第三方检测'
+                                break
+                        }
+                        item.typeName = name
+                    })
+                }
+            })
+        },
+        /**
+         * 初始化时间选择器
+         */
+        initTimePicker() {
+            let endTime = new Date(),
+                startTime = new Date(endTime.getTime() - 1000 * 60 * 60 * 24 * 30)
+            this.dialogTime = [startTime, endTime]
+            this.changeTime()
+        },
+        /**
+         * 切换时间
+         */
+        changeTime() {
+            this.hisCurPage = 1
+            if (this.dialogTime) {
+                this.startTime = moment.unix(new Date(this.dialogTime[0]).getTime() / 1000).format('YYYYMMDDHHmmss')
+                this.endTime = moment.unix(new Date(this.dialogTime[1]).getTime() / 1000).format('YYYYMMDDHHmmss')
+            } else {
+                this.initTimePicker()
+            }
+            this.getEquipmentHistoryMsg()
+        },
+        /**
+         * 切换设备台账下所有历史事项信息页码
+         */
+        changeHisTablePage(page) {
+            this.hisCurPage = page
+            this.getEquipmentHistoryMsg()
+        },
+        /**
+         * 显示图片详情
+         */
+        showPicturesDetail(val) {
+            console.log('val', val)
+            // if (!val.file_type || !val.file_type_id) {
+            //   return
+            // }
+            this.showDetail = true
+            this.detailTitle = '图片预览'
+            this.getDetailData(val)
+        },
+        /**
+         * 获取图片/报告详情
+         */
+        getDetailData(val) {
+            let param = {
+                file_type: 1, // val.file_type
+                file_type_id: 2467908, // val.file_type_id
+                type: this.detailTitle === '图片预览' ? 0 : 1
+            }
+
+            queryDetailData('/data/base/queryFileDetails', param).then(res => {
+                console.log('res', res)
+            })
         }
     }
 }
@@ -323,6 +464,17 @@ export default {
             display: flex;
             justify-content: flex-end;
         }
+        .el-dialog {
+            min-height: 600px;
+        }
+        .detail-container {
+            display: flex;
+            min-height: 600px;
+        }
+        .pictures-menu {
+            margin-right: 21px;
+            width: 180px;
+        }
     }
 }
 </style>

+ 184 - 6
src/views/analysis/GanttChart.vue

@@ -8,9 +8,10 @@
         :isReadOnly="true" 
         tipPlace="top" 
         caption="系统名称:"
-        v-model="systemName" 
+        v-model="systemId" 
         :selectdata="systemList" 
         :placeholder="'请选择'"
+        @change="getGanttChartData"
       />
       <div class="legend-container">
         <div v-for="(item) in legends" :key="'key_' + item.id" class="item-legend">
@@ -26,24 +27,46 @@
       </div>
     </div>
     <div class="main-gantt-container">
+      <div class="task-title">
+        <div class="title">任务标题</div>
+        <Tree :data="treeData" @openNode="toggleNode" />
+      </div>
+      <div class="chart-container" id="chartContainer" ref="chartContainer">
+        <div id="ganttContainer"></div>
+      </div>
+      <el-dialog :title="detailTitle" :visible.sync="showDetail" width="840px">
 
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
+import { queryGanttChart } from '../../api/ganttChart';
+import { querySystemList } from '../../api/coreDeviceReport';
+import { Tree } from 'meri-design';
+import _ from 'lodash';
+import moment from 'moment';
+// import '../../utils/ganttChart/g.js';
+import { GanttChart } from '../../utils/ganttChart/GanttChart.js';
+import { parse } from 'path';
 export default {
   data () {
     return {
       systemList: [], // 系统列表
-      systemName: '', // 系统名称
+      systemId: '', // 系统名称
       legends: [
         {id: 1, text: '按时完成', backgroundColor: '#E7E9EA', borderColor: '#C3C7CB'},
         {id: 2, text: '未开始/进行中', backgroundColor: 'rgba(91, 143, 249, 0.2)', borderColor: '#5B8FF9'},
-        {id: 3, text: '按时完成', backgroundColor: '#FBCE99', borderColor: '#F58300'},
-        {id: 4, text: '按时完成', backgroundColor: '#FBB8B5', borderColor: '#F54E45'},
+        {id: 3, text: '逾期完成', backgroundColor: '#FBCE99', borderColor: '#F58300'},
+        {id: 4, text: '逾期未完成', backgroundColor: '#FBB8B5', borderColor: '#F54E45'},
       ], // 图例
       timeType: 'month', // 甘特图时间类型
+      treeData: [], // 树结构数据
+      
+      // 弹窗相关
+      showDetail: false, // 弹框显示状态
+      detailTitle: '', // 弹窗标题
     }
   },
 
@@ -51,9 +74,143 @@ export default {
 
   computed: {},
 
-  mounted() {},
+  mounted() {
+    this.getSystemList();
+  },
 
-  methods: {}
+  methods: {
+    /**
+     * 获取系统列表数据
+     */
+    getSystemList() {
+      querySystemList().then((res) => {
+        if (res.result === 'success') {
+          let data = res.data;
+          let newData = [];
+          _.forEach(data, (item) => {
+            newData.push({
+              id: item.code,
+              name: item.name
+            })
+          })
+          this.systemId = newData[0].id;
+          this.systemList = newData;
+          this.getGanttChartData();
+        }
+      })
+    },
+    /**
+     * 处理请求数据的时间
+     */
+    disQueryTime() {
+      let startTime, endTime;
+      let curTime = new Date(),
+          curYear = curTime.getFullYear(),
+          curMonth = curTime.getMonth() + 1;
+      if (this.timeType === 'month') {
+        startTime = `${curYear}0101000000`;
+        endTime = `${curYear + 1}0101000000`;
+      } else {
+        startTime = `${curYear}${curMonth}01000000`;
+        if (curMonth + 1 > 12) {
+          endTime = `${curYear + 1}0101000000`;
+        } else {
+          endTime = `${curYear}${curMonth + 1}01000000`;
+        }
+      }
+      return [startTime, endTime];
+    },
+    /**
+     * 获取甘特图数据
+     */
+    getGanttChartData() {
+      let time = this.disQueryTime();
+      let param = {
+        smsxt: this.systemId,
+        plazaId: 1000423,
+        startDate: 20000101000000, // time[0]
+        endDate: 20200708000000, // time[1]
+      }
+      queryGanttChart('/data/base/queryGanttChart', param).then((res) => {
+        const { dsfList, wbList, zwList, result } = res;
+          console.log('res', res)
+        if (result === 'success') {
+          let newData = [],
+              data = [wbList, zwList, dsfList],
+              name = ['维保', '专维', '第三方检测'];
+          _.forEach(data, (item, index) => {
+            newData.push({
+              id: index + 1,
+              name: name[index],
+              open: true,
+              children: name[index] === '专维'?[] : this.disGanttData(dsfList)
+            })
+          })
+          
+          this.treeData = newData;
+          
+          let taskData = _.map(_.cloneDeep(newData), (item) => {
+            return {
+              id: item.id,
+              type: item.name,
+              open: item.open,
+              dataList: _.map(item.children, (_item) => {
+                return {
+                  id: _item.id,
+                  title: _item.name,
+                  tasks: _item.originData
+                }
+              })
+            }
+          })
+          console.log('taskData', taskData)
+          let width = this.$refs.chartContainer.offsetWidth;
+          window.gc = new GanttChart({
+            viewWidth: width,
+            cWidth: 3*width,
+            tasks: taskData,
+            chartContainer: 'chartContainer',
+            daysCount: parseInt(3*width/40),
+            callback: this.showDialog
+          });
+          gc.main()
+        }
+      })
+    },
+    /**
+     * 处理甘特图数据
+     */
+    disGanttData(arr) {
+      let data = [];
+      _.forEach(arr, (item) => {
+        data.push({
+          id: item.id,
+          name: item.name,
+          checked: 'uncheck',
+          originData: _.map(item.data, (_item) => {
+            _item.startDate = moment.unix((new Date().getTime() - 1000*60*60*24*7)/1000).format('YYYY-MM-DD HH:mm:ss');
+            _item.endDate = moment.unix(new Date().getTime()/1000).format('YYYY-MM-DD HH:mm:ss');
+            _item.description = _item.parentname;
+            return _item
+          })
+        })
+      })
+      return data
+    },
+    /**
+     * 展开收起节点
+     */
+    toggleNode(status) {
+      console.log('status', status)
+    },
+    /**
+     * 显示弹窗
+     */
+    showDialog(task) {
+      this.showDetail = true;
+      this.detailTitle = task._pdata.description;
+    }
+  }
 }
 </script>
 
@@ -99,6 +256,27 @@ export default {
     width: 100%;
     height: calc(100% - 44px);
     background: #F2F5F7;
+    border:1px solid rgba(239,240,241,1);
+    border-radius:4px;
+    display: flex;
+    .task-title{
+      width: 404px;
+      height: 100%;
+      border-right: 1px solid #EFF0F1;
+      .title{
+        padding-left: 32px;
+        padding-top: 15px;
+        padding-bottom: 15px;
+        font-size: 14px;
+        color: #646C73;
+        line-height: 19px;
+        border-bottom: 1px solid #EFF0F1;
+      }
+    }
+    .chart-container{
+      flex: 1;
+      overflow: hidden;
+    }
   }
 }
 </style>

+ 82 - 12
src/views/analysis/SpecificationUpdateRecord.vue

@@ -8,7 +8,7 @@
         :isReadOnly="true" 
         tipPlace="top" 
         caption="事件类型:"
-        @change="testClick" 
+        @change="changeTablePage(1)"
         v-model="incidentType" 
         :selectdata="incidentList" 
         :placeholder="'请选择'"
@@ -18,20 +18,24 @@
         type="daterange"
         range-separator="至"
         start-placeholder="开始日期"
-        end-placeholder="结束日期">
+        end-placeholder="结束日期"
+        @change="changeTime">
       </el-date-picker>
     </div>
     <el-table :data="tableData" style="margin-bottom: 19px">
-      <el-table-column property="date" label="日期"></el-table-column>
-      <el-table-column property="itemType" label="事项类型"></el-table-column>
-      <el-table-column property="serialNumber" label="编号"></el-table-column>
-      <el-table-column property="update" label="更新内容"></el-table-column>
+      <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>
+      <el-table-column property="content" label="更新内容"></el-table-column>
     </el-table>
     <div class="page">
       <el-pagination
         background
         layout="prev, pager, next"
-        :total="tatol">
+        :current-page="curPage"
+        :page-size="pageSize"
+        :total="tatol"
+        @current-change="changeTablePage">
       </el-pagination>
     </div>
   </div>
@@ -39,14 +43,26 @@
 </template>
 
 <script>
+import { getSpecificaltionData } from '../../api/specificationUpdateRecord';
+import moment from 'moment';
+import _ from 'lodash';
 export default {
   data () {
     return {
-      incidentList: [], // 事件列表
+      incidentList: [
+        {id: 0, name: '专维'},
+        {id: 1, name: '维保'},
+        {id: 2, name: '第三方检测'},
+        {id: 3, name: '重点关注'},
+      ], // 事件列表
       incidentType: '', // 事件类型
       timeVal: '', // 时间
       tableData: [], // 表数据
-      tatol: 100, // 数据总量
+      curPage: 1, // 当前页码
+      pageSize: 10, // 每页条数
+      tatol: 0, // 数据总量
+      startTime: 20171027000000, // 开始时间
+      endTime: 20171028000000, // 结束事件
     }
   },
 
@@ -54,11 +70,65 @@ export default {
 
   computed: {},
 
-  mounted() {},
+  mounted() {
+    this.getTableData();
+  },
 
   methods: {
-    testClick() {
-
+    /**
+     * 获取表数据
+     */
+    getTableData() {
+      let param = {
+        page: this.curPage,
+        size: this.pageSize,
+        plazaId: 1000423,
+        // changeDateStartDate: 20171027000000,
+        // changeDateEndDate: 20171028000000,
+      }
+      if (this.startTime !== '') {
+        param.changeDateStartDate = this.startTime;
+      }
+      if (this.endTime !== '') {
+        param.changeDateEndDate = this.endTime;
+      }
+      if (this.incidentType !== '') {
+        param.objtype = this.incidentType;
+      }
+      getSpecificaltionData('/data/rpt_change_record/query', param).then((res) => {
+        const { result, data, count } = res;
+        if (result === 'success') {
+          this.tatol = count;
+          _.map(data, (item) => {
+            let text = _.find(this.incidentList, (o) => {return o.id === item.objtype}).name
+            item.evenType = text;
+            item.time = moment.unix(item.changedate / 1000).format('YYYY.MM.DD')
+            return
+          })
+          this.tableData = data;
+        }
+      })
+    },
+    /**
+     * 切换页码
+     */
+    changeTablePage(page) {
+      this.curPage = page;
+      this.getTableData();
+    },
+    /**
+     * 切换时间
+     */
+    changeTime() {
+      this.curPage = 1;
+      if (this.timeVal) {
+        this.startTime = moment.unix(new Date(this.timeVal[0]).getTime() / 1000).format('YYYYMMDDHHmmss');
+        this.endTime = moment.unix(new Date(this.timeVal[1]).getTime() / 1000).format('YYYYMMDDHHmmss');
+      } else {
+        this.startTime = 20171027000000;
+        this.endTime = 20171028000000;
+      }
+      this.getTableData();
     }
   }
 }

+ 422 - 0
src/views/homepage/index.vue

@@ -0,0 +1,422 @@
+<template>
+    <main class="homepage">
+        <section class="homepage-cards-content">
+            <div class="cards-item" v-for="(item , index) in cardsList" :key="index" :style = itemStyle(item)>
+                <h4>{{item.smsxtname}}</h4>
+                <div class="equipment-list">
+                    <div @click="navToInnerPage(item, equip)" class="equipment-item" v-for="equip in item.assetTypeList" >
+                        <h5>{{equip.category_name}}</h5>
+                        <section>
+                            <div class="equip-statis"><span class="equip-number">{{equip.asset_num}}</span><span class="equip-unit">台</span></div>
+                            <div class="expired-number" v-if="equip.is_exception_num">异常:{{equip.is_exception_num}}</div>
+                        </section>
+                    </div>
+                </div>
+                <div class="alert-list">
+                    <div class="alert-item"   v-for="(option , index) in  item.rptGlsmsStatisticsList" :key="index" >
+                        <img v-if="option.level"  :src="srcList[option.type][option.level]"> 
+                        <div  class="content">
+                            <p class="line">
+                                <span >{{option.type === 1 ? '维保': option.type === 0 ? '专维' :  '第三方视图' }}</span>
+                                <span><em :style="{color:item.level == 1? '#646C73': item.level == 2 ? '#E07A04 ' :'#C13830'}">{{option.unfinished}}</em>/<em>{{option.total}}</em></span>
+                            </p>
+                            <p class="desc">当月未完成/总任务</p>
+                        </div>
+                    </div>
+                </div>
+                <div v-if="!item.rptGlsmsStatisticsList || !item.rptGlsmsStatisticsList.length" class="empty-content">暂无数据</div>
+            </div>
+        </section>
+        <section class="homepage-nav-list">
+            <nav>
+                <div class="main-title">
+                    <span>重点关注事项</span>
+                    <a @click="navToFocusItem">更多</a>
+                </div>
+                <div class="table">
+                    <div class="row table-header">
+                        <article>日期</article>
+                        <article>政府部门</article>
+                        <article>记录事项</article>
+                    </div>
+                    <div class="table-body">
+                        <div class="row" v-for="(item , index) in itemsList" :key="index">
+                            <article>{{item.createdate}}</article>
+                            <article>{{item.department}}</article>
+                            <article>{{item.recordsx}}</article>
+                        </div>
+                    </div>
+                </div>
+            </nav>
+            <nav>
+                <div class="main-title">
+                    <span>说明书更新记录</span>
+                    <a @click="navToIntroduce">更多</a>
+                </div>
+                <div class="table">
+                    <div class="row table-header">
+                        <article>日期</article>
+                        <article>政府部门</article>
+                        <article>记录事项</article>
+                    </div>
+                    <div class="table-body">
+                        <div class="row" v-for="(item , index) in changeList" :key="index">
+                            <article>{{item.changedate}}</article>
+                            <article>{{item.type}}</article>
+                            <article>{{item.content}}</article>
+                        </div>
+                    </div>
+                </div>
+            </nav>
+        </section>
+    </main>
+</template>
+
+<script>
+import {getCardList, getQueryList, getChangeList} from "@/api/homePage"
+import moment from 'moment'
+export default {
+    data() {
+        return {
+            cardsList:[],
+            itemsList:[],
+            changeList:[],
+            srcList:{
+                0:{ 
+                    1: require("../../assets/images/icons/edit_blue_b.png"),    //1.正常(蓝色) 2.警告(黄色) 3.严重(红色)
+                    2: require("../../assets/images/icons/edit_yellow_b.png"),
+                    3: require("../../assets/images/icons/edit_red_b.png")
+                },
+                1:{
+                    1: require("../../assets/images/icons/fix_blue_b.png"),    
+                    2: require("../../assets/images/icons/fix_yellow_b.png"),
+                    3: require("../../assets/images/icons/fix_red_b.png")
+                },
+                2:{
+                    1: require("../../assets/images/icons/search_blue_b.png"),    
+                    2: require( "../../assets/images/icons/search_yellow_b.png"),
+                    3: require("../../assets/images/icons/search_red_b.png")
+                }
+            }
+        }
+    },
+    mounted () {
+        this.testAjax()
+        this.getItemsQuery()
+        this.getInstructionList()
+    },
+    methods:{
+        navToFocusItem () {
+            this.$router.push({path:""})
+        },
+        navToIntroduce () {
+            this.$router.push({path:""})
+        },
+        itemStyle (option) {
+            let num = 0
+            option.assetTypeList.forEach(item=>{
+                num +=  item.is_exception_num
+            })
+            if (option.rptGlsmsStatisticsList) {
+                option.rptGlsmsStatisticsList.forEach(option => {
+                    num +=  option.unfinished
+                })
+            }
+            if (num > 0) {
+                return {
+                    borderLeft:"3px solid #EF6B66"
+                }
+            }
+        },
+        navToInnerPage (item, equip) {
+            this.$router.push({path:"./analysis", query:{smsxt:item.smsxt, equipId: equip.id}})
+        },
+        //TODO plazaId目前是写死的 后期需要更换成用户对应的ID
+        testAjax () {
+            let params = {
+                getParams: {
+                    "plazaId":1000423,
+                }
+            }
+            getCardList(params).then(res => {
+                if (res.result == 'success') {
+                    let result = res.data
+                    if (result && Array.isArray(result)) {
+                        this.cardsList = result
+                    }
+                }
+            })
+        },
+        /**
+         * 获取说明书变更记录
+         */
+        getInstructionList () {
+            let params = {
+                getParams: {
+                    "plazaId":1000423,
+                    "page":1,
+                    "size":10,
+                }
+            }
+ 
+            getChangeList(params).then(res => {
+                if (res.result == 'success') {
+                    let result = res.data
+                    result.forEach(item=>{
+                        item.changedate = moment.unix(item.changedate / 1000).format('YYYY.MM.DD')
+                        if (item.objtype === 0) {
+                            item.type = "专维"
+                        } else if( item.objtype === 1) {
+                            item.type = "维保"
+                        } else if( item.objtype === 2) {
+                            item.type = "第三方视图"
+                        } else {
+                            item.type = "综合事项"
+                        }
+                    })
+                   
+                    if (result && Array.isArray(result)) {
+                        this.changeList = result
+                    }
+                }
+            })
+        },
+        getItemsQuery () {
+            let params = {
+                getParams: {
+                    // department=部门 //部门
+                    "startDate":"20200208000000", //开始时间  
+                    "endDate":"20200608000000", //结束时间  
+                    "plazaId":1000423, //广场id 必填
+                    "page":1,//页数
+                    "size":10,//条数
+                    // "orderBy":字段名,1;//排序,1正序,0,倒序
+                    // keyword=关键字1:字段名11,字段名12;关键字2:字段名21,字段名22;//模糊查询参数
+                }
+            }
+            getQueryList(params).then(res=>{
+                moment().format('YYYY.MM.DD HH:mm')
+                if (res.result == 'success') {
+                    if (res.data && Array.isArray(res.data)) {
+                        res.data.forEach(item => {
+                            item.createdate = moment.unix(item.createdate / 1000).format('YYYY.MM.DD')
+                        })
+                        this.itemsList = res.data
+                    }
+                    
+                }
+            })
+        },
+    }
+}
+</script>
+
+<style lang='less'>
+.homepage {
+    display: flex;
+    justify-content: space-between;
+    height: calc(100vh - 48px);
+    padding: 15px;
+    background: rgba(242, 245, 247, 1);
+    overflow: auto;
+    .homepage-cards-content{
+        display: flex;
+        flex-wrap: wrap;
+        justify-content: space-between;
+        align-content:flex-start;
+        width: 70%;
+        .cards-item{
+            width: calc(50% - 5px);
+            height: 24%;
+            padding:0.4rem;    
+            padding-bottom: 0;
+            margin-bottom: 1rem;
+            background: #fff;
+            box-shadow: 0 2px 10px 0 rgba(31, 36, 41, 0.06);
+            h4 {
+                margin-bottom: 0.8rem;
+                color: rgba(31, 36, 41, 1);
+                padding:1rem;
+                font-size: 1.6rem;
+                font-weight: bold;
+            }
+            .equipment-list{
+                display: flex;
+                padding-bottom: 2rem;
+                padding:1rem;
+                .equipment-item{
+                    width: 33.33%;
+                    cursor: pointer;
+                    h5{
+                        color: #1F2429;
+                        font-size: 1.4rem;
+                        // font-weight: bold;
+                        margin-bottom: 1.2rem;
+                    }
+                    section{
+                        display: flex;
+                        justify-content: flex-start;
+                        align-items: center;
+                        .equip-statis{
+                            .equip-number{
+                                font-size: 1.8rem;
+                                font-weight: bold;
+                                color:rgba(31, 36, 41, 1)
+                            }
+                            .equip-unit{
+                                color: #ccc;
+                                font-size: 1.2rem;
+                            }
+                        }
+                        .expired-number{
+                            width: 7.2rem;
+                            height: 2rem;
+                            margin-left: 3rem;
+                            text-align: center;
+                            line-height: 2rem;
+                            font-size: 1.2rem;
+                            color: #C13830;
+                            background: #FFE7E6;
+                        }
+                    }
+                }
+            }
+            .alert-list{
+                display: flex;
+                align-items: center;
+                justify-content: flex-start;
+                padding-top: 2rem;
+                border-top: 1px solid #F5F6F7;
+                border-radius: 4px;
+                cursor: pointer;
+                padding: 14px;
+                &:hover{
+                    background: #F5F6F7;
+                }
+                .alert-item{
+                    display: flex;
+                    width: 33.33%;
+                    align-items: center;
+                    img{
+                        width: 4rem;
+                        height: 4rem;
+                        margin-right: 1.4rem;
+                    }
+                    .content{
+                        border-right: 1px solid #F5F6F7;
+                        padding-right: 2rem;
+                        .line{
+                            display: flex;
+                            justify-content: space-between;
+                            align-items: center;
+                            line-height: 1;
+                            span:first-child{
+                                margin-right: 1rem;
+                                font-size: 1.2rem;
+                                color: #1F2429;
+                                font-weight: bold;
+                            }
+                            em{
+                                font-weight: normal;
+                            }
+                            em:first-child{
+                                font-size: 1.6rem;
+                                font-weight: bold;
+                            }
+                        }
+                        .desc{
+                            padding-top: 0.6rem;
+                            color: #8D9399;
+                            font-size: 1.2rem;
+                            text-align: right;
+                        }
+                    }
+                }
+            }
+            .empty-content{
+                text-align: center;
+                color: #8D9399;
+            }
+        }
+    }
+    .homepage-nav-list {
+        width: calc(30% - 10px);
+        nav:first-child{
+            height: 320px;
+        }
+        nav:last-child{
+            height: 320px;
+        }
+        nav{
+            padding: 14px 16px;
+            margin-bottom: 10px;
+            background: white;
+            overflow: hidden;
+            box-shadow: 0 2px 10px 0 rgba(31, 36, 41, 0.06);
+            .main-title{
+                display: flex;
+                justify-content: space-between;
+                margin-bottom: 12px;
+                span:first-child{
+                    color: #1F2429;
+                    font-weight: bold;
+                    font-size:1.4rem;
+                }
+            }
+            .table{
+                .row{
+                    display: flex;
+                    align-items: center;
+                    padding: 6px;
+                    border-bottom: 1px solid #E4E6E7;
+                    article{
+                        margin-right: 10px;
+                    }
+                    article:nth-of-type(1) {
+                        width: 20%;
+                    }
+                    article:nth-of-type(2) {
+                        width: 30%;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                    }
+                    article:nth-of-type(3) {
+                        width: calc(50% - 30px);
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        display: -webkit-box;
+                        -webkit-line-clamp: 2;
+                        -webkit-box-orient: vertical;
+                    }
+                }
+                .table-header{
+                    height: 3.2rem;
+                    padding: 6px;
+                    line-height: 3.2rem;
+                    color:#646A73;
+                    font-weight: 600;
+                    border-bottom: none;
+                    background: #F8F9FA;
+                }
+                .table-body{
+                    overflow: auto;
+                }
+            }
+        }
+        nav:first-child{
+            height: 40%;
+            .table-body{
+                height: 27vh;
+            }
+        }
+        nav:last-child{
+            height: calc(60% - 12px);
+            .table-body{
+                height: 45vh;
+            }
+        }
+    }
+
+}
+</style>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1378 - 0
src/views/statistics/index.vue


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 26486 - 0
static/g.js


+ 8 - 0
vue.config.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2020-06-28 13:40:38
+ * @LastEditTime: 2020-07-08 13:56:32
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \wanda-bm-guide\vue.config.js
+ */ 
 module.exports = {
     devServer: {
         port: 8090,