@jiangood/springboot-admin-starter 0.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.
- package/config/config.js +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {DatePicker} from 'antd';
|
|
3
|
+
import {valueToDate} from "./TimePickerTool";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 月份选择器
|
|
7
|
+
*
|
|
8
|
+
* 值类型为字符串
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export { MonthPickerString as FieldMonthPickerString };
|
|
13
|
+
|
|
14
|
+
const FMT = 'YYYY-MM';
|
|
15
|
+
|
|
16
|
+
export class MonthPickerString extends React.Component {
|
|
17
|
+
|
|
18
|
+
static FORMAT = FMT
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
onChange = (date) => {
|
|
22
|
+
const str = date ? date.format(FMT) : null;
|
|
23
|
+
this.props.onChange(str);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
let { value, readOnly = false, mode, ...rest} = this.props;
|
|
28
|
+
if (mode == 'read') {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
value = valueToDate(value,FMT)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<DatePicker
|
|
37
|
+
{...rest}
|
|
38
|
+
value={value}
|
|
39
|
+
onChange={this.onChange}
|
|
40
|
+
picker="month"
|
|
41
|
+
disabled={readOnly || this.props.disabled}
|
|
42
|
+
></DatePicker>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export function valueToDate(value:any, fmt:string){
|
|
5
|
+
if (value != null && value != '') {
|
|
6
|
+
let type = typeof value;
|
|
7
|
+
if (type == 'string' || type == 'number') {
|
|
8
|
+
value = dayjs(value, fmt);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {DatePicker} from 'antd';
|
|
3
|
+
import {valueToDate} from "./TimePickerTool";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 月份选择器
|
|
7
|
+
*
|
|
8
|
+
* 值类型为字符串
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export { YearPickerString as FieldYearPickerString };
|
|
13
|
+
const FMT = 'YYYY';
|
|
14
|
+
export class YearPickerString extends React.Component {
|
|
15
|
+
|
|
16
|
+
static FORMAT = FMT
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
onChange = (date) => {
|
|
20
|
+
const str = date ? date.format(FMT): null;
|
|
21
|
+
this.props.onChange(str);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
let { value, readOnly = false, mode } = this.props;
|
|
26
|
+
if (mode == 'read') {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
value = valueToDate(value,FMT)
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<DatePicker
|
|
33
|
+
{...this.props}
|
|
34
|
+
value={value}
|
|
35
|
+
onChange={this.onChange}
|
|
36
|
+
picker="year"
|
|
37
|
+
disabled={readOnly || this.props.disabled}
|
|
38
|
+
></DatePicker>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {DatePicker} from 'antd';
|
|
3
|
+
import {valueToDate} from "./TimePickerTool";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 季度选择
|
|
7
|
+
*/
|
|
8
|
+
export { YearQuarterString as FieldYearQuarterString };
|
|
9
|
+
|
|
10
|
+
const FMT = 'YYYY-QQ';
|
|
11
|
+
|
|
12
|
+
export class YearQuarterString extends React.Component {
|
|
13
|
+
|
|
14
|
+
static FORMAT = FMT
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
onChange = (date, dateString) => {
|
|
18
|
+
this.props.onChange(dateString);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
render() {
|
|
22
|
+
let { value, readOnly = false, mode } = this.props;
|
|
23
|
+
if (mode == 'read') {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
value = valueToDate(value,FMT)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<DatePicker
|
|
30
|
+
{...this.props}
|
|
31
|
+
value={value}
|
|
32
|
+
onChange={this.onChange}
|
|
33
|
+
picker="quarter"
|
|
34
|
+
disabled={readOnly || this.props.disabled}
|
|
35
|
+
></DatePicker>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import {CropperProps} from "react-easy-crop/Cropper";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
declare type FieldUploadCropImageProps = {
|
|
8
|
+
value?: string; // 文件的值,sysFile的id
|
|
9
|
+
onChange?: (v:string)=>{};
|
|
10
|
+
|
|
11
|
+
cropperProps?: CropperProps;
|
|
12
|
+
|
|
13
|
+
maxCount?: number
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 上传图片前裁切, 单张图片
|
|
18
|
+
*
|
|
19
|
+
* 可参考 react-easy-crop
|
|
20
|
+
*/
|
|
21
|
+
export class FieldUploadCropImage extends React.Component<FieldUploadCropImageProps, any> {
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import {CropperProps} from "react-easy-crop/Cropper";
|
|
5
|
+
import {UploadListType} from "antd/es/upload/interface";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
declare type FieldUploadFileProps = {
|
|
9
|
+
value?: string; // 文件的值,sysFile的id, 逗号分割
|
|
10
|
+
onChange?: (v: string) => {};
|
|
11
|
+
onFileChange?: (fileList: any[]) => {}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 是否裁切图片
|
|
15
|
+
*/
|
|
16
|
+
cropImage?: boolean;
|
|
17
|
+
cropperProps?: CropperProps;
|
|
18
|
+
|
|
19
|
+
maxCount?: number;
|
|
20
|
+
|
|
21
|
+
accept?: "image/*" | ".pdf" | ".docx" | '.xlsx' | string;
|
|
22
|
+
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
|
|
25
|
+
listType?: UploadListType
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 上传图片前裁切, 单张图片
|
|
30
|
+
*
|
|
31
|
+
* 可参考 react-easy-crop
|
|
32
|
+
*/
|
|
33
|
+
export class FieldUploadFile extends React.Component<FieldUploadFileProps, any> {
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ImgCrop from "antd-img-crop";
|
|
3
|
+
import {Modal, Upload} from "antd";
|
|
4
|
+
import UploadOutlined from "@ant-design/icons/lib/icons/UploadOutlined";
|
|
5
|
+
import {SysUtil} from "../../../system";
|
|
6
|
+
import {ViewFile} from "../../view";
|
|
7
|
+
import {ObjUtil} from "../../../utils";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class FieldUploadFile extends React.Component {
|
|
11
|
+
|
|
12
|
+
state = {
|
|
13
|
+
// 传入的参数
|
|
14
|
+
maxCount: 1,
|
|
15
|
+
cropImage: false,
|
|
16
|
+
accept: ".jpg,.png",
|
|
17
|
+
|
|
18
|
+
// 内部参数
|
|
19
|
+
fileList: [],
|
|
20
|
+
value: null // 都好分隔的文件id
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props);
|
|
25
|
+
ObjUtil.copyPropertyIfPresent(props, this.state)
|
|
26
|
+
this.state.fileList = this.convertInputToComponentValue(this.state.value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
convertInputToComponentValue(value) {
|
|
30
|
+
let list = [];
|
|
31
|
+
if (value && value.length > 0) {
|
|
32
|
+
const arr = value.split(",")
|
|
33
|
+
for (const id of arr) {
|
|
34
|
+
const url = SysUtil.wrapServerUrl('admin/sysFile/preview/' + id)
|
|
35
|
+
let file = {id, url, uid: id, name: id, status: 'done', fileName: id};
|
|
36
|
+
list.push(file);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return list
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
convertComponentValueToOutput(fileList) {
|
|
44
|
+
let fileIds = [];
|
|
45
|
+
for (const f of fileList) {
|
|
46
|
+
if (f.status === 'done') {
|
|
47
|
+
if(f.response) { // 新上传的
|
|
48
|
+
const ajaxResult = f.response
|
|
49
|
+
if (ajaxResult.success) {
|
|
50
|
+
const {id, name} = ajaxResult.data
|
|
51
|
+
f.id = id;
|
|
52
|
+
fileIds.push(id);
|
|
53
|
+
} else {
|
|
54
|
+
Modal.error({title: '上传文件失败', content: ajaxResult.message})
|
|
55
|
+
}
|
|
56
|
+
}else { // 老的
|
|
57
|
+
fileIds.push(f.id)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return fileIds;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
handleChange = ({fileList, event, file}) => {
|
|
68
|
+
console.log('检测到文件变化', fileList)
|
|
69
|
+
const rs = file.response;
|
|
70
|
+
if (rs != null && rs.success === false) {
|
|
71
|
+
Modal.error({
|
|
72
|
+
title: '上传失败',
|
|
73
|
+
content: rs.message,
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
this.setState({fileList});
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
let newIds = this.convertComponentValueToOutput(fileList);
|
|
83
|
+
if (newIds.length > 0 && this.props.onFileChange) {
|
|
84
|
+
this.props.onFileChange(fileList)
|
|
85
|
+
}
|
|
86
|
+
if(this.props.onChange){
|
|
87
|
+
let value = newIds.join(',');
|
|
88
|
+
console.log('上传文件值', value )
|
|
89
|
+
this.props.onChange(value);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
handlePreview = (file) => {
|
|
96
|
+
debugger
|
|
97
|
+
Modal.info({
|
|
98
|
+
title: '文件预览',
|
|
99
|
+
width: '80vw',
|
|
100
|
+
content: <ViewFile value={file.id} height='70vh'/>
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
render() {
|
|
106
|
+
if (this.state.cropImage) {
|
|
107
|
+
return <ImgCrop cropperProps={this.props.cropperProps} modalTitle={'裁剪图片'} fillColor={null}>
|
|
108
|
+
{this.getUpload()}
|
|
109
|
+
</ImgCrop>
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return this.getUpload();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
getUpload = () => {
|
|
116
|
+
const {accept, fileList, maxCount} = this.state;
|
|
117
|
+
|
|
118
|
+
return <Upload
|
|
119
|
+
action={SysUtil.wrapServerUrl('admin/sysFile/upload')}
|
|
120
|
+
listType={this.props.listType || 'picture-card'}
|
|
121
|
+
fileList={fileList}
|
|
122
|
+
onChange={this.handleChange}
|
|
123
|
+
headers={SysUtil.getHeaders()}
|
|
124
|
+
multiple={false}
|
|
125
|
+
accept={accept}
|
|
126
|
+
maxCount={maxCount}
|
|
127
|
+
onPreview={this.handlePreview}
|
|
128
|
+
>
|
|
129
|
+
{this.renderButton()}
|
|
130
|
+
|
|
131
|
+
</Upload>;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
renderButton = () => {
|
|
135
|
+
const {fileList, maxCount} = this.state;
|
|
136
|
+
if (fileList.length >= maxCount) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return <>
|
|
141
|
+
<UploadOutlined/>
|
|
142
|
+
<div className="ant-upload-text">选择文件</div>
|
|
143
|
+
</>;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FieldUploadFile} from "./FieldUploadFile";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* crop: 带裁切
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export class FieldUploadImage extends React.Component {
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
return <FieldUploadFile {...this.props} accept={'image/*'} />
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './field'
|
|
2
|
+
export * from './ProModal'
|
|
3
|
+
export * from './Ellipsis'
|
|
4
|
+
export * from './ButtonList'
|
|
5
|
+
export * from './HasPerm'
|
|
6
|
+
export * from './system'
|
|
7
|
+
export * from './ImageView';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export * from './PageLoading'
|
|
11
|
+
export * from './OrgTree'
|
|
12
|
+
export * from './ProTable'
|
|
13
|
+
export * from './DownloadFileButton'
|
|
14
|
+
|
|
15
|
+
export * from './NamedIcon'
|
|
16
|
+
export * from './EditTable'
|
|
17
|
+
export * from './view'
|
|
18
|
+
export * from './LinkButton'
|
|
19
|
+
export * from './Gap'
|
|
20
|
+
export * from './Panel'
|
|
21
|
+
export * from './Page'
|
|
22
|
+
export * from './Echarts'
|
|
23
|
+
export * from './MsgBox'
|
|
24
|
+
export * from './ValueType'
|
|
25
|
+
export * from './RoleTree'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FieldRemoteTreeSelect, FieldSelect} from './field';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export function FieldUserSelect(props) {
|
|
6
|
+
return <FieldSelect url="admin/sysUser/options" {...props} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FieldUserMultipleSelect(props) {
|
|
10
|
+
return <FieldSelect multiple={true} url="admin/sysUser/options" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function FieldUnitTreeSelect(props) {
|
|
14
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/unitTree" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function FieldDeptTreeSelect(props) {
|
|
18
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/deptTree" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function FieldOrgTreeSelect(props) {
|
|
22
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/deptTree" {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function FieldOrgTreeMultipleSelect(props) {
|
|
26
|
+
return <FieldSelect multiple={true} url="/sysOrg/deptTree" {...props} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Tag} from 'antd';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class ViewBooleanEnableDisable extends React.Component {
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
let {value} = this.props;
|
|
10
|
+
if(value == null){
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return value ? <Tag color={"green"}>启动</Tag> : <Tag color={"red"}>禁用</Tag>
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Button, Modal, Popover} from 'antd';
|
|
3
|
+
import {StrUtil} from "../../utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class ViewEllipsis extends React.Component {
|
|
7
|
+
|
|
8
|
+
static defaultProps = {maxLength: 15}
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
let {maxLength, value} = this.props;
|
|
12
|
+
|
|
13
|
+
const short = StrUtil.ellipsis(value, maxLength)
|
|
14
|
+
return <Popover placement="topLeft" title={'长文本'} content={<Button onClick={this.showModal}>点击查看全部内容</Button>}>
|
|
15
|
+
{short}
|
|
16
|
+
</Popover>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
showModal = () => {
|
|
21
|
+
let {maxLength, value} = this.props;
|
|
22
|
+
Modal.info({
|
|
23
|
+
icon:null,
|
|
24
|
+
title:'长文本内容',
|
|
25
|
+
content: <div style={{height:500,overflowY:'auto'}}>{value}</div>,
|
|
26
|
+
width:700
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Carousel, Empty} from 'antd';
|
|
3
|
+
import {SysUtil} from "../../system";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class ViewFile extends React.Component {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
render() {
|
|
10
|
+
let fileId = this.props.value
|
|
11
|
+
|
|
12
|
+
if (!fileId) {
|
|
13
|
+
return <Empty/>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let arr = fileId.split(',');
|
|
17
|
+
|
|
18
|
+
let urlList = arr.map(id => SysUtil.wrapServerUrl('admin/sysFile/preview/' + id));
|
|
19
|
+
let height = this.props.height;
|
|
20
|
+
|
|
21
|
+
if(urlList.length === 1){
|
|
22
|
+
const url = urlList[0]
|
|
23
|
+
return <iframe
|
|
24
|
+
src={url}
|
|
25
|
+
width='99%'
|
|
26
|
+
frameBorder={0}
|
|
27
|
+
style={{height}}
|
|
28
|
+
/>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 多个文件则用走马灯
|
|
32
|
+
const iframeList = urlList.map((url) => {
|
|
33
|
+
return <div style={{height}}>
|
|
34
|
+
<iframe
|
|
35
|
+
key={url}
|
|
36
|
+
src={url}
|
|
37
|
+
width='99%'
|
|
38
|
+
frameBorder={0}
|
|
39
|
+
style={{height}}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return <div style={{height}}>
|
|
45
|
+
<Carousel dotPosition={"top"}>
|
|
46
|
+
{iframeList}
|
|
47
|
+
</Carousel>
|
|
48
|
+
</div>
|
|
49
|
+
}
|
|
50
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Modal} from 'antd';
|
|
3
|
+
import {SysUtil} from "../../system";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class ViewImage extends React.Component {
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
let vs = this.props.value
|
|
10
|
+
|
|
11
|
+
if (!vs) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof vs === 'string') {
|
|
16
|
+
vs = vs.split(',');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let urlList = [];
|
|
20
|
+
for (let v of vs) {
|
|
21
|
+
let isId = v.indexOf('/') === -1;
|
|
22
|
+
let isAbsUrl = v.startsWith('http');
|
|
23
|
+
if (isAbsUrl) {
|
|
24
|
+
urlList.push(v);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isId) {
|
|
29
|
+
urlList.push(SysUtil.getServerUrl() + 'sysFile/preview/' + v);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
urlList.push(SysUtil.getServerUrl() + v);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const imgs = urlList.map((url) => (
|
|
37
|
+
<img
|
|
38
|
+
style={{ display: 'inline-block' }}
|
|
39
|
+
key={url}
|
|
40
|
+
src={url}
|
|
41
|
+
onClick={() => this.preview(url)}
|
|
42
|
+
width={60}
|
|
43
|
+
height={60}
|
|
44
|
+
/>
|
|
45
|
+
));
|
|
46
|
+
|
|
47
|
+
return imgs;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
preview = (url) => {
|
|
51
|
+
Modal.info({
|
|
52
|
+
title: '预览图片',
|
|
53
|
+
width: '70vw',
|
|
54
|
+
content: <div style={{maxHeight:'70vh',overflow:'auto'}}>
|
|
55
|
+
<img src={url} style={{maxWidth: '100%'}}/>
|
|
56
|
+
</div>,
|
|
57
|
+
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
}
|