|
@@ -7,64 +7,40 @@
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'shareJob-baseInfoCompleteForm'})
|
|
|
import { reactive, ref, defineExpose } from 'vue'
|
|
|
-import { useI18n } from '@/hooks/web/useI18n'
|
|
|
-import { uploadFile } from '@/api/common'
|
|
|
-import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
-const { t } = useI18n()
|
|
|
const formPageRef = ref()
|
|
|
let query = reactive({})
|
|
|
|
|
|
-// 上传简历
|
|
|
-const typeList = ['pdf', 'doc', 'docx']
|
|
|
-const handleUpload = async (e) => {
|
|
|
- const file = e
|
|
|
- const size = file.size
|
|
|
- if (size / (1024*1024) > 10) {
|
|
|
- Snackbar.warning(t('common.fileSizeExceed'))
|
|
|
- return
|
|
|
- }
|
|
|
- const arr = file.name.split('.')
|
|
|
- if (typeList.indexOf(arr[arr.length - 1]) < 0) {
|
|
|
- Snackbar.warning(t('common.fileFormatIncorrect'))
|
|
|
- return
|
|
|
- }
|
|
|
- const formData = new FormData()
|
|
|
- formData.append('file', file)
|
|
|
- const { data } = await uploadFile(formData)
|
|
|
- if (!data) return
|
|
|
- items.value.options.find(e => e.key === 'url').data = data
|
|
|
-}
|
|
|
|
|
|
const items = ref({
|
|
|
options: [
|
|
|
- // {
|
|
|
- // type: 'text',
|
|
|
- // key: 'name',
|
|
|
- // value: '',
|
|
|
- // clearable: true,
|
|
|
- // label: '姓名 *',
|
|
|
- // rules: [v => !!v || '请填写姓名']
|
|
|
- // },
|
|
|
- // {
|
|
|
- // type: 'text',
|
|
|
- // key: 'phone',
|
|
|
- // value: '',
|
|
|
- // clearable: true,
|
|
|
- // label: '手机号码 *',
|
|
|
- // rules: [v => !!v || '请填写手机号码']
|
|
|
- // },
|
|
|
{
|
|
|
- type: 'upload',
|
|
|
- key: 'url',
|
|
|
- value: null,
|
|
|
- data: '',
|
|
|
- label: '简历 *',
|
|
|
- accept: '.doc, .docx, .pdf',
|
|
|
- placeholder: '请上传简历',
|
|
|
- rules: [v => !!v || '请上传简历'],
|
|
|
- change: handleUpload
|
|
|
- }
|
|
|
+ type: 'text',
|
|
|
+ key: 'name',
|
|
|
+ value: '',
|
|
|
+ clearable: true,
|
|
|
+ label: '姓名 *',
|
|
|
+ rules: [v => !!v || '请填写姓名']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'text',
|
|
|
+ key: 'phone',
|
|
|
+ value: '',
|
|
|
+ clearable: true,
|
|
|
+ label: '手机号码 *',
|
|
|
+ rules: [v => !!v || '请填写手机号码']
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: 'upload',
|
|
|
+ // key: 'url',
|
|
|
+ // value: null,
|
|
|
+ // data: '',
|
|
|
+ // label: '简历 *',
|
|
|
+ // accept: '.doc, .docx, .pdf',
|
|
|
+ // placeholder: '请上传简历',
|
|
|
+ // rules: [v => !!v || '请上传简历'],
|
|
|
+ // change: handleUpload
|
|
|
+ // }
|
|
|
]
|
|
|
})
|
|
|
|