Xiao_123 1 рік тому
батько
коміт
c1cbd9d174

+ 0 - 1
src/components/jobTypeCard/index.vue

@@ -17,7 +17,6 @@
             <span class="mdi mdi-menu-right"></span>
           </div>
         </div>
-        <!-- <v-divider vertical></v-divider> -->
         <!-- 分页 -->
         <div v-if="isPage" class="mt-2" @mouseover.stop="handleMouseLeave" style="border-top: 1px dashed #e6e6e6; position: absolute; bottom: 4px; width: 100%;">
           <div class="d-flex justify-space-between align-center mx-4" style="height: 40px">

+ 1 - 1
src/permission.js

@@ -15,7 +15,7 @@ const whiteList = [
   '/register',
   '/privacyPolicy',
   '/userAgreement',
-  '/company/search',
+  '/recruit/company',
   '/recruit/position'
 ]
 

+ 3 - 3
src/views/Home/personal/components/hotPromotedPositions.vue

@@ -7,13 +7,13 @@
     </v-tabs>
     <v-window v-model="tab" class="mt-3">
       <v-window-item :value="1">
-        <PositionCard :items="items" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
+        <PositionCard v-if="items.length" :items="items" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
       </v-window-item>
       <v-window-item :value="2">
-        <PositionCard :items="items"></PositionCard>
+        <PositionCard v-if="items.length" :items="items" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
       </v-window-item>
       <v-window-item :value="3">
-        <PositionCard :items="items"></PositionCard>
+        <PositionCard v-if="items.length" :items="items" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
       </v-window-item>
     </v-window>
     <div class="text-center">

+ 17 - 10
src/views/recruit/company/index.vue

@@ -10,11 +10,11 @@
         <div class="clear" @click="handleClear">清空筛选条件</div>
       </div>
     </div>
-    <companyItem class="mt-3" :list="items"></companyItem>
+    <companyItem v-loading="loading" class="mt-3" :list="items"></companyItem>
     <MPagination
       :total="total"
-      :page="pageInfo.current"
-      :limit="pageInfo.size"
+      :page="pageInfo.pageNo"
+      :limit="pageInfo.pageSize"
       @handleChange="handleChangePage"
     ></MPagination>
   </div>
@@ -42,10 +42,11 @@ const handleClear = () => {
 }
 
 const total = ref(0)
+const loading = ref(false)
 const items = ref([])
 const pageInfo = ref({
-  size: 1,
-  current: 1
+  pageSize: 1,
+  pageNo: 1
 })
 const query = ref({
   ...pageInfo.value
@@ -53,22 +54,28 @@ const query = ref({
 
 // 搜索
 const handleSearch = async (val, key) => {
-  query.value.current = 1
+  query.value.pageNo = 1
+  // val为-1时选择的是不限或者全国, 此时选中的字段不传
   if (val === -1) delete query.value[key]
   else query.value[key] = val
   await getCompanyData()
 }
 
 const getCompanyData = async () => {
-  const { list, total: number } = await getEnterpriseSearch(query.value)
-  total.value = number
-  items.value = dealDictData(items.value, list)
+  loading.value = true
+  try {
+    const { list, total: number } = await getEnterpriseSearch(query.value)
+    total.value = number
+    items.value = dealDictData(items.value, list)
+  } finally {
+    loading.value = false
+  }
 }
 getCompanyData()
 
 // 分页
 const handleChangePage = (index) => {
-  pageInfo.value.current = index
+  pageInfo.value.pageNo = index
   getCompanyData()
 }
 </script>

+ 1 - 1
src/views/recruit/position/components/dict.js

@@ -37,7 +37,7 @@ export const dealDictData = (res, list) => {
     const valueKey = item.nameKey ? item.nameKey : 'label'
     const idKey = item.valueKey ? item.valueKey : 'value'
     if (Array.isArray(list)) {
-      const next = list.find(val => val[item.key])
+      const next = list.find(val => val[item?.key])
       if (!next) return
       res = list.map(e => {
         const obj = dictObj[item.value].find(k => Number(k[idKey]) === Number(e[item.key]))