|
@@ -1,30 +1,40 @@
|
|
<template>
|
|
<template>
|
|
<commonStyle :btnTitle="title" :close-on-content-click="false">
|
|
<commonStyle :btnTitle="title" :close-on-content-click="false">
|
|
- <industryTypeCard @handleClickIndustry="handleIndustry"></industryTypeCard>
|
|
|
|
|
|
+ <industryTypeCard :select="selectedItems" @handleClickIndustry="handle"></industryTypeCard>
|
|
</commonStyle>
|
|
</commonStyle>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import commonStyle from './commonStyle.vue'
|
|
import commonStyle from './commonStyle.vue'
|
|
import industryTypeCard from '@/components/industryTypeCard'
|
|
import industryTypeCard from '@/components/industryTypeCard'
|
|
|
|
+import { inject, ref } from 'vue'
|
|
defineOptions({name: 'conditionFilter-company-industry'})
|
|
defineOptions({name: 'conditionFilter-company-industry'})
|
|
-import { ref } from 'vue'
|
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
|
-
|
|
|
|
-const route = useRoute()
|
|
|
|
-const routeQuery = route?.query
|
|
|
|
-
|
|
|
|
const emits = defineEmits(['inputChange'])
|
|
const emits = defineEmits(['inputChange'])
|
|
|
|
+const query = inject('routeQuery')
|
|
|
|
+const props = defineProps({
|
|
|
|
+ positionIndexPage: { // 职位检索
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
const title = ref('行业类型')
|
|
const title = ref('行业类型')
|
|
-if (routeQuery && routeQuery.industryIds) {
|
|
|
|
- const arr = routeQuery.industryIds.split('_')
|
|
|
|
- title.value = `行业类型(${arr.length})`
|
|
|
|
- emits('inputChange', { values: arr, isEmit: true })
|
|
|
|
|
|
+const selectedItems = ref([])
|
|
|
|
+
|
|
|
|
+if (query && query.industryIds) {
|
|
|
|
+ const str = query.industryIds.split(',')[0]
|
|
|
|
+ const arr = str.split('_')
|
|
|
|
+ if (arr?.length) {
|
|
|
|
+ selectedItems.value = arr
|
|
|
|
+ title.value = selectedItems.value.length ? `行业类型(${selectedItems.value.length})` : '行业类型'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-const handleIndustry = (val) => {
|
|
|
|
- title.value = val.length ? `行业类型(${val.length})` : '行业类型'
|
|
|
|
- emits('inputChange', { values: val, isEmit: true })
|
|
|
|
|
|
+const handle = (arr) => {
|
|
|
|
+ selectedItems.value = arr
|
|
|
|
+ title.value = selectedItems.value.length ? `行业类型(${selectedItems.value.length})` : '行业类型'
|
|
|
|
+ if (props.positionIndexPage) emits('inputChange', selectedItems.value)
|
|
|
|
+ else emits('inputChange', { values: selectedItems.value, isEmit: true })
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|