Compare commits

..

No commits in common. "feae80d0f8107febb134676ba60d7289d5185b2a" and "a42d974f7ad343f72b0bd8a7fffff84eff7d4e5c" have entirely different histories.

1 changed files with 41 additions and 36 deletions

View File

@ -10,6 +10,7 @@ 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';
// 修改函数类型定义 // 修改函数类型定义
@ -151,6 +152,7 @@ export default function StaffTable() {
{ {
field: 'username', field: 'username',
headerName: '姓名', headerName: '姓名',
minWidth: 120,
pinned: 'left', pinned: 'left',
// floatingFilter: true // 确保启用浮动过滤器 // floatingFilter: true // 确保启用浮动过滤器
}, },
@ -160,16 +162,18 @@ export default function StaffTable() {
{ {
field: 'idNumber', field: 'idNumber',
headerName: '身份证号', headerName: '身份证号',
minWidth: 180,
}, },
{ {
field: 'type', field: 'type',
headerName: '人员类型', headerName: '人员类型',
minWidth: 120,
}, },
{ field: 'officerId', headerName: '警号'}, { field: 'officerId', headerName: '警号', minWidth: 120 },
{ field: 'phoneNumber', headerName: '手机号' }, { field: 'phoneNumber', headerName: '手机号', minWidth: 130 },
{ field: 'age', headerName: '年龄'}, { field: 'age', headerName: '年龄', minWidth: 80 },
{ {
field: 'sex', headerName: '性别', field: 'sex', headerName: '性别', minWidth: 80,
cellRenderer: (params: any) => { cellRenderer: (params: any) => {
switch (params.value) { switch (params.value) {
case true: case true:
@ -182,57 +186,58 @@ export default function StaffTable() {
} }
}, },
{ field: 'bloodType', headerName: '血型',}, { field: 'bloodType', headerName: '血型', minWidth: 80 },
{ {
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: '来源'}, { field: 'source', headerName: '来源', minWidth: 120 },
] ]
}, },
{ {
headerName: '政治信息', headerName: '政治信息',
children: [ children: [
{ field: 'politicalStatus', headerName: '政治面貌', }, { field: 'politicalStatus', headerName: '政治面貌', minWidth: 150 },
{ field: 'partyPosition', headerName: '党内职务', } { field: 'partyPosition', headerName: '党内职务', minWidth: 120 }
] ]
}, },
{ {
headerName: '职务信息', headerName: '职务信息',
children: [ children: [
{ field: 'department.name', headerName: '所属部门', }, { field: 'department.name', headerName: '所属部门', minWidth: 200 },
{ field: 'rank', headerName: '衔职级别', }, { field: 'rank', headerName: '衔职级别', minWidth: 120 },
{ {
field: 'rankDate', headerName: '衔职时间', field: 'rankDate', headerName: '衔职时间', minWidth: 120,
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ field: 'proxyPosition', headerName: '代理职务', }, { field: 'proxyPosition', headerName: '代理职务', minWidth: 120 },
{ field: 'post', headerName: '岗位', } { field: 'post', headerName: '岗位', minWidth: 120 }
] ]
}, },
{ {
headerName: '入职信息', headerName: '入职信息',
children: [ children: [
{ {
field: 'hireDate', headerName: '入职时间', field: 'hireDate', headerName: '入职时间', minWidth: 120,
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ {
field: 'seniority', headerName: '工龄认定时间', field: 'seniority', headerName: '工龄认定时间', minWidth: 140,
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
}, },
{ field: 'sourceType', headerName: '来源类型', }, { field: 'sourceType', headerName: '来源类型', minWidth: 120 },
{ {
field: 'isReentry', headerName: '是否二次入职', field: 'isReentry', headerName: '是否二次入职', minWidth: 120,
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ {
field: 'isExtended', headerName: '是否延期服役', field: 'isExtended', headerName: '是否延期服役', minWidth: 120,
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ {
field: 'currentPositionDate', headerName: '现岗位开始时间', field: 'currentPositionDate', headerName: '现岗位开始时间', minWidth: 140,
valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : '' valueFormatter: (params: any) => params.value ? new Date(params.value).toLocaleDateString() : ''
} }
] ]
@ -240,24 +245,24 @@ export default function StaffTable() {
{ {
headerName: '教育背景', headerName: '教育背景',
children: [ children: [
{ field: 'education', headerName: '学历', }, { field: 'education', headerName: '学历', minWidth: 100 },
{ field: 'educationType', headerName: '学历形式', }, { field: 'educationType', headerName: '学历形式', minWidth: 120 },
{ {
field: 'isGraduated', headerName: '是否毕业', field: 'isGraduated', headerName: '是否毕业', minWidth: 100,
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
}, },
{ field: 'major', headerName: '专业', }, { field: 'major', headerName: '专业', minWidth: 150 },
{ field: 'foreignLang', headerName: '外语能力', } { field: 'foreignLang', headerName: '外语能力', minWidth: 120 }
] ]
}, },
{ {
headerName: '培训信息', headerName: '培训信息',
children: [ children: [
{ field: 'trainType', headerName: '培训类型', }, { field: 'trainType', headerName: '培训类型', minWidth: 120 },
{ field: 'trainInstitute', headerName: '培训机构', }, { field: 'trainInstitute', headerName: '培训机构', minWidth: 150 },
{ field: 'trainMajor', headerName: '培训专业', }, { field: 'trainMajor', headerName: '培训专业', minWidth: 150 },
{ {
field: 'hasTrain', headerName: '是否参加培训', field: 'hasTrain', headerName: '是否参加培训', minWidth: 120,
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
} }
] ]
@ -265,10 +270,10 @@ export default function StaffTable() {
{ {
headerName: '鉴定信息', headerName: '鉴定信息',
children: [ children: [
{ field: 'certRank', headerName: '鉴定等级', }, { field: 'certRank', headerName: '鉴定等级', minWidth: 120 },
{ field: 'certWork', headerName: '鉴定工种', }, { field: 'certWork', headerName: '鉴定工种', minWidth: 120 },
{ {
field: 'hasCert', headerName: '是否参加鉴定', field: 'hasCert', headerName: '是否参加鉴定', minWidth: 120,
cellRenderer: (params: any) => params.value ? '是' : '否' cellRenderer: (params: any) => params.value ? '是' : '否'
} }
] ]
@ -279,7 +284,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' }}
@ -291,7 +296,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' }}
@ -304,7 +309,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' }}
@ -316,7 +321,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' }}
@ -335,7 +340,7 @@ export default function StaffTable() {
filter: 'agSetColumnFilter', filter: 'agSetColumnFilter',
resizable: false, resizable: false,
flex: 1, flex: 1,
minWidth: 200, minWidth: 150,
maxWidth: 600, maxWidth: 600,
suppressMovable: true, suppressMovable: true,
cellStyle: { cellStyle: {