@jiangood/open-admin 1.3.4 → 2.0.1

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.
Files changed (153) hide show
  1. package/config/config.js +3 -8
  2. package/package.json +5 -9
  3. package/src/.umi-production/appData.json +325 -365
  4. package/src/.umi-production/core/helmet.ts +1 -1
  5. package/src/.umi-production/core/history.ts +1 -1
  6. package/src/.umi-production/core/historyIntelli.ts +1 -1
  7. package/src/.umi-production/core/pluginConfig.ts +1 -1
  8. package/src/.umi-production/core/polyfill.ts +216 -216
  9. package/src/.umi-production/core/route.tsx +2 -4
  10. package/src/.umi-production/exports.ts +3 -3
  11. package/src/.umi-production/testBrowser.tsx +1 -1
  12. package/src/.umi-production/tsconfig.json +1 -1
  13. package/src/.umi-production/umi.ts +2 -2
  14. package/src/framework/components/ErrorBoundary/index.tsx +86 -0
  15. package/src/framework/components/Gap/index.tsx +42 -0
  16. package/src/framework/components/NamedIcon/index.d.ts +6 -4
  17. package/src/framework/components/NamedIcon/index.jsx +9 -6
  18. package/src/framework/components/OrgTree/{index.jsx → index.tsx} +10 -19
  19. package/src/framework/components/PageLoading/{index.jsx → index.tsx} +2 -5
  20. package/src/framework/components/ProModal/index.tsx +1 -1
  21. package/src/framework/components/ProTable/components/ToolBar/{index.jsx → index.tsx} +3 -3
  22. package/src/framework/components/ProTable/index.less +1 -1
  23. package/src/framework/components/ProTable/{index.jsx → index.tsx} +9 -7
  24. package/src/framework/components/ProTable/utils/index.ts +62 -0
  25. package/src/framework/components/RoleTree/{index.jsx → index.tsx} +7 -17
  26. package/src/framework/components/ValueType/{index.jsx → index.tsx} +2 -1
  27. package/src/framework/components/ViewRange/index.tsx +15 -0
  28. package/src/framework/components/index.ts +2 -1
  29. package/src/framework/components/system/ButtonList.tsx +22 -0
  30. package/src/framework/components/system/index.tsx +4 -4
  31. package/src/framework/fields/BaseRemoteSelect/index.tsx +129 -0
  32. package/src/framework/fields/FieldDictSelect/{index.jsx → index.tsx} +10 -4
  33. package/src/framework/fields/FieldRemoteSelect/index.tsx +37 -0
  34. package/src/framework/fields/FieldRemoteSelectMultiple/index.tsx +29 -0
  35. package/src/framework/fields/FieldRemoteSelectMultipleInline/index.tsx +33 -0
  36. package/src/framework/fields/FieldRemoteTree/index.tsx +31 -0
  37. package/src/framework/fields/FieldRemoteTreeCascader/index.tsx +39 -0
  38. package/src/framework/fields/FieldRemoteTreeSelect/index.tsx +39 -0
  39. package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.tsx +43 -0
  40. package/src/framework/fields/FieldSysOrgTree/{index.jsx → index.tsx} +2 -2
  41. package/src/framework/fields/FieldSysOrgTreeSelect/{index.jsx → index.tsx} +2 -2
  42. package/src/framework/fields/FieldTable/{index.jsx → index.tsx} +5 -5
  43. package/src/framework/fields/FieldUploadFile/{index.jsx → index.tsx} +1 -3
  44. package/src/framework/index.ts +0 -1
  45. package/src/framework/utils/ArrayUtils.ts +186 -0
  46. package/src/framework/utils/EventBusUtils.ts +0 -1
  47. package/src/framework/utils/MessageUtils.tsx +0 -2
  48. package/src/framework/utils/TreeUtils.ts +2 -2
  49. package/src/framework/utils/index.ts +1 -1
  50. package/src/framework/utils/system/FormRegistryUtils.ts +0 -1
  51. package/src/framework/utils/system/PermUtils.ts +2 -2
  52. package/src/framework/views/ViewApproveStatus/index.tsx +11 -0
  53. package/src/framework/views/ViewBoolean/index.tsx +6 -0
  54. package/src/framework/views/ViewFile/{index.jsx → index.tsx} +4 -4
  55. package/src/framework/views/ViewImage/{index.jsx → index.tsx} +3 -3
  56. package/src/framework/views/ViewPassword/{index.jsx → index.tsx} +2 -2
  57. package/src/framework/views/ViewProcessInstanceProgressButton/{index.jsx → index.tsx} +1 -2
  58. package/src/layouts/PageRender.jsx +6 -6
  59. package/src/layouts/admin/HeaderRight.jsx +2 -2
  60. package/src/layouts/admin/TabPageRender.jsx +28 -13
  61. package/src/layouts/admin/index.jsx +15 -14
  62. package/src/layouts/admin/index.less +1 -1
  63. package/src/layouts/index.jsx +12 -13
  64. package/src/layouts/index.less +2 -2
  65. package/src/loading.jsx +17 -16
  66. package/src/pages/login.jsx +132 -4
  67. package/src/{framework/pages/LoginPage.less → pages/login.less} +3 -3
  68. package/src/pages/system/dict/index.jsx +4 -3
  69. package/src/pages/system/file/index.jsx +6 -5
  70. package/src/pages/system/job/index.jsx +10 -9
  71. package/src/pages/system/{sysManual → manual}/index.jsx +1 -1
  72. package/src/pages/system/org/index.jsx +4 -5
  73. package/src/pages/system/role/index.jsx +5 -5
  74. package/src/pages/system/role/perm.jsx +6 -6
  75. package/src/pages/system/user/UserPerm.jsx +4 -4
  76. package/src/pages/system/user/index.jsx +2 -2
  77. package/src/pages/userCenter/ChangePassword.jsx +3 -5
  78. package/src/pages/userCenter/manual.jsx +1 -1
  79. package/src/pages/userCenter/message.jsx +1 -1
  80. package/src/framework/components/DownloadFileButton/index.d.ts +0 -11
  81. package/src/framework/components/Gap/index.d.ts +0 -23
  82. package/src/framework/components/Gap/index.jsx +0 -46
  83. package/src/framework/components/LinkButton/index.d.ts +0 -14
  84. package/src/framework/components/OrgTree/index.d.ts +0 -4
  85. package/src/framework/components/Page/index.d.ts +0 -17
  86. package/src/framework/components/PageLoading/index.d.ts +0 -1
  87. package/src/framework/components/ProTable/index.d.ts +0 -42
  88. package/src/framework/components/ProTable/utils/index.js +0 -43
  89. package/src/framework/components/RoleTree/index.d.ts +0 -4
  90. package/src/framework/components/ViewRange/index.d.ts +0 -14
  91. package/src/framework/components/ViewRange/index.jsx +0 -20
  92. package/src/framework/components/system/ButtonList.d.ts +0 -8
  93. package/src/framework/components/system/ButtonList.jsx +0 -42
  94. package/src/framework/fields/FieldBoolean/index.d.ts +0 -9
  95. package/src/framework/fields/FieldDate/index.d.ts +0 -23
  96. package/src/framework/fields/FieldDateRange/index.d.ts +0 -22
  97. package/src/framework/fields/FieldDictSelect/index.d.ts +0 -12
  98. package/src/framework/fields/FieldEditor/index.d.ts +0 -14
  99. package/src/framework/fields/FieldNumberRange/index.d.ts +0 -10
  100. package/src/framework/fields/FieldPercent/index.d.ts +0 -8
  101. package/src/framework/fields/FieldRemoteSelect/index.d.ts +0 -44
  102. package/src/framework/fields/FieldRemoteSelect/index.jsx +0 -66
  103. package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +0 -20
  104. package/src/framework/fields/FieldRemoteSelectMultiple/index.jsx +0 -85
  105. package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +0 -21
  106. package/src/framework/fields/FieldRemoteSelectMultipleInline/index.jsx +0 -88
  107. package/src/framework/fields/FieldRemoteTree/index.d.ts +0 -20
  108. package/src/framework/fields/FieldRemoteTree/index.jsx +0 -50
  109. package/src/framework/fields/FieldRemoteTreeCascader/index.d.ts +0 -18
  110. package/src/framework/fields/FieldRemoteTreeCascader/index.jsx +0 -59
  111. package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +0 -19
  112. package/src/framework/fields/FieldRemoteTreeSelect/index.jsx +0 -57
  113. package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +0 -20
  114. package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.jsx +0 -62
  115. package/src/framework/fields/FieldSysOrgTree/index.d.ts +0 -9
  116. package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +0 -9
  117. package/src/framework/fields/FieldTable/index.d.ts +0 -14
  118. package/src/framework/fields/FieldTableSelect/index.d.ts +0 -19
  119. package/src/framework/fields/FieldUploadFile/index.d.ts +0 -31
  120. package/src/framework/pages/LoginPage.d.ts +0 -16
  121. package/src/framework/pages/LoginPage.jsx +0 -135
  122. package/src/framework/pages/LoginPageUtils.ts +0 -36
  123. package/src/framework/pages/index.ts +0 -2
  124. package/src/framework/utils/ArrUtils.ts +0 -229
  125. package/src/framework/views/ViewApproveStatus/index.d.ts +0 -5
  126. package/src/framework/views/ViewApproveStatus/index.jsx +0 -15
  127. package/src/framework/views/ViewBoolean/index.d.ts +0 -3
  128. package/src/framework/views/ViewBoolean/index.jsx +0 -4
  129. package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +0 -5
  130. package/src/framework/views/ViewFile/index.d.ts +0 -10
  131. package/src/framework/views/ViewFileButton/index.d.ts +0 -10
  132. package/src/framework/views/ViewImage/index.d.ts +0 -6
  133. package/src/framework/views/ViewPassword/index.d.ts +0 -5
  134. package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +0 -12
  135. package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +0 -6
  136. package/src/framework/views/ViewText/index.d.ts +0 -16
  137. package/src/pages/system/api/index.jsx +0 -279
  138. package/src/pages/test/views.jsx +0 -95
  139. package/src/framework/components/DownloadFileButton/{index.jsx → index.tsx} +0 -0
  140. package/src/framework/components/LinkButton/{index.jsx → index.tsx} +0 -0
  141. package/src/framework/components/Page/{index.jsx → index.tsx} +0 -0
  142. package/src/framework/components/ValueType/{registry.jsx → registry.tsx} +1 -1
  143. /package/src/framework/fields/FieldBoolean/{index.jsx → index.tsx} +0 -0
  144. /package/src/framework/fields/FieldDate/{index.jsx → index.tsx} +0 -0
  145. /package/src/framework/fields/FieldDateRange/{index.jsx → index.tsx} +0 -0
  146. /package/src/framework/fields/FieldEditor/{index.jsx → index.tsx} +0 -0
  147. /package/src/framework/fields/FieldNumberRange/{index.jsx → index.tsx} +0 -0
  148. /package/src/framework/fields/FieldPercent/{index.jsx → index.tsx} +0 -0
  149. /package/src/framework/fields/FieldTableSelect/{index.jsx → index.tsx} +0 -0
  150. /package/src/framework/views/ViewBooleanEnableDisable/{index.jsx → index.tsx} +0 -0
  151. /package/src/framework/views/ViewFileButton/{index.jsx → index.tsx} +0 -0
  152. /package/src/framework/views/ViewProcessInstanceProgress/{index.jsx → index.tsx} +0 -0
  153. /package/src/framework/views/ViewText/{index.jsx → index.tsx} +0 -0
@@ -1,16 +1,144 @@
1
1
  import React from 'react';
2
+ import {Button, Form, Input, message, Space} from 'antd';
3
+ import {LockOutlined, SafetyCertificateOutlined, UserOutlined, WarningOutlined} from '@ant-design/icons';
4
+ import {JSEncrypt} from "jsencrypt";
5
+ import {history} from 'umi';
6
+ import {EventBusUtils, HttpUtils, PageUtils, MessageUtils, SysUtils} from "../framework/utils";
2
7
 
3
- import {LoginPage} from "../framework/pages/LoginPage";
8
+ import "./login.less"
4
9
 
10
+ function getRedirect() {
11
+ let redirect = PageUtils.currentParams()['redirect'];
12
+ if (redirect) {
13
+ redirect = decodeURIComponent(redirect)
14
+ } else {
15
+ redirect = '/'
16
+ }
17
+ return redirect;
18
+ }
19
+
20
+ function postLogin(values) {
21
+ return new Promise((resolve, reject) => {
22
+ HttpUtils.post('/admin/auth/login', values).then(rs => {
23
+ EventBusUtils.emit('loginSuccess')
24
+ history.push(getRedirect())
25
+ resolve(rs)
26
+ }).catch(e => {
27
+ reject(e)
28
+ })
29
+ })
30
+ }
5
31
 
6
32
  export default class extends React.Component {
7
33
 
34
+ state = {
35
+ logging: false,
36
+ siteInfo: {},
37
+ random: Math.random()
38
+ }
39
+
40
+ async componentDidMount() {
41
+ if (localStorage.length === 0) {
42
+ MessageUtils.alert('站点数据缺失,刷新当前页面...')
43
+ window.location.reload()
44
+ return
45
+ }
46
+
47
+ const siteInfo = SysUtils.getSiteInfo()
48
+ this.setState({siteInfo})
49
+ }
50
+
51
+ submit = values => {
52
+ this.setState({logging: true})
53
+
54
+ const pubkey = this.state.siteInfo.rsaPublicKey;
55
+ if (!pubkey) {
56
+ message.error("未获取密钥,请刷新浏览器再试")
57
+ this.setState({logging: false})
58
+ return
59
+ }
60
+ const crypt = new JSEncrypt();
61
+ crypt.setPublicKey(pubkey);
62
+ values.password = crypt.encrypt(values.password)
63
+
64
+ postLogin(values).finally(() => {
65
+ this.setState({logging: false})
66
+ })
67
+ }
8
68
 
9
69
  render() {
10
- return <LoginPage/>
11
- // 支持自定义
12
- // return <LoginPage form={<Button type={"primary"} size='large'>xx登录</Button>} />
70
+ const {siteInfo} = this.state
71
+
72
+ const pageStyle = {}
73
+ if (siteInfo.loginBackground) {
74
+ const url = 'admin/sysFile/preview/' + siteInfo.loginBackground;
75
+ pageStyle.backgroundImage = 'url("' + url + '")'
76
+ }
77
+
78
+ return (
79
+ <section className='login-page' style={pageStyle}>
80
+ <div className="login-content">
81
+ <h1>{siteInfo.title}</h1>
82
+ {this.getForm(siteInfo)}
83
+ {this.renderFormBottom()}
84
+ </div>
85
+ </section>
86
+ );
13
87
  }
14
88
 
89
+ getForm = siteInfo => {
90
+ const form = (
91
+ <Form
92
+ name="normal_login"
93
+ className="login-form"
94
+ initialValues={{remember: true}}
95
+ onFinish={this.submit}
96
+ requiredMark={false}
97
+ colon={false}
98
+ >
99
+ <Form.Item name="username" rules={[{required: true, message: '请输入用户名!'}]}>
100
+ <Input size='large' prefix={<UserOutlined/>} placeholder="用户名" autoComplete="off"/>
101
+ </Form.Item>
102
+ <Form.Item name="password" rules={[{required: true, message: '请输入密码!'}]}>
103
+ <Input autoComplete="off" prefix={<LockOutlined/>} type="password" placeholder="密码"
104
+ size='large'
105
+ />
106
+ </Form.Item>
15
107
 
108
+ {siteInfo.captcha && (
109
+ <Form.Item name='captchaCode' rules={[{required: true}]}>
110
+ <Space style={{alignItems: 'center'}}>
111
+ <Input size='large' placeholder='验证码' prefix={<SafetyCertificateOutlined/>}/>
112
+ <img height={36} width={100}
113
+ src={"/admin/auth/captcha-image?_random=" + this.state.random}
114
+ onClick={() => this.setState({random: Math.random()})}/>
115
+ </Space>
116
+ </Form.Item>
117
+ )}
118
+
119
+ <Form.Item style={{marginTop: 10}}>
120
+ <Button loading={this.state.logging} type="primary" htmlType="submit"
121
+ block size='large'>
122
+ 登录
123
+ </Button>
124
+ </Form.Item>
125
+ </Form>
126
+ );
127
+
128
+ if (this.props.formRender) {
129
+ return this.props.formRender(form);
130
+ }
131
+ return form;
132
+ };
133
+
134
+ renderFormBottom() {
135
+ const siteInfo = this.state.siteInfo;
136
+ if (siteInfo.loginBoxBottomTip) {
137
+ return (
138
+ <div style={{color: 'white', marginTop: 50, fontSize: '14px', textAlign: 'center'}}>
139
+ <WarningOutlined/> {siteInfo.loginBoxBottomTip}
140
+ </div>
141
+ )
142
+ }
143
+ }
16
144
  }
@@ -17,7 +17,7 @@
17
17
  top: 20%;
18
18
 
19
19
  .ant-form-item-label > label{
20
- color: white !important;
20
+ color: white;
21
21
  }
22
22
  }
23
23
  }
@@ -44,10 +44,10 @@
44
44
 
45
45
 
46
46
 
47
- .login-page h1 {
47
+ .login-page.login-page h1 {
48
48
  margin-bottom: 50px;
49
49
  text-align: center;
50
- color: white !important;
50
+ color: white;
51
51
  font-size: x-large;
52
52
  }
53
53
 
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import {Button, Form, Input, InputNumber, Modal, Popconfirm, Splitter, Tag, Tree, Typography} from "antd";
3
+ import {PlusOutlined} from "@ant-design/icons";
4
+
3
5
  import {
4
6
  ButtonList,
5
7
  FieldBoolean, FieldDictSelect, FieldRemoteSelect,
@@ -8,7 +10,6 @@ import {
8
10
  ProTable,
9
11
  ViewBooleanEnableDisable, ViewText
10
12
  } from "../../../framework";
11
- import {PlusOutlined} from "@ant-design/icons";
12
13
 
13
14
  export default class extends React.Component {
14
15
 
@@ -132,7 +133,7 @@ export default class extends React.Component {
132
133
  open={this.state.formOpen}
133
134
  onOk={() => this.formRef.current.submit()}
134
135
  onCancel={() => this.setState({formOpen: false})}
135
- destroyOnHidden
136
+ destroyOnClose
136
137
  >
137
138
 
138
139
  <Form ref={this.formRef} labelCol={{flex: '100px'}}
@@ -143,7 +144,7 @@ export default class extends React.Component {
143
144
  <ViewText />
144
145
  </Form.Item>
145
146
  <Form.Item label='类型' name='typeCode' rules={[{required: true}]} >
146
- <FieldRemoteSelect url='/admin/dict/typeOptions' />
147
+ <FieldRemoteSelect url='/admin/dict/type-options' />
147
148
  </Form.Item>
148
149
  <Form.Item label='编码' name='code' rules={[{required: true}]}>
149
150
  <Input/>
@@ -1,8 +1,9 @@
1
- import {Button, Form, Input, Modal, Popconfirm} from 'antd'
2
1
  import React from 'react'
3
- import {ButtonList, FieldDateRange, FieldDictSelect, FieldUploadFile, HttpUtils, ProTable} from "../../../framework";
2
+ import {Button, Form, Input, Modal, Popconfirm} from 'antd'
4
3
  import {CloudUploadOutlined} from "@ant-design/icons";
5
4
 
5
+ import {ButtonList, FieldDateRange, FieldDictSelect, FieldUploadFile, HttpUtils, ProTable} from "../../../framework";
6
+
6
7
  export default class extends React.Component {
7
8
 
8
9
  state = {
@@ -63,8 +64,8 @@ export default class extends React.Component {
63
64
 
64
65
  if (record.imageUrls?.length > 0) {
65
66
  for (let item of record.imageUrls) {
66
- let url = item.url;
67
- let label = item.label;
67
+ const url = item.url;
68
+ const label = item.label;
68
69
  nodes.push(<a href={(url)} target='_blank' style={{marginLeft: 8}}>{label}</a>)
69
70
  }
70
71
  }
@@ -126,7 +127,7 @@ export default class extends React.Component {
126
127
  this.tableRef.current.reload()
127
128
  }}
128
129
  footer={null}
129
- destroyOnHidden
130
+ destroyOnClose
130
131
  >
131
132
  <Form ref={this.formRef}
132
133
  initialValues={this.state.formValues}
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import {
2
3
  Alert,
3
4
  AutoComplete,
@@ -13,8 +14,8 @@ import {
13
14
  Switch,
14
15
  Tag
15
16
  } from 'antd'
16
- import React from 'react'
17
17
  import {PlusOutlined} from "@ant-design/icons";
18
+
18
19
  import {ButtonList, HttpUtils, Page, ProTable, StringUtils, ValueType} from "../../../framework";
19
20
 
20
21
 
@@ -63,7 +64,7 @@ export default class extends React.Component {
63
64
  formRef = React.createRef()
64
65
 
65
66
  componentDidMount() {
66
- HttpUtils.get('admin/job/jobClassOptions').then(rs => {
67
+ HttpUtils.get('admin/job/job-class-options').then(rs => {
67
68
  this.setState({jobClassOptions: rs})
68
69
  })
69
70
  }
@@ -78,7 +79,7 @@ export default class extends React.Component {
78
79
  }
79
80
 
80
81
  loadJobParamFields(className, jobData) {
81
- HttpUtils.post("admin/job/getJobParamFields", jobData || {}, {className}).then(rs => {
82
+ HttpUtils.post("admin/job/get-job-param-fields", jobData || {}, {className}).then(rs => {
82
83
  this.setState({paramList: rs})
83
84
  })
84
85
  }
@@ -98,7 +99,7 @@ export default class extends React.Component {
98
99
  }
99
100
 
100
101
  handleTriggerJob = row => {
101
- HttpUtils.get('admin/job/triggerJob', {id: row.id}).then(rs => {
102
+ HttpUtils.get('admin/job/trigger-job', {id: row.id}).then(rs => {
102
103
  this.tableRef.current.reload();
103
104
  })
104
105
  }
@@ -194,7 +195,7 @@ export default class extends React.Component {
194
195
 
195
196
  <Modal title='作业调度'
196
197
  open={this.state.formOpen}
197
- destroyOnHidden
198
+ destroyOnClose
198
199
  width={800}
199
200
  onOk={() => this.formRef.current.submit()}
200
201
  onCancel={() => this.setState({formOpen: false})}
@@ -253,7 +254,7 @@ export default class extends React.Component {
253
254
  onCancel={() => this.setState({executeRecordOpen: false})}
254
255
  footer={null}
255
256
  width={1024}
256
- destroyOnHidden
257
+ destroyOnClose
257
258
  >
258
259
  <ProTable columns={[{
259
260
  title: '开始时间',
@@ -288,13 +289,13 @@ export default class extends React.Component {
288
289
  title: '操作',
289
290
  dataIndex: 'option',
290
291
  render: (_, record) => {
291
- let url = '/admin/sys/log/' + record.id;
292
+ const url = '/admin/sys/log/' + record.id;
292
293
  return <a href={url} target='_blank'>日志</a>;
293
294
  },
294
295
  }
295
296
  ]} request={params => {
296
297
  params.jobId = this.state.formValues.id
297
- return HttpUtils.get('admin/job/executeRecord', params);
298
+ return HttpUtils.get('admin/job/execute-record', params);
298
299
  }}></ProTable>
299
300
 
300
301
  </Modal>
@@ -306,7 +307,7 @@ export default class extends React.Component {
306
307
  this.loadJobParamFields(values.jobClass)
307
308
  const option = this.state.jobClassOptions.find(o => o.value === changed.jobClass)
308
309
  if (option) {
309
- let {label} = option;
310
+ const {label} = option;
310
311
  if (StringUtils.contains(label, " ")) { // 取中文名部门设置为name
311
312
  this.formRef.current.setFieldValue("name", label.split(" ")[1])
312
313
  }
@@ -97,7 +97,7 @@ export default class extends React.Component {
97
97
  open={this.state.formOpen}
98
98
  onOk={() => this.formRef.current.submit()}
99
99
  onCancel={() => this.setState({formOpen: false})}
100
- destroyOnHidden
100
+ destroyOnClose
101
101
  maskClosable={false}
102
102
  >
103
103
 
@@ -44,7 +44,7 @@ export default class extends React.Component {
44
44
 
45
45
  const {params} = this.state
46
46
  HttpUtils.get('admin/sysOrg/tree', params).then(rs => {
47
- let treeData = rs;
47
+ const treeData = rs;
48
48
  this.setState({treeData})
49
49
  }).finally(() => {
50
50
  this.setState({treeLoading: false});
@@ -91,9 +91,9 @@ export default class extends React.Component {
91
91
 
92
92
 
93
93
  render() {
94
- let {formValues} = this.state;
95
- let disabled = formValues == null;
96
- let params = this.state.params;
94
+ const {formValues} = this.state;
95
+ const disabled = formValues == null;
96
+ const params = this.state.params;
97
97
  return <Page padding>
98
98
  <Card>
99
99
  <Space>
@@ -250,7 +250,6 @@ export default class extends React.Component {
250
250
  const dropPosition = e.dropPosition - Number(dropPos[dropPos.length - 1]); // the drop position relative to the drop node, inside 0, top -1, bottom 1
251
251
 
252
252
 
253
- console.log(dragNode.title, '->', node.title, 'dropToGap:', dropToGap, "dropPosition:", dropPosition)
254
253
  HttpUtils.post('admin/sysOrg/sort', {dropPosition, dropToGap, dropKey, dragKey}).then(this.loadTree)
255
254
  };
256
255
  }
@@ -39,7 +39,7 @@ export default class extends React.Component {
39
39
 
40
40
  handleEditUser = record => {
41
41
  this.setState({usersModalOpen: true, formValues: record})
42
- HttpUtils.get('admin/sysRole/userList', {id: record.id}).then(rs => {
42
+ HttpUtils.get('admin/sysRole/user-list', {id: record.id}).then(rs => {
43
43
  this.setState({userList: rs.list, targetKeys: rs.selectedKeys})
44
44
  })
45
45
  }
@@ -153,7 +153,7 @@ export default class extends React.Component {
153
153
  id: this.state.formValues.id,
154
154
  userIdList: this.state.targetKeys
155
155
  }
156
- HttpUtils.post('admin/sysRole/grantUsers', params).then(rs => {
156
+ HttpUtils.post('admin/sysRole/grant-users', params).then(rs => {
157
157
  this.setState({usersModalOpen: false})
158
158
  })
159
159
  }
@@ -197,7 +197,7 @@ export default class extends React.Component {
197
197
  open={this.state.formOpen}
198
198
  onOk={() => this.formRef.current.submit()}
199
199
  onCancel={() => this.setState({formOpen: false})}
200
- destroyOnHidden
200
+ destroyOnClose
201
201
  maskClosable={false}
202
202
  width={600}
203
203
  >
@@ -238,7 +238,7 @@ export default class extends React.Component {
238
238
 
239
239
  <Modal title={'角色用户' + "【" + this.state.formValues?.name + '】'}
240
240
  open={this.state.usersModalOpen}
241
- destroyOnHidden
241
+ destroyOnClose
242
242
  maskClosable={false}
243
243
  width={800}
244
244
  onCancel={() => this.setState({usersModalOpen: false})}
@@ -271,7 +271,7 @@ export default class extends React.Component {
271
271
 
272
272
  <Modal title={'角色授权菜单权限' + "【" + this.state.formValues?.name + '】'}
273
273
  open={this.state.menuOpen}
274
- destroyOnHidden
274
+ destroyOnClose
275
275
  maskClosable={false}
276
276
  width={800}
277
277
  onCancel={() => this.setState({menuOpen: false})}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import {Button, Card, Checkbox, Table, Typography} from "antd";
3
3
  import {SaveOutlined} from "@ant-design/icons";
4
- import {ArrUtils, HttpUtils, PageUtils} from "../../../framework";
4
+ import {ArrayUtils, HttpUtils, PageUtils} from "../../../framework";
5
5
  export default class extends React.Component {
6
6
 
7
7
 
@@ -35,7 +35,7 @@ export default class extends React.Component {
35
35
  }
36
36
 
37
37
 
38
- let rowSelectedKey = this.state.rowSelectedKeys[record.id];
38
+ const rowSelectedKey = this.state.rowSelectedKeys[record.id];
39
39
  return <Checkbox.Group options={options}
40
40
  value={rowSelectedKey}
41
41
  onChange={(ks) => {
@@ -59,10 +59,10 @@ export default class extends React.Component {
59
59
  HttpUtils.get('admin/sysRole/get', {id: this.roleId}).then(rs => {
60
60
  this.setState({roleInfo: rs})
61
61
  }),
62
- HttpUtils.get('admin/sysRole/permTreeTable', {id: this.roleId}).then(rs => {
62
+ HttpUtils.get('admin/sysRole/perm-tree-table', {id: this.roleId}).then(rs => {
63
63
  this.setState({dataSource: rs})
64
64
  }),
65
- HttpUtils.get('admin/sysRole/ownPerms', {id: this.roleId}).then(rs => {
65
+ HttpUtils.get('admin/sysRole/own-perms', {id: this.roleId}).then(rs => {
66
66
  this.setState({rowSelectedKeys: rs})
67
67
  })
68
68
  ]).then(rs => {
@@ -80,9 +80,9 @@ export default class extends React.Component {
80
80
  continue;
81
81
  }
82
82
  menus.push(menuId)
83
- ArrUtils.addAll(perms, ks)
83
+ ArrayUtils.addAll(perms, ks)
84
84
  }
85
- HttpUtils.post('admin/sysRole/savePerms', {id: this.roleId, perms, menus}).then(rs => {
85
+ HttpUtils.post('admin/sysRole/save-perms', {id: this.roleId, perms, menus}).then(rs => {
86
86
  // Page.open(PageUtils.currentPathname(), PageUtils.currentLabel())
87
87
  })
88
88
  };
@@ -20,7 +20,7 @@ export default class UserPerm extends React.Component {
20
20
  show(item) {
21
21
  this.setState({visible: true})
22
22
 
23
- HttpUtils.get('admin/sysUser/getPermInfo', {id: item.id}).then(rs => {
23
+ HttpUtils.get('admin/sysUser/get-perm-info', {id: item.id}).then(rs => {
24
24
  this.setState({formValues: rs})
25
25
  this.formRef.current.setFieldsValue(rs)
26
26
  })
@@ -34,7 +34,7 @@ export default class UserPerm extends React.Component {
34
34
  })
35
35
 
36
36
 
37
- HttpUtils.post('admin/sysUser/grantPerm', values).then(rs => {
37
+ HttpUtils.post('admin/sysUser/grant-perm', values).then(rs => {
38
38
  this.setState({
39
39
  visible: false,
40
40
  confirmLoading: false
@@ -49,11 +49,11 @@ export default class UserPerm extends React.Component {
49
49
  }
50
50
 
51
51
  render() {
52
- let {visible, confirmLoading} = this.state
52
+ const {visible, confirmLoading} = this.state
53
53
 
54
54
  return <Modal
55
55
  title="授权"
56
- destroyOnHidden
56
+ destroyOnClose
57
57
  width={600}
58
58
  open={visible}
59
59
  confirmLoading={confirmLoading}
@@ -30,7 +30,7 @@ export default class extends React.Component {
30
30
  tableRef = React.createRef()
31
31
 
32
32
  resetPwd(row) {
33
- HttpUtils.post('admin/sysUser/resetPwd', {id: row.id}).then(rs => {
33
+ HttpUtils.post('admin/sysUser/reset-pwd', {id: row.id}).then(rs => {
34
34
  Modal.success({
35
35
  title: '重置密码成功',
36
36
  content: rs
@@ -206,7 +206,7 @@ export default class extends React.Component {
206
206
  open={this.state.formOpen}
207
207
  onOk={() => this.formRef.current.submit()}
208
208
  onCancel={() => this.setState({formOpen: false})}
209
- destroyOnHidden
209
+ destroyOnClose
210
210
  >
211
211
 
212
212
  <Form ref={this.formRef} labelCol={{flex: '100px'}}
@@ -1,15 +1,13 @@
1
1
  import React from "react";
2
2
  import {Button, Form, Input, Modal} from "antd";
3
-
4
-
5
3
  import {history} from 'umi'
6
- import {HttpUtils} from "../../framework";
4
+ import {HttpUtils, SysUtils} from "../../framework";
7
5
 
8
6
  export default class extends React.Component {
9
7
 
10
8
 
11
9
  onFinish = (values) => {
12
- HttpUtils.post('admin/userCenter/updatePwd', values).then(() => {
10
+ HttpUtils.post('admin/userCenter/update-pwd', values).then(() => {
13
11
  Modal.success({
14
12
  title: '提示',
15
13
  content: '修改密码成功',
@@ -23,7 +21,7 @@ export default class extends React.Component {
23
21
 
24
22
  validator = (rule, value) => {
25
23
  return new Promise((resolve, reject) => {
26
- HttpUtils.get("admin/sysUser/pwdStrength", {password: value}).then(response => {
24
+ HttpUtils.get("admin/sysUser/pwd-strength", {password: value}).then(response => {
27
25
  const rs = response.data
28
26
  if (!rs.success) {
29
27
  reject(rs.message)
@@ -45,7 +45,7 @@ export default class extends React.Component {
45
45
  return <Page>
46
46
  <ProTable
47
47
  actionRef={this.tableRef}
48
- request={(params) => HttpUtils.get('admin/sysManual/pageForUser', params)}
48
+ request={(params) => HttpUtils.get('admin/sysManual/page-for-user', params)}
49
49
  columns={this.columns}
50
50
  />
51
51
  </Page>
@@ -56,7 +56,7 @@ export default class extends React.Component {
56
56
  render() {
57
57
  return <Card variant={"borderless"}>
58
58
 
59
- <Tabs defaultActiveKey="0" destroyOnHidden
59
+ <Tabs defaultActiveKey="0" destroyOnClose
60
60
  >
61
61
  <Tabs.TabPane key='0' tab='所有消息'>
62
62
  <ProTable
@@ -1,11 +0,0 @@
1
- import React from "react";
2
-
3
-
4
- declare type DownloadFileButtonProps = {
5
- url: String;
6
- params: any
7
-
8
- };
9
-
10
- export class DownloadFileButton extends React.Component<DownloadFileButtonProps, any> {
11
- }
@@ -1,23 +0,0 @@
1
- // @ts-ignore
2
- import React from "react";
3
-
4
- // 推荐(16+8n)px 作为间隔,n为自然数
5
- declare type GapProps = {
6
- /**
7
- * mini 4px
8
- * middle 8px
9
- * large 16px
10
- *
11
- * 默认 middle
12
- */
13
- size?: 'small' | 'middle' | 'large';
14
-
15
- /** 方向:水平或垂直
16
- * 默认垂直:上下间隔
17
- *
18
- */
19
- direction?: 'horizontal' | 'vertical';
20
- };
21
-
22
- export class Gap extends React.Component<GapProps, any> {
23
- }
@@ -1,46 +0,0 @@
1
- import React from "react";
2
-
3
- /**
4
- * 上下间隔
5
- */
6
- export class Gap extends React.Component {
7
-
8
- static defaultProps = {
9
- size: 'middle',
10
- direction: 'vertical',
11
- };
12
-
13
- render() {
14
- const {n = 0, size, direction} = this.props;
15
- if (n) {
16
- console.warn('参数 n 已经不被支持')
17
- return
18
- }
19
-
20
- const SizeMap = {
21
- x: 4,
22
- small: 8,
23
- middle: 16,
24
- large: 24,
25
- xLarge: 32,
26
- xxLarge: 40,
27
- };
28
-
29
-
30
- let sizePx = SizeMap[size];
31
- const isHorizontal = direction === 'horizontal';
32
-
33
-
34
- // 水平间隔:有宽度,无高度
35
- // 垂直间隔:有高度,无宽度
36
- const width = isHorizontal ? sizePx : 0;
37
- const height = isHorizontal ? 0 : sizePx;
38
-
39
- // 水平间隔用 inline-block(避免换行),垂直间隔用 block
40
- const display = isHorizontal ? 'inline-block' : 'block';
41
-
42
- const style = {display, height, width}
43
-
44
- return <div style={style}></div>
45
- }
46
- }
@@ -1,14 +0,0 @@
1
- // @ts-ignore
2
- import React from "react";
3
-
4
- interface LinkButtonProps {
5
- /**
6
- * 路径
7
- */
8
- path: string;
9
- label: string;
10
- type?: 'primary' | 'default' | 'dashed' | 'link' | 'text' | 'ghost'
11
- };
12
-
13
- export class LinkButton extends React.Component<LinkButtonProps, any> {
14
- }
@@ -1,4 +0,0 @@
1
- import React from "react";
2
-
3
- export class OrgTree extends React.Component<any, any> {
4
- }
@@ -1,17 +0,0 @@
1
- // @ts-ignore
2
- import React from "react";
3
-
4
- declare type PageProps = {
5
- /**
6
- * 是否有内边距
7
- */
8
- padding?: boolean;
9
-
10
- /**
11
- * 背景色
12
- */
13
- backgroundGray?:boolean;
14
- };
15
-
16
- export class Page extends React.Component<PageProps, any> {
17
- }