简历详情新增标签展示 统计分析style
This commit is contained in:
@@ -318,6 +318,7 @@ export const request = {
|
||||
try {
|
||||
// 解密响应数据
|
||||
const decryptedData = decrypt(data.encryptedData);
|
||||
// console.log(decryptedData)
|
||||
response.data =
|
||||
typeof decryptedData === 'string' ? JSON.parse(decryptedData) : decryptedData;
|
||||
} catch (error) {
|
||||
|
||||
@@ -57,44 +57,11 @@ export default function AreaStatics({ data }) {
|
||||
style:{
|
||||
columnWidthRatio: 0.4,
|
||||
},
|
||||
color: color,
|
||||
xAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fontSize: 12,
|
||||
fill: '#666',
|
||||
},
|
||||
formatter: (text: string) => {
|
||||
return text.length > 4 ? `${text.substring(0, 4)}...` : text;
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8e8e8',
|
||||
lineWidth: 1,
|
||||
lineDash: [3, 3],
|
||||
},
|
||||
},
|
||||
alignTick: true,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
label: {
|
||||
style: {
|
||||
fontSize: 12,
|
||||
fill: '#666',
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
line: {
|
||||
style: {
|
||||
stroke: '#e8e8e8',
|
||||
lineWidth: 1,
|
||||
lineDash: [3, 3],
|
||||
},
|
||||
},
|
||||
alignTick: true,
|
||||
axis: {
|
||||
x: {
|
||||
labelFontSize:11,
|
||||
labelAutoRotate:true,
|
||||
labelFormatter:(str)=>str.replace('(含)','')
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ModalForm, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Image, Card, Divider, Row, Col, Tag, Timeline, Empty } from 'antd';
|
||||
import { Image, Card, Divider, Row, Col, Tag, Timeline, Empty,Avatar } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
@@ -11,6 +11,35 @@ export type ResumeDetailProps = {
|
||||
values?: any;
|
||||
};
|
||||
|
||||
// 标签颜色
|
||||
const TAG_COLORS = [
|
||||
'magenta',
|
||||
'red',
|
||||
'volcano',
|
||||
'orange',
|
||||
'gold',
|
||||
'lime',
|
||||
'green',
|
||||
'cyan',
|
||||
'blue',
|
||||
'geekblue',
|
||||
'purple',
|
||||
'#f50',
|
||||
'#2db7f5',
|
||||
'#87d068',
|
||||
'#108ee9',
|
||||
];
|
||||
|
||||
// 标签颜色 基于文本hash
|
||||
const getTagColor = (tag: string) => {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < tag.length; i++) {
|
||||
hash = tag.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
const index = Math.abs(hash) % TAG_COLORS.length;
|
||||
return TAG_COLORS[index];
|
||||
};
|
||||
|
||||
const ResumeDetail: React.FC<ResumeDetailProps> = (props) => {
|
||||
const [sexEnum, setSexEnum] = useState<any>([]);
|
||||
const [educationEnum, setEducationEnum] = useState<any>([]);
|
||||
@@ -60,9 +89,49 @@ const ResumeDetail: React.FC<ResumeDetailProps> = (props) => {
|
||||
/>
|
||||
);
|
||||
|
||||
// 渲染标签组
|
||||
const renderTags = () => {
|
||||
const tags = values?.indices || [];
|
||||
|
||||
if (!tags || tags.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
marginTop: 2,
|
||||
padding: '8px 16px',
|
||||
borderRadius: 8,
|
||||
border: '1px dashed #eaeaeaff'
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 , justifyContent:"center" }}>
|
||||
{tags.map((tag: string, index: number) => (
|
||||
<Tag
|
||||
key={index}
|
||||
color={getTagColor(tag)}
|
||||
style={{
|
||||
padding: '4px 12px',
|
||||
fontSize: '13px',
|
||||
fontWeight: 500,
|
||||
borderRadius: 12,
|
||||
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
||||
border: 'none',
|
||||
cursor: 'default',
|
||||
}}
|
||||
>
|
||||
{tag}
|
||||
</Tag>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
title="求职者简历详情"
|
||||
title="人才信息详情"
|
||||
open={props.open}
|
||||
width={1000}
|
||||
modalProps={{
|
||||
@@ -89,35 +158,26 @@ const ResumeDetail: React.FC<ResumeDetailProps> = (props) => {
|
||||
<Col span={6}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{values?.avatar ? (
|
||||
<Image
|
||||
width={100}
|
||||
height={100}
|
||||
<Avatar
|
||||
size={100}
|
||||
src={values.avatar}
|
||||
style={{
|
||||
borderRadius: '50%',
|
||||
marginBottom: 12,
|
||||
border: '2px solid #e8f4fd',
|
||||
border: '4px solid #e8f4fd',
|
||||
}}
|
||||
preview={false}
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
<Avatar
|
||||
size={100}
|
||||
style={{
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: '#1890ff',
|
||||
fontSize: 36,
|
||||
borderRadius: '50%',
|
||||
backgroundColor: '#f0f0f0',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
margin: '0 auto 12px',
|
||||
fontSize: 12,
|
||||
color: '#999',
|
||||
border: '2px solid #e8f4fd',
|
||||
border: '4px solid #e8f4fd',
|
||||
}}
|
||||
>
|
||||
暂无头像
|
||||
</div>
|
||||
{values?.name?.charAt(0) || 'U'}
|
||||
</Avatar>
|
||||
)}
|
||||
<h3 style={{ margin: '8px 0 4px 0', color: '#1890ff' }}>
|
||||
{values?.name || '未填写'}
|
||||
@@ -126,12 +186,15 @@ const ResumeDetail: React.FC<ResumeDetailProps> = (props) => {
|
||||
{values?.jobTitle?.join(' / ') || '暂无期望岗位'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{renderTags()}
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
|
||||
<Col span={18} style={{display:'flex',alignItems:'center'}}>
|
||||
<ProDescriptions
|
||||
column={3}
|
||||
dataSource={values || {}}
|
||||
size="small"
|
||||
size="default"
|
||||
labelStyle={{ fontWeight: 'bold', color: '#333' }}
|
||||
contentStyle={{ color: '#666' }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user