个人资料和岗位列表联调,简历优化部分页面
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { dislikeJob } from '@/api/jobs'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
@@ -48,6 +49,7 @@ const props = defineProps<{
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void
|
||||
(e: 'disliked'): void
|
||||
}>()
|
||||
|
||||
const visible = computed({
|
||||
@@ -55,39 +57,50 @@ const visible = computed({
|
||||
set: (val: boolean) => emit('update:modelValue', val),
|
||||
})
|
||||
|
||||
/** 不感兴趣的原因(单选) */
|
||||
const dislikeReason = ref('')
|
||||
/** 不感兴趣的原因(单选,0-5) */
|
||||
const dislikeReason = ref<number | undefined>(undefined)
|
||||
|
||||
/** 不感兴趣的补充描述 */
|
||||
const dislikeDetail = ref('')
|
||||
|
||||
/** 不感兴趣原因选项列表 */
|
||||
/** 不感兴趣原因选项列表(与接口 reason 0-5 对应) */
|
||||
const dislikeOptions = [
|
||||
{ value: 'company', label: '对这家公司不感兴趣' },
|
||||
{ value: 'position', label: '对这个岗位不感兴趣' },
|
||||
{ value: 'location', label: '工作地点不合适' },
|
||||
{ value: 'other', label: '其他原因' },
|
||||
{ value: 0, label: '对公司不感兴趣' },
|
||||
{ value: 1, label: '对岗位不感兴趣' },
|
||||
{ value: 2, label: '对行业不感兴趣' },
|
||||
// { value: 3, label: '技能不符合' },
|
||||
{ value: 4, label: '地点不合适' },
|
||||
{ value: 5, label: '其他' },
|
||||
]
|
||||
|
||||
/** 是否正在提交 */
|
||||
const submitting = ref(false)
|
||||
|
||||
/** 提交不感兴趣反馈 */
|
||||
function handleDislikeSubmit() {
|
||||
if (!dislikeReason.value) {
|
||||
async function handleDislikeSubmit() {
|
||||
if (dislikeReason.value === undefined) {
|
||||
ElMessage.warning('请选择一个原因')
|
||||
return
|
||||
}
|
||||
// TODO: 调用接口提交反馈,参数:props.jobId, dislikeReason.value, dislikeDetail.value
|
||||
console.log('提交不感兴趣反馈', {
|
||||
jobId: props.jobId,
|
||||
reason: dislikeReason.value,
|
||||
detail: dislikeDetail.value,
|
||||
})
|
||||
ElMessage.success('反馈已提交,感谢您的反馈')
|
||||
visible.value = false
|
||||
if (!props.jobId) return
|
||||
submitting.value = true
|
||||
try {
|
||||
const res = await dislikeJob(props.jobId, dislikeReason.value)
|
||||
if (res.code === '0') {
|
||||
ElMessage.success('反馈已提交,感谢您的反馈')
|
||||
visible.value = false
|
||||
emit('disliked')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('提交不感兴趣反馈失败', e)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 弹窗打开时重置表单 */
|
||||
function resetForm() {
|
||||
dislikeReason.value = ''
|
||||
dislikeReason.value = undefined
|
||||
dislikeDetail.value = ''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user