Bläddra i källkod

参数名称修改

lifanagju_citu 7 månader sedan
förälder
incheckning
7c0fd290b8

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

@@ -7,7 +7,8 @@
           :idName="item.key"
           :title="item.title"
           :isSingle="item.isSingle"
-          :dictName="item.dictShow"
+          :isSlot="item.isSlot"
+          :displayDictName="item.displayDictName"
           :provideData="item.provideData || []"
           :info="item"
           @inputChange="inputChange"

+ 10 - 6
src/views/recruit/personal/position/components/conditionFilter/commonPath.vue

@@ -33,6 +33,10 @@ const props = defineProps({
     type: Boolean,
     default: false
   },
+  isSlot: { // 使用插槽(不调用getDict)
+    type: Boolean,
+    default: false
+  },
   isSingle: { // 是否单选
     type: Boolean,
     default: false
@@ -41,9 +45,9 @@ const props = defineProps({
     type: String,
     default: ''
   },
-  dictName: {
+  displayDictName: {
     type: [String, Number],
-    default: ''
+    default: '' // 1: 插槽使用会返回数组
   },
   provideData: {
     type: Array,
@@ -64,7 +68,7 @@ let items = ref()
 const selectedItems = ref([])
 
 const handle = (value) => {
-  if (props.dictName === 1) { // 插槽使用会返回数组
+  if (props.isSlot) {
     selectedItems.value = value
   } else {
     if (selectedItems.value.includes(value)) {
@@ -84,13 +88,13 @@ const handle = (value) => {
 }
 
 // 字典
-if (props.dictName === 1) show.value = true // 插槽使用
+if (props.isSlot) show.value = true // 插槽使用
 else if (props.provideData?.length) { // 自定义下拉数据
   items.value = props.provideData
   show.value = true
 }
-else if (props.dictName) {
-  getDict(props.dictName).then(({ data }) => {
+else if (props.displayDictName) {
+  getDict(props.displayDictName).then(({ data }) => {
     data = data?.length && data || []
     items.value = data
     show.value = true

+ 14 - 14
src/views/recruit/personal/position/components/dict.js

@@ -2,11 +2,11 @@ import { getDict } from '@/hooks/web/useDictionaries'
 import commonPath from './conditionFilter/commonPath.vue'
 // import areaType from './conditionFilter/areaType.vue'
 
-// dictUse: 查数据回显(一维数组字典),dictShow: 用户操作的字典(用户看到的数据)
+// toFilterDictName: 查数据回显(一维数组字典),dictShow: 用户操作的字典(用户看到的数据)
 // 当type是tree类型的数据的时候需要提供dictType
 const dictList = [
   { 
-    dictShow: 'menduner_area_type',
+    displayDictName: 'menduner_area_type',
     apiType: 'areaList',
     key: 'areaIds',
     itemKey: 'id',
@@ -16,10 +16,10 @@ const dictList = [
     data: []
   },
   { 
-    dictUse: 'menduner_industry_type',
+    toFilterDictName: 'menduner_industry_type',
     apiType: 'industryList',
-    dictShow: 1,
     key: 'industryIds',
+    isSlot: true,
     itemKey: 'id',
     itemText: 'nameCn',
     title: '行业类型',
@@ -27,10 +27,10 @@ const dictList = [
     data: []
   },
   { 
-    dictUse: 'positionData',
+    toFilterDictName: 'positionData',
     apiType: 'positionData',
-    dictShow: 1,
     key: 'positionId',
+    isSlot: true,
     itemKey: 'id',
     itemText: 'nameCn',
     title: '职位类型',
@@ -39,7 +39,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_job_type',
+    displayDictName: 'menduner_job_type',
     key: 'jobType',
     itemKey: 'value',
     itemText: 'label',
@@ -48,7 +48,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_exp_type',
+    displayDictName: 'menduner_exp_type',
     key: 'expType',
     itemKey: 'value',
     itemText: 'label',
@@ -57,7 +57,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_pay_scope',
+    displayDictName: 'menduner_pay_scope',
     key: 'payScope',
     itemKey: 'value',
     itemText: 'label',
@@ -68,7 +68,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_education_type',
+    displayDictName: 'menduner_education_type',
     key: 'eduType',
     itemKey: 'value',
     itemText: 'label',
@@ -77,7 +77,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_scale',
+    displayDictName: 'menduner_scale',
     key: 'scale',
     itemKey: 'value',
     itemText: 'label',
@@ -86,7 +86,7 @@ const dictList = [
     data: []
   },
   { 
-    dictShow: 'menduner_financing_status',
+    displayDictName: 'menduner_financing_status',
     key: 'financingStatus',
     itemKey: 'value',
     itemText: 'label',
@@ -100,8 +100,8 @@ export const filterList = dictList
 // 字典
 const getDictList = async () => {
   dictList.forEach(async (dictListItem) => {
-    const dictUse = dictListItem.dictUse || dictListItem.dictShow
-    const { data } = await getDict(dictUse, dictListItem.params, dictListItem.apiType)
+    const toFilterDictName = dictListItem.toFilterDictName || dictListItem.displayDictName
+    const { data } = await getDict(toFilterDictName, dictListItem.params, dictListItem.apiType)
     dictListItem.data = data
   })
 }

+ 1 - 0
src/views/recruit/personal/position/index.vue

@@ -49,6 +49,7 @@ const route = useRoute(); const router = useRouter()
 const cityFilterRef = ref()
 const conditionFilterRef = ref()
 const showFilterList = [
+  // { key: 'cityId' },
   { key: 'industryIds' },
   { key: 'positionId', isSingle: true },
   { key: 'jobType' },