|
|
@@ -173,13 +173,15 @@
|
|
|
选择从事方向
|
|
|
</div>
|
|
|
<div class="my-header-title flex align-center" style="margin-left: 40px; width: 600px">
|
|
|
- <el-select @remove-tag="removeTag" :collapse-tags="true" :max-collapse-tags="5"
|
|
|
- class="my-header-title-se" multiple-limit="20" v-model="postPushForm.positionTag" multiple
|
|
|
- placeholder="请选择从事方向">
|
|
|
- <el-option v-for="item in industryArrList" :key="item.postSkillName"
|
|
|
- :label="item.postSkillName" :value="item.postSkillName" />
|
|
|
+ <el-select v-model="postPushForm.positionTag" multiple placeholder="请选择跨境标签" :collapse-tags="true"
|
|
|
+ :max-collapse-tags="5">
|
|
|
+ <el-option-group v-for="group in industryList" :key="group.postSkillName"
|
|
|
+ :label="group.postSkillName">
|
|
|
+ <el-option v-for="item in group.childrenList" :key="item.postSkillName"
|
|
|
+ :label="item.postSkillName" :value="item.postSkillName" />
|
|
|
+ </el-option-group>
|
|
|
</el-select>
|
|
|
- <span style="margin-left: 10px;font-size: 13px;color: #999999;">{{ postPushForm.positionTag.length }}/20</span>
|
|
|
+ <span style="margin-left: 10px;font-size: 13px;color: #999999;">{{ postPushForm.positionTag.length }}</span>
|
|
|
<el-button @click="addHangye()" style="margin-left: 10px" type="primary">确定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -195,7 +197,7 @@
|
|
|
<div class="preference-children">
|
|
|
<div v-for="(child, cIndex) in parent.childrenList" :key="cIndex" class="preference-tag"
|
|
|
:class="{ active: postPushForm.positionTag.includes(child.postSkillName) }"
|
|
|
- @click="togglePreference(child.postSkillName)">
|
|
|
+ @click="togglePreference(pIndex,child.postSkillName)">
|
|
|
<span>{{ child.postSkillName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -263,7 +265,6 @@ export default {
|
|
|
workDialog: false, //是否打开岗位选择
|
|
|
dialogAgreements: false, //协议弹窗
|
|
|
checked: false, //是否同意协议
|
|
|
- industryArrList: [], // 可选择的从事方向列表
|
|
|
industryList: [], // 从事方向列表
|
|
|
industryDialog: false, // 是否打开从事方向选择
|
|
|
availableBackendTags: [], // 可用的后端标签
|
|
|
@@ -420,7 +421,7 @@ export default {
|
|
|
return this.workTypeList.length > 0 ? this.workTypeList[this.workCurrent].childrens : []
|
|
|
},
|
|
|
positionTagDisplay() {
|
|
|
- return this.postPushForm.positionTag.join(',')
|
|
|
+ return this.postPushForm.positionTag?.length?this.postPushForm.positionTag.join(','):''
|
|
|
},
|
|
|
customTags() {
|
|
|
// 过滤出真正的自定义标签(不在后端标签列表中的标签)
|
|
|
@@ -472,19 +473,21 @@ export default {
|
|
|
return `${num / 1000}k`
|
|
|
},
|
|
|
// 切换从事方向选择状态
|
|
|
- togglePreference(skillName) {
|
|
|
- // 查找索引
|
|
|
+ togglePreference(pIndex, skillName) {
|
|
|
+ const parent = this.industryList[pIndex];
|
|
|
+ const selectedInCategory = parent.childrenList
|
|
|
+ .filter(item => item.postSkillName !== '不限' && this.postPushForm.positionTag.includes(item.postSkillName));
|
|
|
+
|
|
|
const index = this.postPushForm.positionTag.indexOf(skillName);
|
|
|
|
|
|
if (index > -1) {
|
|
|
- // 如果已选择,则取消选择
|
|
|
+ // 已选择则取消
|
|
|
this.postPushForm.positionTag.splice(index, 1);
|
|
|
} else {
|
|
|
- // 如果未选择,检查是否达到选择上限
|
|
|
- if (this.postPushForm.positionTag.length >= 20) {
|
|
|
+ if (selectedInCategory.length >= 5) {
|
|
|
ElMessage({
|
|
|
- message: '最多添加二十条',
|
|
|
- type: 'info',
|
|
|
+ message: '每个分类最多选择5个标签',
|
|
|
+ type: 'warning',
|
|
|
duration: 1500,
|
|
|
offset: this.screenHeight / 2
|
|
|
});
|
|
|
@@ -706,8 +709,6 @@ export default {
|
|
|
flatList.push(child);
|
|
|
});
|
|
|
});
|
|
|
- this.industryArrList = flatList;
|
|
|
-
|
|
|
// 保存所有可用的后端标签名称
|
|
|
this.availableBackendTags = flatList.map(item => item.postSkillName);
|
|
|
|
|
|
@@ -771,27 +772,30 @@ export default {
|
|
|
},
|
|
|
//确认
|
|
|
handleInputConfirm() {
|
|
|
- if (this.inputValue) {
|
|
|
- // 检查是否达到选择上限
|
|
|
- if (this.postPushForm.positionTag.length >= 20) {
|
|
|
- ElMessage({
|
|
|
- message: '最多添加二十条',
|
|
|
- type: 'info',
|
|
|
- duration: 1500,
|
|
|
- offset: this.screenHeight / 2
|
|
|
- });
|
|
|
- this.inputVisible = false;
|
|
|
- this.inputValue = '';
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- this.postPushForm.positionTag.push(this.inputValue)
|
|
|
- this.inputVisible = false
|
|
|
- this.inputValue = ''
|
|
|
- } else {
|
|
|
- this.inputVisible = false
|
|
|
+ if (!this.inputValue) {
|
|
|
+ this.inputVisible = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+ // 当前已有自定义标签数量
|
|
|
+ const currentCustomCount = this.postPushForm.positionTag.filter(
|
|
|
+ tag => !this.availableBackendTags.includes(tag)
|
|
|
+ ).length;
|
|
|
|
|
|
+ if (currentCustomCount >= 5) {
|
|
|
+ ElMessage({
|
|
|
+ message: '最多添加5个自定义标签',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 1500,
|
|
|
+ offset: this.screenHeight / 2
|
|
|
+ });
|
|
|
+ this.inputVisible = false;
|
|
|
+ this.inputValue = '';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 添加自定义标签
|
|
|
+ this.postPushForm.positionTag.push(this.inputValue.trim());
|
|
|
+ this.inputVisible = false;
|
|
|
+ this.inputValue = '';
|
|
|
},
|
|
|
// 工作经验
|
|
|
getSchoolList() {
|
|
|
@@ -832,9 +836,9 @@ export default {
|
|
|
this.workTypeList = res.data
|
|
|
this.workDialog = true
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
+ this.postPushForm.positionTag = []
|
|
|
},
|
|
|
//选择地址
|
|
|
handleSelect(item) {
|