Commit 6c4b62e6 authored by wangxl's avatar wangxl

44

parent 21198a2f
...@@ -238,7 +238,7 @@ export default { ...@@ -238,7 +238,7 @@ export default {
}, },
}, },
}, },
data() { data () {
return { return {
educationList: [], educationList: [],
studyList: [], studyList: [],
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
} }
}; };
}, },
created() { created () {
// 根据 resumeType 分类并排序 // 根据 resumeType 分类并排序
if (this.resumeList && this.resumeList.length > 0) { if (this.resumeList && this.resumeList.length > 0) {
// 学历记录 // 学历记录
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
.map(item => ({ .map(item => ({
...item, ...item,
resumeRange: item.resumeStart && item.resumeEnd ? resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : [] [item.resumeStart, item.resumeEnd] : []
})) }))
// 研修经历 // 研修经历
...@@ -270,7 +270,7 @@ export default { ...@@ -270,7 +270,7 @@ export default {
.map(item => ({ .map(item => ({
...item, ...item,
resumeRange: item.resumeStart && item.resumeEnd ? resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : [] [item.resumeStart, item.resumeEnd] : []
})) }))
// 工作经历 // 工作经历
...@@ -280,7 +280,7 @@ export default { ...@@ -280,7 +280,7 @@ export default {
.map(item => ({ .map(item => ({
...item, ...item,
resumeRange: item.resumeStart && item.resumeEnd ? resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : [] [item.resumeStart, item.resumeEnd] : []
})) }))
this.formModel.educationList = this.educationList this.formModel.educationList = this.educationList
...@@ -291,25 +291,25 @@ export default { ...@@ -291,25 +291,25 @@ export default {
methods: { methods: {
moment, moment,
checkDateRange, checkDateRange,
educationDateChange(dates, dateStrings, index) { educationDateChange (dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) { if (dateStrings[0] && dateStrings[1]) {
this.educationList[index].resumeStart = dateStrings[0] this.educationList[index].resumeStart = dateStrings[0]
this.educationList[index].resumeEnd = dateStrings[1] this.educationList[index].resumeEnd = dateStrings[1]
} }
}, },
studyDateChange(dates, dateStrings, index) { studyDateChange (dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) { if (dateStrings[0] && dateStrings[1]) {
this.studyList[index].resumeStart = dateStrings[0] this.studyList[index].resumeStart = dateStrings[0]
this.studyList[index].resumeEnd = dateStrings[1] this.studyList[index].resumeEnd = dateStrings[1]
} }
}, },
workDateChange(dates, dateStrings, index) { workDateChange (dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) { if (dateStrings[0] && dateStrings[1]) {
this.workList[index].resumeStart = dateStrings[0] this.workList[index].resumeStart = dateStrings[0]
this.workList[index].resumeEnd = dateStrings[1] this.workList[index].resumeEnd = dateStrings[1]
} }
}, },
addEducationArray() { addEducationArray () {
const newItem = { const newItem = {
...Education, ...Education,
showIndex: this.educationList.length + 1, showIndex: this.educationList.length + 1,
...@@ -320,13 +320,13 @@ export default { ...@@ -320,13 +320,13 @@ export default {
this.$refs.form && this.$refs.form.clearValidate() this.$refs.form && this.$refs.form.clearValidate()
}) })
}, },
deleteEducationArray(item) { deleteEducationArray (item) {
let index = this.educationList.indexOf(item) let index = this.educationList.indexOf(item)
if (index !== -1) { if (index !== -1) {
this.educationList.splice(index, 1) this.educationList.splice(index, 1)
} }
}, },
addStudyArray() { addStudyArray () {
const newItem = { const newItem = {
...Study, ...Study,
showIndex: this.studyList.length + 1, showIndex: this.studyList.length + 1,
...@@ -337,13 +337,13 @@ export default { ...@@ -337,13 +337,13 @@ export default {
this.$refs.form && this.$refs.form.clearValidate() this.$refs.form && this.$refs.form.clearValidate()
}) })
}, },
deleteStudyArray(item) { deleteStudyArray (item) {
let index = this.studyList.indexOf(item) let index = this.studyList.indexOf(item)
if (index !== -1) { if (index !== -1) {
this.studyList.splice(index, 1) this.studyList.splice(index, 1)
} }
}, },
addWorkArray() { addWorkArray () {
const newItem = { const newItem = {
...Work, ...Work,
showIndex: this.workList.length + 1, showIndex: this.workList.length + 1,
...@@ -354,13 +354,13 @@ export default { ...@@ -354,13 +354,13 @@ export default {
this.$refs.form && this.$refs.form.clearValidate() this.$refs.form && this.$refs.form.clearValidate()
}) })
}, },
deleteWorkArray(item) { deleteWorkArray (item) {
let index = this.workList.indexOf(item) let index = this.workList.indexOf(item)
if (index !== -1) { if (index !== -1) {
this.workList.splice(index, 1) this.workList.splice(index, 1)
} }
}, },
mergeResumeList() { mergeResumeList () {
// 清空原有数据 // 清空原有数据
this.resumeList.length = 0 this.resumeList.length = 0
...@@ -421,21 +421,21 @@ export default { ...@@ -421,21 +421,21 @@ export default {
}, },
watch: { watch: {
educationList: { educationList: {
handler(val) { handler (val) {
this.formModel.educationList = val this.formModel.educationList = val
}, },
deep: true, deep: true,
immediate: true immediate: true
}, },
studyList: { studyList: {
handler(val) { handler (val) {
this.formModel.studyList = val this.formModel.studyList = val
}, },
deep: true, deep: true,
immediate: true immediate: true
}, },
workList: { workList: {
handler(val) { handler (val) {
this.formModel.workList = val this.formModel.workList = val
}, },
deep: true, deep: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment