@jiangood/springboot-admin-starter 0.0.3 → 0.0.5
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/field-components/FieldTable.d.ts +17 -0
- package/src/framework/field-components/FieldTable.jsx +108 -0
- 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 +5 -0
- package/src/framework/pages/LoginPage.d.ts +11 -0
- package/src/framework/pages/LoginPage.jsx +136 -0
- package/src/{pages/login.less → framework/pages/LoginPage.less} +1 -1
- package/src/framework/pages/index.ts +1 -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 +4 -129
- 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.d.ts +0 -13
- package/src/framework/components/field/FieldEditTable/index.jsx +0 -103
- 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
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import {Button, Select, Spin} from 'antd';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {HttpUtil} from "../../../../system";
|
|
5
|
-
import {ReloadOutlined} from "@ant-design/icons";
|
|
6
|
-
import {ObjUtil} from "../../../../utils";
|
|
7
|
-
|
|
8
|
-
export class FieldSelect extends React.Component {
|
|
9
|
-
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
|
|
13
|
-
ObjUtil.copyPropertyIfPresent(props, this.state)
|
|
14
|
-
this.state.componentValue = this.convertInputToComponentValue(this.state.value)
|
|
15
|
-
|
|
16
|
-
if (this.state.multiple) {
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
state = {
|
|
21
|
-
// 参数
|
|
22
|
-
url: '',
|
|
23
|
-
data: [],
|
|
24
|
-
value: null,
|
|
25
|
-
loading: false,
|
|
26
|
-
searchText: '',
|
|
27
|
-
showRefresh: false,
|
|
28
|
-
placeholder: '请选择',
|
|
29
|
-
|
|
30
|
-
multiple: false,
|
|
31
|
-
valueType: 'primitive',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// 内部状态
|
|
35
|
-
componentValue: null
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
componentDidMount() {
|
|
40
|
-
this.loadData({});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
44
|
-
let {value} = this.props;
|
|
45
|
-
// 表单主动设置value的情况
|
|
46
|
-
if (value !== prevProps.value && this.state.value !== value) {
|
|
47
|
-
const v = this.convertInputToComponentValue(value);
|
|
48
|
-
this.setState({componentValue: v, value: v}, () => this.loadData({}))
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
convertInputToComponentValue = value => {
|
|
53
|
-
if (value != null) {
|
|
54
|
-
if (this.state.multiple) {
|
|
55
|
-
if (this.state.valueType === 'object') {
|
|
56
|
-
return value.map(v => v.id)
|
|
57
|
-
}
|
|
58
|
-
if (this.state.valueType === 'joined') {
|
|
59
|
-
return value.split(',')
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
if (this.state.valueType === 'object') {
|
|
63
|
-
return value.id
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return value
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
convertComponentValueToOutput = value => {
|
|
73
|
-
if (value != null) {
|
|
74
|
-
if (this.state.multiple) {
|
|
75
|
-
if (this.state.valueType === 'object') {
|
|
76
|
-
return value.map(v => {
|
|
77
|
-
return {id: v}
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
if (this.state.valueType === 'joined') {
|
|
81
|
-
return value.join(',')
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
if (this.state.valueType === 'object') {
|
|
85
|
-
return {id: value}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return value
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
handleChange = (value) => {
|
|
95
|
-
this.setState({componentValue: value, loading: false});
|
|
96
|
-
this.props.onChange?.(this.convertComponentValueToOutput(value));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
handleSearch = (searchText) => {
|
|
101
|
-
this.setState({searchText});
|
|
102
|
-
this.loadData({searchText: searchText});
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
loadData = ({searchText}) => {
|
|
106
|
-
const {value, url} = this.state;
|
|
107
|
-
|
|
108
|
-
let selected = null;
|
|
109
|
-
if (value != null) {
|
|
110
|
-
const isArray = value instanceof Array
|
|
111
|
-
if (isArray) {
|
|
112
|
-
selected = value.join(',')
|
|
113
|
-
} else {
|
|
114
|
-
selected = value
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this.setState({loading: true});
|
|
120
|
-
HttpUtil.get(url, {searchText, selected})
|
|
121
|
-
.then(data => {
|
|
122
|
-
this.setState({data});
|
|
123
|
-
this.props.onLoadDataFinish?.(data);
|
|
124
|
-
})
|
|
125
|
-
.finally(() => {
|
|
126
|
-
this.setState({loading: false});
|
|
127
|
-
})
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
render() {
|
|
132
|
-
console.log(this.props.disabled)
|
|
133
|
-
return (
|
|
134
|
-
<div style={{display: 'flex', alignItems: 'center'}}>
|
|
135
|
-
<Select
|
|
136
|
-
{...this.props}
|
|
137
|
-
allowClear
|
|
138
|
-
showSearch
|
|
139
|
-
style={{width: '100%', minWidth: 200}}
|
|
140
|
-
notFoundContent={this.state.loading ? <Spin size="small"/> : null}
|
|
141
|
-
filterOption={false}
|
|
142
|
-
onSearch={this.handleSearch}
|
|
143
|
-
onChange={this.handleChange}
|
|
144
|
-
placeholder={this.state.placeholder}
|
|
145
|
-
value={this.state.componentValue}
|
|
146
|
-
options={this.state.data}
|
|
147
|
-
mode={this.state.multiple ? 'multiple' : undefined}
|
|
148
|
-
>
|
|
149
|
-
</Select>
|
|
150
|
-
{this.state.showRefresh &&
|
|
151
|
-
<Button onClick={this.loadData} autoInsertSpace={false} icon={<ReloadOutlined/>}
|
|
152
|
-
size='small'/>}
|
|
153
|
-
</div>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {Input, Select, Table, Typography} from "antd";
|
|
3
|
-
import {SearchOutlined} from "@ant-design/icons";
|
|
4
|
-
import {HttpUtil} from "../../../../system";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 下拉表格
|
|
8
|
-
*/
|
|
9
|
-
export class FieldTableSelect extends React.Component {
|
|
10
|
-
|
|
11
|
-
state = {
|
|
12
|
-
loading: false,
|
|
13
|
-
columns: [],
|
|
14
|
-
dataSource: [],
|
|
15
|
-
|
|
16
|
-
open: false,
|
|
17
|
-
searchText: null,
|
|
18
|
-
|
|
19
|
-
value: null,
|
|
20
|
-
label: null,
|
|
21
|
-
|
|
22
|
-
// 分页参数
|
|
23
|
-
totalElements: 0,
|
|
24
|
-
current: 1,
|
|
25
|
-
pageSize: 10,
|
|
26
|
-
sorter: null
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
componentDidMount() {
|
|
32
|
-
let value = this.props.value;
|
|
33
|
-
this.state.value = value
|
|
34
|
-
// 首次加载时,将默认的那条数据也下载下来,方便显示label
|
|
35
|
-
this.initData(value);
|
|
36
|
-
|
|
37
|
-
this.loadData()
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
initData(value) {
|
|
41
|
-
if (value != null) {
|
|
42
|
-
let selected = [value];
|
|
43
|
-
HttpUtil.post(this.props.url, {selected}, {size:1})
|
|
44
|
-
.then(({ dataSource}) => {
|
|
45
|
-
const record = dataSource[0]
|
|
46
|
-
if (record) {
|
|
47
|
-
this.setState({label: record[this.props.labelKey]})
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
54
|
-
let {value} = this.props;
|
|
55
|
-
// 表单主动设置value的情况
|
|
56
|
-
if (value !== prevProps.value && this.state.value !== value) {
|
|
57
|
-
this.setState({value: value, label: null}, this.loadData)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
loadData = searchText => {
|
|
62
|
-
this.setState({loading: true})
|
|
63
|
-
|
|
64
|
-
const params = {
|
|
65
|
-
size: this.state.pageSize,
|
|
66
|
-
page: this.state.current,
|
|
67
|
-
searchText,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if(this.state.sorter){
|
|
72
|
-
const {field, order} = this.state.sorter
|
|
73
|
-
if (field) {
|
|
74
|
-
params.sort = field + "," + (order === 'ascend' ? 'asc' : 'desc')
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
HttpUtil.get(this.props.url, params).then(({columns, dataSource, totalElements}) => {
|
|
80
|
-
this.setState({columns, dataSource, totalElements: parseInt(totalElements)})
|
|
81
|
-
}).finally(() => {
|
|
82
|
-
this.setState({loading: false})
|
|
83
|
-
})
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
onSearch = searchText => {
|
|
88
|
-
this.setState({searchText})
|
|
89
|
-
this.loadData(searchText)
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
render() {
|
|
93
|
-
return <>
|
|
94
|
-
<Select popupRender={this.popupRender} loading={this.state.loading}
|
|
95
|
-
open={this.state.open}
|
|
96
|
-
onOpenChange={visible => this.setState({open: visible})}
|
|
97
|
-
style={{minWidth: 300}}
|
|
98
|
-
value={this.state.value}
|
|
99
|
-
labelRender={() => this.state.label}
|
|
100
|
-
popupMatchSelectWidth={900}
|
|
101
|
-
placeholder={this.props.placeholder || '请选择'}
|
|
102
|
-
/>
|
|
103
|
-
</>
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
popupRender = () => {
|
|
108
|
-
return <div>
|
|
109
|
-
<div style={{padding: 8, display: 'flex', justifyContent: 'end'}}>
|
|
110
|
-
<Input
|
|
111
|
-
placeholder="搜索..."
|
|
112
|
-
prefix={<SearchOutlined/>}
|
|
113
|
-
value={this.state.searchText}
|
|
114
|
-
onChange={(e) => this.onSearch(e.target.value)}
|
|
115
|
-
style={{maxWidth: 280}}
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
<Table dataSource={this.state.dataSource} loading={this.state.loading}
|
|
119
|
-
columns={this.state.columns}
|
|
120
|
-
size='small'
|
|
121
|
-
bordered
|
|
122
|
-
rowKey='id'
|
|
123
|
-
onRow={(record) => {
|
|
124
|
-
return {
|
|
125
|
-
onDoubleClick: (event) => {
|
|
126
|
-
let value = record.id;
|
|
127
|
-
let label = record[this.props.labelKey]
|
|
128
|
-
|
|
129
|
-
this.setState({label, value, open: false})
|
|
130
|
-
this.props.onChange?.(value)
|
|
131
|
-
},
|
|
132
|
-
}
|
|
133
|
-
}}
|
|
134
|
-
|
|
135
|
-
pagination={{
|
|
136
|
-
total: this.state.totalElements,
|
|
137
|
-
pageSize: this.state.pageSize,
|
|
138
|
-
current: this.state.current,
|
|
139
|
-
showTotal: (total) => `共 ${total} 条`
|
|
140
|
-
}}
|
|
141
|
-
|
|
142
|
-
onChange={(pagination, filters, sorter, extra) => {
|
|
143
|
-
this.setState({
|
|
144
|
-
current: pagination.current,
|
|
145
|
-
pageSize: pagination.pageSize,
|
|
146
|
-
sorter
|
|
147
|
-
}, this.loadData)
|
|
148
|
-
}}
|
|
149
|
-
summary={()=><Typography.Text>提示:双击选择数据</Typography.Text>}
|
|
150
|
-
|
|
151
|
-
></Table>
|
|
152
|
-
|
|
153
|
-
</div>
|
|
154
|
-
};
|
|
155
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface SwitchYNProps {
|
|
4
|
-
mode?: string | 'read';
|
|
5
|
-
value?: String;
|
|
6
|
-
onChange?: (value: String) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare class SwitchYN extends React.Component<SwitchYNProps, any> {}
|
|
10
|
-
|
|
11
|
-
declare class FieldSwitchYN extends React.Component<SwitchYNProps, any> {}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Switch} from 'antd';
|
|
3
|
-
|
|
4
|
-
export { SwitchYN as FieldSwitchYN };
|
|
5
|
-
|
|
6
|
-
export class SwitchYN extends React.Component {
|
|
7
|
-
render() {
|
|
8
|
-
let { value, mode } = this.props;
|
|
9
|
-
|
|
10
|
-
if (mode === 'read') {
|
|
11
|
-
if (value) {
|
|
12
|
-
return value === 'Y' ? '是' : '否';
|
|
13
|
-
}
|
|
14
|
-
return '';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let strValue = null;
|
|
18
|
-
if (value != null && value != '') {
|
|
19
|
-
strValue = value == 'Y';
|
|
20
|
-
} else {
|
|
21
|
-
// 设置默认值
|
|
22
|
-
strValue = 'N';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return <Switch value={strValue} {...this.props} onChange={this.onChange}></Switch>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
onChange = (b) => {
|
|
29
|
-
this.props.onChange(b ? 'Y' : 'N');
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {DatePicker} from 'antd';
|
|
3
|
-
import {valueToDate} from "./TimePickerTool";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* 值类型为字符串
|
|
8
|
-
*/
|
|
9
|
-
export { DatePickerString as FieldDatePickerString };
|
|
10
|
-
|
|
11
|
-
const FMT = 'YYYY-MM-DD';
|
|
12
|
-
|
|
13
|
-
export class DatePickerString extends React.Component {
|
|
14
|
-
static FORMAT = FMT
|
|
15
|
-
onChange = (date) => {
|
|
16
|
-
const str = date ? date.format(FMT) : null;
|
|
17
|
-
this.props.onChange(str);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
let { value, readOnly = false, mode } = this.props;
|
|
22
|
-
if (mode == 'read') {
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
value = valueToDate(value,FMT)
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<DatePicker
|
|
30
|
-
{...this.props}
|
|
31
|
-
value={value}
|
|
32
|
-
onChange={this.onChange}
|
|
33
|
-
disabled={readOnly || this.props.disabled}
|
|
34
|
-
></DatePicker>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
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 { DateTimePickerString as FieldDateTimePickerString };
|
|
13
|
-
const FMT = 'YYYY-MM-DD HH:mm:ss';
|
|
14
|
-
|
|
15
|
-
export class DateTimePickerString extends React.Component {
|
|
16
|
-
|
|
17
|
-
static FORMAT = FMT
|
|
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
|
-
showTime
|
|
35
|
-
value={value}
|
|
36
|
-
onChange={this.onChange}
|
|
37
|
-
|
|
38
|
-
disabled={readOnly || this.props.disabled}
|
|
39
|
-
></DatePicker>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {DatePicker} from "antd";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 日期区间选择, 格式为时间戳数组
|
|
7
|
-
*
|
|
8
|
-
* 时间范围使用ISO 8601 时间间隔格式
|
|
9
|
-
* 存储格式:开始时间/结束时间
|
|
10
|
-
* 2023-01-01/2023-01-01
|
|
11
|
-
*
|
|
12
|
-
* 提示:后端便捷方式 q.betweenIsoDateRange("createTime", dateRange);
|
|
13
|
-
*/
|
|
14
|
-
export class FieldDateRange extends React.Component {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
str2dayjs(v) {
|
|
18
|
-
console.log('调用转换')
|
|
19
|
-
if (v ) {
|
|
20
|
-
const arr = v.split("/")
|
|
21
|
-
|
|
22
|
-
let v1 = arr[0];
|
|
23
|
-
let v2 = arr[1];
|
|
24
|
-
return [dayjs(v1), dayjs(v2)]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
let {value, onChange} = this.props
|
|
34
|
-
|
|
35
|
-
value = this.str2dayjs(value)
|
|
36
|
-
|
|
37
|
-
return <DatePicker.RangePicker
|
|
38
|
-
value={value}
|
|
39
|
-
format={"YYYY-MM-DD"}
|
|
40
|
-
onChange={(value, dateString) => {
|
|
41
|
-
let strValue = dateString.join('/');
|
|
42
|
-
strValue = strValue === '/' ? null: strValue
|
|
43
|
-
onChange(strValue)
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
</DatePicker.RangePicker>
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {TimePicker} from 'antd';
|
|
4
|
-
import {valueToDate} from "./TimePickerTool";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 时分
|
|
8
|
-
*
|
|
9
|
-
* 值类型为字符串
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
const FMT = 'HH:mm';
|
|
14
|
-
|
|
15
|
-
export class FieldHHmmPickerString extends React.Component {
|
|
16
|
-
|
|
17
|
-
static FORMAT = FMT
|
|
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
|
-
|
|
32
|
-
return (
|
|
33
|
-
<TimePicker
|
|
34
|
-
{...this.props}
|
|
35
|
-
value={value}
|
|
36
|
-
onChange={this.onChange}
|
|
37
|
-
format={FMT}
|
|
38
|
-
disabled={readOnly || this.props.disabled}
|
|
39
|
-
></TimePicker>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
}
|