@jiangood/admin-spring-boot-starter 0.2.6 → 0.2.8-beta.0
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,136 +0,0 @@
|
|
|
1
|
-
import {Button, Card, Form, Modal, Table} from 'antd'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import {ButtonList, HttpUtils, ValueType} from '../../../framework'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default class extends React.Component {
|
|
8
|
-
|
|
9
|
-
state = {
|
|
10
|
-
data: [],
|
|
11
|
-
formValues: {},
|
|
12
|
-
formOpen: false
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
formRef = React.createRef()
|
|
16
|
-
tableRef = React.createRef()
|
|
17
|
-
|
|
18
|
-
columns = [
|
|
19
|
-
{
|
|
20
|
-
title: '参数名称',
|
|
21
|
-
dataIndex: 'name',
|
|
22
|
-
width: 300,
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: '编码',
|
|
27
|
-
dataIndex: 'code',
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
title: '值',
|
|
33
|
-
dataIndex: 'value',
|
|
34
|
-
render(v, record) {
|
|
35
|
-
if (v != null) {
|
|
36
|
-
return ValueType.renderView(record.valueType, {value: v})
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
title: '说明',
|
|
44
|
-
dataIndex: 'description',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: '更新时间',
|
|
48
|
-
dataIndex: 'updateTime',
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
title: '操作',
|
|
53
|
-
dataIndex: 'option',
|
|
54
|
-
fixed: 'right',
|
|
55
|
-
render: (_, record) => (
|
|
56
|
-
<ButtonList>
|
|
57
|
-
<Button size='small' perm='sysConfig:save' onClick={() => this.handleEdit(record)}> 修改 </Button>
|
|
58
|
-
</ButtonList>
|
|
59
|
-
),
|
|
60
|
-
},
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
componentDidMount() {
|
|
64
|
-
this.loadData();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
loadData() {
|
|
68
|
-
HttpUtils.get('admin/sysConfig/page').then(rs => {
|
|
69
|
-
this.setState({data: rs})
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
handleEdit = record => {
|
|
74
|
-
this.setState({formOpen: true, formValues: record})
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onFinish = values => {
|
|
79
|
-
HttpUtils.post('admin/sysConfig/save', values).then(rs => {
|
|
80
|
-
this.setState({formOpen: false})
|
|
81
|
-
this.loadData()
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
render() {
|
|
87
|
-
return <>
|
|
88
|
-
<Card loading={this.state.data.length === 0}>
|
|
89
|
-
<Table
|
|
90
|
-
dataSource={this.state.data}
|
|
91
|
-
actionRef={this.tableRef}
|
|
92
|
-
pagination={false}
|
|
93
|
-
expandable={
|
|
94
|
-
{
|
|
95
|
-
defaultExpandAllRows: true
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
columns={this.columns}
|
|
99
|
-
rowKey='id'
|
|
100
|
-
bordered
|
|
101
|
-
size='small'
|
|
102
|
-
/>
|
|
103
|
-
</Card>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<Modal title={'编辑系统参数'}
|
|
107
|
-
open={this.state.formOpen}
|
|
108
|
-
onOk={() => this.formRef.current.submit()}
|
|
109
|
-
onCancel={() => this.setState({formOpen: false})}
|
|
110
|
-
destroyOnHidden
|
|
111
|
-
maskClosable={false}
|
|
112
|
-
width={400}
|
|
113
|
-
>
|
|
114
|
-
|
|
115
|
-
<Form ref={this.formRef}
|
|
116
|
-
initialValues={this.state.formValues}
|
|
117
|
-
onFinish={this.onFinish}
|
|
118
|
-
layout='vertical'
|
|
119
|
-
>
|
|
120
|
-
|
|
121
|
-
<Form.Item name='id' noStyle/>
|
|
122
|
-
|
|
123
|
-
<Form.Item name='value' label={this.state.formValues.label}>
|
|
124
|
-
{ValueType.renderField(this.state.formValues.valueType)}
|
|
125
|
-
</Form.Item>
|
|
126
|
-
|
|
127
|
-
</Form>
|
|
128
|
-
</Modal>
|
|
129
|
-
</>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|