@jiangood/springboot-admin-starter 0.0.2 → 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
package/config/dist/config.js
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var umi_1 = require("umi");
|
|
4
|
+
var fs = require("fs");
|
|
5
|
+
var path = require("path");
|
|
4
6
|
//https://umijs.org/docs/api/config
|
|
5
7
|
console.log('i am config.ts');
|
|
8
|
+
console.log('__dirname', __dirname);
|
|
9
|
+
console.log('process.cwd()', process.cwd());
|
|
10
|
+
var isFramework = fs.existsSync(path.join(process.cwd(), 'config/plugins/route-plugin.ts'));
|
|
11
|
+
console.log('isFramework', isFramework);
|
|
12
|
+
var pluginDir = isFramework ? './config/plugins' : '@jiangood/springboot-admin-starter/config/dist/plugins';
|
|
13
|
+
console.log('pluginDir', pluginDir);
|
|
6
14
|
exports.default = (0, umi_1.defineConfig)({
|
|
7
15
|
// 配置是否让生成的文件包含 hash 后缀,通常用于增量发布和避免浏览器加载缓存。
|
|
8
16
|
hash: true,
|
|
9
17
|
history: { type: 'hash' },
|
|
10
18
|
// 复杂,还得设置忽略、编译等,先关掉
|
|
11
19
|
mfsu: false,
|
|
20
|
+
plugins: [
|
|
21
|
+
pluginDir + '/form-plugin',
|
|
22
|
+
pluginDir + '/route-plugin',
|
|
23
|
+
],
|
|
24
|
+
proxy: {
|
|
25
|
+
'/admin': {
|
|
26
|
+
target: 'http://127.0.0.1:8002',
|
|
27
|
+
changeOrigin: true,
|
|
28
|
+
},
|
|
29
|
+
'/preview': {
|
|
30
|
+
target: 'http://127.0.0.1:8002',
|
|
31
|
+
changeOrigin: true,
|
|
32
|
+
},
|
|
33
|
+
'/ureport': {
|
|
34
|
+
target: 'http://127.0.0.1:8002',
|
|
35
|
+
changeOrigin: true,
|
|
36
|
+
pathRewrite: { '^/ureport': '/ureport' },
|
|
37
|
+
},
|
|
38
|
+
'/ws-log-view': {
|
|
39
|
+
target: 'http://127.0.0.1:8002',
|
|
40
|
+
changeOrigin: true,
|
|
41
|
+
ws: true,
|
|
42
|
+
},
|
|
43
|
+
}
|
|
12
44
|
});
|
package/config/dist/index.js
CHANGED
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./config"), exports);
|
|
18
|
-
__exportStar(require("./config.local"), exports);
|
|
19
18
|
__exportStar(require("./plugins/route-plugin"), exports);
|
|
20
19
|
__exportStar(require("./plugins/form-plugin"), exports);
|
|
@@ -20,7 +20,7 @@ exports.default = (function (api) {
|
|
|
20
20
|
api.logger.info('formRegistryPath', formRegistryPath);
|
|
21
21
|
api.addEntryImports(function () { return ({
|
|
22
22
|
source: formRegistryPath,
|
|
23
|
-
specifier: '{
|
|
23
|
+
specifier: '{FormRegistryUtils}'
|
|
24
24
|
}); });
|
|
25
25
|
parseDir(api, path.join(api.paths.absSrcPath, 'forms'));
|
|
26
26
|
if (!isFramework) {
|
|
@@ -45,7 +45,7 @@ function parseDir(api, dir) {
|
|
|
45
45
|
specifier: name
|
|
46
46
|
}); });
|
|
47
47
|
// register form
|
|
48
|
-
api.addEntryCodeAhead(function () { return "
|
|
48
|
+
api.addEntryCodeAhead(function () { return "FormRegistryUtils.register(\"".concat(name, "\",").concat(name, " );"); });
|
|
49
49
|
api.logger.info('formRegistry.register: ', name, source);
|
|
50
50
|
});
|
|
51
51
|
}
|
package/package.json
CHANGED
|
@@ -8,23 +8,21 @@
|
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@ant-design/icons": "^5.4.0",
|
|
11
|
-
"@
|
|
11
|
+
"@bpmn-io/properties-panel": "^3.34.0",
|
|
12
12
|
"@tinymce/tinymce-react": "^6.0.0",
|
|
13
13
|
"@umijs/types": "^3.5.43",
|
|
14
|
-
"antd": "^
|
|
14
|
+
"antd": "^6.0.0",
|
|
15
15
|
"antd-img-crop": "^4.23.0",
|
|
16
|
+
"axios": "^1.13.2",
|
|
16
17
|
"bpmn-js": "^18.7.0",
|
|
17
|
-
"
|
|
18
|
+
"bpmn-js-properties-panel": "^5.43.0",
|
|
18
19
|
"dayjs": "^1.11.13",
|
|
19
|
-
"echarts": "^5.6.0",
|
|
20
20
|
"jsencrypt": "^3.5.4",
|
|
21
|
+
"lodash": "^4.17.21",
|
|
21
22
|
"qs": "^6.14.0",
|
|
22
23
|
"react": "^19.0.0",
|
|
23
|
-
"react-amap": "^1.2.8",
|
|
24
24
|
"react-dom": "^19.0.0",
|
|
25
|
-
"
|
|
26
|
-
"umi": "^4.0.0",
|
|
27
|
-
"axios": "^1.13.2"
|
|
25
|
+
"umi": "^4.0.0"
|
|
28
26
|
},
|
|
29
27
|
"name": "@jiangood/springboot-admin-starter",
|
|
30
28
|
"description": "springboot-admin-starter",
|
|
@@ -32,8 +30,12 @@
|
|
|
32
30
|
"src/*",
|
|
33
31
|
"config/dist/*"
|
|
34
32
|
],
|
|
35
|
-
"main": "src/index.
|
|
36
|
-
"version": "0.0.
|
|
33
|
+
"main": "src/index.ts",
|
|
34
|
+
"version": "0.0.4",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"preact": "^10.27.2",
|
|
37
|
+
"preact-hooks": "0.0.0-0.0.0"
|
|
38
|
+
},
|
|
37
39
|
"scripts": {
|
|
38
40
|
"dev": "umi dev",
|
|
39
41
|
"build": "tsc --outDir config/dist --skipLibCheck --noEmitOnError false config/index.ts"
|
package/src/forms/demoForm.jsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {Form, Input} from "antd";
|
|
1
|
+
import {Form, Input, InputNumber} from "antd";
|
|
2
2
|
|
|
3
3
|
export default function (){
|
|
4
4
|
|
|
5
5
|
return <div>
|
|
6
6
|
demo表单示例
|
|
7
7
|
<Form>
|
|
8
|
-
<Form.Item label="
|
|
8
|
+
<Form.Item label="事由">
|
|
9
9
|
<Input/>
|
|
10
10
|
</Form.Item>
|
|
11
|
-
<Form.Item label="
|
|
12
|
-
<
|
|
11
|
+
<Form.Item label="请假天数" name='days'>
|
|
12
|
+
<InputNumber/>
|
|
13
13
|
</Form.Item>
|
|
14
14
|
</Form>
|
|
15
15
|
</div>
|
|
16
|
-
}
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button, Modal, Spin} from "antd";
|
|
3
|
-
import {
|
|
3
|
+
import {HttpUtils} from "../utils";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export class DownloadFileButton extends React.Component {
|
|
@@ -12,7 +12,7 @@ export class DownloadFileButton extends React.Component {
|
|
|
12
12
|
onClick(){
|
|
13
13
|
const {url, params, children, ...rest} = this.props;
|
|
14
14
|
this.setState({open:true})
|
|
15
|
-
|
|
15
|
+
HttpUtils.downloadFile(url,params).then(rs=>{
|
|
16
16
|
|
|
17
17
|
}).finally(()=>{
|
|
18
18
|
this.setState({open:false})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Modal} from 'antd';
|
|
3
3
|
import './Ellipsis.less'
|
|
4
|
-
import {
|
|
4
|
+
import {StringUtils} from "../utils";
|
|
5
5
|
|
|
6
6
|
export class Ellipsis extends React.Component {
|
|
7
7
|
static defaultProps = {length: 15}
|
|
@@ -17,7 +17,7 @@ export class Ellipsis extends React.Component {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
const shortText =
|
|
20
|
+
const shortText = StringUtils.ellipsis(text, length)
|
|
21
21
|
return (
|
|
22
22
|
<span className='ellipsis-text' onClick={this.showFull}>{shortText}</span>
|
|
23
23
|
);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export interface LinkButtonProps {
|
|
5
5
|
/**
|
|
6
6
|
* 路径
|
|
7
7
|
*/
|
|
8
|
-
path: string
|
|
9
|
-
label: string
|
|
10
|
-
type?:'primary'|'default'|'dashed'|'link'|'text'|'ghost'
|
|
8
|
+
path: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type?: 'primary' | 'default' | 'dashed' | 'link' | 'text' | 'ghost'
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export class LinkButton extends React.Component<LinkButtonProps, any> {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button} from "antd";
|
|
3
|
-
import {
|
|
3
|
+
import {PageUtils} from "../utils";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
PageUtil.open(path,label)
|
|
11
|
-
}}>{children}</Button>
|
|
12
|
-
}
|
|
5
|
+
export function LinkButton(props) {
|
|
6
|
+
const {path, label, children, size = 'small', ...rest} = props;
|
|
7
|
+
return <Button size={size} {...rest} onClick={() => {
|
|
8
|
+
PageUtils.open(path, label)
|
|
9
|
+
}}>{children}</Button>
|
|
13
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import './index.less'
|
|
3
|
-
import {
|
|
3
|
+
import {ThemeUtils} from "../../utils";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 上下间隔
|
|
@@ -18,7 +18,7 @@ export class Page extends React.Component {
|
|
|
18
18
|
style.padding = 16
|
|
19
19
|
}
|
|
20
20
|
if(this.props.backgroundGray){
|
|
21
|
-
style.backgroundColor =
|
|
21
|
+
style.backgroundColor = ThemeUtils.getColor("background-color")
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Alert, Spin} from "antd";
|
|
3
|
+
import {ThemeUtils} from "../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 页面加载中的动画
|
|
7
|
+
*/
|
|
8
|
+
export function PageLoading(props: { message?: string }) {
|
|
9
|
+
const msg = props.message || '页面加载中...';
|
|
10
|
+
|
|
11
|
+
return <div style={{
|
|
12
|
+
height: '100vh', width: '100%',
|
|
13
|
+
display: 'flex', alignItems: 'center', justifyContent: "center",
|
|
14
|
+
color: ThemeUtils.getColor("primary-color")
|
|
15
|
+
}}>
|
|
16
|
+
<div style={{textAlign: "center", marginTop: '-10rem'}}>
|
|
17
|
+
<div>
|
|
18
|
+
<Spin size={"large"}></Spin>
|
|
19
|
+
</div>
|
|
20
|
+
<div style={{marginTop: '1rem'}}>
|
|
21
|
+
<Alert title={msg}></Alert>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
@@ -5,8 +5,7 @@ import {HistoryOutlined, ReloadOutlined} from '@ant-design/icons';
|
|
|
5
5
|
import {Button, Input, message, Modal, Table} from 'antd';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import './index.less';
|
|
8
|
-
import {
|
|
9
|
-
import {DateUtil, StorageUtil} from "../../../../utils";
|
|
8
|
+
import {DateUtils, PageUtils, StorageUtils} from "../../../../utils";
|
|
10
9
|
|
|
11
10
|
export default class Toolbar extends React.Component {
|
|
12
11
|
|
|
@@ -47,7 +46,7 @@ export default class Toolbar extends React.Component {
|
|
|
47
46
|
|
|
48
47
|
renderHistory() {
|
|
49
48
|
const {params} = this.props
|
|
50
|
-
const list =
|
|
49
|
+
const list = StorageUtils.get(this.getParamKey()) || []
|
|
51
50
|
|
|
52
51
|
const dataSource = [{params, time: '当前'}, ...list]
|
|
53
52
|
|
|
@@ -94,7 +93,7 @@ export default class Toolbar extends React.Component {
|
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
getParamKey() {
|
|
97
|
-
return 'query-params-' +
|
|
96
|
+
return 'query-params-' + PageUtils.currentPathname();
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
onSaveHistory = () => {
|
|
@@ -104,13 +103,13 @@ export default class Toolbar extends React.Component {
|
|
|
104
103
|
message.error('查询参数为空,无法保存')
|
|
105
104
|
return
|
|
106
105
|
}
|
|
107
|
-
const list =
|
|
108
|
-
let data = {time:
|
|
106
|
+
const list = StorageUtils.get(this.getParamKey()) || []
|
|
107
|
+
let data = {time: DateUtils.now(), params};
|
|
109
108
|
list.unshift(data)
|
|
110
109
|
if (list.length > 5) {
|
|
111
110
|
list.pop()
|
|
112
111
|
}
|
|
113
|
-
|
|
112
|
+
StorageUtils.set(this.getParamKey(), list)
|
|
114
113
|
message.success('保存成功')
|
|
115
114
|
this.setState({historyOpen: false})
|
|
116
115
|
}
|
|
@@ -3,7 +3,7 @@ import Toolbar from './components/ToolBar';
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import './index.less'
|
|
5
5
|
import {SearchOutlined} from "@ant-design/icons";
|
|
6
|
-
import {
|
|
6
|
+
import {StringUtils} from "../../utils";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export class ProTable extends React.Component {
|
|
@@ -42,7 +42,7 @@ export class ProTable extends React.Component {
|
|
|
42
42
|
if (props.defaultPageSize) {
|
|
43
43
|
this.state.pageSize = props.defaultPageSize
|
|
44
44
|
}
|
|
45
|
-
this.id =
|
|
45
|
+
this.id = StringUtils.random(32)
|
|
46
46
|
this.showToolbarSearch = this.props.showToolbarSearch
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -91,7 +91,8 @@ export class ProTable extends React.Component {
|
|
|
91
91
|
})
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
|
|
95
|
+
// 数据重新加载后,更新toolbar需要的已选择数据行
|
|
95
96
|
updateSelectedRows = list => {
|
|
96
97
|
const {rowKey = "id"} = this.props
|
|
97
98
|
const {selectedRows} = this.state
|
|
@@ -121,10 +122,7 @@ export class ProTable extends React.Component {
|
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
return <div className={'tmgg-pro-table '} id={this.id}>
|
|
124
|
-
|
|
125
125
|
{this.renderForm()}
|
|
126
|
-
|
|
127
|
-
|
|
128
126
|
{toolbarOptions !== false && <Toolbar
|
|
129
127
|
actionRef={actionRef}
|
|
130
128
|
toolBarRender={this.getToolBarRenderNode(toolBarRender)}
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
FieldPassword,
|
|
7
|
-
FieldRadioBoolean,
|
|
8
|
-
FieldSelect,
|
|
9
|
-
FieldUploadImage
|
|
10
|
-
} from "../field";
|
|
11
|
-
import {ViewBoolean, ViewImage, ViewPassword, ViewText} from "../view";
|
|
1
|
+
|
|
2
|
+
import {ViewImage, ViewText} from "../view";
|
|
3
|
+
import {ViewPassword,ViewBoolean} from "../../view-components";
|
|
4
|
+
import {FieldDictSelect, FieldRemoteSelect} from "../../field-components";
|
|
5
|
+
import {Input} from "antd";
|
|
12
6
|
|
|
13
7
|
|
|
14
8
|
export const fieldRegistry = {
|
|
15
|
-
'text':
|
|
9
|
+
'text':Input,
|
|
16
10
|
|
|
17
|
-
'dict':
|
|
18
|
-
'
|
|
19
|
-
'password':FieldPassword,
|
|
20
|
-
'datetime':FieldDateTimePickerString,
|
|
21
|
-
'boolean':FieldRadioBoolean,
|
|
22
|
-
imageBase64:FieldImageBase64,
|
|
23
|
-
image:FieldUploadImage,
|
|
11
|
+
'dict':FieldDictSelect,
|
|
12
|
+
'password':Input.Password,
|
|
24
13
|
|
|
25
|
-
select:
|
|
14
|
+
select: FieldRemoteSelect
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
export const viewRegistry = {
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
export * from './field'
|
|
2
1
|
export * from './ProModal'
|
|
3
2
|
export * from './Ellipsis'
|
|
4
|
-
|
|
5
|
-
export * from './HasPerm'
|
|
3
|
+
|
|
6
4
|
export * from './system'
|
|
7
|
-
export * from './ImageView';
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
export * from './PageLoading'
|
|
11
|
-
|
|
8
|
+
|
|
12
9
|
export * from './ProTable'
|
|
13
10
|
export * from './DownloadFileButton'
|
|
14
11
|
|
|
15
12
|
export * from './NamedIcon'
|
|
16
|
-
export * from './EditTable'
|
|
17
13
|
export * from './view'
|
|
18
14
|
export * from './LinkButton'
|
|
19
15
|
export * from './Gap'
|
|
20
|
-
export * from './Panel'
|
|
21
16
|
export * from './Page'
|
|
22
|
-
export * from './Echarts'
|
|
23
|
-
export * from './MsgBox'
|
|
24
17
|
export * from './ValueType'
|
|
25
|
-
export * from './RoleTree'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Space} from 'antd';
|
|
3
|
+
import {PermUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 带权限的按钮列表
|
|
8
|
+
* @param maxNum: 显示子节点的个数, 超过的为收缩起来
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export class ButtonList extends React.Component {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
let {children} = this.props;
|
|
16
|
+
const menus = [];
|
|
17
|
+
|
|
18
|
+
// 判断是否数组
|
|
19
|
+
if (Array.isArray(children)) {
|
|
20
|
+
for (let child of children) {
|
|
21
|
+
if (child === null || child === undefined) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (child.props == null || child.props.perm == null || PermUtils.hasPermission(child.props.perm)) {
|
|
25
|
+
menus.push(child);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
menus.push(children)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return <Space>{menus}</Space>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {ReactNode} from "react";
|
|
2
|
+
import {PermUtils} from "../../utils";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 使用该组件,可以判断权限
|
|
6
|
+
*/
|
|
7
|
+
export function HasPerm(props: { code: string, children: ReactNode }) {
|
|
8
|
+
let {code} = props;
|
|
9
|
+
|
|
10
|
+
if (PermUtils.hasPermission(code)) {
|
|
11
|
+
return props.children;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {FieldRemoteSelect, FieldRemoteSelectMultiple, FieldRemoteTreeSelect} from "../../field-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export * from './ButtonList'
|
|
5
|
+
export * from './HasPerm'
|
|
6
|
+
|
|
7
|
+
export function FieldUserSelect(props) {
|
|
8
|
+
return <FieldRemoteSelect url="admin/sysUser/options" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
export function FieldUserSelectMultiple(props) {
|
|
11
|
+
return <FieldRemoteSelectMultiple url="admin/sysUser/options" {...props} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function FieldUnitTreeSelect(props) {
|
|
15
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/unitTree" {...props} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function FieldDeptTreeSelect(props) {
|
|
19
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/deptTree" {...props} />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function FieldOrgTreeSelect(props) {
|
|
23
|
+
return <FieldRemoteTreeSelect url="admin/sysOrg/deptTree" {...props} />;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function FieldOrgTreeMultipleSelect(props) {
|
|
27
|
+
return <FieldRemoteSelectMultiple url="/sysOrg/deptTree" {...props} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from 'antd';
|
|
3
|
+
|
|
4
|
+
// 定义组件的 Props 接口
|
|
5
|
+
interface ViewBooleanEnableDisableProps {
|
|
6
|
+
value: boolean | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class ViewBooleanEnableDisable extends React.Component<ViewBooleanEnableDisableProps, any> {
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
const { value } = this.props;
|
|
13
|
+
|
|
14
|
+
if (value == null) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return value ? <Tag color={"green"}>启动</Tag> : <Tag color={"red"}>禁用</Tag>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Button, Modal, Popover} from 'antd';
|
|
3
|
-
import {
|
|
3
|
+
import {StringUtils} from "../../utils";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export class ViewEllipsis extends React.Component {
|
|
@@ -10,7 +10,7 @@ export class ViewEllipsis extends React.Component {
|
|
|
10
10
|
render() {
|
|
11
11
|
let {maxLength, value} = this.props;
|
|
12
12
|
|
|
13
|
-
const short =
|
|
13
|
+
const short = StringUtils.ellipsis(value, maxLength)
|
|
14
14
|
return <Popover placement="topLeft" title={'长文本'} content={<Button onClick={this.showModal}>点击查看全部内容</Button>}>
|
|
15
15
|
{short}
|
|
16
16
|
</Popover>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Carousel, Empty} from 'antd';
|
|
3
|
-
import {SysUtil} from "../../system";
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
export class ViewFile extends React.Component {
|
|
@@ -15,7 +14,7 @@ export class ViewFile extends React.Component {
|
|
|
15
14
|
|
|
16
15
|
let arr = fileId.split(',');
|
|
17
16
|
|
|
18
|
-
let urlList = arr.map(id =>
|
|
17
|
+
let urlList = arr.map(id => 'admin/sysFile/preview/' + id);
|
|
19
18
|
let height = this.props.height;
|
|
20
19
|
|
|
21
20
|
if(urlList.length === 1){
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Modal} from 'antd';
|
|
3
|
-
import {SysUtil} from "../../system";
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
export class ViewImage extends React.Component {
|
|
@@ -26,11 +25,11 @@ export class ViewImage extends React.Component {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
if (isId) {
|
|
29
|
-
urlList.push(
|
|
28
|
+
urlList.push( 'admin/sysFile/preview/' + v);
|
|
30
29
|
continue;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
urlList.push(
|
|
32
|
+
urlList.push( v);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
const imgs = urlList.map((url) => (
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Typography} from "antd";
|
|
3
|
+
|
|
4
|
+
interface ViewTextProps {
|
|
5
|
+
value: string | null | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class ViewText extends React.Component<ViewTextProps, any>{
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
if(this.props.value == null){
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return <Typography.Text> {this.props.value}</Typography.Text>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
* 统一有个值叫value
|
|
4
4
|
*/
|
|
5
5
|
export * from './ViewEllipsis'
|
|
6
|
-
export * from './ViewBoolean'
|
|
7
6
|
export * from './ViewBooleanEnableDisable'
|
|
8
7
|
export * from './ViewImage'
|
|
9
8
|
export * from './ViewRange'
|
|
10
9
|
export * from './ViewFile'
|
|
11
10
|
export * from './ViewText'
|
|
12
|
-
export * from './ViewPassword'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd/es/select';
|
|
3
|
+
|
|
4
|
+
export interface FieldBooleanProps {
|
|
5
|
+
|
|
6
|
+
type?:'select' | 'radio' | 'checkbox' | 'switch'; // 默认 select
|
|
7
|
+
value?: boolean;
|
|
8
|
+
onChange?: (value: boolean) => void;
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class FieldBoolean extends React.Component<FieldBooleanProps, any> {}
|
|
13
|
+
|