@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,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* antd 自带的checkbox 未选择时不会返回false, 和form配合时还得设置 valuePropName
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* 本组件改成布尔值的输入
|
|
6
|
+
*
|
|
7
|
+
* 选中 true, 反选 false
|
|
8
|
+
*
|
|
9
|
+
* 注意:null 会转为false
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import {Checkbox, Radio} from 'antd';
|
|
15
|
+
import {FieldProps} from "../FieldProps";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export {FieldCheckboxBoolean as FieldBoolean};
|
|
19
|
+
|
|
20
|
+
export class FieldCheckboxBoolean extends React.Component<FieldProps, any> {
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
render() {
|
|
24
|
+
|
|
25
|
+
let {value, mode} = this.props
|
|
26
|
+
|
|
27
|
+
const checked = this.parseBoolean(value);
|
|
28
|
+
|
|
29
|
+
if (mode == 'read') {
|
|
30
|
+
if (checked !== null) {
|
|
31
|
+
return checked ? "是" : "否"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Checkbox
|
|
38
|
+
checked={checked}
|
|
39
|
+
onChange={(e) => {
|
|
40
|
+
if (this.props.onChange) {
|
|
41
|
+
this.props.onChange(!!e.target.checked);
|
|
42
|
+
}
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
parseBoolean(v: any) {
|
|
49
|
+
if (v === null) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (typeof v === 'boolean') {
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
return v === 1 || v === 'true' || v === 'Y';
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export class FieldRadioBoolean extends React.Component {
|
|
63
|
+
render() {
|
|
64
|
+
let {mode, value, onChange} = this.props;
|
|
65
|
+
|
|
66
|
+
if(value != null){
|
|
67
|
+
// 转换一下,以免一些字符串格式出现
|
|
68
|
+
if(value === 'true'){
|
|
69
|
+
value = true
|
|
70
|
+
}else if(value === 'false'){
|
|
71
|
+
value = false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if (mode === 'read') {
|
|
77
|
+
if (value == null) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return value ? '是' : '否'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<Radio.Group value={value} onChange={onChange}>
|
|
86
|
+
<Radio value={true}>是</Radio>
|
|
87
|
+
<Radio value={false}>否</Radio>
|
|
88
|
+
<Radio value={null}>未知</Radio>
|
|
89
|
+
</Radio.Group>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ColumnsType} from "antd/es/table";
|
|
3
|
+
|
|
4
|
+
declare type FieldEditTableProps = {
|
|
5
|
+
columns: ColumnsType,
|
|
6
|
+
value?: any[]
|
|
7
|
+
onChange?: (list:any[])=>{}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export class FieldEditTable extends React.Component<FieldEditTableProps, any> {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {Button, Input, Table} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {DeleteOutlined, PlusOutlined} from "@ant-design/icons";
|
|
4
|
+
import './index.less'
|
|
5
|
+
import {ArrUtil} from "../../../utils";
|
|
6
|
+
|
|
7
|
+
export class FieldEditTable extends React.Component {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
columns = []
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
|
|
16
|
+
this.columns = this.props.columns.map(col => {
|
|
17
|
+
if (col.render == null) {
|
|
18
|
+
col.render = (v, record,index) => {
|
|
19
|
+
return <Input value={v} onChange={(e)=>this.onCellChange(index,col.dataIndex,e)}/>
|
|
20
|
+
}
|
|
21
|
+
}else {
|
|
22
|
+
if(!col._oldRender){
|
|
23
|
+
col._oldRender = col.render
|
|
24
|
+
col.render = (v, record,index) => {
|
|
25
|
+
const cmp =col._oldRender()
|
|
26
|
+
return React.createElement(cmp.type,{...cmp.props, value:v, onChange: (e)=>this.onCellChange(index, col.dataIndex, e)})
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return col
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
this.columns.push({
|
|
34
|
+
title: '/',
|
|
35
|
+
render:(v, record) =>{
|
|
36
|
+
return <Button icon={<DeleteOutlined/>} size='small' shape={'circle'}
|
|
37
|
+
onClick={() => this.remove(record)}></Button>
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
if (this.props.value != null) {
|
|
42
|
+
this.state.dataSource = this.props.value
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
state = {
|
|
48
|
+
dataSource: []
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
onCellChange=(index,dataIndex,e)=>{
|
|
53
|
+
let {dataSource} = this.state
|
|
54
|
+
let row =dataSource[index]
|
|
55
|
+
|
|
56
|
+
let v = e;
|
|
57
|
+
if(e.hasOwnProperty('target')){
|
|
58
|
+
v = e.target.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
row[dataIndex] = v
|
|
63
|
+
|
|
64
|
+
dataSource = [...dataSource]
|
|
65
|
+
this.setState({dataSource},this.notifyParent)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
add = () => {
|
|
69
|
+
let {dataSource} = this.state
|
|
70
|
+
dataSource = [...dataSource, {}];
|
|
71
|
+
this.setState({dataSource},this.notifyParent)
|
|
72
|
+
};
|
|
73
|
+
remove = (record) => {
|
|
74
|
+
let {dataSource} = this.state
|
|
75
|
+
ArrUtil.remove(dataSource, record)
|
|
76
|
+
this.setState({dataSource:[...dataSource]},this.notifyParent)
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
notifyParent(){
|
|
80
|
+
let {dataSource} = this.state
|
|
81
|
+
this.props.onChange(dataSource)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render() {
|
|
85
|
+
return <div className='edit-table'>
|
|
86
|
+
|
|
87
|
+
<Table columns={this.columns}
|
|
88
|
+
dataSource={this.state.dataSource}
|
|
89
|
+
size='small'
|
|
90
|
+
|
|
91
|
+
footer={() => <Button type='dashed' icon={<PlusOutlined/>}
|
|
92
|
+
onClick={this.add}>增加一行
|
|
93
|
+
</Button>}
|
|
94
|
+
|
|
95
|
+
pagination={false}
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
</Table>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.edit-table {
|
|
2
|
+
table{
|
|
3
|
+
width: 100%;
|
|
4
|
+
border-spacing: 0;
|
|
5
|
+
|
|
6
|
+
th {
|
|
7
|
+
background-color: rgb(250, 250, 250);
|
|
8
|
+
padding: 16px;
|
|
9
|
+
color: rgba(0, 0, 0, 0.88);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
th:last-child, td:last-child {
|
|
15
|
+
text-align: center;
|
|
16
|
+
width: 50px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
td {
|
|
20
|
+
padding: 2px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
.add-btn-wrapper{
|
|
26
|
+
margin: 8px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Editor as TinyMceEditor} from '@tinymce/tinymce-react';
|
|
3
|
+
import {SysUtil} from "../../system";
|
|
4
|
+
import {UrlUtil} from "../../utils";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 富文本编辑器
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export class FieldEditor extends React.Component {
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
let serverUrl = SysUtil.getServerUrl();
|
|
15
|
+
let uploadUrl = UrlUtil.join(serverUrl , 'sysFile/upload')
|
|
16
|
+
|
|
17
|
+
return <>
|
|
18
|
+
<TinyMceEditor
|
|
19
|
+
initialValue={this.props.value}
|
|
20
|
+
tinymceScriptSrc={UrlUtil.join(serverUrl , "tinymce/tinymce.min.js")}
|
|
21
|
+
init={{
|
|
22
|
+
min_height: 500,
|
|
23
|
+
language: 'zh_CN',
|
|
24
|
+
plugins: [
|
|
25
|
+
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
|
26
|
+
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
|
27
|
+
'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
|
|
28
|
+
],
|
|
29
|
+
toolbar_mode:'Sliding',
|
|
30
|
+
toolbar: "fontsize blocks bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify |image link | bullist numlist outdent indent | removeformat |fontfamily| undo redo | help",
|
|
31
|
+
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
|
|
32
|
+
|
|
33
|
+
// 上传图片
|
|
34
|
+
images_upload_url: uploadUrl,
|
|
35
|
+
images_upload_base_path: serverUrl,
|
|
36
|
+
promotion: false, // 不显示升级按钮(右上角)
|
|
37
|
+
cache_suffix: '?v=v7.7'
|
|
38
|
+
|
|
39
|
+
}}
|
|
40
|
+
onChange={e => {
|
|
41
|
+
if (this.props.onChange) {
|
|
42
|
+
this.props.onChange(e.target.getContent())
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
</>;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
declare type FieldFileBase64Props = {
|
|
5
|
+
value?: any,
|
|
6
|
+
onChange?: (v: any) => {},
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 按钮文字
|
|
10
|
+
*/
|
|
11
|
+
buttonText?: string
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class FieldFileBase64 extends React.Component<FieldFileBase64Props, any> {
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Input} from "antd";
|
|
3
|
+
import {FieldUploadFile} from "../upload";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class FieldFileBase64 extends React.Component {
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
let url = '/utils/fileBase64';
|
|
10
|
+
console.log('上传地址')
|
|
11
|
+
return <>
|
|
12
|
+
<Input.TextArea rows={3} value={this.props.value}></Input.TextArea>
|
|
13
|
+
<FieldUploadFile url={url} onChange={this.onFinish}></FieldUploadFile>
|
|
14
|
+
</>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
onFinish = value => {
|
|
18
|
+
if(this.props.onChange){
|
|
19
|
+
this.props.onChange(value)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
declare type FieldImageBase64Props = {
|
|
5
|
+
value?: any,
|
|
6
|
+
onChange?: (v: any) => {},
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 按钮文字
|
|
10
|
+
*/
|
|
11
|
+
buttonText?: string
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class FieldImageBase64 extends React.Component<FieldImageBase64Props, any> {
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Input} from "antd";
|
|
3
|
+
import {FieldUploadFile} from "../upload";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class FieldImageBase64 extends React.Component {
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
let url = '/utils/fileBase64';
|
|
10
|
+
return <>
|
|
11
|
+
<Input.TextArea rows={3} value={this.props.value}></Input.TextArea>
|
|
12
|
+
<FieldUploadFile url={url} onChange={this.onFinish}></FieldUploadFile>
|
|
13
|
+
</>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
onFinish = value => {
|
|
17
|
+
if(this.props.onChange){
|
|
18
|
+
this.props.onChange(value)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Input} from 'antd';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class FieldInput extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
if(this.props.mode === 'read'){
|
|
8
|
+
return this.props.value
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return <Input value={this.props.value} onChange={this.props.onChange} />
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织机构树
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import {FieldProps} from "../FieldProps";
|
|
6
|
+
import {Tree} from "antd";
|
|
7
|
+
import {LoadingOutlined} from "@ant-design/icons";
|
|
8
|
+
|
|
9
|
+
interface Props extends FieldProps {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export default class extends React.Component<Props, any> {
|
|
14
|
+
|
|
15
|
+
state = {
|
|
16
|
+
treeData: null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
const params: any = {
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
HttpUtil.get("admin/admin/sysOrg/unitTree", params).then(rs => {
|
|
25
|
+
this.setState({treeData: rs})
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
render() {
|
|
30
|
+
if (this.state.treeData == null) {
|
|
31
|
+
return <LoadingOutlined/>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return <Tree.DirectoryTree defaultSelectedKeys={[this.props.value]}
|
|
35
|
+
expandAction={false}
|
|
36
|
+
treeData={this.state.treeData}
|
|
37
|
+
defaultExpandAll
|
|
38
|
+
onSelect={this.onSelect}/>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
onSelect = (keys: any[]) => {
|
|
42
|
+
this.props.onChange(keys[0])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FieldProps {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description form表单,read查看, 不填表示表单
|
|
6
|
+
*/
|
|
7
|
+
mode?: 'form' | 'read' ;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @description 值
|
|
11
|
+
*/
|
|
12
|
+
value?: any;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @description 函数回调,当值变化时
|
|
17
|
+
*/
|
|
18
|
+
onChange?: (value: any) => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {Cascader, message, Spin} from 'antd';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {HttpUtil} from "../../system";
|
|
5
|
+
import {TreeUtil} from "../../utils";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* props : url
|
|
10
|
+
*/
|
|
11
|
+
export class FieldRemoteTreeCascader extends React.Component {
|
|
12
|
+
state = {
|
|
13
|
+
data: [],
|
|
14
|
+
value: [],
|
|
15
|
+
fetching: false,
|
|
16
|
+
key: this.props.id,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
componentDidMount() {
|
|
20
|
+
this.fetchData();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
24
|
+
this.setState({ url: this.props.url }, () => {
|
|
25
|
+
this.fetchData();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
fetchData = () => {
|
|
32
|
+
const { url } = this.props;
|
|
33
|
+
this.setState({ fetching: true });
|
|
34
|
+
|
|
35
|
+
HttpUtil.get(url).then(list => {
|
|
36
|
+
|
|
37
|
+
if (!(list instanceof Array)) {
|
|
38
|
+
message.error('返回结果应该为数组');
|
|
39
|
+
this.setState({ fetching: false });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.setState({ data: list, fetching: false });
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
handleChange = (arr) => {
|
|
48
|
+
if (this.props.onChange) {
|
|
49
|
+
this.props.onChange(arr[arr.length - 1]);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
const { data, map, fetching } = this.state;
|
|
55
|
+
if (fetching) {
|
|
56
|
+
return <Spin />;
|
|
57
|
+
}
|
|
58
|
+
let { value, ...restProps } = this.props;
|
|
59
|
+
|
|
60
|
+
let arr = [];
|
|
61
|
+
if (value != null) {
|
|
62
|
+
arr = TreeUtil.getKeyList(data, value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Cascader
|
|
67
|
+
options={data}
|
|
68
|
+
onChange={this.handleChange}
|
|
69
|
+
value={arr}
|
|
70
|
+
fieldNames={{ label: 'title', value: 'key' }}
|
|
71
|
+
{...restProps}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {Spin, TreeSelect} from 'antd';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {HttpUtil} from "../../system";
|
|
5
|
+
import {TreeUtil} from "../../utils";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 带checkbox的tree select
|
|
10
|
+
* props : url
|
|
11
|
+
*/
|
|
12
|
+
export class FieldRemoteTreeCheckable extends React.Component {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
state = {
|
|
17
|
+
data: [],
|
|
18
|
+
fetching: false,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
componentDidMount() {
|
|
23
|
+
const {url} = this.props;
|
|
24
|
+
this.fetchData(url);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
fetchData = (url) => {
|
|
29
|
+
this.setState({fetching: true});
|
|
30
|
+
|
|
31
|
+
HttpUtil.get(url).then((rs) => {
|
|
32
|
+
this.setState({data: rs, fetching: false});
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
handleChange = (value) => {
|
|
37
|
+
if (this.props.onChange) {
|
|
38
|
+
this.props.onChange(value);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
render() {
|
|
43
|
+
const {data} = this.state;
|
|
44
|
+
let {value, mode, onChange, url, ...restProps} = this.props;
|
|
45
|
+
|
|
46
|
+
if (this.state.fetching) {
|
|
47
|
+
return <Spin/>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (mode === 'read') {
|
|
51
|
+
return this.renderRead();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<TreeSelect
|
|
56
|
+
{...restProps}
|
|
57
|
+
style={{width: '100%'}}
|
|
58
|
+
allowClear={true}
|
|
59
|
+
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
60
|
+
treeData={data}
|
|
61
|
+
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
62
|
+
treeDefaultExpandAll={false}
|
|
63
|
+
onChange={this.handleChange}
|
|
64
|
+
multiple
|
|
65
|
+
value={value || []}
|
|
66
|
+
treeCheckable
|
|
67
|
+
treeLine
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
renderRead() {
|
|
73
|
+
const {value} = this.props;
|
|
74
|
+
if (value == null) {
|
|
75
|
+
return '-';
|
|
76
|
+
}
|
|
77
|
+
const {data} = this.state;
|
|
78
|
+
const itemList = TreeUtil.findByKeyList(data, value);
|
|
79
|
+
return itemList.map((item) => item.title || item.label).join(',');
|
|
80
|
+
}
|
|
81
|
+
}
|