kn-cli 1.0.131 → 1.0.134

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 (211) hide show
  1. package/build/shellUtil.sh +2 -2
  2. package/build/start.sh +3 -2
  3. package/build/vite.config.js +1 -1
  4. package/package.json +2 -1
  5. package/src/create.js +2 -0
  6. package/templates/template_admin_antd5/.vscode/settings.json +28 -0
  7. package/templates/template_admin_antd5/build.sh +8 -0
  8. package/templates/template_admin_antd5/cli.config.js +35 -0
  9. package/templates/template_admin_antd5/dev.sh +33 -0
  10. package/templates/template_admin_antd5/frontend_build.sh +48 -0
  11. package/templates/template_admin_antd5/init/prepare-commit-msg +5 -0
  12. package/templates/template_admin_antd5/init.sh +24 -0
  13. package/templates/template_admin_antd5/jsconfig.json +17 -0
  14. package/templates/template_admin_antd5/package.json +27 -0
  15. package/templates/template_admin_antd5/public/404.html +26 -0
  16. package/templates/template_admin_antd5/public/favicon.png +0 -0
  17. package/templates/template_admin_antd5/public/index.html +48 -0
  18. package/templates/template_admin_antd5/public/src/_antd.less +37 -0
  19. package/templates/template_admin_antd5/public/src/_mixin.module.less +79 -0
  20. package/templates/template_admin_antd5/public/src/_reset.module.less +134 -0
  21. package/templates/template_admin_antd5/public/src/_variable.module.less +85 -0
  22. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.eot +0 -0
  23. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.module.less +109 -0
  24. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.svg +75 -0
  25. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.ttf +0 -0
  26. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.woff +0 -0
  27. package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.woff2 +0 -0
  28. package/templates/template_admin_antd5/public/src/assets/images/arrow.png +0 -0
  29. package/templates/template_admin_antd5/public/src/assets/images/avatar.png +0 -0
  30. package/templates/template_admin_antd5/public/src/assets/images/icon-notice.png +0 -0
  31. package/templates/template_admin_antd5/public/src/assets/images/icon-user.png +0 -0
  32. package/templates/template_admin_antd5/public/src/assets/images/loadFail.png +0 -0
  33. package/templates/template_admin_antd5/public/src/assets/images/loading.svg +40 -0
  34. package/templates/template_admin_antd5/public/src/assets/images/login/bg.png +0 -0
  35. package/templates/template_admin_antd5/public/src/assets/images/login/logo.png +0 -0
  36. package/templates/template_admin_antd5/public/src/assets/images/login/slogan.png +0 -0
  37. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-dep-active.png +0 -0
  38. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-dep.png +0 -0
  39. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-log-active.png +0 -0
  40. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-log.png +0 -0
  41. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-loginlog-active.png +0 -0
  42. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-loginlog.png +0 -0
  43. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-role-active.png +0 -0
  44. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-role.png +0 -0
  45. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-user-active.png +0 -0
  46. package/templates/template_admin_antd5/public/src/assets/images/nav/icon-user.png +0 -0
  47. package/templates/template_admin_antd5/public/src/assets/images/nav/nav-toggle.png +0 -0
  48. package/templates/template_admin_antd5/public/src/assets/images/nav/slogan.png +0 -0
  49. package/templates/template_admin_antd5/public/src/assets/images/noData.png +0 -0
  50. package/templates/template_admin_antd5/public/src/assets/images/noSelect.png +0 -0
  51. package/templates/template_admin_antd5/public/src/assets/images/permission/403.png +0 -0
  52. package/templates/template_admin_antd5/public/src/assets/images/permission/404.png +0 -0
  53. package/templates/template_admin_antd5/public/src/assets/images/permission/503.png +0 -0
  54. package/templates/template_admin_antd5/public/src/assets/images/play.png +0 -0
  55. package/templates/template_admin_antd5/public/src/components/_table/column.jsx +47 -0
  56. package/templates/template_admin_antd5/public/src/components/_table/column.module.less +12 -0
  57. package/templates/template_admin_antd5/public/src/components/_table/index.jsx +71 -0
  58. package/templates/template_admin_antd5/public/src/components/_table/index.module.less +15 -0
  59. package/templates/template_admin_antd5/public/src/components/antd/antProvider.jsx +21 -0
  60. package/templates/template_admin_antd5/public/src/components/antd/index.jsx +146 -0
  61. package/templates/template_admin_antd5/public/src/components/antd/select/index.jsx +296 -0
  62. package/templates/template_admin_antd5/public/src/components/antd/select/index.module.less +21 -0
  63. package/templates/template_admin_antd5/public/src/components/antd/theme.js +173 -0
  64. package/templates/template_admin_antd5/public/src/components/antd/tooltip/detail/index.jsx +70 -0
  65. package/templates/template_admin_antd5/public/src/components/antd/tooltip/detail/index.module.less +12 -0
  66. package/templates/template_admin_antd5/public/src/components/antd/tooltip/index.jsx +69 -0
  67. package/templates/template_admin_antd5/public/src/components/antd/tooltip/index.module.less +28 -0
  68. package/templates/template_admin_antd5/public/src/components/auth/index.jsx +123 -0
  69. package/templates/template_admin_antd5/public/src/components/auth/index.module.less +7 -0
  70. package/templates/template_admin_antd5/public/src/components/auth/navCheck.jsx +27 -0
  71. package/templates/template_admin_antd5/public/src/components/badge/index.jsx +47 -0
  72. package/templates/template_admin_antd5/public/src/components/badge/index.module.less +44 -0
  73. package/templates/template_admin_antd5/public/src/components/button/index.jsx +17 -0
  74. package/templates/template_admin_antd5/public/src/components/debug/index.jsx +28 -0
  75. package/templates/template_admin_antd5/public/src/components/debug/index.module.less +10 -0
  76. package/templates/template_admin_antd5/public/src/components/empty/index.jsx +28 -0
  77. package/templates/template_admin_antd5/public/src/components/empty/index.module.less +20 -0
  78. package/templates/template_admin_antd5/public/src/components/error/index.jsx +39 -0
  79. package/templates/template_admin_antd5/public/src/components/icon/index.jsx +128 -0
  80. package/templates/template_admin_antd5/public/src/components/icon/playVideo/index.jsx +21 -0
  81. package/templates/template_admin_antd5/public/src/components/icon/playVideo/index.module.less +16 -0
  82. package/templates/template_admin_antd5/public/src/components/iconFont/index.jsx +20 -0
  83. package/templates/template_admin_antd5/public/src/components/iconFont/index.module.less +5 -0
  84. package/templates/template_admin_antd5/public/src/components/image/index.jsx +73 -0
  85. package/templates/template_admin_antd5/public/src/components/image/index.module.less +117 -0
  86. package/templates/template_admin_antd5/public/src/components/image/preview.jsx +85 -0
  87. package/templates/template_admin_antd5/public/src/components/layout/basic/index.jsx +49 -0
  88. package/templates/template_admin_antd5/public/src/components/layout/basic/index.module.less +76 -0
  89. package/templates/template_admin_antd5/public/src/components/layout/index.jsx +39 -0
  90. package/templates/template_admin_antd5/public/src/components/layout/index.module.less +63 -0
  91. package/templates/template_admin_antd5/public/src/components/layout/provider/index.jsx +32 -0
  92. package/templates/template_admin_antd5/public/src/components/leftMenu/index.jsx +106 -0
  93. package/templates/template_admin_antd5/public/src/components/leftMenu/index.module.less +42 -0
  94. package/templates/template_admin_antd5/public/src/components/link/index.jsx +39 -0
  95. package/templates/template_admin_antd5/public/src/components/link/index.module.less +11 -0
  96. package/templates/template_admin_antd5/public/src/components/menuIcon/index.jsx +33 -0
  97. package/templates/template_admin_antd5/public/src/components/menuIcon/index.module.less +49 -0
  98. package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.jsx +51 -0
  99. package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.module.less +29 -0
  100. package/templates/template_admin_antd5/public/src/components/popup/index.jsx +60 -0
  101. package/templates/template_admin_antd5/public/src/components/popup/index.module.less +18 -0
  102. package/templates/template_admin_antd5/public/src/components/react/index.jsx +13 -0
  103. package/templates/template_admin_antd5/public/src/components/resizeBox/index.jsx +144 -0
  104. package/templates/template_admin_antd5/public/src/components/resizeBox/index.module.css +90 -0
  105. package/templates/template_admin_antd5/public/src/components/select/defaultServicesSelect/index.jsx +182 -0
  106. package/templates/template_admin_antd5/public/src/components/select/dictSelect/index.jsx +84 -0
  107. package/templates/template_admin_antd5/public/src/components/select/index.jsx +7 -0
  108. package/templates/template_admin_antd5/public/src/components/select/useSelectList.jsx +217 -0
  109. package/templates/template_admin_antd5/public/src/components/table/aliTable/index.jsx +250 -0
  110. package/templates/template_admin_antd5/public/src/components/table/aliTable/index.module.less +105 -0
  111. package/templates/template_admin_antd5/public/src/components/table/column.jsx +128 -0
  112. package/templates/template_admin_antd5/public/src/components/table/column.module.less +50 -0
  113. package/templates/template_admin_antd5/public/src/components/table/imageTable/index.jsx +302 -0
  114. package/templates/template_admin_antd5/public/src/components/table/imageTable/index.module.less +196 -0
  115. package/templates/template_admin_antd5/public/src/components/table/imageTable/radio.jsx +15 -0
  116. package/templates/template_admin_antd5/public/src/components/table/imageTable/radio.module.less +18 -0
  117. package/templates/template_admin_antd5/public/src/components/table/index.jsx +475 -0
  118. package/templates/template_admin_antd5/public/src/components/table/index.module.less +133 -0
  119. package/templates/template_admin_antd5/public/src/components/text/index.jsx +98 -0
  120. package/templates/template_admin_antd5/public/src/components/text/index.module.less +13 -0
  121. package/templates/template_admin_antd5/public/src/components/toast/index.jsx +79 -0
  122. package/templates/template_admin_antd5/public/src/components/toast/index.module.less +43 -0
  123. package/templates/template_admin_antd5/public/src/components/topMenu/index.jsx +102 -0
  124. package/templates/template_admin_antd5/public/src/components/topMenu/index.module.less +89 -0
  125. package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.jsx +81 -0
  126. package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.module.less +97 -0
  127. package/templates/template_admin_antd5/public/src/components/video/index.jsx +96 -0
  128. package/templates/template_admin_antd5/public/src/components/video/index.module.less +132 -0
  129. package/templates/template_admin_antd5/public/src/components/video/preview.jsx +38 -0
  130. package/templates/template_admin_antd5/public/src/config.js +31 -0
  131. package/templates/template_admin_antd5/public/src/declarations.d.ts +1 -0
  132. package/templates/template_admin_antd5/public/src/dictionary/dictionary.js +289 -0
  133. package/templates/template_admin_antd5/public/src/dictionary/index.jsx +64 -0
  134. package/templates/template_admin_antd5/public/src/enum.js +41 -0
  135. package/templates/template_admin_antd5/public/src/hooks/index.jsx +29 -0
  136. package/templates/template_admin_antd5/public/src/hooks/useDebounceFn.jsx +33 -0
  137. package/templates/template_admin_antd5/public/src/hooks/useDelay.jsx +34 -0
  138. package/templates/template_admin_antd5/public/src/hooks/useEsc.jsx +98 -0
  139. package/templates/template_admin_antd5/public/src/hooks/useImageLoader.jsx +26 -0
  140. package/templates/template_admin_antd5/public/src/hooks/useInToView.jsx +58 -0
  141. package/templates/template_admin_antd5/public/src/hooks/useLoading.jsx +46 -0
  142. package/templates/template_admin_antd5/public/src/hooks/usePreload.jsx +67 -0
  143. package/templates/template_admin_antd5/public/src/hooks/useRouteMenu.jsx +263 -0
  144. package/templates/template_admin_antd5/public/src/hooks/useScrollTop.jsx +44 -0
  145. package/templates/template_admin_antd5/public/src/hooks/useSearch.jsx +163 -0
  146. package/templates/template_admin_antd5/public/src/hooks/useTableRowSelect.jsx +310 -0
  147. package/templates/template_admin_antd5/public/src/hooks/useThrottole.jsx +68 -0
  148. package/templates/template_admin_antd5/public/src/hooks/useTimer.jsx +42 -0
  149. package/templates/template_admin_antd5/public/src/hooks/useUpdate.jsx +16 -0
  150. package/templates/template_admin_antd5/public/src/hooks/useWatchServices.jsx +124 -0
  151. package/templates/template_admin_antd5/public/src/index.jsx +89 -0
  152. package/templates/template_admin_antd5/public/src/menuConfig/auth.jsx +92 -0
  153. package/templates/template_admin_antd5/public/src/menuConfig/dashboard.jsx +25 -0
  154. package/templates/template_admin_antd5/public/src/menuConfig/dna.jsx +76 -0
  155. package/templates/template_admin_antd5/public/src/menuConfig/index.jsx +17 -0
  156. package/templates/template_admin_antd5/public/src/mock/auth.js +33 -0
  157. package/templates/template_admin_antd5/public/src/mock/demo.js +122 -0
  158. package/templates/template_admin_antd5/public/src/mock/index.js +65 -0
  159. package/templates/template_admin_antd5/public/src/mock/utils.js +33 -0
  160. package/templates/template_admin_antd5/public/src/pages/antdComponents/index.jsx +142 -0
  161. package/templates/template_admin_antd5/public/src/pages/auth/user/create/index.jsx +47 -0
  162. package/templates/template_admin_antd5/public/src/pages/auth/user/create/index.module.less +6 -0
  163. package/templates/template_admin_antd5/public/src/pages/auth/user/dialog/index.jsx +96 -0
  164. package/templates/template_admin_antd5/public/src/pages/auth/user/index.jsx +214 -0
  165. package/templates/template_admin_antd5/public/src/pages/components/layout/index.jsx +75 -0
  166. package/templates/template_admin_antd5/public/src/pages/components/layout/index.module.less +78 -0
  167. package/templates/template_admin_antd5/public/src/pages/components/layout/titleBar/index.jsx +28 -0
  168. package/templates/template_admin_antd5/public/src/pages/components/layout/titleBar/index.module.less +44 -0
  169. package/templates/template_admin_antd5/public/src/pages/components/select/user.jsx +18 -0
  170. package/templates/template_admin_antd5/public/src/pages/demo/page1.jsx +21 -0
  171. package/templates/template_admin_antd5/public/src/pages/demo/page2.jsx +21 -0
  172. package/templates/template_admin_antd5/public/src/pages/demo/page3.jsx +21 -0
  173. package/templates/template_admin_antd5/public/src/pages/error/403.jsx +15 -0
  174. package/templates/template_admin_antd5/public/src/pages/error/404.jsx +15 -0
  175. package/templates/template_admin_antd5/public/src/pages/error/503.jsx +15 -0
  176. package/templates/template_admin_antd5/public/src/pages/error/permission.jsx +40 -0
  177. package/templates/template_admin_antd5/public/src/pages/error/permission.module.less +16 -0
  178. package/templates/template_admin_antd5/public/src/pages/home.jsx +90 -0
  179. package/templates/template_admin_antd5/public/src/pages/home.module.less +6 -0
  180. package/templates/template_admin_antd5/public/src/pages/login/index.jsx +113 -0
  181. package/templates/template_admin_antd5/public/src/pages/login/index.module.less +153 -0
  182. package/templates/template_admin_antd5/public/src/pages/pageTemplate.jsx +28 -0
  183. package/templates/template_admin_antd5/public/src/provider/app.jsx +201 -0
  184. package/templates/template_admin_antd5/public/src/provider/loading.jsx +47 -0
  185. package/templates/template_admin_antd5/public/src/provider/menu.jsx +161 -0
  186. package/templates/template_admin_antd5/public/src/provider/menu.module.less +35 -0
  187. package/templates/template_admin_antd5/public/src/route.jsx +127 -0
  188. package/templates/template_admin_antd5/public/src/services/demo.js +85 -0
  189. package/templates/template_admin_antd5/public/src/services/excel.js +43 -0
  190. package/templates/template_admin_antd5/public/src/services/http/index.js +155 -0
  191. package/templates/template_admin_antd5/public/src/services/index.js +126 -0
  192. package/templates/template_admin_antd5/public/src/services/interceptor/index.js +67 -0
  193. package/templates/template_admin_antd5/public/src/services/login.js +37 -0
  194. package/templates/template_admin_antd5/public/src/services/socket/index.jsx +99 -0
  195. package/templates/template_admin_antd5/public/src/services/token/index.js +41 -0
  196. package/templates/template_admin_antd5/public/src/type.js +67 -0
  197. package/templates/template_admin_antd5/public/src/utils/event.js +58 -0
  198. package/templates/template_admin_antd5/public/src/utils/format.js +135 -0
  199. package/templates/template_admin_antd5/public/src/utils/index.js +727 -0
  200. package/templates/template_admin_antd5/public/src/utils/menu.js +33 -0
  201. package/templates/template_admin_antd5/public/src/utils/rule.js +277 -0
  202. package/templates/template_admin_antd5/public/src/utils/storage.js +30 -0
  203. package/templates/template_admin_antd5/public/static/about.html +1 -0
  204. package/templates/template_admin_antd5/public/static/kssoLogin.html +22 -0
  205. package/templates/template_admin_antd5/readme.md +84 -0
  206. package/templates/template_admin_antd5/renamejstojsx.js +45 -0
  207. package/templates/template_admin_antd5/renameless.js +53 -0
  208. package/templates/template_admin_antd5/report.sh +25 -0
  209. package/templates/template_admin_antd5/shellUtil.sh +110 -0
  210. package/templates/template_admin_antd5/versionPublish.sh +16 -0
  211. package/templates/template_admin_antd5/webpack.api.js +105 -0
@@ -0,0 +1,96 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ // @ts-ignore
3
+ import { Modal, Form, Input, message,Spin } from '@/components/antd';
4
+ import Popup from '@/components/popup';
5
+ import { UPDATE,GET_DETAIL } from '@/services/demo';
6
+ import rule from '@/utils/rule';
7
+ import { ReactRender } from '@/components/react';
8
+
9
+
10
+
11
+
12
+ const DialogEdit = (props) => {
13
+ const { destory, id=null } = props;
14
+ const [form] = Form.useForm();
15
+ const [record,setRecord]=useState(null)
16
+
17
+ const init=async ()=>{
18
+ if(id){
19
+ const req= await GET_DETAIL({id})
20
+ if(req?.code==0 && req?.data){
21
+ let item= req.data;
22
+ setRecord(item);
23
+ return;
24
+ }
25
+ }
26
+ setRecord({})
27
+ }
28
+ const onOk = async () => {
29
+ try {
30
+ const values = await form.validateFields();
31
+ const params = {
32
+ ...values,
33
+ };
34
+ let res = null;
35
+ if (id) {
36
+ res = await UPDATE({id,...params});
37
+ }
38
+ if (res?.code === 0) {
39
+ message.success('成功');
40
+ destory && destory(true);
41
+ }
42
+ } catch (errorInfo) {
43
+ console.log('Failed:', errorInfo);
44
+ }
45
+ };
46
+
47
+ const onCancel = () => {
48
+ form.resetFields();
49
+ destory && destory(false);
50
+ };
51
+
52
+ useEffect(()=>{
53
+ init();
54
+ },[])
55
+ const isEdit=id?true:false;
56
+ return (
57
+ <Modal
58
+ maskClosable={false}
59
+ title={isEdit? '编辑用户' : '新增用户'}
60
+ width={600}
61
+ open={true}
62
+ onOk={onOk}
63
+ onCancel={onCancel}
64
+ >
65
+ {
66
+ !record?
67
+ <Spin/>:
68
+ <Form labelCol={{ span: 5 }} wrapperCol={{ span: 19 }} form={form} initialValues={record||{}}>
69
+ <Form.Item
70
+ label="姓名"
71
+ name="userId"
72
+ ruler={rule.INPUT}
73
+ required
74
+ >
75
+ <Input placeholder="请输入" disabled={isEdit}/>
76
+ </Form.Item>
77
+ <Form.Item label="昵称" name="bindNickname" ruler={rule.INPUT}>
78
+ <Input placeholder="请输入" />
79
+ </Form.Item>
80
+
81
+ </Form>
82
+ }
83
+ </Modal>
84
+ );
85
+ };
86
+
87
+ const ShowEdit = (props = {}) => {
88
+ return new Promise((resolve) => {
89
+ let popup = Popup(resolve);
90
+ ReactRender(
91
+ <DialogEdit destory={popup.destory} {...props} />,
92
+ popup.dom
93
+ );
94
+ });
95
+ };
96
+ export default ShowEdit;
@@ -0,0 +1,214 @@
1
+ import React from 'react';
2
+ import {
3
+ Space,
4
+ Form,
5
+ Button,
6
+ Input,
7
+ Select,
8
+ Tabs,
9
+ Badge
10
+ // @ts-ignore
11
+ } from '@/components/antd';
12
+ // @ts-ignore
13
+ import {useNavigate,} from 'react-router-dom';
14
+ // @ts-ignore
15
+ import {PlusOutlined} from '@ant-design/icons';
16
+
17
+ import ruler from '@/utils/rule';
18
+ import {px2rem} from '@/utils';
19
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
20
+ import Table from '@/components/table';
21
+ import { usePaginationWithForm } from '@/hooks';
22
+ import Link from '@/components/link';
23
+ import {FormatTableService,FormatGetRequest} from '@/services'
24
+ import {
25
+ GET_LIST,
26
+ } from '@/services/demo';
27
+
28
+
29
+ import ShowEdit from './dialog';
30
+
31
+
32
+ const AuthUser = () => {
33
+ const navigator = useNavigate();
34
+
35
+ const [form] = Form.useForm();
36
+
37
+ const page = usePaginationWithForm({
38
+ afterService: [FormatTableService],
39
+ beforeService:[FormatGetRequest],
40
+ service: GET_LIST,
41
+ pagination: { pageSize: 15 },
42
+ form
43
+ });
44
+
45
+ const onSearch=()=>{
46
+ page.update({ pagination: { current: 1 }, clear: true });
47
+ }
48
+ const onReset=()=>{}
49
+
50
+ const onPageChange = (current, pageSize) => {
51
+ page.update({ pagination: { current, pageSize }, clear: true });
52
+ };
53
+
54
+ const onCreate=()=>{
55
+ navigator('/auth/user/create')
56
+ }
57
+ const onEdit=async (record)=>{
58
+ const req = await ShowEdit({id:record.id})
59
+ }
60
+
61
+ const columnsInternalUsers = [
62
+ {
63
+ title: '姓名',
64
+ dataIndex: 'name',
65
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={88}>{text}</Table.Column>)
66
+ },
67
+ {
68
+ title: '用户名',
69
+ dataIndex: 'name',
70
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={80}>{text}</Table.Column>)
71
+ },
72
+ {
73
+ title: '职位',
74
+ dataIndex: 'name',
75
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={94}>{text}</Table.Column>)
76
+ },
77
+ {
78
+ title: '所在部门',
79
+ dataIndex: 'longName',
80
+ render:(text,record)=>(<Table.Column minWidth={100} maxWidth={224}>{text}</Table.Column>)
81
+ },
82
+ {
83
+ title: '角色',
84
+ dataIndex: 'name',
85
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={111}>{text}</Table.Column>)
86
+ },
87
+ {
88
+ title: '模块权限(补充)',
89
+ dataIndex: 'longName',
90
+ render:(text,record)=>(<Table.Column minWidth={120} maxWidth={187}>{text}</Table.Column>)
91
+ },
92
+ {
93
+ title: '产品权限(补充)',
94
+ dataIndex: 'longName',
95
+ render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
96
+ },
97
+
98
+ {
99
+ title: '操作',
100
+ key: 'option',
101
+ width:104,
102
+ fixed:'right',
103
+ align:'center',
104
+ render: (_, record) => {
105
+ return <Link onClick={onEdit.bind(this,record)} >编辑</Link>
106
+
107
+ }
108
+ },
109
+ ];
110
+ const columnsExternalUsers = [
111
+ {
112
+ title: '姓名',
113
+ dataIndex: 'name',
114
+ fixed:'left',
115
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={88} item={record}>{text}</Table.Column>)
116
+
117
+ },
118
+ {
119
+ title: '公司',
120
+ dataIndex: 'name',
121
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={224}>{text}</Table.Column>)
122
+ },
123
+ {
124
+ title: '所在部门',
125
+ dataIndex: 'name',
126
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={224}>{text}</Table.Column>)
127
+ },
128
+ {
129
+ title: '角色',
130
+ dataIndex: 'name',
131
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={110}>{text}</Table.Column>)
132
+ },
133
+ {
134
+ title: '模块权限(补充)',
135
+ dataIndex: 'longName',
136
+ render:(text,record)=>(<Table.Column minWidth={120} maxWidth={187}>{text}</Table.Column>)
137
+ },
138
+ {
139
+ title: '产品权限(补充)',
140
+ dataIndex: 'longName',
141
+ render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
142
+ },
143
+
144
+ {
145
+ title: '操作',
146
+ key: 'option',
147
+ width:104,
148
+ fixed:'right',
149
+ align:'center',
150
+ render: (_, record) => {
151
+ return <Link onClick={onEdit.bind(this,record)} >编辑</Link>
152
+ }
153
+ },
154
+ ];
155
+ const tabs = [
156
+ {
157
+ key: '1',
158
+ label: '内部用户',
159
+ children: <Table page={page}
160
+ columns={columnsInternalUsers}
161
+ pagination={{
162
+ onChange: onPageChange,
163
+ }}
164
+ />,
165
+ },
166
+ {
167
+ key: '2',
168
+ label: '外部用户',
169
+ children: <Table page={page}
170
+ columns={columnsExternalUsers}
171
+ pagination={{
172
+ onChange: onPageChange,
173
+ }}
174
+ />,
175
+
176
+ },
177
+ ];
178
+
179
+ const onTab=()=>{}
180
+ return (
181
+ <Layout>
182
+ <SearchBar>
183
+ <TitleBar label='用户管理' />
184
+ <Form form={form} layout="inline" initialValues={{status:'',keyword:'',dep:'',role:''}}>
185
+ <Form.Item label="关键字" name={'keyword'} rules={ruler.KEYWORDS}>
186
+ <Input placeholder="请输入用户名/姓名" onPressEnter={onSearch} />
187
+ </Form.Item>
188
+
189
+ <Space size='middle'>
190
+ <Button onClick={onSearch} type="primary">
191
+ 搜索
192
+ </Button>
193
+ <Button onClick={onReset}>
194
+ 重置
195
+ </Button>
196
+ </Space>
197
+ </Form>
198
+ </SearchBar>
199
+
200
+ <Content>
201
+ <Panel>
202
+ <Tabs defaultActiveKey="1" items={tabs} onChange={onTab}
203
+ tabBarExtraContent={
204
+ {right:<Button icon={<PlusOutlined />} type='primary' onClick={onCreate}>新建用户</Button>}
205
+ }
206
+ />
207
+ </Panel>
208
+ </Content>
209
+
210
+ </Layout>
211
+ )
212
+ }
213
+
214
+ export default AuthUser;
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import { useNavigate } from 'react-router-dom';
4
+ import _TitleBar from './titleBar';
5
+ // @ts-ignore
6
+ import styles from './index.module.less';
7
+
8
+
9
+
10
+ export const Layout = (props) => {
11
+ const { children,className='' } = props;
12
+ return (
13
+ <section className={`${styles.layout} ${className}`}>
14
+ {children}
15
+ </section>
16
+ )
17
+ };
18
+
19
+ export const Content = (props) => {
20
+ const { children,className='' } = props;
21
+ return (
22
+ <section className={`${styles.contentPadding} ${className}`}>
23
+ {children}
24
+ </section>
25
+ )
26
+ };
27
+
28
+ export const Panel = (props) => {
29
+ const { children,className='', title='' } = props;
30
+ return (
31
+ <section className={`${styles.panel} ${className}`}>
32
+ {title&&<label className={styles.panelTitle}>{title}</label>}
33
+ {children}
34
+ </section>
35
+ )
36
+ };
37
+
38
+
39
+
40
+ export const SearchBar = (props) => {
41
+ const { children } = props;
42
+ return <section className={styles.search}>{children}</section>;
43
+ };
44
+
45
+ /**
46
+ * 二级子页面的头部返回导航栏
47
+ * @param {object} props
48
+ * @param {()=>void} [props.onClick] - 监听点击返回按钮,如果没有onClick则触发默认回退操作
49
+ * @param {string|JSX.Element} [props.children] - 展示在返回按钮右侧区域的元素
50
+ *
51
+ * @returns {JSX.Element}
52
+ */
53
+ export const NavBackTitle=(props)=>{
54
+ const {children,onClick:_onClick}= props;
55
+ const navigate = useNavigate()
56
+ const onClick=()=>{
57
+ if(_onClick){
58
+ _onClick();
59
+ return;
60
+ }
61
+ navigate(-1);
62
+
63
+ }
64
+ return (
65
+ <div className={styles.navBack}>
66
+ <div className={styles.backWrap} onClick={onClick}>
67
+ <div className={styles.arrowBack}></div>
68
+ </div>
69
+ <span className={styles.navLabel}>{children||''}</span>
70
+ </div>
71
+ )
72
+ }
73
+
74
+ export const TitleBar = _TitleBar
75
+ export default { Layout, Content, Panel, SearchBar, TitleBar };
@@ -0,0 +1,78 @@
1
+ @import '~@/_mixin.module.less';
2
+
3
+ .layout{
4
+ position: relative;
5
+ width: 100%;
6
+ height: 100%;
7
+ overflow: hidden;
8
+ display: flex;
9
+ flex-direction: column;
10
+ }
11
+ .contentPadding{
12
+ position: relative;
13
+ margin-top: 16px;
14
+ padding:16px;
15
+ padding-top: 0;
16
+ width: 100%;
17
+ flex:1;
18
+ overflow: auto;
19
+ }
20
+
21
+ .panel {
22
+ padding: 24px;
23
+ border-radius: 8px;
24
+ background-color: white;
25
+ &:not(:last-child){
26
+ margin-bottom: 16px;
27
+ }
28
+ .panelTitle{
29
+ font-size: 16px;
30
+ color:#1F2329;
31
+ font-weight: bold;
32
+ }
33
+ }
34
+ .search {
35
+ background-color: #fff;
36
+ padding: 14px 16px;
37
+ min-height: 48px;
38
+ display: flex;
39
+ flex-direction: column;
40
+ row-gap: 12px;
41
+ }
42
+
43
+
44
+ .navBack{
45
+ display: flex;
46
+ align-items: center;
47
+ column-gap: 14px;
48
+ .backWrap{
49
+ width: 28px;
50
+ height: 28px;
51
+ border-radius: 4px;
52
+ border:1px solid #BBBFC4;
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ cursor: pointer;
57
+ &:hover{
58
+ border-color: #a6adb8;
59
+ .arrowBack{
60
+ border-color: #a6adb8;
61
+ }
62
+ }
63
+ .arrowBack{
64
+ width: 8px;
65
+ height: 8px;
66
+ border:1px solid #BBBFC4;
67
+ border-right: 0;
68
+ border-bottom: 0;
69
+ transform: translateX(25%) rotateZ(-45deg);
70
+ }
71
+ }
72
+ .navLabel{
73
+ font-weight: 600;
74
+ font-size: 20px;
75
+ color: #1F2329;
76
+ line-height: 23px;
77
+ }
78
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import { useNavigate } from 'react-router-dom';
4
+
5
+ // @ts-ignore
6
+ import imgArrow from '@/assets/images/arrow.png';
7
+ // @ts-ignore
8
+ import styles from './index.module.less';
9
+
10
+ const TitleBar = (props) => {
11
+ const { optionLeft, optionRight,label,showBack,className='' } = props;
12
+
13
+ const navigate = useNavigate();
14
+ const onBack=()=>{
15
+ navigate(-1);
16
+ }
17
+ return (
18
+ <section className={`${styles.title} ${className}`}>
19
+ <hgroup className={styles.left}>
20
+ {showBack&&<div className={styles.iconBack} onClick={onBack}><img src={imgArrow} /></div>}
21
+ {label&&<span className={styles.label}>{label}</span>}
22
+ <div className={styles.left}>{optionLeft || ''}</div>
23
+ </hgroup>
24
+ <div className={styles.right}>{optionRight || ''}</div>
25
+ </section>
26
+ );
27
+ };
28
+ export default TitleBar;
@@ -0,0 +1,44 @@
1
+ @import '~@/_mixin.module.less';
2
+
3
+
4
+ .title {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ align-items: center;
8
+ min-height: 36px;
9
+
10
+ .iconBack{
11
+ margin-right: 8px;
12
+ width: 24px;
13
+ height: 24px;
14
+ background-color: #F5F8FF;
15
+ border-radius: 4px;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ cursor: pointer;
20
+ img{
21
+ width: 16px;
22
+ height: 16px;
23
+ transform: rotateY(180deg);
24
+ }
25
+ }
26
+ .label{
27
+ font-weight: bold;
28
+ font-size: 18px;
29
+ color:#000;
30
+
31
+ }
32
+ .right,
33
+ .left {
34
+ display: flex;
35
+ align-items: center;
36
+ .no-select;
37
+
38
+ }
39
+ .right{
40
+ column-gap: 16px;
41
+ }
42
+ }
43
+
44
+
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+
3
+ import {DictSelect} from "@/components/select";
4
+ import { useEmDemos } from "@/dictionary";
5
+
6
+
7
+ /**
8
+ * APP状态
9
+ * @param {import("@/components/select/useSelectList").SelectListProps} props
10
+ * @returns {JSX.Element}
11
+ */
12
+ const SelectUser = (props) => {
13
+ const list = useEmDemos();
14
+ return <DictSelect {...props} emDict={{list:list.types}} />;
15
+ };
16
+
17
+
18
+ export default SelectUser;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page1-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page2-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page3-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image403 from '@/assets/images/permission/403.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 403页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page403 = () => {
11
+
12
+ return <Permission title='没有访问权限!' backButton img={image403} />
13
+ }
14
+
15
+ export default Page403;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image404 from '@/assets/images/permission/404.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 404页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page404 = () => {
11
+
12
+ return <Permission title='您访问的页面不存在!' backButton img={image404} />
13
+ }
14
+
15
+ export default Page404;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image503 from '@/assets/images/permission/503.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 503页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page503 = () => {
11
+
12
+ return <Permission title='系统维护中,请稍后...' img={image503} />
13
+ }
14
+
15
+ export default Page503;