Browse Source

办件中心角标功能实现

songxy 1 year ago
parent
commit
a7d8212e39

+ 4 - 0
client/src/api/oa/index.ts

@@ -52,3 +52,7 @@ export const deleteMenu = (id: number) => {
 export const getFlowUrl = (params) => {
   return request.get({ url: '/IFlowInstance/getFlowUrl', params }, '/workflow')
 }
+//获取待办角标
+export const getAttendCount = (params) => {
+  return request.get({ url: '/HandlerCaseApi/getAttendCount', params }, '/workflow')
+}

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

@@ -63,12 +63,12 @@ const projectList = [
     <li>
       <span>
         <b>2796</b>
-        新立
+        有合同
       </span>
       <i></i>
       <span>
         <b>1731</b>
-        结转
+        无合同
       </span>
     </li>
 

+ 30 - 2
client/src/views/OaSystem/oaLayout/menus.vue

@@ -19,6 +19,7 @@
       <div class="btn" @click="toPageHandle('/mainOfficeCenter')">
         <img src="@/assets/imgs/OA/bjzx_icon.png" alt="" />
         <p>办件中心</p>
+        <div class="tip" v-show="attendCount > 0">{{ attendCount }}</div>
       </div>
     </div>
     <div class="menus-tabs">
@@ -52,6 +53,7 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
 import MenusActive from './menusActive.vue'
 import { useQuery } from '@tanstack/vue-query'
 import { getRecordsDetail } from '@/api/oa/staffRecords'
+import { getAttendCount } from '@/api/oa/index'
 
 defineOptions({ name: 'Header' })
 const { t } = useI18n()
@@ -75,6 +77,20 @@ const { data } = useQuery(['fetch-staff-detail-left', userId], async () => {
   return await getRecordsDetail({ userId })
 })
 
+/***
+ * 根据用户ID获取待办角标
+ */
+const attendCount = ref<number>(0)
+const initAttendCount = async () => {
+  const result = await getAttendCount({
+    userId: userId
+  })
+  if (result) {
+    attendCount.value = result
+  }
+}
+initAttendCount()
+
 const mouseenterIndex = ref(-1)
 const loginOut = () => {
   ElMessageBox.confirm(t('common.loginOutMessage'), t('common.reminder'), {
@@ -97,7 +113,6 @@ const reactiveData: any = reactive({
 })
 
 const initMenus = async () => {
-  const uid = currentRoute.value
   let locals: any = localStorage.getItem('roleRouters')
   let roleRouters = JSON.parse(JSON.parse(locals).v)?.[0]?.children
 
@@ -245,7 +260,20 @@ onMounted(() => {
     height: 40px;
     padding: 0 20px;
     margin-bottom: 10px;
-
+    position: relative;
+    .tip {
+      background-color: #f00;
+      position: absolute;
+      right: 15px;
+      top: -10px;
+      font-size: 12px;
+      color: #fff;
+      width: 22px;
+      height: 22px;
+      line-height: 22px;
+      border-radius: 50%;
+      text-align: center;
+    }
     .btn {
       display: flex;
       width: 100%;

+ 1 - 1
zjugis-workflow/src/main/java/com/zjugis/z_workflow/serviceApi/HandlerCaseApiController.java

@@ -191,7 +191,7 @@ public class HandlerCaseApiController extends BaseController {
 		paramVo.setUserIds(Arrays.asList(userId));
 		paramVo.setFlowTemIds(flowTempIdList);
 		paramVo.setIsMobile(Objects.isNull(isMobile) ? false : isMobile);
-		return ok(iFlowHandlerCountServce.getAwaitCount(paramVo));
+		return success(iFlowHandlerCountServce.getAwaitCount(paramVo));
 	}
 
 	/**