Pārlūkot izejas kodu

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

yuanrf 1 gadu atpakaļ
vecāks
revīzija
7c6e2fee1d

+ 10 - 1
config/index.js

@@ -19,7 +19,16 @@ module.exports = {
             // '/'这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替。比如我要调用'http://api.douban.com/v2/movie/top250',直接写‘/api/v2/movie/top250’即可
 
          }
-        }
+        },
+        '/chatHub': {
+          target : 'http://132.232.92.186:8888/chatHub',    //设置你调用的接口域名和端口号.别忘了加http
+          changeOrigin : true,   //允许跨域
+          pathRewrite : {
+              '^/chatHub':'/'
+            // '/'这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替。比如我要调用'http://api.douban.com/v2/movie/top250',直接写‘/api/v2/movie/top250’即可
+
+          }
+        },
     },
     
     // Various Dev Server settings

+ 1 - 0
src/App.vue

@@ -45,5 +45,6 @@ export default {
 #app {
   margin: 0px;
   padding: 0px;
+  font-family:arial,"\5B8B\4F53" ;
 }
 </style>

+ 1 - 1
src/components/Crm/DeleClient.vue

@@ -24,7 +24,7 @@
                     </el-table-column>
                     <el-table-column prop="companyName" label="所属公司">
                     </el-table-column>
-                    <el-table-column prop="sex" label="性别" width="50">
+                    <el-table-column prop="sex" label="性别" width="55">
                         <template slot-scope="sex">
                             <span v-if="sex.row.sex == 0">男</span>
                             <span v-else-if="sex.row.sex == 1">女</span>

+ 1 - 0
src/components/Login.vue

@@ -118,6 +118,7 @@ export default {
                 console.log(res);
                 if (res.data.code == 200) {
                     localStorage.setItem('userinif', JSON.stringify(res.data.data));
+                    localStorage.setItem('unReadCount', JSON.stringify(res.data.data.unReadCount));
                     that.fullscreenLoading = false;
                     for (var l = 0; l < res.data.data.authData.length; l++) {
                         if (res.data.data.authData[l].modulName == '主页') {

+ 1 - 1
src/components/OP/AirTicketRes.vue

@@ -7,7 +7,7 @@
                 </div>
                 <div style="display: flex;justify-content: space-between;">
                     <div style="width: 60%;">
-                        <el-select v-model="DiId" placeholder="团组选择" clearable filterable
+                        <el-select style="width: 300px;" v-model="DiId" placeholder="团组选择" clearable filterable
                             @change="AirTicketResSelectChange">
                             <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.groupName"
                                 :value="item.id">

+ 4 - 2
src/components/OP/CarTouristGuideGrounContent.vue

@@ -55,7 +55,7 @@
                         </el-table-column>
                         <el-table-column label="金额/币种" width="400">
                             <template slot-scope="scope">
-                                <div class="el-input-number-style">
+                                <div class="el-input-number-style pice-ys">
                                     <el-input-number placeholder="请输入金额" v-model="scope.row.price" :controls="false"
                                         @change="PriceChange"></el-input-number>
 
@@ -461,7 +461,9 @@ export default {
 .el-input-number-style .el-input input {
     text-align: left;
 }
-
+.pice-ys .el-input-number{
+    width: 250px;
+}
 @media screen and (max-width: 1700px) {
     .appraise-box>div {
         width: 48%;

+ 2 - 5
src/components/OP/Customers.vue

@@ -17,7 +17,7 @@
                                 </el-option>
                             </el-select>
                         </div>
-                        <div style="width: 25%;"><el-input v-model="VisaClient" placeholder="请输入客户名称" clearable></el-input>
+                        <div style="width: 25%;margin-left: 10px;"><el-input v-model="VisaClient" placeholder="请输入客户名称" clearable></el-input>
                         </div>
                         <div style="width: 25%;margin-left: 10px;"><el-button type="primary"
                                 @click="QueryByVisaClient">查询</el-button>
@@ -132,7 +132,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.delegationInfoList = res.data.data.groupName;
                     that.DiId = that.$route.query.diId
                     if (that.DiId == undefined) {
@@ -140,7 +139,6 @@ export default {
                         that.DiId = that.delegationInfoList[0].id;
                     } else {
                         for (let index = 0; index < that.delegationInfoList.length; index++) {
-                            debugger
                             if (that.delegationInfoList[index].id == that.DiId) {
                                 that.delegationInfo = that.delegationInfoList[index];
                                 that.DiId = that.delegationInfoList[index].id;
@@ -180,7 +178,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.tableDatas = res.data.data;
                     that.tableData = that.tableDatas
                     if (that.tableDatas.length != 0) {
@@ -209,7 +206,6 @@ export default {
 
         },
         addIf() {
-            debugger
             if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
                 this.$router.push({
                     path: "/home/OpCustomers",
@@ -300,6 +296,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    min-height: 830px;
 }
 
 .communal-title {

+ 1 - 1
src/components/OP/DecreasePayments.vue

@@ -8,7 +8,7 @@
                 </div>
                 <div style="display: flex;">
                     <div style="width: 90%;">
-                        <el-select v-model="DiId" placeholder="团组选择" clearable filterable @change="DecreasePaymentsChange">
+                        <el-select style="width:400px" v-model="DiId" placeholder="团组选择" clearable filterable @change="DecreasePaymentsChange">
                             <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
                                 :value="item.id">
                             </el-option>

+ 2 - 2
src/components/OP/GroupsTaskAssignment.vue

@@ -6,14 +6,14 @@
         <div class="konzh" style="display: flex;justify-content: space-between;">
             <el-form style="display: flex;" label-width="70px" class="demo-form-inline">
                 <el-form-item style="width: 300px;margin-right: 20px;" label="团组名称">
-                    <el-select v-model="diId" filterable clearable placeholder="请选择" style="width:100%;"
+                    <el-select v-model="diId" filterable clearable placeholder="请选择" style="width:230px;"
                         @change="diidChange()">
                         <el-option v-for="item1 in delegationInfos" :key=item1.id :label=item1.name
                             :value=item1.id></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item style="width: 300px;margin-right: 20px;" label="操作分类">
-                    <el-select v-model="ctId" filterable clearable placeholder="请选择" style="width:100%;"
+                    <el-select v-model="ctId" filterable clearable placeholder="请选择" style="width:230px;"
                     @change="sdIdChange()">
                         <el-option v-for=" item1 in setData" :key=item1.id :label=item1.name :value=item1.id></el-option>
                     </el-select>

+ 2 - 2
src/components/OP/HotelReservations.vue

@@ -37,7 +37,7 @@
             <div class="hotelr-table">
                 <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
                     style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
-                    <el-table-column type="index" label="序号" width="50">
+                    <el-table-column type="index" label="序号" width="55">
                     </el-table-column>
                     <el-table-column prop="reservationsNo" label="预定号">
                     </el-table-column>
@@ -56,7 +56,7 @@
                     </el-table-column>
                     <el-table-column prop="createTime" label="操作时间" width="180">
                     </el-table-column>
-                    <el-table-column prop="isAuditGMStr" label="是否审核" width="80">
+                    <el-table-column prop="isAuditGMStr" label="是否审核" width="85">
                     </el-table-column>
                     <el-table-column prop="name" label="操 作" width="140">
                         <template slot-scope="scope">

+ 2 - 2
src/components/OP/OPgroup.vue

@@ -82,12 +82,12 @@
                     <el-table-column
                         prop="visitDays"
                         label="出访天数"
-                        width="80">
+                        width="85">
                     </el-table-column>
                     <el-table-column
                         prop="visitPNumber"
                         label="出访人数"
-                        width="80">
+                        width="85">
                     </el-table-column>
                     <el-table-column
                         prop="jietuanOperator"

+ 1 - 1
src/components/OP/OpCarTouristGuideGroundId.vue

@@ -371,7 +371,7 @@ export default {
                                         type: 'success'
                                     });
                                     setTimeout(() => {
-                                        that.$router.push('/home/CarTouristGuideGroundId')
+                                        that.$router.push('/home/CarTouristGuideGroundId?diId='+that.OpCarTouristGuideGroundData.diId+'')
                                     }, 3000);
                                 } else {
                                     that.$message.error(res.data.msg);

+ 3 - 3
src/components/OP/OpCustomers.vue

@@ -107,8 +107,8 @@
                             <el-upload :file-list="uploadFiles" ref="upload" :on-success="upLoadSuccess"
                                 style="width: 200px;" :before-remove="beforeRemove" :limit="1" :on-exceed="exceed"
                                 :action="uploadURL" :headers="headers" :auto-upload="false" :on-change="onChange">
-                                <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-                            </el-upload>
+                                <el-button slot="trigger" size="small" type="primary">选取文件</el-button>                      
+                           </el-upload>
 
                         </el-form-item>
                     </div>
@@ -264,7 +264,7 @@
                     </div>
                 </div>
                 <el-form-item>
-                    <div style="margin-left: 60%;">
+                    <div style="text-align: right;">
                         <el-button type="primary" @click="addBtn">保存</el-button>
 
                         <el-button @click="EscAdd">取消</el-button>

+ 1 - 1
src/components/OP/OpLtinerary.vue

@@ -222,7 +222,7 @@ export default {
 }
 .opname-box{
     display: flex;
-    justify-content: end;
+    justify-content: flex-end;
 }
 .opname-head-li:nth-child(1){
     margin-right: 10px;

+ 3 - 1
src/components/OP/OpVisaPriec.vue

@@ -1,3 +1,4 @@
+
 <template>
     <div class="car_add">
         <div>
@@ -260,7 +261,7 @@
                     </div>
                 </div>
                 <el-form-item>
-                    <div style="margin-left: 60%;">
+                    <div style="text-align: right;">
                         <el-button type="primary" @click="addBtn">保存</el-button>
 
                         <el-button @click="EscAdd">取消</el-button>
@@ -617,6 +618,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    
 }
 
 .car_add .communal-title {

+ 2 - 2
src/components/OP/PickupList.vue

@@ -58,7 +58,7 @@
                     <el-table-column
                     type="index"
                     label="序号"
-                    width="50">
+                    width="55">
                     </el-table-column>
                     <el-table-column
                     prop="lastName"
@@ -86,7 +86,7 @@
                     <el-table-column
                     prop="sex"
                     label="性别"
-                    width="50">
+                    width="55">
                     <template slot-scope="scope">
                         {{ scope.row.sex==0?'男':'女' }}
                     </template>

+ 1 - 1
src/components/OP/ThreeStandards.vue

@@ -41,7 +41,7 @@
                     <el-table-column
                     prop="rowNumber"
                     label="序号"
-                    width="50">
+                    width="55">
                     </el-table-column>
                     <el-table-column
                     prop="continent"

+ 2 - 5
src/components/OP/VisaPriec.vue

@@ -17,7 +17,7 @@
                                 </el-option>
                             </el-select>
                         </div>
-                        <div style="width: 25%;"><el-input v-model="VisaClient" placeholder="请输入费用名称" clearable></el-input>
+                        <div style="width: 25%;margin-left: 10px;"><el-input v-model="VisaClient" placeholder="请输入费用名称" clearable></el-input>
                         </div>
                         <div style="width: 25%;margin-left: 10px;"><el-button type="primary"
                                 @click="QueryByVisaClient">查询</el-button>
@@ -133,7 +133,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.delegationInfoList = res.data.data.groupName;
                     that.DiId = that.$route.query.diId
                     if (that.DiId == undefined) {
@@ -141,7 +140,6 @@ export default {
                         that.DiId = that.delegationInfoList[0].id;
                     } else {
                         for (let index = 0; index < that.delegationInfoList.length; index++) {
-                            debugger
                             if (that.delegationInfoList[index].id == that.DiId) {
                                 that.delegationInfo = that.delegationInfoList[index];
                                 that.DiId = that.delegationInfoList[index].id;
@@ -183,7 +181,6 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
                     that.tableDatas = res.data.data;
                     that.tableData = that.tableDatas
                     if (that.tableDatas.length != 0) {
@@ -215,7 +212,6 @@ export default {
 
         },
         addIf() {
-            debugger
             if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
                 this.$router.push({
                     path: "/home/OpVisaPriec",
@@ -286,6 +282,7 @@ export default {
     padding: 10px;
     box-shadow: 0 0 5px #0005;
     border-radius: 10px;
+    min-height: 830px;
 }
 
 .communal-title {

+ 6 - 8
src/components/Resource/InvitationOfficialActivityData.vue

@@ -6,13 +6,13 @@
             </div>
             <div>
                 <div class="communal-box" style="margin-top: 10px;">
-                    <el-autocomplete class="inline-input" v-model="Country" :fetch-suggestions="querySearchCountry"
+                    <el-autocomplete style="margin-right: 15px;" class="inline-input" v-model="Country" :fetch-suggestions="querySearchCountry"
                         placeholder="请输入国家" clearable></el-autocomplete>
-                    <el-autocomplete class="inline-input" v-model="UnitName" :fetch-suggestions="querySearchUnitName"
+                    <el-autocomplete style="margin-right: 15px;" class="inline-input" v-model="UnitName" :fetch-suggestions="querySearchUnitName"
                         placeholder="请输入邀请方" clearable></el-autocomplete>
-                    <el-autocomplete class="inline-input" v-model="Contact" :fetch-suggestions="querySearchContact"
+                    <el-autocomplete style="margin-right: 15px;" class="inline-input" v-model="Contact" :fetch-suggestions="querySearchContact"
                         placeholder="联系人" clearable></el-autocomplete>
-                    <el-select v-model="Delegation" clearable filterable placeholder="团组名称" style="width: 20%;">
+                    <el-select  v-model="Delegation" clearable filterable placeholder="团组名称" style="width: 20%;margin-right: 15px;">
                         <el-option v-for="item in restaurantDelegation" :key="item.id" :label="item.groupName"
                             :value="item.id">
                         </el-option>
@@ -27,7 +27,7 @@
                     </div>
                 </div>
                 <div class="communal-box" style="margin-top: 10px;">
-                    <el-select v-model="CreateUserId" placeholder="录入者" filterable clearable>
+                    <el-select style="margin-right: 15px;width:218px;" v-model="CreateUserId" placeholder="录入者" filterable clearable>
                         <el-option v-for="item in CreateUserList" :key="item.id" :label="item.cnName" :value="item.id">
                         </el-option>
                     </el-select>
@@ -532,7 +532,5 @@ export default {
     white-space: nowrap;
     cursor: pointer;
 }
-.communal-box .el-autocomplete,.el-select{
-    margin-right: 15px;
-}
+
 </style>

+ 84 - 84
src/components/child/test.vue

@@ -1,90 +1,90 @@
-<template>
-    <div class="home">
-      <h1>前端演示SignalR</h1>
-      <input v-model="user" type="text" />
-      <input v-model="message" type="text" />
-      <button @click="sendAll">发送全部</button>
-      <button @click="sendOwn">对自己发送</button>
-      <div>
-        <ul v-for="(item ,index) in messages" v-bind:key="index +'itemMessage'">
-          <li>{{item.user}} says {{item.message}}</li>
-        </ul>
-      </div>
-    </div>
+<!-- <template>
+	<div class="hello">
+	  <div id="message" v-html="remsg"></div>
+	  <input type="text" placeholder="请输入用户名" v-model="user" />
+	  <input type="text"  placeholder="请输入内容" v-model="msg">
+	  <button  @click="handle">发送消息</button>
+	</div>
   </template>
   
   <script>
+  
   import * as signalR from "@aspnet/signalr";
+  
+  let token=JSON.parse(localStorage.getItem('userinif')).token;
+  let hubUrl = "http://132.232.92.186:8888/chatHub";
+  
+  //.net core 版本中默认不会自动重连,需手动调用 withAutomaticReconnect 
+  const connection = new signalR.HubConnectionBuilder()
+		// .withAutomaticReconnect()//断线自动重连
+		.withUrl(hubUrl,{ accessTokenFactory: () => token })//传递参数Query["access_token"]
+		.build();
+  
+  //启动
+  connection.start().catch(err => {
+	console.log(err);
+  });
+  
+  //自动重连成功后的处理
+//   connection.onreconnected(connectionId => {
+// 	  console.log(connectionId);
+//   });
+  
   export default {
-    name: "SignalR",
-    components: {},
-    data() {
-      return {
-        token:"",
-        user: "", //用户
-        message: "", //消息
-        connection: "", //signalr连接
-        messages: [] //返回消息
-      };
-    },
-    methods: {
-      //给全部发送消息
-      sendAll: function() {
-        this.connection
-          .invoke("SendMessage", this.user, this.message)
-          .catch(function(err) {
-            return console.error(err);
-          });
-      },
-      //只给自己发送消息
-      sendOwn: function() {
-        this.connection
-          .invoke("SendMessageCaller", this.message)
-          .catch(function(err) {
-            return console.error(err);
-          });
-      }
-  
-   
-    },
-    created: function() {
-      this.token = JSON.parse(localStorage.getItem('userinif')).token;
-      let thisVue = this;
-      console.log(thisVue.token)
-      this.connection = new signalR.HubConnectionBuilder(
-        {
-          skipNegotiation: true,
-          transport: signalR.HttpTransportType.WebSockets
-        }
-      )
-        // .withAutomaticReconnect()//断线自动重连
-        // .withUrl("http://132.232.92.186:8888/chatHub", (opts) =>
-        //     {                    
-        //         //opts.Headers.Add("Authorization", new AuthenticationHeaderValue("Bearer ", thisVue.token).ToString());         
-        //         opts.headers['Authorization'] = 'Bearer ' + thisVue.token;
-        //         skipNegotiation = true;
-        //         transport = signalR.HttpTransportType.WebSockets;
-        //         // opts.accessTokenFactory: () => thisVue.token                     
-        //     })    
-        .withUrl("http://132.232.92.186:8888/chatHub?access_token="+"Bearer "+ thisVue.token, 
-        {
-          // headers: {"Authorization":"Bearer "+ thisVue.token},
-          //options.headers['Authorization'] = 'Bearer your_auth_token';
-          
-          //accessTokenFactory: () => "Bearer "+ thisVue.token
-        })
-        .configureLogging(signalR.LogLevel.Information)
-        .build();
-      this.connection.on("ReceiveMessage", function(data) {
-        //thisVue.messages.push({ userid, message });
-        console.log(data);
-      });
-      this.connection.on("ReceiveMessage", function(userid,message) {
-        let user = "自己";//这里为了push不报错,我就弄了一个默认值。
-        thisVue.messages.push({ userid, message });
-        console.log({ userid, message });
-      });
-      this.connection.start();
-    }
+	name: "First",
+	mounted() {
+	  var _this = this;
+  
+	  //调用后端方法 SendMessageResponse 接收定时数据
+	  connection.on("SendMessageResponse", function(data) {
+		if(data.state==200)
+			_this.remsg = _this.remsg + "<br>" + "定时数据:" + data.msg;
+	  });
+  
+	  //调用后端方法 SendMessage 接受自己人发送消息
+	  connection.on("SendMessage", function(data) {
+		if(data.state==200)
+			_this.remsg = _this.remsg + "<br>" + data.data.userName + ":" + data.msg;
+	  });
+  
+	  //调用后端方法 ConnectResponse 接收连接成功
+	  connection.on("ConnectResponse", function(data) {
+		if(data.state==200)
+			_this.remsg = _this.remsg + "<br>" + "连接:" + data.msg;
+	  });
+  
+	},
+	data() {
+	  return {
+		user: "",
+		msg: "",
+		remsg: ""
+	  };
+	},
+  
+	methods: {
+	  handle: function() {
+		if(this.msg.trim()==""){
+		  alert("不能发送空白消息");
+		  return;
+		}
+		//调用后端方法 SendMessage 传入参数
+		connection.invoke("SendMessage", this.user, this.msg);
+		this.msg = "";
+	  }
+	}
   };
-  </script>
+  </script>
+  
+ Add "scoped" attribute to limit CSS to this component only -->
+  <style scoped>
+  #message {
+  
+	overflow-y:auto;
+	text-align: left;
+	border: #42b983 solid 1px;
+	height: 500px;
+  
+  }
+  
+  </style> 

+ 313 - 53
src/components/home.vue

@@ -4,43 +4,82 @@
       <el-dialog
       style=""
       top="0"
-      title="消息"
+      title="消息通知"
       :visible.sync="dialogVisible"
       width="30%">
         <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-          <el-tab-pane name="first">
+          <el-tab-pane v-for="(msgitem,index) in msgtype" :key="index" :label="msgitem.id+''" :name="msgitem.name">
+            <span slot="label">
+              {{ msgitem.name }}
+              <el-badge :hidden="msgitem.unReadCount==0?true:false" :value="msgitem.unReadCount" :max="9999"></el-badge>
+            </span>
+          </el-tab-pane>
+          <div class="msg-box">
+            <div class="read-btn">
+              
+              <el-button type="primary" @click="taskclicks(2)"  size="mini" :plain="tasknobtn" >未读</el-button>
+              <el-button type="primary" @click="taskclicks(3)" size="mini" :plain="taskbtn" >已读</el-button>
+            </div>
+            <div class="scroll-box">
+              <div class="news-box" v-for="(item,index) in msglist" :key="index">
+                <div class="news-box-list">
+                  <div class="news-list-hade">
+                    <div>{{item.title}}</div>
+                    <div>所属部门: {{item.issuerDep}}</div>
+                  </div>
+                  <div class="news-list-content" v-html="item.content">
+                  </div>
+                  <div class="news-list-posts">
+                    <div>发布人: {{item.issuerUser}}</div>
+                    <div>发布时间: {{item.releaseTime}}</div>
+                  </div>
+                  <div class="news-list-btn" >
+                    <el-button @click="DeleMsg(index,item)" v-if="item.isRead==0" type="primary">确认已读</el-button>
+                    <el-button v-if="item.isRead==1" type="info">已读</el-button>
+                  </div>
+                </div>
+              </div>
+              <div v-if="count>10&&msglist.length<count" class="loadmore">
+                <el-button @click="loadadd" size="mini">加载更多</el-button>
+              </div>
+              <el-divider v-if="msglist.length>=count" style="">没有更多了!</el-divider>
+            </div>
+          </div>
+          <!-- <el-tab-pane name="first">
             <span slot="label">
               任务操作通知
               <el-badge :hidden="tasknot==0?true:false" :value="tasknot" :max="9999"></el-badge>
             </span>
             <div class="read-btn">
               <el-badge :hidden="tasknot==0?true:false" :value="tasknot" class="item">
-                <el-button  size="mini" plain >未读</el-button>
+                <el-button type="primary" @click="taskclick('未读')"  size="mini" :plain="tasknobtn" >未读</el-button>
               </el-badge>
-              <el-button size="mini" plain >
+              <el-button type="primary" @click="taskclick('已读')" size="mini" :plain="taskbtn" >
                 已读
               </el-button>
             </div>
-            <div class="news-box" v-for="(item,index) in newstasklist" :key="index">
-              <div class="news-box-list">
-                <div class="news-list-hade">
-                  <div>{{item.title}}</div>
-                  <div>所属部门: {{item.issuerDep}}</div>
-                </div>
-                <div class="news-list-content" v-html="item.content">
-                </div>
-                <div class="news-list-posts">
-                  <div>发布人: {{item.issuerUser}}</div>
-                  <div>发布时间: {{item.releaseTime}}</div>
-                </div>
-                <div class="news-list-btn">
-                  <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
-                  <el-button v-if="item.isRead==1" type="info">已读</el-button>
+            <div class="scroll-box">
+              <div class="news-box" v-for="(item,index) in newstasklist" :key="index">
+                <div class="news-box-list">
+                  <div class="news-list-hade">
+                    <div>{{item.title}}</div>
+                    <div>所属部门: {{item.issuerDep}}</div>
+                  </div>
+                  <div class="news-list-content" v-html="item.content">
+                  </div>
+                  <div class="news-list-posts">
+                    <div>发布人: {{item.issuerUser}}</div>
+                    <div>发布时间: {{item.releaseTime}}</div>
+                  </div>
+                  <div class="news-list-btn" >
+                    <el-button @click="DeleMsg(index,item)" v-if="item.isRead==0" type="primary">确认已读</el-button>
+                    <el-button v-if="item.isRead==1" type="info">已读</el-button>
+                  </div>
                 </div>
               </div>
-            </div>
-            <div class="notyet" v-if="newstasklist.length==0">
-              暂无通知
+              <div class="notyet" v-if="newstasklist.length==0">
+                暂无通知
+              </div>
             </div>
           </el-tab-pane>
           <el-tab-pane name="second">
@@ -50,34 +89,36 @@
             </span>
             <div class="read-btn">
               <el-badge :hidden="groupnot==0?true:false" :value="groupnot" class="item">
-                <el-button size="mini" plain >未读</el-button>
+                <el-button type="primary" size="mini" @click="groupclick('未读')" :plain="groupnobtn" >未读</el-button>
               </el-badge>
-              <el-button size="mini" plain >
+              <el-button type="primary" size="mini" @click="groupclick('已读')" :plain="groupbtn" >
                 已读
               </el-button>
             </div>
-            <div class="news-box" v-for="(item,index) in newsgrouplist" :key="index">
-              <div class="news-box-list">
-                <div class="news-list-hade">
-                  <div>{{item.title}}</div>
-                  <div>所属部门: {{item.issuerDep}}</div>
-                </div>
-                <div class="news-list-content" v-html="item.content">
-                </div>
-                <div class="news-list-posts">
-                  <div>发布人: {{item.issuerUser}}</div>
-                  <div>发布时间: {{item.releaseTime}}</div>
-                </div>
-                <div class="news-list-btn">
-                  <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
-                  <el-button v-if="item.isRead==1" type="info">已读</el-button>
+            <div class="scroll-box">
+              <div class="news-box" v-for="(item,index) in newsgrouplist" :key="index">
+                <div class="news-box-list">
+                  <div class="news-list-hade">
+                    <div>{{item.title}}</div>
+                    <div>所属部门: {{item.issuerDep}}</div>
+                  </div>
+                  <div class="news-list-content" v-html="item.content">
+                  </div>
+                  <div class="news-list-posts">
+                    <div>发布人: {{item.issuerUser}}</div>
+                    <div>发布时间: {{item.releaseTime}}</div>
+                  </div>
+                  <div class="news-list-btn">
+                    <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
+                    <el-button v-if="item.isRead==1" type="info">已读</el-button>
+                  </div>
                 </div>
               </div>
+              <div class="notyet" v-if="newsgrouplist.length==0">
+                暂无通知
+              </div>
             </div>
-            <div class="notyet" v-if="newsgrouplist.length==0">
-              暂无通知
-            </div>
-          </el-tab-pane>
+          </el-tab-pane> -->
         </el-tabs>
       </el-dialog>
     </div>
@@ -159,7 +200,7 @@
               <i class="icon-shiyonggongju"></i>
             </div>
             <div class="message">
-              <el-badge :value="12" class="item">
+              <el-badge :value="unReadCount" class="item">
                 <i class="icon-tongzhi" @click="dialogVisible= true"></i>
               </el-badge>
             </div>
@@ -295,13 +336,25 @@ export default {
       dialogVisible: false ,
       newstasklist:[],
       newsgrouplist:[],
-      activeName: 'first',
+      activeName: '',
       tasknot:0,//任务未读条数
       groupnot:0,//团组未读条数
       tasknotlist:[],//任务未读
       taskReadlist:[],//任务以读
       groupnotlist:[],//团组未读
       groupReadlist:[],//团组以读
+      taskbtn:true,//plain任务已读
+      tasknobtn:false,//plain任务未读
+      groupbtn:true,//plain团组已读
+      groupnobtn:true,//plain团组未读
+      unReadCount:0,//未读总条数
+      msgtype:[],//未读总条数
+      pageIndex:1,//页码
+      pageSize:10,//条数
+      type:0,//类型
+      readStatus:2,//状态
+      msglist:[],//list
+      count:0,//list数量
     };
   },
   // components: {
@@ -411,12 +464,100 @@ export default {
       console.log('测试');
     },
     handleClick(tab, event) {
+      this.pageIndex=1;
+      this.pageSize=10;
+      this.msglist=[];
       console.log(tab, event);
+      console.log(tab.label);
+      this.type=Number(tab.label);
+      this.PotsMessagePageList();
+    },
+    //已读未读切换
+    taskclicks(val){
+      if(val==2){
+        this.tasknobtn=false;
+        this.taskbtn=true;
+      }else{
+        this.tasknobtn=true;
+        this.taskbtn=false;
+      }
+      this.readStatus=val;
+      this.pageIndex=1;
+      this.pageSize=10;
+      this.msglist=[];
+      this.PotsMessagePageList();
+    },
+    //加载更多
+    loadadd(){
+      this.pageIndex++
+      this.PotsMessagePageList()
+    },
+    //消息list
+    PotsMessagePageList(){
+      console.log(this.type)
+      var url = "/api/System/PotsMessagePageList"
+      var that = this
+      this.$axios({
+          method: 'post',
+          url: url,
+          headers: {
+              Authorization: 'Bearer ' + that.token
+          },
+          data:{
+            portType:1,
+            pageIndex:that.pageIndex,
+            pageSize:that.pageSize,
+            type:that.type,
+            userId:that.userId,
+            readStatus:that.readStatus
+          }
+      }).then(function (res) {
+          console.log(res)
+          if(res.data.code==200){
+            var magarr=res.data.data;
+            that.count=res.data.count;
+            for(let j=0;j<magarr.length;j++){
+              that.msglist.push(magarr[j])
+            }
+          }else{
+            that.$message.error(res.data.msg);
+          }
+      }).catch(function (error) {
+          that.$message.error("获取消息列表失败!");
+      });
     },
     //任务通知切换
     newstasklistclick(){
       console.log(this.newstasklist)
-       
+    },
+    //消息类型
+    PotsMsgTypeData(){
+      this.msglist=[];
+      var url = "/api/System/PotsMsgTypeData"
+      var that = this
+      this.$axios({
+          method: 'post',
+          url: url,
+          headers: {
+              Authorization: 'Bearer ' + that.token
+          },
+          data:{
+            portType:1,
+            userId:that.userId
+          }
+      }).then(function (res) {
+          console.log(res)
+          if(res.data.code==200){
+            that.msgtype=res.data.data;
+            that.activeName=that.msgtype[0].name;
+            that.type=that.msgtype[0].id;
+            that.PotsMessagePageList()
+          }else{
+            that.$message.error(res.data.msg);
+          }
+      }).catch(function (error) {
+          that.$message.error("获取消息类型失败!");
+      });
     },
     //消息列表
     PsotMsgPageList(){
@@ -431,17 +572,14 @@ export default {
             data:{
               portType:1,
               pageIndex:1,
-              pageSize:10,
+              pageSize:100,
               userId:that.userId
             }
         }).then(function (res) {
             console.log(res)
             if(res.data.code==200){
-                that.newstasklist=res.data.data.taskNotificatio.taskNotificatioData;
-                that.tasknot=res.data.data.taskNotificatio.unReadCount;
-                that.newsgrouplist=res.data.data.operationNotificatio.operationNotificatioData;
-                that.groupnot=res.data.data.operationNotificatio.unReadCount;
-                console.log(that.newsgrouplist)
+                //初始化
+                
             }else{
                 that.$message.error(res.data.msg);
             }
@@ -449,6 +587,89 @@ export default {
             that.$message.error("获取消息列表失败!");
         });
     },
+    //消息确认已读
+    DeleMsg(index,row){
+      this.$confirm('此操作将认定你已知晓此通知?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var url = "/api/System/SetMessageRead"
+        var that = this
+        this.$axios({
+            method: 'post',
+            url: url,
+            headers: {
+                Authorization: 'Bearer ' + that.token
+            },
+            data:{
+              portType:1,
+              msgId:row.id,
+              userId:that.userId
+            }
+        }).then(function (res) {
+            console.log(res)
+            if(res.data.code==200){
+              if(that.type==1020){
+                that.$router.push({ path: "/home/TaskList"});
+              }
+              that.uplocal();
+              that.PotsMsgTypeData();
+              that.$message({
+                type: 'success',
+                message: res.data.msg
+              });
+            }else{
+              that.$message.error(res.data.msg);
+            }
+        }).catch(function (error) {
+            that.$message.error("确认已读失败!");
+        });
+        
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消确认已读'
+        });          
+      });
+      console.log(index,row)
+      console.log(this.type)
+      
+    },
+    //修改未读条数
+    uplocal(){
+      console.log(this.msgtype.unReadCount);
+      window.localStorage.removeItem('unReadCount');
+      this.unReadCount--;
+      this.msgtype.unReadCount--;
+      console.log(this.msgtype.unReadCount);
+      localStorage.setItem('unReadCount', JSON.stringify(this.unReadCount));
+    },
+    //任务切换
+    taskclick(text){
+      if(text=='未读'){
+        this.newstasklist=this.tasknotlist
+        this.tasknobtn=false;
+        this.taskbtn=true;
+      }else{
+        this.newstasklist=this.taskReadlist
+        this.tasknobtn=true;
+        this.taskbtn=false;
+      }
+      console.log(this.newstasklist)
+    },
+    //团组切换
+    groupclick(text){
+      if(text=='未读'){
+        this.newsgrouplist=this.groupnotlist
+        this.groupnobtn=false;
+        this.groupbtn=true;
+      }else{
+        this.newsgrouplist=this.groupReadlist
+        this.groupnobtn=true;
+        this.groupbtn=false;
+      }
+    },
     //消息通知
     chatHub(){
         var url = "/api/chatHub"
@@ -512,11 +733,17 @@ export default {
   mounted() {
     this.userId=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
     this.token=JSON.parse(localStorage.getItem('userinif')).token;
+    this.unReadCount=JSON.parse(localStorage.getItem('unReadCount'));
     this.removal();
     this.radioChange(false);
     this.ifIndexValue();
     this.getmenu();
     this.PsotMsgPageList();
+    this.PotsMsgTypeData();
+    // setTimeout(this.PotsMessagePageList(),500)
+    
+    setInterval(this.PsotMsgPageList, 300000);
+    // setInterval(this.PsotMsgPageList, 3000);
     // this.chatHub();
   },
   created() {
@@ -554,6 +781,12 @@ export default {
 };
 </script>
 <style>
+*{
+  font-family: arial,"\5B8B\4F53";
+}
+.all-box{
+  font-family: arial,"\5B8B\4F53";
+}
 .el-menu .el-menu-item.is-active {
   color: #fff;
   background-color: rgba(0, 0, 0, 0.1);
@@ -952,7 +1185,13 @@ i.icon-tongzhi {
 .home-dialog .el-dialog__header{
   padding: 10px 20px;
 }
-
+.news-list-content{
+  line-height: 20px;
+}
+.loadmore{
+  margin-top: 20px;
+  text-align: center;
+}
 
 
 
@@ -998,5 +1237,26 @@ i.icon-tongzhi {
   padding: 0;
 }
 .delwh::-webkit-scrollbar {display:none}
+.scroll-box{
+  height: 750px;
+  overflow-y: auto;
+}
+.scroll-box::-webkit-scrollbar {
+  width: 6px;
+}
+.scroll-box::-webkit-scrollbar-track {
+  background: rgb(239, 239, 239);
+  border-radius: 2px;
+}
+.scroll-box::-webkit-scrollbar-thumb {
+  background: #40a0ff49;
+  border-radius: 10px;
+}
+.scroll-box::-webkit-scrollbar-thumb:hover {
+  background: #40a0ff;
+}
+.all-box .communal-box .el-autocomplete,.el-select{
+  margin-right: 0;
+}
 </style>
 

+ 2 - 2
src/components/system/Payroll.vue

@@ -57,7 +57,7 @@
                         <el-table-column
                             prop="row_Number"
                             label="序号"
-                            width="50">
+                            width="55">
                         </el-table-column>
                         <el-table-column
                             prop="yearMonth"
@@ -120,7 +120,7 @@
                         <el-table-column
                             prop="workDays"
                             label="应出勤天数"
-                            width="95">
+                            width="100">
                         </el-table-column>
                         <!-- <el-table-column
                             prop="regularDays"

+ 6 - 6
src/store/websocket.js

@@ -1,9 +1,9 @@
-export default {
-    ws:{},
-    setWs: function(newWs) {
-      this.ws = newWs
-    }
-  }
+// export default {
+//     ws:{},
+//     setWs: function(newWs) {
+//       this.ws = newWs
+//     }
+//   }
 // // <!--引入store,用于管理socket推送来的消息-->
 // import store from '../store'
 // // <!--封装websocket对象-->

+ 18 - 6
vue.config.js

@@ -1,8 +1,20 @@
-module.exports = {
-    publicPath:'./',
-    devServer:{
-        Proxy:{
-            ws:false
-        }
+const { defineConfig } = require('@vue/cli-service')
+module.exports = defineConfig({
+  transpileDependencies:true,
+  lintOnSave:false, //关闭哦语法检查
+  devServer: {
+    host: '132.232.92.186',
+    // https:true,
+    port: 8888,
+    client: {
+      webSocketURL: 'ws://132.232.92.186:8888/chatHub',
+    },
+    headers: {
+      'Access-Control-Allow-Origin': '*',
     }
+  },
+  transpileDependencies: true
+})
+module.exports = {
+  lintOnSave: false,
 }