Kaynağa Gözat

样式修改

lifanagju_citu 5 ay önce
ebeveyn
işleme
b390694a31

+ 70 - 70
src/views/recruit/personal/PersonalCenter/resume/analysis/index.vue

@@ -4,10 +4,6 @@
       <div class="d-flex flex-column pb-10" style="width: 800px; min-width: 800px; height: 100%; min-height: 500px; margin: 0 auto;">
         <attachmentPage analysis  @analysis="handleAnalysis"></attachmentPage>
       </div>
-      <!-- <div class="d-flex justify-center align-center" style="height: 100%">
-        <v-btn color="primary" @click="null">选择已上传简历</v-btn>
-        <v-btn prepend-icon="mdi-upload" class="ml-5" @click="null">上传附件简历</v-btn>
-      </div> -->
     </template>
     <template v-else>
       <div class="d-flex pa-3" style="height: 100%">
@@ -17,7 +13,7 @@
             <v-tab :value="1">查看附件简历</v-tab>
             <v-tab :value="2">查看文本信息</v-tab>
           </v-tabs>
-          <v-btn style="position: absolute; right: 12px; top: 18px;" variant="tonal" @click="showSelect = true">重新选择附件简历</v-btn>
+          <v-btn style="position: absolute; right: 12px; top: 18px;" color="primary" @click="showSelect = true">重新选择附件简历</v-btn>
           <div class="mt-3 pb-3" style="width: 100%; height: calc(100% - 48px);overflow: auto;">
             <div v-show="tab === 1" style="width: 100%; height: 100%">
               <IFrame :src="decodeURIComponent(fileUrl)" initHeight="100%"></IFrame>
@@ -28,8 +24,6 @@
                 <div v-for="(text, resumeTxtIndex) in resumeTxt" :key="'简历解析' + resumeTxtIndex">{{ text }}</div>
               </template>
               <div v-else style="color: #666;" class="mt-3 text-center">无简历解析文本可用</div>
-              <!-- <div style="height: 500px; overflow: auto;">
-              </div> -->
             </div>
           </div>
         </v-card>
@@ -39,14 +33,15 @@
             <div v-for="item of formLIst" :key="item.id" :id="item.id" class="pa-3 mb-3" style="background-color: var(--color-f8);">
               <div class="resume-header mb-3">
                 <div class="resume-title">{{ item.text }}</div>
-                <v-btn variant="text" color="error" density="compact" prepend-icon="mdi-delete-outline" @click="del(item)">删除</v-btn>
+                <v-btn v-if="item.id !== 'person'" variant="text" color="error" density="compact" prepend-icon="mdi-delete-outline" @click="del(item)">删除</v-btn>
+                <v-btn v-else disabled variant="text" color="error" density="compact">不可删除</v-btn>
               </div>
               <component ref="componentRef" :id="item.id" :is="item.path" :data="item.data" />
             </div>
             <!-- 保存 -->
             <div style="position: absolute; bottom: 0; background-color: #fff; z-index: 99; width: 100%; border-top: 1px solid #e4e7eb;" class="py-3 ml-n3 text-center">
-              <v-btn class="buttons mx-3" color="primary" @click="submit">保存</v-btn>
-              <!-- <v-btn class="buttons mx-3" variant="tonal" @click="showSelect = true">重新选择附件简历</v-btn> -->
+              <v-btn class="buttons mx-3" color="primary" @click="submit">提交(保存至在线简历)</v-btn>
+              <!-- <v-btn class="ml-2" variant="text" color="primary" to="/recruit/personal/personalCenter/resume/online">返回在线简历</v-btn> -->
             </div>
           </div>
         </v-card>
@@ -98,66 +93,6 @@ const exampleList = {
   trainList: { text: t('resume.trainingExperience'), id: 'trainList', path: trainingExperience },
 }
 
-const componentRef = ref()
-const getValue = async () => {
-  let id = ''
-  let data = {}
-  for (let index = 0; index < componentRef.value.length; index++) {
-    const e = componentRef.value[index]
-    const query = await e.submit()
-    if (query && query.data) {
-      data[query.id] = query.data
-    } else {
-      id = id ? id : query.id
-    }
-  }
-  console.log('id:', id)
-  if (id) {
-    Snackbar.warning('请填写完整后提交!')
-    return
-  }
-  // 处理data
-  let obj = Object.keys(data).length ? {} : null
-  const keyTransform = { // 转换给后端的key
-    eduList: 'eduExp',
-    workList: 'workExp',
-    trainList: 'trainExp',
-  }
-  if (obj) {
-    Object.keys(data).forEach(key => {
-      if (key.includes('_')) { // 数组
-        const oldKey = key.split('_')[0]
-        const newKey = keyTransform[oldKey] ? keyTransform[oldKey] : oldKey
-        if (!obj[newKey]) obj[newKey] = [data[key]]
-        else obj[newKey].push(data[key])
-      } else {
-        const newKey = keyTransform[key] ? keyTransform[key] : key
-        obj[newKey] = data[key]
-      }
-    })
-    const defaultObj = { avatar: "", person: {}, tag: { tagList: [] }, jobInterested: [], eduExp: [], workExp: [], trainExp: [] } // 必传字段
-    obj = { ...defaultObj, ...obj }
-  }
-  // console.log('123456:', obj)
-  return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
-}
-const loading = ref(false)
-const submit = async () => {
-  const obj = await getValue()
-  if (!obj) return
-  try {
-    loading.value = true
-    await saveResumeInfo(obj)
-    Snackbar.success(t('common.saveMsg'))
-    await useUserStore().getUserBaseInfos() // 更新用户信息
-    setTimeout(() => { window.location.reload() }, 1000)
-  } catch (error) {
-    console.log(error)
-  } finally {
-    loading.value = false
-  }
-}
-
 const del = (item) => {
   Confirm('系统提示', `是否确认删除${item.text}?`).then(async () => {
     formLIst.value = formLIst.value.filter(e => e.id !== item.id)
@@ -220,6 +155,71 @@ const handleAnalysis = async (url) => {
   }
 }
 
+const componentRef = ref()
+const getValue = async () => {
+  let id = ''
+  let data = {}
+  for (let index = 0; index < componentRef.value.length; index++) {
+    const e = componentRef.value[index]
+    const query = await e.submit()
+    if (query && query.data) {
+      data[query.id] = query.data
+    } else {
+      id = id ? id : query.id
+    }
+  }
+  console.log('id:', id)
+  if (id) {
+    Snackbar.warning('请填写完整后提交!')
+    return
+  }
+  // 处理data
+  let obj = Object.keys(data).length ? {} : null
+  const keyTransform = { // 转换给后端的key
+    eduList: 'eduExp',
+    workList: 'workExp',
+    trainList: 'trainExp',
+  }
+  if (obj) {
+    Object.keys(data).forEach(key => {
+      if (key.includes('_')) { // 数组
+        const oldKey = key.split('_')[0]
+        const newKey = keyTransform[oldKey] ? keyTransform[oldKey] : oldKey
+        if (!obj[newKey]) obj[newKey] = [data[key]]
+        else obj[newKey].push(data[key])
+      } else {
+        const newKey = keyTransform[key] ? keyTransform[key] : key
+        obj[newKey] = data[key]
+      }
+    })
+    // const defaultObj = { avatar: "", person: {}, advantage: { content: '' }, tag: { tagList: [] }, jobInterested: [], eduExp: [], workExp: [], trainExp: [] } // 必传字段
+    // const defaultObj = { avatar: null, person: null, advantage: null, tag: null, jobInterested: null, eduExp: null, workExp: null, trainExp: null } // 必传字段
+    // obj = { ...defaultObj, ...obj }
+  }
+  // console.log('123456:', obj)
+  return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
+}
+
+const loading = ref(false)
+const submit = async () => {
+  const obj = await getValue()
+  if (!obj) return
+  try {
+    loading.value = true
+    await saveResumeInfo(obj)
+    await useUserStore().getUserBaseInfos() // 更新用户信息
+    // Snackbar.success(t('common.saveMsg'))
+    // setTimeout(() => { window.location.reload() }, 1000) // 刷新页面
+    Confirm('系统提示', `提交成功,是否前往在线简历查看?`, { sureText: '立即前往' }).then(() => {
+      window.location.href = '/recruit/personal/personalCenter/resume/online'
+    })
+  } catch (error) {
+    console.log(error)
+  } finally {
+    loading.value = false
+  }
+}
+
 </script>
 
 

+ 3 - 2
src/views/recruit/personal/PersonalCenter/resume/attachment/index.vue

@@ -2,7 +2,7 @@
   <div class="resume-box" style="position: relative; height: 100%;">
     <div class="resume-header">
       <div class="resume-title">{{ props.analysis ? '解析简历附件生成在线简历' : '附件简历'}}</div>
-      <v-btn variant="text" color="primary" prepend-icon="mdi-plus-box" @click="handleAdd">上传</v-btn>
+      <v-btn variant="text" color="primary" prepend-icon="mdi-plus-box" @click="handleAdd">{{ props.analysis ? '上传新的简历' : '上传'}}</v-btn>
     </div>
     <p class="font-size-14 color-999">最多只能上传5份附件简历</p>
     <div v-if="attachmentList.length" class="mt-5">
@@ -24,8 +24,9 @@
           <v-btn variant="text" color="primary" prepend-icon="mdi-trash-can-outline" @click="handleDelete(k)">{{ $t('common.delete') }}</v-btn>
         </div>
       </div>
-      <div v-if="props.analysis" class="text-center mt-15">
+      <div v-if="props.analysis" class="d-flex  flex-column align-center mt-15">
         <v-btn class="buttons" color="primary" @click="handleAnalysis">开始解析</v-btn>
+        <v-btn class="mt-2" variant="text" color="primary" to="/recruit/personal/personalCenter/resume/online">返回在线简历</v-btn>
       </div>
     </div>
     <div v-else class="resumeNoDataText tips">请上传您的附件简历</div>