|
@@ -2,12 +2,10 @@ import React, { useState, useEffect } from 'react'
|
|
import AttendanceMenu from './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 { Table,Tag } from 'antd'
|
|
|
|
-import {
|
|
|
|
- fetchAttendanceList,
|
|
|
|
- deleteAttendance
|
|
|
|
-} from '@/services/user/system'
|
|
|
|
|
|
+import AddObjectModal from './components/AddObjectModal'
|
|
|
|
+import ApplicantModal from './components/ApplicantModal'
|
|
|
|
+import { Table, Tag } from 'antd'
|
|
|
|
+import { fetchAttendanceList, deleteAttendance } from '@/services/user/system'
|
|
|
|
|
|
const Attendance = () => {
|
|
const Attendance = () => {
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
@@ -32,7 +30,7 @@ const Attendance = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
)
|
|
)
|
|
-
|
|
|
|
|
|
+
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (state.id) {
|
|
if (state.id) {
|
|
tryGetRoleStaffList(state.id)
|
|
tryGetRoleStaffList(state.id)
|
|
@@ -46,24 +44,26 @@ const Attendance = () => {
|
|
{
|
|
{
|
|
title: '申请人名称',
|
|
title: '申请人名称',
|
|
dataIndex: 'applicantStaffName',
|
|
dataIndex: 'applicantStaffName',
|
|
- width: '10%'
|
|
|
|
|
|
+ width: '15%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '申请对象',
|
|
title: '申请对象',
|
|
dataIndex: 'staff',
|
|
dataIndex: 'staff',
|
|
align: 'left',
|
|
align: 'left',
|
|
width: '70%',
|
|
width: '70%',
|
|
- render: (_,record) => (
|
|
|
|
|
|
+ render: (_, record) => (
|
|
<>
|
|
<>
|
|
- {record.staff.map((item) => (
|
|
|
|
|
|
+ {record.staff.map(item => (
|
|
// console.log(item.staffName)
|
|
// console.log(item.staffName)
|
|
<span key={item.staffId} className="zh-mg-bottom-5 zh-block">
|
|
<span key={item.staffId} className="zh-mg-bottom-5 zh-block">
|
|
- <Tag closable={true} onClose={() => trydeleteAttendance(item.staffId,record.id )}>{item.staffName}</Tag>
|
|
|
|
|
|
+ <Tag
|
|
|
|
+ closable={true}
|
|
|
|
+ onClose={() => trydeleteAttendance({ staffId: item.staffId, id: record.id })}>
|
|
|
|
+ {item.staffName}
|
|
|
|
+ </Tag>
|
|
</span>
|
|
</span>
|
|
))}
|
|
))}
|
|
- <span className="hover:text-hex-886ab5 cursor-pointer text-purple-500">
|
|
|
|
- <Icon type="plus" />添加
|
|
|
|
- </span>
|
|
|
|
|
|
+ <ApplicantModal dataId={record.id} />
|
|
</>
|
|
</>
|
|
)
|
|
)
|
|
},
|
|
},
|
|
@@ -85,10 +85,7 @@ const Attendance = () => {
|
|
<div className="w-max-3/4">
|
|
<div className="w-max-3/4">
|
|
<div className="ml-8 bg-white p-4 shadow-md shadow-hex-3e2c5a relative">
|
|
<div className="ml-8 bg-white p-4 shadow-md shadow-hex-3e2c5a relative">
|
|
<div className="absolute right-7 top-7 z-100">
|
|
<div className="absolute right-7 top-7 z-100">
|
|
- {/* 添加新申请人 */}
|
|
|
|
- <ConnectModal
|
|
|
|
- title="添加新申请人"
|
|
|
|
- />
|
|
|
|
|
|
+ <AddObjectModal title="添加新申请人" />
|
|
</div>
|
|
</div>
|
|
<Table
|
|
<Table
|
|
bordered
|
|
bordered
|
|
@@ -97,7 +94,6 @@ const Attendance = () => {
|
|
dataSource={state.attendanceList}
|
|
dataSource={state.attendanceList}
|
|
rowKey={row => row.id}
|
|
rowKey={row => row.id}
|
|
/>
|
|
/>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|