@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,85 +0,0 @@
|
|
|
1
|
-
import {Button, Form, Input} from 'antd'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import {DeleteOutlined, PlusOutlined} from "@ant-design/icons";
|
|
4
|
-
import './index.less'
|
|
5
|
-
|
|
6
|
-
export class EditTable extends React.Component {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
columns = []
|
|
10
|
-
|
|
11
|
-
formRef = React.createRef()
|
|
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) => {
|
|
19
|
-
return <Form.Item name={col.dataIndex}> <Input value={v}/></Form.Item>
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return col
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
30
|
-
if(prevProps.dataSource !== this.props.dataSource){
|
|
31
|
-
this.formRef.current.setFieldsValue({items: this.props.dataSource})
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
onFinish = values => {
|
|
36
|
-
this.props.onFinish(values.items)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
render() {
|
|
41
|
-
return <div className='edit-table'>
|
|
42
|
-
|
|
43
|
-
<Form ref={this.formRef} onFinish={this.onFinish}>
|
|
44
|
-
<Form.List name={'items'}>
|
|
45
|
-
{(fields, {add, remove}) => <>
|
|
46
|
-
<table >
|
|
47
|
-
<thead>
|
|
48
|
-
<tr>
|
|
49
|
-
{this.columns.map(col => <th>{col.title}</th>)}
|
|
50
|
-
<th></th>
|
|
51
|
-
</tr>
|
|
52
|
-
</thead>
|
|
53
|
-
<tbody>
|
|
54
|
-
{fields.map((field) => <tr
|
|
55
|
-
key={field.key}>
|
|
56
|
-
{this.columns.map(col => <td className="ant-table-cell" key={col.dataIndex}>
|
|
57
|
-
<Form.Item noStyle rules={[{required: true}]} name={[field.name, col.dataIndex]}>
|
|
58
|
-
<Input/>
|
|
59
|
-
</Form.Item>
|
|
60
|
-
</td>)}
|
|
61
|
-
|
|
62
|
-
<td>
|
|
63
|
-
<Button icon={<DeleteOutlined/>} size='small' shape={'circle'}
|
|
64
|
-
onClick={() => remove(field.name)}></Button>
|
|
65
|
-
</td>
|
|
66
|
-
</tr>
|
|
67
|
-
)}
|
|
68
|
-
</tbody>
|
|
69
|
-
</table>
|
|
70
|
-
<div className='add-btn-wrapper'>
|
|
71
|
-
<Button type='dashed' icon={<PlusOutlined/>}
|
|
72
|
-
onClick={() => add()}>增加一行
|
|
73
|
-
</Button>
|
|
74
|
-
</div>
|
|
75
|
-
</>}
|
|
76
|
-
</Form.List>
|
|
77
|
-
<div style={{textAlign: 'center', margin: 16}}>
|
|
78
|
-
<Button type='primary' htmlType={'submit'}>保存</Button>
|
|
79
|
-
</div>
|
|
80
|
-
</Form>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {Tree} from "antd";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default class extends React.Component{
|
|
6
|
-
|
|
7
|
-
render() {
|
|
8
|
-
return <Tree
|
|
9
|
-
multiple
|
|
10
|
-
checkable
|
|
11
|
-
onCheck={this.onCheck}
|
|
12
|
-
checkedKeys={checked}
|
|
13
|
-
treeData={treeData}
|
|
14
|
-
defaultExpandAll
|
|
15
|
-
checkStrictly
|
|
16
|
-
|
|
17
|
-
>
|
|
18
|
-
</Tree>
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {PermUtil} from "../system";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 使用该组件,可以判断权限
|
|
6
|
-
* @param
|
|
7
|
-
*/
|
|
8
|
-
export class HasPerm extends React.Component {
|
|
9
|
-
|
|
10
|
-
render() {
|
|
11
|
-
let {code} = this.props;
|
|
12
|
-
|
|
13
|
-
if (PermUtil.hasPermission(code)) {
|
|
14
|
-
return this.props.children;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Modal} from 'antd';
|
|
3
|
-
import {SysUtil} from "../system";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 可以使用 fileId 或 url 属性
|
|
8
|
-
*
|
|
9
|
-
* // 推荐使用 , 支持id, url, 并支持逗号分隔符
|
|
10
|
-
* value?: string | string[];
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export class ImageView extends React.Component {
|
|
15
|
-
preview = (url) => {
|
|
16
|
-
Modal.info({
|
|
17
|
-
title: '预览图片',
|
|
18
|
-
width: '70vw',
|
|
19
|
-
content: <img src={url} width="100%" />,
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
let vs = this.props.id
|
|
25
|
-
|
|
26
|
-
if (!vs) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (typeof vs === 'string') {
|
|
31
|
-
vs = vs.split(',');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let urlList = [];
|
|
35
|
-
for (let v of vs) {
|
|
36
|
-
let isId = v.indexOf('/') === -1;
|
|
37
|
-
let isAbsUrl = v.startsWith('http');
|
|
38
|
-
if (isAbsUrl) {
|
|
39
|
-
urlList.push(v);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (isId) {
|
|
44
|
-
urlList.push(SysUtil.getServerUrl() + 'sysFile/preview/' + v);
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
urlList.push(SysUtil.getServerUrl() + v);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const imgs = urlList.map((url) => (
|
|
52
|
-
<img
|
|
53
|
-
style={{ display: 'inline-block' }}
|
|
54
|
-
key={url}
|
|
55
|
-
src={url}
|
|
56
|
-
onClick={() => this.preview(url)}
|
|
57
|
-
width={60}
|
|
58
|
-
height={60}
|
|
59
|
-
/>
|
|
60
|
-
));
|
|
61
|
-
|
|
62
|
-
return imgs;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {Input, message, Modal, Typography} from "antd";
|
|
3
|
-
|
|
4
|
-
export class MsgBox {
|
|
5
|
-
|
|
6
|
-
static _ref = React.createRef();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
static toast(msg, success=true){
|
|
10
|
-
if(success){
|
|
11
|
-
message.success(msg)
|
|
12
|
-
}else {
|
|
13
|
-
message.error(msg)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static alert(msg, title = '提示') {
|
|
19
|
-
let instance = this._ref.current;
|
|
20
|
-
if (instance) {
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
instance.show('alert', msg, title, resolve);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return Promise.resolve(false);
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static confirm(msg, title = '确认') {
|
|
30
|
-
console.log('confirm', this._ref.current)
|
|
31
|
-
let instance = this._ref.current;
|
|
32
|
-
if (instance) {
|
|
33
|
-
return new Promise((resolve) => {
|
|
34
|
-
instance.show('confirm', msg, title, resolve);
|
|
35
|
-
});
|
|
36
|
-
}else {
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return Promise.resolve(false);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static prompt(msg, defaultValue = '', title = '输入') {
|
|
43
|
-
let instance = this._ref.current;
|
|
44
|
-
if (instance) {
|
|
45
|
-
return new Promise((resolve) => {
|
|
46
|
-
instance.show('prompt', msg, title, resolve);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return Promise.resolve(null);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export class MsgBoxComponent extends React.Component {
|
|
54
|
-
|
|
55
|
-
state = {
|
|
56
|
-
open: false,
|
|
57
|
-
title: '提示',
|
|
58
|
-
type: 'alert',
|
|
59
|
-
msg: null,
|
|
60
|
-
inputValue: '',
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
resolvePromise = null; //
|
|
64
|
-
|
|
65
|
-
componentDidMount() {
|
|
66
|
-
MsgBox._ref.current = this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
componentWillUnmount() {
|
|
70
|
-
if (MsgBox._ref.current === this) {
|
|
71
|
-
MsgBox._ref.current = null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
show = (type, msg, title, resolvePromise) => {
|
|
76
|
-
this.setState({
|
|
77
|
-
open: true,
|
|
78
|
-
type: type,
|
|
79
|
-
msg: msg,
|
|
80
|
-
title: title,
|
|
81
|
-
inputValue: type === 'prompt' ? (this.state.inputValue || '') : '',
|
|
82
|
-
});
|
|
83
|
-
this.resolvePromise = resolvePromise
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
handleOk = () => {
|
|
87
|
-
const {type, inputValue} = this.state;
|
|
88
|
-
const resolvePromise = this.resolvePromise
|
|
89
|
-
|
|
90
|
-
this.setState({open: false});
|
|
91
|
-
|
|
92
|
-
if (resolvePromise) {
|
|
93
|
-
switch (type) {
|
|
94
|
-
case 'confirm':
|
|
95
|
-
resolvePromise(true);
|
|
96
|
-
break;
|
|
97
|
-
case 'prompt':
|
|
98
|
-
resolvePromise(inputValue);
|
|
99
|
-
break;
|
|
100
|
-
default:
|
|
101
|
-
resolvePromise(null);
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
handleCancel = () => {
|
|
108
|
-
const {type, resolvePromise} = this.state;
|
|
109
|
-
|
|
110
|
-
this.setState({open: false});
|
|
111
|
-
|
|
112
|
-
if (resolvePromise) {
|
|
113
|
-
switch (type) {
|
|
114
|
-
case 'confirm':
|
|
115
|
-
resolvePromise(false);
|
|
116
|
-
break;
|
|
117
|
-
case 'prompt':
|
|
118
|
-
resolvePromise(null);
|
|
119
|
-
break;
|
|
120
|
-
default:
|
|
121
|
-
resolvePromise(null);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
handleInputChange = (e) => {
|
|
128
|
-
this.setState({inputValue: e.target.value});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
renderContent = () => {
|
|
132
|
-
const {type, msg, inputValue} = this.state;
|
|
133
|
-
|
|
134
|
-
switch (type) {
|
|
135
|
-
case 'alert':
|
|
136
|
-
case 'confirm':
|
|
137
|
-
return <Typography.Text>{msg}</Typography.Text>;
|
|
138
|
-
case 'prompt':
|
|
139
|
-
return (
|
|
140
|
-
<>
|
|
141
|
-
<Typography.Text>{msg}</Typography.Text>
|
|
142
|
-
<Input
|
|
143
|
-
value={inputValue}
|
|
144
|
-
onChange={this.handleInputChange}
|
|
145
|
-
placeholder="请输入内容"
|
|
146
|
-
/>
|
|
147
|
-
</>
|
|
148
|
-
);
|
|
149
|
-
default:
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
render() {
|
|
154
|
-
const {type} = this.state;
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<Modal
|
|
158
|
-
open={this.state.open}
|
|
159
|
-
title={this.state.title}
|
|
160
|
-
destroyOnHidden={true}
|
|
161
|
-
maskClosable={false}
|
|
162
|
-
onOk={this.handleOk}
|
|
163
|
-
onCancel={this.handleCancel}
|
|
164
|
-
okText='确定'
|
|
165
|
-
cancelText='取消'
|
|
166
|
-
width={400}
|
|
167
|
-
transitionName=""
|
|
168
|
-
maskTransitionName=""
|
|
169
|
-
footer={(node, {OkBtn, CancelBtn}) => {
|
|
170
|
-
if (type === 'alert') {
|
|
171
|
-
return <OkBtn/> // 不要取消按钮
|
|
172
|
-
}
|
|
173
|
-
return node;
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
{this.renderContent()}
|
|
177
|
-
</Modal>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {Alert, Spin} from "antd";
|
|
3
|
-
import {theme} from "../system";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 页面加载中的动画
|
|
7
|
-
*/
|
|
8
|
-
export class PageLoading extends React.Component {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
render() {
|
|
12
|
-
const msg = this.props.message || '页面加载中...';
|
|
13
|
-
|
|
14
|
-
return <div style={{height: '100vh', width: '100%',
|
|
15
|
-
display:'flex', alignItems:'center', justifyContent:"center",
|
|
16
|
-
color:theme["primary-color"]
|
|
17
|
-
}}>
|
|
18
|
-
<div style={{textAlign:"center", marginTop:'-10rem'}}>
|
|
19
|
-
<div>
|
|
20
|
-
<Spin size={"large"}></Spin>
|
|
21
|
-
</div>
|
|
22
|
-
<div style={{marginTop:'1rem'}}>
|
|
23
|
-
<Alert message={msg}></Alert>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import './index.less'
|
|
3
|
-
import {Card, Empty, Spin} from "antd";
|
|
4
|
-
|
|
5
|
-
export class Panel extends React.Component{
|
|
6
|
-
|
|
7
|
-
render() {
|
|
8
|
-
return <Card title={this.props.title} size='small'>
|
|
9
|
-
{this.renderContent()}
|
|
10
|
-
</Card>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
renderContent(){
|
|
14
|
-
if(this.props.loading){
|
|
15
|
-
return <Spin />
|
|
16
|
-
}
|
|
17
|
-
if(this.props.empty){
|
|
18
|
-
return <Empty />
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return this.props.children || <Empty />
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|
|
File without changes
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据时间类型自动渲染时间选择组件
|
|
3
|
-
*/
|
|
4
|
-
import React from "react";
|
|
5
|
-
import {FieldMonthPickerString, FieldYearPickerString, FieldYearQuarterString} from "../time";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type TypeEum = 'YEAR' | 'YEAR_MONTH' | 'YEAR_QUARTER';
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
type: TypeEum; // 枚举
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class FieldAutoTime extends React.Component<Props, any> {
|
|
15
|
-
|
|
16
|
-
render() {
|
|
17
|
-
let {type,...props} = this.props;
|
|
18
|
-
switch (type) {
|
|
19
|
-
case 'YEAR':
|
|
20
|
-
return <FieldYearPickerString {...props}/>;
|
|
21
|
-
case 'YEAR_MONTH':
|
|
22
|
-
return <FieldMonthPickerString {...props}/>;
|
|
23
|
-
case 'YEAR_QUARTER':
|
|
24
|
-
return <FieldYearQuarterString {...props}/>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return <div>未知组件 {type}</div>
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static getDefaultValue(type:TypeEum) {
|
|
31
|
-
let year = dayjs().format("YYYY");
|
|
32
|
-
let month = dayjs().format("YYYY-MM");
|
|
33
|
-
let quarter = dayjs().format("YYYY-QQ");
|
|
34
|
-
|
|
35
|
-
switch (type) {
|
|
36
|
-
case 'YEAR':
|
|
37
|
-
return year;
|
|
38
|
-
case 'YEAR_MONTH':
|
|
39
|
-
return month;
|
|
40
|
-
case 'YEAR_QUARTER':
|
|
41
|
-
return quarter;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|