mirror of https://github.com/openspug/spug
add group perm
parent
f48594ac6f
commit
2def2cc504
|
@ -15,7 +15,7 @@ import {
|
||||||
ScissorOutlined
|
ScissorOutlined
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { LoadingOutlined } from '@ant-design/icons';
|
import { LoadingOutlined } from '@ant-design/icons';
|
||||||
import { http } from 'libs';
|
import { hasPermission, http } from 'libs';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import lds from 'lodash';
|
import lds from 'lodash';
|
||||||
|
|
||||||
|
@ -107,6 +107,13 @@ export default observer(function () {
|
||||||
setAction('')
|
setAction('')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleRightClick(v) {
|
||||||
|
if (hasPermission('host.group.edit')) {
|
||||||
|
store.group = v.node;
|
||||||
|
setVisible(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleExpand(keys, {_, node}) {
|
function handleExpand(keys, {_, node}) {
|
||||||
if (node.children.length > 0) {
|
if (node.children.length > 0) {
|
||||||
setExpands(keys)
|
setExpands(keys)
|
||||||
|
@ -140,7 +147,12 @@ export default observer(function () {
|
||||||
<Card
|
<Card
|
||||||
title="分组列表"
|
title="分组列表"
|
||||||
loading={store.grpFetching}
|
loading={store.grpFetching}
|
||||||
extra={<Switch checked={draggable} onChange={setDraggable} checkedChildren="排版" unCheckedChildren="浏览"/>}>
|
extra={<Switch
|
||||||
|
disabled={!hasPermission('host.group.edit')}
|
||||||
|
checked={draggable}
|
||||||
|
onChange={setDraggable}
|
||||||
|
checkedChildren="排版"
|
||||||
|
unCheckedChildren="浏览"/>}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
overlay={menus}
|
overlay={menus}
|
||||||
visible={visible}
|
visible={visible}
|
||||||
|
@ -156,10 +168,7 @@ export default observer(function () {
|
||||||
onSelect={(_, {node}) => store.group = node}
|
onSelect={(_, {node}) => store.group = node}
|
||||||
onExpand={handleExpand}
|
onExpand={handleExpand}
|
||||||
onDrop={handleDrag}
|
onDrop={handleDrag}
|
||||||
onRightClick={v => {
|
onRightClick={handleRightClick}
|
||||||
store.group = v.node;
|
|
||||||
setVisible(true)
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
Loading…
Reference in New Issue