Browse Source

修改完成

chc 4 months ago
parent
commit
a8363a2c1d

+ 26 - 7
src/layout/components/Header/Notification.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <more-infos :columns="columns" :table-data="notifications" :pagination="pagination" :total="notificationTotal" @deal="handleClick" @tag="handleClick" @size-change="handleSizeChange" @curr-change="handleCurrentChange" @selection-change="getSelections" @select-all="getSelections">
+    <more-infos :columns="columns" :table-data="notifications" :tableheight="tableheight" :pagination="pagination" :total="notificationTotal" @deal="handleClick" @tag="handleClick" @size-change="handleSizeChange" @curr-change="handleCurrentChange" @selection-change="getSelections" @select-all="getSelections">
       <template slot="filters">
         <el-row type="flex" justify="start" align="middle" :gutter="20">
           <el-col :span="6" style="display: flex; align-items:center">
@@ -31,13 +31,13 @@ const columns = [
     prop: 'select',
     type: 'selection',
     align: 'center',
-    width: 55
+    // width: 55
   },
   {
     prop: 'order',
     label: '序号',
     align: 'center',
-    width: 90
+    // width: 90
   },
   {
     prop: 'topic',
@@ -46,7 +46,7 @@ const columns = [
   },
   {
     prop: 'message',
-    width: 200,
+    // width: 200,
     align: 'left',
     label: '内容描述'
   },
@@ -54,13 +54,13 @@ const columns = [
     prop: 'createTime',
     label: '时间',
     align: 'center',
-    width: 180
+    // width: 180
   },
   {
     prop: 'flag',
     label: '状态',
     align: 'center',
-    width: 100,
+    // width: 100,
     formatter: (row, col, cellVal, index) => {
       if (cellVal === '0') return '未读'
       if (cellVal === '1') return '已读'
@@ -69,7 +69,7 @@ const columns = [
   {
     prop: 'action',
     label: '操作',
-    width: 140,
+    // width: 140,
     align: 'center',
     actions: [
       {
@@ -89,8 +89,15 @@ const columns = [
 ]
 export default {
   components: { MoreInfos },
+  props: {
+    fullscreen: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
+      tableheight: 400,
       columns,
       notifications: [],
       filter: {
@@ -119,6 +126,18 @@ export default {
       notiSelections: []
     }
   },
+  watch:{
+    fullscreen: {
+      handler(val) {
+          console.log(val,444)
+      if(val){
+        this.tableheight=700
+      }else{
+        this.tableheight=400
+      }
+       }
+      }
+  },
   mounted() {
     this.getNotificationList()
   },

BIN
src/layout/components/Header/fullscreen.png


+ 15 - 3
src/layout/components/Header/index.vue

@@ -41,8 +41,12 @@
             <span v-show="notificationNum !== 0" class="bell-dot">{{
               notificationNum > 100 ? "99+" : notificationNum
             }}</span>
-            <el-dialog v-if="notificationDialog" :visible.sync="notificationDialog" title="消息" append-to-body>
-              <notification @close-notification="handleCloseNotification" @reget-noti="handleMarked" />
+            <el-dialog v-if="notificationDialog" :visible.sync="notificationDialog" title="消息" append-to-body :fullscreen="fullscreen">
+              <template slot="title">
+              <span style="color: #fff;">消息</span>
+              <div style="display: inline-block;float: right;margin-right: 20px"><img style="cursor: pointer;" src="./fullscreen.png" alt="" @click="fullscreen=!fullscreen"></div>
+            </template>
+              <notification @close-notification="handleCloseNotification" @reget-noti="handleMarked" :fullscreen="fullscreen"/>
             </el-dialog>
             <video ref="videoMsg" src="../../../assets/images/home/msg.mp3" style="display:none;" />
           </i>
@@ -118,6 +122,7 @@ export default {
   },
   data() {
     return {
+      fullscreen:false,
       ispersonalCenter: false,
       passWord: false,
       originalPassword: "",
@@ -135,6 +140,13 @@ export default {
       userEdit: false
     };
   },
+  watch:{
+    fulllscreen:{
+      handler(val) {
+        console.log(val,'hh')
+      }
+    }
+  },
   computed: {
     ...mapGetters(["sidebar"]),
     defaultActiveIndex: {
@@ -267,7 +279,7 @@ export default {
 
         // 判断消息条数,播放消息语音
         if (this.notificationNum > 0) {
-          this.speckVideo();
+          // this.speckVideo();
         }
       });
     },

+ 1 - 0
src/store/modules/user.js

@@ -74,6 +74,7 @@ const actions = {
         commit('SET_DEPTS', departmentId)
         setSessionStorage('token', accessToken)
         setSessionStorage('username', username)
+        setSessionStorage('password', password)
         setSessionStorage('realName', realName)
         setSessionStorage('userId', id)
         setSessionStorage('departmentId', departmentId)

+ 21 - 3
src/views/navigator/index.vue

@@ -76,6 +76,7 @@
 </template>
 <script lang="ts">
   import { Vue, Component } from 'vue-property-decorator'
+  import {  geteSessionStorage} from '@/utils/auth'
   // import TfTitle from '@/components/Base/Title/index.vue'
   // import moment from 'moment'
   @Component({
@@ -89,7 +90,8 @@
       [
         { img: require('./images/燃气.png'), title: '燃气监测系统' },
         { img: require('./images/电力.png'), title: '电力监测系统', href: 'http://118.122.141.166:8088/' },
-        { img: require('./images/水.png'), title: '水资源监测系统', href: 'http://118.122.141.166:8068/#/login' },
+        { img: require('./images/水.png'), title: '水资源监测系统', href: 'http://118.122.141.166:8068/#/autoLogin' },
+        // { img: require('./images/水.png'), title: '水资源监测系统', href: 'http://localhost:9528/#/autoLogin' },
         { img: require('./images/空调.png'), title: '空调管理系统' },
         { img: require('./images/计量.png'), title: '计量收费系统', path: '' }
       ],
@@ -108,8 +110,24 @@
         const router = this.$router.resolve(path)
         url = router.href
       }
-      window.opener = window.open(url, url)
-      console.log(window.opener)
+      // 获取账号密码
+      let username= geteSessionStorage('username')
+      let password= geteSessionStorage('password')
+      window.opener = window.open(url)
+      function postson(e){
+          window.opener.postMessage({
+            type:'water',
+            loginForm: {
+              username,
+              password
+            }
+          },'*' )
+        window.removeEventListener('message', postson);
+      }
+      window.addEventListener(
+        'message',
+        postson, false)
+
       window.opener.location.reload()
     }
 

+ 85 - 52
src/views/yizhuan/realtimeMonitor/index.vue

@@ -23,7 +23,11 @@
               ref="tree"
               @node-click="handleNodeClick"
               v-if="deviceType=='0'"
-            ></el-tree>
+            >
+            <span class="span-ellipsis" slot-scope="{ node, data }">
+            <span :title="node.label">{{ node.label }}</span>
+            </span>
+          </el-tree>
             <el-tree
               :highlight-current="true"
               :data="elecTree"
@@ -35,7 +39,11 @@
               ref="tree"
               @node-click="handleNodeClick"
               v-if="deviceType=='1'"
-            ></el-tree>
+            >
+            <span class="span-ellipsis" slot-scope="{ node, data }">
+            <span :title="node.label">{{ node.label }}</span>
+            </span>
+          </el-tree>
           </div>
         </div>
       </div>
@@ -235,7 +243,12 @@
         defaultProps: {
           children: 'children',
           label: 'name'
-        }
+        },
+        clickFlag:false,
+        onlineList: [],
+        offlineList : [],
+        reportList: [],
+        nowArr:[]
       }
     },
     created() {
@@ -412,19 +425,22 @@
       },
       //分页查询本地数据
       getCurrentList() {
+        this.page=1
         this.total = 0
         this.offline = 0
         this.online = 0
         this.report = 0
         let arr1 = []
         this.originData.forEach((i) => {
-          if(this.belongLineId){
-            // 根据支路查询
+          if(this.clickFlag){
+            if(this.belongLineId&&this.belongLineId.length>0){
+              // 根据支路查询
               if (i.deviceType == this.deviceType) {
-              if (i.belongLineId == this.belongLineId) {
+              if (this.belongLineId.includes(i.id)) {
                 arr1.push(i)
               }
             }
+            }
           }else{
             //根据设备类型
           if (i.deviceType == this.deviceType) {
@@ -448,49 +464,58 @@
           
         })
 
-        let onlineList = []
-        let offlineList = []
-        let reportList = []
+        this.onlineList = []
+        this.offlineList = []
+        this.reportList = []
         arr1.forEach((i) => {
           if (i.offline) {
             this.offline++
-            offlineList.push(i)
+            this.offlineList.push(i)
           }
           if (i.report && i.offline == false) {
             this.report++
-            reportList.push(i)
+            this.reportList.push(i)
           }
           if (i.offline == false && i.report == false) {
             this.online++
-            onlineList.push(i)
+            this.onlineList.push(i)
           }
         })
+        this.nowArr=arr1
+        this.getStatusList()
+      },
+      handleSelect(e) {
+        this.page=1
+        this.select = e
+        this.getStatusList()
+        // if (e == 1) {
+        //   this.queryScadaData()
+        // } else {
+          // this.getCurrentList()
+        // }
+      },
+      getStatusList(){
         if (this.select == 1) {
-          this.currentList = arr1.slice(this.size * (this.page - 1), this.size * this.page)
-          this.total = arr1.length
+          this.currentList = this.nowArr.slice(this.size * (this.page - 1), this.size * this.page)
+          this.total = this.nowArr.length
         } else if (this.select == 2) {
-          this.currentList = onlineList.slice(this.size * (this.page - 1), this.size * this.page)
-          this.total = onlineList.length
+          this.currentList = this.onlineList.slice(this.size * (this.page - 1), this.size * this.page)
+          this.total = this.onlineList.length
         } else if (this.select == 3) {
-          this.currentList = reportList.slice(this.size * (this.page - 1), this.size * this.page)
-          this.total = reportList.length
+          this.currentList = this.reportList.slice(this.size * (this.page - 1), this.size * this.page)
+          this.total = this.reportList.length
         } else if (this.select == 4) {
-          this.currentList = offlineList.slice(this.size * (this.page - 1), this.size * this.page)
-          this.total = offlineList.length
+          this.currentList = this.offlineList.slice(this.size * (this.page - 1), this.size * this.page)
+          this.total = this.offlineList.length
         }
         this.loading=false
-      },
-      handleSelect(e) {
-        this.select = e
-        if (e == 1) {
-          this.queryScadaData()
-        } else {
-          this.getCurrentList()
-        }
+        this.clickFlag=false
       },
       handleNodeClick(data) {
+        // 点击查询标志
+        this.clickFlag=true
         console.log(data)
-        this.belongLineId=data.id
+        this.belongLineId=data.deviceIds
         this.getCurrentList()
 
 
@@ -515,12 +540,12 @@
       // 页数
       changeSize(data) {
         this.size = data
-        this.getCurrentList()
+        this.getStatusList()
       },
       // 翻页改变
       changecurrent(data) {
         this.page = data
-        this.getCurrentList()
+        this.getStatusList()
       }
     }
   }
@@ -554,27 +579,8 @@
       .left-bottom {
         height: 100%;
         background: #f8f8f8;
-        overflow-y: auto;
-        overflow-x: auto;
-        &::-webkit-scrollbar {
-          width: 4px;
-          background: white;
-        }
-        &::-webkit-scrollbar-corner,
-        &::-webkit-scrollbar-thumb,
-        &::-webkit-scrollbar-track {
-          border-radius: 4px;
-        }
-        &::-webkit-scrollbar-corner,
-        &::-webkit-scrollbar-track {
-          /* 滚动条轨道 */
-          background-color: rgba(180, 160, 120, 0.1);
-          box-shadow: inset 0 0 1px rgba(180, 160, 120, 0.5);
-        }
-        &::-webkit-scrollbar-thumb {
-          /* 滚动条手柄 */
-          background-color: #cccccc;
-        }
+        overflow: hidden;
+       
         .el-input {
           width: 215px;
           height: 34px;
@@ -583,6 +589,27 @@
         .building-info {
           height: 100%;
           width: 100%;
+          overflow-y: auto;
+          overflow-x: auto;
+          &::-webkit-scrollbar {
+            width: 4px;
+            background: white;
+          }
+          &::-webkit-scrollbar-corner,
+          &::-webkit-scrollbar-thumb,
+          &::-webkit-scrollbar-track {
+            border-radius: 4px;
+          }
+          &::-webkit-scrollbar-corner,
+          &::-webkit-scrollbar-track {
+            /* 滚动条轨道 */
+            background-color: rgba(180, 160, 120, 0.1);
+            box-shadow: inset 0 0 1px rgba(180, 160, 120, 0.5);
+          }
+          &::-webkit-scrollbar-thumb {
+            /* 滚动条手柄 */
+            background-color: #cccccc;
+          }
           .el-tree {
             width: 100%;
             height: 100%;
@@ -757,4 +784,10 @@
       }
     }
   }
+  .span-ellipsis {
+    width: 100%;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
 </style>