@jiangood/springboot-admin-starter 0.0.3 → 0.0.5
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 +32 -0
- package/config/dist/index.js +0 -1
- package/config/dist/plugins/form-plugin.js +2 -2
- package/package.json +12 -10
- package/src/forms/demoForm.jsx +5 -5
- package/src/framework/components/DownloadFileButton.jsx +2 -2
- package/src/framework/components/Ellipsis.jsx +2 -2
- package/src/framework/components/LinkButton.d.ts +4 -4
- package/src/framework/components/LinkButton.jsx +6 -9
- package/src/framework/components/Page/index.jsx +2 -2
- package/src/framework/components/PageLoading.tsx +27 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +6 -7
- package/src/framework/components/ProTable/index.d.ts +5 -1
- package/src/framework/components/ProTable/index.jsx +4 -6
- package/src/framework/components/ProTable/index.less +0 -1
- package/src/framework/components/ValueType/registry.jsx +9 -20
- package/src/framework/components/{index.js → index.ts} +2 -10
- 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.jsx +2 -2
- package/src/framework/components/view/ViewFile.jsx +1 -2
- package/src/framework/components/view/ViewImage.jsx +2 -3
- package/src/framework/components/view/ViewText.tsx +16 -0
- package/src/framework/components/view/{index.js → index.ts} +0 -2
- 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 +25 -0
- package/src/framework/field-components/FieldDate.jsx +109 -0
- package/src/framework/field-components/FieldDateRange.d.ts +6 -0
- package/src/framework/field-components/FieldDateRange.jsx +101 -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/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/{components/field/select/FieldTableSelect/index.d.ts → field-components/FieldTableSelect.d.ts} +4 -14
- package/src/framework/field-components/FieldTableSelect.jsx +59 -0
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.d.ts +0 -1
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.jsx +5 -9
- package/src/framework/field-components/index.ts +20 -0
- package/src/framework/{components/OrgTree.jsx → field-components/system/OrgTree.tsx} +8 -7
- package/src/framework/{components/RoleTree.jsx → field-components/system/RoleTree.tsx} +3 -3
- package/src/framework/field-components/system/index.ts +2 -0
- package/src/framework/index.ts +5 -0
- package/src/framework/pages/LoginPage.d.ts +11 -0
- package/src/framework/pages/LoginPage.jsx +136 -0
- package/src/{pages/login.less → framework/pages/LoginPage.less} +1 -1
- package/src/framework/pages/index.ts +1 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/{date.js → DateUtils.ts} +69 -69
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +143 -0
- package/src/framework/utils/MessageUtils.tsx +182 -0
- package/src/framework/utils/ObjectUtils.ts +113 -0
- package/src/framework/utils/StorageUtils.ts +67 -0
- package/src/framework/utils/StringUtils.ts +410 -0
- package/src/framework/utils/TreeUtils.ts +248 -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 +246 -0
- package/src/framework/utils/system/PageUtils.ts +153 -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/ViewBoolean.jsx +4 -0
- package/src/framework/view-components/index.js +3 -0
- package/src/layouts/PageRender.jsx +2 -2
- package/src/layouts/admin/HeaderRight.jsx +9 -9
- package/src/layouts/admin/TabPageRender.jsx +2 -2
- package/src/layouts/admin/index.jsx +27 -40
- package/src/layouts/admin/index.less +2 -1
- package/src/layouts/index.jsx +30 -38
- package/src/layouts/index.less +0 -21
- package/src/loading.jsx +2 -2
- package/src/{components → pages/flowable}/InstanceInfo.jsx +5 -4
- 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.jsx +61 -234
- 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 +28 -69
- 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 +93 -0
- package/src/pages/flowable/task/form.jsx +5 -5
- package/src/pages/flowable/task/index.jsx +5 -5
- package/src/pages/flowable/test/index.jsx +13 -10
- package/src/pages/index.jsx +8 -13
- package/src/pages/login.jsx +4 -129
- package/src/pages/{api/doc.jsx → system/api/ApiDoc.jsx} +56 -47
- 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 +3 -3
- package/src/pages/system/dict/Dict.jsx +2 -3
- package/src/pages/system/dict/DictItem.jsx +5 -5
- package/src/pages/system/file/index.jsx +13 -5
- package/src/pages/{job → system/job}/index.jsx +124 -39
- package/src/pages/system/log/index.jsx +3 -3
- package/src/pages/system/org/index.jsx +11 -12
- package/src/pages/system/role/index.jsx +11 -11
- package/src/pages/system/role/perm.jsx +8 -8
- package/src/pages/system/sysManual/index.jsx +6 -6
- package/src/pages/system/user/UserPerm.jsx +7 -42
- package/src/pages/system/user/index.jsx +13 -17
- package/src/pages/test.jsx +188 -3
- package/src/pages/ureport/index.jsx +4 -4
- package/src/pages/userCenter/ChangePassword.jsx +3 -4
- package/src/pages/userCenter/index.jsx +2 -2
- package/src/pages/userCenter/manual.jsx +3 -7
- package/src/pages/userCenter/message.jsx +5 -5
- package/config/dist/config.local.js +0 -23
- package/src/components/InstanceStatusInfo.jsx +0 -79
- package/src/components/StreamLog.jsx +0 -27
- package/src/components/flow/BpmnUtils.js +0 -85
- package/src/components/flow/customTranslate/customTranslate.js +0 -19
- package/src/components/flow/customTranslate/translations.js +0 -79
- package/src/components/flow/design/form/ConditionForm.jsx +0 -316
- package/src/components/flow/design/form/ServiceTaskForm.jsx +0 -55
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +0 -62
- package/src/components/flow/design/form/UserTaskForm.jsx +0 -211
- package/src/components/flow/design/palette.js +0 -39
- package/src/components/monitor/AllDefinition.jsx +0 -46
- package/src/components/monitor/AllInstance.jsx +0 -76
- package/src/forms/driverForm.jsx +0 -18
- package/src/framework/components/ButtonList.jsx +0 -91
- package/src/framework/components/Echarts/index.d.ts +0 -10
- package/src/framework/components/Echarts/index.jsx +0 -49
- package/src/framework/components/EditTable/index.d.ts +0 -11
- package/src/framework/components/EditTable/index.jsx +0 -85
- package/src/framework/components/FieldRemoteTree.jsx +0 -20
- package/src/framework/components/HasPerm.jsx +0 -18
- package/src/framework/components/ImageView.d.ts +0 -12
- package/src/framework/components/ImageView.jsx +0 -64
- package/src/framework/components/MsgBox.jsx +0 -180
- package/src/framework/components/PageLoading.jsx +0 -31
- package/src/framework/components/Panel/index.d.ts +0 -11
- package/src/framework/components/Panel/index.jsx +0 -24
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +0 -46
- package/src/framework/components/field/FieldBoolean/index.tsx +0 -92
- package/src/framework/components/field/FieldEditTable/index.d.ts +0 -13
- package/src/framework/components/field/FieldEditTable/index.jsx +0 -103
- package/src/framework/components/field/FieldEditTable/index.less +0 -29
- package/src/framework/components/field/FieldEditor.jsx +0 -48
- package/src/framework/components/field/FieldFileBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldFileBase64/index.jsx +0 -23
- package/src/framework/components/field/FieldImageBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldImageBase64/index.jsx +0 -22
- package/src/framework/components/field/FieldInput.jsx +0 -13
- package/src/framework/components/field/FieldOrgTree/index.tsx +0 -45
- package/src/framework/components/field/FieldPassword.jsx +0 -11
- package/src/framework/components/field/FieldProps.ts +0 -19
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +0 -75
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +0 -81
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +0 -100
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +0 -82
- package/src/framework/components/field/FieldSelectPosition/index.tsx +0 -85
- package/src/framework/components/field/FieldTree.jsx +0 -45
- package/src/framework/components/field/dict/index.tsx +0 -110
- package/src/framework/components/field/flat-multiple-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-multiple-select/index.jsx +0 -116
- package/src/framework/components/field/flat-multiple-select/index.less +0 -12
- package/src/framework/components/field/flat-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-select/index.jsx +0 -107
- package/src/framework/components/field/flat-select/index.less +0 -12
- package/src/framework/components/field/index.js +0 -33
- package/src/framework/components/field/input-number-percent/index.d.ts +0 -11
- package/src/framework/components/field/input-number-percent/index.jsx +0 -28
- package/src/framework/components/field/select/FieldSelect/index.d.ts +0 -39
- package/src/framework/components/field/select/FieldSelect/index.jsx +0 -156
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +0 -155
- package/src/framework/components/field/select/index.jsx +0 -2
- package/src/framework/components/field/switch-y-n/index.d.ts +0 -11
- package/src/framework/components/field/switch-y-n/index.jsx +0 -31
- package/src/framework/components/field/text/index.tsx +0 -7
- package/src/framework/components/field/time/DatePickerString.tsx +0 -37
- package/src/framework/components/field/time/DateTimePickerString.tsx +0 -42
- package/src/framework/components/field/time/FieldDateRange.d.ts +0 -9
- package/src/framework/components/field/time/FieldDateRange.jsx +0 -49
- package/src/framework/components/field/time/HHmmPickerString.tsx +0 -42
- package/src/framework/components/field/time/MonthPickerString.tsx +0 -45
- package/src/framework/components/field/time/TimePickerTool.ts +0 -14
- package/src/framework/components/field/time/YearPickerString.tsx +0 -41
- package/src/framework/components/field/time/YearQuarterString.tsx +0 -38
- package/src/framework/components/field/time/index.tsx +0 -7
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +0 -22
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +0 -11
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +0 -7
- package/src/framework/components/field/upload/FieldUploadImage.jsx +0 -16
- package/src/framework/components/field/upload/index.jsx +0 -3
- package/src/framework/components/system.jsx +0 -29
- package/src/framework/components/view/ViewBoolean.jsx +0 -15
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +0 -16
- package/src/framework/components/view/ViewText.jsx +0 -9
- package/src/framework/index.js +0 -3
- package/src/framework/system/dict.js +0 -88
- package/src/framework/system/formRegistry.js +0 -58
- package/src/framework/system/http.jsx +0 -290
- package/src/framework/system/index.js +0 -13
- package/src/framework/system/page.js +0 -109
- package/src/framework/system/permission.js +0 -44
- package/src/framework/system/sys.js +0 -60
- package/src/framework/system/theme.js +0 -17
- package/src/framework/utils/arr.js +0 -118
- package/src/framework/utils/browser.js +0 -24
- package/src/framework/utils/color.js +0 -269
- package/src/framework/utils/debounce.js +0 -33
- package/src/framework/utils/dom.js +0 -16
- package/src/framework/utils/eventBus.js +0 -70
- package/src/framework/utils/html.js +0 -13
- package/src/framework/utils/index.js +0 -17
- package/src/framework/utils/obj.js +0 -72
- package/src/framework/utils/storage.js +0 -37
- package/src/framework/utils/str.js +0 -297
- package/src/framework/utils/tree.js +0 -175
- package/src/framework/utils/uid.js +0 -76
- package/src/framework/utils/url.js +0 -84
- package/src/framework/utils/validate.js +0 -9
- package/src/pages/api/accessLog/index.jsx +0 -108
- package/src/pages/api/accountResource/index.jsx +0 -149
- package/src/pages/api/index.jsx +0 -163
- package/src/pages/api/resource.jsx +0 -18
- package/src/pages/flowable/instance/view.jsx +0 -13
- package/src/pages/flowable/monitor.jsx +0 -106
- package/src/pages/flowable/test/form.jsx +0 -31
- package/src/pages/job/logList.jsx +0 -100
- package/src/pages/job/status.jsx +0 -84
- /package/src/framework/components/{ButtonList.d.ts → system/ButtonList.d.ts} +0 -0
- /package/src/framework/{components/EditTable/index.less → field-components/FieldTable.less} +0 -0
- /package/src/framework/{components/view → view-components}/ViewPassword.jsx +0 -0
- /package/src/{index.js → index.ts} +0 -0
- /package/src/{components/flow → pages/flowable}/design/contextPad.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {Button, Descriptions, Table, Typography} from "antd";
|
|
2
|
+
import {FieldRemoteSelect, HttpUtils, PageUtils} from "../../../framework";
|
|
3
|
+
import {Button, Descriptions, message, Space, Table, Typography} from "antd";
|
|
4
4
|
|
|
5
5
|
const {Title, Paragraph, Text, Link} = Typography;
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export class ApiDoc extends React.Component {
|
|
8
8
|
|
|
9
9
|
state = {
|
|
10
10
|
url: null,
|
|
@@ -29,45 +29,50 @@ export default class extends React.Component {
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
componentDidMount() {
|
|
32
|
-
const id =
|
|
33
|
-
|
|
34
|
-
HttpUtil.get('admin/apiAccount/docInfo', {id}).then(rs => {
|
|
35
|
-
this.setState(rs)
|
|
36
|
-
})
|
|
32
|
+
const id = PageUtils.currentParams().id
|
|
33
|
+
this.loadData(id);
|
|
37
34
|
|
|
38
35
|
let url = window.location.protocol + '//' + window.location.host
|
|
39
36
|
this.setState({url})
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
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
44
|
}
|
|
45
45
|
|
|
46
|
+
|
|
47
|
+
|
|
46
48
|
render() {
|
|
47
49
|
const {apiList} = this.state
|
|
48
|
-
return <div
|
|
49
|
-
|
|
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>
|
|
50
56
|
<div id='doc-content'>
|
|
51
|
-
<Title level={1}
|
|
57
|
+
<Title level={1}>接口说明文档</Title>
|
|
52
58
|
|
|
53
|
-
<Title level={2}
|
|
59
|
+
<Title level={2}>一、基本信息</Title>
|
|
54
60
|
<Paragraph>
|
|
55
61
|
<Descriptions column={1} bordered size='small'>
|
|
56
62
|
<Descriptions.Item label='请求地址'>
|
|
57
|
-
{this.state.url}/api/gateway
|
|
63
|
+
{this.state.url}/api/gateway/接口名称
|
|
58
64
|
</Descriptions.Item>
|
|
59
65
|
<Descriptions.Item label='appId'>
|
|
60
|
-
|
|
66
|
+
私发
|
|
61
67
|
</Descriptions.Item>
|
|
62
68
|
<Descriptions.Item label='appSecret'>
|
|
63
|
-
|
|
69
|
+
私发
|
|
64
70
|
</Descriptions.Item>
|
|
65
71
|
</Descriptions>
|
|
66
72
|
|
|
67
73
|
</Paragraph>
|
|
68
74
|
|
|
69
75
|
|
|
70
|
-
<Title level={2}>1 接口说明</Title>
|
|
71
76
|
<Paragraph>
|
|
72
77
|
<Typography.Text>
|
|
73
78
|
<div>
|
|
@@ -78,57 +83,61 @@ export default class extends React.Component {
|
|
|
78
83
|
</Paragraph>
|
|
79
84
|
|
|
80
85
|
|
|
81
|
-
<Title level={4}
|
|
86
|
+
<Title level={4}>请求头</Title>
|
|
82
87
|
|
|
83
|
-
<Table columns={this.columns} bordered dataSource={[
|
|
88
|
+
<Table rowKey='name' columns={this.columns} bordered dataSource={[
|
|
84
89
|
{name: 'appId', type: 'String', required: true, desc: '账号标识,appId'},
|
|
85
90
|
{name: 'timestamp', type: 'String', required: true, desc: '时间戳,当前UNIX时间戳,13位,精确到毫秒'},
|
|
86
91
|
{name: 'sign', type: 'String', required: true, desc: '数据签名,appId + appSecret + timestamp拼接后,进行md5摘要,值为32位小写'},
|
|
87
92
|
]} size='small' pagination={false}>
|
|
88
93
|
</Table>
|
|
89
94
|
|
|
90
|
-
<Title level={4}>返回公共参数说明 </Title>
|
|
91
|
-
<Table columns={this.columns} bordered dataSource={[
|
|
92
|
-
{name: 'code', type: 'int', required: true, desc: '返回码,成功返回0,其他表示操作错误'},
|
|
93
|
-
{name: 'message', type: 'String', required: false, desc: '结果提示信息'},
|
|
94
|
-
{name: 'data', type: 'String', required: false, desc: '返回数据JSON'}
|
|
95
|
-
]} size='small' pagination={false}>
|
|
96
|
-
</Table>
|
|
97
95
|
|
|
98
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>
|
|
99
103
|
|
|
100
|
-
<Typography.Title level={2}
|
|
104
|
+
<Typography.Title level={2}>二、接口列表</Typography.Title>
|
|
101
105
|
{apiList.map((api, index) => {
|
|
102
|
-
return
|
|
103
|
-
<Typography.Title level={3}>{
|
|
106
|
+
return <div key={index}>
|
|
107
|
+
<Typography.Title level={3}>{ api.name} </Typography.Title>
|
|
108
|
+
<p>接口名称: {api.action}</p>
|
|
104
109
|
<p>功能描述:{api.desc}</p>
|
|
105
|
-
<p>请求路径: /api/gateway/{api.action}</p>
|
|
106
110
|
|
|
107
111
|
|
|
108
|
-
<Title level={5}
|
|
109
|
-
<Table columns={this.columns} bordered dataSource={api.parameterList}
|
|
112
|
+
<Title level={5}>请求参数</Title>
|
|
113
|
+
<Table rowKey='name' columns={this.columns} bordered dataSource={api.parameterList}
|
|
110
114
|
size='small' pagination={false}>
|
|
111
115
|
</Table>
|
|
112
116
|
|
|
113
|
-
<Title level={5}
|
|
114
|
-
<
|
|
115
|
-
|
|
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>
|
|
117
128
|
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
<Table columns={this.columns}
|
|
130
|
+
rowKey={'name'}
|
|
131
|
+
bordered
|
|
120
132
|
dataSource={api.returnList} size='small' pagination={false}>
|
|
121
|
-
</Table>
|
|
133
|
+
</Table>
|
|
134
|
+
</>
|
|
135
|
+
}
|
|
122
136
|
|
|
123
|
-
|
|
137
|
+
</div>
|
|
124
138
|
})}
|
|
125
139
|
|
|
126
|
-
|
|
127
|
-
<Table columns={[
|
|
128
|
-
{dataIndex:'code',title:'错误码'},
|
|
129
|
-
{dataIndex:'message', title:'错误描述'}
|
|
130
|
-
]} rowKey='code' bordered dataSource={this.state.errorList} size='small' pagination={false}>
|
|
131
|
-
</Table>
|
|
140
|
+
|
|
132
141
|
</div>
|
|
133
142
|
</div>
|
|
134
143
|
}
|
|
@@ -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
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {Button, Card, Form, Modal, Table} from 'antd'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import {ButtonList,
|
|
4
|
+
import {ButtonList, HttpUtils, ValueType} from '../../../framework'
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export default class extends React.Component {
|
|
@@ -65,7 +65,7 @@ export default class extends React.Component {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
loadData() {
|
|
68
|
-
|
|
68
|
+
HttpUtils.get('admin/sysConfig/page').then(rs => {
|
|
69
69
|
this.setState({data: rs})
|
|
70
70
|
})
|
|
71
71
|
}
|
|
@@ -76,7 +76,7 @@ export default class extends React.Component {
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
onFinish = values => {
|
|
79
|
-
|
|
79
|
+
HttpUtils.post('admin/sysConfig/save', values).then(rs => {
|
|
80
80
|
this.setState({formOpen: false})
|
|
81
81
|
this.loadData()
|
|
82
82
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {HttpUtils, ProTable} from "../../../framework";
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
export default class extends React.Component {
|
|
@@ -40,7 +39,7 @@ export default class extends React.Component {
|
|
|
40
39
|
<ProTable
|
|
41
40
|
actionRef={this.tableRef}
|
|
42
41
|
|
|
43
|
-
request={(params) =>
|
|
42
|
+
request={(params) => HttpUtils.get('admin/sysDict/page', params)}
|
|
44
43
|
columns={this.columns}
|
|
45
44
|
rowKey='id'
|
|
46
45
|
|
|
@@ -2,7 +2,7 @@ import {PlusOutlined} from '@ant-design/icons'
|
|
|
2
2
|
import {Button, Col, Form, Input, InputNumber, Modal, Popconfirm, Row, Tag} from 'antd'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
|
-
import {ButtonList,
|
|
5
|
+
import {ButtonList, FieldBoolean, HttpUtils, ProTable} from '../../../framework'
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export default class extends React.Component {
|
|
@@ -88,7 +88,7 @@ export default class extends React.Component {
|
|
|
88
88
|
|
|
89
89
|
onFinish = values => {
|
|
90
90
|
values.sysDict = {id: this.props.sysDictId}
|
|
91
|
-
|
|
91
|
+
HttpUtils.post('admin/sysDictItem/save', values).then(rs => {
|
|
92
92
|
this.setState({formOpen: false})
|
|
93
93
|
this.tableRef.current.reload()
|
|
94
94
|
})
|
|
@@ -96,7 +96,7 @@ export default class extends React.Component {
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
handleDelete = row => {
|
|
99
|
-
|
|
99
|
+
HttpUtils.get('admin/sysDictItem/delete', row).then(rs => {
|
|
100
100
|
this.tableRef.current.reload()
|
|
101
101
|
})
|
|
102
102
|
}
|
|
@@ -115,7 +115,7 @@ export default class extends React.Component {
|
|
|
115
115
|
}}
|
|
116
116
|
request={(params) => {
|
|
117
117
|
params.sysDictId = this.props.sysDictId
|
|
118
|
-
return
|
|
118
|
+
return HttpUtils.get('admin/sysDictItem/page', params);
|
|
119
119
|
}}
|
|
120
120
|
columns={this.columns}
|
|
121
121
|
rowKey='id'
|
|
@@ -162,7 +162,7 @@ export default class extends React.Component {
|
|
|
162
162
|
</Row>
|
|
163
163
|
|
|
164
164
|
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
165
|
-
|
|
165
|
+
<FieldBoolean />
|
|
166
166
|
</Form.Item>
|
|
167
167
|
|
|
168
168
|
</Form>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ButtonList,
|
|
5
|
+
FieldDateRange,
|
|
6
|
+
FieldDictSelect,
|
|
7
|
+
FieldUploadFile,
|
|
8
|
+
HttpUtils,
|
|
9
|
+
ProTable,
|
|
10
|
+
SysUtils
|
|
11
|
+
} from "../../../framework";
|
|
4
12
|
import {CloudUploadOutlined} from "@ant-design/icons";
|
|
5
13
|
|
|
6
14
|
|
|
@@ -54,14 +62,14 @@ export default class extends React.Component {
|
|
|
54
62
|
title: '预览',
|
|
55
63
|
dataIndex: 'id',
|
|
56
64
|
render(id,record){
|
|
57
|
-
const nodes = [ <a href={
|
|
65
|
+
const nodes = [ <a href={'/admin/sysFile/preview/' + record.id } target='_blank'>预览</a>]
|
|
58
66
|
|
|
59
67
|
|
|
60
68
|
if(record.imageUrls?.length > 0){
|
|
61
69
|
for(let item of record.imageUrls){
|
|
62
70
|
let url = item.url;
|
|
63
71
|
let label = item.label;
|
|
64
|
-
nodes.push(<a href={
|
|
72
|
+
nodes.push(<a href={( url) } target='_blank' style={{marginLeft:8}} >{label}</a>)
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
|
|
@@ -85,7 +93,7 @@ export default class extends React.Component {
|
|
|
85
93
|
|
|
86
94
|
|
|
87
95
|
handleDelete = row => {
|
|
88
|
-
|
|
96
|
+
HttpUtils.get('admin/sysFile/delete', row).then(rs => {
|
|
89
97
|
this.tableRef.current.reload()
|
|
90
98
|
})
|
|
91
99
|
}
|
|
@@ -103,7 +111,7 @@ export default class extends React.Component {
|
|
|
103
111
|
</Button>
|
|
104
112
|
}}
|
|
105
113
|
request={(params) => {
|
|
106
|
-
return
|
|
114
|
+
return HttpUtils.get('admin/sysFile/page', params);
|
|
107
115
|
}}
|
|
108
116
|
|
|
109
117
|
columns={this.columns}
|