personnelConfig.data.ts
3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Form/index';
// 动态生成年份选项
const generateYearOptions = () => {
const currentYear = new Date().getFullYear();
const years: { label: string; value: string }[] = [];
for (let i = -2; i <= 5; i++) {
const year = currentYear + i;
years.push({
label: `${year}年`,
value: year.toString(),
});
}
return years;
};
// 常量定义
const yearOptions = generateYearOptions();
const monthOptions = [
{ label: '1月', value: '1' },
{ label: '2月', value: '2' },
{ label: '3月', value: '3' },
{ label: '4月', value: '4' },
{ label: '5月', value: '5' },
{ label: '6月', value: '6' },
{ label: '7月', value: '7' },
{ label: '8月', value: '8' },
{ label: '9月', value: '9' },
{ label: '10月', value: '10' },
{ label: '11月', value: '11' },
{ label: '12月', value: '12' },
];
export const columns: BasicColumn[] = [
{
title: '年份',
dataIndex: 'year',
width: 100,
align: 'center',
},
{
title: '月份',
dataIndex: 'month',
width: 100,
align: 'center',
},
{
title: '日历天数',
dataIndex: 'calendarDays',
width: 120,
align: 'center',
},
{
title: '工作日',
dataIndex: 'workDays',
width: 100,
align: 'center',
},
{
title: '计薪日',
dataIndex: 'salaryDays',
width: 100,
align: 'center',
},
{
title: '法定日',
dataIndex: 'legalHolidays',
width: 100,
align: 'center',
}
];
export const searchFormSchema: FormSchema[] = [
{
field: 'settingValue',
label: '年份',
component: 'Select',
componentProps: {
options: yearOptions,
},
defaultValue: new Date().getFullYear().toString(),
colProps: { span: 6 },
},
{
field: 'settingType',
label: '',
component: 'Input',
defaultValue: '60',
show: false,
},
{
field: 'month',
label: '月份',
component: 'Select',
componentProps: {
options: monthOptions,
},
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{
field: 'year',
label: '年份',
required: true,
component: 'Select',
componentProps: {
options: yearOptions,
},
},
{
field: 'month',
label: '月份',
required: true,
component: 'Select',
componentProps: {
options: monthOptions,
},
},
{
field: 'calendarDays',
label: '日历天数',
required: true,
component: 'InputNumber',
componentProps: {
min: 28,
max: 31,
style: {
width: '100%',
},
},
},
{
field: 'workDays',
label: '工作日',
required: true,
component: 'InputNumber',
componentProps: {
min: 0,
max: 31,
style: {
width: '100%',
},
},
},
{
field: 'salaryDays',
label: '计薪日',
required: true,
component: 'InputNumber',
componentProps: {
min: 0,
max: 31,
style: {
width: '100%',
},
},
},
{
field: 'legalHolidays',
label: '法定日',
required: true,
component: 'InputNumber',
componentProps: {
min: 0,
max: 31,
style: {
width: '100%',
},
},
},
];