Xiao_123 11 mēneši atpakaļ
vecāks
revīzija
f47e49c9a8

+ 1 - 0
src/components/DatePicker/index.vue

@@ -2,6 +2,7 @@
   <div style="width: 100%">
     <VueDatePicker
       locale="zh-CN"
+      :disabled="options?.disabled || false"
       :range="options?.range || false"
       :model-type="options?.format || 'yyyy.MM.dd'"
       :month-picker="month"

+ 48 - 37
src/views/resume/components/basicInfo.vue

@@ -108,9 +108,9 @@ import { getDict } from '@/hooks/web/useDictionaries'
 import { getTimeStamp, timesTampChange } from '@/utils/date'
 import { saveResumeBasicInfo } from '@/api/resume'
 import { useUserStore } from '@/store/user'
-import { ref, shallowRef } from 'vue';
 import { uploadFile } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
+import { ref } from 'vue';
 
 defineOptions({name: 'resume-components-basicInfo'})
 const { t } = useI18n()
@@ -171,17 +171,22 @@ const formItems = ref({
       label: '性别',
       col: 6,
       width: 70,
-      items: [{ label: '男', value: 0 }, { label: '女', value: 1 }],
+      dictTypeName: 'system_user_sex',
+      items: [],
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'birthday',
-      value: shallowRef(null),
+      value: null,
       default: null,
       col: 6,
-      label: '出生日期 *',
-      // outlined: true,
-      disabled: true,
+      class: 'mb-3',
+      options: {
+        type: 'date',
+        format: 'timestamp',
+        placeholder: '出生日期 *',
+        disabled: true,
+      },
     },
     {
       type: 'text',
@@ -227,6 +232,7 @@ const formItems = ref({
       outlined: true,
       itemText: 'label',
       itemValue: 'value',
+      dictTypeName: 'menduner_exp_type',
       rules: [v => !!v || '请选择工作经验'],
       items: []
     },
@@ -240,6 +246,7 @@ const formItems = ref({
       outlined: true,
       itemText: 'label',
       itemValue: 'value',
+      dictTypeName: 'menduner_education_type',
       rules: [v => !!v || '请选择最高学历'],
       items: []
     },
@@ -253,6 +260,7 @@ const formItems = ref({
       outlined: true,
       itemText: 'label',
       itemValue: 'value',
+      dictTypeName: 'menduner_job_type',
       rules: [v => !!v || '请选择求职类型'],
       items: []
     },
@@ -267,7 +275,12 @@ const formItems = ref({
       itemText: 'label',
       itemValue: 'value',
       rules: [v => !!v || '请选择求职状态'],
-      items: [{ label: '离职-随时到岗 ', value: 0 }, { label: '在职-月内到岗', value: 1 }, { label: '在职-考虑机会', value: 2 }, { label: '在职-暂不考虑', value: 3 }]
+      items: [
+        { label: '离职-随时到岗 ', value: '0' },
+        { label: '在职-月内到岗', value: '1' },
+        { label: '在职-考虑机会', value: '2' },
+        { label: '在职-暂不考虑', value: '3' }
+      ]
     },
     {
       type: 'autocomplete',
@@ -280,29 +293,29 @@ const formItems = ref({
       itemText: 'label',
       itemValue: 'value',
       rules: [v => !!v || '请选择婚姻状况'],
-      items: [{ label: '未婚 ', value: 0 }, { label: '已婚', value: 1 }, { label: '离异', value: 2 }, { label: '保密', value: 3 }]
+      items: [
+        { label: '未婚 ', value: '0' },
+        { label: '已婚', value: '1' },
+        { label: '离异', value: '2' },
+        { label: '保密', value: '3' }
+      ]
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'firstWorkTime',
-      value: shallowRef(null),
+      value: null,
       default: null,
       col: 6,
-      label: '首次工作时间 *',
-      // outlined: true,
+      class: 'mb-3',
+      options: {
+        type: 'month',
+        format: 'timestamp',
+        placeholder: '首次工作时间 *',
+      },
       rules: [v => !!v || '请选择首次工作时间']
     },
   ]
 })
-const transformItems = ['expType', 'eduType','jobType', 'areaId']
-formItems.value.options.forEach((e, index) => {
-  if ((index + 2) % 2 === 0) e.flexStyle = 'mr-3'
-  // 回显
-  if (baseInfo.value[e.key]) e.value = baseInfo.value[e.key]
-  // 日期相关
-  if (e.type === 'datepicker') e.value = timesTampChange(e.value).slice(0, 10)
-})
-
 
 // 保存-基础信息
 const handleSave = async () => {
@@ -312,7 +325,6 @@ const handleSave = async () => {
   formItems.value.options.forEach(e => {
     if (e.noReturn) return
     else if (e.type === 'datepicker') obj[e.key] = getTimeStamp(e.value)
-    else if (transformItems.includes(e.key) && e.value && e.value !== 0) obj[e.key] = e.value
     else obj[e.key] = e.value
   })
   await saveResumeBasicInfo(obj)
@@ -323,24 +335,23 @@ const handleSave = async () => {
   await getBasicInfo()
 }
 
-
 // 获取字典内容
-const getDictData = async (obj) => {
-  const item = formItems.value.options.find(e => e.key === obj.key)
-  if (item) { //  && !item.items?.length
-    const { data } = await getDict(obj.type)
+const getDictData = async (dictTypeName) => {
+  const item = formItems.value.options.find(e => e.dictTypeName === dictTypeName)
+  if (item) {
+    const { data } = await getDict(dictTypeName)
     item.items = data
   }
 }
-const getOptions = () => {
-  const dictList = [
-    { type: 'menduner_exp_type', key: 'expType' },
-    { type: 'menduner_education_type', key: 'eduType' },
-    { type: 'menduner_job_type', key: 'jobType' }
-  ]
-  dictList.forEach(obj =>  getDictData(obj))
-}
-getOptions()
+
+formItems.value.options.forEach((e, index) => {
+  if ((index + 2) % 2 === 0) e.flexStyle = 'mr-3'
+  if (e.dictTypeName) getDictData(e.dictTypeName) // 查字典set options
+  // formItems回显
+  if (baseInfo.value[e.key]) e.value = baseInfo.value[e.key]
+  // 日期相关
+  if (e.type === 'datepicker') e.value = timesTampChange(e.value).slice(0, 10)
+})
 </script>
 <style lang="scss" scoped>
 

+ 19 - 11
src/views/resume/components/educationExp.vue

@@ -57,16 +57,14 @@ import { saveResumeEduExp, getResumeEduExp, deleteResumeEduExp, schoolSearchByNa
 import Confirm from '@/plugins/confirm'
 import { getText, dealCanBeInputtedSave, dealCanBeInputtedValueAndLabel } from '@/utils/getText'
 import { debounce } from 'lodash'
-import { nextTick, shallowRef, reactive, ref } from 'vue'
+import { nextTick, reactive, ref } from 'vue'
 const editId = ref(null)
 const CtFormRef = ref()
 const dictItemsObj = reactive({})
 dictItemsObj.educationSystemType = [{ label: '全日制', value: '0' }, { label: '非全日制', value: '1' }]
 
 // 学校下拉列表
-// const schoolName = ref('')
 const getSchoolListData = async (name, init = '') => {
-  // schoolName.value = name
   const item = formItems.value.options.find(e => e.key === 'schoolId')
   if (!item) return
   item[item.itemTextName] = name
@@ -103,7 +101,6 @@ const formItems = ref({
       outlined: true,
       clearable: true,
       canBeInputted: true, //
-      // itemValueName: 'schoolId',
       itemTextName: 'schoolName',
       itemText: 'value',
       itemValue: 'key',
@@ -121,7 +118,6 @@ const formItems = ref({
       outlined: true,
       clearable: true,
       canBeInputted: true, //
-      // itemValueName: 'majorId',
       itemTextName: 'major',
       itemText: 'nameCn',
       itemValue: 'id',
@@ -156,19 +152,31 @@ const formItems = ref({
       items: dictItemsObj.educationSystemType,
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'startTime',
-      value: shallowRef(null),
+      value: null,
+      default: null,
       col: 6,
-      label: '起始时间 *',
+      class: 'mb-3',
+      options: {
+        type: 'month',
+        format: 'timestamp',
+        placeholder: '起始时间 *',
+      },
       rules: [v => !!v || '请选择起始时间']
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'endTime',
-      value: shallowRef(null),
+      value: null,
+      default: null,
       col: 6,
-      label: '结束时间 *',
+      class: 'mb-3',
+      options: {
+        type: 'month',
+        format: 'timestamp',
+        placeholder: '结束时间 *',
+      },
       rules: [v => !!v || '请选择结束时间']
     },
     {

+ 19 - 7
src/views/resume/components/workExperience.vue

@@ -55,7 +55,7 @@ import { saveResumeWorkExp, getResumeWorkExp, deleteResumeWorkExp, enterpriseSea
 import Confirm from '@/plugins/confirm'
 import { dealCanBeInputtedSave, dealCanBeInputtedValueAndLabel } from '@/utils/getText'
 import { debounce } from 'lodash'
-import { nextTick, shallowRef, reactive, ref } from 'vue'
+import { nextTick, reactive, ref } from 'vue'
 const editId = ref(null)
 const CtFormRef = ref()
 const dictItemsObj = reactive({})
@@ -118,19 +118,31 @@ const formItems = ref({
       items: []
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'startTime',
-      value: shallowRef(null),
+      value: null,
+      default: null,
       col: 6,
-      label: '起始时间 *',
+      class: 'mb-3',
+      options: {
+        type: 'month',
+        format: 'timestamp',
+        placeholder: '起始时间 *',
+      },
       rules: [v => !!v || '请选择起始时间']
     },
     {
-      type: 'datepicker',
+      type: 'datePicker',
       key: 'endTime',
-      value: shallowRef(null),
+      value: null,
+      default: null,
       col: 6,
-      label: '结束时间 *',
+      class: 'mb-3',
+      options: {
+        type: 'month',
+        format: 'timestamp',
+        placeholder: '结束时间 *',
+      },
       rules: [v => !!v || '请选择结束时间']
     },
     {