|
@@ -27,13 +27,11 @@
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
defineOptions({name: 'dialogExtend-InfoForm'})
|
|
defineOptions({name: 'dialogExtend-InfoForm'})
|
|
import { reactive, ref } from 'vue'
|
|
import { reactive, ref } from 'vue'
|
|
-import { schoolMajorByName, schoolSearchByName } from '@/api/recruit/personal/resume'
|
|
|
|
|
|
+import { schoolList, departmentList } from '@/api/recruit/personal/resume'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { uploadFile } from '@/api/common'
|
|
import { uploadFile } from '@/api/common'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
-import { debounce } from 'lodash'
|
|
|
|
-import { dealCanBeInputtedSave } from '@/utils/getText'
|
|
|
|
import { isValidIdCard18 } from '@/utils/validate'
|
|
import { isValidIdCard18 } from '@/utils/validate'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -46,46 +44,6 @@ const setInfo = ref(props.option?.setInfo ? props.option.setInfo : {})
|
|
const formPageRef = ref()
|
|
const formPageRef = ref()
|
|
let query = reactive({})
|
|
let query = reactive({})
|
|
|
|
|
|
-// 学校下拉列表
|
|
|
|
-const schoolNameInput = ref('')
|
|
|
|
-const getSchoolListData = async (name) => {
|
|
|
|
- const item = items.value.options.find(e => e.key === 'schoolId')
|
|
|
|
- if (!item) return
|
|
|
|
- if (item.items?.length && (schoolNameInput.value === name)) return // 防抖
|
|
|
|
- item[item.itemTextName] = schoolNameInput.value = name
|
|
|
|
-
|
|
|
|
- if (name === null || name === '') { item.items = [] }
|
|
|
|
- else {
|
|
|
|
- const data = await schoolSearchByName({ name })
|
|
|
|
- item.items = data
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-const debouncedCallbackSchool = debounce(newValue => {
|
|
|
|
- if (!newValue) return
|
|
|
|
- getSchoolListData(newValue)
|
|
|
|
-}, 500)
|
|
|
|
-
|
|
|
|
-// 专业下拉列表
|
|
|
|
-const majorNameInput = ref('')
|
|
|
|
-const getMajorListData = async (name) => {
|
|
|
|
- const item = items.value.options.find(e => e.key === 'majorId')
|
|
|
|
- if (name === '') { // 此接口不支持传空值
|
|
|
|
- item.items = []
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (item.items?.length && (majorNameInput.value === name)) return // 防抖
|
|
|
|
- item[item.itemTextName] = majorNameInput.value = name
|
|
|
|
-
|
|
|
|
- if (name === null || name === '') { item.items = [] }
|
|
|
|
- else {
|
|
|
|
- const data = await schoolMajorByName({ name })
|
|
|
|
- item.items = data
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-const debouncedCallbackMajor = debounce(newValue => {
|
|
|
|
- getMajorListData(newValue)
|
|
|
|
-}, 500)
|
|
|
|
-
|
|
|
|
// 图片裁剪
|
|
// 图片裁剪
|
|
const selectPic = ref('')
|
|
const selectPic = ref('')
|
|
const isShowCopper = ref(false)
|
|
const isShowCopper = ref(false)
|
|
@@ -174,45 +132,38 @@ const items = ref({
|
|
rules: [v => !!v || '请选择出生日期']
|
|
rules: [v => !!v || '请选择出生日期']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: 'combobox',
|
|
|
|
|
|
+ type: 'autocomplete',
|
|
key: 'schoolId',
|
|
key: 'schoolId',
|
|
value: null,
|
|
value: null,
|
|
default: null,
|
|
default: null,
|
|
- label: '学校名称 *',
|
|
|
|
|
|
+ label: '就读学校 *',
|
|
outlined: true,
|
|
outlined: true,
|
|
- clearable: true,
|
|
|
|
- canBeInputted: true, //
|
|
|
|
- itemTextName: 'schoolName',
|
|
|
|
- itemText: 'value',
|
|
|
|
- itemValue: 'key',
|
|
|
|
- rules: [v => !!v || '请选择学校名称'],
|
|
|
|
- search: debouncedCallbackSchool,
|
|
|
|
|
|
+ itemText: 'schoolName',
|
|
|
|
+ itemValue: 'schoolId',
|
|
|
|
+ rules: [v => !!v || '请选择就读学校'],
|
|
items: [],
|
|
items: [],
|
|
|
|
+ change: e => getDepartmentList(e),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: 'text',
|
|
|
|
|
|
+ type: 'autocomplete',
|
|
key: 'schoolDepartmentName',
|
|
key: 'schoolDepartmentName',
|
|
- value: '',
|
|
|
|
|
|
+ value: null,
|
|
default: null,
|
|
default: null,
|
|
label: '所在院系 *',
|
|
label: '所在院系 *',
|
|
outlined: true,
|
|
outlined: true,
|
|
- rules: [v => !!v || '请填写所在院系']
|
|
|
|
|
|
+ itemText: 'departmentTitle',
|
|
|
|
+ itemValue: 'schoolDepartmentId',
|
|
|
|
+ rules: [v => !!v || '请选择所在院系'],
|
|
|
|
+ items: []
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: 'combobox',
|
|
|
|
- key: 'majorId',
|
|
|
|
- value: null,
|
|
|
|
|
|
+ type: 'text',
|
|
|
|
+ key: 'majorName',
|
|
|
|
+ value: '',
|
|
default: null,
|
|
default: null,
|
|
label: '所学专业 *',
|
|
label: '所学专业 *',
|
|
outlined: true,
|
|
outlined: true,
|
|
- clearable: true,
|
|
|
|
- canBeInputted: true, //
|
|
|
|
- itemTextName: 'major',
|
|
|
|
- itemText: 'nameCn',
|
|
|
|
- itemValue: 'id',
|
|
|
|
- rules: [v => !!v || '请选择所学专业'],
|
|
|
|
- search: debouncedCallbackMajor,
|
|
|
|
- items: []
|
|
|
|
|
|
+ rules: [v => !!v || '请输入所学专业']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
@@ -256,6 +207,26 @@ if (import.meta.env.VITE_NODE_ENV === 'production') {
|
|
items.value.options = items.value.options.filter(e => e.slotName !== 'analysis')
|
|
items.value.options = items.value.options.filter(e => e.slotName !== 'analysis')
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// // 学校下拉列表
|
|
|
|
+const getSchoolListData = async () => {
|
|
|
|
+ const item = items.value.options.find(e => e.key === 'schoolId')
|
|
|
|
+ if (!item) return
|
|
|
|
+ const { records } = await schoolList({current: 1,size: 9999})
|
|
|
|
+ item.items = records || []
|
|
|
|
+}
|
|
|
|
+getSchoolListData()
|
|
|
|
+
|
|
|
|
+const getDepartmentList = async (e) => {
|
|
|
|
+ const item = items.value.options.find(e => e.key === 'schoolDepartmentName')
|
|
|
|
+ if (!item) return
|
|
|
|
+ const query = {
|
|
|
|
+ page: { size: 9999, current: 1 },
|
|
|
|
+ entity: { schoolId: e }
|
|
|
|
+ }
|
|
|
|
+ const res = await departmentList(query)
|
|
|
|
+ const list = res?.records?.length ? res.records : []
|
|
|
|
+ item.items = list.map(e => e.entity)
|
|
|
|
+}
|
|
|
|
|
|
// 选择文件
|
|
// 选择文件
|
|
const fileInput = ref()
|
|
const fileInput = ref()
|
|
@@ -334,9 +305,6 @@ const getQuery = async () => {
|
|
items.value.options.forEach(e => {
|
|
items.value.options.forEach(e => {
|
|
if (Object.prototype.hasOwnProperty.call(e, 'data')) return obj[e.key] = e.data
|
|
if (Object.prototype.hasOwnProperty.call(e, 'data')) return obj[e.key] = e.data
|
|
obj[e.key] = e.value === '' ? null : e.value
|
|
obj[e.key] = e.value === '' ? null : e.value
|
|
- if (e.canBeInputted) { // 特殊处理可输入下拉框
|
|
|
|
- dealCanBeInputtedSave(e, obj)
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
if (!obj.avatar) obj.avatar = getUserAvatar(null, obj.sex)
|
|
if (!obj.avatar) obj.avatar = getUserAvatar(null, obj.sex)
|
|
query = Object.assign(query, obj)
|
|
query = Object.assign(query, obj)
|