|
@@ -13,7 +13,6 @@ export enum modalType {
|
|
|
const Attendance: React.FC = () => {
|
|
|
const [state, setState] = useState({
|
|
|
id: '',
|
|
|
- modalId: '',
|
|
|
attendanceList: [],
|
|
|
visible: false,
|
|
|
type: modalType.addobjectModal
|
|
@@ -21,8 +20,6 @@ const Attendance: React.FC = () => {
|
|
|
|
|
|
const { run: tryGetRoleStaffList } = useRequest(fetchAttendanceList, {
|
|
|
onSuccess: result => {
|
|
|
- console.log('result', result)
|
|
|
-
|
|
|
setState({ ...state, attendanceList: result })
|
|
|
}
|
|
|
})
|
|
@@ -62,33 +59,33 @@ const Attendance: React.FC = () => {
|
|
|
dataIndex: 'staff',
|
|
|
align: 'left',
|
|
|
width: '70%',
|
|
|
- render: (_, record: API.AttendanceItem) => (
|
|
|
- <div>
|
|
|
- {record.staff.map(item => (
|
|
|
- // console.log(item.staffName)
|
|
|
- <span key={item.staffId} className="zh-mg-bottom-5 zh-block">
|
|
|
+ render: (_, record: API.AttendanceItem) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {record.staff.map(item => (
|
|
|
<Tag
|
|
|
+ key={item.staffId}
|
|
|
closable={true}
|
|
|
onClose={() => tryunlinkAttendance({ staffId: item.staffId, id: record.id })}>
|
|
|
{item.staffName}
|
|
|
</Tag>
|
|
|
+ ))}
|
|
|
+ <span
|
|
|
+ className="hover:text-hex-886ab5 cursor-pointer text-purple-500"
|
|
|
+ onClick={() =>
|
|
|
+ setState({
|
|
|
+ ...state,
|
|
|
+ id: record.id,
|
|
|
+ visible: true,
|
|
|
+ type: modalType.linkAttendance
|
|
|
+ })
|
|
|
+ }>
|
|
|
+ <Plus />
|
|
|
+ 添加
|
|
|
</span>
|
|
|
- ))}
|
|
|
- <span
|
|
|
- className="hover:text-hex-886ab5 cursor-pointer text-purple-500"
|
|
|
- onClick={() =>
|
|
|
- setState({
|
|
|
- ...state,
|
|
|
- id: record.id,
|
|
|
- visible: true,
|
|
|
- type: modalType.linkAttendance
|
|
|
- })
|
|
|
- }>
|
|
|
- <Plus />
|
|
|
- 添加
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- )
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|