浏览代码

求职类型

lifanagju_citu 11 月之前
父节点
当前提交
5fd3c1ce4e

+ 33 - 28
src/views/recruit/position/components/conditionFilter.vue

@@ -2,7 +2,7 @@
   <div class="d-flex">
     <companyIndustry @inputChange="val => inputChange('industryIds', val)"></companyIndustry>
     <positionType @inputChange="val => inputChange('positionId', val)"></positionType>
-    <JobType @inputChange="val => emits('change', 'jobType', val)"></JobType>
+    <JobType positionIndexPage @inputChange="val => inputChange('jobType', val)"></JobType>
     <expType :isSingle="false" @inputChange="val => inputChange('expType', val)"></expType>
     <payScope @inputChange="val => inputChange('payType', val)"></payScope>
     <educationType :isSingle="false" @inputChange="val => inputChange('eduType', val)"></educationType>
@@ -19,38 +19,43 @@ import payScope from './conditionFilter/payScope.vue'
 import educationType from './conditionFilter/educationType.vue'
 import scale from './conditionFilter/scale.vue'
 import financingStatus from './conditionFilter/financingStatus.vue'
-import { reactive, defineExpose } from 'vue'
-import { useRoute } from 'vue-router'
+// import { reactive, defineExpose } from 'vue'
+// import { useRoute } from 'vue-router'
 defineOptions({name: 'retrieval-components-conditionFilter'})
 const emits = defineEmits(['change'])
-const route = useRoute()
 
-const removeEmptyStringsAndReturnNew = (obj) => {
-  const result = {}
-  Object.keys(obj).forEach(function(key) {
-    if (obj[key]) {
-      result[key] = obj[key]
-    }
-  })
-  return result
+const inputChange = (key, arr) => {
+  const str = arr.length ? arr.join('_') : ''
+  emits('change', key, str)
 }
+// const route = useRoute()
+
+// const removeEmptyStringsAndReturnNew = (obj) => {
+//   const result = {}
+//   Object.keys(obj).forEach(function(key) {
+//     if (obj[key]) {
+//       result[key] = obj[key]
+//     }
+//   })
+//   return result
+// }
  
-const params = reactive({})
-let query = reactive({})
+// const params = reactive({})
+// let query = reactive({})
 
-if (route.query?.content) {
-  query['content'] = route.query.content
-  emits('change')
-}
+// if (route.query?.content) {
+//   query['content'] = route.query.content
+//   emits('change')
+// }
 
-const inputChange = (key, { values }) => {
-  params[key] = values
-  query[key] = Array.isArray(values) ? values.join('_') : values
-  query = removeEmptyStringsAndReturnNew(query)
-  emits('change', query.value)
-}
-const getQuery = () => {
-  return query
-}
-defineExpose({ getQuery, params })
+// const inputChange = (key, { values }) => {
+//   params[key] = values
+//   query[key] = Array.isArray(values) ? values.join('_') : values
+//   query = removeEmptyStringsAndReturnNew(query)
+//   emits('change', query.value)
+// }
+// const getQuery = () => {
+//   return query
+// }
+// defineExpose({ getQuery, params })
 </script>

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

@@ -49,8 +49,7 @@ const handle = (val) => {
     selectedItems.value.push(val)
   }
   title.value = selectedItems.value.length ? `求职类型(${selectedItems.value.length})` : '求职类型'
-  const str = selectedItems.value.length ? selectedItems.value.join('_') : ''
-  emits('inputChange', str)
+  emits('inputChange', selectedItems.value)
 }
 </script>
 <style lang="scss" scoped>