| | |
| | | }); |
| | | const userInfo = { userName: data.name }; |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)); |
| | | let permissionList: any[] = [ |
| | | "/work_order_transaction_management/work_order_item_configuration", |
| | | "/work_order_transaction_management", |
| | | "/system_setting/role_management/edit", |
| | | "/work_order_transaction_management/banner_management", |
| | | "/work_order_transaction_management/banner_management/del", |
| | | "/system_setting/position_management/add", |
| | | "/message_notification/mark_read", |
| | | "/system_setting/role_management", |
| | | "/system_setting/unit_management/del", |
| | | "/system_setting/people_management/freeze", |
| | | "/work_order_transaction_management/problem_type_management", |
| | | "/system_setting/position_management/edit", |
| | | "/system_setting/people_management/del", |
| | | "/work_order_transaction_management/problem_type_management/edit", |
| | | "/position_management/del", |
| | | "/system_setting/unit_management/edit", |
| | | "/system_setting/people_management/edit", |
| | | "/work_order_transaction_management/problem_type_management/add", |
| | | "/system_setting/unit_management/add", |
| | | "/system_setting/people_management/detail", |
| | | "/system_setting/role_management/detail", |
| | | "/system_setting/unit_management", |
| | | "/message_notification", |
| | | "/system_setting/role_management/add", |
| | | "/work_order_transaction_management/banner_management/edit", |
| | | "/system_setting/role_management/del", |
| | | "/work_order_transaction_management/problem_type_management/del", |
| | | "/system_setting/people_management/add", |
| | | "/work_order_transaction_management/banner_management/add", |
| | | "/system_setting/position_management", |
| | | "/system_setting", |
| | | "/system_setting/people_management", |
| | | "/work_order_transaction_management/work_order_item_configuration/save", |
| | | ]; |
| | | let accessObj: any = {}; |
| | | data.menu.map((item) => { |
| | | accessObj[item] = true |
| | | permissionList.map((item) => { |
| | | if (JSON.stringify(data.menu) === JSON.stringify(['*:*:*'])) { |
| | | accessObj[item] = true; |
| | | } else { |
| | | accessObj[item] = data.menu.includes(item); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | setInitialState((s: any) => ({ |
| | | ...s, |
| | |
| | | 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); |
| | | }} |
| | | > |
| | |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | </Card> |
| | | <Access accessible={access['/work_order_transaction_management/work_order_item_configuration/save'] || false}> |
| | | <Access accessible={access['/work_order_transaction_management/work_order_item_configuration/save']}> |
| | | <div style={{ marginTop: 20, display: 'flex', justifyContent: 'center' }}> |
| | | <Button type="primary" htmlType="submit" style={{ marginRight: 20 }} onClick={() => {save()}} > |
| | | 保存 |