Xiao_123 11 meses atrás
pai
commit
a831e36d6f

+ 16 - 12
src/components/Enterprise/components/positions.vue

@@ -14,8 +14,8 @@
     <div class="d-flex mt-3">
       <areaType v-if="areaList.length" :list="areaList" @inputChange="val => handleSearch('areaIds', val)"></areaType>
       <expType :isSingle="true" @inputChange="val => handleSearch('expType', val)"></expType>
-      <educationType></educationType>
-      <payScope></payScope>
+      <educationType :isSingle="true" @inputChange="val => handleSearch('eduType', val)"></educationType>
+      <payScope @input-change="val => handleSearch('payType', val)"></payScope>
       <div style="width: 300px;">
         <v-text-field
           v-model="query.content"
@@ -24,8 +24,8 @@
           hide-details
           color="primary"
           append-inner-icon="mdi-magnify"
-          @click:append-inner="handleSearch(query.content, 'content')"
-          @keyup.enter="handleSearch(query.content, 'content')"
+          @click:append-inner="handleSearch('content', { values: query.content })"
+          @keyup.enter="handleSearch('content', { values: query.content })"
         >
         </v-text-field>
       </div>
@@ -137,24 +137,22 @@ const handleClickCategory = (k) => {
 
 const dealRouteQuery = () => {
   const arr = Object.keys(query).map((e, i) => {
-    return `${i ? '&' : ''}${e}=${query[e]}`
+    if (e !== 'pageNo' || e !== 'pageSize') return `${i ? '&' : ''}${e}=${query[e]}`
   })
   const str = arr.join()
   if (str) router.push(`${route.path}?${str}`)
 }
 
 const handleSearch = (key, { values }) => {
-  console.log(values, key, 'handle-search')
   if (values === -1 || !values || values[0] === -1) delete query[key]
   else query[key] = values
   dealRouteQuery()
-  query.pageNo = 1
-  // getPositionList()
+  getPositionList(true)
 }
 
 // 职位列表
 const list = ref([])
-const query = reactive({
+let query = reactive({
   // content: '',
   // areaIds: [],
   // expType: 0,
@@ -163,8 +161,14 @@ const query = reactive({
   // positionId: 0,
 })
 // 职位列表
-const getPositionList = async () => {
-  const { list: arr, total: number } = await getJobAdvertisedSearch(Object.assign(query, pageInfo.value, { enterpriseId: props.info.enterprise.id }))
+const getPositionList = async (isSearch) => {
+  query = {
+    ...query,
+    ...pageInfo.value,
+    enterpriseId: props.info.enterprise.id
+  }
+  if (isSearch) query.pageNo = 1
+  const { list: arr, total: number } = await getJobAdvertisedSearch(query)
   total.value = number
   list.value = arr.map(e => {
     e.active = false
@@ -172,7 +176,7 @@ const getPositionList = async () => {
     return e
   })
 }
-// getPositionList()
+getPositionList()
 
 const handleChangePage = (index) => {
   pageInfo.value.pageNo = index

+ 1 - 1
src/views/recruit/position/components/conditionFilter.vue

@@ -5,7 +5,7 @@
     <JobType @inputChange="val => inputChange('jobType', val)"></JobType>
     <expType :isSingle="false" @inputChange="val => inputChange('expType', val)"></expType>
     <payScope @inputChange="val => inputChange('payScope', val)"></payScope>
-    <educationType @inputChange="val => inputChange('educationType', val)"></educationType>
+    <educationType :isSingle="false" @inputChange="val => inputChange('educationType', val)"></educationType>
     <scale @inputChange="val => inputChange('scale', val)"></scale>
     <financingStatus @inputChange="val => inputChange('financingStatus', val)"></financingStatus>
   </div>

+ 4 - 5
src/views/recruit/position/components/conditionFilter/areaType.vue

@@ -39,11 +39,10 @@ getDict('menduner_area_type', {}, 'areaList').then(({ data }) => {
     return { id, label, number: e.value, parentId, type }
   })
   items.value = [{ id: -1, label: '全部' }, ...arr]
-  if (query && query.areaIds) {
-    if (query?.areaIds) {
-      selectedItems.value = [Number(query.areaIds)]
-      emits('inputChange', { values: selectedItems.value })
-    }
+  if (query && query?.areaIds) {
+    title.value = '工作地点(1)'
+    selectedItems.value = [Number(query.areaIds)]
+    emits('inputChange', { values: selectedItems.value })
   }
   show.value = true
 })

+ 39 - 7
src/views/recruit/position/components/conditionFilter/educationType.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle btnTitle="学历要求" :close-on-content-click="false">
+  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="isSingle">
     <v-list>
       <v-list-item
         color="primary"
@@ -7,6 +7,9 @@
         v-for="item in items" :key="item.id" :value="item.value"
         @click="handle(item.value)"
       >
+        <template v-if="selectedItems.includes(item.value)" v-slot:append>
+          <v-icon icon="mdi-check"></v-icon>
+        </template>
         <v-list-item-title>{{ item.label }}</v-list-item-title>
       </v-list-item>
     </v-list>
@@ -15,20 +18,49 @@
 <script setup>
 import commonStyle from './commonStyle.vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { ref, defineEmits } from 'vue';
-
+import { ref, defineEmits, inject } from 'vue';
 defineOptions({name: 'conditionFilter-educationType'})
-const emits = defineEmits(['selectedItems'])
+
+const props = defineProps({
+  isSingle: {
+    type: Boolean,
+    default: false
+  }
+})
+
+const show = ref(false)
+const query = inject('routeQuery')
+const title = ref('学历要求')
+const emits = defineEmits(['inputChange'])
 let items = ref()
 const selectedItems = ref([])
 getDict('menduner_education_type').then(({ data }) => {
   data = data?.length && data || []
   items.value = data
+  if (query && query.eduType) {
+    const str = query.eduType.split(',')[0]
+    const arr = str.split('_')
+    if (arr?.length) {
+      selectedItems.value = arr
+      title.value = props.isSingle ? '学历要求(1)' : `学历要求(${selectedItems.value.length})`
+      emits('inputChange', { values: selectedItems.value, isEmit: false })
+    }
+  }
+  show.value = true
 })
 const handle = (val) => {
-  if (selectedItems.value.includes(val)) selectedItems.value = selectedItems.value.filter(i => i !== val)
-  else selectedItems.value.push(val)
-  emits('selectedItems', selectedItems.value)
+  const obj = selectedItems.value.find(e => e === val)
+  if (props.isSingle) {
+    // 单选
+    selectedItems.value = obj ? [] : [val]
+  } else {
+    // 多选 
+    if (obj) {
+      selectedItems.value = selectedItems.value.filter(i => i !== val)
+    } else selectedItems.value.push(val)
+  }
+  title.value = props.isSingle ? '学历要求(1)' : `学历要求(${selectedItems.value.length})`
+  emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>
 <style lang="scss" scoped>

+ 18 - 6
src/views/recruit/position/components/conditionFilter/payScope.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle btnTitle="薪资待遇" :close-on-content-click="false">
+  <commonStyle v-if="show" :btnTitle="title" :close-on-content-click="true">
     <v-list>
       <v-list-item
         color="primary"
@@ -7,6 +7,9 @@
         v-for="item in items" :key="item.id" :value="item.value"
         @click="handle(item.value)"
       >
+        <template v-if="selectedItems.includes(item.value)" v-slot:append>
+          <v-icon icon="mdi-check"></v-icon>
+        </template>
         <v-list-item-title>{{ item.label }}</v-list-item-title>
       </v-list-item>
     </v-list>
@@ -15,20 +18,29 @@
 <script setup>
 import commonStyle from './commonStyle.vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { ref, defineEmits } from 'vue';
-
+import { ref, defineEmits, inject } from 'vue';
 defineOptions({name: 'conditionFilter-payScope'})
-const emits = defineEmits(['selectedItems'])
+
+const show = ref(false)
+const query = inject('routeQuery')
+const title = ref('薪资待遇')
+const emits = defineEmits(['inputChange'])
 let items = ref()
 let selectedItems = ref([])
 getDict('menduner_pay_scope').then(({ data }) => {
   data = data?.length && data || []
   items.value = data
+  if (query && query.payType) {
+    title.value = '薪资待遇(1)'
+    selectedItems.value = [query.payType]
+    emits('inputChange', { values: selectedItems.value })
+  }
+  show.value = true
 })
 const handle = (val) => {
-  // 单选
+  title.value = val.id === 0 ? '薪资待遇' : '薪资待遇(1)'
   selectedItems.value = [val]
-  emits('selectedItems', selectedItems.value)
+  emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>
 <style lang="scss" scoped>