guoxiaohuan vor 4 Jahren
Ursprung
Commit
defea47f10

+ 3 - 8
public/index.html

@@ -1,7 +1,5 @@
- 
 <!DOCTYPE html>
 <html lang="en">
-
 <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -16,15 +14,12 @@
             border:none!important;
             box-shadow:none!important;
         }
-        .my-leaflet-div-icon{
-            width: auto!important;
-            white-space: nowrap;
-            word-break: normal;
-        }
         .leaflet-container{
             background: #f7f9fa!important;
         }
-        
+        .my-leaflet-div-icon{
+            white-space: nowrap;
+        }
         .leaflet-popup-content-wrapper{
             padding: 0px!important;
             border-radius: 0px!important;

+ 0 - 9
src/api/coreDeviceReport.js

@@ -1,12 +1,3 @@
-/*
- * @Author: your name
- * @Date: 2020-07-03 19:04:47
- * @LastEditTime: 2020-07-12 11:15:12
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \wanda-bm-guide\src\api\coreDeviceReport.js
- */
-
 // 核心设备报表 接口
 import httputils from '@/api/httputils'
 /**

+ 0 - 1
src/api/equipmentList.js

@@ -1,4 +1,3 @@
- 
 import httputils from "@/api/httputils"
 
 // 设备设施-主要设备清单

+ 1 - 0
src/api/httputils.js

@@ -21,6 +21,7 @@ axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
         let token = store.getters['ssoToken']
+        console.log()
         let isPreview = store.getters['isPreview']
         // if (config.url.indexOf('mapapp') < 0) {
         //     config.headers = {

+ 6 - 1
src/api/specificationUpdateRecord.js

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

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 39
src/assets/CHN.geo2.json


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 31986
src/assets/china.json


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1594
src/assets/cityData/济南区域.json


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1447
src/assets/cityData/青岛区域.json


+ 64 - 0
src/components/Legend/src/legend.vue

@@ -22,7 +22,11 @@
             <el-collapse-transition>
                 <div v-if='showView===2'>
                     <lengend-edit
+<<<<<<< HEAD
                         @changeSwitch='handleSwich'
+=======
+                        @handleSwich2='handleSwich2'
+>>>>>>> develop-cd
                         v-if='editTable.length>0'
                         :loading='loading1'
                         ref='editLen'
@@ -51,10 +55,16 @@
             </el-tooltip>
             <!-- 编辑图例 -->
             <el-tooltip effect='dark' content='编辑图例' placement='left'>
+<<<<<<< HEAD
                 <span class='bjtk' v-if='systemName != "土建系统" && isMessage' @click='editTl'>图例</span>
                 <!-- <p v-if='systemName != "土建系统" && isMessage' @click='editTl' class='tltk-1'> -->
                 <!-- <img src='@/assets/imgs/bjtl.png' alt /> -->
                 <!-- </p> -->
+=======
+                <p v-if='systemName != "土建系统" && isMessage' @click='editTl' class='tltk-1'>
+                    <img src='@/assets/imgs/bjtl.png' alt />
+                </p>
+>>>>>>> develop-cd
             </el-tooltip>
             <!-- 新增分布图 -->
             <el-tooltip effect='dark' content='新增分布图' placement='left' v-if='floorSelect.length!=floors.length && type==0'>
@@ -213,16 +223,24 @@ export default {
         async getDraftNum() {
             let res = null,
                 // floorId = this.$cookie.get('floorMapId'),
+<<<<<<< HEAD
                 floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
                 categoryId = this.categoryId || this.$cookie.get('categoryId')
             // console.log('getDraftNum', this.innerLeng, categoryId)
+=======
+                floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId')
+>>>>>>> develop-cd
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
             }
             let data = {
                 Distinct: true,
+<<<<<<< HEAD
                 Filters: `projectId='${this.plazaId}';isPub=false;BuildingId='1';categoryId='${categoryId}';floorId='${floorId}'`,
+=======
+                Filters: `projectId='${this.plazaId}';isPub=false;floorId='${floorId}'`,
+>>>>>>> develop-cd
                 PageNumber: 1,
                 PageSize: 500,
                 Projection: ['floorId']
@@ -353,7 +371,11 @@ export default {
             let categoryId = this.categoryId || this.$cookie.get('categoryId')
             // console.log('queryView', this.innerLeng, categoryId)
             let data = {
+<<<<<<< HEAD
                 categoryId,
+=======
+                categoryId: this.$cookie.get('categoryId'),
+>>>>>>> develop-cd
                 graphId: this.$cookie.get('graphId'),
                 projectId: this.$store.state.plazaId,
                 flag: flag,
@@ -388,7 +410,11 @@ export default {
             let categoryId = this.categoryId || this.$cookie.get('categoryId')
             // console.log('queryEditNum', categoryId)
             let data = {
+<<<<<<< HEAD
                 categoryId,
+=======
+                categoryId: this.$cookie.get('categoryId'),
+>>>>>>> develop-cd
                 graphId: this.$cookie.get('graphId'),
                 projectId: this.$store.state.plazaId,
                 flag: flag,
@@ -405,6 +431,7 @@ export default {
         queryEdit(val) {
             let arr = []
             if (val.length > 0) {
+<<<<<<< HEAD
                 val.forEach(e => {
                     let obj = {
                         BuildingId: '1',
@@ -413,6 +440,17 @@ export default {
                         FloorId: this.$cookie.get('floorMapId'),
                         ProjectId: e.ProjectId,
                         CategoryId: e.GraphCategoryId
+=======
+                val.forEach(el => {
+                    let obj = {
+                        BuildingId: '1',
+                        FloorId: this.$store.state.currentFloor.gname,
+                        ProjectId: this.plazaId,
+                        CategoryId: el.GraphCategoryId,
+                        GraphId: this.$cookie.get('graphId'),
+                        GraphElementId: el.GraphElementId,
+                        Num: el.Num
+>>>>>>> develop-cd
                     }
                     arr.push(obj)
                 })
@@ -422,6 +460,7 @@ export default {
                     Content: arr
                 }
             }
+<<<<<<< HEAD
             updateStatis(params)
                 .then(res => {
                     if (res.Result == 'success') {
@@ -438,6 +477,18 @@ export default {
                     }
                 })
                 .catch(err => {
+=======
+            updateStatis(params).then(res => {
+                if (res.Result == 'success') {
+                    //console.log('更新图例', res)
+                    this.$message({
+                        message: '操作成功',
+                        type: 'success'
+                    })
+                    this.$store.commit('SETSHOWVIEW', 1)
+                    // this.queryEditNum(this.editSwitch)
+                } else {
+>>>>>>> develop-cd
                     this.$message({
                         message: err,
                         type: 'error'
@@ -450,8 +501,11 @@ export default {
                     element.Modify = element.IsModify
                 })
                 this.queryEdit(val)
+<<<<<<< HEAD
                 this.$store.commit('SETSHOWVIEW', 1)
                 this.handleSwich(true)
+=======
+>>>>>>> develop-cd
                 // this.isShow2()
             } else {
                 // this.show2 = false
@@ -503,9 +557,13 @@ export default {
         }
     },
     mounted() {
+<<<<<<< HEAD
         // console.log('lengend mounted')
         // console.log(this.categoryId)
         // console.log('editTips', this.editTips)
+=======
+        console.log('editTips', this.editTips)
+>>>>>>> develop-cd
         this.init()
         // 定时查询草稿箱数量
         // TODO: 1
@@ -672,6 +730,12 @@ export default {
         cursor: pointer;
         border: 1px solid #eee;
     }
+    .tltk-1 {
+        margin-bottom: 10px;
+        display: none;
+        cursor: pointer;
+        border: 1px solid #eee;
+    }
 }
 .edit_map:hover .tltk {
     // display: block;

+ 1 - 0
src/components/floorList.vue

@@ -79,6 +79,7 @@ export default {
         ...mapGetters(['legendTable'])
     },
     mounted() {
+        window.vm = this
         this.init()
     },
     methods: {

+ 10 - 1
src/components/floorMap/index.vue

@@ -130,6 +130,10 @@ export default {
                     this.$store.commit('SETISMESSAGE', false)
                     return
                 } else {
+<<<<<<< HEAD
+=======
+                    console.log('data[0].Elements.Node', data)
+>>>>>>> develop-cd
                     if (
                         data.Data[0].Elements.Nodes.length === 0 &&
                         data.Data[0].Elements.Markers.length === 0 &&
@@ -366,11 +370,16 @@ export default {
                 // })
                 this.topologyParser.imageLegendList.forEach(t => {
                     let id = t.data.GraphElementId
-                    t.maskFlag = !(res.indexOf(id) > -1)
+                    t.selected = res.indexOf(id) > -1
                 })
                 this.topologyParser.relationList.forEach(t => {
+<<<<<<< HEAD
                     let id = t.data.GraphElementId || t.data.GraphElementID
                     t.maskFlag = !(res.indexOf(id) > -1)
+=======
+                    let id = t.data.GraphElementId
+                    t.selected = res.indexOf(id) > -1
+>>>>>>> develop-cd
                 })
             })
         }

+ 61 - 63
src/lib/items/SImageLegendItem.js

@@ -1,6 +1,6 @@
-import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
-import { ItemOrder, SItemStatus } from '@saga-web/big/lib';
-import { SFont, SColor } from '@saga-web/draw/lib';
+import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem'
+import { ItemOrder, SItemStatus } from '@saga-web/big/lib'
+import { SFont, SColor } from '@saga-web/draw/lib'
 /**
  * 图例节点Item(图标类型)
  *
@@ -14,97 +14,96 @@ export class SImageLegendItem extends SIconTextItem {
      * @param data      图例节点对象数据
      */
     constructor(parent, data) {
-        super(parent, data.AnchorList);
+        super(parent, data.AnchorList)
         /** 图例数量 */
-        this._num = 1;
+        this._num = 1
         /** 是否蒙版遮罩  */
-        this._maskFlag = false;
-        this.isTransform = false;
-        this.zOrder = ItemOrder.markOrder;
-        this.data = data;
-        this.id = data.ID;
-        this.name = data.Name;
-        this.moveTo(data.Pos.X, data.Pos.Y);
+        this._maskFlag = false
+        this.isTransform = false
+        this.zOrder = ItemOrder.markOrder
+        this.data = data
+        this.id = data.ID
+        this.name = data.Name
+        this.moveTo(data.Pos.X, data.Pos.Y)
         if (data.Num) {
-            this._num = data.Num;
+            this._num = data.Num
         }
         if (data.Size) {
-            this.width = data.Size.Width;
-            this.height = data.Size.Height;
+            this.width = data.Size.Width
+            this.height = data.Size.Height
         }
         if (data.Num) {
-            this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`;
+            this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`
         }
         if (data.Properties && data.Properties.Url) {
-            this.img.url = data.Properties.Url;
+            this.img.url = data.Properties.Url
         }
         if (data.Properties.ImgPos) {
-            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y)
         }
         if (data.Properties.TextPos) {
-            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y)
         }
         if (data.Properties && data.Properties.sWidth) {
-            this.sWidth = data.Properties.sWidth;
+            this.sWidth = data.Properties.sWidth
         }
         if (data.Properties && data.Properties.sHeight) {
-            this.sHeight = data.Properties.sHeight;
+            this.sHeight = data.Properties.sHeight
         }
         if (data.Properties && data.Properties.font) {
-            this.font = new SFont('sans-serif', data.Properties.font);
+            this.font = new SFont('sans-serif', data.Properties.font)
         }
         if (data.Properties && data.Properties.color) {
-            this.color = new SColor(data.Properties.color);
+            this.color = new SColor(data.Properties.color)
         }
         if (data.Properties && data.Properties.IsActive) {
-            this.isActive = data.Properties.IsActive;
+            this.isActive = data.Properties.IsActive
         }
         if (data.AttachObjectIds && data.AttachObjectIds.length) {
-            this.isActive = true;
+            this.isActive = true
         }
         if (data.Properties && data.Properties.FrameColor) {
-            this.activeColor = new SColor(data.Properties.FrameColor);
+            this.activeColor = new SColor(data.Properties.FrameColor)
         }
     }
     get num() {
-        return this._num;
+        return this._num
     }
     set num(v) {
         if (v) {
-            this._num = v;
-            this.data.Num = v;
-        }
-        else {
-            this._num = 1;
-            this.data.Num = 1;
-        }
-        this.data.Properties.Num = this._num;
-        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`;
-        this.update();
+            this._num = v
+            this.data.Num = v
+        } else {
+            this._num = 1
+            this.data.Num = 1
+        }
+        this.data.Properties.Num = this._num
+        this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`
+        this.update()
     }
     get maskFlag() {
-        return this._maskFlag;
+        return this._maskFlag
     }
     set maskFlag(v) {
         if (v === this._maskFlag) {
-            return;
+            return
         }
-        this._maskFlag = v;
-        this.update();
+        this._maskFlag = v
+        this.update()
     }
     toData() {
-        this.data.Pos = { X: this.x, Y: this.y };
-        this.data.Size = { Width: this.width, Height: this.height };
-        this.data.Name = this.name;
-        this.data.Properties.Url = this.img.url;
-        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
-        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
-        this.data.Properties.sWidth = this.sWidth;
-        this.data.Properties.sHeight = this.sHeight;
-        this.data.Properties.font = this.font.size;
-        this.data.Properties.color = this.color.value;
-        this.data.Properties.FrameColor = this.activeColor.value;
-        this.data.Properties.IsActive = this.isActive;
+        this.data.Pos = { X: this.x, Y: this.y }
+        this.data.Size = { Width: this.width, Height: this.height }
+        this.data.Name = this.name
+        this.data.Properties.Url = this.img.url
+        this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y }
+        this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y }
+        this.data.Properties.sWidth = this.sWidth
+        this.data.Properties.sHeight = this.sHeight
+        this.data.Properties.font = this.font.size
+        this.data.Properties.color = this.color.value
+        this.data.Properties.FrameColor = this.activeColor.value
+        this.data.Properties.IsActive = this.isActive
         this.data.AnchorList = this.anchorList.map((t) => {
             return {
                 ID: t.id,
@@ -112,9 +111,9 @@ export class SImageLegendItem extends SIconTextItem {
                     X: t.x,
                     Y: t.y,
                 },
-            };
-        });
-        return this.data;
+            }
+        })
+        return this.data
     }
     /**
      * Item绘制框架
@@ -123,15 +122,14 @@ export class SImageLegendItem extends SIconTextItem {
      * @param   rect          绘制区域
      */
     onPaint(painter, rect) {
-        super.onPaint(painter, rect);
+        super.onPaint(painter, rect)
         if (this.maskFlag && this.status == SItemStatus.Normal) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = new SColor("#ffffffa1");
+            painter.pen.color = SColor.Transparent
+            painter.brush.color = new SColor('#ffffffa1')
             if (this.selected) {
-                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25);
-            }
-            else {
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
+                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25)
+            } else {
+                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0)
             }
         }
     } // Function onPaint()

+ 11 - 11
src/lib/items/SImageLegendItem.ts

@@ -1,8 +1,8 @@
 import { SGraphItem } from '@saga-web/graph/lib'
 import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem'
 import { Legend } from '../types/Legend'
-import { ItemOrder, SItemStatus } from '@saga-web/big/lib';
-import { SFont, SColor, SPainter, SRect } from '@saga-web/draw/lib';
+import { ItemOrder, SItemStatus } from '@saga-web/big/lib'
+import { SFont, SColor, SPainter, SRect } from '@saga-web/draw/lib'
 /**
  * 图例节点Item(图标类型)
  *
@@ -30,15 +30,15 @@ export class SImageLegendItem extends SIconTextItem {
     }
 
     /** 是否蒙版遮罩  */
-    _maskFlag: boolean = false;
+    _maskFlag: boolean = false
     get maskFlag(): boolean {
-        return this._maskFlag;
+        return this._maskFlag
     }
     set maskFlag(v: boolean) {
         if (v === this._maskFlag) {
-        return
+            return
         }
-        this._maskFlag = v;
+        this._maskFlag = v
         this.update()
     }
 
@@ -130,14 +130,14 @@ export class SImageLegendItem extends SIconTextItem {
      * @param   rect          绘制区域
      */
     onPaint(painter: SPainter, rect: SRect): void {
-        super.onPaint(painter, rect);
+        super.onPaint(painter, rect)
         if (this.maskFlag && this.status == SItemStatus.Normal) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = new SColor("#ffffffa1");
+            painter.pen.color = SColor.Transparent
+            painter.brush.color = new SColor('#ffffffa1')
             if (this.selected) {
-                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25);
+                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25)
             } else {
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
+                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0)
             }
         }
     } // Function onPaint()

+ 0 - 1
src/main.ts

@@ -29,7 +29,6 @@ import Pui from 'meri-design'
 import 'meri-design/dist/index.css'
 import 'leaflet/dist/leaflet.css'
 
-import { login } from './api/login.js'
 Vue.use(Pui)
 
 //////////模拟传入参数

+ 10 - 2
src/router/index.js

@@ -7,11 +7,18 @@ import {
 
 Vue.use(VueRouter)
 const routes = [
+<<<<<<< HEAD
     // 登陆页面
     // {
     //     path: '/',
     //     redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
     // },
+=======
+    {
+        path: '/',
+        redirect: '/home/overview',        // 只有区域,及区域以上用户才能进入总部首页这一套
+    },
+>>>>>>> develop-cd
     {
         path: '/404',
         component: () => import('../components/404'),
@@ -26,7 +33,8 @@ const routes = [
         name: 'home',
         component: () => import('../views/index'),
         redirect: '/home/homepage',
-        children: [{
+        children: [
+            {
                 path: 'homepage',
                 component: () => import('../views/homepage'),
             },
@@ -112,4 +120,4 @@ router.beforeEach(async (to, from, next) => {
         return
     }
 })
-export default router
+export default router

+ 4 - 25
src/store/index.js

@@ -2,15 +2,14 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import { login, queryFloor, queryfmapID } from '@/api/login.js'
 import { queryBrand } from '@/api/public.js'
-import { queryFact } from '@/api/overview'
 import axios from 'axios'
 import router from '../router'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        // ssoToken: 'admin:lengqiang',
-        ssoToken: null,
+        ssoToken: 'admin:xuliping',
+        // ssoToken: null,
         plazaName: '',
         isPreview: false,
         lastRoute: '',
@@ -34,7 +33,6 @@ export default new Vuex.Store({
         remarksText: '', //备注
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
-        categoryId: 'GDXT', //当前选中的系统
         accessLevel: -1, // 权限级别
         showView: 1,
     },
@@ -61,12 +59,6 @@ export default new Vuex.Store({
         SETPLAZENAME(state, data) {
             state.plazaName = data
         },
-        /**
-         * 修改 categoryId
-         */
-        SETCATEGORYID(state, data) {
-            state.categoryId = data
-        },
         SETSHOWVIEW(state, data) {
             state.showView = data
         },
@@ -130,7 +122,7 @@ export default new Vuex.Store({
             state.currentFloor = data
         },
         STOREACCESSLEVEL(state, data) {
-            state.accessLevel = data.level
+            state.accessLevel = data
         },
     },
     actions: {
@@ -141,6 +133,7 @@ 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' })
@@ -194,20 +187,6 @@ export default new Vuex.Store({
                 context.commit('SETBUNKOBJ', obj)
             })
         },
-        async getFact(context) {
-            let params = {
-                getParams: {
-                    plazaId: context.state.plazaId,
-                },
-            }
-            await queryFact(params).then((res) => {
-                if (res.result == 'success') {
-                    if (res.plazaName) {
-                        context.commit('SETPLAZENAME', res.plazaName)
-                    }
-                }
-            })
-        },
     },
     modules: {},
 })

+ 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,
   };
 }

+ 108 - 49
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>
@@ -33,7 +34,7 @@
       <el-table :data="tableData" style="width: 100%;margin-bottom: 63px;" @row-click="showEquipmentStatus">
         <el-table-column label="序号" type="index" :index="indexMethod"></el-table-column>
         <el-table-column prop="sbjc" label="设备简称"></el-table-column>
-        <el-table-column prop="sbjbm" label="设备编号"></el-table-column>
+        <el-table-column prop="assetnum" label="设备编号"></el-table-column>
         <el-table-column prop="is_exception" label="状态">
           <template slot-scope="scope">
             <span style="display: inline-block;width: 6px;height:6px;border-radius: 3px;background: #0091FF;" :style="{'background': !scope.row.is_exception?'#0091FF' : '#F54E45'}"></span>
@@ -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();
-    
   },
 
   methods: {
@@ -221,28 +221,39 @@ export default {
       let param = {
         plazaId: 1000423,
         ccode: 1002347,
-        smsxt: this.systemId
+      }
+      if (this.systemId !== '') {
+        param.smsxt = this.systemId;
       }
       queryEquipmentList('/data/home/querySystemCard', param).then((res) => {
         const { result, data } = res;
         if (result === 'success') {
-          let newData = [];
+          let newData = [], abnormalList = [];
+
           _.forEach(data[0].assetTypeList, (item, index) => {
-            newData.push({
-              id: item.id,
+            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,
-              isActive: index === 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);
+            }
           })
-          this.systemContentData = newData;
+          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.id == query.equipId});
+            _.map(this.systemContentData, (o) => {return o.isActive = o.category_code == query.equipId});
           }
           this.getTableData();
         }
@@ -252,7 +263,7 @@ export default {
      * 切换系统下的设备
      */
     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();
     },
     /**
@@ -262,7 +273,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`
       }
@@ -293,6 +304,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();
@@ -306,12 +318,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;
@@ -321,17 +334,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');
           })
         }
       })
@@ -368,39 +382,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});
     }
   }
 }
@@ -533,11 +586,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, // 查看更多图片弹框显示状态
     };
@@ -242,8 +244,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');
     },
     /**
      * 获取系统列表数据
@@ -375,8 +377,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();
               }
             });
@@ -422,6 +424,7 @@ export default {
     showDialog(task) {
       this.showDetail = true;
       this.detailTitle = task._pdata.description;
+      this.curTask = task;
       this.getGanttDetailData();
       this.getPictureOrReportData(0);
       this.getPictureOrReportData(1);
@@ -468,15 +471,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>
@@ -648,7 +666,7 @@ export default {
     margin-right: 21px;
     padding-top: 16px;
     padding-bottom: 16px;
-    width: 180px;
+    padding-right: 5px;
     height: 100%;
     overflow: auto;
     .item {
@@ -668,6 +686,9 @@ export default {
         margin-bottom: 20px;
       }
     }
+    .active>img{
+      border-color: rgba(31, 35, 41, 0.15);
+    }
   }
   .cur-img-container {
     padding: 20px;

+ 29 - 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>
@@ -58,13 +59,13 @@ export default {
         {id: 3, name: '重点关注'},
       ], // 事件列表字典表
       incidentType: 'all', // 事件类型
-      timeVal: null, // 时间
+      timeVal: '', // 时间
       tableData: [], // 表数据
       curPage: 1, // 当前页码
       pageSize: 10, // 每页条数
       tatol: 0, // 数据总量
-      startTime: 20171027000000, // 开始时间
-      endTime: 20171028000000, // 结束事件
+      startTime: null, // 开始时间
+      endTime: null, // 结束事件
     }
   },
 
@@ -161,11 +162,33 @@ export default {
         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.initTimePicker();
+        this.startTime = 20171027000000;
+        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 - 8
src/views/analysis/index.vue

@@ -46,14 +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});
-			}
-		}
+    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: {

+ 31 - 13
src/views/homepage/index.vue

@@ -5,11 +5,11 @@
                 <h4>{{item.smsxtname}}</h4>
                 <div class='equipment-list' v-if='item.assetTypeList'>
                     <div @click='navToInnerPage(item, equip)' class='equipment-item' v-for='(equip , index) in item.assetTypeList' :key="index">
-                        <div class='equip-name'>
+                        <div class='equip-name' >
                             <h5>{{equip.category_name}}</h5>
-                            <div class='exception-number' v-if='equip.is_exception_num'>{{equip.is_exception_num}}</div>
+                            <div class='exception-number' v-if="equip.is_exception_num">{{equip.is_exception_num}}</div>
                         </div>
-                        <section>
+                        <section  >
                             <div class='equip-statis'>
                                 <span class='equip-number'>{{equip.asset_num}}</span>
                                 <span class='equip-unit'>台</span>
@@ -90,6 +90,7 @@ export default {
             cardsList: [],
             itemsList: [],
             changeList: [],
+            plazaId:'',
             srcList: {
                 0: {
                     1: require('../../assets/images/icons/edit_blue_b.png'), //1.正常(蓝色) 2.警告(黄色) 3.严重(红色)
@@ -109,6 +110,12 @@ export default {
             }
         }
     },
+    created () {
+        let plazaId = this.$route.query.plazaId
+        if (plazaId) {
+            this.plazaId = plazaId
+        }
+    },
     mounted() {
         this.testAjax()
         this.getItemsQuery()
@@ -150,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'}})
         },
          
         /**
@@ -159,17 +166,29 @@ export default {
         navToGanttPage (item) {
             this.$router.push({path:"./analysis", query:{smsxt:item.smsxt, module:'gantt'}})
         },
-        //TODO plazaId目前是写死的 后期需要更换成用户对应的ID
+  
         testAjax() {
             let params = {
                 getParams: {
-                    plazaId: 1000423
+                    plazaId: this.plazaId
                 }
             }
             getCardList(params).then(res => {
                 if (res.result == 'success') {
                     let result = res.data
                     if (result && Array.isArray(result)) {
+                        result.forEach(item => {
+                            if (item.assetTypeList) {
+                                let list = item.assetTypeList
+                                let len = list.length
+                                for (let i=0; i< len; i++) {
+                                    if (list[i] && !list[i].asset_num) {
+                                        list.splice(i, 1)
+                                        i--
+                                    }
+                                }
+                            }
+                        })
                         this.cardsList = result
                     }
                 }
@@ -181,14 +200,14 @@ export default {
         getInstructionList() {
             let params = {
                 getParams: {
-                    plazaId: 1000423,
+                    plazaId: this.plazaId,
                     page: 1,
                     size: 10
                 }
             }
 
             getChangeList(params).then(res => {
-                if (res.result == 'success') {
+                if (res.result == 'success' && res.data) {
                     let result = res.data
                     result.forEach(item => {
                         item.changedate = moment.unix(item.changedate / 1000).format('YYYY.MM.DD')
@@ -213,13 +232,12 @@ export default {
             let params = {
                 getParams: {
                     // department=部门 //部门
-                    startDate: '20200208000000', //开始时间
-                    endDate: '20200608000000', //结束时间
-                    plazaId: 1000423, //广场id 必填
+                    // startDate: '20200208000000', //开始时间
+                    // endDate: '20200608000000', //结束时间
+                    plazaId: this.plazaId, //广场id 必填
                     page: 1, //页数
                     size: 10 //条数
-                    // "orderBy":字段名,1;//排序,1正序,0,倒序
-                    // keyword=关键字1:字段名11,字段名12;关键字2:字段名21,字段名22;//模糊查询参数
+              
                 }
             }
             getQueryList(params).then(res => {

+ 5 - 0
src/views/legendRules/index.vue

@@ -420,9 +420,14 @@ export default {
             this.deleteObject = row
             this.modalStatusTip = true
         },
+<<<<<<< HEAD
         pageChanged(page, size) {
             this.currentPage = page
             this.getTableTata()
+=======
+        add() {
+            this.$refs.addLegends.open('', '', this.GraphCategoryId)
+>>>>>>> develop-cd
         },
         getTableListPosition(val) {
             let postParams = val.map(({ id }) => id)

+ 0 - 8
vue.config.js

@@ -1,11 +1,3 @@
-/*
- * @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,