|
|
|
@@ -34,7 +34,12 @@
|
|
|
|
|
<div v-for="(edu, idx) in editData.education" :key="'edu-'+idx" class="job-resume-edit__card">
|
|
|
|
|
<div class="job-resume-edit__card-header">
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>教育经历{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.education.length > 1" class="job-resume-edit__card-delete" @click="removeItem('education', idx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-delete-icon"><path d="M3 4h10M6 4V3a1 1 0 011-1h2a1 1 0 011 1v1M5 4v8a1 1 0 001 1h4a1 1 0 001-1V4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
|
|
|
<button v-if="editData.education.length > 1" class="job-resume-edit__card-delete" @click="removeItem('education', idx)"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2214 3.31982C12.2595 3.43697 12.2595 3.56318 12.2214 3.68034C12.1834 3.79749 12.1092 3.89959 12.0095 3.97201C11.9099 4.04441 11.7899 4.08341 11.6667 4.08341H11.0833L11.0816 4.12483L10.5373 11.7495C10.5235 11.9445 10.4608 12.1328 10.3552 12.2972C10.2496 12.4617 10.1044 12.5969 9.93283 12.6906C9.76131 12.7843 9.56901 12.8334 9.37359 12.8334H4.62583C4.4304 12.8334 4.2381 12.7843 4.06658 12.6906C3.89506 12.5969 3.74983 12.4617 3.6442 12.2972C3.53858 12.1328 3.47596 11.9445 3.46209 11.7495L2.91783 4.12541L2.91666 4.08341H2.33334C2.21014 4.08341 2.09011 4.04441 1.99046 3.97201C1.89079 3.89959 1.81662 3.79749 1.77855 3.68034C1.74048 3.56318 1.74048 3.43697 1.77855 3.31982C1.81662 3.20266 1.89079 3.10056 1.99046 3.02815C2.09011 2.95575 2.21014 2.91675 2.33334 2.91675H11.6667C11.7899 2.91675 11.9099 2.95575 12.0095 3.02815C12.1092 3.10056 12.1834 3.20266 12.2214 3.31982ZM4.62632 11.6666H9.37368L9.91504 4.08325H4.08496L4.62632 11.6666Z" fill="#52CAD1"/>
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.72145 1.56981C8.75952 1.68696 8.75952 1.81316 8.72145 1.93031C8.68338 2.04747 8.6092 2.14957 8.50954 2.22197C8.40988 2.29438 8.28986 2.33337 8.16667 2.33337H5.83333C5.71014 2.33337 5.59012 2.29438 5.49046 2.22197C5.3908 2.14957 5.31662 2.04747 5.27855 1.93031C5.24048 1.81316 5.24048 1.68696 5.27855 1.56981C5.31662 1.45265 5.3908 1.35056 5.49046 1.27815C5.59012 1.20574 5.71014 1.16675 5.83333 1.16675H8.16667C8.28986 1.16675 8.40988 1.20574 8.50954 1.27815C8.6092 1.35056 8.68338 1.45265 8.72145 1.56981Z" fill="#52CAD1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="ml5">删除</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">学校</label><input class="job-resume-edit__input" placeholder="请输入学校" v-model="edu.school" @blur="autoSave" /></div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">专业</label><input class="job-resume-edit__input" placeholder="请输入专业" v-model="edu.major" @blur="autoSave" /></div>
|
|
|
|
@@ -48,11 +53,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field">
|
|
|
|
|
<label class="job-resume-edit__label">经历描述</label>
|
|
|
|
|
<div v-for="(desc, dIdx) in edu.description" :key="desc.id" class="job-resume-edit__desc-item">
|
|
|
|
|
<textarea class="job-resume-edit__textarea job-resume-edit__textarea--with-remove" placeholder="请输入描述" v-model="desc.text" rows="3" @blur="autoSave"></textarea>
|
|
|
|
|
<button v-if="edu.description.length > 1" class="job-resume-edit__desc-remove" @click="removeDesc('education', idx, dIdx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__desc-remove-icon"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg></button>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn" @click="addDesc('education', idx)"><span class="job-resume-edit__add-icon">+</span> 新增描述</button>
|
|
|
|
|
<textarea class="job-resume-edit__textarea" placeholder="请输入描述,每行一条" v-model="descTextMap.education[idx]" rows="4" @blur="syncDescFromText('education', idx)"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn job-resume-edit__add-btn--full" @click="addItem('education')"><span class="job-resume-edit__add-icon">+</span> 新增教育经历</button>
|
|
|
|
@@ -63,7 +64,12 @@
|
|
|
|
|
<div v-for="(item, idx) in editData.internship" :key="'intern-'+idx" class="job-resume-edit__card">
|
|
|
|
|
<div class="job-resume-edit__card-header">
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>实习经历{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.internship.length > 1" class="job-resume-edit__card-delete" @click="removeItem('internship', idx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-delete-icon"><path d="M3 4h10M6 4V3a1 1 0 011-1h2a1 1 0 011 1v1M5 4v8a1 1 0 001 1h4a1 1 0 001-1V4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
|
|
|
<button v-if="editData.internship.length > 1" class="job-resume-edit__card-delete" @click="removeItem('internship', idx)"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2214 3.31982C12.2595 3.43697 12.2595 3.56318 12.2214 3.68034C12.1834 3.79749 12.1092 3.89959 12.0095 3.97201C11.9099 4.04441 11.7899 4.08341 11.6667 4.08341H11.0833L11.0816 4.12483L10.5373 11.7495C10.5235 11.9445 10.4608 12.1328 10.3552 12.2972C10.2496 12.4617 10.1044 12.5969 9.93283 12.6906C9.76131 12.7843 9.56901 12.8334 9.37359 12.8334H4.62583C4.4304 12.8334 4.2381 12.7843 4.06658 12.6906C3.89506 12.5969 3.74983 12.4617 3.6442 12.2972C3.53858 12.1328 3.47596 11.9445 3.46209 11.7495L2.91783 4.12541L2.91666 4.08341H2.33334C2.21014 4.08341 2.09011 4.04441 1.99046 3.97201C1.89079 3.89959 1.81662 3.79749 1.77855 3.68034C1.74048 3.56318 1.74048 3.43697 1.77855 3.31982C1.81662 3.20266 1.89079 3.10056 1.99046 3.02815C2.09011 2.95575 2.21014 2.91675 2.33334 2.91675H11.6667C11.7899 2.91675 11.9099 2.95575 12.0095 3.02815C12.1092 3.10056 12.1834 3.20266 12.2214 3.31982ZM4.62632 11.6666H9.37368L9.91504 4.08325H4.08496L4.62632 11.6666Z" fill="#52CAD1"/>
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.72145 1.56981C8.75952 1.68696 8.75952 1.81316 8.72145 1.93031C8.68338 2.04747 8.6092 2.14957 8.50954 2.22197C8.40988 2.29438 8.28986 2.33337 8.16667 2.33337H5.83333C5.71014 2.33337 5.59012 2.29438 5.49046 2.22197C5.3908 2.14957 5.31662 2.04747 5.27855 1.93031C5.24048 1.81316 5.24048 1.68696 5.27855 1.56981C5.31662 1.45265 5.3908 1.35056 5.49046 1.27815C5.59012 1.20574 5.71014 1.16675 5.83333 1.16675H8.16667C8.28986 1.16675 8.40988 1.20574 8.50954 1.27815C8.6092 1.35056 8.68338 1.45265 8.72145 1.56981Z" fill="#52CAD1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="ml5">删除</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">公司名称</label><input class="job-resume-edit__input" placeholder="请输入公司名称" v-model="item.companyName" @blur="autoSave" /></div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">职位</label><input class="job-resume-edit__input" placeholder="请输入职位" v-model="item.position" @blur="autoSave" /></div>
|
|
|
|
@@ -73,11 +79,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field">
|
|
|
|
|
<label class="job-resume-edit__label">经历描述</label>
|
|
|
|
|
<div v-for="(desc, dIdx) in item.description" :key="desc.id" class="job-resume-edit__desc-item">
|
|
|
|
|
<textarea class="job-resume-edit__textarea job-resume-edit__textarea--with-remove" placeholder="请输入描述" v-model="desc.text" rows="3" @blur="autoSave"></textarea>
|
|
|
|
|
<button v-if="item.description.length > 1" class="job-resume-edit__desc-remove" @click="removeDesc('internship', idx, dIdx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__desc-remove-icon"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg></button>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn" @click="addDesc('internship', idx)"><span class="job-resume-edit__add-icon">+</span> 新增描述</button>
|
|
|
|
|
<textarea class="job-resume-edit__textarea" placeholder="请输入描述,每行一条" v-model="descTextMap.internship[idx]" rows="4" @blur="syncDescFromText('internship', idx)"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn job-resume-edit__add-btn--full" @click="addItem('internship')"><span class="job-resume-edit__add-icon">+</span> 新增实习经历</button>
|
|
|
|
@@ -88,7 +90,12 @@
|
|
|
|
|
<div v-for="(item, idx) in editData.work" :key="'work-'+idx" class="job-resume-edit__card">
|
|
|
|
|
<div class="job-resume-edit__card-header">
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>工作经历{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.work.length > 1" class="job-resume-edit__card-delete" @click="removeItem('work', idx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-delete-icon"><path d="M3 4h10M6 4V3a1 1 0 011-1h2a1 1 0 011 1v1M5 4v8a1 1 0 001 1h4a1 1 0 001-1V4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
|
|
|
<button v-if="editData.work.length > 1" class="job-resume-edit__card-delete" @click="removeItem('work', idx)"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2214 3.31982C12.2595 3.43697 12.2595 3.56318 12.2214 3.68034C12.1834 3.79749 12.1092 3.89959 12.0095 3.97201C11.9099 4.04441 11.7899 4.08341 11.6667 4.08341H11.0833L11.0816 4.12483L10.5373 11.7495C10.5235 11.9445 10.4608 12.1328 10.3552 12.2972C10.2496 12.4617 10.1044 12.5969 9.93283 12.6906C9.76131 12.7843 9.56901 12.8334 9.37359 12.8334H4.62583C4.4304 12.8334 4.2381 12.7843 4.06658 12.6906C3.89506 12.5969 3.74983 12.4617 3.6442 12.2972C3.53858 12.1328 3.47596 11.9445 3.46209 11.7495L2.91783 4.12541L2.91666 4.08341H2.33334C2.21014 4.08341 2.09011 4.04441 1.99046 3.97201C1.89079 3.89959 1.81662 3.79749 1.77855 3.68034C1.74048 3.56318 1.74048 3.43697 1.77855 3.31982C1.81662 3.20266 1.89079 3.10056 1.99046 3.02815C2.09011 2.95575 2.21014 2.91675 2.33334 2.91675H11.6667C11.7899 2.91675 11.9099 2.95575 12.0095 3.02815C12.1092 3.10056 12.1834 3.20266 12.2214 3.31982ZM4.62632 11.6666H9.37368L9.91504 4.08325H4.08496L4.62632 11.6666Z" fill="#52CAD1"/>
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.72145 1.56981C8.75952 1.68696 8.75952 1.81316 8.72145 1.93031C8.68338 2.04747 8.6092 2.14957 8.50954 2.22197C8.40988 2.29438 8.28986 2.33337 8.16667 2.33337H5.83333C5.71014 2.33337 5.59012 2.29438 5.49046 2.22197C5.3908 2.14957 5.31662 2.04747 5.27855 1.93031C5.24048 1.81316 5.24048 1.68696 5.27855 1.56981C5.31662 1.45265 5.3908 1.35056 5.49046 1.27815C5.59012 1.20574 5.71014 1.16675 5.83333 1.16675H8.16667C8.28986 1.16675 8.40988 1.20574 8.50954 1.27815C8.6092 1.35056 8.68338 1.45265 8.72145 1.56981Z" fill="#52CAD1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="ml5">删除</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">公司名称</label><input class="job-resume-edit__input" placeholder="请输入公司名称" v-model="item.companyName" @blur="autoSave" /></div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">职位</label><input class="job-resume-edit__input" placeholder="请输入职位" v-model="item.position" @blur="autoSave" /></div>
|
|
|
|
@@ -98,11 +105,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field">
|
|
|
|
|
<label class="job-resume-edit__label">经历描述</label>
|
|
|
|
|
<div v-for="(desc, dIdx) in item.description" :key="desc.id" class="job-resume-edit__desc-item">
|
|
|
|
|
<textarea class="job-resume-edit__textarea job-resume-edit__textarea--with-remove" placeholder="请输入描述" v-model="desc.text" rows="3" @blur="autoSave"></textarea>
|
|
|
|
|
<button v-if="item.description.length > 1" class="job-resume-edit__desc-remove" @click="removeDesc('work', idx, dIdx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__desc-remove-icon"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg></button>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn" @click="addDesc('work', idx)"><span class="job-resume-edit__add-icon">+</span> 新增描述</button>
|
|
|
|
|
<textarea class="job-resume-edit__textarea" placeholder="请输入描述,每行一条" v-model="descTextMap.work[idx]" rows="4" @blur="syncDescFromText('work', idx)"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn job-resume-edit__add-btn--full" @click="addItem('work')"><span class="job-resume-edit__add-icon">+</span> 新增工作经历</button>
|
|
|
|
@@ -113,7 +116,12 @@
|
|
|
|
|
<div v-for="(item, idx) in editData.project" :key="'proj-'+idx" class="job-resume-edit__card">
|
|
|
|
|
<div class="job-resume-edit__card-header">
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>项目经历{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.project.length > 1" class="job-resume-edit__card-delete" @click="removeItem('project', idx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-delete-icon"><path d="M3 4h10M6 4V3a1 1 0 011-1h2a1 1 0 011 1v1M5 4v8a1 1 0 001 1h4a1 1 0 001-1V4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
|
|
|
<button v-if="editData.project.length > 1" class="job-resume-edit__card-delete" @click="removeItem('project', idx)"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2214 3.31982C12.2595 3.43697 12.2595 3.56318 12.2214 3.68034C12.1834 3.79749 12.1092 3.89959 12.0095 3.97201C11.9099 4.04441 11.7899 4.08341 11.6667 4.08341H11.0833L11.0816 4.12483L10.5373 11.7495C10.5235 11.9445 10.4608 12.1328 10.3552 12.2972C10.2496 12.4617 10.1044 12.5969 9.93283 12.6906C9.76131 12.7843 9.56901 12.8334 9.37359 12.8334H4.62583C4.4304 12.8334 4.2381 12.7843 4.06658 12.6906C3.89506 12.5969 3.74983 12.4617 3.6442 12.2972C3.53858 12.1328 3.47596 11.9445 3.46209 11.7495L2.91783 4.12541L2.91666 4.08341H2.33334C2.21014 4.08341 2.09011 4.04441 1.99046 3.97201C1.89079 3.89959 1.81662 3.79749 1.77855 3.68034C1.74048 3.56318 1.74048 3.43697 1.77855 3.31982C1.81662 3.20266 1.89079 3.10056 1.99046 3.02815C2.09011 2.95575 2.21014 2.91675 2.33334 2.91675H11.6667C11.7899 2.91675 11.9099 2.95575 12.0095 3.02815C12.1092 3.10056 12.1834 3.20266 12.2214 3.31982ZM4.62632 11.6666H9.37368L9.91504 4.08325H4.08496L4.62632 11.6666Z" fill="#52CAD1"/>
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.72145 1.56981C8.75952 1.68696 8.75952 1.81316 8.72145 1.93031C8.68338 2.04747 8.6092 2.14957 8.50954 2.22197C8.40988 2.29438 8.28986 2.33337 8.16667 2.33337H5.83333C5.71014 2.33337 5.59012 2.29438 5.49046 2.22197C5.3908 2.14957 5.31662 2.04747 5.27855 1.93031C5.24048 1.81316 5.24048 1.68696 5.27855 1.56981C5.31662 1.45265 5.3908 1.35056 5.49046 1.27815C5.59012 1.20574 5.71014 1.16675 5.83333 1.16675H8.16667C8.28986 1.16675 8.40988 1.20574 8.50954 1.27815C8.6092 1.35056 8.68338 1.45265 8.72145 1.56981Z" fill="#52CAD1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="ml5">删除</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">项目名称</label><input class="job-resume-edit__input" placeholder="请输入项目名称" v-model="item.projectName" @blur="autoSave" /></div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">所属公司</label><input class="job-resume-edit__input" placeholder="请输入所属公司" v-model="item.companyName" @blur="autoSave" /></div>
|
|
|
|
@@ -124,11 +132,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field">
|
|
|
|
|
<label class="job-resume-edit__label">经历描述</label>
|
|
|
|
|
<div v-for="(desc, dIdx) in item.description" :key="desc.id" class="job-resume-edit__desc-item">
|
|
|
|
|
<textarea class="job-resume-edit__textarea job-resume-edit__textarea--with-remove" placeholder="请输入描述" v-model="desc.text" rows="3" @blur="autoSave"></textarea>
|
|
|
|
|
<button v-if="item.description.length > 1" class="job-resume-edit__desc-remove" @click="removeDesc('project', idx, dIdx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__desc-remove-icon"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg></button>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn" @click="addDesc('project', idx)"><span class="job-resume-edit__add-icon">+</span> 新增描述</button>
|
|
|
|
|
<textarea class="job-resume-edit__textarea" placeholder="请输入描述,每行一条" v-model="descTextMap.project[idx]" rows="4" @blur="syncDescFromText('project', idx)"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button class="job-resume-edit__add-btn job-resume-edit__add-btn--full" @click="addItem('project')"><span class="job-resume-edit__add-icon">+</span> 新增项目经历</button>
|
|
|
|
@@ -138,8 +142,14 @@
|
|
|
|
|
<template v-else-if="sec.key === 'competition'">
|
|
|
|
|
<div v-for="(item, idx) in editData.competition" :key="'comp-'+idx" class="job-resume-edit__card">
|
|
|
|
|
<div class="job-resume-edit__card-header">
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>竞赛{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.competition.length > 1" class="job-resume-edit__card-delete" @click="removeItem('competition', idx)"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-delete-icon"><path d="M3 4h10M6 4V3a1 1 0 011-1h2a1 1 0 011 1v1M5 4v8a1 1 0 001 1h4a1 1 0 001-1V4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
|
|
|
<span class="job-resume-edit__card-index"><svg viewBox="0 0 16 16" fill="none" class="job-resume-edit__card-index-dot"><circle cx="8" cy="8" r="3" fill="currentColor"/></svg>竞赛经历{{ idx + 1 }}</span>
|
|
|
|
|
<button v-if="editData.competition.length > 1" class="job-resume-edit__card-delete" @click="removeItem('competition', idx)">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2214 3.31982C12.2595 3.43697 12.2595 3.56318 12.2214 3.68034C12.1834 3.79749 12.1092 3.89959 12.0095 3.97201C11.9099 4.04441 11.7899 4.08341 11.6667 4.08341H11.0833L11.0816 4.12483L10.5373 11.7495C10.5235 11.9445 10.4608 12.1328 10.3552 12.2972C10.2496 12.4617 10.1044 12.5969 9.93283 12.6906C9.76131 12.7843 9.56901 12.8334 9.37359 12.8334H4.62583C4.4304 12.8334 4.2381 12.7843 4.06658 12.6906C3.89506 12.5969 3.74983 12.4617 3.6442 12.2972C3.53858 12.1328 3.47596 11.9445 3.46209 11.7495L2.91783 4.12541L2.91666 4.08341H2.33334C2.21014 4.08341 2.09011 4.04441 1.99046 3.97201C1.89079 3.89959 1.81662 3.79749 1.77855 3.68034C1.74048 3.56318 1.74048 3.43697 1.77855 3.31982C1.81662 3.20266 1.89079 3.10056 1.99046 3.02815C2.09011 2.95575 2.21014 2.91675 2.33334 2.91675H11.6667C11.7899 2.91675 11.9099 2.95575 12.0095 3.02815C12.1092 3.10056 12.1834 3.20266 12.2214 3.31982ZM4.62632 11.6666H9.37368L9.91504 4.08325H4.08496L4.62632 11.6666Z" fill="#52CAD1"/>
|
|
|
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.72145 1.56981C8.75952 1.68696 8.75952 1.81316 8.72145 1.93031C8.68338 2.04747 8.6092 2.14957 8.50954 2.22197C8.40988 2.29438 8.28986 2.33337 8.16667 2.33337H5.83333C5.71014 2.33337 5.59012 2.29438 5.49046 2.22197C5.3908 2.14957 5.31662 2.04747 5.27855 1.93031C5.24048 1.81316 5.24048 1.68696 5.27855 1.56981C5.31662 1.45265 5.3908 1.35056 5.49046 1.27815C5.59012 1.20574 5.71014 1.16675 5.83333 1.16675H8.16667C8.28986 1.16675 8.40988 1.20574 8.50954 1.27815C8.6092 1.35056 8.68338 1.45265 8.72145 1.56981Z" fill="#52CAD1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
|
|
|
|
|
<span class="ml5">删除</span></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">竞赛名称</label><input class="job-resume-edit__input" placeholder="请输入竞赛名称" v-model="item.competitionName" @blur="autoSave" /></div>
|
|
|
|
|
<div class="job-resume-edit__field"><label class="job-resume-edit__label">获奖名次</label><input class="job-resume-edit__input" placeholder="请输入获奖名次" v-model="item.award" @blur="autoSave" /></div>
|
|
|
|
@@ -178,13 +188,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- ========== 作品集 ========== -->
|
|
|
|
|
<template v-else-if="sec.key === 'portfolio'">
|
|
|
|
|
<div class="job-resume-edit__field">
|
|
|
|
|
<input class="job-resume-edit__input" placeholder="请输入作品集链接" v-model="editData.resume.portfolioUrl" @blur="autoSave" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -269,14 +272,13 @@ const sectionList = [
|
|
|
|
|
{ key: 'competition', label: '竞赛' },
|
|
|
|
|
{ key: 'certificate', label: '证书' },
|
|
|
|
|
{ key: 'skills', label: '技能' },
|
|
|
|
|
{ key: 'portfolio', label: '作品集' },
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
/** 各模块展开状态 */
|
|
|
|
|
const openSections = reactive<Record<string, boolean>>({
|
|
|
|
|
info: false, summary: false, education: false, internship: false,
|
|
|
|
|
work: false, project: false, competition: false, certificate: false,
|
|
|
|
|
skills: false, portfolio: false,
|
|
|
|
|
skills: false,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** 切换模块展开/收起 */
|
|
|
|
@@ -347,9 +349,45 @@ function initEditData(data: CustomizeResumeData) {
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 描述文本映射(合并编辑用) ====================
|
|
|
|
|
|
|
|
|
|
/** 每个模块每条经历的描述文本(将description数组用换行拼成单个字符串) */
|
|
|
|
|
const descTextMap = reactive<Record<string, string[]>>({
|
|
|
|
|
education: [],
|
|
|
|
|
work: [],
|
|
|
|
|
internship: [],
|
|
|
|
|
project: [],
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** 从 editData 的 description 数组生成合并文本 */
|
|
|
|
|
function buildDescTextMap() {
|
|
|
|
|
descTextMap.education = editData.education.map(e => e.description.map(d => d.text).join('\n'))
|
|
|
|
|
descTextMap.work = editData.work.map(w => w.description.map(d => d.text).join('\n'))
|
|
|
|
|
descTextMap.internship = editData.internship.map(i => i.description.map(d => d.text).join('\n'))
|
|
|
|
|
descTextMap.project = editData.project.map(p => p.description.map(d => d.text).join('\n'))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 将文本框内容按换行拆分回 description 数组,并触发自动保存 */
|
|
|
|
|
function syncDescFromText(type: 'education' | 'work' | 'internship' | 'project', itemIdx: number) {
|
|
|
|
|
const text = descTextMap[type][itemIdx] || ''
|
|
|
|
|
const lines = text.split('\n').filter(s => s.trim())
|
|
|
|
|
const oldDesc = editData[type][itemIdx].description
|
|
|
|
|
// 保留原有id,超出的生成新id
|
|
|
|
|
const newDesc: DescParagraph[] = lines.map((line, i) => ({
|
|
|
|
|
id: i < oldDesc.length ? oldDesc[i].id : genId(),
|
|
|
|
|
text: line,
|
|
|
|
|
}))
|
|
|
|
|
// 如果全部为空则保留一个空描述
|
|
|
|
|
editData[type][itemIdx].description = newDesc.length ? newDesc : [{ id: genId(), text: '' }]
|
|
|
|
|
autoSave()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 监听 props 变化,初始化编辑数据 */
|
|
|
|
|
watch(() => props.resumeData, (val) => {
|
|
|
|
|
if (val) initEditData(val)
|
|
|
|
|
if (val) {
|
|
|
|
|
initEditData(val)
|
|
|
|
|
buildDescTextMap()
|
|
|
|
|
}
|
|
|
|
|
}, { immediate: true, deep: true })
|
|
|
|
|
|
|
|
|
|
// ==================== 自动保存(失焦/选择后触发PUT接口) ====================
|
|
|
|
@@ -360,7 +398,9 @@ let saveTimer: ReturnType<typeof setTimeout> | null = null
|
|
|
|
|
/** 将编辑数据转换为接口所需的 CustomizeResumeData 格式 */
|
|
|
|
|
function buildSavePayload(): CustomizeResumeData {
|
|
|
|
|
return {
|
|
|
|
|
// 主表字段:以原始数据为基础,覆盖编辑数据,确保不丢失任何字段
|
|
|
|
|
resume: {
|
|
|
|
|
...(props.resumeData?.resume || {}),
|
|
|
|
|
avatarUrl: editData.resume.avatarUrl,
|
|
|
|
|
name: editData.resume.name,
|
|
|
|
|
email: editData.resume.email,
|
|
|
|
@@ -423,12 +463,16 @@ function addItem(type: 'education' | 'work' | 'internship' | 'project' | 'compet
|
|
|
|
|
const emptyDesc: DescParagraph[] = [{ id: genId(), text: '' }]
|
|
|
|
|
if (type === 'education') {
|
|
|
|
|
editData.education.push({ id, school: '', major: '', degree: '本科', studyType: '全日制', startDate: '', endDate: '', description: emptyDesc })
|
|
|
|
|
descTextMap.education.push('')
|
|
|
|
|
} else if (type === 'work') {
|
|
|
|
|
editData.work.push({ id, companyName: '', position: '', startDate: '', endDate: '', description: emptyDesc })
|
|
|
|
|
descTextMap.work.push('')
|
|
|
|
|
} else if (type === 'internship') {
|
|
|
|
|
editData.internship.push({ id, companyName: '', position: '', startDate: '', endDate: '', description: emptyDesc })
|
|
|
|
|
descTextMap.internship.push('')
|
|
|
|
|
} else if (type === 'project') {
|
|
|
|
|
editData.project.push({ id, companyName: '', projectName: '', role: '', startDate: '', endDate: '', description: emptyDesc })
|
|
|
|
|
descTextMap.project.push('')
|
|
|
|
|
} else if (type === 'competition') {
|
|
|
|
|
editData.competition.push({ id, competitionName: '', award: '', awardDate: '', description: emptyDesc })
|
|
|
|
|
}
|
|
|
|
@@ -438,17 +482,10 @@ function addItem(type: 'education' | 'work' | 'internship' | 'project' | 'compet
|
|
|
|
|
/** 删除一条经历记录 */
|
|
|
|
|
function removeItem(type: 'education' | 'work' | 'internship' | 'project' | 'competition', idx: number) {
|
|
|
|
|
editData[type].splice(idx, 1)
|
|
|
|
|
autoSave()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 新增一条描述段落 */
|
|
|
|
|
function addDesc(type: 'education' | 'work' | 'internship' | 'project', itemIdx: number) {
|
|
|
|
|
editData[type][itemIdx].description.push({ id: genId(), text: '' })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 删除一条描述段落 */
|
|
|
|
|
function removeDesc(type: 'education' | 'work' | 'internship' | 'project', itemIdx: number, descIdx: number) {
|
|
|
|
|
editData[type][itemIdx].description.splice(descIdx, 1)
|
|
|
|
|
// 同步更新描述文本映射
|
|
|
|
|
if (type !== 'competition' && descTextMap[type]) {
|
|
|
|
|
descTextMap[type].splice(idx, 1)
|
|
|
|
|
}
|
|
|
|
|
autoSave()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|