Jelajahi Sumber

投递成功

lifanagju_citu 10 bulan lalu
induk
melakukan
5e7c6b345a

+ 26 - 5
src/views/recruit/personal/shareJob/components/baseInfoCompleteForm.vue

@@ -5,6 +5,7 @@
 </template>
 
 <script setup>
+import { getDict } from '@/hooks/web/useDictionaries'
 defineOptions({ name: 'shareJob-baseInfoCompleteForm'})
 import { reactive, ref, defineExpose } from 'vue'
 
@@ -16,7 +17,7 @@ const items = ref({
     {
       type: 'text',
       key: 'name',
-      value: '姓名',
+      value: '',
       default: null,
       label: '姓名 *',
       outlined: true,
@@ -25,7 +26,7 @@ const items = ref({
     {
       type: 'text',
       key: 'phone',
-      value: '1840000003',
+      value: '',
       clearable: true,
       label: '联系手机号 *',
       rules: [v => !!v || '请填写联系手机号']
@@ -33,7 +34,7 @@ const items = ref({
     {
       type: 'autocomplete',
       key: 'jobStatus',
-      value: '0',
+      value: '',
       default: null,
       label: '求职状态 *',
       outlined: true,
@@ -46,7 +47,7 @@ const items = ref({
     {
       type: 'autocomplete',
       key: 'expType',
-      value: '0',
+      value: '',
       default: null,
       label: '工作经验 *',
       outlined: true,
@@ -59,7 +60,7 @@ const items = ref({
     {
       type: 'autocomplete',
       key: 'eduType',
-      value: '0',
+      value: '',
       default: null,
       label: '最高学历 *',
       outlined: true,
@@ -72,6 +73,26 @@ const items = ref({
   ]
 })
 
+// 获取字典内容
+const getDictData = async (dictTypeName) => {
+  const item = items.value.options.find(e => e.dictTypeName === dictTypeName)
+  if (item) {
+    const { data } = await getDict(dictTypeName)
+    item.items = data
+  }
+}
+
+items.value.options.forEach((e) => {
+  if (e.dictTypeName) getDictData(e.dictTypeName) // 查字典set options
+  // formItems回显
+  // const infoExist = baseInfo.value && Object.keys(baseInfo.value).length
+  // if (infoExist && baseInfo.value[e.key]) e.value = baseInfo.value[e.key]
+  // // 日期相关
+  // if (e.type === 'datepicker') e.value = timesTampChange(e.value).slice(0, 10)
+  // // 所在城市回显
+  // if (infoExist && e.nameKey) e[e.nameKey] = baseInfo.value[e.nameKey]
+})
+
 const getQuery = async () => {
   const { valid } = await formPageRef.value.formRef.validate()
   if (!valid) return