kn-cli 1.0.96 → 1.0.98

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 (135) hide show
  1. package/build/package.json +1 -0
  2. package/package.json +1 -1
  3. package/readme.md +3 -0
  4. package/templates/template_admin/cli.config.js +4 -1
  5. package/templates/template_admin/package.json +7 -1
  6. package/templates/template_admin/public/favicon.png +0 -0
  7. package/templates/template_admin/public/index.html +6 -4
  8. package/templates/template_admin/public/src/_antd.less +30 -3
  9. package/templates/template_admin/public/src/_mixin.less +41 -0
  10. package/templates/template_admin/public/src/_reset.less +28 -20
  11. package/templates/template_admin/public/src/_variable.less +11 -6
  12. package/templates/template_admin/public/src/assets/iconfont/iconfont.eot +0 -0
  13. package/templates/template_admin/public/src/assets/iconfont/iconfont.less +60 -8
  14. package/templates/template_admin/public/src/assets/iconfont/iconfont.svg +57 -18
  15. package/templates/template_admin/public/src/assets/iconfont/iconfont.ttf +0 -0
  16. package/templates/template_admin/public/src/assets/iconfont/iconfont.woff +0 -0
  17. package/templates/template_admin/public/src/assets/iconfont/iconfont.woff2 +0 -0
  18. package/templates/template_admin/public/src/assets/images/arrow.png +0 -0
  19. package/templates/template_admin/public/src/assets/images/icon-notice.png +0 -0
  20. package/templates/template_admin/public/src/assets/images/icon-user.png +0 -0
  21. package/templates/template_admin/public/src/assets/images/loadFail.png +0 -0
  22. package/templates/template_admin/public/src/assets/images/login/bg.png +0 -0
  23. package/templates/template_admin/public/src/assets/images/login/logo.png +0 -0
  24. package/templates/template_admin/public/src/assets/images/login/slogan.png +0 -0
  25. package/templates/template_admin/public/src/assets/images/nav/icon-dep-active.png +0 -0
  26. package/templates/template_admin/public/src/assets/images/nav/icon-dep.png +0 -0
  27. package/templates/template_admin/public/src/assets/images/nav/icon-log-active.png +0 -0
  28. package/templates/template_admin/public/src/assets/images/nav/icon-log.png +0 -0
  29. package/templates/template_admin/public/src/assets/images/nav/icon-loginlog-active.png +0 -0
  30. package/templates/template_admin/public/src/assets/images/nav/icon-loginlog.png +0 -0
  31. package/templates/template_admin/public/src/assets/images/nav/icon-role-active.png +0 -0
  32. package/templates/template_admin/public/src/assets/images/nav/icon-role.png +0 -0
  33. package/templates/template_admin/public/src/assets/images/nav/icon-user-active.png +0 -0
  34. package/templates/template_admin/public/src/assets/images/nav/icon-user.png +0 -0
  35. package/templates/template_admin/public/src/assets/images/nav/nav-toggle.png +0 -0
  36. package/templates/template_admin/public/src/assets/images/nav/slogan.png +0 -0
  37. package/templates/template_admin/public/src/assets/images/noData.png +0 -0
  38. package/templates/template_admin/public/src/assets/images/noSelect.png +0 -0
  39. package/templates/template_admin/public/src/components/auth/index.jsx +7 -3
  40. package/templates/template_admin/public/src/components/auth/index.less +7 -0
  41. package/templates/template_admin/public/src/components/badge/index.jsx +47 -0
  42. package/templates/template_admin/public/src/components/badge/index.less +44 -0
  43. package/templates/template_admin/public/src/components/debug/index.jsx +27 -0
  44. package/templates/template_admin/public/src/components/debug/index.less +9 -0
  45. package/templates/template_admin/public/src/components/empty/index.jsx +28 -0
  46. package/templates/template_admin/public/src/components/empty/index.less +20 -0
  47. package/templates/template_admin/public/src/components/image/index.jsx +73 -0
  48. package/templates/template_admin/public/src/components/image/index.less +117 -0
  49. package/templates/template_admin/public/src/components/image/preview.jsx +85 -0
  50. package/templates/template_admin/public/src/components/layout/basic/index.jsx +24 -11
  51. package/templates/template_admin/public/src/components/layout/basic/index.less +58 -19
  52. package/templates/template_admin/public/src/components/layout/index.jsx +20 -17
  53. package/templates/template_admin/public/src/components/layout/index.less +4 -4
  54. package/templates/template_admin/public/src/components/layout/provider/index.jsx +19 -6
  55. package/templates/template_admin/public/src/components/{menu → leftMenu}/index.jsx +20 -28
  56. package/templates/template_admin/public/src/components/leftMenu/index.less +42 -0
  57. package/templates/template_admin/public/src/components/popup/index.jsx +25 -0
  58. package/templates/template_admin/public/src/components/table/column.jsx +47 -0
  59. package/templates/template_admin/public/src/components/table/column.less +12 -0
  60. package/templates/template_admin/public/src/components/table/index.jsx +22 -13
  61. package/templates/template_admin/public/src/components/table/index.less +15 -0
  62. package/templates/template_admin/public/src/components/text/index.jsx +98 -0
  63. package/templates/template_admin/public/src/components/text/index.less +13 -0
  64. package/templates/template_admin/public/src/components/topMenu/index.jsx +97 -0
  65. package/templates/template_admin/public/src/components/topMenu/index.less +80 -0
  66. package/templates/template_admin/public/src/components/topMenu/topBar/index.jsx +76 -0
  67. package/templates/template_admin/public/src/components/topMenu/topBar/index.less +88 -0
  68. package/templates/template_admin/public/src/components/video/index.jsx +96 -0
  69. package/templates/template_admin/public/src/components/video/index.less +132 -0
  70. package/templates/template_admin/public/src/components/video/preview.jsx +38 -0
  71. package/templates/template_admin/public/src/dictionary/index.js +108 -39
  72. package/templates/template_admin/public/src/enum.js +41 -0
  73. package/templates/template_admin/public/src/hooks/index.jsx +8 -6
  74. package/templates/template_admin/public/src/hooks/useDebounceFn.jsx +33 -0
  75. package/templates/template_admin/public/src/hooks/useInToView.jsx +58 -0
  76. package/templates/template_admin/public/src/hooks/useRouteMenu.jsx +37 -28
  77. package/templates/template_admin/public/src/hooks/useTimer.jsx +42 -0
  78. package/templates/template_admin/public/src/index.jsx +10 -7
  79. package/templates/template_admin/public/src/mock/auth.js +33 -0
  80. package/templates/template_admin/public/src/mock/demo.js +12 -74
  81. package/templates/template_admin/public/src/mock/index.js +1 -0
  82. package/templates/template_admin/public/src/pages/auth/user/create/index.jsx +55 -0
  83. package/templates/template_admin/public/src/pages/auth/user/create/index.less +6 -0
  84. package/templates/template_admin/public/src/pages/auth/user/dialog/index.jsx +96 -0
  85. package/templates/template_admin/public/src/pages/auth/user/index.jsx +271 -0
  86. package/templates/template_admin/public/src/pages/components/layout/index.jsx +75 -0
  87. package/templates/template_admin/public/src/pages/components/layout/index.less +78 -0
  88. package/templates/template_admin/public/src/pages/components/layout/titleBar/index.jsx +28 -0
  89. package/templates/template_admin/public/src/pages/components/layout/titleBar/index.less +44 -0
  90. package/templates/template_admin/public/src/pages/components/select/account/index.jsx +114 -0
  91. package/templates/template_admin/public/src/pages/components/select/device/index.jsx +83 -0
  92. package/templates/template_admin/public/src/pages/components/select/groupUser/index.jsx +172 -0
  93. package/templates/template_admin/public/src/pages/components/select/user/index.jsx +119 -0
  94. package/templates/template_admin/public/src/pages/home.jsx +79 -0
  95. package/templates/template_admin/public/src/pages/home.less +6 -0
  96. package/templates/template_admin/public/src/pages/login/index.jsx +90 -6
  97. package/templates/template_admin/public/src/pages/login/index.less +133 -24
  98. package/templates/template_admin/public/src/provider/app.jsx +72 -66
  99. package/templates/template_admin/public/src/provider/loading.jsx +47 -0
  100. package/templates/template_admin/public/src/provider/menu.jsx +117 -83
  101. package/templates/template_admin/public/src/provider/menu.less +35 -0
  102. package/templates/template_admin/public/src/route.jsx +41 -40
  103. package/templates/template_admin/public/src/services/auth.js +39 -0
  104. package/templates/template_admin/public/src/services/demo.js +3 -37
  105. package/templates/template_admin/public/src/services/index.js +139 -13
  106. package/templates/template_admin/public/src/services/login.js +37 -0
  107. package/templates/template_admin/public/src/services/socket/index.jsx +100 -0
  108. package/templates/template_admin/public/src/type.js +36 -19
  109. package/templates/template_admin/public/src/utils/event.js +58 -0
  110. package/templates/template_admin/public/src/utils/format.js +84 -0
  111. package/templates/template_admin/public/src/utils/index.js +214 -2
  112. package/templates/template_admin/public/src/utils/rule.js +3 -0
  113. package/templates/template_admin/public/static/kssoLogin.html +1 -1
  114. package/templates/template_admin/webpack.api.js +11 -3
  115. package/src/.DS_Store +0 -0
  116. package/templates/template_admin/.gitignore +0 -6
  117. package/templates/template_admin/public/favicon.ico +0 -0
  118. package/templates/template_admin/public/src/assets/images/avatars/1.png +0 -0
  119. package/templates/template_admin/public/src/assets/images/avatars/2.png +0 -0
  120. package/templates/template_admin/public/src/assets/images/avatars/3.png +0 -0
  121. package/templates/template_admin/public/src/components/layout/centerBody/index.jsx +0 -25
  122. package/templates/template_admin/public/src/components/layout/centerBody/index.less +0 -30
  123. package/templates/template_admin/public/src/components/menu/index.less +0 -19
  124. package/templates/template_admin/public/src/components/menu/topMenu/index.jsx +0 -132
  125. package/templates/template_admin/public/src/components/menu/topMenu/index.less +0 -105
  126. package/templates/template_admin/public/src/pages/demo/detail/index.jsx +0 -27
  127. package/templates/template_admin/public/src/pages/demo/edit/index.jsx +0 -109
  128. package/templates/template_admin/public/src/pages/demo/index.less +0 -9
  129. package/templates/template_admin/public/src/pages/demo/page1.jsx +0 -161
  130. package/templates/template_admin/public/src/pages/superAdminLogin/index.jsx +0 -64
  131. package/templates/template_admin/public/src/pages/superAdminLogin/index.less +0 -44
  132. package/templates/template_app/.gitignore +0 -6
  133. package/templates/template_oa/.gitignore +0 -6
  134. package/templates/template_oa_jwt/.gitignore +0 -6
  135. package/templates/template_offcial/.gitignore +0 -6
@@ -0,0 +1,55 @@
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 'antd';
12
+ // @ts-ignore
13
+ import {PlusOutlined} from '@ant-design/icons';
14
+
15
+ import ruler from '@/utils/rule';
16
+ import {px2rem} from '@/utils';
17
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
18
+ import {emUserState} from '@/dictionary';
19
+ import Table from '@/components/table';
20
+ import { usePaginationWithForm } from '@/hooks';
21
+ import Link from '@/components/link';
22
+ import {FormatTableService,FormatGetRequest} from '@/services'
23
+ import {
24
+ GET_LIST,
25
+ } from '@/services/demo';
26
+
27
+ // @ts-ignore
28
+ import styles from './index.less';
29
+
30
+ const AuthUserCreate = () => {
31
+ return (
32
+ <Layout>
33
+ <SearchBar>
34
+ <TitleBar label='新建用户' showBack optionRight={
35
+ <div className={styles.btns}>
36
+ <Button type='primary'>保存</Button>
37
+ <Button>取消</Button>
38
+ </div>
39
+ }/>
40
+ </SearchBar>
41
+
42
+ <Content>
43
+ <Panel title='基础信息'>
44
+ <div>123123</div>
45
+ </Panel>
46
+ <Panel title='权限配置'>
47
+ <div>123123</div>
48
+ </Panel>
49
+ </Content>
50
+
51
+ </Layout>
52
+ )
53
+ }
54
+
55
+ export default AuthUserCreate;
@@ -0,0 +1,6 @@
1
+
2
+ .btns{
3
+ display: flex;
4
+ align-items: center;
5
+ column-gap: 12px;
6
+ }
@@ -0,0 +1,96 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import ReactDom from 'react-dom';
3
+ // @ts-ignore
4
+ import { Modal, Form, Input, message,Spin } from 'antd';
5
+ import Popup from '@/components/popup';
6
+ import { UPDATE,GET_DETAIL } from '@/services/demo';
7
+ import rule from '@/utils/rule';
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
+ ReactDom.render(
91
+ <DialogEdit destory={popup.destory} {...props} />,
92
+ popup.dom
93
+ );
94
+ });
95
+ };
96
+ export default ShowEdit;
@@ -0,0 +1,271 @@
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 '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 {emUserState} from '@/dictionary';
21
+ import Table from '@/components/table';
22
+ import { usePaginationWithForm } from '@/hooks';
23
+ import Link from '@/components/link';
24
+ import {FormatTableService,FormatGetRequest} from '@/services'
25
+ import {
26
+ GET_LIST,
27
+ } from '@/services/demo';
28
+
29
+
30
+ import ShowEdit from './dialog';
31
+
32
+
33
+ const AuthUser = () => {
34
+ const navigator = useNavigate();
35
+
36
+ const [form] = Form.useForm();
37
+
38
+ const page = usePaginationWithForm({
39
+ afterService: [FormatTableService],
40
+ beforeService:[FormatGetRequest],
41
+ service: GET_LIST,
42
+ pagination: { pageSize: 15 },
43
+ form
44
+ });
45
+
46
+ const onSearch=()=>{
47
+ page.update({ pagination: { current: 1 }, clear: true });
48
+ }
49
+ const onReset=()=>{}
50
+
51
+ const onPageChange = (current, pageSize) => {
52
+ page.update({ pagination: { current, pageSize }, clear: true });
53
+ };
54
+
55
+ const onCreate=()=>{
56
+ navigator('/auth/user/create')
57
+ }
58
+ const onEdit=async (record)=>{
59
+ const req = await ShowEdit({id:record.id})
60
+ }
61
+
62
+ const columnsInternalUsers = [
63
+ {
64
+ title: '姓名',
65
+ dataIndex: 'name',
66
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={88}>{text}</Table.Column>)
67
+ },
68
+ {
69
+ title: '用户名',
70
+ dataIndex: 'name',
71
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={80}>{text}</Table.Column>)
72
+ },
73
+ {
74
+ title: '职位',
75
+ dataIndex: 'name',
76
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={94}>{text}</Table.Column>)
77
+ },
78
+ {
79
+ title: '所在部门',
80
+ dataIndex: 'longName',
81
+ render:(text,record)=>(<Table.Column minWidth={100} maxWidth={224}>{text}</Table.Column>)
82
+ },
83
+ {
84
+ title: '角色',
85
+ dataIndex: 'name',
86
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={111}>{text}</Table.Column>)
87
+ },
88
+ {
89
+ title: '模块权限(补充)',
90
+ dataIndex: 'longName',
91
+ render:(text,record)=>(<Table.Column minWidth={120} maxWidth={187}>{text}</Table.Column>)
92
+ },
93
+ {
94
+ title: '产品权限(补充)',
95
+ dataIndex: 'longName',
96
+ render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
97
+ },
98
+ {
99
+ title: '状态',
100
+ dataIndex: 'select',
101
+ width:70,
102
+ fixed:'right',
103
+ render:(state)=>{
104
+ const stateLabel = emUserState.getLabel(`${state}`);
105
+ if(!stateLabel)return '-'
106
+ const colors={
107
+ '1':'green',
108
+ '0':'red',
109
+ '2':'#FAAD14',
110
+ }
111
+ return <Badge
112
+ color={colors[`${state}`]}
113
+ text={stateLabel}
114
+ />
115
+ }
116
+ },
117
+ {
118
+ title: '操作',
119
+ key: 'option',
120
+ width:104,
121
+ fixed:'right',
122
+ align:'center',
123
+ render: (_, record) => {
124
+ return <Link onClick={onEdit.bind(this,record)} >编辑</Link>
125
+
126
+ }
127
+ },
128
+ ];
129
+ const columnsExternalUsers = [
130
+ {
131
+ title: '姓名',
132
+ dataIndex: 'name',
133
+ fixed:'left',
134
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={88} item={record}>{text}</Table.Column>)
135
+
136
+ },
137
+ {
138
+ title: '公司',
139
+ dataIndex: 'name',
140
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={224}>{text}</Table.Column>)
141
+ },
142
+ {
143
+ title: '所在部门',
144
+ dataIndex: 'name',
145
+ render:(text,record)=>(<Table.Column minWidth={80} maxWidth={224}>{text}</Table.Column>)
146
+ },
147
+ {
148
+ title: '角色',
149
+ dataIndex: 'name',
150
+ render:(text,record)=>(<Table.Column minWidth={60} maxWidth={110}>{text}</Table.Column>)
151
+ },
152
+ {
153
+ title: '模块权限(补充)',
154
+ dataIndex: 'longName',
155
+ render:(text,record)=>(<Table.Column minWidth={120} maxWidth={187}>{text}</Table.Column>)
156
+ },
157
+ {
158
+ title: '产品权限(补充)',
159
+ dataIndex: 'longName',
160
+ render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
161
+ },
162
+ {
163
+ title: '状态',
164
+ dataIndex: 'select',
165
+ width:70,
166
+ fixed:'right',
167
+ render:(state)=>{
168
+ const stateLabel = emUserState.getLabel(`${state}`);
169
+ if(!stateLabel)return '-'
170
+ const colors={
171
+ '1':'green',
172
+ '0':'red',
173
+ '2':'#FAAD14',
174
+ }
175
+ return <Badge
176
+ color={colors[`${state}`]}
177
+ text={stateLabel}
178
+ />
179
+ }
180
+ },
181
+ {
182
+ title: '操作',
183
+ key: 'option',
184
+ width:104,
185
+ fixed:'right',
186
+ align:'center',
187
+ render: (_, record) => {
188
+ return <Link onClick={onEdit.bind(this,record)} >编辑</Link>
189
+ }
190
+ },
191
+ ];
192
+ const tabs = [
193
+ {
194
+ key: '1',
195
+ label: '内部用户',
196
+ children: <Table page={page}
197
+ columns={columnsInternalUsers}
198
+ pagination={{
199
+ onChange: onPageChange,
200
+ }}
201
+ />,
202
+ },
203
+ {
204
+ key: '2',
205
+ label: '外部用户',
206
+ children: <Table page={page}
207
+ columns={columnsExternalUsers}
208
+ pagination={{
209
+ onChange: onPageChange,
210
+ }}
211
+ />,
212
+
213
+ },
214
+ ];
215
+
216
+ const onTab=()=>{}
217
+ return (
218
+ <Layout>
219
+ <SearchBar>
220
+ <TitleBar label='用户管理' />
221
+ <Form form={form} layout="inline" initialValues={{status:'',keyword:'',dep:'',role:''}}>
222
+ <Form.Item label="关键字" name={'keyword'} rules={ruler.KEYWORDS}>
223
+ <Input placeholder="请输入用户名/姓名" onPressEnter={onSearch} />
224
+ </Form.Item>
225
+ <Form.Item label="状态" name={'status'} style={{width:px2rem(150)}}>
226
+ <Select>
227
+ <Select.Option value=''>全部</Select.Option>
228
+ {emUserState.selectOptions}
229
+ </Select>
230
+ </Form.Item>
231
+
232
+ <Form.Item label="部门" name={'dep'} style={{width:px2rem(150)}}>
233
+ <Select>
234
+ <Select.Option value=''>全部</Select.Option>
235
+ {emUserState.selectOptions}
236
+ </Select>
237
+ </Form.Item>
238
+
239
+ <Form.Item label="角色" name={'role'} style={{width:px2rem(150)}}>
240
+ <Select>
241
+ <Select.Option value=''>全部</Select.Option>
242
+ {emUserState.selectOptions}
243
+ </Select>
244
+ </Form.Item>
245
+
246
+ <Space size='middle'>
247
+ <Button onClick={onSearch} type="primary">
248
+ 搜索
249
+ </Button>
250
+ <Button onClick={onReset}>
251
+ 重置
252
+ </Button>
253
+ </Space>
254
+ </Form>
255
+ </SearchBar>
256
+
257
+ <Content>
258
+ <Panel>
259
+ <Tabs defaultActiveKey="1" items={tabs} onChange={onTab}
260
+ tabBarExtraContent={
261
+ {right:<Button icon={<PlusOutlined />} type='primary' onClick={onCreate}>新建用户</Button>}
262
+ }
263
+ />
264
+ </Panel>
265
+ </Content>
266
+
267
+ </Layout>
268
+ )
269
+ }
270
+
271
+ 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.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.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.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.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
+