Ver Fonte

优化首页适配和通知公告

songxy há 1 ano atrás
pai
commit
e012b5cc50

+ 23 - 0
client/src/utils/formatTime.ts

@@ -221,3 +221,26 @@ export function convertDate(param: Date | string) {
   }
   return param
 }
+
+/***
+ * 将时间戳转成YYYY-MM-DD HH:ii:ss
+ */
+export function convertTimeToDate(time: number) {
+  if (!time) return
+  const date = new Date(time)
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  const monthStr = month < 10 ? `0${month}` : month.toString()
+  const dayStr = day < 10 ? `0${day}` : day.toString()
+  const hourStr = hour < 10 ? `0${hour}` : hour.toString()
+  const minuteStr = minute < 10 ? `0${minute}` : minute.toString()
+  const secondStr = second < 10 ? `0${second}` : second.toString()
+
+  return `${year}-${monthStr}-${dayStr} ${hourStr}:${minuteStr}:${secondStr}`
+}

+ 5 - 0
client/src/views/OaSystem/home/common.scss

@@ -46,6 +46,11 @@
       &.bottomBox {
         display: flex;
         height: calc(50% - 20px);
+        >div {
+          &:first-child {
+            min-width: 600px;
+          }
+        }
       }
     }
   }

+ 1 - 0
client/src/views/OaSystem/home/components/BarList.vue

@@ -74,6 +74,7 @@ ul {
 
 .unit-person {
   margin: 10px 0;
+  margin-top: 5px;
   margin-right: 30px;
   font-family: 'Microsoft YaHei';
   font-size: 13px;

+ 2 - 1
client/src/views/OaSystem/home/components/CardItemSeven.vue

@@ -5,7 +5,7 @@
         <div class="content">
           <span>{{ item?.messageContent }}</span>
         </div>
-        <span>{{ item?.createTime }}</span>
+        <span>{{ convertTimeToDate(item?.createTime) }}</span>
       </li>
     </ul>
     <p v-else style="text-align: center; padding: 20px 0px">
@@ -16,6 +16,7 @@
 
 <script setup lang="ts">
 import request from '@/config/axios'
+import { convertTimeToDate } from '@/utils/formatTime'
 import { useUserStore } from '@/store/modules/user'
 
 const loading = ref<boolean>(false)

+ 2 - 2
client/src/views/OaSystem/home/components/PersonInfo.vue

@@ -258,7 +258,7 @@ const switchListData = (): void => {
   .card-person-chart-l {
     width: 34px;
     height: 100%;
-    margin-top: 20px;
+    margin-top: 10px;
 
     span {
       display: block;
@@ -293,7 +293,7 @@ const switchListData = (): void => {
 }
 
 .card-person-chart-m {
-  margin-top: 20px;
+  margin-top: 10px;
 
   .school {
     height: 96px;

+ 1 - 1
client/src/views/OaSystem/home/index.vue

@@ -41,7 +41,7 @@ const roles = userStore.getRoles
 if (roles) {
   if (roles.indexOf('test_leader') != -1 || roles.indexOf('test_dept_manager') != -1) {
     //板块领导||部门经理
-    currentIndex.value = '1'
+    currentIndex.value = '2'
   } else {
     //普通员工
     currentIndex.value = '2'

+ 2 - 0
client/src/views/OaSystem/oaLayout/header.vue

@@ -67,6 +67,7 @@ onMounted(() => {})
   .header-left {
     display: flex;
     align-items: center;
+    min-width: 466px;
     img {
       width: 48px;
       height: 48px;
@@ -85,6 +86,7 @@ onMounted(() => {})
     display: flex;
     align-items: center;
     height: 100%;
+    min-width: 328px;
     .hx {
       width: 1px;
       height: 30px;

+ 11 - 0
client/src/views/OaSystem/officeCenter/noticeAndLearn/noticeLook.vue

@@ -108,6 +108,17 @@ const queryListByPage = async (): Promise<void> => {
   total.value = result['total']
 }
 queryListByPage()
+const queryCount = async (): Promise<void> => {
+  const urlApi = `/adm/noticeAndLearn/readNo/count`
+  const sendData = {
+    type: 1,
+    ...formData.value
+  }
+  const result = await request.get({ url: urlApi, data: sendData })
+  console.log('result--------------')
+  console.log(result)
+}
+queryCount()
 const onSearchHandle = (): void => {
   pageNo.value = 1
   queryListByPage()

+ 2 - 2
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/noticeLearn/NoticeLearnController.java

@@ -60,7 +60,7 @@ public class NoticeLearnController {
     }
 
     @GetMapping("/readNo/count")
-    public CommonResult<Long> getCountReadNo(){
-        return success(noticeAndLearnService.getCountReadNo());
+    public CommonResult<Long> getCountReadNo(@Valid Integer type){
+        return success(noticeAndLearnService.getCountReadNo(type));
     }
 }

+ 6 - 2
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/dal/mysql/noticeAndLearn/NoticeAndLearnMapper.java

@@ -1,9 +1,11 @@
 package com.zjugis.module.adm.dal.mysql.noticeAndLearn;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.zjugis.framework.common.pojo.PageResult;
 import com.zjugis.framework.mybatis.core.mapper.BaseMapperX;
 import com.zjugis.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.zjugis.framework.mybatis.core.query.QueryWrapperX;
 import com.zjugis.module.adm.controller.admin.noticeLearn.vo.NoticeAndLearnCreateReqVO;
 import com.zjugis.module.adm.controller.admin.noticeLearn.vo.NoticeAndLearnPageReqVO;
 import com.zjugis.module.adm.controller.admin.noticeLearn.vo.NoticeAndLearnRespVO;
@@ -46,8 +48,10 @@ public interface NoticeAndLearnMapper extends BaseMapperX<NoticeAndLearnDO> {
         return NoticeAndLearnConvert.INSTANCE.convert(selectPage(reqVO, queryWrapperX));
     }
 
-    default  List<NoticeAndLearnRespVO> selectByAll(){
-        return NoticeAndLearnConvert.INSTANCE.convert(selectList());
+    default  List<NoticeAndLearnRespVO> selectByAll(Integer type){
+        LambdaQueryWrapperX<NoticeAndLearnDO> queryWrapperX = new LambdaQueryWrapperX<>();
+        queryWrapperX.eqIfPresent(NoticeAndLearnDO::getType, type);
+        return NoticeAndLearnConvert.INSTANCE.convert(selectList(queryWrapperX));
     }
 
     default List<NoticeAndLearnRespVO> selectByList(NoticeAndLearnPageReqVO reqVO){

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/noticeAndLearn/NoticeAndLearnService.java

@@ -21,5 +21,5 @@ public interface NoticeAndLearnService {
 
     Long updateRead(Long id) ;
 
-    Long getCountReadNo();
+    Long getCountReadNo(Integer type);
 }

+ 2 - 2
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/noticeAndLearn/NoticeAndLearnServiceImpl.java

@@ -86,8 +86,8 @@ public class NoticeAndLearnServiceImpl implements NoticeAndLearnService {
     }
 
     @Override
-    public Long getCountReadNo() {
-        List<NoticeAndLearnRespVO> lists = noticeAndLearnMapper.selectByAll();
+    public Long getCountReadNo(Integer type) {
+        List<NoticeAndLearnRespVO> lists = noticeAndLearnMapper.selectByAll(type);
         return lists.stream().filter((NoticeAndLearnRespVO item)->{
             if(relUserService.queryByCount(item.getId().longValue()) == 0){
                 return true;