| | |
| | | const handleScope = async (val) => { |
| | | const hide = message.loading('正在分配'); |
| | | try { |
| | | const resp = await Http.doPost('api/role/scope', val); |
| | | const resp = await Http.doPost('api/role/scope/update', val); |
| | | if (resp.code === 200) { |
| | | message.success('分配成功'); |
| | | return true; |
| | |
| | | actionRef={actionRef} |
| | | setSearchParam={setSearchParam} |
| | | />, |
| | | render: (_, record) => { |
| | | return ( |
| | | <a |
| | | onClick={() => { |
| | | Http.doGetPromise('/api/role/scope/list', { roleId: record.id }, (res) => { |
| | | if (res.data) { |
| | | setMenuIds(res.data); |
| | | } |
| | | setScopeModalVisible(true); |
| | | setCurrentRow(record); |
| | | }); |
| | | }} |
| | | > |
| | | {_} |
| | | </a> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | title: '标识', |
| | |
| | | title: '修改时间', |
| | | dataIndex: 'updateTime$', |
| | | valueType: 'text', |
| | | width: 300, |
| | | filterDropdown: (props) => <DatetimeRangeFilter |
| | | name='updateTime' |
| | | {...props} |
| | |
| | | title: '状态', |
| | | dataIndex: 'status$', |
| | | valueType: 'text', |
| | | width: 160, |
| | | filterDropdown: (props) => <SelectFilter |
| | | name='status' |
| | | {...props} |
| | |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'option', |
| | | width: 140, |
| | | width: 260, |
| | | valueType: 'option', |
| | | render: (_, record) => [ |
| | | <Button |
| | | type="link" |
| | | key="edit" |
| | | onClick={() => { |
| | | setModalVisible(true); |
| | | setCurrentRow(record); |
| | | }} |
| | | > |
| | | 编辑 |
| | | </Button>, |
| | | <Button |
| | | type="link" |
| | | key="scope" |
| | |
| | | }} |
| | | > |
| | | 分配权限 |
| | | </Button>, |
| | | <Button |
| | | type="link" |
| | | key="edit" |
| | | onClick={() => { |
| | | setModalVisible(true); |
| | | setCurrentRow(record); |
| | | }} |
| | | > |
| | | 编辑 |
| | | </Button>, |
| | | <Button |
| | | type="link" |
| | |
| | | formRef={formTableRef} |
| | | columns={columns} |
| | | cardBordered |
| | | scroll={{ x: 1300 }} |
| | | dateFormatter="string" |
| | | pagination={{ pageSize: 20 }} |
| | | search={false} |
| | |
| | | () => { |
| | | setScopeModalVisible(false); |
| | | setCurrentRow(undefined); |
| | | setMenuIds([]); |
| | | } |
| | | } |
| | | onSubmit={async (values) => { |
| | |
| | | if (ok) { |
| | | setScopeModalVisible(false); |
| | | setCurrentRow(undefined); |
| | | setMenuIds([]); |
| | | if (actionRef.current) { |
| | | actionRef.current.reload(); |
| | | } |