Quellcode durchsuchen

作业执行监控页面底部tab标签内容展示判断优化

wyn vor 3 Monaten
Ursprung
Commit
3ba5137110
2 geänderte Dateien mit 27 neuen und 7 gelöschten Zeilen
  1. 19 2
      src/views/jobTicket/job/JobMonitor.vue
  2. 8 5
      src/views/system/notify/agent/index.vue

+ 19 - 2
src/views/jobTicket/job/JobMonitor.vue

@@ -131,6 +131,7 @@
                   </div>
                 </div>
               </div>
+              <p v-show="groupedLockers.length==0" style="margin-top:20px;text-align: center">暂无数据</p>
             </div>
             <!-- 共锁人区域 -->
             <div class="right_box">
@@ -143,6 +144,7 @@
                   <div class="user-name">{{ user.userName }}</div>
                 </div>
               </div>
+              <p v-show="coLockUsers.length==0" style="margin-top:20px;text-align: center">暂无数据</p>
             </div>
           </div>
         </el-tab-pane>
@@ -245,7 +247,8 @@
               <span class="tab-text">作业日志</span>
             </div>
           </template>
-          <div class="joblogCon">
+          <p v-show="filteredJoblogList.length==0" style="margin-top:20px;text-align: center">暂无数据</p>
+          <div class="joblogCon" v-show="filteredJoblogList.length>0">
             <!--顶部日志内容-->
             <div class="joblogTop">
               <p v-for="(item, index) in filteredJoblogList" :key="index">
@@ -304,6 +307,7 @@ import { CaretRight } from '@element-plus/icons-vue'
 import { getTicketOperLogPage } from '@/api/job/index'
 import { connectWebsocket, closeWebsocket } from '@/utils/webSocket'
 import { getIsSystemAttributeByKey } from '@/api/basic/configuration/index'
+import type { TabsPaneContext } from 'element-plus'
 
 const JobForm = reactive({
   createTime: null,
@@ -365,6 +369,8 @@ const isJoblogVisible = ref(false)
 const JoblogDialogVisible = ref(false)
 
 
+
+
 // 初始化
 onMounted(async () => {
   await getDetail()
@@ -376,7 +382,11 @@ onMounted(async () => {
   window.addEventListener('resize', onResize)
   onResize()
   getWebSocket()
-  if (route.query.todoType == 'CONFIRM' || route.query.todoType == 'END') {
+  const todoType = route.query.todoType as string | undefined
+  if (!todoType) {
+    // 没传值、undefined、null、空字符串都进这里
+    activeName.value = 'first'
+  } else if (todoType == 'CONFIRM' || todoType == 'END') {
     activeName.value = 'fourth'
     await handleClick({ paneName: 'fourth' } as TabsPaneContext, new Event('click'))
   } else {
@@ -968,6 +978,12 @@ const onNewSocketLog=async (rawLogStr)=> {
 </script>
 
 <style scoped lang="scss">
+.demo-tabs > .el-tabs__content {
+  padding: 32px;
+  color: #6b778c;
+  font-size: 32px;
+  font-weight: 600;
+}
 .basicInformation {
   border: 1px solid #dcdfe6;
   border-radius: 4px;
@@ -1430,4 +1446,5 @@ const onNewSocketLog=async (rawLogStr)=> {
     }
   }
 }
+
 </style>

+ 8 - 5
src/views/system/notify/agent/index.vue

@@ -20,7 +20,8 @@
           </span>
         </template>
         <!--       中间内容-->
-        <div class="middleContent" v-for="(item,index) in waitAgentList" :key="index">
+        <p v-show="waitAgentList.length==0" style="text-align: center">暂无数据</p>
+        <div class="middleContent" v-for="(item,index) in waitAgentList" :key="index" v-show="waitAgentList.length>0">
           <div class="itemCon">
             <section class="title">等待: <span>{{item.todoTitle}} <span v-if="item.groupName">({{item.groupName}})</span></span></section>
             <section class="itemDetail" @click="goJobMonitor(item.ticketId,item.todoType)">
@@ -38,8 +39,9 @@
           </span>
         </template>
         <!--       中间内容-->
+        <p v-show="handleAgentLsit.length==0" style="text-align: center">暂无数据</p>
         <div class="middleContent">
-          <div class="itemCon" v-for="(item,index) in handleAgentLsit" :key="index">
+          <div class="itemCon" v-for="(item,index) in handleAgentLsit" :key="index" v-show="handleAgentLsit.length>0">
             <section class="title"><span style="color: red">{{item.todoTitle || '-'}} <span v-if="item.groupName">({{item.groupName}})</span></span></section>
             <section class="itemDetail" @click="goJobMonitor(item.ticketId,item.todoType)">
               <p>相关作业:<span>{{item.ticketName || '-'}}</span></p>
@@ -86,7 +88,8 @@
               @change="handleCustomDateChange"
             />
           </div>
-          <div class="itemCon" v-for="(item,index) in finishedAgentLsit" :key="index">
+          <p v-show="finishedAgentLsit.length==0" style="text-align: center">暂无数据</p>
+          <div class="itemCon" v-for="(item,index) in finishedAgentLsit" :key="index" v-show="finishedAgentLsit.length>0">
             <section class="title"><span>{{item.todoTitle || '-'}} <span v-if="item.groupName">({{item.groupName}})</span></span></section>
             <section class="itemDetail" @click="goJobMonitor(item.ticketId,item.todoType)">
               <p>相关作业:<span>{{item.ticketName || '-'}}</span></p>
@@ -183,12 +186,12 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
 const goJobMonitor=async (ticketId:number,todoType:string)=>{
   try{
     const JobData = await JobApi.selectJobTicketById(ticketId)
-    if(JobData.data){
+    if(JobData.data!==null){
       router.push({
         name:'JobMonitor',
         query:{
           id:ticketId,
-          todoTYpe:todoType
+          todoType:todoType
         }
       })
     }