From adfe1ca87e734e564b56a42c6fc5d015b4858eb3 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 04 六月 2024 20:37:49 +0800
Subject: [PATCH] 修改任务检验

---
 src/components/view/index-index.vue |  174 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 149 insertions(+), 25 deletions(-)

diff --git a/src/components/view/index-index.vue b/src/components/view/index-index.vue
index 63d5312..e3ece03 100644
--- a/src/components/view/index-index.vue
+++ b/src/components/view/index-index.vue
@@ -182,6 +182,7 @@
   }
   .left-2-item{
     border-right: 1px solid #F1F1F1;
+    overflow: hidden !important;
   }
   .left-2-item:nth-last-child(1){
     border-right: 0;
@@ -240,7 +241,31 @@
 		text-align: left;
     margin-bottom: 10px;
 	}
-
+  >>>.el-calendar-day span{
+    display: inline-block;
+    width: 30px;
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+    border-radius: 4px;
+  }
+  >>>.is-selected{
+    background: transparent !important;
+  }
+  >>>.is-selected .el-calendar-day{
+    background: transparent !important;
+  }
+  >>>.is-selected .el-calendar-day span{
+    background: #3A7BFA !important;
+    color: #fff !important;
+  }
+  >>>.el-calendar-day:hover{
+    background: transparent;
+  }
+  >>>.el-calendar-day span:hover{
+    background: #3A7BFA !important;
+    color: #fff !important;
+  }
 </style>
 
 <template>
@@ -255,7 +280,7 @@
 						</div>
 					</div>
 				</div>
-        <div class="left-2 card" v-loading="workLoading">
+        <div class="left-2 card" v-loading="workLoading" style="overflow: hidden;">
           <div class="left-2-item" v-for="(item,index) in workDay" :key="index">
             <div class="left-item-title">
               <span style="font-size: 18px;">{{ item }}</span>
@@ -279,8 +304,8 @@
               <img src="../../../static/img/index-0.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">254</p>
-              <p style="font-size: 14px;margin-bottom: 10px;">鎴戠殑浠e姙</p>
+              <p style="font-size: 20px;">{{getNumberFourTypes.totalNumberOfMessages}}</p>
+              <p style="font-size: 14px;margin-bottom: 10px;">鎴戠殑寰呭姙</p>
             </div>
           </div>
           <div class="right-1-item">
@@ -288,7 +313,7 @@
               <img src="../../../static/img/index-1.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">254</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.totalNumberOfReadMessages }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">宸插姙浜嬪疁</p>
             </div>
           </div>
@@ -297,7 +322,7 @@
               <img src="../../../static/img/index-2.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">254</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.remainingToDo }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">鍓╀綑寰呭姙</p>
             </div>
           </div>
@@ -306,7 +331,7 @@
               <img src="../../../static/img/index-3.svg" alt="">
             </div>
             <div class="mun">
-              <p style="font-size: 20px;">254</p>
+              <p style="font-size: 20px;">{{ getNumberFourTypes.totalNumberOfMessagesInThePastSevenDays }}</p>
               <p style="font-size: 14px;margin-bottom: 10px;">杩戞湡浜嬪疁</p>
             </div>
           </div>
@@ -331,8 +356,8 @@
                         <span>
                             {{ data.day.split('-').slice(2)+'' }}
                         </span>
-                    <el-badge v-if="data.isSelected" is-dot class="item">
-                    </el-badge>
+                    <!-- <el-badge v-if="data.isSelected" is-dot class="item">
+                    </el-badge> -->
                 </template>
               </el-calendar>
             </div>
@@ -343,26 +368,32 @@
                   <p class="ellipsis-multiline" >{{ m.text }}</p>
                 </el-tooltip>
               </div>
-              <span style="color:rgb(153, 153, 153);font-size: 12px;text-align: center;margin: 120px 0;display: inline-block;width: 100%;" v-if="listScheduleByMe.length==0">鏆傛棤</span>
+              <span style="color:rgb(144, 147, 153);font-size: 14px;text-align: center;margin: 120px 0;display: inline-block;width: 100%;" v-if="listScheduleByMe.length==0">鏆傛棤鏁版嵁</span>
             </div>
           </div>
         </div>
         <div class="right-3 card" style="overflow: hidden;">
           <div class="right-3-tab">
-            <div class="tab-item" style="cursor: pointer;" :class="{active:currentIndex==0}" @click="currentIndex=0">棰勮鎻愰啋 10</div>
-            <div class="tab-item" style="cursor: pointer;" :class="{active:currentIndex==1}" @click="currentIndex=1">閫氱煡閫氬憡 12</div>
+            <div class="tab-item" style="cursor: pointer;" :class="{active:currentIndex==4}" @click="currentIndex=4">棰勮鎻愰啋</div>
+            <div class="tab-item" style="cursor: pointer;" :class="{active:currentIndex==5}" @click="currentIndex=5">閫氱煡閫氬憡</div>
           </div>
-          <div class="right-3-list">
-            <div class="list3-item" v-for="(m,i) in 5" :key="i">
+          <div class="right-3-list" v-loading="listLoading">
+            <scroll-pagination @load="getList" :finishLoding="finishLoding" :list="list" v-if="list.length>0">
+              <div class="list3-item" v-for="(m,i) in list" :key="i">
               <div class="list3-item-title">
                 <img src="../../../static/img/index-tip.svg" alt="">
-                <p>璁惧鍒版湡鎻愰啋</p>
+                <p>{{ m.theme }}</p>
               </div>
               <div class="list3-item-info">
-                <p style="width: 73%;-webkit-line-clamp: 1;" class="ellipsis-multiline">缂栧彿<span style="color:#3A7BFA;"> SB20240101-001 </span>鐨勮澶囧皢浜�2023-09-09 11:11:11杩囨湡</p>
-                <p>2023-09-09 09:09:09</p>
+                <p style="width: 73%;-webkit-line-clamp: 1;cursor: pointer;" class="ellipsis-multiline" @click="goNoticeDetail(m)">
+                  <!-- 缂栧彿<span style="color:#3A7BFA;"> SB20240101-001 </span>鐨勮澶囧皢浜�2023-09-09 11:11:11杩囨湡 -->
+                  {{ m.content }}
+                </p>
+                <p>{{ m.createTime }}</p>
               </div>
             </div>
+            </scroll-pagination>
+            <div v-if="list.length<1&&!listLoading" style="color:#909399;font-size:14px;text-align: center;margin-top:80px" >鏆傛棤鏁版嵁</div>
           </div>
         </div>
       </el-col>
@@ -371,7 +402,7 @@
 			<div class="body" style="max-height: 60vh;">
 				<el-row>
 					<el-col class="search_thing" :span="22">
-						<div class="search_label">鏃堕棿锛�</div>
+						<div class="search_label"><span style="color: red;margin-right: 4px;">*</span>鏃堕棿锛�</div>
 						<div class="search_input">
 							<el-date-picker
                 v-model="query.time"
@@ -383,9 +414,10 @@
 						</div>
 					</el-col>
           <el-col class="search_thing" :span="22">
-						<div class="search_label">鍐呭锛�</div>
+						<div class="search_label"><span style="color: red;margin-right: 4px;">*</span>鍐呭锛�</div>
 						<div class="search_input">
-							<el-input v-model="query.text" size="small" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+							<el-input v-model="query.text" type="textarea"
+  :rows="2" size="small" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
 						</div>
 					</el-col>
 				</el-row>
@@ -404,13 +436,17 @@
   import {
 		getYearAndMonthAndDays
 	} from '../../util/date'
+  import ScrollPagination from '../tool/scroll-paging.vue'
 	export default {
+    components: {
+      ScrollPagination
+    },
 		data() {
 			return {
 				user: {},
 				now: null,
         calendarValue: new Date(),
-        currentIndex:0,
+        currentIndex:4,
         dialogVisible:false,
         query:{
           time:'',
@@ -423,11 +459,26 @@
         weekdays:[],
         listScheduleByMe:[],
         scheduleLoading:false,
+        list:[],
+        currentPage:1,
+        pageSize: 8, // 涓�椤�7鏉�
+        total: null,
+        listLoading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
+        finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+        timer:null,
+        keyMap:{},
+        getNumberFourTypes: {},
 			}
 		},
     watch:{
       calendarValue(val){
         this.getScheduleByMe()
+      },
+      currentIndex(){
+        this.keyMap = {}
+        this.currentPage = 1;
+        this.list = [];
+        this.getList();
       }
     },
 		mounted() {
@@ -436,11 +487,66 @@
 			setInterval(() => {
 				this.nowTime()
 			}, 1000)
-      this.init();
       this.weekdays = this.getWeekdaysForNextWeek()
+      this.init();
+      this.currentPage = 1;
+      this.keyMap = {}
+      this.list = [];
+      this.getList();
       this.getScheduleByMe()
+      this.timer&&clearInterval(this.timer)
+      this.timer = setInterval(() => {
+        this.init();
+        this.currentPage = 1;
+        this.keyMap = {}
+        this.list = [];
+        this.getList();
+        this.getScheduleByMe()
+      },1000*60*10)
+      this.getNumberFourTypesFun()
 		},
 		methods: {
+      getNumberFourTypesFun() {
+        this.$axios.get(this.$api.informationNotification.getNumberFourTypesMessagesHomePage).then(res => {
+          this.getNumberFourTypes = res.data
+        })
+      },
+      getList(){
+        const key = `_${this.currentPage}`
+        const value = this.keyMap[key]
+        // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰
+        if(value) {
+          return
+        }
+        // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅
+        this.keyMap[key] = 'temp'
+        if(this.currentPage==1){
+          this.listLoading = true
+        }
+        if(this.list.length==0){
+          this.finishLoding = false;
+        }
+        this.$axios.get(this.$api.informationNotification.page+'?size='+this.pageSize+'&current='+this.currentPage+'&messageType='+this.currentIndex).then(res => {
+          if(res.code === 201){
+            return
+          }
+          let list = res.data.records;
+          this.total = res.data.total;
+          if(list.length==0){
+            this.finishLoding = true;
+          }else{
+            if(list.length<this.pageSize){
+              this.finishLoding = true;
+            }
+            this.list = this.list.concat(list)
+            if(this.total==this.list.length){
+              this.finishLoding = true;
+            }
+            this.currentPage++;
+          }
+          this.listLoading = false
+        })
+      },
 			nowTime() {
 				var date = new Date();
 				var y = date.getFullYear();
@@ -561,7 +667,8 @@
             this.workList.push(res.data[`work${i}`])
           }
           this.workDay = res.data.weekDays.map(m=>{
-            return m[2]
+            let arr = m.split('-')
+            return arr[2]
           })
         })
       },
@@ -569,10 +676,11 @@
         let weekdays = [];
         for (let i = 0; i < 7; i++) {
           let date = new Date();
-          date.setDate(date.getDate() + i); // 浠婂ぉ涔嬪悗鐨勬棩瀛�
+          date.setDate(date.getDate() - i); // 浠婂ぉ涔嬪悗鐨勬棩瀛�
           let day = date.getDay(); // 0-6 浠h〃鏄熸湡鏃ュ埌鏄熸湡鍏�
           weekdays.push(day);
         }
+        weekdays.reverse()
         weekdays = weekdays.map(m=>{
           let day =''
           switch (m) {
@@ -623,6 +731,22 @@
           })
         })
       },
-		}
+      goNoticeDetail(row){
+      this.$axios.put(this.$api.informationNotification.triggerModificationStatusToRead+'/'+row.id).then(res => {
+        row.num = Math.random(100);
+        this.$bus.$emit("change", JSON.stringify(row));
+        this.$parent.addTab({
+          v: "娑堟伅璇︽儏",
+          i: "el-icon-s-tools",
+          u: "notice-detail",
+          k:35,
+          p: "abcd"
+        },29);
+      })
+    },
+		},
+    deactivated(){
+      this.timer&&clearInterval(this.timer)
+    }
 	}
 </script>

--
Gitblit v1.9.3