|
@@ -1,14 +1,13 @@
|
|
import React, { useState, useEffect } from 'react'
|
|
import React, { useState, useEffect } from 'react'
|
|
-import AttendanceMenu from '../Attendance/components/AttendanceMenu/attendanceMenu'
|
|
|
|
|
|
+import AttendanceMenu from './components/AttendanceMenu/attendanceMenu'
|
|
import { useRequest } from 'umi'
|
|
import { useRequest } from 'umi'
|
|
import Icon from '@/components/IconPark'
|
|
import Icon from '@/components/IconPark'
|
|
import ConnectModal from '@/pages/Role/System/components/ConnectModal'
|
|
import ConnectModal from '@/pages/Role/System/components/ConnectModal'
|
|
-import { Table,Tag,Popconfirm } from 'antd'
|
|
|
|
|
|
+import { Table,Tag } from 'antd'
|
|
import {
|
|
import {
|
|
fetchAttendanceList,
|
|
fetchAttendanceList,
|
|
deleteAttendance
|
|
deleteAttendance
|
|
} from '@/services/user/system'
|
|
} from '@/services/user/system'
|
|
-import Item from 'antd/lib/list/Item'
|
|
|
|
|
|
|
|
const Attendance = () => {
|
|
const Attendance = () => {
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
@@ -23,11 +22,11 @@ const Attendance = () => {
|
|
})
|
|
})
|
|
|
|
|
|
const { run: trydeleteAttendance } = useRequest(
|
|
const { run: trydeleteAttendance } = useRequest(
|
|
- (id: string) => {
|
|
|
|
- return deleteAttendance({ id })
|
|
|
|
|
|
+ (params: API.DeleteAttendance) => {
|
|
|
|
+ return deleteAttendance(params)
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- manual: false,
|
|
|
|
|
|
+ manual: true,
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
tryGetRoleStaffList(state.id)
|
|
tryGetRoleStaffList(state.id)
|
|
}
|
|
}
|
|
@@ -43,7 +42,7 @@ const Attendance = () => {
|
|
}
|
|
}
|
|
}, [state.id])
|
|
}, [state.id])
|
|
|
|
|
|
- const columns = [
|
|
|
|
|
|
+ const columns: ColumnsType<API.AttendanceItem> = [
|
|
{
|
|
{
|
|
title: '申请人名称',
|
|
title: '申请人名称',
|
|
dataIndex: 'applicantStaffName',
|
|
dataIndex: 'applicantStaffName',
|
|
@@ -53,20 +52,13 @@ const Attendance = () => {
|
|
title: '申请对象',
|
|
title: '申请对象',
|
|
dataIndex: 'staff',
|
|
dataIndex: 'staff',
|
|
align: 'left',
|
|
align: 'left',
|
|
- width: '60%',
|
|
|
|
|
|
+ width: '70%',
|
|
render: (_,record) => (
|
|
render: (_,record) => (
|
|
<>
|
|
<>
|
|
- {record.staff.map((item, index) => (
|
|
|
|
|
|
+ {record.staff.map((item) => (
|
|
// console.log(item.staffName)
|
|
// console.log(item.staffName)
|
|
- <span key={index} className="zh-mg-bottom-5 zh-block">
|
|
|
|
- <Tag closable={()=>trydeleteAttendance(item.staffId)}>{item.staffName}</Tag>
|
|
|
|
- {/* <Popconfirm
|
|
|
|
- title="确认删除吗?"
|
|
|
|
- okText="确认"
|
|
|
|
- cancelText="取消"
|
|
|
|
- onConfirm={() => trydeleteAttendance(item.id)}>
|
|
|
|
- <Tag closable="trydeleteAttendance">{item.staffName}</Tag>
|
|
|
|
- </Popconfirm> */}
|
|
|
|
|
|
+ <span key={item.staffId} className="zh-mg-bottom-5 zh-block">
|
|
|
|
+ <Tag closable={true} onClose={() => trydeleteAttendance(item.staffId,record.id )}>{item.staffName}</Tag>
|
|
</span>
|
|
</span>
|
|
))}
|
|
))}
|
|
<span className="hover:text-hex-886ab5 cursor-pointer text-purple-500">
|
|
<span className="hover:text-hex-886ab5 cursor-pointer text-purple-500">
|
|
@@ -78,7 +70,7 @@ const Attendance = () => {
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'opreate',
|
|
dataIndex: 'opreate',
|
|
- width: '20%',
|
|
|
|
|
|
+ width: '10%',
|
|
render: () => (
|
|
render: () => (
|
|
<span className="hover:text-hex-e7026e cursor-pointer">
|
|
<span className="hover:text-hex-e7026e cursor-pointer">
|
|
<Icon type="delete" fill="#fd3995" />
|
|
<Icon type="delete" fill="#fd3995" />
|