|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div style="width: 100%;">
|
|
|
<CtForm ref="formPageRef" :items="items" style="width: 600px;">
|
|
|
- <template #workAreaId="{ item }">
|
|
|
+ <template #areaId="{ item }">
|
|
|
<v-menu :close-delay="1" :open-delay="0" v-bind="$attrs">
|
|
|
<template v-slot:activator="{ props }">
|
|
|
<textUI
|
|
@@ -11,7 +11,7 @@
|
|
|
style="position: relative;"
|
|
|
></textUI>
|
|
|
</template>
|
|
|
- <areaType :select="[query.workAreaId].filter(Boolean)" @handleAreaClick="handleArea" class="jobTypeCardBox" isSingle></areaType>
|
|
|
+ <areaType :select="[query.areaId].filter(Boolean)" @handleAreaClick="handleArea" class="jobTypeCardBox" isSingle></areaType>
|
|
|
</v-menu>
|
|
|
</template>
|
|
|
</CtForm>
|
|
@@ -23,23 +23,22 @@ defineOptions({ name: 'position-add-job-requirements'})
|
|
|
import CtForm from '@/components/CtForm'
|
|
|
import areaType from '@/components/AreaSelect'
|
|
|
import textUI from '@/components/FormUI/TextInput'
|
|
|
-import { reactive, ref } from 'vue'
|
|
|
+import { reactive, ref, defineExpose } from 'vue'
|
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
|
|
|
const formPageRef = ref()
|
|
|
-const query = reactive({})
|
|
|
-console.log(query, 'qqq')
|
|
|
+let query = reactive({})
|
|
|
const items = ref({
|
|
|
options: [
|
|
|
{
|
|
|
type: 'autocomplete',
|
|
|
- key: 'jobType',
|
|
|
+ key: 'type',
|
|
|
value: null,
|
|
|
- label: '职位性质 *',
|
|
|
+ label: '招聘类型 *',
|
|
|
itemText: 'label',
|
|
|
itemValue: 'value',
|
|
|
dictTypeName: 'menduner_job_type',
|
|
|
- rules: [v => !!v || '请选择职位性质'],
|
|
|
+ rules: [v => !!v || '招聘类型'],
|
|
|
items: []
|
|
|
},
|
|
|
{
|
|
@@ -70,9 +69,8 @@ const items = ref({
|
|
|
{
|
|
|
type: 'text',
|
|
|
key: 'payFrom',
|
|
|
- value: '',
|
|
|
- col: 6,
|
|
|
- flexStyle: 'mr-3',
|
|
|
+ value: '12000',
|
|
|
+ col: 4,
|
|
|
label: '最低薪资 *',
|
|
|
suffix: '元',
|
|
|
rules: [v => !!v || '请填写最低薪资'],
|
|
@@ -80,23 +78,37 @@ const items = ref({
|
|
|
{
|
|
|
type: 'text',
|
|
|
key: 'payTo',
|
|
|
- value: '',
|
|
|
- col: 6,
|
|
|
+ value: '15000',
|
|
|
+ col: 4,
|
|
|
label: '最高薪资 *',
|
|
|
+ flexStyle: 'mx-3',
|
|
|
suffix: '元',
|
|
|
rules: [v => !!v || '请填写最高薪资'],
|
|
|
},
|
|
|
{
|
|
|
- slotName: 'workAreaId',
|
|
|
- key: 'workAreaId',
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'payUnit',
|
|
|
+ value: null,
|
|
|
+ label: '薪酬单位 *',
|
|
|
+ itemText: 'label',
|
|
|
+ itemValue: 'value',
|
|
|
+ col: 4,
|
|
|
+ dictTypeName: 'menduner_pay_unit',
|
|
|
+ rules: [v => !!v || '请选择薪酬单位'],
|
|
|
+ items: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slotName: 'areaId',
|
|
|
+ key: 'areaId',
|
|
|
value: null,
|
|
|
+ noParam: true,
|
|
|
label: '工作城市 *',
|
|
|
- rules: [v => !!v || '请选择最高学历']
|
|
|
+ rules: [v => !!v || '请选择工作城市']
|
|
|
},
|
|
|
{
|
|
|
type: 'text',
|
|
|
key: 'address',
|
|
|
- value: '',
|
|
|
+ value: '先烈中路100号大院8栋',
|
|
|
label: '详情地址 *',
|
|
|
rules: [v => !!v || '请填写详细地址'],
|
|
|
},
|
|
@@ -113,12 +125,32 @@ items.value.options.forEach(async (e) => {
|
|
|
|
|
|
// 工作城市
|
|
|
const handleArea = (list, name) => {
|
|
|
- if (!list.length) return
|
|
|
- query.workAreaId = list[0]
|
|
|
- const obj = items.value.options.find(e => e.key === 'workAreaId')
|
|
|
+ if (!list.length) {
|
|
|
+ delete query.areaId
|
|
|
+ items.value.options.find(e => e.key === 'areaId').value = ''
|
|
|
+ return
|
|
|
+ }
|
|
|
+ query.areaId = list[0]
|
|
|
+ const obj = items.value.options.find(e => e.key === 'areaId')
|
|
|
obj.value = name
|
|
|
}
|
|
|
|
|
|
+const getQuery = async () => {
|
|
|
+ const { valid } = await formPageRef.value.formRef.validate()
|
|
|
+ if (!valid) return
|
|
|
+ const obj = {}
|
|
|
+ items.value.options.forEach(e => {
|
|
|
+ if (e.noParam) return
|
|
|
+ obj[e.key] = e.value
|
|
|
+ })
|
|
|
+ query = Object.assign(query, obj)
|
|
|
+ return query
|
|
|
+}
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ formPageRef,
|
|
|
+ getQuery
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|