Forráskód Böngészése

职位、公司收藏数量更新

Xiao_123 4 hónapja
szülő
commit
4efbee826a

+ 3 - 0
components.d.ts

@@ -72,4 +72,7 @@ declare module 'vue' {
     VerifySlide: typeof import('./src/components/Verifition/Verify/VerifySlide.vue')['default']
     WangEditor: typeof import('./src/components/FormUI/wangEditor/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 7 - 1
src/views/recruit/personal/PersonalCenter/jobFeedback/components/companyCollection.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div v-if="items.length">
-      <LongCompany :list="items" @refresh="getPositionList"></LongCompany>
+      <LongCompany :list="items" @refresh="handleCancelCollect"></LongCompany>
       <CtPagination
         :total="total"
         :page="page.pageNo"
@@ -20,6 +20,7 @@ import { ref } from 'vue'
 import { dealDictArrayData } from '@/utils/position'
 import { getSubscribeEnterprise } from '@/api/position'
 
+const emit = defineEmits(['cancelCollect'])
 const total = ref(0)
 const items = ref([])
 const page = ref({
@@ -36,6 +37,11 @@ const getPositionList = async () => {
 }
 getPositionList()
 
+const handleCancelCollect = () => {
+  emit('cancelCollect', 1)
+  getPositionList()
+}
+
 const handleChangePage = (index) => {
   page.value.pageNo = index
   getPositionList()

+ 1 - 1
src/views/recruit/personal/PersonalCenter/jobFeedback/components/interested.vue

@@ -6,7 +6,7 @@
       <v-tab :value="1">{{ subscribeCount > 0 ? `${$t('position.companyCollection')}(${subscribeCount})` : $t('position.companyCollection') }}</v-tab>
     </v-tabs>
     <div class="mt-3">
-      <component :is="tabVal === 0 ? positionCollection : companyCollection"></component>
+      <component :is="tabVal === 0 ? positionCollection : companyCollection" @cancelCollect="val => val ? getSubscribeCount() : getFavoriteCount()"></component>
     </div>
   </div>
 </template>

+ 7 - 1
src/views/recruit/personal/PersonalCenter/jobFeedback/components/positionCollection.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div v-if="items.length">
-      <LongStrip :items="items" :showCancelBtn="true" @refresh="getPositionList"></LongStrip>
+      <LongStrip :items="items" :showCancelBtn="true" @refresh="handleCancelCollect"></LongStrip>
       <CtPagination
         :total="total"
         :page="page.pageNo"
@@ -20,6 +20,7 @@ import { ref } from 'vue'
 import { dealDictObjData } from '@/utils/position'
 import { getJobFavoriteList } from '@/api/position'
 
+const emit = defineEmits(['cancelCollect'])
 const total = ref(0)
 const items = ref([])
 const page = ref({
@@ -41,6 +42,11 @@ const getPositionList = async () => {
 }
 getPositionList()
 
+const handleCancelCollect = () => {
+  emit('cancelCollect', 0)
+  getPositionList()
+}
+
 const handleChangePage = (index) => {
   page.value.pageNo = index
   getPositionList()