| | |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm,showConfirm } from '@/utils/antdUtils'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm, showConfirm } from '@/utils/antdUtils'; |
| | | import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { PageContainer, ProFormText, ProTable, QueryFilter } from '@ant-design/pro-components'; |
| | | import { Button, Cascader, Col, Menu, Row, Select, Space } from 'antd'; |
| | |
| | | <span>{item.name}</span> |
| | | <div> |
| | | {item.tier < 4 && ( |
| | | <PlusOutlined |
| | | <Access accessible={access['/system_setting/unit_management/add']}> |
| | | <PlusOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | addViewRef1.current.refreshData({ ...item, type: 'add' }); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | /> |
| | | </Access> |
| | | )} |
| | | <Access accessible={access['/system_setting/unit_management/edit']}> |
| | | <EditOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | addViewRef1.current.refreshData({ ...item, type: 'add' }); |
| | | addViewRef1.current.refreshData({ ...item, type: 'edit' }); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | /> |
| | | )} |
| | | <EditOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | addViewRef1.current.refreshData({ ...item, type: 'edit' }); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | /> |
| | | <DeleteOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(delUnit, item.id); |
| | | if (status) { |
| | | fetchUnit(); |
| | | } |
| | | }, '确认删除该单位吗?'); |
| | | }} |
| | | /> |
| | | </Access> |
| | | <Access accessible={access['/system_setting/unit_management/del']}> |
| | | <DeleteOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(delUnit, item.id); |
| | | if (status) { |
| | | fetchUnit(); |
| | | } |
| | | }, '确认删除该单位吗?'); |
| | | }} |
| | | /> |
| | | </Access> |
| | | </div> |
| | | </div> |
| | | </div > |
| | | ); |
| | | }; |
| | | const renderMenuItems = (items) => { |
| | |
| | | <Access accessible={access['/system_setting/people_management/edit']}> |
| | | <a |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({...record,type:'edit'}); |
| | | addViewRef.current.refreshData({ ...record, type: 'edit' }); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |
| | |
| | | <Access accessible={access['/system_setting/people_management/detail']}> |
| | | <a |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({...record,type:'detail'}); |
| | | addViewRef.current.refreshData({ ...record, type: 'detail' }); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |
| | |
| | | <Access accessible={access['/system_setting/people_management/freeze']}> |
| | | <a |
| | | onClick={() => { |
| | | showConfirm(`确认${record.status === 1 ? '冻结' : '解冻'}该人员吗?`,async () => { |
| | | showConfirm(`确认${record.status === 1 ? '冻结' : '解冻'}该人员吗?`, async () => { |
| | | let status = await sendRequest( |
| | | record.status === 1 ? freezeApi : unfreezeApi, |
| | | record.id, |
| | |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({type:'add'}); |
| | | addViewRef.current.refreshData({ type: 'add' }); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |