| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'locationRequired', |
| | | label: '定位打卡', |
| | | component: 'Switch', |
| | | defaultValue: false, |
| | | componentProps: { |
| | | checkedChildren: '启用', |
| | | unCheckedChildren: '关闭', |
| | | }, |
| | | help: '启用后,员工打卡必须在下方设定地点的允许半径内', |
| | | }, |
| | | { |
| | | fieldName: 'locationName', |
| | | label: '打卡地点', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '例如:新高电力厂区', |
| | | maxlength: 100, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationRequired'], |
| | | show: (values) => Boolean(values.locationRequired), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'locationAddress', |
| | | label: '地点地址', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入详细地址,便于员工识别', |
| | | maxlength: 255, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationRequired'], |
| | | show: (values) => Boolean(values.locationRequired), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'longitude', |
| | | label: '经度(WGS84)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | placeholder: '地图选点后自动填充', |
| | | min: -180, |
| | | max: 180, |
| | | precision: 7, |
| | | style: { width: '100%' }, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationRequired'], |
| | | show: (values) => Boolean(values.locationRequired), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'latitude', |
| | | label: '纬度(WGS84)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | placeholder: '地图选点后自动填充', |
| | | min: -90, |
| | | max: 90, |
| | | precision: 7, |
| | | style: { width: '100%' }, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationRequired'], |
| | | show: (values) => Boolean(values.locationRequired), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'radiusMeters', |
| | | label: '打卡半径(米)', |
| | | component: 'InputNumber', |
| | | defaultValue: 10, |
| | | componentProps: { |
| | | min: 10, |
| | | max: 5000, |
| | | precision: 0, |
| | | style: { width: '100%' }, |
| | | }, |
| | | help: '允许范围 10~5000 米,实际精度取决于手机 GPS 与环境', |
| | | dependencies: { |
| | | triggerFields: ['locationRequired'], |
| | | show: (values) => Boolean(values.locationRequired), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'coordinateSystem', |
| | | component: 'Input', |
| | | defaultValue: 'WGS84', |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => false, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'status', |
| | | label: '状态', |
| | | component: 'RadioGroup', |
| | |
| | | `${row.effectiveStartDate || '不限'} ~ ${row.effectiveEndDate || '不限'}`, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '打卡范围', |
| | | minWidth: 180, |
| | | formatter: ({ row }) => |
| | | row.locationRequired |
| | | ? `${row.locationName || '-'}(${row.radiusMeters ?? 0}米)` |
| | | : '不限制位置', |
| | | }, |
| | | { |
| | | field: 'status', |
| | | title: '状态', |
| | | width: 80, |