|
@@ -16,7 +16,7 @@
|
|
<!-- 展示 -->
|
|
<!-- 展示 -->
|
|
<div
|
|
<div
|
|
v-else
|
|
v-else
|
|
- v-for="(item, index) in projectExp" :key="'educationExp' + index"
|
|
|
|
|
|
+ v-for="(item, index) in dataList" :key="'educationExp' + index"
|
|
:class="[' mx-n2', {'mt-5': index }]"
|
|
:class="[' mx-n2', {'mt-5': index }]"
|
|
>
|
|
>
|
|
<div class="educExpItem" @mouseenter="item.active = true" @mouseleave="item.active = false">
|
|
<div class="educExpItem" @mouseenter="item.active = true" @mouseleave="item.active = false">
|
|
@@ -41,8 +41,7 @@
|
|
<span class="color6 font15">{{ getText(item.educationSystemType, dictItemsObj.educationSystemType) }}</span>
|
|
<span class="color6 font15">{{ getText(item.educationSystemType, dictItemsObj.educationSystemType) }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="level3">
|
|
<div class="level3">
|
|
- <span class="color6 font15">在校经历:</span>
|
|
|
|
- <span class="color6 font15">{{ item.content }}</span>
|
|
|
|
|
|
+ <span class="color6 font15">在校经历:{{ item.content }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -59,6 +58,7 @@ import Confirm from '@/plugins/confirm'
|
|
import { getText } from '@/utils/getText'
|
|
import { getText } from '@/utils/getText'
|
|
import { debounce } from 'lodash'
|
|
import { debounce } from 'lodash'
|
|
import { nextTick, shallowRef, reactive, ref } from 'vue'
|
|
import { nextTick, shallowRef, reactive, ref } from 'vue'
|
|
|
|
+const editId = ref(null)
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
const dictItemsObj = reactive({})
|
|
const dictItemsObj = reactive({})
|
|
dictItemsObj.educationSystemType = [{ label: '全日制', value: '0' }, { label: '非全日制', value: '1' }]
|
|
dictItemsObj.educationSystemType = [{ label: '全日制', value: '0' }, { label: '非全日制', value: '1' }]
|
|
@@ -100,6 +100,7 @@ const formItems = ref({
|
|
col: 6,
|
|
col: 6,
|
|
outlined: true,
|
|
outlined: true,
|
|
clearable: true,
|
|
clearable: true,
|
|
|
|
+ itemTextName: 'schoolName',
|
|
itemText: 'value',
|
|
itemText: 'value',
|
|
itemValue: 'key',
|
|
itemValue: 'key',
|
|
rules: [v => !!v || '请选择学校名称'],
|
|
rules: [v => !!v || '请选择学校名称'],
|
|
@@ -115,6 +116,7 @@ const formItems = ref({
|
|
col: 6,
|
|
col: 6,
|
|
outlined: true,
|
|
outlined: true,
|
|
clearable: true,
|
|
clearable: true,
|
|
|
|
+ itemTextName: 'major',
|
|
itemText: 'nameCn',
|
|
itemText: 'nameCn',
|
|
itemValue: 'id',
|
|
itemValue: 'id',
|
|
rules: [v => !!v || '请选择所学专业'],
|
|
rules: [v => !!v || '请选择所学专业'],
|
|
@@ -175,62 +177,56 @@ const formItems = ref({
|
|
},
|
|
},
|
|
]
|
|
]
|
|
})
|
|
})
|
|
|
|
+// 左侧加mr
|
|
|
|
+formItems.value.options.forEach((e, index) => {
|
|
|
|
+ if (((index + 2) % 2 === 0) && Boolean(e.col) && e.col !== 12) e.flexStyle = 'mr-3'
|
|
|
|
+})
|
|
|
|
|
|
console.log('dictItemsObj', dictItemsObj)
|
|
console.log('dictItemsObj', dictItemsObj)
|
|
// 获取数据
|
|
// 获取数据
|
|
-const projectExp = ref([])
|
|
|
|
|
|
+const dataList = ref([])
|
|
const getData = async () => {
|
|
const getData = async () => {
|
|
const data = await getResumeEduExp()
|
|
const data = await getResumeEduExp()
|
|
- projectExp.value = data
|
|
|
|
|
|
+ dataList.value = data
|
|
}
|
|
}
|
|
getData()
|
|
getData()
|
|
|
|
|
|
// 新增 或 编辑
|
|
// 新增 或 编辑
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
const titleStatus = ref(0)
|
|
const titleStatus = ref(0)
|
|
-const rowObj = ref({})
|
|
|
|
const handle = (item) => {
|
|
const handle = (item) => {
|
|
titleStatus.value = item ? 1 : 0
|
|
titleStatus.value = item ? 1 : 0
|
|
if (item) { // 编辑
|
|
if (item) { // 编辑
|
|
- rowObj.value = item
|
|
|
|
- formItems.value.options.forEach(_i => { if (item[_i.key]) _i.value = item[_i.key] })
|
|
|
|
|
|
+ editId.value = item.id
|
|
|
|
+ formItems.value.options.forEach(e => { // 回显
|
|
|
|
+ if (item[e.key]) e.value = item[e.key]
|
|
|
|
+ if (e.type === 'datepicker') e.value = timesTampChange(item[e.key]).slice(0, 10)
|
|
|
|
+ if (e.type === 'combobox') e.value = item[e.itemTextName] // 回显中文,因为下拉框无内容,显示id无用
|
|
|
|
+ })
|
|
} else { // 新增
|
|
} else { // 新增
|
|
- formItems.value.options.forEach(_i => _i.value = _i.default || null)
|
|
|
|
|
|
+ editId.value = null
|
|
|
|
+ formItems.value.options.forEach(e => e.value = e.default || null)
|
|
}
|
|
}
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
isEdit.value = true
|
|
isEdit.value = true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-// const transformItems = ['educationType', 'educationSystemType']
|
|
|
|
-formItems.value.options.forEach((e, index) => {
|
|
|
|
- if (((index + 2) % 2 === 0) && Boolean(e.col) && e.col !== 12) e.flexStyle = 'mr-3' // 左侧加mr
|
|
|
|
- // 回显
|
|
|
|
- if (rowObj.value[e.key]) e.value = rowObj.value[e.key]
|
|
|
|
- // // 数字转为字符串
|
|
|
|
- // if (transformItems.includes(e.key) && e.value && e.value !== 0) e.value = e.value.toString()
|
|
|
|
- // 日期相关
|
|
|
|
- if (e.type === 'datepicker') e.value = timesTampChange(e.value).slice(0, 10)
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 保存-基础信息
|
|
// 保存-基础信息
|
|
const handleSave = async () => {
|
|
const handleSave = async () => {
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
if (!valid) return
|
|
if (!valid) return
|
|
const obj = {}
|
|
const obj = {}
|
|
formItems.value.options.forEach(e => {
|
|
formItems.value.options.forEach(e => {
|
|
- if (e.noReturn) return
|
|
|
|
- else if (e.type === 'datepicker') obj[e.key] = getTimeStamp(e.value)
|
|
|
|
|
|
+ if (e.type === 'datepicker') obj[e.key] = getTimeStamp(e.value)
|
|
else obj[e.key] = e.value
|
|
else obj[e.key] = e.value
|
|
})
|
|
})
|
|
obj.schoolName = schoolName.value
|
|
obj.schoolName = schoolName.value
|
|
obj.major = major.value
|
|
obj.major = major.value
|
|
- if (rowObj.value?.id) obj.id = rowObj.value.id
|
|
|
|
|
|
+ if (editId.value) obj.id = editId.value
|
|
await saveResumeEduExp(obj)
|
|
await saveResumeEduExp(obj)
|
|
Snackbar.success('保存成功!')
|
|
Snackbar.success('保存成功!')
|
|
isEdit.value = false
|
|
isEdit.value = false
|
|
- // 获取当前登录账户信息
|
|
|
|
await getData()
|
|
await getData()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -238,8 +234,8 @@ const handleSave = async () => {
|
|
const handleDelete = ({ id }) => {
|
|
const handleDelete = ({ id }) => {
|
|
Confirm('系统提示', '是否确认删除此教育经历?').then(async () => {
|
|
Confirm('系统提示', '是否确认删除此教育经历?').then(async () => {
|
|
await deleteResumeEduExp(id)
|
|
await deleteResumeEduExp(id)
|
|
|
|
+ getData(id)
|
|
Snackbar.success('删除成功!')
|
|
Snackbar.success('删除成功!')
|
|
- getData()
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|