| | |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { PageContainer, ProFormText, ProTable, QueryFilter } from '@ant-design/pro-components'; |
| | | import { Button, Col, Row, Menu ,Space } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { Button, Col, Menu, Row, Space } from 'antd'; |
| | | import { useEffect, useRef, useState } from 'react'; |
| | | import { Access, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/addAndEdit'; |
| | | import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons'; |
| | | import { add, del, edit, getList } from './service'; |
| | | import { add, del, edit, getList, getUnitList } from './service'; |
| | | |
| | | const Role = () => { |
| | | const actionRef = useRef(); |
| | | const addViewRef = useRef(); |
| | | const [modalVisible, handleModalVisibles] = useState(false); |
| | | const access = useAccess(); |
| | | useEffect(() => { |
| | | getUnitList().then((res) => { |
| | | console.log(res); |
| | | }); |
| | | }, []); |
| | | const items = [ |
| | | { |
| | | key: '1', |
| | | icon: <MailOutlined />, |
| | | label: 'Navigation One', |
| | | icon: ( |
| | | <div |
| | | style={{ |
| | | display: 'flex', |
| | | alignItems: 'center', |
| | | justifyContent: 'space-between', |
| | | width: '100%', |
| | | }} |
| | | > |
| | | <span>组织部</span> |
| | | <div> |
| | | <PlusOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | }} |
| | | /> |
| | | <EditOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | }} |
| | | /> |
| | | <DeleteOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | }} |
| | | /> |
| | | </div> |
| | | </div> |
| | | ), |
| | | children: [ |
| | | { |
| | | key: '11', |
| | |
| | | }, |
| | | { |
| | | key: '14', |
| | | label: 'Option 4', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | key: '2', |
| | | icon: <AppstoreOutlined />, |
| | | label: 'Navigation Two', |
| | | children: [ |
| | | { |
| | | key: '21', |
| | | label: 'Option 1', |
| | | }, |
| | | { |
| | | key: '22', |
| | | label: 'Option 2', |
| | | }, |
| | | { |
| | | key: '23', |
| | | label: 'Submenu', |
| | | children: [ |
| | | { |
| | | key: '231', |
| | | label: 'Option 1', |
| | | }, |
| | | { |
| | | key: '232', |
| | | label: 'Option 2', |
| | | }, |
| | | { |
| | | key: '233', |
| | | label: 'Option 3', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | key: '24', |
| | | label: 'Submenu 2', |
| | | children: [ |
| | | { |
| | | key: '241', |
| | | label: 'Option 1', |
| | | }, |
| | | { |
| | | key: '242', |
| | | label: 'Option 2', |
| | | }, |
| | | { |
| | | key: '243', |
| | | label: 'Option 3', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | key: '3', |
| | | icon: <SettingOutlined />, |
| | | label: 'Navigation Three', |
| | | children: [ |
| | | { |
| | | key: '31', |
| | | label: 'Option 1', |
| | | }, |
| | | { |
| | | key: '32', |
| | | label: 'Option 2', |
| | | }, |
| | | { |
| | | key: '33', |
| | | label: 'Option 3', |
| | | }, |
| | | { |
| | | key: '34', |
| | | label: 'Option 4', |
| | | }, |
| | | ], |
| | |
| | | mode="inline" |
| | | defaultSelectedKeys={['231']} |
| | | style={{ |
| | | // width: 256, |
| | | // width: 256, |
| | | height: '100%', |
| | | }} |
| | | items={items} |
| | | /> |
| | |
| | | showQuickJumper: true, |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => buildProTableDataSource(getList, params)} |
| | | // request={(params) => buildProTableDataSource(getList, params)} |
| | | toolBarRender={(action, selectRows) => [ |
| | | <Access accessible={access['/system_setting/role_management/add']}> |
| | | <Space> |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 单位列表 |
| | | export const getUnitList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/department/list`, { |
| | | method: 'GET', |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // 编辑获取角色权限树 |
| | | export const getTree = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemRole/getSystemRoleInfo/${id}`, { |