@jiangood/springboot-admin-starter 0.0.3 → 0.0.4
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/dist/config.js +32 -0
- package/config/dist/index.js +0 -1
- package/config/dist/plugins/form-plugin.js +2 -2
- package/package.json +12 -10
- package/src/forms/demoForm.jsx +5 -5
- package/src/framework/components/DownloadFileButton.jsx +2 -2
- package/src/framework/components/Ellipsis.jsx +2 -2
- package/src/framework/components/LinkButton.d.ts +4 -4
- package/src/framework/components/LinkButton.jsx +6 -9
- package/src/framework/components/Page/index.jsx +2 -2
- package/src/framework/components/PageLoading.tsx +27 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +6 -7
- package/src/framework/components/ProTable/index.d.ts +5 -1
- package/src/framework/components/ProTable/index.jsx +4 -6
- package/src/framework/components/ProTable/index.less +0 -1
- package/src/framework/components/ValueType/registry.jsx +9 -20
- package/src/framework/components/{index.js → index.ts} +2 -10
- package/src/framework/components/system/ButtonList.jsx +35 -0
- package/src/framework/components/system/HasPerm.tsx +14 -0
- package/src/framework/components/system/index.tsx +29 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.tsx +20 -0
- package/src/framework/components/view/ViewEllipsis.jsx +2 -2
- package/src/framework/components/view/ViewFile.jsx +1 -2
- package/src/framework/components/view/ViewImage.jsx +2 -3
- package/src/framework/components/view/ViewText.tsx +16 -0
- package/src/framework/components/view/{index.js → index.ts} +0 -2
- package/src/framework/field-components/FieldBoolean.d.ts +13 -0
- package/src/framework/field-components/FieldBoolean.jsx +76 -0
- package/src/framework/field-components/FieldDate.d.ts +25 -0
- package/src/framework/field-components/FieldDate.jsx +109 -0
- package/src/framework/field-components/FieldDateRange.d.ts +6 -0
- package/src/framework/field-components/FieldDateRange.jsx +101 -0
- package/src/framework/field-components/FieldDictSelect.d.ts +13 -0
- package/src/framework/field-components/FieldDictSelect.jsx +16 -0
- package/src/framework/field-components/FieldEditor.d.ts +10 -0
- package/src/framework/field-components/FieldEditor.jsx +58 -0
- package/src/framework/field-components/FieldPercent.d.ts +12 -0
- package/src/framework/field-components/FieldPercent.jsx +27 -0
- package/src/framework/field-components/FieldRemoteSelect.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelect.jsx +87 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.jsx +86 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.d.ts +20 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.jsx +86 -0
- package/src/framework/field-components/FieldRemoteTree.d.ts +21 -0
- package/src/framework/field-components/FieldRemoteTree.jsx +45 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.d.ts +23 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.jsx +61 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.jsx +67 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.jsx +68 -0
- package/src/framework/field-components/FieldSysOrgTree.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTree.jsx +23 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.jsx +23 -0
- package/src/framework/{components/field/FieldEditTable/index.d.ts → field-components/FieldTable.d.ts} +5 -2
- package/src/framework/{components/field/FieldEditTable/index.jsx → field-components/FieldTable.jsx} +29 -21
- package/src/framework/{components/field/select/FieldTableSelect/index.d.ts → field-components/FieldTableSelect.d.ts} +4 -14
- package/src/framework/field-components/FieldTableSelect.jsx +59 -0
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.d.ts +0 -1
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.jsx +5 -9
- package/src/framework/field-components/index.ts +20 -0
- package/src/framework/{components/OrgTree.jsx → field-components/system/OrgTree.tsx} +8 -7
- package/src/framework/{components/RoleTree.jsx → field-components/system/RoleTree.tsx} +3 -3
- package/src/framework/field-components/system/index.ts +2 -0
- package/src/framework/index.ts +4 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/{date.js → DateUtils.ts} +69 -69
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +143 -0
- package/src/framework/utils/MessageUtils.tsx +182 -0
- package/src/framework/utils/ObjectUtils.ts +113 -0
- package/src/framework/utils/StorageUtils.ts +67 -0
- package/src/framework/utils/StringUtils.ts +410 -0
- package/src/framework/utils/TreeUtils.ts +248 -0
- package/src/framework/utils/UrlUtils.ts +152 -0
- package/src/framework/utils/UuidUtils.ts +88 -0
- package/src/framework/utils/ValidateUtils.ts +28 -0
- package/src/framework/utils/index.ts +16 -0
- package/src/framework/utils/system/DictUtils.ts +97 -0
- package/src/framework/utils/system/FormRegistryUtils.ts +77 -0
- package/src/framework/utils/system/HttpUtils.ts +246 -0
- package/src/framework/utils/system/PageUtils.ts +153 -0
- package/src/framework/utils/system/PermUtils.ts +79 -0
- package/src/framework/utils/system/SysUtils.ts +97 -0
- package/src/framework/utils/system/ThemeUtils.ts +27 -0
- package/src/framework/utils/system/index.ts +7 -0
- package/src/framework/view-components/ViewBoolean.jsx +4 -0
- package/src/framework/view-components/index.js +3 -0
- package/src/layouts/PageRender.jsx +2 -2
- package/src/layouts/admin/HeaderRight.jsx +9 -9
- package/src/layouts/admin/TabPageRender.jsx +2 -2
- package/src/layouts/admin/index.jsx +27 -40
- package/src/layouts/admin/index.less +2 -1
- package/src/layouts/index.jsx +30 -38
- package/src/layouts/index.less +0 -21
- package/src/loading.jsx +2 -2
- package/src/{components → pages/flowable}/InstanceInfo.jsx +5 -4
- package/src/pages/flowable/design/customTranslate/customTranslate.js +16 -0
- package/src/pages/flowable/design/customTranslate/translations-properties-panel.js +10 -0
- package/src/pages/flowable/design/customTranslate/translations.js +144 -0
- package/src/pages/flowable/design/descriptors/flowable.json +1109 -0
- package/src/pages/flowable/design/index.jsx +61 -234
- package/src/pages/flowable/design/provider/FlowablePropertiesProvider.js +75 -0
- package/src/pages/flowable/design/provider/index.js +6 -0
- package/src/pages/flowable/design/provider/properties/ConditionDesign.jsx +175 -0
- package/src/pages/flowable/design/provider/properties/ConditionProps.jsx +76 -0
- package/src/pages/flowable/design/provider/properties/DelegateExpressionProps.js +54 -0
- package/src/pages/flowable/design/provider/properties/FormProps.js +55 -0
- package/src/pages/flowable/design/provider/properties/MultiInstanceProps.js +100 -0
- package/src/pages/flowable/design/provider/properties/UserTaskForm.jsx +48 -0
- package/src/pages/flowable/design/provider/properties/utils.jsx +35 -0
- package/src/pages/flowable/index.jsx +28 -69
- package/src/pages/flowable/monitor/definition.jsx +87 -0
- package/src/pages/flowable/monitor/instance/index.jsx +177 -0
- package/src/pages/flowable/monitor/instance/view.jsx +102 -0
- package/src/pages/flowable/monitor/task.jsx +93 -0
- package/src/pages/flowable/task/form.jsx +5 -5
- package/src/pages/flowable/task/index.jsx +5 -5
- package/src/pages/flowable/test/index.jsx +13 -10
- package/src/pages/index.jsx +8 -13
- package/src/pages/login.jsx +8 -8
- package/src/pages/{api/doc.jsx → system/api/ApiDoc.jsx} +56 -47
- package/src/pages/system/api/index.jsx +268 -0
- package/src/pages/system/api/perm.jsx +69 -0
- package/src/pages/system/config/index.jsx +3 -3
- package/src/pages/system/dict/Dict.jsx +2 -3
- package/src/pages/system/dict/DictItem.jsx +5 -5
- package/src/pages/system/file/index.jsx +13 -5
- package/src/pages/{job → system/job}/index.jsx +124 -39
- package/src/pages/system/log/index.jsx +3 -3
- package/src/pages/system/org/index.jsx +11 -12
- package/src/pages/system/role/index.jsx +11 -11
- package/src/pages/system/role/perm.jsx +8 -8
- package/src/pages/system/sysManual/index.jsx +6 -6
- package/src/pages/system/user/UserPerm.jsx +7 -42
- package/src/pages/system/user/index.jsx +13 -17
- package/src/pages/test.jsx +188 -3
- package/src/pages/ureport/index.jsx +4 -4
- package/src/pages/userCenter/ChangePassword.jsx +3 -4
- package/src/pages/userCenter/index.jsx +2 -2
- package/src/pages/userCenter/manual.jsx +3 -7
- package/src/pages/userCenter/message.jsx +5 -5
- package/config/dist/config.local.js +0 -23
- package/src/components/InstanceStatusInfo.jsx +0 -79
- package/src/components/StreamLog.jsx +0 -27
- package/src/components/flow/BpmnUtils.js +0 -85
- package/src/components/flow/customTranslate/customTranslate.js +0 -19
- package/src/components/flow/customTranslate/translations.js +0 -79
- package/src/components/flow/design/form/ConditionForm.jsx +0 -316
- package/src/components/flow/design/form/ServiceTaskForm.jsx +0 -55
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +0 -62
- package/src/components/flow/design/form/UserTaskForm.jsx +0 -211
- package/src/components/flow/design/palette.js +0 -39
- package/src/components/monitor/AllDefinition.jsx +0 -46
- package/src/components/monitor/AllInstance.jsx +0 -76
- package/src/forms/driverForm.jsx +0 -18
- package/src/framework/components/ButtonList.jsx +0 -91
- package/src/framework/components/Echarts/index.d.ts +0 -10
- package/src/framework/components/Echarts/index.jsx +0 -49
- package/src/framework/components/EditTable/index.d.ts +0 -11
- package/src/framework/components/EditTable/index.jsx +0 -85
- package/src/framework/components/FieldRemoteTree.jsx +0 -20
- package/src/framework/components/HasPerm.jsx +0 -18
- package/src/framework/components/ImageView.d.ts +0 -12
- package/src/framework/components/ImageView.jsx +0 -64
- package/src/framework/components/MsgBox.jsx +0 -180
- package/src/framework/components/PageLoading.jsx +0 -31
- package/src/framework/components/Panel/index.d.ts +0 -11
- package/src/framework/components/Panel/index.jsx +0 -24
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +0 -46
- package/src/framework/components/field/FieldBoolean/index.tsx +0 -92
- package/src/framework/components/field/FieldEditTable/index.less +0 -29
- package/src/framework/components/field/FieldEditor.jsx +0 -48
- package/src/framework/components/field/FieldFileBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldFileBase64/index.jsx +0 -23
- package/src/framework/components/field/FieldImageBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldImageBase64/index.jsx +0 -22
- package/src/framework/components/field/FieldInput.jsx +0 -13
- package/src/framework/components/field/FieldOrgTree/index.tsx +0 -45
- package/src/framework/components/field/FieldPassword.jsx +0 -11
- package/src/framework/components/field/FieldProps.ts +0 -19
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +0 -75
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +0 -81
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +0 -100
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +0 -82
- package/src/framework/components/field/FieldSelectPosition/index.tsx +0 -85
- package/src/framework/components/field/FieldTree.jsx +0 -45
- package/src/framework/components/field/dict/index.tsx +0 -110
- package/src/framework/components/field/flat-multiple-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-multiple-select/index.jsx +0 -116
- package/src/framework/components/field/flat-multiple-select/index.less +0 -12
- package/src/framework/components/field/flat-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-select/index.jsx +0 -107
- package/src/framework/components/field/flat-select/index.less +0 -12
- package/src/framework/components/field/index.js +0 -33
- package/src/framework/components/field/input-number-percent/index.d.ts +0 -11
- package/src/framework/components/field/input-number-percent/index.jsx +0 -28
- package/src/framework/components/field/select/FieldSelect/index.d.ts +0 -39
- package/src/framework/components/field/select/FieldSelect/index.jsx +0 -156
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +0 -155
- package/src/framework/components/field/select/index.jsx +0 -2
- package/src/framework/components/field/switch-y-n/index.d.ts +0 -11
- package/src/framework/components/field/switch-y-n/index.jsx +0 -31
- package/src/framework/components/field/text/index.tsx +0 -7
- package/src/framework/components/field/time/DatePickerString.tsx +0 -37
- package/src/framework/components/field/time/DateTimePickerString.tsx +0 -42
- package/src/framework/components/field/time/FieldDateRange.d.ts +0 -9
- package/src/framework/components/field/time/FieldDateRange.jsx +0 -49
- package/src/framework/components/field/time/HHmmPickerString.tsx +0 -42
- package/src/framework/components/field/time/MonthPickerString.tsx +0 -45
- package/src/framework/components/field/time/TimePickerTool.ts +0 -14
- package/src/framework/components/field/time/YearPickerString.tsx +0 -41
- package/src/framework/components/field/time/YearQuarterString.tsx +0 -38
- package/src/framework/components/field/time/index.tsx +0 -7
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +0 -22
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +0 -11
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +0 -7
- package/src/framework/components/field/upload/FieldUploadImage.jsx +0 -16
- package/src/framework/components/field/upload/index.jsx +0 -3
- package/src/framework/components/system.jsx +0 -29
- package/src/framework/components/view/ViewBoolean.jsx +0 -15
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +0 -16
- package/src/framework/components/view/ViewText.jsx +0 -9
- package/src/framework/index.js +0 -3
- package/src/framework/system/dict.js +0 -88
- package/src/framework/system/formRegistry.js +0 -58
- package/src/framework/system/http.jsx +0 -290
- package/src/framework/system/index.js +0 -13
- package/src/framework/system/page.js +0 -109
- package/src/framework/system/permission.js +0 -44
- package/src/framework/system/sys.js +0 -60
- package/src/framework/system/theme.js +0 -17
- package/src/framework/utils/arr.js +0 -118
- package/src/framework/utils/browser.js +0 -24
- package/src/framework/utils/color.js +0 -269
- package/src/framework/utils/debounce.js +0 -33
- package/src/framework/utils/dom.js +0 -16
- package/src/framework/utils/eventBus.js +0 -70
- package/src/framework/utils/html.js +0 -13
- package/src/framework/utils/index.js +0 -17
- package/src/framework/utils/obj.js +0 -72
- package/src/framework/utils/storage.js +0 -37
- package/src/framework/utils/str.js +0 -297
- package/src/framework/utils/tree.js +0 -175
- package/src/framework/utils/uid.js +0 -76
- package/src/framework/utils/url.js +0 -84
- package/src/framework/utils/validate.js +0 -9
- package/src/pages/api/accessLog/index.jsx +0 -108
- package/src/pages/api/accountResource/index.jsx +0 -149
- package/src/pages/api/index.jsx +0 -163
- package/src/pages/api/resource.jsx +0 -18
- package/src/pages/flowable/instance/view.jsx +0 -13
- package/src/pages/flowable/monitor.jsx +0 -106
- package/src/pages/flowable/test/form.jsx +0 -31
- package/src/pages/job/logList.jsx +0 -100
- package/src/pages/job/status.jsx +0 -84
- /package/src/framework/components/{ButtonList.d.ts → system/ButtonList.d.ts} +0 -0
- /package/src/framework/{components/EditTable/index.less → field-components/FieldTable.less} +0 -0
- /package/src/framework/{components/view → view-components}/ViewPassword.jsx +0 -0
- /package/src/{index.js → index.ts} +0 -0
- /package/src/{components/flow → pages/flowable}/design/contextPad.js +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Select, Spin, message} from 'antd';
|
|
3
|
+
import {debounce} from 'lodash';
|
|
4
|
+
import {HttpUtils, StringUtils} from "../utils";
|
|
5
|
+
|
|
6
|
+
export class FieldRemoteSelectMultipleInline extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
|
|
10
|
+
this.state = {
|
|
11
|
+
options: [],
|
|
12
|
+
loading: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.fetchIdRef = 0;
|
|
16
|
+
this.loadDataDebounce = debounce(this.loadData, 800);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static defaultProps = {
|
|
20
|
+
placeholder: '请搜索选择'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
componentDidMount() {
|
|
24
|
+
this.loadData('')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
componentWillUnmount() {
|
|
28
|
+
this.loadDataDebounce.cancel();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
loadData = async (searchText) => {
|
|
32
|
+
const {url, value} = this.props;
|
|
33
|
+
const fetchId = ++this.fetchIdRef;
|
|
34
|
+
|
|
35
|
+
this.setState({loading: true});
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = await HttpUtils.get(url, {searchText, selected: value});
|
|
39
|
+
|
|
40
|
+
if (fetchId === this.fetchIdRef) {
|
|
41
|
+
this.setState({options: data || []});
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('远程搜索失败:', error);
|
|
45
|
+
message.error('搜索失败,请重试');
|
|
46
|
+
this.setState({options: []});
|
|
47
|
+
} finally {
|
|
48
|
+
if (fetchId === this.fetchIdRef) {
|
|
49
|
+
this.setState({loading: false});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
handleSearch = (value) => {
|
|
55
|
+
if (value.trim() === '') {
|
|
56
|
+
this.setState({options: []});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.loadDataDebounce(value.trim());
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
render() {
|
|
63
|
+
const {options, loading} = this.state;
|
|
64
|
+
const {value, onChange, url, ...selectProps} = this.props;
|
|
65
|
+
return (
|
|
66
|
+
<Select
|
|
67
|
+
showSearch={
|
|
68
|
+
{
|
|
69
|
+
filterOption: false,
|
|
70
|
+
onSearch: this.handleSearch,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
value={StringUtils.split(value, ',')}
|
|
74
|
+
onChange={arr=>onChange(StringUtils.join(arr, ','))}
|
|
75
|
+
options={options}
|
|
76
|
+
notFoundContent={loading ? <Spin size="small"/> : '数据为空'}
|
|
77
|
+
style={{width: '100%', minWidth: 200}}
|
|
78
|
+
allowClear
|
|
79
|
+
mode='multiple'
|
|
80
|
+
{...selectProps}
|
|
81
|
+
>
|
|
82
|
+
</Select>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd/es/select';
|
|
3
|
+
import {TreeProps} from "antd";
|
|
4
|
+
|
|
5
|
+
export interface FieldRemoteTreeProps {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 请求地址
|
|
9
|
+
*/
|
|
10
|
+
url: string ;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 多选树
|
|
15
|
+
*
|
|
16
|
+
* 区别于下拉框,是扁平展示的树
|
|
17
|
+
* 这种需要扁平展示的树,通常都是多选。
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export class FieldRemoteTree extends React.Component<FieldRemoteTreeProps, any> {}
|
|
21
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Spin, Tree} from "antd";
|
|
3
|
+
import {HttpUtils} from "../utils";
|
|
4
|
+
|
|
5
|
+
export class FieldRemoteTree extends React.Component {
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
treeLoading: true,
|
|
9
|
+
treeData: [],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
componentDidMount() {
|
|
13
|
+
this.loadData();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
loadData = async () => {
|
|
18
|
+
this.setState({treeLoading: true})
|
|
19
|
+
let url = this.props.url;
|
|
20
|
+
try {
|
|
21
|
+
const treeData = await HttpUtils.get(url)
|
|
22
|
+
this.setState({treeData})
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.log(e)
|
|
25
|
+
} finally {
|
|
26
|
+
this.setState({treeLoading: false})
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
if (this.state.treeLoading) {
|
|
32
|
+
return <Spin/>
|
|
33
|
+
}
|
|
34
|
+
return <Tree
|
|
35
|
+
multiple
|
|
36
|
+
checkable
|
|
37
|
+
onCheck={e => this.props.onChange(e.checked)}
|
|
38
|
+
checkedKeys={this.props.value}
|
|
39
|
+
treeData={this.state.treeData}
|
|
40
|
+
defaultExpandAll
|
|
41
|
+
checkStrictly
|
|
42
|
+
>
|
|
43
|
+
</Tree>
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd/es/select';
|
|
3
|
+
import {TreeProps} from "antd";
|
|
4
|
+
|
|
5
|
+
export interface FieldRemoteTreeCascaderProps {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 请求地址
|
|
9
|
+
* 要求返回数据格式为:tree
|
|
10
|
+
*/
|
|
11
|
+
url: string ;
|
|
12
|
+
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 远程树级联选择器, 类似select,但是树级联
|
|
19
|
+
*
|
|
20
|
+
* 注意,value为非数组形式,区别于cascader组件
|
|
21
|
+
*/
|
|
22
|
+
export class FieldRemoteTreeCascader extends React.Component<FieldRemoteTreeCascaderProps, any> {}
|
|
23
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {Cascader, message, Spin} from 'antd';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {HttpUtils, TreeUtils} from "../utils";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class FieldRemoteTreeCascader extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
data: [],
|
|
11
|
+
value: [],
|
|
12
|
+
loading: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
componentDidMount() {
|
|
16
|
+
this.loadData();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
loadData = async () => {
|
|
21
|
+
const {url} = this.props;
|
|
22
|
+
this.setState({loading: true});
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const list = await HttpUtils.get(url);
|
|
26
|
+
this.setState({data: list});
|
|
27
|
+
} catch (e) {
|
|
28
|
+
console.log(e)
|
|
29
|
+
} finally {
|
|
30
|
+
this.setState({loading: false});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
const {data} = this.state;
|
|
39
|
+
if (this.state.loading) {
|
|
40
|
+
return <Spin/>;
|
|
41
|
+
}
|
|
42
|
+
let {value, onChange,...rest} = this.props;
|
|
43
|
+
|
|
44
|
+
let arr = [];
|
|
45
|
+
if (value != null) {
|
|
46
|
+
arr = TreeUtils.getKeyList(data, value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Cascader
|
|
51
|
+
options={this.state.data}
|
|
52
|
+
onChange={arr=>{
|
|
53
|
+
onChange(arr[arr.length - 1]);
|
|
54
|
+
}}
|
|
55
|
+
value={arr}
|
|
56
|
+
fieldNames={{label: 'title', value: 'key'}}
|
|
57
|
+
{...rest}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FieldRemoteTreeSelectProps {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 请求地址
|
|
7
|
+
*/
|
|
8
|
+
url: string ;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 默认展开所有
|
|
12
|
+
*/
|
|
13
|
+
treeDefaultExpandAll?: boolean ;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class FieldRemoteTreeSelect extends React.Component<FieldRemoteTreeSelectProps, any> {}
|
|
17
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {Spin, TreeSelect} from 'antd';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {HttpUtils, StringUtils} from "../utils";
|
|
5
|
+
|
|
6
|
+
export class FieldRemoteTreeSelect extends React.Component {
|
|
7
|
+
|
|
8
|
+
static defaultProps = {
|
|
9
|
+
treeDefaultExpandAll: true,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
state = {
|
|
13
|
+
data: [],
|
|
14
|
+
value: [],
|
|
15
|
+
loading: false,
|
|
16
|
+
key: this.props.id,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
componentDidMount() {
|
|
20
|
+
this.loadData();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
loadData = async () => {
|
|
25
|
+
const {url} = this.props;
|
|
26
|
+
this.setState({loading: true});
|
|
27
|
+
try {
|
|
28
|
+
const rs = await HttpUtils.get(url)
|
|
29
|
+
this.setState({data: rs});
|
|
30
|
+
} finally {
|
|
31
|
+
this.setState({loading: false});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
let {value,onChange} = this.props;
|
|
39
|
+
let {data} = this.state;
|
|
40
|
+
|
|
41
|
+
if (this.state.loading) {
|
|
42
|
+
return <Spin/>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<TreeSelect
|
|
50
|
+
style={{width: '100%', minWidth: 200}}
|
|
51
|
+
allowClear={true}
|
|
52
|
+
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
53
|
+
treeData={data}
|
|
54
|
+
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
55
|
+
value={value || undefined}
|
|
56
|
+
onChange={onChange}
|
|
57
|
+
|
|
58
|
+
filterTreeNode={(inputValue, treeNode) => {
|
|
59
|
+
const {title} = treeNode
|
|
60
|
+
return StringUtils.contains(title, inputValue)
|
|
61
|
+
}}
|
|
62
|
+
treeLine={{showLeafIcon: true}}
|
|
63
|
+
treeDefaultExpandAll={this.props.treeDefaultExpandAll}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FieldRemoteTreeSelectMultipleProps {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 请求地址
|
|
7
|
+
*/
|
|
8
|
+
url: string ;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 默认展开所有
|
|
12
|
+
*/
|
|
13
|
+
treeDefaultExpandAll?: boolean ;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class FieldRemoteTreeSelectMultiple extends React.Component<FieldRemoteTreeSelectMultipleProps, any> {}
|
|
17
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {Spin, TreeSelect} from 'antd';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {HttpUtils, StringUtils} from "../utils";
|
|
5
|
+
|
|
6
|
+
export class FieldRemoteTreeSelectMultiple extends React.Component {
|
|
7
|
+
|
|
8
|
+
static defaultProps = {
|
|
9
|
+
treeDefaultExpandAll: true,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
state = {
|
|
13
|
+
data: [],
|
|
14
|
+
value: [],
|
|
15
|
+
loading: false,
|
|
16
|
+
key: this.props.id,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
componentDidMount() {
|
|
20
|
+
this.loadData();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
loadData = async () => {
|
|
25
|
+
const {url} = this.props;
|
|
26
|
+
this.setState({loading: true});
|
|
27
|
+
try {
|
|
28
|
+
const rs = await HttpUtils.get(url)
|
|
29
|
+
this.setState({data: rs});
|
|
30
|
+
} finally {
|
|
31
|
+
this.setState({loading: false});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
let {value,onChange} = this.props;
|
|
39
|
+
let {data} = this.state;
|
|
40
|
+
|
|
41
|
+
if (this.state.loading) {
|
|
42
|
+
return <Spin/>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<TreeSelect
|
|
50
|
+
style={{width: '100%', minWidth: 200}}
|
|
51
|
+
allowClear={true}
|
|
52
|
+
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
53
|
+
treeData={data}
|
|
54
|
+
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
55
|
+
value={value || undefined}
|
|
56
|
+
onChange={onChange}
|
|
57
|
+
multiple={true}
|
|
58
|
+
|
|
59
|
+
filterTreeNode={(inputValue, treeNode) => {
|
|
60
|
+
const {title} = treeNode
|
|
61
|
+
return StringUtils.contains(title, inputValue)
|
|
62
|
+
}}
|
|
63
|
+
treeLine={{showLeafIcon: true}}
|
|
64
|
+
treeDefaultExpandAll={this.props.treeDefaultExpandAll}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织机构树
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import {FieldRemoteTree} from "./FieldRemoteTree";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class FieldSysOrgTree extends React.Component {
|
|
9
|
+
static defaultProps = {
|
|
10
|
+
type: 'dept',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
let {type,...rest} = this.props;
|
|
16
|
+
const url = type === 'dept'?
|
|
17
|
+
'/admin/sysOrg/deptTree':
|
|
18
|
+
'/admin/sysOrg/unitTree'
|
|
19
|
+
return <FieldRemoteTree url={url} {...rest} />
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd/es/select';
|
|
3
|
+
|
|
4
|
+
export interface FieldSysOrgTreeSelectProps {
|
|
5
|
+
|
|
6
|
+
type?: 'dept' | 'unit'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class FieldSysOrgTreeSelect extends React.Component<FieldSysOrgTreeSelectProps, any> {}
|
|
12
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织机构树
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import {FieldRemoteTreeSelect} from "./FieldRemoteTreeSelect";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class FieldSysOrgTreeSelect extends React.Component {
|
|
9
|
+
|
|
10
|
+
static defaultProps = {
|
|
11
|
+
type: 'dept',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
let {type,...rest} = this.props;
|
|
16
|
+
const url = type === 'dept'?
|
|
17
|
+
'/admin/sysOrg/deptTree':
|
|
18
|
+
'/admin/sysOrg/unitTree'
|
|
19
|
+
|
|
20
|
+
return <FieldRemoteTreeSelect url={url} {...rest}/>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {ColumnsType} from "antd/es/table";
|
|
3
3
|
|
|
4
|
-
declare type
|
|
4
|
+
declare type FieldTableProps = {
|
|
5
5
|
columns: ColumnsType,
|
|
6
6
|
value?: any[]
|
|
7
7
|
onChange?: (list:any[])=>{}
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/***
|
|
11
|
+
* 可编辑表格
|
|
12
|
+
*/
|
|
13
|
+
export class FieldTable extends React.Component<FieldTableProps, any> {
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
}
|
package/src/framework/{components/field/FieldEditTable/index.jsx → field-components/FieldTable.jsx}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Button, Input, Table} from 'antd'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import {DeleteOutlined, PlusOutlined} from "@ant-design/icons";
|
|
4
|
-
import './
|
|
5
|
-
import {
|
|
4
|
+
import './FieldTable.less'
|
|
5
|
+
import {ArrUtils} from "../utils";
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class FieldTable extends React.Component {
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
columns = []
|
|
@@ -15,15 +15,22 @@ export class FieldEditTable extends React.Component {
|
|
|
15
15
|
|
|
16
16
|
this.columns = this.props.columns.map(col => {
|
|
17
17
|
if (col.render == null) {
|
|
18
|
-
col.render = (v, record,index) => {
|
|
19
|
-
return
|
|
18
|
+
col.render = (v, record, index) => {
|
|
19
|
+
return <Input value={v} onChange={(e) => this.onCellChange(index, col.dataIndex, e)}/>
|
|
20
20
|
}
|
|
21
|
-
}else {
|
|
22
|
-
if(!col._oldRender){
|
|
21
|
+
} else {
|
|
22
|
+
if (!col._oldRender) {
|
|
23
23
|
col._oldRender = col.render
|
|
24
|
-
col.render = (v, record,index) => {
|
|
25
|
-
const cmp =col._oldRender()
|
|
26
|
-
return React.createElement(cmp.type,
|
|
24
|
+
col.render = (v, record, index) => {
|
|
25
|
+
const cmp = col._oldRender(v, record, index)
|
|
26
|
+
return React.createElement(cmp.type,
|
|
27
|
+
{
|
|
28
|
+
...cmp.props,
|
|
29
|
+
value: v,
|
|
30
|
+
onChange: (e) => {
|
|
31
|
+
this.onCellChange(index, col.dataIndex, e);
|
|
32
|
+
}
|
|
33
|
+
})
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
}
|
|
@@ -31,9 +38,9 @@ export class FieldEditTable extends React.Component {
|
|
|
31
38
|
})
|
|
32
39
|
|
|
33
40
|
this.columns.push({
|
|
34
|
-
title: '
|
|
35
|
-
render:(v, record) =>{
|
|
36
|
-
return <Button icon={<DeleteOutlined/>} size='small' shape={'circle'}
|
|
41
|
+
title: '操作',
|
|
42
|
+
render: (v, record) => {
|
|
43
|
+
return <Button icon={<DeleteOutlined/>} title='删除' size='small' shape={'circle'}
|
|
37
44
|
onClick={() => this.remove(record)}></Button>
|
|
38
45
|
}
|
|
39
46
|
})
|
|
@@ -49,12 +56,12 @@ export class FieldEditTable extends React.Component {
|
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
|
|
52
|
-
onCellChange=(index,dataIndex,e)=>{
|
|
59
|
+
onCellChange = (index, dataIndex, e) => {
|
|
53
60
|
let {dataSource} = this.state
|
|
54
|
-
let row =dataSource[index]
|
|
61
|
+
let row = dataSource[index]
|
|
55
62
|
|
|
56
63
|
let v = e;
|
|
57
|
-
if(e.hasOwnProperty('target')){
|
|
64
|
+
if (e != null &&e.hasOwnProperty('target')) {
|
|
58
65
|
v = e.target.value;
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -62,21 +69,21 @@ export class FieldEditTable extends React.Component {
|
|
|
62
69
|
row[dataIndex] = v
|
|
63
70
|
|
|
64
71
|
dataSource = [...dataSource]
|
|
65
|
-
this.setState({dataSource},this.notifyParent)
|
|
72
|
+
this.setState({dataSource}, this.notifyParent)
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
add = () => {
|
|
69
76
|
let {dataSource} = this.state
|
|
70
77
|
dataSource = [...dataSource, {}];
|
|
71
|
-
this.setState({dataSource},this.notifyParent)
|
|
78
|
+
this.setState({dataSource}, this.notifyParent)
|
|
72
79
|
};
|
|
73
80
|
remove = (record) => {
|
|
74
81
|
let {dataSource} = this.state
|
|
75
|
-
|
|
76
|
-
this.setState({dataSource:[...dataSource]},this.notifyParent)
|
|
82
|
+
ArrUtils.remove(dataSource, record)
|
|
83
|
+
this.setState({dataSource: [...dataSource]}, this.notifyParent)
|
|
77
84
|
};
|
|
78
85
|
|
|
79
|
-
notifyParent(){
|
|
86
|
+
notifyParent() {
|
|
80
87
|
let {dataSource} = this.state
|
|
81
88
|
this.props.onChange(dataSource)
|
|
82
89
|
}
|
|
@@ -88,6 +95,7 @@ export class FieldEditTable extends React.Component {
|
|
|
88
95
|
dataSource={this.state.dataSource}
|
|
89
96
|
size='small'
|
|
90
97
|
|
|
98
|
+
|
|
91
99
|
footer={() => <Button type='dashed' icon={<PlusOutlined/>}
|
|
92
100
|
onClick={this.add}>增加一行
|
|
93
101
|
</Button>}
|
|
@@ -2,22 +2,12 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
declare type FieldTableSelectProps = {
|
|
5
|
-
/**
|
|
6
|
-
* 远程方法连接, 返回的data数据为 io.tmgg.lang.obj.Table
|
|
7
|
-
*/
|
|
8
5
|
url:string;
|
|
9
|
-
|
|
10
|
-
type: 'checkbox' | 'radio';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 显示的字段
|
|
16
|
-
*/
|
|
17
|
-
labelKey: string;
|
|
18
|
-
|
|
19
6
|
placeholder?:string;
|
|
20
|
-
|
|
7
|
+
columns: {
|
|
8
|
+
title: string;
|
|
9
|
+
dataIndex: string;
|
|
10
|
+
}[];
|
|
21
11
|
};
|
|
22
12
|
|
|
23
13
|
/**
|