guoxiaohuan 4 éve
szülő
commit
9ed67217dc

+ 155 - 128
src/App.vue

@@ -1,25 +1,50 @@
 <template>
-    <div id='app'>
-        <div :id='`fengMap${id}`' class='fengMap'></div>
-        <router-view />
-    </div>
+  <div id="app">
+    <div :id="`fengMap${id}`" class="fengMap"></div>
+    <router-view />
+  </div>
 </template>
 <script>
-import { mapGetters, mapActions, mapMutations } from 'vuex'
-import { SFengParser } from '@saga-web/feng-map'
-window.fengmapData = null
+import { mapGetters, mapActions, mapMutations } from "vuex";
+import { SFengParser } from "@saga-web/feng-map";
+window.fengmapData = null;
 export default {
-    data() {
-        return {
-            view: '',
-            scene: '',
-            id: '2',
-            canvasID: '',
-            key: '23f30a832a862c58637a4aadbf50a566',
-            appName: '万达可视化系统',
-            mapServerURL: `http://map.wanda.cn/editor`,
-            mapthemeUrl: `http://map.wanda.cn/editor/webtheme`
-        }
+  data() {
+    return {
+      view: "",
+      scene: "",
+      id: "2",
+      canvasID: "",
+      key: "23f30a832a862c58637a4aadbf50a566",
+      appName: "万达可视化系统",
+      mapServerURL: `http://map.wanda.cn/editor`
+    };
+  },
+  mounted() {
+    const state = this.$store.state;
+    sessionStorage.setItem("STATE", JSON.stringify(state));
+    // 监听页面刷新事件
+    window.addEventListener("unload", this.unload);
+
+    // 页面加载完成后,移除session里的存储的信息
+    window.addEventListener("load", this.load);
+    // 请求该项目下的楼层数据
+    // this.getFengMap();
+  },
+  computed: {
+    ...mapGetters(["plazaId", "fmapID", "haveFengMap"])
+  },
+  methods: {
+    ...mapActions(["getfmapID"]),
+    ...mapMutations(["SETHAVEFENGMAP"]),
+    load () {
+      const state = this.$store.state;
+      sessionStorage.setItem("STATE", JSON.stringify(state));
+    },
+    unload() {
+      // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
+       sessionStorage.clear()
+      
     },
     /**
      * 刷新保存vuex信息
@@ -41,49 +66,39 @@ export default {
         // 请求该项目下的楼层数据
         this.getFengMap()
     },
-    computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
+    getFengMap() {
+      if (!this.fmapID) {
+        this.getfmapID().then(() => {
+          this.getMap();
+        });
+        return;
+      }
+      this.getMap();
     },
-    methods: {
-        ...mapActions(['getfmapID']),
-        ...mapMutations(['SETHAVEFENGMAP']),
-        unload() {
-            // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
-            const state = this.$store.state
-            sessionStorage.setItem('state', JSON.stringify(state))
-        },
-        load() {
-            sessionStorage.clear()
-        },
-        getFengMap() {
-            if (!this.fmapID) {
-                this.getfmapID().then(() => {
-                    this.getMap()
-                })
-                return
-            }
-            this.getMap()
-        },
-        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()
-                    })
-                })
-            }
-        }
+    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,
@@ -111,8 +126,8 @@ input,
 textarea,
 th,
 td {
-    margin: 0;
-    padding: 0;
+  margin: 0;
+  padding: 0;
 }
 
 body,
@@ -120,7 +135,7 @@ button,
 input,
 select,
 textarea {
-    font: 12px/1.5 Arial, 'Microsoft YaHei', '\65b0\5b8b\4f53';
+  font: 12px/1.5 Arial, "Microsoft YaHei", "\65b0\5b8b\4f53";
 }
 
 h1,
@@ -129,7 +144,7 @@ h3,
 h4,
 h5,
 h6 {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 address,
@@ -139,133 +154,145 @@ var,
 em,
 i,
 u {
-    font-style: normal;
+  font-style: normal;
 }
 
 ol,
 ul {
-    list-style: none;
+  list-style: none;
 }
 
 a {
-    text-decoration: none;
+  text-decoration: none;
 }
 
 a:hover {
-    text-decoration: underline;
+  text-decoration: underline;
 }
 
 img {
-    border: none;
-    vertical-align: middle;
+  border: none;
+  vertical-align: middle;
 }
 
 :focus {
-    outline: 0;
+  outline: 0;
 }
 
 button,
 input,
 select,
 textarea {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 table {
-    border-collapse: collapse;
-    border-spacing: 0;
+  border-collapse: collapse;
+  border-spacing: 0;
 }
 
 /* 滚动条样式 */
 
 body ::-webkit-scrollbar {
-    width: 5px;
-    height: 8px;
+  width: 5px;
+  height: 8px;
 }
 
 body ::-webkit-scrollbar-track {
-    background-color: rgba(0, 0, 0, 0);
-    border-radius: 3px;
+  background-color: rgba(0, 0, 0, 0);
+  border-radius: 3px;
 }
 
 body ::-webkit-scrollbar-thumb {
-    border-radius: 3px;
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  border-radius: 3px;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 body ::-webkit-scrollbar-thumb:vertical:hover {
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 #app {
-    //meri-design组件select的字体颜色
-    /deep/ .p-select-fakePlaceholder {
-        span {
-            span {
-                color: #606266 !important;
-                font-size: 13px;
-                font-weight: normal;
-            }
-        }
-    }
-    //element 分页组件背景色
-    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
-    //element button
-    /deep/ .el-button--primary,
-    .p-button-primary {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+  //meri-design组件select的字体颜色
+  /deep/ .p-select-fakePlaceholder {
+    span {
+      span {
+        color: #606266 !important;
+        font-size: 13px;
+        font-weight: normal;
+      }
     }
+  }
+  //element 分页组件背景色
+  /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
+  //element button
+  /deep/ .el-button--primary,
+  .p-button-primary {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 .clearfix::after {
-    content: '.';
-    display: block;
-    height: 0;
-    clear: both;
-    visibility: hidden;
+  content: ".";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
 }
 .clearfix {
-    zoom: 1;
+  zoom: 1;
 }
 
 .left {
-    float: left;
+  float: left;
 }
 
 .right {
-    float: right;
+  float: right;
 }
 html,
 body {
-    width: 100%;
-    height: 100%;
-    // min-width: 1920px;
-    //   background: url('./assets/images/back.jpg') no-repeat;
+  width: 100%;
+  height: 100%;
+  // min-width: 1920px;
+  //   background: url('./assets/images/back.jpg') no-repeat;
 }
 #app {
-    height: 100%;
-    width: 100%;
-    position: relative;
-    .fengMap {
-        position: fixed;
-        width: 100px;
-        height: 100px;
-        z-index: -1;
-        opacity: 0;
-    }
+  height: 100%;
+  width: 100%;
+  position: relative;
+  .fengMap {
+    position: fixed;
+    width: 100px;
+    height: 100px;
+    z-index: -1;
+    opacity: 0;
+  }
 }
 // element表头背景颜色修改
 .core-device-report,
 .specification-update-record {
-    .el-table thead th {
-        background-color: #f8f9fa;
-    }
-    .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
+  .el-table thead th {
+    background-color: #f8f9fa;
+  }
+  .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 // 说明书更新记录 element 时间控件样式重写
 .specification-update-record,

+ 2 - 2
src/api/room.js

@@ -25,12 +25,12 @@ export function queryDygjcxline({ getParams }) {
 
 // 机房-机房内核心设备
 export function queryHxsb({ data, postParams }) {
-    return httputils.fetchJson(`/sms/queryStatistics`, data, postParams)
+    return httputils.fetchJson(`/data/sms_asset/queryStatistics`, data, postParams)
 }
 
 // 机房-机房内核心设备钻取表
 export function queryHxsbDetail({ data, postParams }) {
-    return httputils.fetchJson(`/sms/query`, data, postParams)
+    return httputils.fetchJson(`/data/sms_asset/query`, data, postParams)
 }
 
 // 机房-维修记录

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


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


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


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

@@ -34,7 +34,7 @@ export default {
             mapServerURL: `http://map.wanda.cn/editor`,
             canvasWidth: 600,
             canvasHeight: 800,
-            loading: true, // 限制重复查询
+            loading: false, // 限制重复查询
             view: null,
             urlMsg: {},
             canvasID: 'canvas',

+ 1 - 1
src/components/menuList.vue

@@ -5,7 +5,7 @@
             <div class='downright'></div>
             <div class='home-box'>
                 <img src='@/assets/imgs/logo.png' alt />
-                <span>{{plazaName}}</span>
+                <span>{{plazaName||'万达集团'}}</span>
                 <!-- <span v-if='plazas'>{{plazas.length>0?formatter(plazaId,plazas):'--'}}</span> -->
             </div>
         </div>

+ 4 - 6
src/router/index.js

@@ -5,11 +5,10 @@ import { query } from '@/utils/query'
 
 Vue.use(VueRouter)
 const routes = [
-    // 登陆页面
-    // {
-    //     path: '/',
-    //     redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
-    // },
+    {
+        path: '/',
+        redirect: '/home/overview', // 只有区域,及区域以上用户才能进入总部首页这一套
+    },
     {
         path: '/404',
         component: () => import('../components/404'),
@@ -72,7 +71,6 @@ const router = new VueRouter({
     base: process.env.BASE_URL,
     routes,
 })
-//不需要token的路由
 const ignore = ['/404']
 router.beforeEach(async (to, from, next) => {
     if (!ignore.includes(to.path)) {

+ 3 - 1
src/store/index.js

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

+ 119 - 26
src/views/analysis/CoreDeviceReport.vue

@@ -11,15 +11,15 @@
                 @change='changeCurSystem'
                 v-model='systemId'
                 :selectdata='systemList'
-                :placeholder=''请选择''
+                :placeholder='"请选择"'
                 hideClear
             />
             <div class='system-content'>
                 <div
                     v-for='(item) in systemContentData'
-                    :key=''key_' + item.category_code'
+                    :key='"key_" + item.category_code'
                     class='item-content'
-                    :class='{'active': item.isActive}'
+                    :class='{"active": item.isActive}'
                     @click='changeEquipment(item.category_code)'
                 >
                     <div class='first-row'>
@@ -31,7 +31,7 @@
                             {{item.num}}
                             <span>台</span>
                         </div>
-                        <span :class='{'abnormal': item.abnormal}'>{{item.statusNum !== 0?item.statusNum : ''}}</span>
+                        <span :class='{"abnormal": item.abnormal}'>{{item.statusNum !== 0?item.statusNum : ''}}</span>
                     </div>
                 </div>
             </div>
@@ -48,7 +48,7 @@
                     <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'}'
+                            :style='{"background": !scope.row.is_exception?"#0091FF" : "#F54E45"}'
                         ></span>
                         <span style='margin-left: 10px'>{{ !scope.row.is_exception?'正常' : '异常' }}</span>
                     </template>
@@ -57,7 +57,7 @@
                     <template slot-scope='scope'>
                         <span
                             style='color: #025BAA'
-                            @click='showPicturesDetail(scope.row, 'equip')'
+                            @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>
@@ -66,8 +66,9 @@
                     <template slot-scope='scope'>
                         <span
                             style='color: #025BAA'
-                            @click='showReportDetail(scope.row, 'equip')'
+                            @click='(e) => showReportDetail(scope.row, "equip", e)'
                         >{{ scope.row.attachments_num?(scope.row.attachments_num+ '张') : '—'}}</span>
+                        <!-- <span style="color: #025BAA" @click="(e) => showReportDetail(scope.row, 'equip', e)">1张</span> -->
                     </template>
                 </el-table-column>
             </el-table>
@@ -99,7 +100,7 @@
                         <template slot-scope='scope'>
                             <span
                                 style='color: #025BAA'
-                                @click='showPicturesDetail(scope.row, 'his')'
+                                @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>
@@ -108,8 +109,9 @@
                         <template slot-scope='scope'>
                             <span
                                 style='color: #025BAA'
-                                @click='showReportDetail(scope.row, 'his')'
+                                @click='(e) => showReportDetail(scope.row, "his", e)'
                             >{{ scope.row.attachmentsNum?(scope.row.attachmentsNum+ '张') : '—'}}</span>
+                            <!-- <span style="color: #025BAA" @click="(e) => showReportDetail(scope.row, 'his', e)">1张</span> -->
                         </template>
                     </el-table-column>
                 </el-table>
@@ -130,22 +132,27 @@
                         <div class='pictures-menu'>
                             <div
                                 v-for='(item) in pictureList'
-                                :key=''id_' + item.id'
+                                :key='"id_" + item.id'
                                 class='item'
                                 @click='changeCurImg(item.id)'
-                                :class='{'active': item.isActive}'
+                                :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='curImg.url' alt />
+                            <img v-if='curImg.url' :src='curImg.url' alt />
                         </div>
                     </div>
                 </el-dialog>
             </div>
         </div>
+        <div v-show='showAccessory' class='accessory-container' :style='{"top": accessoryPos.top + "px", "left": accessoryPos.left + "px"}'>
+            <div v-for='(item) in accessoryList' :key='"id_" + item.id'>
+                <a :href='item.url' target='_blank' :title='item.name'>{{item.name}}</a>
+            </div>
+        </div>
     </div>
 </template>
 
@@ -158,6 +165,7 @@ import { log } from 'util'
 export default {
     data() {
         return {
+            plazaId: 1000423, // 广场id
             systemId: '', // 当前系统Id
             systemList: [], // 系统
             systemContentData: [
@@ -196,7 +204,15 @@ export default {
                 // {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: {} // 当前图片
+            curImg: {}, // 当前图片
+
+            showAccessory: false, // 附件窗口显示状态
+            isClickAccessory: false, // 是否点击的是附件
+            accessoryList: [], // 附件
+            accessoryPos: {
+                top: 0,
+                left: 0
+            } // 附件弹窗位置
         }
     },
 
@@ -207,7 +223,20 @@ export default {
 
     computed: {},
 
+    beforeMount() {
+        let PLAZAID = localStorage.getItem('PLAZAID')
+        this.plazaId = Number(PLAZAID) || 1000423
+    },
     mounted() {
+        document.addEventListener('click', () => {
+            setTimeout(() => {
+                if (this.isClickAccessory) {
+                    this.isClickAccessory = false
+                    return
+                }
+                this.showAccessory = false
+            }, 20)
+        })
         this.getSystemList()
     },
 
@@ -249,7 +278,7 @@ export default {
          */
         getEquipmentOfSystem() {
             let param = {
-                plazaId: 1000423,
+                plazaId: this.plazaId,
                 ccode: 1002347
             }
             if (this.systemId !== '') {
@@ -312,7 +341,7 @@ export default {
                     return o.isActive
                 }).category_code
             }
-            let url = `/sms/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`
+            let url = `/data/sms_asset/query?plazaId=${this.plazaId}3&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`
             if (_.trim(this.searchKey) !== '') {
                 url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`
             }
@@ -342,7 +371,12 @@ export default {
          */
         showEquipmentStatus(row, column, e) {
             setTimeout(() => {
-                if (this.showDetail) return
+                if (this.showDetail || this.showAccessory) {
+                    // if (this.showAccessory) {
+                    //   this.showAccessory = false;
+                    // }
+                    return
+                }
                 this.equipTitle = row.sbjc
                 this.dialogTableVisible = true
                 this.assetnum = row.assetnum
@@ -357,13 +391,13 @@ export default {
             let param = {
                 page: this.hisCurPage,
                 size: this.hisPageSize,
-                plazaId: 1000423,
-                // assetnum: this.assetnum,
-                assetnum: 24071,
-                // startDate: this.startTime,
-                startDate: 20000101000000,
-                // endDate: this.endTime
-                endDate: 20200201000000
+                plazaId: this.plazaId,
+                assetnum: this.assetnum,
+                // assetnum: 24071,
+                startDate: this.startTime,
+                // startDate: 20000101000000,
+                endDate: this.endTime
+                // endDate: 20200201000000
             }
             queryHistoryTableData('/data/base/queryDateByAssetNum', param).then(res => {
                 const { result, data, count } = res
@@ -439,6 +473,30 @@ export default {
         /**
          * 显示附件详情
          */
+        showReportDetail(val, type, e) {
+            console.log('val', val)
+            if (type === 'equip') {
+                if (!val.file_type || !val.file_type_id) {
+                    // return;
+                }
+            } else {
+                if (!val.attachments_num) {
+                    // return;
+                }
+            }
+            console.log('e', e)
+            this.accessoryPos = {
+                top: e.clientY + 5,
+                left: e.clientX - 360 - 5
+            }
+            this.isClickAccessory = true
+            this.showAccessory = true
+            this.detailTitle = '附件预览'
+            this.getDetailData(val)
+        },
+        /**
+         * 显示附件详情
+         */
         showReportDetail(val) {
             console.log('val', val)
             if (type === 'equip') {
@@ -462,7 +520,8 @@ export default {
                 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,
+                // file_type_id: this.detailTitle === "图片预览" ?2914 : 1136,
+                // file_type_id: 9886,
                 type: this.detailTitle === '图片预览' ? 0 : 1
             }
             queryDetailData('/data/base/queryFileDetails', param).then(res => {
@@ -480,8 +539,11 @@ export default {
                     })
                     if (this.detailTitle === '图片预览') {
                         this.pictureList = newData
-                        this.curImg = this.pictureList[0]
+                        if (this.pictureList.length > 0) {
+                            this.curImg = this.pictureList[0]
+                        }
                     } else {
+                        this.accessoryList = newData
                     }
                 }
             })
@@ -613,7 +675,7 @@ export default {
         margin-right: 21px;
         padding-top: 16px;
         padding-bottom: 16px;
-        width: 180px;
+        padding-right: 5px;
         height: 100%;
         overflow: auto;
         .item {
@@ -623,6 +685,7 @@ export default {
                 border-radius: 4px;
             }
             .name {
+                width: 180px;
                 font-size: 12px;
                 color: #1f2429;
                 line-height: 16px;
@@ -635,6 +698,9 @@ export default {
             &:not(:last-of-type) {
                 margin-bottom: 20px;
             }
+            .active > img {
+                border-color: rgba(31, 35, 41, 0.15);
+            }
         }
         .active > img {
             border-color: rgba(31, 35, 41, 0.15);
@@ -653,5 +719,32 @@ export default {
             max-height: 530px;
         }
     }
+    .accessory-container {
+        padding-top: 4px;
+        padding-bottom: 4px;
+        width: 360px;
+        max-height: 166px;
+        overflow: auto;
+        position: fixed;
+        background: #fff;
+        box-shadow: 0px 2px 10px 0px rgba(31, 35, 41, 0.1);
+        border-radius: 2px;
+        border: 1px solid rgba(228, 229, 231, 1);
+        z-index: 5000;
+        > div > a {
+            padding-left: 12px;
+            padding-right: 12px;
+            display: block;
+            height: 38px;
+            font-size: 14px;
+            line-height: 38px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            &:hover {
+                background: #f5f6f7;
+            }
+        }
+    }
 }
 </style>

+ 135 - 49
src/views/analysis/GanttChart.vue

@@ -44,7 +44,7 @@
               <Task class="icon" />
               <div class="title">任务状态</div>
             </div>
-            <div>进行中</div>
+            <div :style="{'background': ganttDetail.color && ganttDetail.color[1]?ganttDetail.color[1] : '', 'color': ganttDetail.color && ganttDetail.color[0]?ganttDetail.color[0] : ''}">{{ganttDetail.status}}</div>
           </div>
           <div class="row">
             <div>
@@ -67,13 +67,13 @@
             </div>
             <div>
               <div>
-                <div class="num">12张</div>
-                <div class="more" @click="() => showImgDetail = true">查看更多</div>
+                <div class="num">{{pictureList.length}}张</div>
+                <div v-if="pictureList.length > 0" class="more" @click="() => showImgDetail = true">查看更多</div>
               </div>
               <div class="pictrue-container">
-                <div v-for="(item) in pictures" :key="'id_' + item.id">
-                  <img :src="item.imgSrc" alt />
-                  <div class="info">{{item.title}}</div>
+                <div v-for="(item) in pictures" :key="'id_' + item.id" @click="showImgContainer(item.id)" class="item">
+                  <img src="../../assets/imgs/analysis/picture.png" alt />
+                  <div class="info" :title="item.name">{{item.name}}</div>
                 </div>
               </div>
             </div>
@@ -85,12 +85,16 @@
             </div>
             <div>
               <div>
-                <div class="num">2张</div>
+                <div class="num">{{accessoryList.length}}张</div>
               </div>
-              <div class="pictrue-container">
-                <div v-for="(item) in reports" :key="'id_' + item.id">
-                  <img :src="item.imgSrc" alt />
-                  <div class="info">{{item.title}}</div>
+              <div class="accessory-container" :style="{'max-height': accessoryIsExpand?'' : '115px'}">
+                <a :href="item.url?item.url : 'javascript:void(0)'" target="_blank" v-for="(item) in accessoryList" :key="'id_' + item.id" class="item">
+                  <img src="../../assets/imgs/analysis/report_pdf.png" alt />
+                  <div class="info" :title="item.name">{{item.name}}</div>
+                </a>
+                <div v-if="accessoryList.length > 0" class="expand-more" @click="() => accessoryIsExpand = !accessoryIsExpand">
+                  <ExpandArrow :class="{'expand': accessoryIsExpand}"/>
+                  展开更多
                 </div>
               </div>
             </div>
@@ -114,12 +118,12 @@
           <div class="detail-container">
             <div class="pictures-menu">
               <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>
+                <img :src="item.url?item.url : ''" alt="">
+                <div class="name" :title="item.name">{{item.name}}</div>
               </div>
             </div>
             <div class="cur-img-container">
-              <img :src="curImg.url" alt="">
+              <img v-if="curImg && curImg.url" :src="curImg.url" alt="">
             </div>
           </div>
         </el-dialog>
@@ -144,6 +148,7 @@ import RealTime from "../../assets/svg/real_time.svg";
 import Picture from "../../assets/svg/picture.svg";
 import Report from "../../assets/svg/report.svg";
 import Menu from "../../assets/svg/menu.svg";
+import ExpandArrow from "../../assets/svg/expand_arrow.svg";
 export default {
   data() {
     return {
@@ -184,40 +189,31 @@ export default {
       showDetail: false, // 弹框显示状态
       detailTitle: "", // 弹窗标题
       pictures: [
-        {
-          id: 1,
-          imgSrc: require("../../assets/imgs/analysis/picture.png"),
-          title: "2019年5月高压用具检测报告.jpg"
-        },
-        {
-          id: 2,
-          imgSrc: require("../../assets/imgs/analysis/picture.png"),
-          title: "2019年5月高压用具检测报告.jpg"
-        }
+        // {
+        //   id: 1,
+        //   imgSrc: require("../../assets/imgs/analysis/picture.png"),
+        //   title: "2019年5月高压用具检测报告.jpg"
+        // },
+        // {
+        //   id: 2,
+        //   imgSrc: require("../../assets/imgs/analysis/picture.png"),
+        //   title: "2019年5月高压用具检测报告.jpg"
+        // }
       ], // 照片
-      reports: [
-        {
-          id: 1,
-          imgSrc: require("../../assets/imgs/analysis/report_pdf.png"),
-          title: "2019年5月高压用具检测报告.pdf"
-        },
-        {
-          id: 2,
-          imgSrc: require("../../assets/imgs/analysis/report_word.png"),
-          title: "2019年5月高压用具检测报告.docx"
-        }
-      ], // 报告
       ganttDetail: {}, // 甘特图明细
       tableData: [], // 表数据
       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},
+        // {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: {}, // 当前查看的图片
+      accessoryList: [], // 附件
+      accessoryIsExpand: false, // 附件是否展开
 
       showImgDetail: false, // 查看更多图片弹框显示状态
+
     };
   },
 
@@ -227,12 +223,22 @@ export default {
     RealTime,
     Picture,
     Report,
-    Menu
+    Menu,
+    ExpandArrow
   },
 
   computed: {},
 
   mounted() {
+    document.addEventListener('click', () => {
+      setTimeout(() => {
+        if (this.isClickAccessory) {
+          this.isClickAccessory = false;
+          return
+        }
+        this.showAccessory = false;
+      }, 20)
+    })
     this.initChartTime();
     this.getSystemList();
   },
@@ -446,11 +452,30 @@ export default {
             planStartDate,
             planEndDate,
             realStartDate,
-            realEndDate
+            realEndDate,
+            statusType
           } = data;
+          let color;
+          switch (statusType) {
+            case 1:
+              color = ['#c3c7cb', '#e7e9ea'];
+              break
+            case 2:
+              color = ['#5b8ff9', '#5b8ff933'];
+              break
+            case 3:
+              color = ['#f58300', '#fbce99'];
+              break
+            case 4:
+              color = ['#f54e45', '#fbb8b5'];
+              break
+            default:
+              color = ['#f54e45', '#fbb8b5'];
+              break
+          }
           let newData = {
             status,
-            color: "",
+            color: color,
             planTime: this.dealDetailTime(planStartDate, planEndDate),
             realTime: this.dealDetailTime(realStartDate, realEndDate)
           };
@@ -474,14 +499,31 @@ export default {
       const { id, statusType } = this.curTask._pdata;
       let param = {
         file_type: statusType,
+        // file_type: 0,
         file_type_id: id,
-        type: type
+        // file_type_id: 9886,
+        type: type,
       };
       queryDetailData("/data/base/queryFileDetails", param).then(res => {
         console.log("photo", res);
         const { result, data } = res;
         if (result === 'success') {
-          
+          let newData = [];
+          _.forEach(data, (item, index) => {
+            newData.push({
+              id: item.id,
+              url: item.urlname,
+              isActive: index === 0,
+              name: item.description
+            });
+          });
+          if (type === 0) {
+            this.pictureList = newData;
+            this.curImg = newData[0];
+            this.pictures = this.pictureList.slice(0, 2);
+          } else {
+            this.accessoryList = newData;
+          }
         }
       });
     },
@@ -491,6 +533,15 @@ export default {
     changeCurImg(id) {
       _.map(this.pictureList, (o) => {return o.isActive = o.id === id});
       this.curImg = _.find(this.pictureList, (o) => {return o.isActive});
+    },
+    /**
+     * 展示图片
+     */
+    showImgContainer(id) {
+      console.log('id', id)
+      _.map(this.pictures, (o) => {return o.isActive = o.id === id});
+      this.curImg = _.find(this.pictures, (o) => {return o.isActive});
+      this.showImgDetail = true;
     }
   },
   beforeDestroy() {
@@ -571,6 +622,7 @@ export default {
   .dialog-container {
     max-height: 580px;
     overflow: auto;
+    padding-right: 5px;
     .row {
       display: flex;
       > div:first-child {
@@ -599,7 +651,9 @@ export default {
       font-weight: 400;
     }
     .task-status > div:nth-of-type(2) {
-      width: 58px;
+      padding-left: 8px;
+      padding-right: 8px;
+      // width: 58px;
       height: 24px;
       background: rgba(91, 143, 249, 0.2);
       border-radius: 2px;
@@ -634,23 +688,51 @@ export default {
         cursor: pointer;
       }
     }
-    .pictrue-container {
-      > div {
+    .pictrue-container,
+    .accessory-container {
+      .item {
         padding: 10px 16px;
-        width: 100%;
+        width: 400px;
         border-radius: 4px;
         border: 1px solid rgba(233, 233, 233, 1);
         display: flex;
         align-items: center;
+        cursor: pointer;
         > img {
           width: 24px;
           margin-right: 15px;
         }
+        .info{
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
       }
-      > div:not(:last-child) {
+      .item:not(:last-of-type) {
         margin-bottom: 8px;
       }
     }
+    .accessory-container{
+      position: relative;
+      overflow: hidden;
+      .expand-more{
+        position: absolute;
+        left: 444px;
+        bottom: 0;
+        color: #025baa;
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+        >svg{
+          margin-right: 4px;
+          width: 16px;
+          transition: transform .36s;
+        }
+        .expand{
+          transform: rotate(180deg);
+        }
+      } 
+    }
     .test-content {
       display: block;
       > div:first-child {
@@ -676,11 +758,15 @@ export default {
         border-radius: 4px;
       }
       .name {
+        width: 180px;
         font-size: 12px;
         color: #1f2429;
         line-height: 16px;
         margin-top: 12px;
         text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
       }
       &:not(:last-of-type) {
         margin-bottom: 20px;

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

@@ -111,7 +111,7 @@ export default {
         }
     },
     created () {
-        let plazaId = this.$route.query.plazaId
+        let plazaId = localStorage.getItem('PLAZAID')  
         if (plazaId) {
             this.plazaId = plazaId
         }

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