Parcourir la source

判断是否存在

lifanagju_citu il y a 3 mois
Parent
commit
c5634c039c
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/views/recruit/enterprise/search/retrieval/index.vue

+ 3 - 3
src/views/recruit/enterprise/search/retrieval/index.vue

@@ -79,7 +79,7 @@
         </template>
         </template>
         
         
         <div class="px-5 pb-8">
         <div class="px-5 pb-8">
-          <div v-if="item.workList.length">
+          <div v-if="item?.workList?.length">
             <div class="second-title">工作经验</div>
             <div class="second-title">工作经验</div>
             <v-timeline density="compact" align="start" side="end" truncate-line="both">
             <v-timeline density="compact" align="start" side="end" truncate-line="both">
               <v-timeline-item v-for="(j, i) in item.workList" :key="i" dot-color="primary" size="small">
               <v-timeline-item v-for="(j, i) in item.workList" :key="i" dot-color="primary" size="small">
@@ -296,7 +296,7 @@ const getData = async () => {
   loading.value = true
   loading.value = true
   try {
   try {
     const res = await getPersonSearchPage(Object.assign(queryParams.value, query.value))
     const res = await getPersonSearchPage(Object.assign(queryParams.value, query.value))
-    if (!res.list.length) {
+    if (!res?.list?.length) {
       items.value = []
       items.value = []
       total.value = 0
       total.value = 0
       return
       return
@@ -380,7 +380,7 @@ const positionList = ref([])
 const getJobList = async () => {
 const getJobList = async () => {
   const { total, list } = await getJobAdvertisedList({ pageNo: 1, pageSize: 10, hasExpiredData: false, status: 0 })
   const { total, list } = await getJobAdvertisedList({ pageNo: 1, pageSize: 10, hasExpiredData: false, status: 0 })
   jobNum.value = total
   jobNum.value = total
-  if (!list.length) {
+  if (!list?.length) {
     positionList.value = []
     positionList.value = []
     jobNum.value = 0
     jobNum.value = 0
     return
     return