@jiangood/open-admin 3.0.13 → 3.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/framework/fields/FieldDateRange/index.tsx +4 -0
- package/src/framework/fields/FieldEditor/index.tsx +1 -0
- package/src/framework/fields/FieldUploadImage/index.tsx +1 -1
- package/src/framework/utils/UrlUtils.ts +2 -1
- package/src/framework/utils/system/HttpUtils.ts +6 -0
- package/src/pages/system/dict/index.jsx +14 -10
- package/src/pages/system/org/index.jsx +12 -9
package/package.json
CHANGED
|
@@ -108,6 +108,10 @@ export class FieldDateRange extends React.Component<FieldDateRangeProps> {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
dateToStr(dateArr: [dayjs.Dayjs | null, dayjs.Dayjs | null] | null, fmt: string): string {
|
|
111
|
+
if (dateArr == null) {
|
|
112
|
+
return "";
|
|
113
|
+
}
|
|
114
|
+
|
|
111
115
|
const arr = dateArr as [dayjs.Dayjs | null, dayjs.Dayjs | null];
|
|
112
116
|
const d1 = arr[0];
|
|
113
117
|
const d2 = arr[1];
|
|
@@ -365,7 +365,7 @@ export class FieldUploadImage extends React.Component<FieldUploadImageProps, Fie
|
|
|
365
365
|
fd.append('file', this.state.preview.cFile);
|
|
366
366
|
fd.append('thumb', tFile);
|
|
367
367
|
fd.append('isPublic', String(this.state.isPublic));
|
|
368
|
-
const rs = await HttpUtils.post('admin/sysFile/uploadImage', fd
|
|
368
|
+
const rs = await HttpUtils.post('admin/sysFile/uploadImage', fd);
|
|
369
369
|
const newNames = [...this.state.objectNames, rs.objectName];
|
|
370
370
|
this.setState({objectNames: newNames});
|
|
371
371
|
this.props.onChange?.(newNames.join(','));
|
|
@@ -66,6 +66,7 @@ export class UrlUtils {
|
|
|
66
66
|
*/
|
|
67
67
|
static contextPath(path: string): string {
|
|
68
68
|
const base = import.meta.env.VITE_SERVER_SERVLET_CONTEXT_PATH;
|
|
69
|
-
|
|
69
|
+
if (base === '/' || base === '') return path;
|
|
70
|
+
return base.replace(/\/+$/, '') + path;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -21,6 +21,12 @@ export class HttpUtils {
|
|
|
21
21
|
const url = config.url as string;
|
|
22
22
|
config.url = url.startsWith('admin') ? '/' + url : url;
|
|
23
23
|
|
|
24
|
+
// FormData 请求交由浏览器自动生成带 boundary 的 multipart Content-Type,
|
|
25
|
+
// 否则手动指定 Content-Type 会缺失 boundary 导致后端解析失败
|
|
26
|
+
if (typeof FormData !== 'undefined' && config.data instanceof FormData) {
|
|
27
|
+
config.headers = {...config.headers, 'Content-Type': undefined};
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
return new Promise<T>((resolve, reject) => {
|
|
25
31
|
axiosInstance(config).then((response) => {
|
|
26
32
|
const body = response.data;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {DeleteOutlined, EditOutlined, PlusOutlined} from '@ant-design/icons';
|
|
2
|
-
import {AutoComplete, Button, Card, Descriptions, Empty, Form, Input, InputNumber,
|
|
2
|
+
import {AutoComplete, Button, Card, Descriptions, Empty, Form, Input, InputNumber, Splitter, Tree, Tag, TreeSelect, Typography} from 'antd';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import {
|
|
5
5
|
PermActions,
|
|
@@ -168,7 +168,9 @@ export default class extends React.Component {
|
|
|
168
168
|
size='small'
|
|
169
169
|
title={<div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center'}}>
|
|
170
170
|
<Typography.Text strong>字典类型</Typography.Text>
|
|
171
|
-
<
|
|
171
|
+
<PermActions size='small' actions={[
|
|
172
|
+
{label: '新增类型', perm: 'sys-dict:create', icon: <PlusOutlined/>, onClick: this.handleTypeAdd},
|
|
173
|
+
]}/>
|
|
172
174
|
</div>}
|
|
173
175
|
>
|
|
174
176
|
<Tree
|
|
@@ -188,14 +190,16 @@ export default class extends React.Component {
|
|
|
188
190
|
<div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8}}>
|
|
189
191
|
<Typography.Text strong>类型信息</Typography.Text>
|
|
190
192
|
{hasTypeSelected && (
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
<PermActions size='small' actions={[
|
|
194
|
+
{label: '编辑', perm: 'sys-dict:update', icon: <EditOutlined/>, onClick: this.handleTypeEdit},
|
|
195
|
+
{
|
|
196
|
+
label: '删除',
|
|
197
|
+
perm: 'sys-dict:delete',
|
|
198
|
+
icon: <DeleteOutlined/>,
|
|
199
|
+
confirm: '是否确定删除此类型及其所有子类型和字典项?',
|
|
200
|
+
onClick: this.handleTypeDelete,
|
|
201
|
+
},
|
|
202
|
+
]}/>
|
|
199
203
|
)}
|
|
200
204
|
</div>
|
|
201
205
|
{hasTypeSelected && <Descriptions size='small' column={3}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {DeleteOutlined, EditOutlined, PlusOutlined, SettingOutlined, SyncOutlined} from '@ant-design/icons';
|
|
2
|
-
import {Button, Card, Checkbox, Descriptions, Form, Input, InputNumber,
|
|
2
|
+
import {Button, Card, Checkbox, Descriptions, Form, Input, InputNumber, Popover, Space, Spin, Splitter, Switch, Tree, Typography} from 'antd';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import {
|
|
5
5
|
FieldBoolean,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
HttpUtils,
|
|
11
11
|
NamedIcon,
|
|
12
12
|
Page,
|
|
13
|
+
PermActions,
|
|
13
14
|
ViewSwitch,
|
|
14
15
|
} from "../../../framework";
|
|
15
16
|
|
|
@@ -145,14 +146,16 @@ export default class extends React.Component {
|
|
|
145
146
|
<div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8}}>
|
|
146
147
|
<Typography.Text strong>机构信息</Typography.Text>
|
|
147
148
|
{selectedOrg && (
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
<PermActions size='small' actions={[
|
|
150
|
+
{label: '编辑', perm: 'sys-org:update', icon: <EditOutlined/>, onClick: this.handleEdit},
|
|
151
|
+
{
|
|
152
|
+
label: '删除',
|
|
153
|
+
perm: 'sys-org:delete',
|
|
154
|
+
icon: <DeleteOutlined/>,
|
|
155
|
+
confirm: '是否确定删除组织机构',
|
|
156
|
+
onClick: this.handleDelete,
|
|
157
|
+
},
|
|
158
|
+
]}/>
|
|
156
159
|
)}
|
|
157
160
|
</div>
|
|
158
161
|
{selectedOrg && (
|