Browse Source

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy 1 year ago
parent
commit
be96abdb95

+ 24 - 32
client/src/utils/PubsubService.ts

@@ -3,59 +3,51 @@
  * 一个简单的发布者、订阅者模式,提供了发布、订阅、删除的方法
  * from chinyan
  */
-const PubsubService = (function () {
-  const topics: Record<string, ((params?: any) => void)[]> = {}
+class PubsubService {
+  private topics: Record<string, ((params?: any) => void)[]> = {}
 
   // 发布事件
-  function publish(topic: string, data: any) {
-    if (!topics[topic]) return
-    topics[topic].forEach((fn) => fn(data))
+  publish(topic: string, data: any) {
+    if (!this.topics[topic]) return
+    this.topics[topic].forEach((fn) => fn(data))
   }
 
   // 订阅事件
-  function subscribe(topic: string, callback: (params?: any) => void) {
-    if (!topics[topic]) {
-      topics[topic] = []
+  subscribe(topic: string, callback: (params?: any) => void) {
+    if (!this.topics[topic]) {
+      this.topics[topic] = []
     }
 
-    if (topics[topic].includes(callback)) {
-      return // 已经订阅过,不重复添加
+    if (!this.topics[topic].includes(callback)) {
+      this.topics[topic].push(callback)
     }
 
-    topics[topic].push(callback)
     // 返回取消订阅的方法
-    return function unsubscribe() {
-      const index = topics[topic].indexOf(callback)
+    return () => {
+      const index = this.topics[topic].indexOf(callback)
       if (index !== -1) {
-        topics[topic].splice(index, 1)
+        this.topics[topic].splice(index, 1)
       }
     }
   }
 
   // 清空所有订阅者
-  function clearAllSub() {
-    for (const key in topics) {
-      topics[key] = []
-    }
+  clearAllSub() {
+    this.topics = {}
   }
 
   // 清空某个主题的订阅者
-  function clearSubsByTopic(topic: string) {
-    topics[topic] = []
+  clearSubsByTopic(topic: string) {
+    if (this.topics[topic]) {
+      this.topics[topic] = []
+    }
   }
 
   // 判断是否有某个主题的订阅者
-  function hasSubsByTopic(topic: string) {
-    return topics[topic] && topics[topic].length > 0
-  }
-
-  return {
-    publish,
-    subscribe,
-    clearSubsByTopic,
-    clearAllSub,
-    hasSubsByTopic
+  hasSubsByTopic(topic: string) {
+    return this.topics[topic] && this.topics[topic].length > 0
   }
-})()
+}
 
-export default PubsubService
+// 实例化并导出单例
+export default new PubsubService()

+ 5 - 2
client/src/views/OaSystem/personnelManagement/components/DetailBox.vue

@@ -234,7 +234,7 @@ watch(
       }
       .text-area {
         width: 100%;
-        height: 132px;
+        height: 200px;
         overflow-y: scroll;
         background: #f9f9f9;
         border-radius: 4px 4px 4px 4px;
@@ -263,12 +263,15 @@ watch(
     width: 100%;
     padding-left: 100px;
     .comment-list {
-      height: 180px;
+      height: 120px;
       overflow-y: scroll;
       background: #f7f8fa;
       border-radius: 4px 4px 4px 4px;
       border: 1px solid #eef2f9;
       padding: 10px;
+      :deep(.el-empty) {
+        padding: 0 !important;
+      }
       .item {
         display: flex;
         justify-content: flex-start;

+ 6 - 3
client/src/views/OaSystem/personnelManagement/components/DetailBoxWeek.vue

@@ -145,7 +145,7 @@ watch(
       <el-form ref="form" label-width="100px">
         <el-row :gutter="24">
           <el-col :span="10">
-            <el-form-item class="label-item" label="日志日期">
+            <el-form-item class="label-item" label="周报日期">
               <div class="write-date">
                 {{ moment(detail.reportStartDate).format('YYYY-MM-DD') }}
                 -
@@ -246,7 +246,7 @@ watch(
       }
       .text-area {
         width: 100%;
-        height: 132px;
+        height: 200px;
         overflow-y: scroll;
         background: #f9f9f9;
         border-radius: 4px 4px 4px 4px;
@@ -275,12 +275,15 @@ watch(
     width: 100%;
     padding-left: 100px;
     .comment-list {
-      height: 180px;
+      height: 120px;
       overflow-y: scroll;
       background: #f7f8fa;
       border-radius: 4px 4px 4px 4px;
       border: 1px solid #eef2f9;
       padding: 10px;
+      :deep(.el-empty) {
+        padding: 0 !important;
+      }
       .item {
         display: flex;
         justify-content: flex-start;

+ 10 - 3
client/src/views/OaSystem/personnelManagement/weeklyCenter/weeklyLogList.vue

@@ -60,8 +60,16 @@ const { onChange } = defineProps<IProp>()
 const isLoading = ref<boolean>(false)
 // 所有的周日报和周划分
 // const allWorkDayListAndLogs = ref<any>([])
+
 // 本月日期
-const thisMonth = ref<any>(moment())
+const defineMonth = () => {
+  // 如果本周日是在一号或二号,那本周必然算是上个月,所以做一个判断
+  if (moment().date() < 3) {
+    return moment().subtract(1, 'month')
+  }
+  return moment()
+}
+const thisMonth = ref<any>(defineMonth())
 // 本月的周日报和周划分
 const thisMonthLogs = ref<any>([])
 
@@ -109,7 +117,6 @@ const initPageList = async () => {
   const workObj = await workDayList()
   const logList = await http.getMonthLogList('weekly', thisMonth.value)
   const allWorkDayListAndLogs = service.mergeWorkDayAndLogs(workObj, logList)
-
   const pointer = moment(thisMonth.value).format('YYYY-M')
   const thisMonthLog = allWorkDayListAndLogs[pointer].map((item: any) => {
     // 默认未填
@@ -177,7 +184,7 @@ const statusObj = [
 // const { push } = useRouter()
 const checkItem = ref(moment())
 const goToWeeklyPage = (item: any) => {
-  if (item.type == '未到') {
+  if (item?.type == '未到') {
     message.info('还未到这周!')
     return
   }

+ 7 - 6
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/staff/StaffStatisticServiceImpl.java

@@ -80,6 +80,7 @@ public class StaffStatisticServiceImpl implements StaffStatisticService {
 
         List<StaffRecordSDO> staffList = recordsMapper.selectList(new LambdaQueryWrapperX<StaffRecordSDO>()
                 .inIfPresent(StaffRecordSDO::getUserId, userIds)
+                .neIfPresent(StaffRecordSDO::getNickname, "admin")
                 .neIfPresent(StaffRecordSDO::getState, 4));
 
 
@@ -102,15 +103,15 @@ public class StaffStatisticServiceImpl implements StaffStatisticService {
                 .collect(Collectors.groupingBy(
                         employee -> {
                             if (employee.getZgxl().equals("6")) {
-                                return "doctorStaff";
+                                return "doctorStaff"; //博士
                             } else if (employee.getZgxl().equals("5")) {
-                                return "masterStaff";
-                            } else if (employee.getZgxl().equals("4")) {
-                                return "undergraduateStaff";
+                                return "masterStaff"; //硕士
+                            } else if (employee.getZgxl().equals("4") || employee.getZgxl().equals("7")) {
+                                return "undergraduateStaff";//本科
                             } else if (employee.getZgxl().equals("3")) {
-                                return "juniorCollegeStaff";
+                                return "juniorCollegeStaff";//大专
                             } else {
-                                return "belowJuniorCollegeStaff";
+                                return "belowJuniorCollegeStaff"; //大专以下
                             }
                         },
                         Collectors.counting()