lifanagju_citu 1 місяць тому
батько
коміт
f0f6a2c113

+ 3 - 3
src/views/recruit/enterprise/search/components/common.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="d-flex align-center color-666">
-    <span class="font-size-14">{{ title }}:</span>
-    <v-chip-group v-model="select" selected-class="text-primary" mandatory @update:modelValue="handleSelect">
+    <span class="font-size-14" :class="labelActiveColor && select ? 'color-primary' : 'color-777'">{{ title }}:</span>
+    <v-chip-group v-model="select" selected-class="text-primary" @update:modelValue="handleSelect">
       <v-chip v-for="val in items" :key="val.id" :text="val.label" :value="val.value" label filter size="small"></v-chip>
     </v-chip-group>
   </div>
@@ -19,12 +19,12 @@ const props = defineProps({
   isClear: Boolean
 })
 
-const select = ref('')
 const items = ref([])
 getDict(props.dictType).then(({ data }) => {
   items.value = data || []
 })
 
+const select = ref('')
 const handleSelect = (val) => {
   emit('select', val)
 }

+ 0 - 53
src/views/recruit/enterprise/search/retrieval/components/area.vue

@@ -1,53 +0,0 @@
-<template>
-  <div class="font-size-15 d-flex align-center color-666">
-    <span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区:</span>
-    <v-menu :close-delay="1" :open-delay="0" v-bind="$attrs" :close-on-content-click="false">
-      <template v-slot:activator="{  props }">
-        <div>
-          <v-chip v-for="k in areaSelect" :key="k.id" class="mr-3" closable label size="small" @click:close="handleAreaClear(k)">{{ k.name }}</v-chip>
-          <v-btn icon="mdi-plus" v-bind="props" variant="outlined" size="x-small"></v-btn>
-        </div>
-      </template>
-      <AreaSelect :select="select" :currentData="areaSelect" :limit="false" showSelect @handleClick="handleArea"></AreaSelect>
-    </v-menu>
-  </div>
-</template>
-
-<script setup>
-defineOptions({ name: 'search-retrieval-area' })
-import { ref, watch } from 'vue'
-
-const emit = defineEmits(['select', 'clear'])
-const props = defineProps({
-  isClear: Boolean
-})
-const select = ref([])
-const areaSelect = ref([])
-
-const handleArea = (list, arr) => {
-  select.value = list
-  areaSelect.value = arr
-  emit('select', list)
-}
-
-const handleAreaClear = (k) => {
-  select.value = select.value.filter(item => item !== k.id)
-  const index = areaSelect.value.findIndex(item => item.id === k.id)
-  if (index !== -1) areaSelect.value.splice(index, 1)
-  emit('select', select.value)
-}
-
-watch(
-  () => props.isClear,
-  (val) => {
-    if (!val) return
-    select.value = []
-    areaSelect.value = []
-    emit('clear')
-  }
-)
-</script>
-
-<style scoped lang="scss">
-
-</style>

+ 0 - 80
src/views/recruit/enterprise/search/retrieval/components/position.vue

@@ -1,80 +0,0 @@
-<template>
-  <div class="d-flex font-size-14 flex-wrap">
-    <div v-for="val in items" :key="val.id" class="mr-5 cursor-pointer mb-3" :class="{'active': val.active}" @click="handleFirst(val)">{{ val.nameCn }}</div>
-  </div>
-  <div class="mt-3 font-size-14 mb-3">
-    <span 
-      v-for="k in children" 
-      :key="k.id" 
-      class="d-inline-block mr-10 cursor-pointer color-666 mb-2" 
-      :class="{'active': select.findIndex(e => e.id === k.id) !== -1}"
-      @click="handleSecond(k)"
-    >{{ k.nameCn }}</span>
-  </div>
-</template>
-
-<script setup>
-defineOptions({ name: 'search-screen-industry'})
-import { ref, watch } from 'vue'
-import { getDict } from '@/hooks/web/useDictionaries'
-
-const emit = defineEmits(['select', 'clear'])
-const props = defineProps({
-  selectData: {
-    type: Array,
-    default: () => []
-  },
-  isClear: Boolean
-})
-
-const items = ref([])
-const select = ref([])
-const children = ref([])
-getDict('positionTreeData', {}, 'positionTreeData').then(({ data }) => {
-  if (!data) return
-  items.value = data.map(e => {
-    e.active = false
-    return e
-  })
-})
-
-watch(
-  () => props.selectData,
-  (val) => {
-    select.value = val
-  },
-  { deep: true }
-)
-
-const handleFirst = (val) => {
-  items.value.forEach(e => e.active = false)
-  val.active = !val.active
-  children.value = val.children || []
-}
-
-const handleSecond = (val) => {
-  const index = select.value.findIndex(e => e.id === val.id)
-  if (index !== -1) {
-    select.value.splice(index, 1)
-  } else select.value.push(val)
-  emit('select', select.value)
-}
-
-watch(
-  () => props.isClear,
-  (val) => {
-    if (!val) return
-    select.value = []
-    children.value = []
-    items.value.forEach(e => e.active = false)
-    emit('clear')
-  }
-)
-</script>
-
-<style scoped lang="scss">
-.active {
-  color: var(--v-primary-base);
-  font-family: 'MiSans-Bold';
-}
-</style>

+ 7 - 19
src/views/recruit/enterprise/search/retrieval/index.vue

@@ -1,27 +1,23 @@
 <template>
-  <div class="mt-4">
-    <div class="d-flex justify-center">
+  <div>
+    <div class="d-flex justify-center mt-4 mb-6">
       <TextInput v-model="queryParams.content" :item="textItem" @enter="handleConfirm" @appendInnerClick="handleConfirm"></TextInput>
     </div>
     <div>
-      <Position :isClear="clear" @clear="clear = false" :selectData="position" @select="val => position = val"></Position>
       <div class="font-size-15 d-flex align-center color-666">
-        <span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区:</span>
+        <span :class="queryParams.positionIds?.length ? 'color-primary' : 'color-777'">职位类型:</span>
+        <cascade v-model="queryParams.positionIds" :item="positionItems" @change="val => handleSearch('positionIds', val)" style="width: 300px;"></cascade>
+        <span class="ml-10" :class="queryParams.areaIds?.length ? 'color-primary' : 'color-777'">地区:</span>
         <cascade v-model="queryParams.areaIds" :item="selectItems" @change="val => handleSearch('areaIds', val)" style="width: 300px;"></cascade>
       </div>
       <CommonPage :isClear="clear" @clear="clear = false" class="my-3" dictType="menduner_education_type" title="最高学历" @select="val => handleSearch('eduType', val)"></CommonPage>
       <CommonPage :isClear="clear" @clear="clear = false" dictType="menduner_exp_type" title="工作经验" @select="val => handleSearch('expType', val)"></CommonPage>
       <v-divider class="mt-1 mb-3"></v-divider>
       <div>
-        <div>
-          <v-chip v-for="k in position" :key="k.id" label class="mr-3" closable @click:close="handleClose(k)">{{ k.nameCn }}</v-chip>
-        </div>
-        <div class="text-end">
-          <v-btn  color="primary" variant="text" @click="handleClear">清空筛选条件</v-btn>
-        </div>
       </div>
       <div class="text-center mt-8">
         <v-btn class="half-button" color="primary" @click="handleConfirm">搜 索</v-btn>
+        <v-btn class="half-button ml-3" variant="outlined"  color="primary" @click="handleClear">重置</v-btn>
       </div>
     </div>
   </div>
@@ -113,7 +109,6 @@
 defineOptions({ name: 'searchRetrieval' })
 import { ref, computed } from 'vue'
 import CommonPage from '../components/common.vue'
-import Position from './components/position.vue'
 import { getPersonSearchPage } from '@/api/enterprise.js'
 import { dealDictArrayData } from '@/utils/position'
 import { timesTampChange } from '@/utils/date'
@@ -127,6 +122,7 @@ import InvitePage from '@/views/recruit/enterprise/interviewManagement/component
 import { getDict } from '@/hooks/web/useDictionaries'
 import { getTimeDifferenceInChinese } from '@/utils/date'
 import { formatName } from '@/utils/getText'
+import { spaces } from '@/utils/index.js'
 
 const textItem = ref({
   type: 'text',
@@ -214,7 +210,6 @@ const handleChangePage = (e) =>{
   getData()
 }
 
-const position = ref([])
 const handleSearch = (key, value) => {
   query.value.pageNo = 1
   queryParams.value[key] = value
@@ -227,8 +222,6 @@ const checkValue = (obj) => {
 }
 
 const handleConfirm = () => {
-  const positionIds = position.value.map(k => k.id)
-  queryParams.value.positionIds = positionIds || []
   query.value.pageNo = 1
   if (!checkValue(queryParams.value)) {
     Snackbar.warning('至少选择一个条件进行搜索')
@@ -242,7 +235,6 @@ const handleConfirm = () => {
 // 清空筛选条件
 const clear = ref(false)
 const handleClear = () => {
-  position.value = []
   queryParams.value = {
     content: null,
     positionIds: [],
@@ -256,10 +248,6 @@ const handleClear = () => {
   clear.value = true
 }
 
-const handleClose = (item) => {
-  position.value = position.value.filter(k => k.id !== item.id)
-}
-
 // 职位列表
 const jobNum = ref(0)
 const positionList = ref([])