mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-07 05:42:50 +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,
|
||||
"markAsNotActiveSelectedTimeRange": 7,
|
||||
"expectCityList": [],
|
||||
"expectCityNotMatchStrategy": 1,
|
||||
"expectCityNotMatchStrategy": 3,
|
||||
"strategyScopeOptionWhenMarkJobCityNotMatch": 2,
|
||||
"autoReminder": {
|
||||
"throttleIntervalMinutes": 10,
|
||||
"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 rawIndustryFilterExemption } from './internal-config/job-filter-industry-filter-exemption-20241002.json'
|
||||
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'
|
||||
|
||||
const jobFilterConditionsMapByCode = {}
|
||||
@@ -81,9 +81,11 @@ const anyCombineRecommendJobFilter = readConfigFile('boss.json').anyCombineRecom
|
||||
const expectJobRegExpStr = readConfigFile('boss.json').expectJobRegExpStr
|
||||
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 strategyScopeOptionWhenMarkJobCityNotMatch = readConfigFile('boss.json').strategyScopeOptionWhenMarkJobCityNotMatch ?? StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||
|
||||
const markAsNotActiveSelectedTimeRange = (() => {
|
||||
let n = readConfigFile('boss.json').markAsNotActiveSelectedTimeRange
|
||||
if (
|
||||
@@ -531,7 +533,24 @@ async function toRecommendPage (hooks) {
|
||||
|
||||
// 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 targetJobIndex = -1
|
||||
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) &&
|
||||
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
|
||||
)
|
||||
)
|
||||
@@ -591,11 +614,7 @@ async function toRecommendPage (hooks) {
|
||||
requestNextPagePromiseWithResolver = null
|
||||
|
||||
await sleep(5000)
|
||||
jobListData = await page.evaluate(
|
||||
`
|
||||
document.querySelector('.page-jobs-main')?.__vue__?.jobList
|
||||
`
|
||||
)
|
||||
await updateJobListData()
|
||||
tempTargetJobIndexToCheckDetail = getTempTargetJobIndexToCheckDetail()
|
||||
}
|
||||
|
||||
|
||||
@@ -11,3 +11,8 @@ export enum MarkAsNotSuitOp {
|
||||
MARK_AS_NOT_SUIT_ON_LOCAL = 2,
|
||||
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')) {
|
||||
bossConfig.expectCityNotMatchStrategy = payload.expectCityNotMatchStrategy
|
||||
}
|
||||
if (hasOwn(payload, 'strategyScopeOptionWhenMarkJobCityNotMatch')) {
|
||||
bossConfig.strategyScopeOptionWhenMarkJobCityNotMatch =
|
||||
payload.strategyScopeOptionWhenMarkJobCityNotMatch
|
||||
}
|
||||
promiseArr.push(writeConfigFile('boss.json', bossConfig))
|
||||
|
||||
if (hasOwn(payload, 'expectCompanies')) {
|
||||
|
||||
@@ -118,40 +118,65 @@
|
||||
width: '1px'
|
||||
}"
|
||||
></div>
|
||||
<el-form-item
|
||||
<div
|
||||
v-if="formContent.expectCityList?.length"
|
||||
prop="expectCityList"
|
||||
mb10px
|
||||
:style="{
|
||||
flex: 1,
|
||||
minWidth: '400px'
|
||||
}"
|
||||
>
|
||||
<div
|
||||
font-size-12px
|
||||
<el-form-item
|
||||
mb10px
|
||||
:style="{
|
||||
width: '100%'
|
||||
}"
|
||||
>
|
||||
<div>当前职位工作地与期望工作地不匹配时:</div>
|
||||
<el-form-item mb0>
|
||||
<el-select
|
||||
v-model="formContent.expectCityNotMatchStrategy"
|
||||
@change="
|
||||
(value) => gtagRenderer('expect_city_not_match_strategy_changed', { value })
|
||||
"
|
||||
<div font-size-12px>当前职位工作地与期望工作地不匹配时:</div>
|
||||
<el-select
|
||||
v-model="formContent.expectCityNotMatchStrategy"
|
||||
@change="
|
||||
(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
|
||||
v-for="op in strategyOptionWhenCurrentJobNotMatch"
|
||||
:key="op.value"
|
||||
:label="op.name"
|
||||
:value="op.value"
|
||||
>{{ op.name }}</el-option
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="
|
||||
[
|
||||
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
||||
MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_LOCAL
|
||||
].includes(formContent.expectCityNotMatchStrategy)
|
||||
"
|
||||
mb0
|
||||
: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>
|
||||
|
||||
<el-tooltip
|
||||
@@ -335,7 +360,7 @@
|
||||
}"
|
||||
>
|
||||
<el-form-item v-if="formContent.markAsNotActiveSelectedTimeRange > 0" mb0>
|
||||
<div font-size-12px>发现当前职位不活跃时:</div>
|
||||
<div font-size-12px>当前职位活跃度在如上范围内(即不活跃)时:</div>
|
||||
<el-select
|
||||
v-model="formContent.jobNotActiveStrategy"
|
||||
@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 defaultTargetCompanyListConf from '@geekgeekrun/geek-auto-start-chat-with-boss/default-config-file/target-company-list.json'
|
||||
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 mittBus from '../../../utils/mitt'
|
||||
import CityChooser from './components/CityChooser.vue'
|
||||
@@ -434,7 +462,9 @@ const formContent = ref({
|
||||
jobNotActiveStrategy: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS,
|
||||
markAsNotActiveSelectedTimeRange: 7,
|
||||
expectCityList: [],
|
||||
expectCityNotMatchStrategy: MarkAsNotSuitOp.MARK_AS_NOT_SUIT_ON_BOSS
|
||||
expectCityNotMatchStrategy: MarkAsNotSuitOp.NO_OP,
|
||||
strategyScopeOptionWhenMarkJobCityNotMatch:
|
||||
StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||
})
|
||||
|
||||
const currentAnyCombineRecommendJobFilterCombinationCount = computed(() => {
|
||||
@@ -502,7 +532,10 @@ electron.ipcRenderer.invoke('fetch-config-file-content').then((res) => {
|
||||
.map((it) => it.value)
|
||||
.includes(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 = {
|
||||
@@ -726,6 +759,17 @@ const strategyOptionWhenCurrentJobNotMatch = [
|
||||
}
|
||||
]
|
||||
|
||||
const strategyScopeOptionWhenMarkJobNotMatch = [
|
||||
{
|
||||
name: '所有职位',
|
||||
value: StrategyScopeOptionWhenMarkJobNotMatch.ALL_JOB
|
||||
},
|
||||
{
|
||||
name: '仅和“期望公司白名单”匹配的职位',
|
||||
value: StrategyScopeOptionWhenMarkJobNotMatch.ONLY_COMPANY_MATCHED_JOB
|
||||
}
|
||||
]
|
||||
|
||||
const noActiveDefinitionMarks = computed(() => {
|
||||
let arr = [...activeDescList]
|
||||
arr.shift()
|
||||
|
||||
Reference in New Issue
Block a user