@jiangood/open-admin 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Input} from "antd";
|
|
1
|
+
import {Input, InputNumber, Switch} from "antd";
|
|
2
2
|
|
|
3
3
|
import {ViewPassword, ViewBoolean, ViewImage, ViewText} from "../../views";
|
|
4
4
|
import {FieldDictSelect, FieldRemoteSelect} from "../../fields";
|
|
@@ -6,6 +6,14 @@ import {FieldDictSelect, FieldRemoteSelect} from "../../fields";
|
|
|
6
6
|
|
|
7
7
|
export const fieldRegistry = {
|
|
8
8
|
'text':Input,
|
|
9
|
+
'string': Input,
|
|
10
|
+
|
|
11
|
+
'number': InputNumber,
|
|
12
|
+
|
|
13
|
+
'boolean': Switch,
|
|
14
|
+
|
|
15
|
+
'img': Input,
|
|
16
|
+
'img_base64': Input,
|
|
9
17
|
|
|
10
18
|
'dict':FieldDictSelect,
|
|
11
19
|
'password':Input.Password,
|
|
@@ -231,8 +231,9 @@ export default class JobPage extends React.Component {
|
|
|
231
231
|
name={['jobData', p.name]}
|
|
232
232
|
key={p.name}
|
|
233
233
|
initialValue={p.defaultValue}
|
|
234
|
+
valuePropName={p.valueType === 'boolean' ? 'checked' : 'value'}
|
|
234
235
|
rules={[{required: p.required}]}>
|
|
235
|
-
{ValueType.renderField(p.
|
|
236
|
+
{ValueType.renderField(p.valueType, {
|
|
236
237
|
...p.componentProps,
|
|
237
238
|
placeholder: p.placeholder || '请输入'
|
|
238
239
|
})}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
NamedIcon,
|
|
12
12
|
Page,
|
|
13
13
|
PermActions,
|
|
14
|
+
PermUtils,
|
|
14
15
|
ViewSwitch,
|
|
15
16
|
} from "../../../framework";
|
|
16
17
|
|
|
@@ -91,6 +92,7 @@ export default class OrgPage extends React.Component {
|
|
|
91
92
|
render() {
|
|
92
93
|
const {selectedOrg} = this.state
|
|
93
94
|
const params = this.state.params
|
|
95
|
+
const canSort = PermUtils.hasPermission('sys-org:update')
|
|
94
96
|
|
|
95
97
|
return <Page title="组织机构" description="管理组织机构树" actions={
|
|
96
98
|
<Button type='primary' perm='sys-org:create' icon={<PlusOutlined/>} onClick={this.handleAdd}>新增</Button>
|
|
@@ -122,6 +124,7 @@ export default class OrgPage extends React.Component {
|
|
|
122
124
|
<div>
|
|
123
125
|
拖拽排序 <Switch
|
|
124
126
|
value={this.state.draggable}
|
|
127
|
+
disabled={!canSort}
|
|
125
128
|
onChange={this.onDraggableChange}/>
|
|
126
129
|
</div>
|
|
127
130
|
<Button size='small' shape='round' icon={<SyncOutlined/>} onClick={this.loadTree}>刷新</Button>
|
|
@@ -224,6 +227,7 @@ export default class OrgPage extends React.Component {
|
|
|
224
227
|
}
|
|
225
228
|
|
|
226
229
|
onDrop = (e) => {
|
|
230
|
+
if (!PermUtils.hasPermission('sys-org:update')) return;
|
|
227
231
|
const {dragNode, dropToGap, node} = e;
|
|
228
232
|
const dropKey = node.key;
|
|
229
233
|
const dragKey = dragNode.key;
|