浏览代码

修改系统通知里面的一些问题

hzj18279462576@163.com 3 年之前
父节点
当前提交
26c3a27a59

+ 2 - 2
admin/src/api/doorLock.js

@@ -2,8 +2,8 @@ import http from '../utils/http'
 let resquest = "/api/ihotel/roomDoorLock"
 let resquest = "/api/ihotel/roomDoorLock"
 
 
 // 根据房间id查询密码锁
 // 根据房间id查询密码锁
-export function roomDoorLockRoomId(params) {
-    return http.get(`${resquest}/room/{roomId}`, params)
+export function roomDoorLockRoomId(roomId) {
+    return http.get(`${resquest}/room/${roomId}`)
 }
 }
 
 
 // 根据订单id查询密码锁
 // 根据订单id查询密码锁

+ 1 - 1
admin/src/api/roomRealTimeStatu.js

@@ -15,6 +15,6 @@ export function clean(statuId, params) {
 }
 }
 
 
 // 锁定房间
 // 锁定房间
-export function lock(statuId, params) {
+export function lock(params) {
     return http.put(`${resquest}/lock`, params)
     return http.put(`${resquest}/lock`, params)
 }
 }

+ 1 - 1
admin/src/layout/components/Navbar.vue

@@ -3,7 +3,7 @@
     <div class="nav-title">智慧校园公寓管理端</div>
     <div class="nav-title">智慧校园公寓管理端</div>
     <div class="right">
     <div class="right">
       <p class="time">{{ time }}</p>
       <p class="time">{{ time }}</p>
-      <el-badge :value="3" class="item">
+      <el-badge :value="$store.state.inform.readFlag" class="item">
         <!-- <svg-icon icon-class="xiaoxizhongxin" /> -->
         <!-- <svg-icon icon-class="xiaoxizhongxin" /> -->
         <div @click="informs">
         <div @click="informs">
           <IconSvg :W="28" :H="31" name="xiaoxizhongxin" />
           <IconSvg :W="28" :H="31" name="xiaoxizhongxin" />

+ 3 - 1
admin/src/store/index.js

@@ -2,11 +2,13 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import Vuex from 'vuex'
 import getters from './getters'
 import getters from './getters'
 import user from './modules/user'
 import user from './modules/user'
+import inform from './modules/inform'
 Vue.use(Vuex)
 Vue.use(Vuex)
 
 
 const store = new Vuex.Store({
 const store = new Vuex.Store({
     modules: {
     modules: {
-        user
+        user,
+        inform
     },
     },
     getters
     getters
 })
 })

+ 34 - 0
admin/src/store/modules/inform.js

@@ -0,0 +1,34 @@
+import Cookies from 'js-cookie'
+import { login, logout, getInfo } from '@/api/acl/user'
+import { getToken, setToken, removeToken } from '@/utils/auth'
+import { resetRouter } from '@/router'
+import api from '@/api/api'
+
+const state = {
+    readFlag: ""
+}
+
+const mutations = {
+
+
+    SET_readFlag: (state, number) => {
+        state.readFlag = number
+    },
+
+    SET_ROLES: (state, roles) => {
+        state.roles = roles
+    }
+}
+
+const actions = {
+    setreadFlag({ commin }, number) {
+        commin('SET_readFlag', number)
+    }
+}
+
+export default {
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 325 - 129
admin/src/views/home/index.vue

@@ -1,9 +1,9 @@
-<template>
+<template >
   <el-card class="box-card">
   <el-card class="box-card">
     <div slot="header" class="clearfix">
     <div slot="header" class="clearfix">
       <div class="header-left">
       <div class="header-left">
         <span class="title">房态管理 </span>
         <span class="title">房态管理 </span>
-        <span> / 共182间</span>
+        <span> / 共{{ roomData.length }}间</span>
       </div>
       </div>
       <div class="header-right">
       <div class="header-right">
         <el-input
         <el-input
@@ -15,7 +15,7 @@
         <el-button class="inquire-button">查询</el-button>
         <el-button class="inquire-button">查询</el-button>
         <div class="control">
         <div class="control">
           <div class="title" @click="water = !water" style="cursor: pointer">
           <div class="title" @click="water = !water" style="cursor: pointer">
-            批量控制
+            批量控制电
           </div>
           </div>
           <ul v-show="water">
           <ul v-show="water">
             <li
             <li
@@ -135,7 +135,9 @@
                 popper-class="popperOptions"
                 popper-class="popperOptions"
               >
               >
                 <div class="control-room">
                 <div class="control-room">
-                  <el-button size="mini">关房</el-button>
+                  <el-button size="mini" @click="closeRoom(item)"
+                    >关房</el-button
+                  >
                   <el-button size="mini">转脏房</el-button>
                   <el-button size="mini">转脏房</el-button>
                   <el-button
                   <el-button
                     size="mini"
                     size="mini"
@@ -143,10 +145,10 @@
                     @click="leisure(item)"
                     @click="leisure(item)"
                     >转空闲</el-button
                     >转空闲</el-button
                   >
                   >
-                  <el-button size="mini">关水</el-button>
                   <el-button size="mini">关电</el-button>
                   <el-button size="mini">关电</el-button>
                   <el-button size="mini">清扫</el-button>
                   <el-button size="mini">清扫</el-button>
-                  <el-button size="mini">取消</el-button>
+                  <el-button size="mini">IC卡</el-button>
+                  <el-button size="mini">指纹</el-button>
                 </div>
                 </div>
                 <div
                 <div
                   @click="EachRoom(i, ind, $event, item)"
                   @click="EachRoom(i, ind, $event, item)"
@@ -161,7 +163,7 @@
                       {{ item.statuName }}
                       {{ item.statuName }}
                     </div>
                     </div>
                   </div>
                   </div>
-                  <template v-if="item.statu == 3">
+                  <template v-if="item.statu == 3 || item.statu == 2">
                     <div class="teacher">{{ item.useInfo.userName }}</div>
                     <div class="teacher">{{ item.useInfo.userName }}</div>
                     <div class="num">
                     <div class="num">
                       <span>水:{{ item.useInfo.startOfWater }}吨</span
                       <span>水:{{ item.useInfo.startOfWater }}吨</span
@@ -170,29 +172,100 @@
                     </div>
                     </div>
                     <div class="count-down">
                     <div class="count-down">
                       <span>退房倒计时 {{ item.useInfo.EndTime }}</span>
                       <span>退房倒计时 {{ item.useInfo.EndTime }}</span>
-                      <div class="tuifang" @click.stop="doorLock = true">
+                      <div class="tuifang" @click.stop="roomLock(item)">
                         <IconSvg :W="21" :H="21" name="tuifang" />
                         <IconSvg :W="21" :H="21" name="tuifang" />
                         <el-dialog
                         <el-dialog
                           title="门锁管理"
                           title="门锁管理"
+                          custom-class="lock"
                           :append-to-body="true"
                           :append-to-body="true"
                           :visible.sync="doorLock"
                           :visible.sync="doorLock"
                           width="30%"
                           width="30%"
                           :before-close="lockClose"
                           :before-close="lockClose"
                         >
                         >
-                          <div class="text" style="margin-top: 13px">
-                            <span>门锁ID:1111111</span>
-                            <IconSvg :W="16" :H="16" name="edit" />
+                          <div class="roomID" style="margin-top: 13px">
+                            <div class="roomblock">
+                              <span>门锁ID:</span>
+                              <div
+                                class="number"
+                                v-if="doorLockList.doorIdshow"
+                              >
+                                <span>{{ doorLockList.doorId }}</span>
+                                <div @click="editlock">
+                                  <IconSvg :W="16" :H="16" name="edit" />
+                                </div>
+                              </div>
+                              <el-input
+                                ref="roomId"
+                                v-else
+                                size="mini"
+                                v-model="doorLockList.doorId"
+                                @blur="editLockBlur"
+                              ></el-input>
+                            </div>
+                            <div class="roomblock">
+                              <span>水表编码:</span>
+                              <div
+                                class="number"
+                                v-if="doorLockList.waterIdshow"
+                              >
+                                <span>{{ doorLockList.waterId }}</span>
+                                <div @click="editWater">
+                                  <IconSvg :W="16" :H="16" name="edit" />
+                                </div>
+                              </div>
+                              <el-input
+                                v-else
+                                size="mini"
+                                v-model="doorLockList.waterId"
+                                @blur="editWaterBlur"
+                              ></el-input>
+                            </div>
                           </div>
                           </div>
-                          <div class="text">
-                            <span>门锁序列号:111111</span>
-                            <IconSvg :W="16" :H="16" name="edit" />
+                          <div class="roomID">
+                            <div class="roomblock">
+                              <span>门锁序列号:</span>
+                              <div
+                                class="number"
+                                v-if="doorLockList.doorNumshow"
+                              >
+                                <span>{{ doorLockList.doorNum }}</span>
+                                <div @click="editRoomNum">
+                                  <IconSvg :W="16" :H="16" name="edit" />
+                                </div>
+                              </div>
+                              <el-input
+                                v-else
+                                size="mini"
+                                v-model="doorLockList.doorNum"
+                                @blur="editRoomNumBlur"
+                              ></el-input>
+                            </div>
+                            <div class="roomblock">
+                              <span>电表编码:</span>
+                              <div
+                                class="number"
+                                v-if="doorLockList.electricityIdshow"
+                              >
+                                <span>{{ doorLockList.electricityId }}</span>
+                                <div @click="editEle">
+                                  <IconSvg :W="16" :H="16" name="edit" />
+                                </div>
+                              </div>
+                              <el-input
+                                v-else
+                                size="mini"
+                                v-model="doorLockList.electricityId"
+                                @blur="editEleBlur"
+                              ></el-input>
+                            </div>
                           </div>
                           </div>
-                          <div class="text">
-                            <span>门锁密码:1111111</span>
-
-                            <span class="password" @click="sending"
-                              >下发密码</span
-                            >
+                          <div class="roomID">
+                            <div class="roomblock">
+                              <span>门锁密码:1111111</span>
+                              <span class="password" @click="sending"
+                                >下发密码</span
+                              >
+                            </div>
                           </div>
                           </div>
                           <span slot="footer" class="dialog-footer">
                           <span slot="footer" class="dialog-footer">
                             <el-button
                             <el-button
@@ -231,7 +304,8 @@
               :clearable="false"
               :clearable="false"
             >
             >
             </el-date-picker>
             </el-date-picker>
-            <el-calendar v-model="date" :first-day-of-week="7"> </el-calendar>
+            <!-- <el-calendar v-model="date" :first-day-of-week="7"> </el-calendar> -->
+            <el-calendar v-model="date"> </el-calendar>
           </div>
           </div>
         </div>
         </div>
         <div class="filtrate">
         <div class="filtrate">
@@ -283,6 +357,16 @@ export default {
       clickId: "",
       clickId: "",
       // 门锁管理
       // 门锁管理
       doorLock: false,
       doorLock: false,
+      doorLockList: {
+        doorId: "111111",
+        doorIdshow: true,
+        waterId: "111111",
+        waterIdshow: true,
+        doorNum: "111111",
+        doorNumshow: true,
+        electricityId: "111111",
+        electricityIdshow: true,
+      },
       // 批量数据
       // 批量数据
       dialogVisible: false,
       dialogVisible: false,
       enableEndTime: "", // 倒计时的日期
       enableEndTime: "", // 倒计时的日期
@@ -290,7 +374,7 @@ export default {
       count: 20,
       count: 20,
       title: "",
       title: "",
       checked: true,
       checked: true,
-      titles: ["批量开电", "批量开水", "批量关电", "批量关水"],
+      titles: ["批量开电", "批量关电"],
       titles2: ["批量开房", "批量关房"],
       titles2: ["批量开房", "批量关房"],
       data: [
       data: [
         {
         {
@@ -300,16 +384,6 @@ export default {
             {
             {
               id: 2,
               id: 2,
               label: "17栋1单元02层01",
               label: "17栋1单元02层01",
-              children: [
-                {
-                  id: 9,
-                  label: "三级 1-1-1",
-                },
-                {
-                  id: 10,
-                  label: "三级 1-1-2",
-                },
-              ],
             },
             },
             {
             {
               id: 3,
               id: 3,
@@ -413,6 +487,7 @@ export default {
     roomList() {
     roomList() {
       this.API.room.roomPageGroup().then((res) => {
       this.API.room.roomPageGroup().then((res) => {
         this.floorRoomDatas = [];
         this.floorRoomDatas = [];
+        console.log(res);
         res.data.list.forEach((item) => {
         res.data.list.forEach((item) => {
           this.floorRoomDatas.push(item.floors[0]);
           this.floorRoomDatas.push(item.floors[0]);
         });
         });
@@ -452,6 +527,7 @@ export default {
           "&" +
           "&" +
           roomIds;
           roomIds;
         this.API.roomRealTimeStatu.realData(params).then((res) => {
         this.API.roomRealTimeStatu.realData(params).then((res) => {
+          console.log(res);
           this.roomData = res.data;
           this.roomData = res.data;
           this.roomData.forEach((resItem) => {
           this.roomData.forEach((resItem) => {
             if (resItem.statu == 1) {
             if (resItem.statu == 1) {
@@ -471,10 +547,10 @@ export default {
               this.roomData.forEach((i, index) => {
               this.roomData.forEach((i, index) => {
                 if (item.id == i.roomId) {
                 if (item.id == i.roomId) {
                   i = Object.assign(i, item);
                   i = Object.assign(i, item);
-                  console.log(i);
+                  // console.log(i);
                   if (i.useInfo) {
                   if (i.useInfo) {
                     this.enableEndTime = i.useInfo.enableEndTime;
                     this.enableEndTime = i.useInfo.enableEndTime;
-                    this.showTime(index, "2022-08-25 12:00:00");
+                    this.showTime(index, i.useInfo.enableEndTime);
                     console.log(i.useInfo.enableEndTime);
                     console.log(i.useInfo.enableEndTime);
                   }
                   }
                 }
                 }
@@ -482,6 +558,7 @@ export default {
             });
             });
           });
           });
           // this.showTime(this.enableEndTime);
           // this.showTime(this.enableEndTime);
+          console.log(this.roomData);
         });
         });
       });
       });
     },
     },
@@ -517,22 +594,21 @@ export default {
         }
         }
         let enableEndTime = day + ":" + h + ":" + m + ":" + s;
         let enableEndTime = day + ":" + h + ":" + m + ":" + s;
         // this.roomData[index].useInfo.EndTime = enableEndTime;
         // this.roomData[index].useInfo.EndTime = enableEndTime;
-        this.$set(this.roomData[index].useInfo, "EndTime", enableEndTime);
+        if (this.roomData[index].useInfo) {
+          this.$set(this.roomData[index].useInfo, "EndTime", enableEndTime);
+        }
       }, 0);
       }, 0);
     },
     },
     bgState(e) {
     bgState(e) {
-      let color = ["", "#D3DBE6", "#296DE3", "#00BAAD", "#FF5733", "#3BB1E3"];
-      if (e == 1) {
-        return { background: color[e], color: "#666" };
-      } else {
-        return { background: color[e] };
-      }
+      let color = ["", "#296DE3", "#00BAAD", "#D3DBE6", "#FF5733", "#3BB1E3"];
+      return { background: color[e] };
     },
     },
     EachRoom(i, ind, $event, item) {
     EachRoom(i, ind, $event, item) {
       console.log(item);
       console.log(item);
       this.clickId = $event.currentTarget.id;
       this.clickId = $event.currentTarget.id;
     },
     },
     // 控制水电
     // 控制水电
+
     dialogShow(e) {
     dialogShow(e) {
       this.dialogVisible = true;
       this.dialogVisible = true;
       this.title = e.target.innerHTML;
       this.title = e.target.innerHTML;
@@ -546,7 +622,14 @@ export default {
         this.count += 4;
         this.count += 4;
       }
       }
     },
     },
-
+    //门锁管理
+    roomLock(item) {
+      this.doorLock = true;
+      console.log(item);
+      this.API.doorLock.roomDoorLockRoomId(item.roomId).then((res) => {
+        console.log(res);
+      });
+    },
     //脏房转空闲
     //脏房转空闲
     leisure(item) {
     leisure(item) {
       this.API.roomRealTimeStatu
       this.API.roomRealTimeStatu
@@ -556,6 +639,22 @@ export default {
       this.roomList();
       this.roomList();
     },
     },
 
 
+    // 锁定房间
+    closeRoom(item) {
+      console.log(item);
+      let roomId = [item.roomId];
+      // let startDay = dayjs(new Date()).format("YYYY-MM-DD");
+      // let endDay = dayjs(new Date()).add(1, "day").format("YYYY-MM-DD");
+      let startDay = "2022-08-23";
+      let endDay = "2022-08-24";
+      let remark = "锁定房间";
+      console.log(roomId, startDay, endDay);
+      this.API.roomRealTimeStatu
+        .lock({ roomId, startDay, endDay, remark })
+        .then((res) => {
+          console.log(res);
+        });
+    },
     // 房态筛查
     // 房态筛查
     handleCheckAllChange(val) {
     handleCheckAllChange(val) {
       this.checkedCities = val ? this.cities : [];
       this.checkedCities = val ? this.cities : [];
@@ -589,6 +688,59 @@ export default {
         })
         })
         .catch((_) => {});
         .catch((_) => {});
     },
     },
+    // 新增房间
+    addRoom() {
+      this.addroom.addroomShow = true;
+    },
+    // 成功添加房间
+    addRoomSuccess() {
+      let roomInfo = {
+        id: this.addroom.id,
+        roomNo: this.addroom.roomNo,
+        build: this.addroom.build,
+        floor: this.addroom.floor,
+        roomTypeId: this.addroom.roomTypeId,
+        roomTypeName: this.addroom.roomTypeName,
+        enableUse: this.addroom.enableUse,
+      };
+      this.API.room.roomSave(roomInfo).then((res) => {
+        console.log(res);
+        this.addroom.addroomShow = false;
+        this.roomList();
+      });
+    },
+    // 编辑门锁ID
+    editlock() {
+      this.doorLockList.doorIdshow = false;
+    },
+    editLockBlur() {
+      this.doorLockList.doorIdshow = true;
+      console.log(111);
+    },
+    // 门锁序列号
+    editRoomNum() {
+      this.doorLockList.doorNumshow = false;
+    },
+    editRoomNumBlur() {
+      this.doorLockList.doorNumshow = true;
+      console.log(111);
+    },
+    // 编辑水表编码
+    editWater() {
+      this.doorLockList.waterIdshow = false;
+    },
+    editWaterBlur() {
+      this.doorLockList.waterIdshow = true;
+      console.log(111);
+    },
+    // 编辑电表编码
+    editEle() {
+      this.doorLockList.electricityIdshow = false;
+    },
+    editEleBlur() {
+      this.doorLockList.electricityIdshow = true;
+      console.log(111);
+    },
   },
   },
 };
 };
 </script>
 </script>
@@ -630,7 +782,7 @@ export default {
       height: 37px;
       height: 37px;
       background: rgba(240, 243, 247, 1);
       background: rgba(240, 243, 247, 1);
       border-radius: 5px;
       border-radius: 5px;
-      margin-left: 715px;
+      margin-left: 744px;
 
 
       /deep/ .el-input__inner {
       /deep/ .el-input__inner {
         height: 37px !important;
         height: 37px !important;
@@ -641,7 +793,7 @@ export default {
       width: 73px;
       width: 73px;
       height: 37px;
       height: 37px;
       font-size: 16px;
       font-size: 16px;
-      margin: 0 58px 0 9px;
+      margin: 0 20px 0 9px;
       padding: 0;
       padding: 0;
       background: rgba(41, 109, 227, 1);
       background: rgba(41, 109, 227, 1);
       color: #fff;
       color: #fff;
@@ -777,6 +929,7 @@ export default {
               .count-down {
               .count-down {
                 margin-left: 15px;
                 margin-left: 15px;
                 display: flex;
                 display: flex;
+
                 span {
                 span {
                   margin-right: 54px;
                   margin-right: 54px;
                 }
                 }
@@ -861,7 +1014,7 @@ export default {
       .calendar {
       .calendar {
         margin: 0 auto;
         margin: 0 auto;
         width: 266px;
         width: 266px;
-        height: 227px;
+        height: 243px;
         .date {
         .date {
           box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
           box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
           .el-input {
           .el-input {
@@ -876,7 +1029,7 @@ export default {
         }
         }
         .el-calendar {
         .el-calendar {
           width: 266px;
           width: 266px;
-          height: 227px;
+          height: 240px;
 
 
           .el-calendar__header {
           .el-calendar__header {
             height: 37px;
             height: 37px;
@@ -1023,32 +1176,15 @@ export default {
   box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
   box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
   border-radius: 8px;
   border-radius: 8px;
 }
 }
-/deep/ .el-dialog {
+
+/deep/ .lock.el-dialog {
   box-shadow: none;
   box-shadow: none;
   margin: 350px 0 0 450px !important;
   margin: 350px 0 0 450px !important;
   width: 555px !important;
   width: 555px !important;
   height: 377px !important;
   height: 377px !important;
-  .text {
-    display: flex;
-    margin-left: 34px;
-    margin-bottom: 15px;
-    font-size: 14px;
-    font-weight: 400;
-    span {
-      margin-right: 20px;
-    }
-    .password {
-      color: #fff;
-      border-radius: 2px;
-      font-size: 12px;
-      padding: 2px;
-      cursor: pointer;
-      background-color: rgba(41, 109, 227, 1);
-    }
-  }
+
   .el-dialog__header {
   .el-dialog__header {
     border-bottom: 1px solid rgba(204, 204, 204, 1);
     border-bottom: 1px solid rgba(204, 204, 204, 1);
-    padding: 25px 20px;
     .el-dialog__headerbtn {
     .el-dialog__headerbtn {
       width: 35px;
       width: 35px;
       height: 35px;
       height: 35px;
@@ -1059,7 +1195,66 @@ export default {
     }
     }
   }
   }
   .el-dialog__body {
   .el-dialog__body {
+    display: flex;
     flex-direction: column;
     flex-direction: column;
+    .roomID {
+      display: flex;
+
+      height: 49px;
+      .roomblock {
+        margin: 10px 19px;
+        width: 262px;
+        display: flex;
+        align-items: center;
+        .number {
+          display: flex;
+        }
+        .password {
+          margin-left: 10px;
+          color: #fff;
+          border-radius: 2px;
+          font-size: 12px;
+          padding: 2px;
+          cursor: pointer;
+          background-color: rgba(41, 109, 227, 1);
+        }
+      }
+
+      .el-input {
+        width: 150px;
+      }
+    }
+  }
+  .el-dialog__footer {
+    margin: 20px 14px 0px 0;
+    .dialog-footer {
+      .el-button:nth-child(2) {
+        color: #fff;
+        background: rgba(41, 109, 227, 1);
+      }
+      .el-button {
+        width: 67px;
+        height: 37px;
+        padding-left: 20px;
+      }
+    }
+  }
+}
+
+/deep/ .addroom.el-dialog {
+  box-shadow: none;
+  margin: 150px 0 0 600px !important;
+  width: 700px !important;
+  .el-dialog__header {
+    border-bottom: 1px solid rgba(204, 204, 204, 1);
+  }
+  .el-dialog__body {
+    .el-form {
+      display: flex;
+      .room {
+        margin: 0 40px;
+      }
+    }
   }
   }
   .el-dialog__footer {
   .el-dialog__footer {
     margin: 40px 14px 0 0;
     margin: 40px 14px 0 0;
@@ -1076,77 +1271,78 @@ export default {
     }
     }
   }
   }
 }
 }
-// /deep/ .el-dialog {
-//   height: 565px !important;
 
 
-//   .el-dialog__header {
-//     height: 81px;
-//     margin: 0;
-//     padding: 0;
-//     border-bottom: 1px solid rgba(230, 230, 230, 1);
-//     display: flex;
-//     align-items: center;
-//     color: rgba(0, 0, 0, 1);
+/deep/ .el-dialog {
+  height: 565px !important;
 
 
-//     span {
-//       font-size: 20px;
-//       font-weight: 500;
-//       margin-left: 30px;
-//     }
+  .el-dialog__header {
+    height: 81px;
+    margin: 0;
+    padding: 0;
+    border-bottom: 1px solid rgba(230, 230, 230, 1);
+    display: flex;
+    align-items: center;
+    color: rgba(0, 0, 0, 1);
+
+    span {
+      font-size: 20px;
+      font-weight: 500;
+      margin-left: 30px;
+    }
 
 
-//     button {
-//       font-size: 20px;
-//       width: 35px;
-//       height: 35px;
-//       top: 23px !important;
-//     }
-//   }
+    button {
+      font-size: 20px;
+      width: 35px;
+      height: 35px;
+      top: 23px !important;
+    }
+  }
 
 
-//   .el-dialog__body {
-//     display: flex;
-//     justify-content: center;
-//     padding: 21px 0 0 0;
+  .el-dialog__body {
+    display: flex;
+    justify-content: center;
+    padding: 21px 0 0 0;
 
 
-//     .tree {
-//       .tree-left {
-//         width: 316px;
-//         height: 44px;
-//         background: rgba(240, 243, 247, 1);
-//         border: 1px solid rgba(230, 230, 230, 1);
-//         box-sizing: border-box;
-//         display: flex;
-//         align-items: center;
-//       }
-//     }
+    .tree {
+      .tree-left {
+        width: 316px;
+        height: 44px;
+        background: rgba(240, 243, 247, 1);
+        border: 1px solid rgba(230, 230, 230, 1);
+        box-sizing: border-box;
+        display: flex;
+        align-items: center;
+      }
+    }
 
 
-//     .el-tree {
-//       width: 316px;
-//       height: 324px;
-//       border: 1px solid rgba(230, 230, 230, 1);
-//       box-sizing: border-box;
-//       padding-left: 9px;
-//     }
+    .el-tree {
+      width: 316px;
+      height: 324px;
+      border: 1px solid rgba(230, 230, 230, 1);
+      box-sizing: border-box;
+      padding-left: 9px;
+    }
 
 
-//     ul {
-//       width: 316px;
-//       height: 324px;
-//       list-style: none;
-//       padding: 0;
-//       margin: 0;
-//       border: 1px solid rgba(230, 230, 230, 1);
-//       box-sizing: border-box;
-//       li {
-//         display: flex;
-//         justify-content: space-between;
-//         padding-right: 17px;
-//       }
-//     }
-//   }
+    ul {
+      width: 316px;
+      height: 324px;
+      list-style: none;
+      padding: 0;
+      margin: 0;
+      border: 1px solid rgba(230, 230, 230, 1);
+      box-sizing: border-box;
+      li {
+        display: flex;
+        justify-content: space-between;
+        padding-right: 17px;
+      }
+    }
+  }
 
 
-//   .el-dialog__footer {
-//     padding: 24px 30px 0 0;
-//   }
-// }
+  .el-dialog__footer {
+    padding: 24px 30px 0 0;
+  }
+}
 </style>
 </style>
 <style lang="scss">
 <style lang="scss">
 .el-popover.popperOptions {
 .el-popover.popperOptions {

+ 84 - 8
admin/src/views/inform/index.vue

@@ -35,8 +35,8 @@
             height="576"
             height="576"
             style="width: 1550px"
             style="width: 1550px"
             stripe
             stripe
-            :row-click="rowClick"
             :cell-style="rowbg"
             :cell-style="rowbg"
+            :row-click="clickData"
             :header-cell-style="{
             :header-cell-style="{
               color: ' rgba(0, 0, 0, 1)',
               color: ' rgba(0, 0, 0, 1)',
               background: 'rgba(240, 243, 247, 1)',
               background: 'rgba(240, 243, 247, 1)',
@@ -75,6 +75,29 @@
             >
             >
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <span
                 <span
+                  @click="handleInfo(scope.$index, scope.row)"
+                  class="operate"
+                  style="color: #296de3; cursor: pointer"
+                  v-show="scope.row.readFlag == 0 ? false : true"
+                >
+                  查看
+                </span>
+                <el-dialog
+                  title="通知详情"
+                  :visible.sync="infoShow"
+                  :close-on-click-modal="false"
+                  custom-class="info"
+                >
+                  <h3>标题:</h3>
+                  <span>
+                    {{ info.title }}
+                  </span>
+                  <h3>消息:</h3>
+                  <span>{{ info.content }}</span>
+                  <h3>时间:</h3>
+                  <span>{{ info.createTime }}</span>
+                </el-dialog>
+                <span
                   @click="handleDelete(scope.$index, scope.row)"
                   @click="handleDelete(scope.$index, scope.row)"
                   class="operate"
                   class="operate"
                   style="color: #296de3; cursor: pointer"
                   style="color: #296de3; cursor: pointer"
@@ -113,6 +136,13 @@ export default {
       data: [], // 当前页面显示的数据
       data: [], // 当前页面显示的数据
       Data: [], // 分页器显示的总数据
       Data: [], // 分页器显示的总数据
       tableData: [], // 请求的总数据
       tableData: [], // 请求的总数据
+      currentPage: 1,
+      infoShow: false,
+      info: {
+        title: "",
+        content: "",
+        createTime: "",
+      },
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -124,9 +154,14 @@ export default {
   methods: {
   methods: {
     dataList() {
     dataList() {
       this.API.systemnotice.systemnoticeList().then((res) => {
       this.API.systemnotice.systemnoticeList().then((res) => {
-        console.log(res.data.list);
+        console.log(res);
         this.tableData = res.data.list;
         this.tableData = res.data.list;
+        let number = 0;
         this.tableData.forEach((item) => {
         this.tableData.forEach((item) => {
+          if (item.readFlag == 0) {
+            number += 1;
+            this.$store.dispatch("inform/setreadFlag", number);
+          }
           item.createTime = item.createTime.replace("T", " ");
           item.createTime = item.createTime.replace("T", " ");
         });
         });
         this.Data = this.tableData;
         this.Data = this.tableData;
@@ -159,19 +194,37 @@ export default {
       }
       }
       this.handleCurrentChange(1);
       this.handleCurrentChange(1);
     },
     },
+    // 查看详情
+    handleInfo(index, row) {
+      console.log(row);
+      this.info = {
+        title: row.title,
+        content: row.content,
+        createTime: row.createTime,
+      };
+      if (row.readFlag == 0) {
+        this.API.systemnotice.systemnoticeRead([row.id]).then((res) => {
+          console.log(res);
+          this.dataList();
+        });
+      }
+      this.infoShow = true;
+    },
     // 一键已读
     // 一键已读
     allRead() {
     allRead() {
       let ids = [];
       let ids = [];
       this.tableData.forEach((item) => {
       this.tableData.forEach((item) => {
         if (item.readFlag == 0) {
         if (item.readFlag == 0) {
           ids.push(item.id);
           ids.push(item.id);
-          console.log(item);
         }
         }
       });
       });
-      this.API.systemnotice.systemnoticeRead([ids]).then((res) => {
-        console.log(res);
-        this.dataList();
-      });
+      console.log(ids);
+      if (ids) {
+        this.API.systemnotice.systemnoticeRead(ids).then((res) => {
+          console.log(res);
+          this.dataList();
+        });
+      }
     },
     },
     rowbg(row) {
     rowbg(row) {
       if (row.rowIndex % 2 != 0) {
       if (row.rowIndex % 2 != 0) {
@@ -180,11 +233,12 @@ export default {
     },
     },
 
 
     handleCurrentChange(val) {
     handleCurrentChange(val) {
+      this.currentPage = this.val;
       this.data = this.Data.slice((val - 1) * 8, val * 8);
       this.data = this.Data.slice((val - 1) * 8, val * 8);
       // console.log(`当前页: ${val}`);
       // console.log(`当前页: ${val}`);
     },
     },
 
 
-    rowClick(row, column, event) {
+    clickData(row, column, event) {
       console.log(1111);
       console.log(1111);
       console.log(row, column, event);
       console.log(row, column, event);
     },
     },
@@ -338,4 +392,26 @@ export default {
     padding: 0;
     padding: 0;
   }
   }
 }
 }
+/deep/ .info.el-dialog {
+  box-shadow: none;
+  margin: 200px 0 0 700px !important;
+  width: 700px !important;
+  .el-dialog__header {
+    border-bottom: 1px solid rgba(204, 204, 204, 1);
+    .el-dialog__title {
+      display: flex;
+    }
+  }
+  .el-dialog__body {
+    display: flex;
+    flex-direction: column;
+    h3 {
+      text-align: left;
+    }
+    span {
+      text-align: left;
+      padding: 30px 20px;
+    }
+  }
+}
 </style>>
 </style>>