This commit is contained in:
parent
91a40abb73
commit
116b567194
|
|
@ -1,3 +1,4 @@
|
|||
import { useStore } from "@/store";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
|
||||
|
|
@ -14,34 +15,46 @@ type Data = {
|
|||
}
|
||||
|
||||
export default function JobPage({ data }: { data: Data }) {
|
||||
const appConfig = useStore((s) => s.appConfig);
|
||||
const {
|
||||
jobType = "职位类别",
|
||||
businessArea = "业务领域",
|
||||
businessPlate = "所属板块",
|
||||
recruitNumber = "招聘人数",
|
||||
jobLocation = "工作地点",
|
||||
jobDescription = "岗位描述",
|
||||
requirement = "任职需求",
|
||||
contact = "联系方式",
|
||||
} = appConfig?.join?.campus.others || {};
|
||||
const { back = "返回" } = appConfig?.__global__?.others
|
||||
return (
|
||||
<div className={styles.jobPage}>
|
||||
<div className={styles.jobPageHeaderLine}>
|
||||
<div className={styles.jobPageHeaderLineBack} onClick={() => window.history.back()}>
|
||||
<img src="/images/icons/icon-arrowleft.png" alt="arrowleft" style={{ width: "1.25rem", height: "1.25rem" }} />
|
||||
<span>返回</span>
|
||||
<span>{back}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.jobPageHeader}>
|
||||
<div className={styles.jobPageHeaderTitle}>{data.title}</div>
|
||||
<div className={styles.jobPageHeaderTimeLine}>
|
||||
<span>职位类别:{data.jobType}</span>
|
||||
<span>业务领域:{data.businessArea}</span>
|
||||
<span>所属板块:{data.businessPlate}</span>
|
||||
<span>招聘人数:{data.recruitNumber}</span>
|
||||
<span>工作地点:{data.jobLocation}</span>
|
||||
<span>{jobType}:{data.jobType}</span>
|
||||
<span>{businessArea}:{data.businessArea}</span>
|
||||
<span>{businessPlate}:{data.businessPlate}</span>
|
||||
<span>{recruitNumber}:{data.recruitNumber}</span>
|
||||
<span>{jobLocation}:{data.jobLocation}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.jobPageContent}>
|
||||
<div className={styles.jobPageContentTitle}>岗位描述</div>
|
||||
<div className={styles.jobPageContentTitle}>{jobDescription}</div>
|
||||
<p className={styles.jobPageContentText} dangerouslySetInnerHTML={{ __html: data.content }}></p>
|
||||
</div>
|
||||
<div className={styles.jobPageContent} style={{ marginTop: "3.125rem" }}>
|
||||
<div className={styles.jobPageContentTitle}>任职需求</div>
|
||||
<div className={styles.jobPageContentTitle}>{requirement}</div>
|
||||
<p className={styles.jobPageContentText} dangerouslySetInnerHTML={{ __html: data.requirement }}></p>
|
||||
</div>
|
||||
<div className={styles.jobPageContent} style={{ marginTop: "3.125rem" }}>
|
||||
<div className={styles.jobPageContentTitle}>联系方式</div>
|
||||
<div className={styles.jobPageContentTitle}>{contact}</div>
|
||||
<p className={styles.jobPageContentText}>{data.contact}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,24 +9,28 @@ import Pagination from "@/components/Pagination";
|
|||
import { Link } from "react-router-dom";
|
||||
import { debounce } from "@/utils";
|
||||
import appApi from "@/api/app";
|
||||
import { LocaleKey } from "@/type";
|
||||
|
||||
type JobItem = {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string;
|
||||
labels: string[];
|
||||
lang: string
|
||||
lang: string;
|
||||
city: string;
|
||||
};
|
||||
|
||||
type SelectOption = { label: string; value: string };
|
||||
|
||||
export default function JoinCampus() {
|
||||
const appConfig = useStore((s) => s.appConfig);
|
||||
const { viewDetail = "查看详情", noData = "暂无数据" } = appConfig?.__global__?.others
|
||||
const i18nData = useStore((s) => s.i18nData);
|
||||
const { viewDetail = "查看详情", noData = "暂无数据", all = "全部" } = appConfig?.__global__?.others
|
||||
const supportLocales = useStore((s) => s.supportLocales);
|
||||
const categoryList = useStore((s) => s.categoryList);
|
||||
const locale = useStore((s) => s.locale);
|
||||
const data = appConfig?.join?.campus;
|
||||
const cityMapList = appConfig?.cityMap.citys;
|
||||
const banner = data?.banner;
|
||||
const others = data?.others;
|
||||
|
||||
|
|
@ -66,6 +70,7 @@ export default function JoinCampus() {
|
|||
content: item.description,
|
||||
labels,
|
||||
lang: item.lang,
|
||||
city: item.city,
|
||||
};
|
||||
});
|
||||
setJobList(items || []);
|
||||
|
|
@ -73,16 +78,20 @@ export default function JoinCampus() {
|
|||
});
|
||||
}, 500), []);
|
||||
|
||||
const getTypes = useCallback(() => {
|
||||
|
||||
const getTypes = useCallback((locale: string) => {
|
||||
const isZh = locale.startsWith('zh');
|
||||
|
||||
const jobTypeOptions: SelectOption[] =
|
||||
categoryList?.filter((item: any) => item.type === 'job_type').map((item: any) => ({ label: item.name, value: String(item.id) })) ?? [];
|
||||
categoryList?.filter((item: any) => item.type === 'job_type').map((item: any) => ({ label: isZh ? item.name : item.name_en, value: String(item.id) })) ?? [];
|
||||
const businessAreaOptions: SelectOption[] =
|
||||
categoryList?.filter((item: any) => item.type === 'job_area').map((item: any) => ({ label: item.name, value: String(item.id) })) ?? [];
|
||||
categoryList?.filter((item: any) => item.type === 'job_area').map((item: any) => ({ label: isZh ? item.name : item.name_en, value: String(item.id) })) ?? [];
|
||||
const businessPlateOptions: SelectOption[] =
|
||||
categoryList?.filter((item: any) => item.type === 'job_unit').map((item: any) => ({ label: item.name, value: String(item.id) })) ?? [];
|
||||
setJobTypeOptions([{ label: '全部', value: '' }, ...jobTypeOptions]);
|
||||
setBusinessAreaOptions([{ label: '全部', value: '' }, ...businessAreaOptions]);
|
||||
setBusinessPlateOptions([{ label: '全部', value: '' }, ...businessPlateOptions]);
|
||||
categoryList?.filter((item: any) => item.type === 'job_unit').map((item: any) => ({ label: isZh ? item.name : item.name_en, value: String(item.id) })) ?? [];
|
||||
const allText = i18nData?.[locale as LocaleKey]?.__global__?.others?.all;
|
||||
setJobTypeOptions([{ label: allText, value: '' }, ...jobTypeOptions]);
|
||||
setBusinessAreaOptions([{ label: allText, value: '' }, ...businessAreaOptions]);
|
||||
setBusinessPlateOptions([{ label: allText, value: '' }, ...businessPlateOptions]);
|
||||
}, [categoryList]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -90,8 +99,8 @@ export default function JoinCampus() {
|
|||
}, [searchValue, jobType, businessArea, businessPlate, page, size]);
|
||||
|
||||
useEffect(() => {
|
||||
getTypes();
|
||||
}, []);
|
||||
getTypes(locale);
|
||||
}, [locale, categoryList]);
|
||||
|
||||
const handleReset = useCallback(() => {
|
||||
setSearchValue('');
|
||||
|
|
@ -140,6 +149,9 @@ export default function JoinCampus() {
|
|||
{item.labels.map((label, index) => (
|
||||
<div key={index} className={styles.jobItemLabel}> • {label}</div>
|
||||
))}
|
||||
• {
|
||||
cityMapList.find((city: any) => city.untranslate_title === item.city)?.showName ?? item.city
|
||||
}
|
||||
</div>
|
||||
<div className={styles.jobItemContent}>{others?.jobDuty ?? "工作职责"}:{item.content}</div>
|
||||
</div></Link>
|
||||
|
|
@ -190,6 +202,8 @@ type SelectFormItemProps = {
|
|||
onChange: (value: string) => void;
|
||||
}
|
||||
function SelectFormItem({ value, options, label, onChange }: SelectFormItemProps) {
|
||||
const appConfig = useStore((s) => s.appConfig);
|
||||
const { noData = "暂无数据", all = "全部" } = appConfig?.__global__?.others
|
||||
const [open, setOpen] = useState(false);
|
||||
const selectId = `select-${label.replace(/\s/g, "-")}`;
|
||||
|
||||
|
|
@ -203,8 +217,8 @@ function SelectFormItem({ value, options, label, onChange }: SelectFormItemProps
|
|||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
showSearch
|
||||
placeholder="全部"
|
||||
notFoundContent="无数据"
|
||||
placeholder={all}
|
||||
notFoundContent={noData}
|
||||
optionFilterProp="label"
|
||||
filterOption={(input, opt) =>
|
||||
(opt?.label ?? "").toString().toLowerCase().includes(input.toLowerCase())
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { Link } from "react-router-dom";
|
|||
import { useStore } from "@/store";
|
||||
import appApi from "@/api/app";
|
||||
import ScrollReveal from "@/components/ScrollReveal";
|
||||
import { dateFormat } from "@/utils";
|
||||
type NewsItem = {
|
||||
id: number;
|
||||
title: string;
|
||||
|
|
@ -33,7 +34,8 @@ export default function NewsPublic() {
|
|||
const videoRefs = useRef<(HTMLVideoElement | null)[]>([]);
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
const handleSearch = useCallback(() => {
|
||||
appApi.getNewsList({ page, size, sort: "create_time DESC", title: searchValue,
|
||||
appApi.getNewsList({
|
||||
page, size, sort: "create_time DESC", title: searchValue,
|
||||
category_id: categoryId,
|
||||
}).then((res) => {
|
||||
const data = res.data.items.map((item: any) => {
|
||||
|
|
@ -119,7 +121,9 @@ export default function NewsPublic() {
|
|||
)}
|
||||
<div className={styles.newItemContent}>
|
||||
<div className={styles.newItemTitle}>{item.title}</div>
|
||||
<div className={styles.newItemCreateTime}>{item.createTime}</div>
|
||||
<div className={styles.newItemCreateTime}>
|
||||
{dateFormat(item.createTime, "yyyy-MM-dd")}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
</ScrollReveal>
|
||||
|
|
|
|||
|
|
@ -168,7 +168,15 @@ export function parsePageConfig(items: RawPageItem[]): {
|
|||
} catch(err) {
|
||||
console.error('parse topMenuConfig error', err)
|
||||
}
|
||||
console.log('topMenuJson', topMenuJson)
|
||||
|
||||
const cityMapConfig = filtered.find((it) => it.tags === "city-map");
|
||||
let cityMapJson: any = null
|
||||
try {
|
||||
cityMapJson = JSON.parse(cityMapConfig?.content ?? "[]");
|
||||
} catch(err) {
|
||||
console.error('parse cityMapConfig error', err)
|
||||
}
|
||||
|
||||
// const zhNavItems = buildNavItems(menuItems, "ZH", parsedContentMap);
|
||||
// const enNavItems = buildNavItems(menuItems, "EN", parsedContentMap);
|
||||
|
||||
|
|
@ -202,6 +210,8 @@ export function parsePageConfig(items: RawPageItem[]): {
|
|||
|
||||
zhConfig.navItems = topMenuJson.ZH.items;
|
||||
enConfig.navItems = topMenuJson.EN.items;
|
||||
zhConfig.cityMap = cityMapJson.ZH;
|
||||
enConfig.cityMap = cityMapJson.EN;
|
||||
deepFallback(enConfig, zhConfig);
|
||||
|
||||
return { "zh-CN": zhConfig, "en-US": enConfig };
|
||||
|
|
|
|||
Loading…
Reference in New Issue