Przeglądaj źródła

待办图标数字提示和待办页面已处理的查询功能参数传递问题修改

wyn 2 miesięcy temu
rodzic
commit
445bc0a406

+ 25 - 11
src/layout/components/ToolHeader.vue

@@ -14,8 +14,9 @@ import TenantVisit from '@/layout/components/TenantVisit/index.vue'
 import { useAppStore } from '@/store/modules/app'
 import { useDesign } from '@/hooks/web/useDesign'
 import { checkPermi } from '@/utils/permission'
+import * as Agent from '@/api/system/notify/agent/index'
 // 先导入图片
-import todoIcon from '../../assets/images/topTodo.png';
+import todoIcon from '../../assets/images/topTodo.png'
 
 const { getPrefixCls, variables } = useDesign()
 
@@ -58,6 +59,21 @@ export default defineComponent({
     // 代办数量
     const router = useRouter()
     const documentTodos = ref(0)
+    const queryParams = reactive({
+      pageNum: 1,
+      pageSize: -1,
+      queryType: '0', // 默认全部
+      startTime: '',
+      endTime: ''
+    })
+    onMounted(() => {
+      getAgentNum()
+    })
+    const getAgentNum = async () => {
+      const agentData = await Agent.getMyAgent(queryParams)
+      documentTodos.value = agentData.handleAgent.length
+      console.log(agentData, 'agentData')
+    }
     // 代办:处理跳转逻辑
     const handleNewPageJump = () => {
       router.push({ name: 'Agent' })
@@ -81,11 +97,11 @@ export default defineComponent({
           </div>
         ) : undefined}
         <div class="h-full flex items-center">
-          {hasTenantVisitPermission.value ? <TenantVisit/> : undefined}
+          {hasTenantVisitPermission.value ? <TenantVisit /> : undefined}
           {screenfull.value ? (
             <Screenfull class="custom-hover" color="var(--top-header-text-color)"></Screenfull>
           ) : undefined}
-          {search.value ? <RouterSearch isModal={false}/> : undefined}
+          {search.value ? <RouterSearch isModal={false} /> : undefined}
           {size.value ? (
             <SizeDropdown class="custom-hover" color="var(--top-header-text-color)"></SizeDropdown>
           ) : undefined}
@@ -98,14 +114,9 @@ export default defineComponent({
           {message.value ? (
             <Message class="custom-hover" color="var(--top-header-text-color)"></Message>
           ) : undefined}
-          <div
-            class="custom-hover p-2 cursor-pointer"
-            onClick={handleNewPageJump}
-            title="待办"
-          >
+          <div class="custom-hover p-2 cursor-pointer" onClick={handleNewPageJump} title="待办">
             {documentTodos.value > 0 ? (
-              <ElBadge value={documentTodos.value} max={10} class="item">
-                // 然后在模板中使用
+              <ElBadge value={documentTodos.value} max={10} class="itemAgent" badge-style="">
                 <img
                   src={todoIcon}
                   style="width: 1.2em; height: 1.2em; vertical-align: middle;"
@@ -113,7 +124,6 @@ export default defineComponent({
                 />
               </ElBadge>
             ) : (
-              // 然后在模板中使用
               <img
                 src={todoIcon}
                 style="width: 1.2em; height: 1.2em; vertical-align: middle;"
@@ -140,4 +150,8 @@ $prefix-cls: #{$namespace}-tool-header;
   margin-top: 10px;
   margin-right: 40px;
 }
+.itemAgent {
+  margin-top: -8px;
+  margin-right: 30px;
+}
 </style>

+ 3 - 3
src/views/system/notify/agent/index.vue

@@ -79,7 +79,7 @@
               v-if="queryParams.queryType == 3"
               v-model="customDateRange"
               type="daterange"
-              value-format="yyyy-MM-dd HH:mm:ss"
+              value-format="YYYY-MM-DD HH:mm:ss"
               range-separator="To"
               start-placeholder="开始日期"
               end-placeholder="结束日期"
@@ -113,7 +113,7 @@ import * as JobApi from '@/api/job/index'
 
 const router = useRouter()
 // const route = useRoute()
-const activeName = ref('first')
+const activeName = ref('second')
 // 查询参数
 const queryParams = reactive({
   pageNum: 1,
@@ -162,7 +162,7 @@ const handleQueryTypeChange = () => {
 
 // 处理自定义日期选择
 const handleCustomDateChange = (val) => {
-  if (val && val.length === 2) {
+  if (val && val.length == 2) {
     queryParams.startTime = dayjs(val[0]).format('YYYY-MM-DD HH:mm:ss')
     queryParams.endTime = dayjs(val[1]).format('YYYY-MM-DD HH:mm:ss')
     getAgentData()