add button to fill common config field

This commit is contained in:
geekgeekrun
2026-02-22 10:35:06 +08:00
parent b94520e00a
commit 0ffab64653

View File

@@ -309,6 +309,13 @@
@click="handleClickConfigCommonJobCondition({ entry: 'expect-company-field' })"
>编辑公共职位筛选条件</el-button
>
<el-button
v-else
size="small"
ml-10px
@click="fillCommonConfigField('expectCompanies')"
>填入公共职位筛选条件的值</el-button
>
</div>
<el-input
v-if="!formContent.fieldsForUseCommonConfig.expectCompanies"
@@ -411,6 +418,13 @@
"
>编辑公共职位筛选条件</el-button
>
<el-button
v-else
size="small"
ml-10px
@click="fillCommonConfigField('blockCompanyNameRegExpStr')"
>填入公共职位筛选条件的值</el-button
>
</div>
<el-form-item
:key="!formContent.fieldsForUseCommonConfig.blockCompanyNameRegExpStr"
@@ -527,6 +541,9 @@
"
>编辑公共职位筛选条件</el-button
>
<el-button v-else size="small" ml-10px @click="fillCommonConfigField('city')"
>填入公共职位筛选条件的值</el-button
>
</div>
<city-chooser
v-if="!formContent.fieldsForUseCommonConfig.city"
@@ -689,6 +706,9 @@
"
>编辑公共职位筛选条件</el-button
>
<el-button v-else size="small" ml-10px @click="fillCommonConfigField('salary')"
>填入公共职位筛选条件的值</el-button
>
</div>
<template v-if="!formContent.fieldsForUseCommonConfig.salary">
<el-form-item prop="expectSalaryLow" mb10px>
@@ -1259,6 +1279,13 @@
"
>编辑公共职位筛选条件</el-button
>
<el-button
v-else
size="small"
ml-10px
@click="fillCommonConfigField('jobDetail')"
>填入公共职位筛选条件的值</el-button
>
</div>
<el-form-item
v-if="!formContent.fieldsForUseCommonConfig.jobDetail"
@@ -2364,6 +2391,49 @@ const handleClickConfigCommonJobCondition = async ({ entry }) => {
console.log(err)
}
}
const fillCommonConfigField = (field) => {
debugger
gtagRenderer('fill_common_config_field_clicked', { field })
let fieldsToReplace = []
switch (field) {
case 'salary': {
fieldsToReplace = ['expectSalaryCalculateWay', 'expectSalaryLow', 'expectSalaryHigh']
break
}
case 'city': {
fieldsToReplace = ['expectCityList']
break
}
case 'jobDetail': {
fieldsToReplace = [
'jobDetailRegExpMatchLogic',
'expectJobNameRegExpStr',
'expectJobTypeRegExpStr',
'expectJobDescRegExpStr'
]
break
}
case 'expectCompanies': {
fieldsToReplace = ['expectCompanies']
break
}
case 'blockCompanyNameRegExpStr': {
fieldsToReplace = ['blockCompanyNameRegExpStr']
break
}
}
for (const field of fieldsToReplace) {
let sourceValue = commonJobConditionConfig.value[field]
if (
commonJobConditionConfig.value[field] &&
typeof commonJobConditionConfig.value[field] === 'object'
) {
sourceValue = JSON.parse(JSON.stringify(commonJobConditionConfig.value[field]))
}
formContent.value[field] = sourceValue
}
}
</script>
<style scoped lang="scss">