|
@@ -123,6 +123,7 @@ import { uploadFile } from '@/api/common'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import portrait from './portrait.vue'
|
|
import portrait from './portrait.vue'
|
|
|
|
+import { checkEmail } from '@/utils/validate'
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
defineOptions({name: 'resume-components-basicInfo'})
|
|
defineOptions({name: 'resume-components-basicInfo'})
|
|
const emit = defineEmits(['complete'])
|
|
const emit = defineEmits(['complete'])
|
|
@@ -132,6 +133,7 @@ const userStore = useUserStore()
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
const showIcon = ref(false)
|
|
const showIcon = ref(false)
|
|
|
|
+let completeStatus = false
|
|
const overlay = ref(false) // 加载中
|
|
const overlay = ref(false) // 加载中
|
|
let baseInfo = ref({})
|
|
let baseInfo = ref({})
|
|
let userInfo = ref({})
|
|
let userInfo = ref({})
|
|
@@ -140,6 +142,10 @@ const getBasicInfo = () => { // 获取基础信息
|
|
if (!key || !Object.keys(key).length) return
|
|
if (!key || !Object.keys(key).length) return
|
|
baseInfo.value = JSON.parse(key) // 人才信息
|
|
baseInfo.value = JSON.parse(key) // 人才信息
|
|
userInfo.value = JSON.parse(localStorage.getItem('userInfo'))
|
|
userInfo.value = JSON.parse(localStorage.getItem('userInfo'))
|
|
|
|
+ if (baseInfo.value && Object.keys(baseInfo.value).length) {
|
|
|
|
+ completeStatus = true
|
|
|
|
+ emit('complete', { status: completeStatus, id: 'basicInfo' })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
getBasicInfo()
|
|
getBasicInfo()
|
|
|
|
|
|
@@ -215,7 +221,7 @@ const items = ref({
|
|
key: 'sex',
|
|
key: 'sex',
|
|
value: '0', // '1' ? '男' : '女'
|
|
value: '0', // '1' ? '男' : '女'
|
|
default: 0,
|
|
default: 0,
|
|
- label: '性别',
|
|
|
|
|
|
+ label: '性别 *',
|
|
col: 6,
|
|
col: 6,
|
|
width: 70,
|
|
width: 70,
|
|
dictTypeName: 'menduner_sex',
|
|
dictTypeName: 'menduner_sex',
|
|
@@ -224,13 +230,11 @@ const items = ref({
|
|
{
|
|
{
|
|
type: 'datePicker',
|
|
type: 'datePicker',
|
|
key: 'birthday',
|
|
key: 'birthday',
|
|
- // dateType: 'date', // 时间类型 year month date time
|
|
|
|
value: null,
|
|
value: null,
|
|
label: '出生日期 *',
|
|
label: '出生日期 *',
|
|
col: 6,
|
|
col: 6,
|
|
outlined: true,
|
|
outlined: true,
|
|
rules: [v => !!v || '请选择出生日期']
|
|
rules: [v => !!v || '请选择出生日期']
|
|
- // options: {},
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'phoneNumber',
|
|
type: 'phoneNumber',
|
|
@@ -239,20 +243,22 @@ const items = ref({
|
|
default: null,
|
|
default: null,
|
|
label: '电话号码',
|
|
label: '电话号码',
|
|
col: 6,
|
|
col: 6,
|
|
- outlined: true,
|
|
|
|
- rules: [v => !!v || '请填写手机号码']
|
|
|
|
- // disabled: true,
|
|
|
|
- // slotName: 'phone',
|
|
|
|
|
|
+ outlined: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
key: 'email',
|
|
key: 'email',
|
|
value: null,
|
|
value: null,
|
|
default: null,
|
|
default: null,
|
|
- label: '常用邮箱 *',
|
|
|
|
|
|
+ label: '常用邮箱',
|
|
col: 6,
|
|
col: 6,
|
|
outlined: true,
|
|
outlined: true,
|
|
- rules: [v => !!v || '请输入常用邮箱']
|
|
|
|
|
|
+ rules: [
|
|
|
|
+ value => {
|
|
|
|
+ if (value && !checkEmail(value)) return '请输入正确的电子邮箱'
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'autocomplete',
|
|
type: 'autocomplete',
|
|
@@ -315,20 +321,19 @@ const items = ref({
|
|
key: 'maritalStatus',
|
|
key: 'maritalStatus',
|
|
value: null,
|
|
value: null,
|
|
default: null,
|
|
default: null,
|
|
- label: '婚姻状况 *',
|
|
|
|
|
|
+ label: '婚姻状况',
|
|
col: 6,
|
|
col: 6,
|
|
outlined: true,
|
|
outlined: true,
|
|
itemText: 'label',
|
|
itemText: 'label',
|
|
itemValue: 'value',
|
|
itemValue: 'value',
|
|
dictTypeName: 'menduner_marital_status',
|
|
dictTypeName: 'menduner_marital_status',
|
|
- rules: [v => !!v || '请选择婚姻状况'],
|
|
|
|
items: []
|
|
items: []
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'autocomplete',
|
|
type: 'autocomplete',
|
|
key: 'workAreaProvinceId',
|
|
key: 'workAreaProvinceId',
|
|
value: null,
|
|
value: null,
|
|
- label: '所在城市:省 *',
|
|
|
|
|
|
+ label: '所在城市:省',
|
|
outlined: true,
|
|
outlined: true,
|
|
itemText: 'name',
|
|
itemText: 'name',
|
|
itemValue: 'id',
|
|
itemValue: 'id',
|
|
@@ -336,7 +341,6 @@ const items = ref({
|
|
noParam: true,
|
|
noParam: true,
|
|
col: 6,
|
|
col: 6,
|
|
flexStyle: 'mr-3',
|
|
flexStyle: 'mr-3',
|
|
- rules: [v => !!v || '请选择所在城市:省'],
|
|
|
|
items: [],
|
|
items: [],
|
|
change: null
|
|
change: null
|
|
},
|
|
},
|
|
@@ -344,12 +348,11 @@ const items = ref({
|
|
type: 'autocomplete',
|
|
type: 'autocomplete',
|
|
key: 'areaId',
|
|
key: 'areaId',
|
|
value: null,
|
|
value: null,
|
|
- label: '所在城市:市 *',
|
|
|
|
|
|
+ label: '所在城市:市',
|
|
outlined: true,
|
|
outlined: true,
|
|
itemText: 'name',
|
|
itemText: 'name',
|
|
itemValue: 'id',
|
|
itemValue: 'id',
|
|
col: 6,
|
|
col: 6,
|
|
- rules: [v => !!v || '请选择所在城市:市'],
|
|
|
|
items: [],
|
|
items: [],
|
|
change: null
|
|
change: null
|
|
},
|
|
},
|
|
@@ -387,13 +390,10 @@ const items = ref({
|
|
dateType: 'month',
|
|
dateType: 'month',
|
|
key: 'firstWorkTime',
|
|
key: 'firstWorkTime',
|
|
value: null,
|
|
value: null,
|
|
- label: '首次工作时间 *',
|
|
|
|
|
|
+ label: '首次工作时间',
|
|
col: 6,
|
|
col: 6,
|
|
- outlined: true,
|
|
|
|
- // clearable: true,
|
|
|
|
- rules: [v => !!v || '请选择首次工作时间']
|
|
|
|
- // options: {},
|
|
|
|
- },
|
|
|
|
|
|
+ outlined: true
|
|
|
|
+ }
|
|
]
|
|
]
|
|
})
|
|
})
|
|
|
|
|
|
@@ -408,13 +408,13 @@ const handleSave = async () => {
|
|
if (e.type === 'datepicker') obj[e.key] = getTimeStamp(e.value)
|
|
if (e.type === 'datepicker') obj[e.key] = getTimeStamp(e.value)
|
|
else obj[e.key] = e.value
|
|
else obj[e.key] = e.value
|
|
})
|
|
})
|
|
|
|
+ if (!obj.sex) return Snackbar.warning('请先选择您的性别')
|
|
await saveResumeBasicInfo(obj)
|
|
await saveResumeBasicInfo(obj)
|
|
Snackbar.success(t('common.saveMsg'))
|
|
Snackbar.success(t('common.saveMsg'))
|
|
isEdit.value = false
|
|
isEdit.value = false
|
|
- // 获取当前登录账户信息
|
|
|
|
- // if (baseInfo.value.userId) await userStore.getUserBaseInfos(baseInfo.value.userId)
|
|
|
|
await userStore.getUserBaseInfos(baseInfo.value.userId || null)
|
|
await userStore.getUserBaseInfos(baseInfo.value.userId || null)
|
|
getBasicInfo()
|
|
getBasicInfo()
|
|
|
|
+
|
|
// 清除户籍地:省
|
|
// 清除户籍地:省
|
|
if (clearRegProvinceId) items.value.options.forEach(e => { if (e.key === 'regProvinceId') e.value = null })
|
|
if (clearRegProvinceId) items.value.options.forEach(e => { if (e.key === 'regProvinceId') e.value = null })
|
|
}
|
|
}
|
|
@@ -448,18 +448,14 @@ const deal = async (id, cityKey, provinceKey) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-let completeStatus = false
|
|
|
|
items.value.options.forEach((e, index) => {
|
|
items.value.options.forEach((e, index) => {
|
|
if ((index + 2) % 2 === 0) e.flexStyle = 'mr-3'
|
|
if ((index + 2) % 2 === 0) e.flexStyle = 'mr-3'
|
|
if (e.dictTypeName) getDictData(e.dictTypeName) // 查字典set options
|
|
if (e.dictTypeName) getDictData(e.dictTypeName) // 查字典set options
|
|
- // formItems回显
|
|
|
|
const infoExist = baseInfo.value && Object.keys(baseInfo.value).length
|
|
const infoExist = baseInfo.value && Object.keys(baseInfo.value).length
|
|
- if (infoExist) completeStatus = true
|
|
|
|
if (infoExist && baseInfo.value[e.key]) e.value = baseInfo.value[e.key]
|
|
if (infoExist && baseInfo.value[e.key]) e.value = baseInfo.value[e.key]
|
|
// 日期相关
|
|
// 日期相关
|
|
if (e.type === 'datepicker') e.value = timesTampChange(e.value, 'Y-M-D')
|
|
if (e.type === 'datepicker') e.value = timesTampChange(e.value, 'Y-M-D')
|
|
// 所在城市回显
|
|
// 所在城市回显
|
|
- // if (infoExist && e.nameKey) e[e.nameKey] = baseInfo.value[e.nameKey]
|
|
|
|
if (infoExist && e.key === 'areaId' && baseInfo.value[e.key]) {
|
|
if (infoExist && e.key === 'areaId' && baseInfo.value[e.key]) {
|
|
const id = baseInfo.value[e.key]
|
|
const id = baseInfo.value[e.key]
|
|
deal(id, e.key, 'workAreaProvinceId')
|
|
deal(id, e.key, 'workAreaProvinceId')
|
|
@@ -471,7 +467,6 @@ items.value.options.forEach((e, index) => {
|
|
if (e.value === undefined || e.value === null || e.value === '') completeStatus = false
|
|
if (e.value === undefined || e.value === null || e.value === '') completeStatus = false
|
|
})
|
|
})
|
|
// 完成度展示
|
|
// 完成度展示
|
|
-emit('complete', { status: completeStatus, id: 'basicInfo' })
|
|
|
|
|
|
|
|
const provinceChange = (value, val, obj) => {
|
|
const provinceChange = (value, val, obj) => {
|
|
let cityKey
|
|
let cityKey
|
|
@@ -486,11 +481,7 @@ const provinceChange = (value, val, obj) => {
|
|
getDict('areaTreeData', null, 'areaTreeData').then(({ data }) => {
|
|
getDict('areaTreeData', null, 'areaTreeData').then(({ data }) => {
|
|
data = data?.length && data || []
|
|
data = data?.length && data || []
|
|
if (!data?.length) return console.error('areaTreeData获取失败!')
|
|
if (!data?.length) return console.error('areaTreeData获取失败!')
|
|
- //
|
|
|
|
- // const china = data.find(e => e.id === '1')
|
|
|
|
- // const chinaTreeData = china?.children?.length ? china.children : []
|
|
|
|
const chinaTreeData = data
|
|
const chinaTreeData = data
|
|
- //
|
|
|
|
if (!chinaTreeData?.length) return console.error('chinaTreeData获取失败!')
|
|
if (!chinaTreeData?.length) return console.error('chinaTreeData获取失败!')
|
|
const workAreaProvince = items.value.options.find(e => e.key === 'workAreaProvinceId')
|
|
const workAreaProvince = items.value.options.find(e => e.key === 'workAreaProvinceId')
|
|
const regAreaProvince = items.value.options.find(e => e.key === 'regProvinceId')
|
|
const regAreaProvince = items.value.options.find(e => e.key === 'regProvinceId')
|