mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-08-28 03:26:42 +08:00
add strategyScopeOptionWhenMarkJobCityNotMatch option; change default value of expectCityNotMatchStrategy to noop; enhance ui
This commit is contained in:
@@ -11,7 +11,8 @@
|
|||||||
"jobNotActiveStrategy": 1,
|
"jobNotActiveStrategy": 1,
|
||||||
"markAsNotActiveSelectedTimeRange": 7,
|
"markAsNotActiveSelectedTimeRange": 7,
|
||||||
"expectCityList": [],
|
"expectCityList": [],
|
||||||
"expectCityNotMatchStrategy": 1,
|
"expectCityNotMatchStrategy": 3,
|
||||||
|
"strategyScopeOptionWhenMarkJobCityNotMatch": 2,
|
||||||
"autoReminder": {
|
"autoReminder": {
|
||||||
"throttleIntervalMinutes": 10,
|
"throttleIntervalMinutes": 10,
|
||||||
"rechatLimitDay": 21,
|
"rechatLimitDay": 21,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { calculateTotalCombinations, combineFiltersWithConstraintsGenerator } fr
|
|||||||
import { default as jobFilterConditions } from './internal-config/job-filter-conditions-20241002.json'
|
import { default as jobFilterConditions } from './internal-config/job-filter-conditions-20241002.json'
|
||||||
import { default as rawIndustryFilterExemption } from './internal-config/job-filter-industry-filter-exemption-20241002.json'
|
import { default as rawIndustryFilterExemption } from './internal-config/job-filter-industry-filter-exemption-20241002.json'
|
||||||
import { ChatStartupFrom } from '@geekgeekrun/sqlite-plugin/dist/entity/ChatStartupLog'
|
import { ChatStartupFrom } from '@geekgeekrun/sqlite-plugin/dist/entity/ChatStartupLog'
|
||||||
import { MarkAsNotSuitReason, MarkAsNotSuitOp } from '@geekgeekrun/sqlite-plugin/dist/enums'
|
import { MarkAsNotSuitReason, MarkAsNotSuitOp, StrategyScopeOptionWhenMarkJobNotMatch } from '@geekgeekrun/sqlite-plugin/dist/enums'
|
||||||
import { activeDescList } from './constant.mjs'
|
import { activeDescList } from './constant.mjs'
|
||||||
|
|
||||||
const jobFilterConditionsMapByCode = {}
|
const jobFilterConditionsMapByCode = {}
|
||||||
@@ -81,9 +81,11 @@ const anyCombineRecommendJobFilter = readConfigFile('boss.json').anyCombineRecom
|
|||||||
const expectJobRegExpStr = readConfigFile('boss.json').expectJobRegExpStr
|
const expectJobRegExpStr = readConfigFile('boss.json').expectJobRegExpStr
|
||||||
const jobNotMatchStrategy = readConfigFile('boss.json').jobNotMatchStrategy ?? MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
const jobNotMatchStrategy = readConfigFile('boss.json').jobNotMatchStrategy ?? MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
||||||
|
|
||||||
const expectCityNotMatchStrategy = readConfigFile('boss.json').expectCityNotMatchStrategy ?? MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
const expectCityNotMatchStrategy = readConfigFile('boss.json').expectCityNotMatchStrategy ?? MarkAsNotSuitOp.NO_OP
|
||||||
const expectCityList = readConfigFile('boss.json').expectCityList ?? []
|
const expectCityList = readConfigFile('boss.json').expectCityList ?? []
|
||||||
|
|
||||||
|
const strategyScopeOptionWhenMarkJobCityNotMatch = readConfigFile('boss.json').strategyScopeOptionWhenMarkJobCityNotMatch ?? StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||||
|
|
||||||
const markAsNotActiveSelectedTimeRange = (() => {
|
const markAsNotActiveSelectedTimeRange = (() => {
|
||||||
let n = readConfigFile('boss.json').markAsNotActiveSelectedTimeRange
|
let n = readConfigFile('boss.json').markAsNotActiveSelectedTimeRange
|
||||||
if (
|
if (
|
||||||
@@ -531,7 +533,24 @@ async function toRecommendPage (hooks) {
|
|||||||
|
|
||||||
// job list
|
// job list
|
||||||
const recommendJobListElProxy = await page.$('.job-list-container .rec-job-list')
|
const recommendJobListElProxy = await page.$('.job-list-container .rec-job-list')
|
||||||
let jobListData = await page.evaluate(`document.querySelector('.page-jobs-main')?.__vue__?.jobList`)
|
let jobListData = []
|
||||||
|
async function updateJobListData () {
|
||||||
|
jobListData = await page.evaluate(`document.querySelector('.page-jobs-main')?.__vue__?.jobList`)
|
||||||
|
if (
|
||||||
|
expectCityNotMatchStrategy === MarkAsNotSuitOp.NO_OP &&
|
||||||
|
Array.isArray(expectCityList) &&
|
||||||
|
expectCityList.length
|
||||||
|
) {
|
||||||
|
console.log(`add job city not suit into blockJobNotSuit set`)
|
||||||
|
for (const it of jobListData) {
|
||||||
|
if (!expectCityList.includes(it.cityName)) {
|
||||||
|
blockJobNotSuit.add(it.encryptJobId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await updateJobListData()
|
||||||
|
|
||||||
let hasReachLastPage = false
|
let hasReachLastPage = false
|
||||||
let targetJobIndex = -1
|
let targetJobIndex = -1
|
||||||
let targetJobData, selectedJobData // they show be same; one is from list, another is from detail
|
let targetJobData, selectedJobData // they show be same; one is from list, another is from detail
|
||||||
@@ -553,7 +572,11 @@ async function toRecommendPage (hooks) {
|
|||||||
(
|
(
|
||||||
Array.isArray(expectCityList) &&
|
Array.isArray(expectCityList) &&
|
||||||
expectCityList.length &&
|
expectCityList.length &&
|
||||||
expectCityNotMatchStrategy === MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
[
|
||||||
|
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
||||||
|
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_LOCAL
|
||||||
|
].includes(expectCityNotMatchStrategy) &&
|
||||||
|
strategyScopeOptionWhenMarkJobCityNotMatch === StrategyScopeOptionWhenMarkJobNotMatch.ALL_JOB
|
||||||
) ? !expectCityList.includes(it.cityName) : false
|
) ? !expectCityList.includes(it.cityName) : false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -591,11 +614,7 @@ async function toRecommendPage (hooks) {
|
|||||||
requestNextPagePromiseWithResolver = null
|
requestNextPagePromiseWithResolver = null
|
||||||
|
|
||||||
await sleep(5000)
|
await sleep(5000)
|
||||||
jobListData = await page.evaluate(
|
await updateJobListData()
|
||||||
`
|
|
||||||
document.querySelector('.page-jobs-main')?.__vue__?.jobList
|
|
||||||
`
|
|
||||||
)
|
|
||||||
tempTargetJobIndexToCheckDetail = getTempTargetJobIndexToCheckDetail()
|
tempTargetJobIndexToCheckDetail = getTempTargetJobIndexToCheckDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,3 +11,8 @@ export enum MarkAsNotSuitOp {
|
|||||||
MARK_AS_NOT_SUIT_ON_LOCAL = 2,
|
MARK_AS_NOT_SUIT_ON_LOCAL = 2,
|
||||||
NO_OP = 3
|
NO_OP = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum StrategyScopeOptionWhenMarkJobNotMatch {
|
||||||
|
ALL_JOB = 1,
|
||||||
|
ONLY_COMPANY_MATCHED_JOB = 2
|
||||||
|
}
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ export default function initIpc() {
|
|||||||
if (hasOwn(payload, 'expectCityNotMatchStrategy')) {
|
if (hasOwn(payload, 'expectCityNotMatchStrategy')) {
|
||||||
bossConfig.expectCityNotMatchStrategy = payload.expectCityNotMatchStrategy
|
bossConfig.expectCityNotMatchStrategy = payload.expectCityNotMatchStrategy
|
||||||
}
|
}
|
||||||
|
if (hasOwn(payload, 'strategyScopeOptionWhenMarkJobCityNotMatch')) {
|
||||||
|
bossConfig.strategyScopeOptionWhenMarkJobCityNotMatch =
|
||||||
|
payload.strategyScopeOptionWhenMarkJobCityNotMatch
|
||||||
|
}
|
||||||
promiseArr.push(writeConfigFile('boss.json', bossConfig))
|
promiseArr.push(writeConfigFile('boss.json', bossConfig))
|
||||||
|
|
||||||
if (hasOwn(payload, 'expectCompanies')) {
|
if (hasOwn(payload, 'expectCompanies')) {
|
||||||
|
|||||||
@@ -118,40 +118,65 @@
|
|||||||
width: '1px'
|
width: '1px'
|
||||||
}"
|
}"
|
||||||
></div>
|
></div>
|
||||||
<el-form-item
|
<div
|
||||||
v-if="formContent.expectCityList?.length"
|
v-if="formContent.expectCityList?.length"
|
||||||
prop="expectCityList"
|
prop="expectCityList"
|
||||||
mb10px
|
|
||||||
:style="{
|
:style="{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
minWidth: '400px'
|
minWidth: '400px'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<el-form-item
|
||||||
font-size-12px
|
mb10px
|
||||||
:style="{
|
:style="{
|
||||||
width: '100%'
|
width: '100%'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div>当前职位工作地与期望工作地不匹配时:</div>
|
<div font-size-12px>当前职位工作地与期望工作地不匹配时:</div>
|
||||||
<el-form-item mb0>
|
<el-select
|
||||||
<el-select
|
v-model="formContent.expectCityNotMatchStrategy"
|
||||||
v-model="formContent.expectCityNotMatchStrategy"
|
@change="
|
||||||
@change="
|
(value) => gtagRenderer('expect_city_not_match_strategy_changed', { value })
|
||||||
(value) => gtagRenderer('expect_city_not_match_strategy_changed', { value })
|
"
|
||||||
"
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="op in strategyOptionWhenCurrentJobNotMatch"
|
||||||
|
:key="op.value"
|
||||||
|
:label="op.name"
|
||||||
|
:value="op.value"
|
||||||
|
>{{ op.name }}</el-option
|
||||||
>
|
>
|
||||||
<el-option
|
</el-select>
|
||||||
v-for="op in strategyOptionWhenCurrentJobNotMatch"
|
</el-form-item>
|
||||||
:key="op.value"
|
<el-form-item
|
||||||
:label="op.name"
|
v-if="
|
||||||
:value="op.value"
|
[
|
||||||
>{{ op.name }}</el-option
|
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
||||||
>
|
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_LOCAL
|
||||||
</el-select>
|
].includes(formContent.expectCityNotMatchStrategy)
|
||||||
</el-form-item>
|
"
|
||||||
</div>
|
mb0
|
||||||
</el-form-item>
|
:style="{
|
||||||
|
width: '100%'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div font-size-12px>标记不合适针对的职位范围:</div>
|
||||||
|
<el-select
|
||||||
|
v-model="formContent.strategyScopeOptionWhenMarkJobCityNotMatch"
|
||||||
|
@change="
|
||||||
|
(value) => gtagRenderer('strategy_scope_option_wmjcnm_changed', { value })
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="op in strategyScopeOptionWhenMarkJobNotMatch"
|
||||||
|
:key="op.value"
|
||||||
|
:label="op.name"
|
||||||
|
:value="op.value"
|
||||||
|
>{{ op.name }}</el-option
|
||||||
|
>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
@@ -335,7 +360,7 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-form-item v-if="formContent.markAsNotActiveSelectedTimeRange > 0" mb0>
|
<el-form-item v-if="formContent.markAsNotActiveSelectedTimeRange > 0" mb0>
|
||||||
<div font-size-12px>发现当前职位不活跃时:</div>
|
<div font-size-12px>当前职位活跃度在如上范围内(即不活跃)时:</div>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formContent.jobNotActiveStrategy"
|
v-model="formContent.jobNotActiveStrategy"
|
||||||
@change="(value) => gtagRenderer('job_not_active_strategy_changed', { value })"
|
@change="(value) => gtagRenderer('job_not_active_strategy_changed', { value })"
|
||||||
@@ -416,7 +441,10 @@ import { calculateTotalCombinations } from '@geekgeekrun/geek-auto-start-chat-wi
|
|||||||
import { gtagRenderer } from '@renderer/utils/gtag'
|
import { gtagRenderer } from '@renderer/utils/gtag'
|
||||||
import defaultTargetCompanyListConf from '@geekgeekrun/geek-auto-start-chat-with-boss/default-config-file/target-company-list.json'
|
import defaultTargetCompanyListConf from '@geekgeekrun/geek-auto-start-chat-with-boss/default-config-file/target-company-list.json'
|
||||||
import { ArrowDown } from '@element-plus/icons-vue'
|
import { ArrowDown } from '@element-plus/icons-vue'
|
||||||
import { MarkAsNotSuitOp } from '@geekgeekrun/sqlite-plugin/src/enums'
|
import {
|
||||||
|
MarkAsNotSuitOp,
|
||||||
|
StrategyScopeOptionWhenMarkJobNotMatch
|
||||||
|
} from '@geekgeekrun/sqlite-plugin/src/enums'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import mittBus from '../../../utils/mitt'
|
import mittBus from '../../../utils/mitt'
|
||||||
import CityChooser from './components/CityChooser.vue'
|
import CityChooser from './components/CityChooser.vue'
|
||||||
@@ -434,7 +462,9 @@ const formContent = ref({
|
|||||||
jobNotActiveStrategy: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
jobNotActiveStrategy: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
||||||
markAsNotActiveSelectedTimeRange: 7,
|
markAsNotActiveSelectedTimeRange: 7,
|
||||||
expectCityList: [],
|
expectCityList: [],
|
||||||
expectCityNotMatchStrategy: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
expectCityNotMatchStrategy: MarkAsNotSuitOp.NO_OP,
|
||||||
|
strategyScopeOptionWhenMarkJobCityNotMatch:
|
||||||
|
StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||||
})
|
})
|
||||||
|
|
||||||
const currentAnyCombineRecommendJobFilterCombinationCount = computed(() => {
|
const currentAnyCombineRecommendJobFilterCombinationCount = computed(() => {
|
||||||
@@ -502,7 +532,10 @@ electron.ipcRenderer.invoke('fetch-config-file-content').then((res) => {
|
|||||||
.map((it) => it.value)
|
.map((it) => it.value)
|
||||||
.includes(res.config['boss.json'].expectCityNotMatchStrategy)
|
.includes(res.config['boss.json'].expectCityNotMatchStrategy)
|
||||||
? res.config['boss.json'].expectCityNotMatchStrategy
|
? res.config['boss.json'].expectCityNotMatchStrategy
|
||||||
: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
: MarkAsNotSuitOp.NO_OP
|
||||||
|
formContent.value.strategyScopeOptionWhenMarkJobCityNotMatch =
|
||||||
|
res.config['boss.json']?.strategyScopeOptionWhenMarkJobCityNotMatch ??
|
||||||
|
StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
@@ -726,6 +759,17 @@ const strategyOptionWhenCurrentJobNotMatch = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const strategyScopeOptionWhenMarkJobNotMatch = [
|
||||||
|
{
|
||||||
|
name: '所有职位',
|
||||||
|
value: StrategyScopeOptionWhenMarkJobNotMatch.ALL_JOB
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '仅和“期望公司白名单”匹配的职位',
|
||||||
|
value: StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const noActiveDefinitionMarks = computed(() => {
|
const noActiveDefinitionMarks = computed(() => {
|
||||||
let arr = [...activeDescList]
|
let arr = [...activeDescList]
|
||||||
arr.shift()
|
arr.shift()
|
||||||
|
|||||||
Reference in New Issue
Block a user