Commit c1023866 by wangzhihui

修复下拉框组件

1 parent 84149dbe
...@@ -539,7 +539,8 @@ ...@@ -539,7 +539,8 @@
<i <i
v-show=" v-show="
item.optionList.length > 1 && item.optionList.length > 1 &&
getEditOptionIndex(item.name) == subIndex getEditOptionIndex(item.name) == subIndex &&
getEditOptionValue(item.name)
" "
class="el-icon-check option_icon add_icon" class="el-icon-check option_icon add_icon"
@click.stop=" @click.stop="
...@@ -778,6 +779,7 @@ export default { ...@@ -778,6 +779,7 @@ export default {
// 设置新增选项值 // 设置新增选项值
setAddOptionValue(name, value) { setAddOptionValue(name, value) {
value = value.replace(/\s/g, "")
this.initSelectState(name) this.initSelectState(name)
this.$set(this.selectStates[name], "addOptionValue", value) this.$set(this.selectStates[name], "addOptionValue", value)
}, },
...@@ -790,6 +792,7 @@ export default { ...@@ -790,6 +792,7 @@ export default {
// 设置编辑选项值 // 设置编辑选项值
setEditOptionValue(name, value) { setEditOptionValue(name, value) {
value = value.replace(/\s/g, "")
this.initSelectState(name) this.initSelectState(name)
this.$set(this.selectStates[name], "editOptionValue", value) this.$set(this.selectStates[name], "editOptionValue", value)
}, },
......
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
type: "special-select", type: "special-select",
isClear: true, isClear: true,
typeCode: "character", typeCode: "character",
typeName: "personalityName",
optionId: "itemValue", optionId: "itemValue",
optionLabel: "itemName", optionLabel: "itemName",
optionsName: "characterData", optionsName: "characterData",
...@@ -194,6 +195,7 @@ export default { ...@@ -194,6 +195,7 @@ export default {
type: "special-select", type: "special-select",
isClear: true, isClear: true,
typeCode: "ability_performance", typeCode: "ability_performance",
typeName: "abilityPerformanceName",
optionId: "itemValue", optionId: "itemValue",
optionLabel: "itemName", optionLabel: "itemName",
optionsName: "abilityData", optionsName: "abilityData",
...@@ -213,6 +215,7 @@ export default { ...@@ -213,6 +215,7 @@ export default {
type: "special-select", type: "special-select",
isClear: true, isClear: true,
typeCode: "education_level", typeCode: "education_level",
typeName: "educationLevelName",
optionId: "itemValue", optionId: "itemValue",
optionLabel: "itemName", optionLabel: "itemName",
optionsName: "educationData", optionsName: "educationData",
...@@ -232,6 +235,7 @@ export default { ...@@ -232,6 +235,7 @@ export default {
type: "special-select", type: "special-select",
isClear: true, isClear: true,
typeCode: "appearance", typeCode: "appearance",
typeName: "appearanceName",
optionId: "itemValue", optionId: "itemValue",
optionLabel: "itemName", optionLabel: "itemName",
optionsName: "appearanceData", optionsName: "appearanceData",
...@@ -251,6 +255,7 @@ export default { ...@@ -251,6 +255,7 @@ export default {
type: "special-select", type: "special-select",
isClear: true, isClear: true,
typeCode: "position_match_degree", typeCode: "position_match_degree",
typeName: "positionMatchDegreeName",
optionId: "itemValue", optionId: "itemValue",
optionLabel: "itemName", optionLabel: "itemName",
optionsName: "matchdegreeData", optionsName: "matchdegreeData",
...@@ -283,13 +288,31 @@ export default { ...@@ -283,13 +288,31 @@ export default {
methods: { methods: {
//编辑 //编辑
handleEdit(data, index) { async handleEdit(data, index) {
this.isAdd = false this.isAdd = false
this.index = index this.index = index
this.isEntryDialogConfig.title = "编辑入职" this.isEntryDialogConfig.title = "编辑入职"
this.fetchOnboardingPlans() await this.fetchOnboardingPlans()
this.isEntryVisible = !this.isEntryVisible this.isEntryVisible = !this.isEntryVisible
this.isEntryForm = deepClone(data) this.isEntryForm = deepClone(data)
this.updateParams(this.isEntryForm)
},
updateParams(data) {
data.appearanceName = this.baseData.appearanceData.find(
(item) => item.itemValue == data.appearanceType
).itemName
data.positionMatchDegreeName = this.baseData.appearanceData.find(
(item) => item.itemValue == data.positionMatchDegreeType
).itemName
data.educationLevelName = this.baseData.educationData.find(
(item) => item.itemValue == data.educationLevelType
).itemName
data.abilityPerformanceName = this.baseData.abilityData.find(
(item) => item.itemValue == data.abilityPerformanceType
).itemName
data.personalityName = this.baseData.characterData.find(
(item) => item.itemValue == data.personalityType
).itemName
}, },
//删除简历 //删除简历
handleDelete(index) { handleDelete(index) {
...@@ -408,8 +431,7 @@ export default { ...@@ -408,8 +431,7 @@ export default {
this.handleEntry() this.handleEntry()
}, },
async handleAddSelectTypeConfirm(data) { async handleAddSelectTypeConfirm(data) {
let { typeCode, optionsName, label, value, name } = data let { typeCode, optionsName, label, value, name, typeName } = data
console.log(data)
let res = await addDict({ let res = await addDict({
businessCode: "recruitment", businessCode: "recruitment",
typeCode, typeCode,
...@@ -417,16 +439,21 @@ export default { ...@@ -417,16 +439,21 @@ export default {
itemName: value itemName: value
}) })
if (res) { if (res) {
this.getDictListType(optionsName, typeCode, name) this.getDictListType(optionsName, typeCode, name, typeName)
} }
}, },
async getDictListType(optionsName, typeCode, name) { async getDictListType(optionsName, typeCode, name, typeName) {
let distData = await getDictList({ let distData = await getDictList({
businessCode: "recruitment", businessCode: "recruitment",
typeCode typeCode
}) })
this.baseData[optionsName] = distData.list this.baseData[optionsName] = distData.list
this.getOptionsList(this, "isEntryFormData", false, name) this.getOptionsList(this, "isEntryFormData", false, name)
this.isEntryForm[typeName] =
this.baseData[optionsName].find((item) => {
return item.itemValue == this.isEntryForm[name]
}).itemName || ""
}, },
async handleEditSelectTypeConfirm(data) { async handleEditSelectTypeConfirm(data) {
let { let {
...@@ -437,7 +464,8 @@ export default { ...@@ -437,7 +464,8 @@ export default {
value, value,
id, id,
name, name,
deletedFlag deletedFlag,
typeName
} = data, } = data,
res res
let idKey = this.filterAttribute(optionsName, optionId, "id", id) let idKey = this.filterAttribute(optionsName, optionId, "id", id)
...@@ -452,7 +480,7 @@ export default { ...@@ -452,7 +480,7 @@ export default {
}) })
} }
if (res) { if (res) {
this.getDictListType(optionsName, typeCode, name) this.getDictListType(optionsName, typeCode, name, typeName)
} }
}, },
findFormAttrId(formData, name) { findFormAttrId(formData, name) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!