@jiangood/admin-spring-boot-starter 0.2.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/config/dist/config.js +45 -0
- package/config/dist/index.js +19 -0
- package/config/dist/plugins/form-plugin.js +51 -0
- package/config/dist/plugins/route-plugin.js +72 -0
- package/package.json +41 -0
- package/src/app.js +1 -0
- package/src/asserts/welcome.png +0 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/Gap/index.d.ts +23 -0
- package/src/framework/components/Gap/index.jsx +46 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +10 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/Page/index.d.ts +17 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.tsx +27 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +123 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +42 -0
- package/src/framework/components/ProTable/index.jsx +260 -0
- package/src/framework/components/ProTable/index.less +14 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +27 -0
- package/src/framework/components/index.ts +17 -0
- package/src/framework/components/system/ButtonList.d.ts +9 -0
- package/src/framework/components/system/ButtonList.jsx +35 -0
- package/src/framework/components/system/HasPerm.tsx +14 -0
- package/src/framework/components/system/index.tsx +29 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.tsx +20 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +49 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +60 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.tsx +16 -0
- package/src/framework/components/view/index.ts +10 -0
- package/src/framework/field-components/FieldBoolean.d.ts +13 -0
- package/src/framework/field-components/FieldBoolean.jsx +76 -0
- package/src/framework/field-components/FieldDate.d.ts +27 -0
- package/src/framework/field-components/FieldDate.jsx +114 -0
- package/src/framework/field-components/FieldDateRange.d.ts +6 -0
- package/src/framework/field-components/FieldDateRange.jsx +104 -0
- package/src/framework/field-components/FieldDictSelect.d.ts +13 -0
- package/src/framework/field-components/FieldDictSelect.jsx +16 -0
- package/src/framework/field-components/FieldEditor.d.ts +10 -0
- package/src/framework/field-components/FieldEditor.jsx +58 -0
- package/src/framework/field-components/FieldNumberRange.d.ts +13 -0
- package/src/framework/field-components/FieldNumberRange.jsx +59 -0
- package/src/framework/field-components/FieldPercent.d.ts +12 -0
- package/src/framework/field-components/FieldPercent.jsx +27 -0
- package/src/framework/field-components/FieldRemoteSelect.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelect.jsx +87 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.jsx +86 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.d.ts +20 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.jsx +86 -0
- package/src/framework/field-components/FieldRemoteTree.d.ts +21 -0
- package/src/framework/field-components/FieldRemoteTree.jsx +45 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.d.ts +23 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.jsx +61 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.jsx +67 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.jsx +68 -0
- package/src/framework/field-components/FieldSysOrgTree.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTree.jsx +23 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.jsx +23 -0
- package/src/framework/field-components/FieldTable.d.ts +17 -0
- package/src/framework/field-components/FieldTable.jsx +108 -0
- package/src/framework/field-components/FieldTable.less +29 -0
- package/src/framework/field-components/FieldTableSelect.d.ts +19 -0
- package/src/framework/field-components/FieldTableSelect.jsx +59 -0
- package/src/framework/field-components/FieldUploadFile.d.ts +34 -0
- package/src/framework/field-components/FieldUploadFile.jsx +141 -0
- package/src/framework/field-components/index.ts +21 -0
- package/src/framework/field-components/system/OrgTree.tsx +61 -0
- package/src/framework/field-components/system/RoleTree.tsx +53 -0
- package/src/framework/field-components/system/index.ts +2 -0
- package/src/framework/index.ts +5 -0
- package/src/framework/pages/LoginPage.d.ts +15 -0
- package/src/framework/pages/LoginPage.jsx +132 -0
- package/src/framework/pages/LoginPage.less +53 -0
- package/src/framework/pages/LoginPageUtils.ts +35 -0
- package/src/framework/pages/index.ts +2 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/DateUtils.ts +187 -0
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +144 -0
- package/src/framework/utils/MessageUtils.tsx +145 -0
- package/src/framework/utils/ObjectUtils.ts +118 -0
- package/src/framework/utils/StorageUtils.ts +50 -0
- package/src/framework/utils/StringUtils.ts +412 -0
- package/src/framework/utils/TreeUtils.ts +251 -0
- package/src/framework/utils/UrlUtils.ts +152 -0
- package/src/framework/utils/UuidUtils.ts +88 -0
- package/src/framework/utils/ValidateUtils.ts +28 -0
- package/src/framework/utils/index.ts +16 -0
- package/src/framework/utils/system/DictUtils.ts +97 -0
- package/src/framework/utils/system/FormRegistryUtils.ts +77 -0
- package/src/framework/utils/system/HttpUtils.ts +247 -0
- package/src/framework/utils/system/PageUtils.ts +163 -0
- package/src/framework/utils/system/PermUtils.ts +79 -0
- package/src/framework/utils/system/SysUtils.ts +97 -0
- package/src/framework/utils/system/ThemeUtils.ts +27 -0
- package/src/framework/utils/system/index.ts +7 -0
- package/src/framework/view-components/ViewApproveStatus.tsx +26 -0
- package/src/framework/view-components/ViewBoolean.tsx +6 -0
- package/src/framework/view-components/ViewFlowableInstanceProgress.d.ts +12 -0
- package/src/framework/view-components/ViewFlowableInstanceProgress.jsx +97 -0
- package/src/framework/view-components/ViewFlowableInstanceProgressButton.tsx +26 -0
- package/src/framework/view-components/ViewPassword.tsx +25 -0
- package/src/framework/view-components/ViewProps.ts +11 -0
- package/src/framework/view-components/index.ts +6 -0
- package/src/index.ts +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +161 -0
- package/src/layouts/admin/index.less +65 -0
- package/src/layouts/index.jsx +153 -0
- package/src/layouts/index.less +24 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/flowable/design/contextPad.js +50 -0
- package/src/pages/flowable/design/customTranslate/customTranslate.js +16 -0
- package/src/pages/flowable/design/customTranslate/translations-properties-panel.js +10 -0
- package/src/pages/flowable/design/customTranslate/translations.js +144 -0
- package/src/pages/flowable/design/descriptors/flowable.json +1109 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +171 -0
- package/src/pages/flowable/design/provider/FlowablePropertiesProvider.js +75 -0
- package/src/pages/flowable/design/provider/index.js +6 -0
- package/src/pages/flowable/design/provider/properties/ConditionDesign.jsx +175 -0
- package/src/pages/flowable/design/provider/properties/ConditionProps.jsx +76 -0
- package/src/pages/flowable/design/provider/properties/DelegateExpressionProps.js +54 -0
- package/src/pages/flowable/design/provider/properties/FormProps.js +55 -0
- package/src/pages/flowable/design/provider/properties/MultiInstanceProps.js +100 -0
- package/src/pages/flowable/design/provider/properties/UserTaskForm.jsx +48 -0
- package/src/pages/flowable/design/provider/properties/utils.jsx +35 -0
- package/src/pages/flowable/index.jsx +87 -0
- package/src/pages/flowable/monitor/definition.jsx +87 -0
- package/src/pages/flowable/monitor/instance/index.jsx +177 -0
- package/src/pages/flowable/monitor/instance/view.jsx +102 -0
- package/src/pages/flowable/monitor/task.jsx +98 -0
- package/src/pages/flowable/task/form.jsx +186 -0
- package/src/pages/flowable/task/index.jsx +184 -0
- package/src/pages/flowable/task/instance/view.jsx +85 -0
- package/src/pages/flowable/test/index.jsx +57 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/login.jsx +21 -0
- package/src/pages/system/api/ApiDoc.jsx +144 -0
- package/src/pages/system/api/index.jsx +268 -0
- package/src/pages/system/api/perm.jsx +69 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +72 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +160 -0
- package/src/pages/system/job/index.jsx +324 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +262 -0
- package/src/pages/system/role/index.jsx +308 -0
- package/src/pages/system/role/perm.jsx +108 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +97 -0
- package/src/pages/system/user/index.jsx +258 -0
- package/src/pages/test.jsx +200 -0
- package/src/pages/ureport/index.jsx +22 -0
- package/src/pages/userCenter/ChangePassword.jsx +63 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +59 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {FieldRemoteSelect, HttpUtils, PageUtils} from "../../../framework";
|
|
3
|
+
import {Button, Descriptions, message, Space, Table, Typography} from "antd";
|
|
4
|
+
|
|
5
|
+
const {Title, Paragraph, Text, Link} = Typography;
|
|
6
|
+
|
|
7
|
+
export class ApiDoc extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
url: null,
|
|
11
|
+
appId: null,
|
|
12
|
+
apiList: [],
|
|
13
|
+
frameworkVersion: null,
|
|
14
|
+
errorList:[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
columns = [
|
|
18
|
+
{dataIndex: 'name', title: '名称', width: 150},
|
|
19
|
+
{dataIndex: 'type', title: '类型', width: 100},
|
|
20
|
+
{
|
|
21
|
+
dataIndex: 'required', title: '必填', width: 100, render: v => {
|
|
22
|
+
if (v == null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return v ? '是' : '否';
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{dataIndex: 'desc', title: '描述'},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
componentDidMount() {
|
|
32
|
+
const id = PageUtils.currentParams().id
|
|
33
|
+
this.loadData(id);
|
|
34
|
+
|
|
35
|
+
let url = window.location.protocol + '//' + window.location.host
|
|
36
|
+
this.setState({url})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async loadData(id) {
|
|
40
|
+
const hide = message.loading('加载中...', 0)
|
|
41
|
+
const rs = await HttpUtils.get('admin/apiAccount/docInfo', {id})
|
|
42
|
+
this.setState(rs)
|
|
43
|
+
hide()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
const {apiList} = this.state
|
|
50
|
+
return <div>
|
|
51
|
+
|
|
52
|
+
<Space>
|
|
53
|
+
<FieldRemoteSelect url='admin/apiAccount/accountOptions' placeholder='请选择账号' onChange={v=>this.loadData(v)}/>
|
|
54
|
+
<Button type='primary' >导出PDF</Button>
|
|
55
|
+
</Space>
|
|
56
|
+
<div id='doc-content'>
|
|
57
|
+
<Title level={1}>接口说明文档</Title>
|
|
58
|
+
|
|
59
|
+
<Title level={2}>一、基本信息</Title>
|
|
60
|
+
<Paragraph>
|
|
61
|
+
<Descriptions column={1} bordered size='small'>
|
|
62
|
+
<Descriptions.Item label='请求地址'>
|
|
63
|
+
{this.state.url}/api/gateway/接口名称
|
|
64
|
+
</Descriptions.Item>
|
|
65
|
+
<Descriptions.Item label='appId'>
|
|
66
|
+
私发
|
|
67
|
+
</Descriptions.Item>
|
|
68
|
+
<Descriptions.Item label='appSecret'>
|
|
69
|
+
私发
|
|
70
|
+
</Descriptions.Item>
|
|
71
|
+
</Descriptions>
|
|
72
|
+
|
|
73
|
+
</Paragraph>
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<Paragraph>
|
|
77
|
+
<Typography.Text>
|
|
78
|
+
<div>
|
|
79
|
+
请求使用HTTP POST发送,请求参数也使用json格式
|
|
80
|
+
</div>
|
|
81
|
+
<div> 响应报文以JSON方式返回</div>
|
|
82
|
+
</Typography.Text>
|
|
83
|
+
</Paragraph>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
<Title level={4}>请求头</Title>
|
|
87
|
+
|
|
88
|
+
<Table rowKey='name' columns={this.columns} bordered dataSource={[
|
|
89
|
+
{name: 'appId', type: 'String', required: true, desc: '账号标识,appId'},
|
|
90
|
+
{name: 'timestamp', type: 'String', required: true, desc: '时间戳,当前UNIX时间戳,13位,精确到毫秒'},
|
|
91
|
+
{name: 'sign', type: 'String', required: true, desc: '数据签名,appId + appSecret + timestamp拼接后,进行md5摘要,值为32位小写'},
|
|
92
|
+
]} size='small' pagination={false}>
|
|
93
|
+
</Table>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<Typography.Title level={4}>公共错误码</Typography.Title>
|
|
98
|
+
<Table columns={[
|
|
99
|
+
{dataIndex:'code',title:'错误码'},
|
|
100
|
+
{dataIndex:'message', title:'错误描述'}
|
|
101
|
+
]} rowKey='code' bordered dataSource={this.state.errorList} size='small' pagination={false}>
|
|
102
|
+
</Table>
|
|
103
|
+
|
|
104
|
+
<Typography.Title level={2}>二、接口列表</Typography.Title>
|
|
105
|
+
{apiList.map((api, index) => {
|
|
106
|
+
return <div key={index}>
|
|
107
|
+
<Typography.Title level={3}>{ api.name} </Typography.Title>
|
|
108
|
+
<p>接口名称: {api.action}</p>
|
|
109
|
+
<p>功能描述:{api.desc}</p>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<Title level={5}>请求参数</Title>
|
|
113
|
+
<Table rowKey='name' columns={this.columns} bordered dataSource={api.parameterList}
|
|
114
|
+
size='small' pagination={false}>
|
|
115
|
+
</Table>
|
|
116
|
+
|
|
117
|
+
<Title level={5}>响应数据</Title>
|
|
118
|
+
<Table columns={this.columns} bordered
|
|
119
|
+
rowKey={'name'}
|
|
120
|
+
dataSource={[
|
|
121
|
+
{name: 'code', type: 'int', required: true, desc: '响应码,0表示成功'},
|
|
122
|
+
{name: 'message', type: 'String', required: false, desc: '结果提示信息'},
|
|
123
|
+
{name: 'data', type: api.returnType, required: false, desc: '返回数据'}
|
|
124
|
+
]} size='small' pagination={false}>
|
|
125
|
+
</Table>
|
|
126
|
+
{api.returnList != null && api.returnList.length > 0 && <>
|
|
127
|
+
<Title level={5}>data 对象 {api.returnType} 说明</Title>
|
|
128
|
+
|
|
129
|
+
<Table columns={this.columns}
|
|
130
|
+
rowKey={'name'}
|
|
131
|
+
bordered
|
|
132
|
+
dataSource={api.returnList} size='small' pagination={false}>
|
|
133
|
+
</Table>
|
|
134
|
+
</>
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
})}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Form, Input, Modal, Popconfirm, Tabs} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import {
|
|
5
|
+
ButtonList,
|
|
6
|
+
FieldBoolean,
|
|
7
|
+
FieldDate, HttpUtils,
|
|
8
|
+
Page,
|
|
9
|
+
PageUtils,
|
|
10
|
+
ProTable,
|
|
11
|
+
StringUtils,
|
|
12
|
+
ViewPassword
|
|
13
|
+
} from "../../../framework";
|
|
14
|
+
import {ApiDoc} from "./ApiDoc";
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export default class extends React.Component {
|
|
18
|
+
|
|
19
|
+
state = {
|
|
20
|
+
formValues: {},
|
|
21
|
+
formOpen: false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
formRef = React.createRef()
|
|
25
|
+
tableRef = React.createRef()
|
|
26
|
+
|
|
27
|
+
columns = [
|
|
28
|
+
{
|
|
29
|
+
title: '名称',
|
|
30
|
+
dataIndex: 'name',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: 'appId',
|
|
34
|
+
dataIndex: 'appId',
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
title: 'appSecret',
|
|
39
|
+
dataIndex: 'appSecret',
|
|
40
|
+
render(v) {
|
|
41
|
+
return <ViewPassword value={v}></ViewPassword>;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: '准入IP',
|
|
46
|
+
dataIndex: 'accessIp',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: '有效期',
|
|
50
|
+
dataIndex: 'endTime',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: '启用',
|
|
54
|
+
dataIndex: 'enable',
|
|
55
|
+
render(v) {
|
|
56
|
+
return v == null ? null : (v ? '是' : '否')
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: '操作',
|
|
61
|
+
dataIndex: 'option',
|
|
62
|
+
render: (_, record) => (
|
|
63
|
+
<ButtonList>
|
|
64
|
+
<Button size='small' perm='api'
|
|
65
|
+
onClick={() => PageUtils.open('/system/api/perm?accountId=' + record.id, '账户权限')}
|
|
66
|
+
type='primary'>权限</Button>
|
|
67
|
+
<Button size='small' perm='api' onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
68
|
+
<Popconfirm perm='api' title='是否确定删除接口访客' onConfirm={() => this.handleDelete(record)}>
|
|
69
|
+
<Button size='small'>删除</Button>
|
|
70
|
+
</Popconfirm>
|
|
71
|
+
</ButtonList>
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
handleAdd = () => {
|
|
77
|
+
this.setState({formOpen: true, formValues: {}})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
handleEdit = record => {
|
|
81
|
+
this.setState({formOpen: true, formValues: record})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
onFinish = values => {
|
|
86
|
+
HttpUtils.post('admin/apiAccount/save', values).then(rs => {
|
|
87
|
+
this.setState({formOpen: false})
|
|
88
|
+
this.tableRef.current.reload()
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
handleDelete = record => {
|
|
94
|
+
HttpUtils.get('admin/apiAccount/delete', {id: record.id}).then(rs => {
|
|
95
|
+
this.tableRef.current.reload()
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
randomAppSecret = () => {
|
|
100
|
+
const appSecret = StringUtils.random(32)
|
|
101
|
+
this.formRef.current.setFieldsValue({appSecret})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
render() {
|
|
105
|
+
return <Page padding>
|
|
106
|
+
<Tabs items={[
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
label: '接口列表',
|
|
110
|
+
key: '2',
|
|
111
|
+
children: <ProTable
|
|
112
|
+
rowKey='action'
|
|
113
|
+
columns={[
|
|
114
|
+
{dataIndex: 'name', title: '名称'},
|
|
115
|
+
{dataIndex: 'action', title: '动作'},
|
|
116
|
+
{dataIndex: 'desc', title: '描述'},
|
|
117
|
+
|
|
118
|
+
]}
|
|
119
|
+
request={(params,) => HttpUtils.get('admin/api/resource/page', params)}
|
|
120
|
+
/>
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
label: '账号列表',
|
|
125
|
+
key: '1',
|
|
126
|
+
children: <ProTable
|
|
127
|
+
actionRef={this.tableRef}
|
|
128
|
+
toolBarRender={() => {
|
|
129
|
+
return <ButtonList>
|
|
130
|
+
<Button perm='api' type='primary' onClick={this.handleAdd}>
|
|
131
|
+
<PlusOutlined/> 新增
|
|
132
|
+
</Button>
|
|
133
|
+
</ButtonList>
|
|
134
|
+
}}
|
|
135
|
+
request={(params) => HttpUtils.get('admin/apiAccount/page', params)}
|
|
136
|
+
columns={this.columns}
|
|
137
|
+
/>
|
|
138
|
+
}, {
|
|
139
|
+
label: '接口文档',
|
|
140
|
+
key: '3',
|
|
141
|
+
children: <ApiDoc/>
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: '访问记录',
|
|
145
|
+
key: '4',
|
|
146
|
+
children: <ProTable
|
|
147
|
+
request={(params) => HttpUtils.get('admin/apiAccessLog/page', params)}
|
|
148
|
+
columns={[
|
|
149
|
+
|
|
150
|
+
{
|
|
151
|
+
title: '接口名称',
|
|
152
|
+
dataIndex: 'name',
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
{
|
|
158
|
+
title: '接口',
|
|
159
|
+
dataIndex: 'action',
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
{
|
|
165
|
+
title: 'requestId',
|
|
166
|
+
dataIndex: 'requestId',
|
|
167
|
+
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
{
|
|
171
|
+
title: '请求数据',
|
|
172
|
+
dataIndex: 'requestData',
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
{
|
|
178
|
+
title: '响应数据',
|
|
179
|
+
dataIndex: 'responseData',
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
{
|
|
185
|
+
title: 'ip',
|
|
186
|
+
dataIndex: 'ip',
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
{
|
|
192
|
+
title: 'ipLocation',
|
|
193
|
+
dataIndex: 'ipLocation',
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
{
|
|
199
|
+
title: '执行时间',
|
|
200
|
+
dataIndex: 'executionTime',
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
{
|
|
206
|
+
title: '接口账户',
|
|
207
|
+
dataIndex: 'accountName',
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
]}
|
|
214
|
+
/>
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
]}>
|
|
218
|
+
|
|
219
|
+
</Tabs>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<Modal title='接口访客'
|
|
223
|
+
open={this.state.formOpen}
|
|
224
|
+
onOk={() => this.formRef.current.submit()}
|
|
225
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
226
|
+
destroyOnHidden
|
|
227
|
+
maskClosable={false}
|
|
228
|
+
>
|
|
229
|
+
|
|
230
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
231
|
+
initialValues={this.state.formValues}
|
|
232
|
+
onFinish={this.onFinish}
|
|
233
|
+
|
|
234
|
+
>
|
|
235
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
236
|
+
|
|
237
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
238
|
+
<Input/>
|
|
239
|
+
</Form.Item>
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<Form.Item label='appId' name='appId'>
|
|
243
|
+
<Input placeholder='多个用逗号分隔'/>
|
|
244
|
+
</Form.Item>
|
|
245
|
+
<Form.Item label='appSecret' name='appSecret' rules={[{required: true}, {len: 32}]}
|
|
246
|
+
help={<Button size='small' type='link' onClick={this.randomAppSecret}>随机生成</Button>}
|
|
247
|
+
>
|
|
248
|
+
<Input/>
|
|
249
|
+
</Form.Item>
|
|
250
|
+
|
|
251
|
+
<Form.Item label='准入IP' name='accessIp'>
|
|
252
|
+
<Input placeholder='多个用逗号分隔'/>
|
|
253
|
+
</Form.Item>
|
|
254
|
+
<Form.Item label='有效期' name='endTime' style={{marginTop: 32}}>
|
|
255
|
+
<FieldDate type='YYYY-MM-DD'/>
|
|
256
|
+
</Form.Item>
|
|
257
|
+
<Form.Item label='启用' name='enable' rules={[{required: true}]}>
|
|
258
|
+
<FieldBoolean/>
|
|
259
|
+
</Form.Item>
|
|
260
|
+
|
|
261
|
+
</Form>
|
|
262
|
+
</Modal>
|
|
263
|
+
</Page>
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {message, Switch} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {ArrUtils, HttpUtils, Page, PageUtils, ProTable} from "../../../framework";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.accountId = PageUtils.currentParams().accountId
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
state = {
|
|
15
|
+
perms: []
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async componentDidMount() {
|
|
19
|
+
const rs = await HttpUtils.get('admin/apiAccount/get', {id: this.accountId})
|
|
20
|
+
this.setState({perms: rs.perms})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
onChange = async (action, checked) => {
|
|
24
|
+
const hide = message.loading('保存中...', 0)
|
|
25
|
+
await HttpUtils.post('admin/apiAccount/grant', {accountId: this.accountId, action, checked});
|
|
26
|
+
|
|
27
|
+
const perms = this.state.perms
|
|
28
|
+
if (checked) {
|
|
29
|
+
ArrUtils.add(perms, action)
|
|
30
|
+
} else {
|
|
31
|
+
ArrUtils.remove(perms, action)
|
|
32
|
+
}
|
|
33
|
+
this.setState({perms})
|
|
34
|
+
hide();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
return <Page>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<ProTable
|
|
43
|
+
rowKey='action'
|
|
44
|
+
columns={[
|
|
45
|
+
{dataIndex: 'name', title: '名称'},
|
|
46
|
+
{dataIndex: 'action', title: '动作'},
|
|
47
|
+
{dataIndex: 'desc', title: '描述'},
|
|
48
|
+
{
|
|
49
|
+
dataIndex: 'option', title: '操作',
|
|
50
|
+
render: (_, record) => {
|
|
51
|
+
let action = record.action;
|
|
52
|
+
return <Switch checked={this.state.perms.includes(action)}
|
|
53
|
+
onChange={(checked) => {
|
|
54
|
+
this.onChange(action, checked)
|
|
55
|
+
|
|
56
|
+
}}> </Switch>
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]}
|
|
60
|
+
request={(params,) => HttpUtils.get('admin/api/resource/page', params)}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
</Page>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {HttpUtils, ProTable} from "../../../framework";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default class extends React.Component {
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
formValues: {},
|
|
9
|
+
formOpen: false,
|
|
10
|
+
selectedRowKeys: []
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
formRef = React.createRef()
|
|
14
|
+
tableRef = React.createRef()
|
|
15
|
+
|
|
16
|
+
columns = [
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
title: '编码',
|
|
22
|
+
dataIndex: 'code',
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: '文本',
|
|
28
|
+
dataIndex: 'text',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
return <>
|
|
39
|
+
<ProTable
|
|
40
|
+
actionRef={this.tableRef}
|
|
41
|
+
|
|
42
|
+
request={(params) => HttpUtils.get('admin/sysDict/page', params)}
|
|
43
|
+
columns={this.columns}
|
|
44
|
+
rowKey='id'
|
|
45
|
+
|
|
46
|
+
rowSelection={{
|
|
47
|
+
type: 'radio',
|
|
48
|
+
selectedRowKeys: this.state.selectedRowKeys,
|
|
49
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
50
|
+
this.setState({selectedRowKeys: selectedRowKeys})
|
|
51
|
+
this.props.onChange(selectedRowKeys[0])
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
onRow={(record) => ({
|
|
55
|
+
onClick: () => {
|
|
56
|
+
this.setState({selectedRowKeys: [record.id]})
|
|
57
|
+
this.props.onChange(record.id)
|
|
58
|
+
}
|
|
59
|
+
})}
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|