@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20temp
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/es/components/Builder/index.js +37 -27
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LDActions/index.js +1 -0
- package/es/components/LdAutoForm/index.js +18 -8
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +10 -7
- package/es/components/LdGrid/index.js +24 -16
- package/es/components/LdGridForm/index.js +16 -7
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/form.js +7 -1
- package/es/helper/ldBuilder.js +9 -5
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +61 -6
- package/es/lowcode/constants/api-url.js +359 -190
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +3 -5
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/es/lowcode/engine/meta/dialog.props.json +24 -4
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -1
- package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +3 -19
- package/es/lowcode/engine/meta/grouptree.props.json +0 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/es/lowcode/engine/meta/jsx.props.json +4 -3
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/table.props.json +0 -7
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +1 -5
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +135 -27
- package/es/lowcode/painter/DesignToolbar.js +102 -188
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Panel.js +1 -1
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +55 -51
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +76 -8
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
- package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/components.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/ErrorBoundary.js +80 -0
- package/es/lowcode/view/Page.js +11 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Box/index.less +2 -2
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/index.js +15 -19
- package/es/lowcode/view/lc-components/Form/meta.json +3 -19
- package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
- package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/es/lowcode/view/lc-components/Table/index.js +11 -3
- package/es/lowcode/view/lc-components/Table/meta.json +0 -7
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/es/lowcode/view/lc-components/Wrapper.js +9 -1
- package/es/services.js +24 -7
- package/es/upload/FilesWall/index.js +16 -6
- package/es/upload/Form/gridForm.js +16 -6
- package/es/upload/FormItem/index.js +16 -4
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +40 -6
- package/es/utils/grid.js +12 -3
- package/lib/components/Builder/index.js +36 -26
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdAutoForm/index.js +15 -5
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +9 -6
- package/lib/components/LdGrid/index.js +24 -16
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/form.js +7 -1
- package/lib/helper/ldBuilder.js +8 -5
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +61 -6
- package/lib/lowcode/constants/api-url.js +360 -190
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/lib/lowcode/engine/meta/dialog.props.json +24 -4
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
- package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +3 -19
- package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/lib/lowcode/engine/meta/jsx.props.json +4 -3
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/table.props.json +0 -7
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +1 -5
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +132 -24
- package/lib/lowcode/painter/DesignToolbar.js +98 -184
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Panel.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +76 -8
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
- package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/components.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/ErrorBoundary.js +88 -0
- package/lib/lowcode/view/Page.js +12 -7
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Box/index.less +2 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/index.js +15 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/lib/lowcode/view/lc-components/Table/index.js +11 -3
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
- package/lib/services.js +25 -7
- package/lib/upload/FilesWall/index.js +13 -3
- package/lib/upload/Form/gridForm.js +13 -3
- package/lib/upload/FormItem/index.js +15 -3
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +40 -5
- package/lib/utils/grid.js +13 -4
- package/package.json +1 -2
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
- package/es/lowcode/view/errorBoundary.js +0 -61
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
- package/lib/lowcode/view/errorBoundary.js +0 -69
|
@@ -54,7 +54,7 @@ export var ImportUploadPop = function ImportUploadPop(_ref) {
|
|
|
54
54
|
moduleCode: moduleCode,
|
|
55
55
|
behaviorKey: behaviorKey,
|
|
56
56
|
templateId: templateId,
|
|
57
|
-
reportType:
|
|
57
|
+
reportType: 'import'
|
|
58
58
|
};
|
|
59
59
|
getFindexcelstate(_fetchExcelStatePrefix, _fetchExcelStateParams).then(function (response) {
|
|
60
60
|
if (response.code === 1) {
|
|
@@ -147,7 +147,7 @@ export var ImportUploadPop = function ImportUploadPop(_ref) {
|
|
|
147
147
|
};
|
|
148
148
|
}();
|
|
149
149
|
return /*#__PURE__*/React.createElement(PopWindow, {
|
|
150
|
-
title:
|
|
150
|
+
title: '上传excel文件',
|
|
151
151
|
mode: "modal",
|
|
152
152
|
size: "mini",
|
|
153
153
|
visible: visible,
|
|
@@ -184,11 +184,14 @@ export var ImportUploadPop = function ImportUploadPop(_ref) {
|
|
|
184
184
|
accept: '.xls,.xlsx,.xlt,.xlsm',
|
|
185
185
|
name: 'fileObj',
|
|
186
186
|
beforeUpload: function beforeUpload(file) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
return new Promise(function (resolve, reject) {
|
|
188
|
+
var suffix = lowerCase(last(split(file.name, '.')));
|
|
189
|
+
if (!includes(['xls', 'xlsx', 'xlt', 'xlsm'], suffix)) {
|
|
190
|
+
reject(new Error('禁止上传的文件类型'));
|
|
191
|
+
} else {
|
|
192
|
+
resolve(true);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
})), templateUrl && /*#__PURE__*/React.createElement(DownloadLink, null, /*#__PURE__*/React.createElement("a", {
|
|
@@ -248,7 +251,7 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
248
251
|
var _fetchExcelStateParams = {
|
|
249
252
|
moduleCode: moduleCode,
|
|
250
253
|
behaviorKey: behaviorKey,
|
|
251
|
-
reportType:
|
|
254
|
+
reportType: 'export'
|
|
252
255
|
};
|
|
253
256
|
getFindexcelstate(_fetchExcelStatePrefix, _fetchExcelStateParams).then(function (response) {
|
|
254
257
|
if (response.code === 1) {
|
|
@@ -299,7 +302,7 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
299
302
|
_exportExcelParams = {
|
|
300
303
|
moduleCode: moduleCode,
|
|
301
304
|
behaviorKey: behaviorKey,
|
|
302
|
-
reportType:
|
|
305
|
+
reportType: 'export'
|
|
303
306
|
};
|
|
304
307
|
_exportExcelPrefix = "/".concat(strategy);
|
|
305
308
|
_context2.next = 10;
|
|
@@ -330,14 +333,14 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
330
333
|
labels.push(column.colDef.headerName);
|
|
331
334
|
fieldInfo.push({
|
|
332
335
|
width: column.actualWidth,
|
|
333
|
-
fieldNm: column.colId
|
|
336
|
+
fieldNm: column.colDef.exportField || column.colId
|
|
334
337
|
});
|
|
335
338
|
}
|
|
336
339
|
});
|
|
337
340
|
defaultExcelParams = {
|
|
338
|
-
bgColor:
|
|
341
|
+
bgColor: '#69b1ff',
|
|
339
342
|
dataUrl: "".concat(window.location.origin, "/api").concat(apiUrl).concat(joiner, "token=").concat(window.cookie.get(window.appConfig.authSaveKey)),
|
|
340
|
-
excelName:
|
|
343
|
+
excelName: 'download.xls',
|
|
341
344
|
fieldInfo: fieldInfo,
|
|
342
345
|
islock: false,
|
|
343
346
|
labels: labels === null || labels === void 0 ? void 0 : labels.join(),
|
|
@@ -345,7 +348,7 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
345
348
|
};
|
|
346
349
|
_exportExcelParams2 = _objectSpread({
|
|
347
350
|
moduleCode: moduleCode,
|
|
348
|
-
reportType:
|
|
351
|
+
reportType: 'export'
|
|
349
352
|
}, defaultExcelParams);
|
|
350
353
|
_exportExcelPrefix2 = "/".concat(strategy);
|
|
351
354
|
_context2.next = 23;
|
|
@@ -4,14 +4,16 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
|
-
var _excluded = ["render"];
|
|
7
|
+
var _excluded = ["render", "dateFormat"];
|
|
8
8
|
import React, { useRef, useImperativeHandle, forwardRef, useCallback } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { useMemoizedFn, useCreation, useRequest, useUnmount } from 'ahooks';
|
|
11
11
|
import { isNil, isString, keyBy } from 'lodash';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
+
import moment from 'moment';
|
|
13
14
|
import { Modal, recheck } from '@luck-design-biz/base';
|
|
14
15
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
16
|
+
import { usePageProxyContext } from "../../../engine/provider/PageProxyProvider";
|
|
15
17
|
import Wrapper from "../Wrapper";
|
|
16
18
|
import { LdGrid, LDActions } from "../../../../index";
|
|
17
19
|
import TopFilter from "./components/TopFilter";
|
|
@@ -63,6 +65,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
63
65
|
onGridReady = _ref.onGridReady,
|
|
64
66
|
advance = _ref.advance;
|
|
65
67
|
var ctx = useContext();
|
|
68
|
+
var ppCtx = usePageProxyContext();
|
|
66
69
|
var apiRef = useRef();
|
|
67
70
|
var wrapperRef = useRef();
|
|
68
71
|
var instanceRef = useCombinedRefs(ref);
|
|
@@ -275,7 +278,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
275
278
|
labels.push(column.colDef.headerName);
|
|
276
279
|
fieldInfo.push({
|
|
277
280
|
width: column.actualWidth,
|
|
278
|
-
fieldNm: column.colId
|
|
281
|
+
fieldNm: column.colDef.exportField || column.colId
|
|
279
282
|
});
|
|
280
283
|
}
|
|
281
284
|
});
|
|
@@ -386,6 +389,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
386
389
|
var colsMap = keyBy(cols, 'field');
|
|
387
390
|
var _cols = isNil(fields) ? cols : fields.map(function (_ref4) {
|
|
388
391
|
var render = _ref4.render,
|
|
392
|
+
dateFormat = _ref4.dateFormat,
|
|
389
393
|
_field = _objectWithoutProperties(_ref4, _excluded);
|
|
390
394
|
return _objectSpread(_objectSpread({}, colsMap[_field.field]), {}, {
|
|
391
395
|
render: render ? function (v, d, i, p) {
|
|
@@ -395,6 +399,8 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
395
399
|
rowIndex: i,
|
|
396
400
|
params: p
|
|
397
401
|
}, render.replace(/(function\s*\w*\s*)\([^)]*\)(\s*{)/, '$1()$2'));
|
|
402
|
+
} : dateFormat ? function (v) {
|
|
403
|
+
return moment(v).format(dateFormat);
|
|
398
404
|
} : null
|
|
399
405
|
}, _field);
|
|
400
406
|
});
|
|
@@ -567,7 +573,9 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
567
573
|
wrapperProps: _wrapperProps,
|
|
568
574
|
width: width,
|
|
569
575
|
height: height,
|
|
570
|
-
|
|
576
|
+
pageProxy: ppCtx
|
|
577
|
+
// _loading={ctx.loading}
|
|
578
|
+
,
|
|
571
579
|
bordered: bordered,
|
|
572
580
|
className: classNames(_defineProperty({}, className, !!className)),
|
|
573
581
|
ldId: id,
|
|
@@ -182,7 +182,6 @@
|
|
|
182
182
|
"name": "默认选中行",
|
|
183
183
|
"type": "_JSEditor",
|
|
184
184
|
"defaultCode": "function getRowDefaultSelected(data, node) { \n return false; \n}",
|
|
185
|
-
"mustConfirm": true,
|
|
186
185
|
"wrapper": "collapse",
|
|
187
186
|
"wrapperProps": {
|
|
188
187
|
"suppressIcon": true
|
|
@@ -193,7 +192,6 @@
|
|
|
193
192
|
"name": "行是否可选",
|
|
194
193
|
"type": "_JSEditor",
|
|
195
194
|
"defaultCode": "function getRowSelectable(data, node) { \n return true; \n}",
|
|
196
|
-
"mustConfirm": true,
|
|
197
195
|
"wrapper": "collapse",
|
|
198
196
|
"wrapperProps": {
|
|
199
197
|
"suppressIcon": true
|
|
@@ -322,7 +320,6 @@
|
|
|
322
320
|
"name": "格式化数据",
|
|
323
321
|
"type": "_JSEditor",
|
|
324
322
|
"defaultCode": "function formatDataSource(list, detail) { \n return []; \n}",
|
|
325
|
-
"mustConfirm": true,
|
|
326
323
|
"wrapper": "collapse",
|
|
327
324
|
"wrapperProps": {
|
|
328
325
|
"suppressIcon": true
|
|
@@ -333,7 +330,6 @@
|
|
|
333
330
|
"name": "构建树层级",
|
|
334
331
|
"type": "_JSEditor",
|
|
335
332
|
"defaultCode": "function getDataPath(data) { \n return []; \n}",
|
|
336
|
-
"mustConfirm": true,
|
|
337
333
|
"wrapper": "collapse",
|
|
338
334
|
"wrapperProps": {
|
|
339
335
|
"suppressIcon": true
|
|
@@ -345,7 +341,6 @@
|
|
|
345
341
|
"desc": "自定义某些表格列",
|
|
346
342
|
"type": "_JSEditor",
|
|
347
343
|
"defaultCode": "function columnsRewrite(columns) { \n return columns; \n}",
|
|
348
|
-
"mustConfirm": true,
|
|
349
344
|
"wrapper": "collapse",
|
|
350
345
|
"wrapperProps": {
|
|
351
346
|
"suppressIcon": true
|
|
@@ -357,7 +352,6 @@
|
|
|
357
352
|
"desc": "完全自定义所有表格列,优先级大于columnsRewrite",
|
|
358
353
|
"type": "_JSEditor",
|
|
359
354
|
"defaultCode": "function columnsReset(columns) { \n return columns; \n}",
|
|
360
|
-
"mustConfirm": true,
|
|
361
355
|
"wrapper": "collapse",
|
|
362
356
|
"wrapperProps": {
|
|
363
357
|
"suppressIcon": true
|
|
@@ -368,7 +362,6 @@
|
|
|
368
362
|
"name": "model参数",
|
|
369
363
|
"type": "_JSEditor",
|
|
370
364
|
"defaultCode": "function getModelParams() { \n return {}; \n}",
|
|
371
|
-
"mustConfirm": true,
|
|
372
365
|
"wrapper": "collapse",
|
|
373
366
|
"wrapperProps": {
|
|
374
367
|
"suppressIcon": true
|
|
@@ -6,9 +6,10 @@ import { useMemoizedFn, useCreation } from 'ahooks';
|
|
|
6
6
|
import { isNil } from 'lodash';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { Tabs } from 'luck-design/antd';
|
|
9
|
-
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
9
|
+
import { useContext, useRemoteSource } from "../../../engine/provider/ContextProvider";
|
|
10
10
|
import Wrapper from "../Wrapper";
|
|
11
11
|
import RuntimeComp from "../JSX/RuntimeComp";
|
|
12
|
+
import { usePageProxyContext } from "../../../engine/provider/PageProxyProvider";
|
|
12
13
|
import { omitBadProps } from "../../../engine/tools/helper";
|
|
13
14
|
import defaultMeta from "../../../engine/meta/tabs.props.default.json";
|
|
14
15
|
var StyledTabs = styled(Tabs).withConfig({
|
|
@@ -32,10 +33,13 @@ var LCTabs = function LCTabs(_ref) {
|
|
|
32
33
|
var ref = useRef();
|
|
33
34
|
var apiRef = useRef();
|
|
34
35
|
var ctx = useContext();
|
|
36
|
+
var _useRemoteSource = useRemoteSource(),
|
|
37
|
+
module = _useRemoteSource.module;
|
|
38
|
+
var ppCtx = usePageProxyContext();
|
|
35
39
|
var _items = useCreation(function () {
|
|
36
40
|
return items.filter(function (_ref2) {
|
|
37
41
|
var serial = _ref2.serial;
|
|
38
|
-
return isNil(serial) || ctx.want(serial);
|
|
42
|
+
return isNil(serial) || ctx.want(serial, module[(ppCtx === null || ppCtx === void 0 ? void 0 : ppCtx.proxyCode) || 'master'].resources);
|
|
39
43
|
});
|
|
40
44
|
}, [items]);
|
|
41
45
|
var _useState = useState(function () {
|
|
@@ -11,6 +11,7 @@ import { isNil, keyBy } from 'lodash';
|
|
|
11
11
|
import { Modal, recheck, IconFont } from '@luck-design-biz/base';
|
|
12
12
|
import { suid } from '@luck-design-biz/base/utils';
|
|
13
13
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
14
|
+
import { usePageProxyContext } from "../../../engine/provider/PageProxyProvider";
|
|
14
15
|
import Wrapper from "../Wrapper";
|
|
15
16
|
import { LdTree } from "../../../../index";
|
|
16
17
|
import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
|
|
@@ -44,6 +45,7 @@ var LCTree = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
44
45
|
defaultSelect = _ref.defaultSelect,
|
|
45
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
47
|
var ctx = useContext();
|
|
48
|
+
var ppCtx = usePageProxyContext();
|
|
47
49
|
var apiRef = useRef();
|
|
48
50
|
var wrapperRef = useRef();
|
|
49
51
|
var instanceRef = useCombinedRefs(ref);
|
|
@@ -160,6 +162,7 @@ var LCTree = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
162
|
ref: instanceRef,
|
|
161
163
|
wrapper: wrapperRef,
|
|
162
164
|
wrapperProps: _wrapperProps,
|
|
165
|
+
pageProxy: ppCtx,
|
|
163
166
|
className: classNames(styles['lc-component-tree'], _defineProperty({}, className, !!className)),
|
|
164
167
|
dataSetKey: dataset === null || dataset === void 0 ? void 0 : dataset.code,
|
|
165
168
|
showLine: showLine,
|
|
@@ -204,7 +204,6 @@
|
|
|
204
204
|
"desc": "返回默认选中的数据主键",
|
|
205
205
|
"type": "_JSEditor",
|
|
206
206
|
"defaultCode": "function defaultSelect(treeData) { \n return null; \n}",
|
|
207
|
-
"mustConfirm": true,
|
|
208
207
|
"wrapper": "collapse",
|
|
209
208
|
"wrapperProps": {
|
|
210
209
|
"suppressIcon": true
|
|
@@ -265,7 +264,6 @@
|
|
|
265
264
|
"name": "节点是否有复选框",
|
|
266
265
|
"type": "_JSEditor",
|
|
267
266
|
"defaultCode": "function treeNodeCheckable(item) { \n return true; \n}",
|
|
268
|
-
"mustConfirm": true,
|
|
269
267
|
"wrapper": "collapse",
|
|
270
268
|
"wrapperProps": {
|
|
271
269
|
"suppressIcon": true
|
|
@@ -276,7 +274,6 @@
|
|
|
276
274
|
"name": "节点复选框是否禁用",
|
|
277
275
|
"type": "_JSEditor",
|
|
278
276
|
"defaultCode": "function treeNodeDisableCheckbox(item) { \n return false; \n}",
|
|
279
|
-
"mustConfirm": true,
|
|
280
277
|
"wrapper": "collapse",
|
|
281
278
|
"wrapperProps": {
|
|
282
279
|
"suppressIcon": true
|
|
@@ -287,7 +284,6 @@
|
|
|
287
284
|
"name": "节点是否禁用",
|
|
288
285
|
"type": "_JSEditor",
|
|
289
286
|
"defaultCode": "function treeNodeDisable(item) { \n return false; \n}",
|
|
290
|
-
"mustConfirm": true,
|
|
291
287
|
"wrapper": "collapse",
|
|
292
288
|
"wrapperProps": {
|
|
293
289
|
"suppressIcon": true
|
|
@@ -298,7 +294,7 @@
|
|
|
298
294
|
"name": "节点定制渲染",
|
|
299
295
|
"type": "_JSEditor",
|
|
300
296
|
"defaultCode": "function onTreeNodeRender(title, item) { \n return title; \n}",
|
|
301
|
-
"
|
|
297
|
+
"isjsx": true,
|
|
302
298
|
"wrapper": "collapse",
|
|
303
299
|
"wrapperProps": {
|
|
304
300
|
"suppressIcon": true
|
|
@@ -4,7 +4,8 @@ import React, { useEffect } from 'react';
|
|
|
4
4
|
import { useLatest, useCreation } from 'ahooks';
|
|
5
5
|
import { omit } from 'lodash';
|
|
6
6
|
import { useContext, useGet, modifyNode, getLevelNodes as _getLevelNodes, getSelfAndParent } from "../../engine/provider/ContextProvider";
|
|
7
|
-
import {
|
|
7
|
+
import { usePageProxyContext } from "../../engine/provider/PageProxyProvider";
|
|
8
|
+
import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, RUNTIME, LC_PAGEPROXY_KEY } from "../../constants";
|
|
8
9
|
import DragDropWrapper from "../../painter/components/DragDrop/DragDropWrapper";
|
|
9
10
|
var LCWrapper = function LCWrapper(_ref) {
|
|
10
11
|
var id = _ref.id,
|
|
@@ -13,6 +14,7 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
13
14
|
getTargetDom = _ref.getTargetDom,
|
|
14
15
|
api = _ref.api;
|
|
15
16
|
var ctx = useContext();
|
|
17
|
+
var ppCtx = usePageProxyContext();
|
|
16
18
|
var selfData = useGet({
|
|
17
19
|
id: id
|
|
18
20
|
});
|
|
@@ -35,6 +37,7 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
35
37
|
ctx._register(id, new Proxy({
|
|
36
38
|
id: id,
|
|
37
39
|
meta: omit(meta, ['props', 'css', 'advance']),
|
|
40
|
+
$pp: ppCtx,
|
|
38
41
|
set: function set(prop, value, toDom) {
|
|
39
42
|
if (toDom === true) {
|
|
40
43
|
if (['id', LC_COMPONENT_UNIT_KEY].includes(prop)) {
|
|
@@ -53,6 +56,8 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
53
56
|
get: function get(target, property, receiver) {
|
|
54
57
|
if (property === 'api') {
|
|
55
58
|
return api ? _objectSpread(_objectSpread({}, _api), api.current) : _api;
|
|
59
|
+
} else if (property === 'name') {
|
|
60
|
+
return _selfData.current.props.name;
|
|
56
61
|
}
|
|
57
62
|
return Reflect.get(target, property, receiver);
|
|
58
63
|
}
|
|
@@ -63,6 +68,9 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
63
68
|
if (dom) {
|
|
64
69
|
dom.setAttribute('id', id);
|
|
65
70
|
dom.setAttribute(LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT);
|
|
71
|
+
if (ppCtx) {
|
|
72
|
+
dom.setAttribute(LC_PAGEPROXY_KEY, ppCtx.id);
|
|
73
|
+
}
|
|
66
74
|
}
|
|
67
75
|
ctx.$publisher(ctx.topics.COMPONENT_MOUNT, {
|
|
68
76
|
id: id
|
package/es/services.js
CHANGED
|
@@ -21,22 +21,39 @@ function _readModlue() {
|
|
|
21
21
|
}));
|
|
22
22
|
return _readModlue.apply(this, arguments);
|
|
23
23
|
}
|
|
24
|
-
export function
|
|
25
|
-
return
|
|
24
|
+
export function readUI(_x2) {
|
|
25
|
+
return _readUI.apply(this, arguments);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function _readUI() {
|
|
28
|
+
_readUI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(get) {
|
|
29
29
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
30
30
|
while (1) switch (_context2.prev = _context2.next) {
|
|
31
31
|
case 0:
|
|
32
|
-
return _context2.abrupt("return", request("".concat(api.
|
|
33
|
-
params: params
|
|
34
|
-
}));
|
|
32
|
+
return _context2.abrupt("return", request("".concat(api.LUCKDA_HOST, "/ui/builder/noAuthFetchModuleDataSetUI?").concat(stringify(get))));
|
|
35
33
|
case 1:
|
|
36
34
|
case "end":
|
|
37
35
|
return _context2.stop();
|
|
38
36
|
}
|
|
39
37
|
}, _callee2);
|
|
40
38
|
}));
|
|
39
|
+
return _readUI.apply(this, arguments);
|
|
40
|
+
}
|
|
41
|
+
export function noAuthTransformCode(_x3) {
|
|
42
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
function _noAuthTransformCode() {
|
|
45
|
+
_noAuthTransformCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
46
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
47
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
return _context3.abrupt("return", request("".concat(api.BASE_HOST, "/page/option/noAuthTransformCode"), {
|
|
50
|
+
params: params
|
|
51
|
+
}));
|
|
52
|
+
case 1:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context3.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee3);
|
|
57
|
+
}));
|
|
41
58
|
return _noAuthTransformCode.apply(this, arguments);
|
|
42
59
|
}
|
|
@@ -8,9 +8,9 @@ import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
|
|
8
8
|
import { Button, Checkbox, Dropdown, Icon, Modal, Upload } from 'luck-design/antd';
|
|
9
9
|
import { useSetState } from 'ahooks';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import { canPreview, formatMessage, patchDownload, request, showPop } from '@luck-design-biz/base/utils';
|
|
12
|
-
import { getDvaApp } from 'umi';
|
|
13
|
-
import { last, lowerCase, split } from 'lodash';
|
|
11
|
+
import { canPreview, formatMessage, patchDownload, request, showPop, string2ASCII } from '@luck-design-biz/base/utils';
|
|
12
|
+
import { getDvaApp, history, getCreateHistoryOptions } from 'umi';
|
|
13
|
+
import { last, lowerCase, split, replace } from 'lodash';
|
|
14
14
|
import { Box, Permission, PermissionGroup } from 'luck-design';
|
|
15
15
|
import styles from "./index.less";
|
|
16
16
|
|
|
@@ -150,12 +150,22 @@ var FilesWall = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
150
150
|
});
|
|
151
151
|
onUploadChange && onUploadChange(e);
|
|
152
152
|
};
|
|
153
|
+
var headers = {};
|
|
154
|
+
var token = window.cookie.get(window.appConfig.authSaveKey);
|
|
155
|
+
if (token) headers.Authorization = "Bearer ".concat(token);
|
|
156
|
+
var ticket = history.location.query.ticket;
|
|
157
|
+
if (ticket) headers.ticket = string2ASCII(ticket);
|
|
158
|
+
if (window.__POWERED_BY_QIANKUN__) {
|
|
159
|
+
var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
|
|
160
|
+
headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
|
|
161
|
+
headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
|
|
162
|
+
if (window.routeCode) headers['Menu-Code'] = window.routeCode;
|
|
163
|
+
}
|
|
164
|
+
;
|
|
153
165
|
var formItemProps = _objectSpread(_objectSpread({}, rest), {}, {
|
|
154
166
|
action: getUrl('upload'),
|
|
155
167
|
// 上传地址
|
|
156
|
-
headers:
|
|
157
|
-
Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
|
|
158
|
-
},
|
|
168
|
+
headers: headers,
|
|
159
169
|
// 请求头
|
|
160
170
|
name: 'files',
|
|
161
171
|
multiple: true,
|
|
@@ -4,15 +4,15 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["formId", "formRef", "showNote", "operates", "loading", "uploadUrl", "supportTypes", "forbiddenTypes", "beforeUpload", "formMode", "onUploadChange", "zipName", "resetActions", "getUrl", "wrapperRef"];
|
|
6
6
|
import React, { useState, useRef, forwardRef } from 'react';
|
|
7
|
-
import { getDvaApp } from 'umi';
|
|
7
|
+
import { getDvaApp, history, getCreateHistoryOptions } from 'umi';
|
|
8
8
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
9
9
|
import { Button, Upload, Tooltip, Icon } from 'luck-design/antd';
|
|
10
10
|
import moment from 'moment';
|
|
11
|
-
import { last } from 'lodash';
|
|
11
|
+
import { last, replace } from 'lodash';
|
|
12
12
|
import { BasicForm, BasicFormItem, PopWindow } from 'luck-design';
|
|
13
13
|
import api from "@/services/ApiConfig";
|
|
14
14
|
import { FormBtn, GridForm } from '@luck-design-biz/base/FormList';
|
|
15
|
-
import { byteConvert, formatMessage, beforeUpload as _beforeUpload2, getSupportUploadTypes, patchDownloadZip, showPop, request, canPreview } from '@luck-design-biz/base/utils';
|
|
15
|
+
import { byteConvert, formatMessage, beforeUpload as _beforeUpload2, getSupportUploadTypes, patchDownloadZip, showPop, request, canPreview, string2ASCII } from '@luck-design-biz/base/utils';
|
|
16
16
|
var columns = [{
|
|
17
17
|
field: 'name',
|
|
18
18
|
title: '附件名称'
|
|
@@ -198,12 +198,22 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
var renderUploadTopLeft = useMemoizedFn(function () {
|
|
201
|
+
var headers = {};
|
|
202
|
+
var token = window.cookie.get(window.appConfig.authSaveKey);
|
|
203
|
+
if (token) headers.Authorization = "Bearer ".concat(token);
|
|
204
|
+
var ticket = history.location.query.ticket;
|
|
205
|
+
if (ticket) headers.ticket = string2ASCII(ticket);
|
|
206
|
+
if (window.__POWERED_BY_QIANKUN__) {
|
|
207
|
+
var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
|
|
208
|
+
headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
|
|
209
|
+
headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
|
|
210
|
+
if (window.routeCode) headers['Menu-Code'] = window.routeCode;
|
|
211
|
+
}
|
|
212
|
+
;
|
|
201
213
|
var formItemProps = {
|
|
202
214
|
action: uploadUrl || getUrl('upload'),
|
|
203
215
|
// 上传地址
|
|
204
|
-
headers:
|
|
205
|
-
Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
|
|
206
|
-
},
|
|
216
|
+
headers: headers,
|
|
207
217
|
// 请求头
|
|
208
218
|
name: 'files',
|
|
209
219
|
multiple: true,
|
|
@@ -3,8 +3,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "supportTypes", "forbiddenTypes", "children", "dataFormat", "listType"];
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { replace } from 'lodash';
|
|
6
7
|
import { BasicFormItem } from 'luck-design';
|
|
7
|
-
import {
|
|
8
|
+
import { history, getCreateHistoryOptions } from 'umi';
|
|
9
|
+
import { formatMessage, beforeUpload as _beforeUpload, getSupportUploadTypes, string2ASCII } from '@luck-design-biz/base/utils';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* 表单类型富文本上传
|
|
@@ -45,6 +47,18 @@ function buildComponent(props) {
|
|
|
45
47
|
return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "¬e=").concat(note);
|
|
46
48
|
};
|
|
47
49
|
var supportUploadTypes = getSupportUploadTypes(forbiddenTypes, supportTypes);
|
|
50
|
+
var headers = {};
|
|
51
|
+
var token = window.cookie.get(window.appConfig.authSaveKey);
|
|
52
|
+
if (token) headers.Authorization = "Bearer ".concat(token);
|
|
53
|
+
var ticket = history.location.query.ticket;
|
|
54
|
+
if (ticket) headers.ticket = string2ASCII(ticket);
|
|
55
|
+
if (window.__POWERED_BY_QIANKUN__) {
|
|
56
|
+
var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
|
|
57
|
+
headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
|
|
58
|
+
headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
|
|
59
|
+
if (window.routeCode) headers['Menu-Code'] = window.routeCode;
|
|
60
|
+
}
|
|
61
|
+
;
|
|
48
62
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({
|
|
49
63
|
extra: "".concat(formatMessage({
|
|
50
64
|
id: 'app.upload.supportUpload',
|
|
@@ -62,9 +76,7 @@ function buildComponent(props) {
|
|
|
62
76
|
}),
|
|
63
77
|
action: uploadUrl || getUrl('upload'),
|
|
64
78
|
// 上传地址
|
|
65
|
-
headers:
|
|
66
|
-
Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
|
|
67
|
-
},
|
|
79
|
+
headers: headers,
|
|
68
80
|
// 请求头
|
|
69
81
|
name: 'files',
|
|
70
82
|
// 发送到后台的文件名
|
package/es/utils/action.js
CHANGED
|
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
// 行为请求同一接口
|
|
5
|
-
import { fetchCallBehavior } from "../lowcode/constants/api-url";
|
|
5
|
+
import { fetchCallBehavior, readCallBehavior } from "../lowcode/constants/api-url";
|
|
6
6
|
export function behaviorCall() {
|
|
7
7
|
return _behaviorCall.apply(this, arguments);
|
|
8
8
|
}
|
|
@@ -28,4 +28,5 @@ function _behaviorCall() {
|
|
|
28
28
|
}, _callee);
|
|
29
29
|
}));
|
|
30
30
|
return _behaviorCall.apply(this, arguments);
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
|
+
export { readCallBehavior };
|
package/es/utils/form.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
@@ -15,13 +16,14 @@ import moment from 'moment';
|
|
|
15
16
|
import { capitalize, merge, transform, isArray, omit, isNil, clone, cloneDeep } from 'lodash';
|
|
16
17
|
import api from "@/services/ApiConfig";
|
|
17
18
|
import { defaultComName, translator, splitStrToObj, formatCustomProps } from "../helper/form";
|
|
18
|
-
import { getColumnRender } from "./grid";
|
|
19
|
+
import { getColumnRender, getExportField } from "./grid";
|
|
19
20
|
import * as formItemUtils from "../helper/FromItems";
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* 根据动态表单配置项生成formItem
|
|
23
24
|
* @param {动态表单配置项} props
|
|
24
25
|
* @param {自定义动态表单配置项} customProps
|
|
26
|
+
* @param {formUi配置项} formUiPreset
|
|
25
27
|
* @returns <BasicForm name='' ... />
|
|
26
28
|
*/
|
|
27
29
|
export function getFormItem() {
|
|
@@ -30,10 +32,11 @@ export function getFormItem() {
|
|
|
30
32
|
property = _ref.property,
|
|
31
33
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
34
|
var customProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
35
|
+
var formUiPreset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
33
36
|
if (!property) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
34
37
|
if (property === 'sint' || property === 'number' || property === 'long') props.opt_decimal = 0;
|
|
35
38
|
var comType = comName || defaultComName[property];
|
|
36
|
-
var _translator = translator(props),
|
|
39
|
+
var _translator = translator(_objectSpread(_objectSpread({}, props), formUiPreset)),
|
|
37
40
|
name = _translator.name,
|
|
38
41
|
translateProps = _objectWithoutProperties(_translator, _excluded2);
|
|
39
42
|
var _merge = merge(
|
|
@@ -194,7 +197,7 @@ export var dataFormat = function dataFormat() {
|
|
|
194
197
|
default:
|
|
195
198
|
result[name] = values[name];
|
|
196
199
|
}
|
|
197
|
-
values = omit(values, [name, "".concat(name, "
|
|
200
|
+
values = omit(values, [name, "".concat(name, "_virtual")]);
|
|
198
201
|
}, {});
|
|
199
202
|
return _objectSpread(_objectSpread({}, values), data);
|
|
200
203
|
};
|
|
@@ -202,8 +205,12 @@ export var dataFormat = function dataFormat() {
|
|
|
202
205
|
/**
|
|
203
206
|
*
|
|
204
207
|
* @param formType
|
|
208
|
+
* @param comName
|
|
209
|
+
* @param property
|
|
205
210
|
* @param props
|
|
211
|
+
* @param formItemRewrite
|
|
206
212
|
* @param customProps
|
|
213
|
+
* @param gridUiPreset
|
|
207
214
|
* @returns {*&{field: *, editable: (false|{required: *}), renderBasicFormItem: ((function(): (*))|*), title, render: *}}
|
|
208
215
|
*/
|
|
209
216
|
export var getFormColumn = function getFormColumn() {
|
|
@@ -216,9 +223,10 @@ export var getFormColumn = function getFormColumn() {
|
|
|
216
223
|
var _ref5 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
217
224
|
formItemRewrite = _ref5.formItemRewrite,
|
|
218
225
|
customProps = _objectWithoutProperties(_ref5, _excluded7);
|
|
226
|
+
var gridUiPreset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
219
227
|
var formItemType = comName || defaultComName[property];
|
|
220
228
|
if (formItemType === 'radio') formItemType = 'select';
|
|
221
|
-
var _translator2 = translator(props),
|
|
229
|
+
var _translator2 = translator(_objectSpread(_objectSpread({}, props), gridUiPreset)),
|
|
222
230
|
name = _translator2.name,
|
|
223
231
|
translateProps = _objectWithoutProperties(_translator2, _excluded8);
|
|
224
232
|
var _merge2 = merge(
|
|
@@ -229,7 +237,7 @@ export var getFormColumn = function getFormColumn() {
|
|
|
229
237
|
_props = _objectWithoutProperties(_merge2, _excluded9);
|
|
230
238
|
var columnRender = getColumnRender(name, formItemType, _props);
|
|
231
239
|
if (formType !== 'writer') _props.name = name;
|
|
232
|
-
return _objectSpread(_objectSpread({
|
|
240
|
+
return _objectSpread(_objectSpread(_objectSpread({}, _props), {}, {
|
|
233
241
|
title: translateProps.label,
|
|
234
242
|
editable: formType === 'writer' && {
|
|
235
243
|
required: _props.required || ((_props$config = _props.config) === null || _props$config === void 0 ? void 0 : _props$config.required)
|
|
@@ -256,6 +264,32 @@ export var getFormColumn = function getFormColumn() {
|
|
|
256
264
|
key: name
|
|
257
265
|
}, _props));
|
|
258
266
|
},
|
|
259
|
-
field: name
|
|
267
|
+
field: name,
|
|
268
|
+
exportField: getExportField(name, formItemType, _props)
|
|
260
269
|
});
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* 合并两个数组,并且数据顺序以arr2为准
|
|
274
|
+
* @param arr1
|
|
275
|
+
* @param arr2
|
|
276
|
+
* @param rowKey
|
|
277
|
+
*/
|
|
278
|
+
export var mergeAndSort = function mergeAndSort(arr1, arr2, rowKey) {
|
|
279
|
+
// 将a2转换为一个Map,便于快速查找
|
|
280
|
+
var a2Map = new Map(arr2.map(function (item) {
|
|
281
|
+
return [item[rowKey], item];
|
|
282
|
+
}));
|
|
283
|
+
// 创建一个新的数组,按a2的顺序填充元素,同时包含a1中不在a2中的元素
|
|
284
|
+
var mergedArray = arr2.map(function (item) {
|
|
285
|
+
var a1Item = arr1.find(function (a1) {
|
|
286
|
+
return a1[rowKey] === item[rowKey];
|
|
287
|
+
});
|
|
288
|
+
return a1Item ? _objectSpread(_objectSpread({}, item), a1Item) : item;
|
|
289
|
+
});
|
|
290
|
+
// 将a1中未出现在a2中的元素追加到合并后的数组末尾
|
|
291
|
+
mergedArray.push.apply(mergedArray, _toConsumableArray(arr1.filter(function (a1Item) {
|
|
292
|
+
return !a2Map.has(a1Item[rowKey]);
|
|
293
|
+
})));
|
|
294
|
+
return mergedArray;
|
|
261
295
|
};
|