@jiangood/open-admin 2.4.7 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/.umi-production/appData.json +58 -78
  3. package/src/.umi-production/core/route.tsx +1 -3
  4. package/src/framework/components/ContextMenu/index.tsx +91 -0
  5. package/src/framework/components/Page/index.less +19 -6
  6. package/src/framework/components/Page/index.tsx +23 -3
  7. package/src/framework/components/ProTable/index.less +60 -9
  8. package/src/framework/components/ProTable/index.tsx +31 -48
  9. package/src/framework/components/index.ts +1 -0
  10. package/src/framework/fields/FieldTableSelect/index.tsx +0 -1
  11. package/src/layouts/admin/HeaderRight.jsx +1 -6
  12. package/src/layouts/admin/TabPageRender.jsx +80 -23
  13. package/src/layouts/admin/index.jsx +16 -22
  14. package/src/layouts/admin/index.less +31 -20
  15. package/src/layouts/index.jsx +0 -9
  16. package/src/pages/about.jsx +1 -1
  17. package/src/pages/index.jsx +1 -1
  18. package/src/pages/login.jsx +1 -5
  19. package/src/pages/system/dict/index.jsx +56 -53
  20. package/src/pages/system/file/index.jsx +1 -7
  21. package/src/pages/system/job/index.jsx +9 -14
  22. package/src/pages/system/log/index.jsx +1 -1
  23. package/src/pages/system/org/index.jsx +153 -173
  24. package/src/pages/system/role/index.jsx +21 -12
  25. package/src/pages/system/role/perm.jsx +1 -2
  26. package/src/pages/system/user/index.jsx +28 -43
  27. package/src/pages/userCenter/index.jsx +3 -2
  28. package/src/pages/userCenter/message.jsx +1 -1
  29. package/src/style/global.less +1 -1
  30. package/src/framework/components/ProTable/components/ToolBar/index.less +0 -53
  31. package/src/framework/components/ProTable/components/ToolBar/index.tsx +0 -123
  32. package/src/pages/system/manual/index.jsx +0 -128
  33. package/src/pages/userCenter/manual.jsx +0 -57
@@ -2,31 +2,17 @@
2
2
  height: 100vh;
3
3
  overflow: hidden;
4
4
  .header {
5
- padding: 0 20px;
5
+ padding: 0 12px;
6
6
  height: 48px;
7
7
  display: flex;
8
8
  align-items: center;
9
- border-bottom: 1px solid rgb(233, 237, 240);
10
- background-color: rgb(246, 248, 250);
11
-
12
- .header-left {
13
-
14
- display: flex;
15
- align-items: center;
16
- gap: 8px;
17
- flex-shrink: 0;
18
-
19
- .logo-img {
20
- height: 38px;
21
- cursor: pointer;
22
- }
23
- }
9
+ background-color: #fff;
24
10
 
25
11
  .top-nav {
26
12
  flex: 1;
27
13
  display: flex;
28
14
  align-items: center;
29
- margin: 0 16px;
15
+ margin: 0;
30
16
  height: 100%;
31
17
  overflow: hidden;
32
18
 
@@ -73,7 +59,34 @@
73
59
 
74
60
 
75
61
  #left-sider {
62
+ display: flex;
63
+ flex-direction: column;
64
+
65
+ .sider-header {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 8px;
69
+ padding: 12px 16px;
70
+
71
+ .logo-img {
72
+ height: 38px;
73
+ cursor: pointer;
74
+ }
75
+
76
+ h3 {
77
+ margin: 0;
78
+ font-size: 14px;
79
+ line-height: 1;
80
+ white-space: nowrap;
81
+ }
82
+ }
83
+
84
+ &.ant-layout-sider-collapsed .sider-header h3 {
85
+ display: none;
86
+ }
87
+
76
88
  .left-menu {
89
+ flex: 1;
77
90
  overflow: auto;
78
91
  scrollbar-width: thin;
79
92
  scrollbar-color: unset;
@@ -83,9 +96,7 @@
83
96
  color: white;
84
97
  }
85
98
  }
86
- .ant-menu-item-group-title {
87
- color: #5E8CD6; /* 主色透明 */
88
- }
99
+
89
100
  }
90
101
 
91
102
  }
@@ -27,16 +27,7 @@ const configProps = {
27
27
  borderRadius: 4,
28
28
  },
29
29
  components: {
30
- Menu: {
31
- darkItemBg: ThemeUtils.getColor("primary-color"),
32
- darkPopupBg: ThemeUtils.getColor("primary-color"),
33
- darkItemSelectedBg: ThemeUtils.getColor("primary-color-click"),
34
- darkItemHoverBg: ThemeUtils.getColor("primary-color-hover"),
35
- darkSubMenuItemBg: ThemeUtils.getColor("primary-color"),
36
- },
37
30
  Layout: {
38
- siderBg: ThemeUtils.getColor("primary-color"),
39
- triggerBg: ThemeUtils.getColor("primary-color-click"),
40
31
  headerBg: 'white',
41
32
  triggerHeight: 32,
42
33
  },
@@ -5,7 +5,7 @@ export default class extends React.Component {
5
5
 
6
6
 
7
7
  render() {
8
- return <Page>
8
+ return <Page title="关于" description="了解系统版本与相关信息">
9
9
  <h1>关于</h1>
10
10
  </Page>
11
11
  }
@@ -3,7 +3,7 @@ import {Card} from "antd";
3
3
  import {Page} from "../framework";
4
4
 
5
5
  export default function () {
6
- return <Page>
6
+ return <Page title="首页" description="欢迎使用本系统">
7
7
  <Card>欢迎使用本系统</Card>
8
8
  </Page>
9
9
  }
@@ -72,11 +72,7 @@ export default class extends React.Component {
72
72
  const {siteInfo} = this.state
73
73
 
74
74
  const pageStyle = {
75
- backgroundImage: `url("${SysUtils.contextPath('/admin/public/login_bg.jpg')}")`
76
- }
77
- if (siteInfo.loginBackground) {
78
- const url = SysUtils.contextPath('/admin/sysFile/preview/' + siteInfo.loginBackground);
79
- pageStyle.backgroundImage = 'url("' + url + '")'
75
+ backgroundImage: `url("./login_bg.jpg")`
80
76
  }
81
77
 
82
78
  return (
@@ -1,11 +1,10 @@
1
- import {DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined} from '@ant-design/icons';
2
- import {Button, Card, Empty, Form, Input, InputNumber, Modal, Popconfirm, Space, Splitter, Tree, Tag, TreeSelect} from 'antd';
1
+ import {DeleteOutlined, EditOutlined, PlusOutlined} from '@ant-design/icons';
2
+ import {Button, Card, Descriptions, Empty, Form, Input, InputNumber, Modal, Popconfirm, Splitter, Tree, Tag, TreeSelect, Typography} from 'antd';
3
3
  import React from 'react';
4
4
  import {
5
5
  ButtonList,
6
6
  FieldBoolean,
7
7
  FieldDictSelect,
8
- Gap,
9
8
  HttpUtils,
10
9
  Page,
11
10
  ProTable,
@@ -24,6 +23,7 @@ export default class extends React.Component {
24
23
  formValues: {},
25
24
  typeFormOpen: false,
26
25
  typeFormValues: {},
26
+
27
27
  }
28
28
 
29
29
  formRef = React.createRef();
@@ -74,22 +74,30 @@ export default class extends React.Component {
74
74
  })
75
75
  }
76
76
 
77
+ findNode = (nodes, key) => {
78
+ for (const n of nodes) {
79
+ if (n.id === key) return n
80
+ if (n.children) {
81
+ const found = this.findNode(n.children, key)
82
+ if (found) return found
83
+ }
84
+ }
85
+ return null
86
+ }
87
+
88
+ getParentLabel = () => {
89
+ const {selectedType, typeTree} = this.state
90
+ if (!selectedType?.pid) return null
91
+ const parent = this.findNode(typeTree, selectedType.pid)
92
+ return parent?.typeLabel || null
93
+ }
94
+
77
95
  onTreeSelect = (selectedKeys) => {
78
96
  if (selectedKeys.length === 0) {
79
97
  this.setState({selectedType: null, selectedTypeCode: null})
80
98
  return
81
99
  }
82
- const findNode = (nodes, key) => {
83
- for (const n of nodes) {
84
- if (n.id === key) return n
85
- if (n.children) {
86
- const found = findNode(n.children, key)
87
- if (found) return found
88
- }
89
- }
90
- return null
91
- }
92
- const node = findNode(this.state.typeTree, selectedKeys[0])
100
+ const node = this.findNode(this.state.typeTree, selectedKeys[0])
93
101
  this.setState({
94
102
  selectedType: node,
95
103
  selectedTypeCode: node?.typeCode || null
@@ -156,32 +164,14 @@ export default class extends React.Component {
156
164
  const {selectedType, selectedTypeCode} = this.state
157
165
  const hasTypeSelected = selectedType != null && selectedTypeCode != null
158
166
 
159
- return <Page>
167
+ return <Page title="数据字典" description="管理数据字典类型和字典项"
168
+ actions={<Button perm='sys-dict:create' icon={<PlusOutlined/>} onClick={this.handleTypeAdd}>新增类型</Button>}>
160
169
  <Splitter>
161
- <Splitter.Panel defaultSize={300}>
170
+ <Splitter.Panel defaultSize={300} style={{paddingRight: 8}}>
162
171
  <Card loading={this.state.treeLoading}
163
- title='字典类型'
164
- extra={<Space>
165
- <Button size='small' shape='round' icon={<SyncOutlined/>}
166
- onClick={this.loadTree}/>
167
- </Space>}
172
+ size='small'
168
173
  >
169
- <ButtonList>
170
- <Button type='primary' size='small' onClick={this.handleTypeAdd}>
171
- <PlusOutlined/> 新增类型
172
- </Button>
173
- <Button size='small' disabled={!selectedType} onClick={this.handleTypeEdit}>
174
- <EditOutlined/> 编辑
175
- </Button>
176
- <Popconfirm title='是否确定删除此类型及其所有子类型和字典项?'
177
- disabled={!selectedType}
178
- onConfirm={this.handleTypeDelete}>
179
- <Button size='small' disabled={!selectedType}>
180
- <DeleteOutlined/> 删除
181
- </Button>
182
- </Popconfirm>
183
- </ButtonList>
184
- <Gap/>
174
+ <Typography.Text strong style={{marginBottom: 8, display: 'block'}}>字典类型</Typography.Text>
185
175
  <Tree
186
176
  treeData={this.state.typeTree}
187
177
  onSelect={this.onTreeSelect}
@@ -191,24 +181,38 @@ export default class extends React.Component {
191
181
  blockNode
192
182
  />
193
183
  {this.state.typeTree.length === 0 && <Empty/>}
194
-
195
-
196
184
  </Card>
197
185
  </Splitter.Panel>
198
186
 
199
- <Splitter.Panel>
200
- <Card title={hasTypeSelected ? `${selectedType.typeLabel} 的字典项` : '字典项'}
201
- extra={
202
- hasTypeSelected
203
- ? <Button type='primary' onClick={this.handleItemAdd}>
204
- <PlusOutlined/> 新增
205
- </Button>
206
- : null
207
- }
208
- >
209
- {!hasTypeSelected
210
- ? <Empty description='请在左侧选择一个字典类型'/>
211
- : <ProTable
187
+ <Splitter.Panel style={{paddingLeft: 8}}>
188
+ <Card size='small' style={{marginBottom: 8}}>
189
+ <div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8}}>
190
+ <Typography.Text strong>类型信息</Typography.Text>
191
+ {hasTypeSelected && (
192
+ <span>
193
+ <Button size='small' icon={<EditOutlined/>} perm='sys-dict:update'
194
+ onClick={this.handleTypeEdit} style={{marginRight: 4}}>编辑</Button>
195
+ <Popconfirm perm='sys-dict:delete' title='是否确定删除此类型及其所有子类型和字典项?'
196
+ onConfirm={this.handleTypeDelete}>
197
+ <Button size='small' icon={<DeleteOutlined/>}>删除</Button>
198
+ </Popconfirm>
199
+ </span>
200
+ )}
201
+ </div>
202
+ {hasTypeSelected && <Descriptions size='small' column={3}>
203
+ <Descriptions.Item label="名称">{selectedType.typeLabel}</Descriptions.Item>
204
+ <Descriptions.Item label="类型编码">{selectedType.typeCode}</Descriptions.Item>
205
+ <Descriptions.Item label="分类">{this.getParentLabel() || '-'}</Descriptions.Item>
206
+ <Descriptions.Item label="序号">{selectedType.seq}</Descriptions.Item>
207
+ <Descriptions.Item label="启用"><ViewBooleanEnableDisable value={selectedType.enabled}/></Descriptions.Item>
208
+ </Descriptions>}
209
+ </Card>
210
+ <Card size='small'>
211
+ <div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8}}>
212
+ <Typography.Text strong>字典项</Typography.Text>
213
+ {hasTypeSelected && <Button type='primary' icon={<PlusOutlined/>} onClick={this.handleItemAdd}>新增字典项</Button>}
214
+ </div>
215
+ {hasTypeSelected && <ProTable
212
216
  rowKey='uid'
213
217
  actionRef={this.tableRef}
214
218
  request={(params) => {
@@ -216,7 +220,6 @@ export default class extends React.Component {
216
220
  return HttpUtils.get('admin/dict/page', params)
217
221
  }}
218
222
  columns={this.columns}
219
- showToolbarSearch
220
223
  />
221
224
  }
222
225
  </Card>
@@ -89,15 +89,9 @@ export default class extends React.Component {
89
89
  ]
90
90
 
91
91
  render() {
92
- return <Page>
92
+ return <Page title="文件管理" description="管理系统上传文件" actions={<Button type='primary' icon={<CloudUploadOutlined/>} onClick={() => this.setState({formOpen: true})}>上传文件</Button>}>
93
93
  <ProTable
94
94
  actionRef={this.tableRef}
95
- toolBarRender={() => {
96
- return <Button type='primary' icon={<CloudUploadOutlined/>}
97
- onClick={() => this.setState({formOpen: true})}>
98
- 上传文件
99
- </Button>
100
- }}
101
95
  request={(params) => {
102
96
  return HttpUtils.get('admin/sysFile/page', params);
103
97
  }}
@@ -15,7 +15,6 @@ import {
15
15
  Tag
16
16
  } from 'antd'
17
17
  import {PlusOutlined} from "@ant-design/icons";
18
-
19
18
  import {ButtonList, HttpUtils, Page, ProTable, StringUtils, SysUtils, ValueType} from "../../../framework";
20
19
 
21
20
 
@@ -189,23 +188,19 @@ export default class extends React.Component {
189
188
 
190
189
 
191
190
  render() {
192
- return <Page>
191
+ return <Page title="作业调度" description="管理定时作业任务" actions={<><Button type='primary' icon={<PlusOutlined/>} onClick={() => this.handleAdd()}>新增</Button><Button onClick={this.showStatus}>查看状态</Button></>}>
193
192
  <ProTable
194
193
  actionRef={this.tableRef}
195
- toolBarRender={() => {
196
- return <ButtonList>
197
- <Button type='primary' onClick={() => this.handleAdd()} icon={<PlusOutlined/>}>
198
- 新增
199
- </Button>
200
- <Button onClick={this.showStatus}>
201
- 查看状态
202
- </Button>
203
- </ButtonList>
204
- }}
205
194
  request={(params) => HttpUtils.get('admin/job/page', params)}
206
195
  columns={this.columns}
207
- showToolbarSearch
208
- />
196
+ >
197
+ <Form.Item label='名称' name='name'>
198
+ <Input/>
199
+ </Form.Item>
200
+ <Form.Item label='执行类' name='jobClass'>
201
+ <Input/>
202
+ </Form.Item>
203
+ </ProTable>
209
204
 
210
205
 
211
206
  <Modal title='作业调度'
@@ -55,7 +55,7 @@ export default class extends React.Component {
55
55
 
56
56
 
57
57
  render() {
58
- return <Page>
58
+ return <Page title="操作日志" description="查看系统操作日志">
59
59
  <ProTable
60
60
  request={(params) => HttpUtils.get('admin/sysLog/page', params)}
61
61
  columns={this.columns}