Skip to content

Commit

Permalink
feat: ✨ AI筛选
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocyss committed Apr 5, 2024
1 parent dcb1d25 commit ca5b612
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 124 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
Boos直聘助手, 皆在减少投递简历的麻烦, 和提高投递简历的效率,技术栈使用VIte + Vue3 + element-plus, 代码由 Vite 打包无加密混淆最小化,开源在 Github 欢迎前来Pr

> 本项目处于积极维护状态
>
> 测试阶段,目前可以正常筛选,自动打招呼并且进行投递,统计,GPT等功能制作中
## 项目预览

Expand All @@ -26,6 +24,15 @@ Boos直聘助手, 皆在减少投递简历的麻烦, 和提高投递简历的效

> 目前正在测试自动编译阶段,一切皆为测试版本
### 问题解答/已知问题

- GPT给出非JSON格式的消息,导致报错
- 花钱用GPT4
- 点击导航栏切换不会挂载界面啊
- 自己手动刷新,增加检测反而会有更多问题
- 页面加载不出来,或者无故多次刷新
- 大概率不是我脚本的问题,我也不知道原因,但不影响使用

## 未来计划

- [x] 优化UI去除广告
Expand Down
13 changes: 10 additions & 3 deletions README.user.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ Boos直聘助手, 皆在减少投递简历的麻烦, 和提高投递简历的效
[202x.x.x.alpha] 为测试版本,同步github的master分支,每日自动构建

> 本项目处于积极维护状态
>
> 测试阶段,目前可以正常筛选,自动打招呼并且进行投递,统计,GPT等功能制作中
### 项目预览
## 项目预览

[![统计界面](https://s21.ax1x.com/2024/04/02/pFHa3ZD.png)](https://imgse.com/i/pFHa3ZD)
[![配置界面](https://s21.ax1x.com/2024/04/02/pFHa8de.png)](https://imgse.com/i/pFHa8de)
[![日志界面](https://s21.ax1x.com/2024/04/02/pFHalqO.png)](https://imgse.com/i/pFHalqO)

### 问题解答/已知问题

- GPT给出非JSON格式的消息,导致报错
- 花钱用GPT4
- 点击导航栏切换不会挂载界面啊
- 自己手动刷新,增加检测反而会有更多问题
- 页面加载不出来,或者无故多次刷新
- 大概率不是我脚本的问题,我也不知道原因,但不影响使用

### 未来计划

- [x] 优化UI去除广告
Expand Down
29 changes: 29 additions & 0 deletions src/components/form/formAi.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts" setup>
import { ElButton, ElButtonGroup } from "element-plus";
import { useFormData } from "@/pages/web/geek/job/hooks/useForm";
import { FormDataAi } from "@/types/formData";
import settingsVue from "@/components/icon/settings.vue";
const { deliverLock, confSaving } = useFormData();
const props = defineProps<{
label: string;
help?: string;
disabled?: boolean;
data: FormDataAi;
}>();
function change(v: FormDataAi) {
v.enable = !v.enable;
confSaving();
}
</script>

<template>
<el-button-group :type="data.enable ? 'success' : 'danger'" :help>
<el-button :disabled="deliverLock || disabled" @click="() => change(data)">
{{ label }}
</el-button>
<el-button :icon="settingsVue" :disabled @click="$emit('show')" />
</el-button-group>
</template>

<style lang="scss" scoped></style>
2 changes: 2 additions & 0 deletions src/components/icon/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
</g>
</svg>
</template>

<script lang="ts" setup></script>
36 changes: 18 additions & 18 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@ async function start(e?: any) {
logger.debug("开始运行");
start();

const _wr = function (type: keyof History) {
var orig = history[type];
return function () {
// @ts-ignore
var rv = orig.apply(this, arguments);
var e = new Event(type);
// @ts-ignore
e.arguments = arguments;
window.dispatchEvent(e);
return rv;
};
};
history.pushState = _wr("pushState");
history.replaceState = _wr("replaceState");
window.addEventListener("popstate", start);
window.addEventListener("hashchange", start);
window.addEventListener("replaceState", start);
window.addEventListener("pushState", start);
// const _wr = function (type: keyof History) {
// var orig = history[type];
// return function () {
// // @ts-ignore
// var rv = orig.apply(this, arguments);
// var e = new Event(type);
// // @ts-ignore
// e.arguments = arguments;
// window.dispatchEvent(e);
// return rv;
// };
// };
// history.pushState = _wr("pushState");
// history.replaceState = _wr("replaceState");
// window.addEventListener("popstate", start);
// window.addEventListener("hashchange", start);
// window.addEventListener("replaceState", start);
// window.addEventListener("pushState", start);

declare global {
interface Window {
Expand Down
82 changes: 38 additions & 44 deletions src/pages/web/geek/job/ai.vue
Original file line number Diff line number Diff line change
@@ -1,70 +1,64 @@
<script lang="ts" setup>
import { ElButton, ElButtonGroup, ElSpace } from "element-plus";
import { useFormData } from "./hooks/useForm";
import { useFormData, formInfoData } from "./hooks/useForm";
import settingsVue from "@/components/icon/settings.vue";
import { ref } from "vue";
import greetingVue from "./ai/greeting.vue";
import configVue from "./ai/config.vue";
import modelVue from "./ai/model.vue";
import { FormDataAi } from "@/types/formData";
import formAiVue from "@/components/form/formAi.vue";
const { formData, deliverLock, confSaving } = useFormData();
const aiBoxShow = ref(false);
const aiBox = ref();
function change(v: FormDataAi) {
v.enable = !v.enable;
confSaving();
}
const aiConfBoxShow = ref(false);
const aiBox = ref<"aiGreeting" | "aiFiltering" | "aiReply">("aiGreeting");
</script>

<template>
<el-space wrap fill :fill-ratio="32" style="width: 100%">
<el-button-group
:type="formData.aiGreeting.enable ? 'success' : 'danger'"
help="即使前面招呼语开了也不会发送,只会发送AI生成的招呼语,让gpt来打招呼真是太棒了,毕竟开场白很重要。"
>
<el-button
:disabled="deliverLock"
@click="() => change(formData.aiGreeting)"
>
AI招呼语
</el-button>
<el-button
:icon="settingsVue"
@click="
aiBox = greetingVue;
aiBoxShow = true;
"
/>
</el-button-group>
<el-button-group
type="info"
help="根据工作内容让gpt分析过滤,真是太稳健了,不放过任何一个垃圾"
>
<el-button disabled>AI过滤</el-button>
<el-button disabled :icon="settingsVue" />
</el-button-group>
<el-button-group
type="info"
help="万一消息太多,回不过来了呢,也许能和AiHR聊到地球爆炸?魔法击败魔法"
>
<el-button disabled>AI回复</el-button>
<el-button disabled :icon="settingsVue" />
</el-button-group>
<formAiVue
v-bind="formInfoData.aiGreeting"
:data="formData.aiGreeting"
@show="
aiBox = 'aiGreeting';
aiBoxShow = true;
"
/>
<formAiVue
v-bind="formInfoData.aiFiltering"
:data="formData.aiFiltering"
@show="
aiBox = 'aiFiltering';
aiBoxShow = true;
"
/>
<formAiVue
v-bind="formInfoData.aiReply"
:data="formData.aiReply"
@show="
aiBox = 'aiReply';
aiBoxShow = true;
"
disabled
/>
</el-space>
<div style="margin-top: 15px">
<el-button
type="primary"
help="有那么多功能,当然要分等级了,不然岂不是浪费了这么多的模型(主要缺钱)"
@click="
aiBox = modelVue;
aiBoxShow = true;
"
@click="aiConfBoxShow = true"
>
模型配置
</el-button>
</div>
<Teleport to="body">
<component v-if="aiBox" :is="aiBox" v-model="aiBoxShow" />
<modelVue v-model="aiConfBoxShow" />
<configVue
v-if="aiBoxShow"
v-key="aiBox"
:data="aiBox"
v-model="aiBoxShow"
/>
</Teleport>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ import {
ElLink,
} from "element-plus";
import { useModel } from "../hooks/useModel";
import { useFormData } from "../hooks/useForm";
import { ref } from "vue";
import { useFormData, formInfoData } from "../hooks/useForm";
import { onMounted, ref } from "vue";
import { FormDataAi, FormData } from "@/types/formData";
const { formData, confSaving, defaultFormData } = useFormData();
const { modelData } = useModel();
const props = defineProps<{
data: "aiGreeting" | "aiFiltering" | "aiReply";
}>();
const show = defineModel<boolean>({ required: true });
const val = ref(formData.aiGreeting.word);
const model = ref(formData.aiGreeting.model);
const val = ref(formData[props.data].word);
const model = ref(formData[props.data].model);
</script>

<template>
<el-dialog
v-model="show"
title="Ai招呼语配置"
:title="formInfoData[data].label"
width="70%"
align-center
destroy-on-close
Expand Down Expand Up @@ -51,14 +55,14 @@ const model = ref(formData.aiGreeting.model);
style="width: 100%"
:autosize="{ minRows: 10, maxRows: 18 }"
type="textarea"
placeholder="Please input"
placeholder="如果无内容或错误内容请直接恢复默认,示例会随脚本更新"
/>
<template #footer>
<div>
<el-button @click="show = false">取消</el-button>
<el-popconfirm
title="恢复默认但不保存~"
@confirm="val = defaultFormData.aiGreeting.word"
@confirm="val = defaultFormData[data].word"
>
<template #reference>
<el-button type="info">默认</el-button>
Expand All @@ -68,8 +72,8 @@ const model = ref(formData.aiGreeting.model);
type="primary"
@click="
() => {
formData.aiGreeting.model = model;
formData.aiGreeting.word = val;
formData[data].model = model;
formData[data].word = val;
confSaving();
show = false;
}
Expand Down
14 changes: 7 additions & 7 deletions src/pages/web/geek/job/config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import formItem from "@/components/form/formItem.vue";
import formSelect from "@/components/form/formSelect.vue";
import deepmerge from "@/utils/deepmerge";
import { FormData } from "@/types/formData";
import { useFormData } from "./hooks/useForm";
import { useFormData, formInfoData } from "./hooks/useForm";
const {
formData,
deliverLock,
Expand All @@ -32,7 +32,7 @@ const {
:disabled="deliverLock"
>
<form-item
v-bind="formData.company"
v-bind="formInfoData.company"
v-model:enable="formData.company.enable"
v-model:include="formData.company.include"
:disabled="deliverLock"
Expand All @@ -43,7 +43,7 @@ const {
/>
</form-item>
<form-item
v-bind="formData.jobTitle"
v-bind="formInfoData.jobTitle"
v-model:enable="formData.jobTitle.enable"
v-model:include="formData.jobTitle.include"
:disabled="deliverLock"
Expand All @@ -54,7 +54,7 @@ const {
/>
</form-item>
<form-item
v-bind="formData.jobContent"
v-bind="formInfoData.jobContent"
v-model:enable="formData.jobContent.enable"
v-model:include="formData.jobContent.include"
:disabled="deliverLock"
Expand All @@ -65,13 +65,13 @@ const {
/>
</form-item>
<form-item
v-bind="formData.salaryRange"
v-bind="formInfoData.salaryRange"
v-model:enable="formData.salaryRange.enable"
>
<el-input v-model="formData.salaryRange.value" style="width: 240px" />
</form-item>
<form-item
v-bind="formData.companySizeRange"
v-bind="formInfoData.companySizeRange"
v-model:enable="formData.companySizeRange.enable"
>
<el-input
Expand All @@ -81,7 +81,7 @@ const {
</form-item>

<form-item
v-bind="formData.customGreeting"
v-bind="formInfoData.customGreeting"
v-model:enable="formData.customGreeting.enable"
>
<el-input
Expand Down
2 changes: 2 additions & 0 deletions src/pages/web/geek/job/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const CompanySizeError = createCustomError("公司规模筛选");
export type CompanySizeError = InstanceType<typeof CompanySizeError>;
export const JobDescriptionError = createCustomError("工作内容筛选");
export type JobDescriptionError = InstanceType<typeof JobDescriptionError>;
export const AIFilteringError = createCustomError("AI筛选");
export type AIFilteringError = InstanceType<typeof AIFilteringError>;
export const ActivityError = createCustomError("活跃度过滤");
export type ActivityError = InstanceType<typeof ActivityError>;
export const UnknownError = createCustomError("未知错误", "danger");
Expand Down
Loading

0 comments on commit ca5b612

Please sign in to comment.