This commit is contained in:
linfeng 2025-03-25 13:06:56 +08:00
parent fdb3e1a163
commit ba9a7d9fe0
1 changed files with 36 additions and 41 deletions

View File

@ -10,7 +10,6 @@ import type { CascaderProps } from 'antd/es/cascader';
import { utils, writeFile, read } from 'xlsx'; import { utils, writeFile, read } from 'xlsx';
import { Modal, Input, Button, Switch, Upload, message } from 'antd'; import { Modal, Input, Button, Switch, Upload, message } from 'antd';
import { api } from '@nice/client'; import { api } from '@nice/client';
import DepartmentSelect from '@web/src/components/models/department/department-select';
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model'; import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
import { UploadOutlined } from '@ant-design/icons'; import { UploadOutlined } from '@ant-design/icons';
// 修改函数类型定义 // 修改函数类型定义
@ -152,7 +151,6 @@ export default function StaffTable() {
{ {
field: 'username', field: 'username',
headerName: '姓名', headerName: '姓名',
minWidth: 120,
pinned: 'left', pinned: 'left',
// floatingFilter: true // 确保启用浮动过滤器 // floatingFilter: true // 确保启用浮动过滤器
}, },
@ -162,18 +160,16 @@ export default function StaffTable() {
{ {
field: 'idNumber', field: 'idNumber',
headerName: '身份证号', headerName: '身份证号',
minWidth: 180,
}, },
{ {
field: 'type', field: 'type',
headerName: '人员类型', headerName: '人员类型',
minWidth: 120,
}, },
{ field: 'officerId', headerName: '警号', minWidth: 120 }, { field: 'officerId', headerName: '警号'},
{ field: 'phoneNumber', headerName: '手机号', minWidth: 130 }, { field: 'phoneNumber', headerName: '手机号' },
{ field: 'age', headerName: '年龄', minWidth: 80 }, { field: 'age', headerName: '年龄'},
{ {
field: 'sex', headerName: '性别', minWidth: 80, field: 'sex', headerName: '性别',
cellRenderer: (params: any) => { cellRenderer: (params: any) => {
switch (params.value) { switch (params.value) {
case true: case true:
@ -186,58 +182,57 @@ export default function StaffTable() {
} }
}, },
{ field: 'bloodType', headerName: '血型', minWidth: 80 }, { field: 'bloodType', headerName: '血型',},
{ {
field: 'birthplace', field: 'birthplace',
headerName: '籍贯', headerName: '籍贯',
minWidth: 200,
valueFormatter: (params) => params.value ? getAreaName(params.value.split('/')) : '', valueFormatter: (params) => params.value ? getAreaName(params.value.split('/')) : '',
}, },
{ field: 'source', headerName: '来源', minWidth: 120 }, { field: 'source', headerName: '来源'},
] ]
}, },
{ {
headerName: '政治信息', headerName: '政治信息',
children: [ children: [
{ field: 'politicalStatus', headerName: '政治面貌', minWidth: 150 }, { field: 'politicalStatus', headerName: '政治面貌', },
{ field: 'partyPosition', headerName: '党内职务', minWidth: 120 } { field: 'partyPosition', headerName: '党内职务', }
] ]
}, },
{ {
headerName: '职务信息', headerName: '职务信息',
children: [ children: [
{ field: 'department.name', headerName: '所属部门', minWidth: 200 }, { field: 'department.name', headerName: '所属部门', },
{ field: 'rank', headerName: '衔职级别', minWidth: 120 }, { field: 'rank', headerName: '衔职级别', },
{ {
field: 'rankDate', headerName: '衔职时间', minWidth: 120, field: 'rankDate', headerName: '衔职时间',
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ field: 'proxyPosition', headerName: '代理职务', minWidth: 120 }, { field: 'proxyPosition', headerName: '代理职务', },
{ field: 'post', headerName: '岗位', minWidth: 120 } { field: 'post', headerName: '岗位', }
] ]
}, },
{ {
headerName: '入职信息', headerName: '入职信息',
children: [ children: [
{ {
field: 'hireDate', headerName: '入职时间', minWidth: 120, field: 'hireDate', headerName: '入职时间',
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ {
field: 'seniority', headerName: '工龄认定时间', minWidth: 140, field: 'seniority', headerName: '工龄认定时间',
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ field: 'sourceType', headerName: '来源类型', minWidth: 120 }, { field: 'sourceType', headerName: '来源类型', },
{ {
field: 'isReentry', headerName: '是否二次入职', minWidth: 120, field: 'isReentry', headerName: '是否二次入职',
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ {
field: 'isExtended', headerName: '是否延期服役', minWidth: 120, field: 'isExtended', headerName: '是否延期服役',
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ {
field: 'currentPositionDate', headerName: '现岗位开始时间', minWidth: 140, field: 'currentPositionDate', headerName: '现岗位开始时间',
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
} }
] ]
@ -245,24 +240,24 @@ export default function StaffTable() {
{ {
headerName: '教育背景', headerName: '教育背景',
children: [ children: [
{ field: 'education', headerName: '学历', minWidth: 100 }, { field: 'education', headerName: '学历', },
{ field: 'educationType', headerName: '学历形式', minWidth: 120 }, { field: 'educationType', headerName: '学历形式', },
{ {
field: 'isGraduated', headerName: '是否毕业', minWidth: 100, field: 'isGraduated', headerName: '是否毕业',
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ field: 'major', headerName: '专业', minWidth: 150 }, { field: 'major', headerName: '专业', },
{ field: 'foreignLang', headerName: '外语能力', minWidth: 120 } { field: 'foreignLang', headerName: '外语能力', }
] ]
}, },
{ {
headerName: '培训信息', headerName: '培训信息',
children: [ children: [
{ field: 'trainType', headerName: '培训类型', minWidth: 120 }, { field: 'trainType', headerName: '培训类型', },
{ field: 'trainInstitute', headerName: '培训机构', minWidth: 150 }, { field: 'trainInstitute', headerName: '培训机构', },
{ field: 'trainMajor', headerName: '培训专业', minWidth: 150 }, { field: 'trainMajor', headerName: '培训专业', },
{ {
field: 'hasTrain', headerName: '是否参加培训', minWidth: 120, field: 'hasTrain', headerName: '是否参加培训',
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
} }
] ]
@ -270,10 +265,10 @@ export default function StaffTable() {
{ {
headerName: '鉴定信息', headerName: '鉴定信息',
children: [ children: [
{ field: 'certRank', headerName: '鉴定等级', minWidth: 120 }, { field: 'certRank', headerName: '鉴定等级', },
{ field: 'certWork', headerName: '鉴定工种', minWidth: 120 }, { field: 'certWork', headerName: '鉴定工种', },
{ {
field: 'hasCert', headerName: '是否参加鉴定', minWidth: 120, field: 'hasCert', headerName: '是否参加鉴定',
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
} }
] ]
@ -284,7 +279,7 @@ export default function StaffTable() {
{ {
field: 'equipment', field: 'equipment',
headerName: '操作维护装备', headerName: '操作维护装备',
minWidth: 150,
cellRenderer: (params: any) => ( cellRenderer: (params: any) => (
<div <div
style={{ lineHeight: '24px' }} style={{ lineHeight: '24px' }}
@ -296,7 +291,7 @@ export default function StaffTable() {
{ {
field: 'projects', field: 'projects',
headerName: '演训任务经历', headerName: '演训任务经历',
minWidth: 150,
cellRenderer: (params: any) => ( cellRenderer: (params: any) => (
<div <div
style={{ lineHeight: '24px' }} style={{ lineHeight: '24px' }}
@ -309,7 +304,7 @@ export default function StaffTable() {
{ {
field: 'awards', field: 'awards',
headerName: '奖励信息', headerName: '奖励信息',
minWidth: 150,
cellRenderer: (params: any) => ( cellRenderer: (params: any) => (
<div <div
style={{ lineHeight: '24px' }} style={{ lineHeight: '24px' }}
@ -321,7 +316,7 @@ export default function StaffTable() {
{ {
field: 'punishments', field: 'punishments',
headerName: '处分信息', headerName: '处分信息',
minWidth: 150,
cellRenderer: (params: any) => ( cellRenderer: (params: any) => (
<div <div
style={{ lineHeight: '24px' }} style={{ lineHeight: '24px' }}
@ -340,7 +335,7 @@ export default function StaffTable() {
filter: 'agSetColumnFilter', filter: 'agSetColumnFilter',
resizable: false, resizable: false,
flex: 1, flex: 1,
minWidth: 150, minWidth: 200,
maxWidth: 600, maxWidth: 600,
suppressMovable: true, suppressMovable: true,
cellStyle: { cellStyle: {