@luck-design-biz/luckda 1.0.0-9-alpha → 1.0.1
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 +15 -3
- package/es/components/LdFormList/index.js +2 -1
- package/es/lowcode/view/lc-components/Dialog/index.js +5 -2
- package/es/lowcode/view/lc-components/Form/index.js +3 -2
- package/es/services.js +19 -0
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/FormItem/index.js +6 -6
- package/es/utils/grid.js +1 -0
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/LdFormList/index.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +5 -2
- package/lib/lowcode/view/lc-components/Form/index.js +3 -2
- package/lib/services.js +20 -0
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/FormItem/index.js +6 -6
- package/lib/utils/grid.js +1 -0
- package/package.json +3 -3
|
@@ -2,13 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
-
import React, { forwardRef, createContext, useState, useRef, useContext } from 'react';
|
|
5
|
+
import React, { forwardRef, createContext, useState, useRef, useContext, useEffect } from 'react';
|
|
6
6
|
import { useRequest, useSetState, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { BasicForm, BasicFormItem } from 'luck-design';
|
|
8
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import { META_TAG_NAME, LC_RUNTIME_KEY } from "../../lowcode/constants";
|
|
10
|
+
import { setMetaAttrs } from "../../lowcode/engine/tools/helper";
|
|
8
11
|
import LdPop from "../LdPop";
|
|
9
|
-
import { readModlue } from "../../services";
|
|
12
|
+
import { readModlue, noAuthTransformCode } from "../../services";
|
|
10
13
|
import { doAction as doActionUtils } from "../../helper/action";
|
|
11
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
14
|
export var LuckDaContext = /*#__PURE__*/createContext();
|
|
13
15
|
export var useLDCtx = function useLDCtx() {
|
|
14
16
|
return useContext(LuckDaContext);
|
|
@@ -28,6 +30,16 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
28
30
|
pops = _useSetState2[0],
|
|
29
31
|
setPops = _useSetState2[1];
|
|
30
32
|
var fieldProps = useRef({});
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
setMetaAttrs(LC_RUNTIME_KEY, 'live');
|
|
35
|
+
noAuthTransformCode({
|
|
36
|
+
code: moduleCode
|
|
37
|
+
}).then(function (res) {
|
|
38
|
+
var code = res.code,
|
|
39
|
+
data = res.data;
|
|
40
|
+
if (code === 1) setMetaAttrs(META_TAG_NAME, data);
|
|
41
|
+
});
|
|
42
|
+
}, []);
|
|
31
43
|
var _useRequest = useRequest(readModlue, {
|
|
32
44
|
defaultParams: [{
|
|
33
45
|
moduleCode: moduleCode
|
|
@@ -120,7 +120,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
120
120
|
var renderExtra = useMemoizedFn(function (formId, extraConfig, type) {
|
|
121
121
|
return /*#__PURE__*/React.createElement(FormBtn, _extends({
|
|
122
122
|
type: type,
|
|
123
|
-
formId: formId
|
|
123
|
+
formId: formId,
|
|
124
|
+
showConfigBtn: false
|
|
124
125
|
}, extraConfig));
|
|
125
126
|
});
|
|
126
127
|
|
|
@@ -8,6 +8,7 @@ import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
|
|
|
8
8
|
import { Modal, Button } from 'luck-design/antd';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import styled from 'styled-components';
|
|
11
|
+
import { isNil } from 'lodash';
|
|
11
12
|
import { LDActions } from "../../../../index";
|
|
12
13
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
13
14
|
import { omitBadProps } from "../../../engine/tools/helper";
|
|
@@ -151,7 +152,6 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
151
152
|
}, /*#__PURE__*/React.createElement(Modal, _extends({
|
|
152
153
|
title: _title,
|
|
153
154
|
visible: open,
|
|
154
|
-
getContainer: getContainer,
|
|
155
155
|
width: width,
|
|
156
156
|
mask: mask,
|
|
157
157
|
maskStyle: maskStyle,
|
|
@@ -160,7 +160,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
160
160
|
overflowY: 'auto',
|
|
161
161
|
marginTop: 0
|
|
162
162
|
},
|
|
163
|
-
wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName))
|
|
163
|
+
wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName)),
|
|
164
|
+
getContainer: isNil(getContainer) ? function () {
|
|
165
|
+
return document.getElementById('root') || document.getElementById('react-content') || document.body;
|
|
166
|
+
} : getContainer
|
|
164
167
|
}, _footer, {
|
|
165
168
|
onOk: handleOk,
|
|
166
169
|
onCancel: function onCancel() {
|
|
@@ -56,7 +56,7 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
56
56
|
return [];
|
|
57
57
|
};
|
|
58
58
|
var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
59
|
-
var _ctx$state2;
|
|
59
|
+
var _ctx$state2, _promiseRef$current2;
|
|
60
60
|
var id = _ref3.id,
|
|
61
61
|
className = _ref3.className,
|
|
62
62
|
blocks = _ref3.blocks,
|
|
@@ -584,7 +584,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
584
584
|
}
|
|
585
585
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
586
586
|
},
|
|
587
|
-
afterInit: afterInit
|
|
587
|
+
afterInit: afterInit,
|
|
588
|
+
validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef)
|
|
588
589
|
}));
|
|
589
590
|
});
|
|
590
591
|
LCForm.defaultProps = omitBadProps(defaultMeta);
|
package/es/services.js
CHANGED
|
@@ -20,4 +20,23 @@ function _readModlue() {
|
|
|
20
20
|
}, _callee);
|
|
21
21
|
}));
|
|
22
22
|
return _readModlue.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
export function noAuthTransformCode(_x2) {
|
|
25
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
26
|
+
}
|
|
27
|
+
function _noAuthTransformCode() {
|
|
28
|
+
_noAuthTransformCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
29
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
30
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
return _context2.abrupt("return", request("".concat(api.BASE_HOST, "/page/option/noAuthTransformCode"), {
|
|
33
|
+
params: params
|
|
34
|
+
}));
|
|
35
|
+
case 1:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context2.stop();
|
|
38
|
+
}
|
|
39
|
+
}, _callee2);
|
|
40
|
+
}));
|
|
41
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
23
42
|
}
|
|
@@ -79,7 +79,7 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
79
79
|
var _getDvaApp$_store$get = (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user,
|
|
80
80
|
currentUser = _getDvaApp$_store$get.currentUser;
|
|
81
81
|
var supportUploadTypes = useCreation(function () {
|
|
82
|
-
return getSupportUploadTypes(forbiddenTypes);
|
|
82
|
+
return getSupportUploadTypes(forbiddenTypes, supportTypes);
|
|
83
83
|
}, [forbiddenTypes, supportTypes]);
|
|
84
84
|
|
|
85
85
|
// 下载
|
|
@@ -271,6 +271,9 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
271
271
|
|
|
272
272
|
// 预览
|
|
273
273
|
var resetActionsColumn = useMemoizedFn(function (data, index, _actions, params) {
|
|
274
|
+
if (resetActions) {
|
|
275
|
+
return resetActions(data, index, actionList, params);
|
|
276
|
+
}
|
|
274
277
|
var actions = _actions.filter(function (item) {
|
|
275
278
|
return item.wanted !== 'update' && item.wanted !== 'add';
|
|
276
279
|
});
|
|
@@ -311,9 +314,6 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
311
314
|
});
|
|
312
315
|
}
|
|
313
316
|
});
|
|
314
|
-
if (resetActions) {
|
|
315
|
-
return resetActions(data, index, actions, params);
|
|
316
|
-
}
|
|
317
317
|
return actions;
|
|
318
318
|
});
|
|
319
319
|
var handleBatchOperationsClick = useMemoizedFn(function (key, selectedRows, cb) {
|
|
@@ -382,9 +382,19 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
382
382
|
beforeUpload: _beforeUpload
|
|
383
383
|
});
|
|
384
384
|
},
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
customRequest: function customRequest(_ref2) {
|
|
386
|
+
var file = _ref2.file,
|
|
387
|
+
onProgress = _ref2.onProgress,
|
|
388
|
+
onSuccess = _ref2.onSuccess;
|
|
389
|
+
return new Promise(function (resolve) {
|
|
390
|
+
setTimeout(function () {
|
|
391
|
+
onProgress({
|
|
392
|
+
percent: 100
|
|
393
|
+
});
|
|
394
|
+
onSuccess(file);
|
|
395
|
+
resolve();
|
|
396
|
+
}, 1000);
|
|
397
|
+
});
|
|
388
398
|
}
|
|
389
399
|
})
|
|
390
400
|
}), /*#__PURE__*/React.createElement(BasicFormItem, {
|
|
@@ -5,20 +5,19 @@ var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { BasicFormItem } from 'luck-design';
|
|
7
7
|
import { formatMessage, beforeUpload as _beforeUpload, getSupportUploadTypes } from '@luck-design-biz/base/utils';
|
|
8
|
-
import { getBehaviorUrl } from "../../lowcode/constants/api-url";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* 表单类型富文本上传
|
|
12
11
|
* 是否实体字段: 是
|
|
13
12
|
* 是否接受tag: 是
|
|
14
13
|
* 是否虚拟主键: 否
|
|
15
|
-
* 接受参数:
|
|
14
|
+
* 接受参数:
|
|
16
15
|
* name: 附件名称逗号拼接
|
|
17
16
|
* name_virtual: [{...// 附件所有参数}]
|
|
18
17
|
* ### name=name_virtual ###
|
|
19
|
-
* 传参:
|
|
18
|
+
* 传参:
|
|
20
19
|
* name: [{objectName, marker},...]
|
|
21
|
-
* 其他需求:
|
|
20
|
+
* 其他需求:
|
|
22
21
|
* 支持beforeUpload禁止附加类型
|
|
23
22
|
* =>beforeUpload禁止类型全覆盖
|
|
24
23
|
* =>forbiddenTypes和配置管理中禁止类型合并
|
|
@@ -36,13 +35,14 @@ function buildComponent(props) {
|
|
|
36
35
|
_props$config = props.config,
|
|
37
36
|
config = _props$config === void 0 ? {} : _props$config,
|
|
38
37
|
supportTypes = props.supportTypes,
|
|
39
|
-
forbiddenTypes = props.forbiddenTypes,
|
|
38
|
+
_props$forbiddenTypes = props.forbiddenTypes,
|
|
39
|
+
forbiddenTypes = _props$forbiddenTypes === void 0 ? [] : _props$forbiddenTypes,
|
|
40
40
|
children = props.children,
|
|
41
41
|
dataFormat = props.dataFormat,
|
|
42
42
|
listType = props.listType,
|
|
43
43
|
rest = _objectWithoutProperties(props, _excluded);
|
|
44
44
|
var getUrl = function getUrl(behaviorKey) {
|
|
45
|
-
return "".concat(
|
|
45
|
+
return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "¬e=").concat(note);
|
|
46
46
|
};
|
|
47
47
|
var supportUploadTypes = getSupportUploadTypes(forbiddenTypes, supportTypes);
|
|
48
48
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({
|
package/es/utils/grid.js
CHANGED
|
@@ -45,6 +45,7 @@ export function getColumnRender(name, type) {
|
|
|
45
45
|
case 'select':
|
|
46
46
|
case 'group':
|
|
47
47
|
case 'complex':
|
|
48
|
+
case 'dict':
|
|
48
49
|
render = function render(text, record) {
|
|
49
50
|
if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
|
|
50
51
|
if (isArray(text)) return text.map(function (i) {
|
|
@@ -13,10 +13,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _ahooks = require("ahooks");
|
|
15
15
|
var _luckDesign = require("luck-design");
|
|
16
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
17
|
+
var _constants = require("../../lowcode/constants");
|
|
18
|
+
var _helper = require("../../lowcode/engine/tools/helper");
|
|
16
19
|
var _LdPop = _interopRequireDefault(require("../LdPop"));
|
|
17
20
|
var _services = require("../../services");
|
|
18
21
|
var _action2 = require("../../helper/action");
|
|
19
|
-
var _utils = require("@luck-design-biz/base/utils");
|
|
20
22
|
var LuckDaContext = exports.LuckDaContext = /*#__PURE__*/(0, _react.createContext)();
|
|
21
23
|
var useLDCtx = exports.useLDCtx = function useLDCtx() {
|
|
22
24
|
return (0, _react.useContext)(LuckDaContext);
|
|
@@ -36,6 +38,16 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
36
38
|
pops = _useSetState2[0],
|
|
37
39
|
setPops = _useSetState2[1];
|
|
38
40
|
var fieldProps = (0, _react.useRef)({});
|
|
41
|
+
(0, _react.useEffect)(function () {
|
|
42
|
+
(0, _helper.setMetaAttrs)(_constants.LC_RUNTIME_KEY, 'live');
|
|
43
|
+
(0, _services.noAuthTransformCode)({
|
|
44
|
+
code: moduleCode
|
|
45
|
+
}).then(function (res) {
|
|
46
|
+
var code = res.code,
|
|
47
|
+
data = res.data;
|
|
48
|
+
if (code === 1) (0, _helper.setMetaAttrs)(_constants.META_TAG_NAME, data);
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
39
51
|
var _useRequest = (0, _ahooks.useRequest)(_services.readModlue, {
|
|
40
52
|
defaultParams: [{
|
|
41
53
|
moduleCode: moduleCode
|
|
@@ -127,7 +127,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
127
127
|
var renderExtra = (0, _ahooks.useMemoizedFn)(function (formId, extraConfig, type) {
|
|
128
128
|
return /*#__PURE__*/_react.default.createElement(_FormList.FormBtn, (0, _extends2.default)({
|
|
129
129
|
type: type,
|
|
130
|
-
formId: formId
|
|
130
|
+
formId: formId,
|
|
131
|
+
showConfigBtn: false
|
|
131
132
|
}, extraConfig));
|
|
132
133
|
});
|
|
133
134
|
|
|
@@ -16,6 +16,7 @@ var _ahooks = require("ahooks");
|
|
|
16
16
|
var _antd = require("luck-design/antd");
|
|
17
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
var _lodash = require("lodash");
|
|
19
20
|
var _index = require("../../../../index");
|
|
20
21
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
21
22
|
var _helper = require("../../../engine/tools/helper");
|
|
@@ -159,7 +160,6 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
159
160
|
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, (0, _extends2.default)({
|
|
160
161
|
title: _title,
|
|
161
162
|
visible: open,
|
|
162
|
-
getContainer: getContainer,
|
|
163
163
|
width: width,
|
|
164
164
|
mask: mask,
|
|
165
165
|
maskStyle: maskStyle,
|
|
@@ -168,7 +168,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
168
168
|
overflowY: 'auto',
|
|
169
169
|
marginTop: 0
|
|
170
170
|
},
|
|
171
|
-
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName))
|
|
171
|
+
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName)),
|
|
172
|
+
getContainer: (0, _lodash.isNil)(getContainer) ? function () {
|
|
173
|
+
return document.getElementById('root') || document.getElementById('react-content') || document.body;
|
|
174
|
+
} : getContainer
|
|
172
175
|
}, _footer, {
|
|
173
176
|
onOk: handleOk,
|
|
174
177
|
onCancel: function onCancel() {
|
|
@@ -64,7 +64,7 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
64
64
|
return [];
|
|
65
65
|
};
|
|
66
66
|
var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
67
|
-
var _ctx$state2;
|
|
67
|
+
var _ctx$state2, _promiseRef$current2;
|
|
68
68
|
var id = _ref3.id,
|
|
69
69
|
className = _ref3.className,
|
|
70
70
|
blocks = _ref3.blocks,
|
|
@@ -592,7 +592,8 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
|
592
592
|
}
|
|
593
593
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
594
594
|
},
|
|
595
|
-
afterInit: afterInit
|
|
595
|
+
afterInit: afterInit,
|
|
596
|
+
validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef)
|
|
596
597
|
}));
|
|
597
598
|
});
|
|
598
599
|
LCForm.defaultProps = (0, _helper.omitBadProps)(_formPropsDefault.default);
|
package/lib/services.js
CHANGED
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.noAuthTransformCode = noAuthTransformCode;
|
|
7
8
|
exports.readModlue = readModlue;
|
|
8
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -27,4 +28,23 @@ function _readModlue() {
|
|
|
27
28
|
}, _callee);
|
|
28
29
|
}));
|
|
29
30
|
return _readModlue.apply(this, arguments);
|
|
31
|
+
}
|
|
32
|
+
function noAuthTransformCode(_x2) {
|
|
33
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
function _noAuthTransformCode() {
|
|
36
|
+
_noAuthTransformCode = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(params) {
|
|
37
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
38
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
return _context2.abrupt("return", (0, _utils.request)("".concat(_ApiConfig.default.BASE_HOST, "/page/option/noAuthTransformCode"), {
|
|
41
|
+
params: params
|
|
42
|
+
}));
|
|
43
|
+
case 1:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context2.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee2);
|
|
48
|
+
}));
|
|
49
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
30
50
|
}
|
|
@@ -87,7 +87,7 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
87
87
|
var _getDvaApp$_store$get = (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user,
|
|
88
88
|
currentUser = _getDvaApp$_store$get.currentUser;
|
|
89
89
|
var supportUploadTypes = (0, _ahooks.useCreation)(function () {
|
|
90
|
-
return (0, _utils.getSupportUploadTypes)(forbiddenTypes);
|
|
90
|
+
return (0, _utils.getSupportUploadTypes)(forbiddenTypes, supportTypes);
|
|
91
91
|
}, [forbiddenTypes, supportTypes]);
|
|
92
92
|
|
|
93
93
|
// 下载
|
|
@@ -279,6 +279,9 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
279
279
|
|
|
280
280
|
// 预览
|
|
281
281
|
var resetActionsColumn = (0, _ahooks.useMemoizedFn)(function (data, index, _actions, params) {
|
|
282
|
+
if (resetActions) {
|
|
283
|
+
return resetActions(data, index, actionList, params);
|
|
284
|
+
}
|
|
282
285
|
var actions = _actions.filter(function (item) {
|
|
283
286
|
return item.wanted !== 'update' && item.wanted !== 'add';
|
|
284
287
|
});
|
|
@@ -319,9 +322,6 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
319
322
|
});
|
|
320
323
|
}
|
|
321
324
|
});
|
|
322
|
-
if (resetActions) {
|
|
323
|
-
return resetActions(data, index, actions, params);
|
|
324
|
-
}
|
|
325
325
|
return actions;
|
|
326
326
|
});
|
|
327
327
|
var handleBatchOperationsClick = (0, _ahooks.useMemoizedFn)(function (key, selectedRows, cb) {
|
|
@@ -390,9 +390,19 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
390
390
|
beforeUpload: _beforeUpload
|
|
391
391
|
});
|
|
392
392
|
},
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
customRequest: function customRequest(_ref2) {
|
|
394
|
+
var file = _ref2.file,
|
|
395
|
+
onProgress = _ref2.onProgress,
|
|
396
|
+
onSuccess = _ref2.onSuccess;
|
|
397
|
+
return new Promise(function (resolve) {
|
|
398
|
+
setTimeout(function () {
|
|
399
|
+
onProgress({
|
|
400
|
+
percent: 100
|
|
401
|
+
});
|
|
402
|
+
onSuccess(file);
|
|
403
|
+
resolve();
|
|
404
|
+
}, 1000);
|
|
405
|
+
});
|
|
396
406
|
}
|
|
397
407
|
})
|
|
398
408
|
}), /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, {
|
|
@@ -11,20 +11,19 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _luckDesign = require("luck-design");
|
|
13
13
|
var _utils = require("@luck-design-biz/base/utils");
|
|
14
|
-
var _apiUrl = require("../../lowcode/constants/api-url");
|
|
15
14
|
var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "supportTypes", "forbiddenTypes", "children", "dataFormat", "listType"];
|
|
16
15
|
/**
|
|
17
16
|
* 表单类型富文本上传
|
|
18
17
|
* 是否实体字段: 是
|
|
19
18
|
* 是否接受tag: 是
|
|
20
19
|
* 是否虚拟主键: 否
|
|
21
|
-
* 接受参数:
|
|
20
|
+
* 接受参数:
|
|
22
21
|
* name: 附件名称逗号拼接
|
|
23
22
|
* name_virtual: [{...// 附件所有参数}]
|
|
24
23
|
* ### name=name_virtual ###
|
|
25
|
-
* 传参:
|
|
24
|
+
* 传参:
|
|
26
25
|
* name: [{objectName, marker},...]
|
|
27
|
-
* 其他需求:
|
|
26
|
+
* 其他需求:
|
|
28
27
|
* 支持beforeUpload禁止附加类型
|
|
29
28
|
* =>beforeUpload禁止类型全覆盖
|
|
30
29
|
* =>forbiddenTypes和配置管理中禁止类型合并
|
|
@@ -42,13 +41,14 @@ function buildComponent(props) {
|
|
|
42
41
|
_props$config = props.config,
|
|
43
42
|
config = _props$config === void 0 ? {} : _props$config,
|
|
44
43
|
supportTypes = props.supportTypes,
|
|
45
|
-
forbiddenTypes = props.forbiddenTypes,
|
|
44
|
+
_props$forbiddenTypes = props.forbiddenTypes,
|
|
45
|
+
forbiddenTypes = _props$forbiddenTypes === void 0 ? [] : _props$forbiddenTypes,
|
|
46
46
|
children = props.children,
|
|
47
47
|
dataFormat = props.dataFormat,
|
|
48
48
|
listType = props.listType,
|
|
49
49
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
50
50
|
var getUrl = function getUrl(behaviorKey) {
|
|
51
|
-
return "".concat(
|
|
51
|
+
return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "¬e=").concat(note);
|
|
52
52
|
};
|
|
53
53
|
var supportUploadTypes = (0, _utils.getSupportUploadTypes)(forbiddenTypes, supportTypes);
|
|
54
54
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({
|
package/lib/utils/grid.js
CHANGED
|
@@ -53,6 +53,7 @@ function getColumnRender(name, type) {
|
|
|
53
53
|
case 'select':
|
|
54
54
|
case 'group':
|
|
55
55
|
case 'complex':
|
|
56
|
+
case 'dict':
|
|
56
57
|
render = function render(text, record) {
|
|
57
58
|
if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
|
|
58
59
|
if ((0, _lodash.isArray)(text)) return text.map(function (i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luck-design-biz/luckda",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "前端配置管理中心业务组件库",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "cross-env NODE_OPTIONS=--max-old-space-size=10240 USER_RUNTIME=SITE RUNTIME=dev umi dev",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@babel/plugin-transform-strict-mode": "^7.18.6",
|
|
82
82
|
"@babel/polyfill": "^7.12.1",
|
|
83
83
|
"@babel/traverse": "^7.24.1",
|
|
84
|
-
"@luck-design-biz/base": "0.0.
|
|
84
|
+
"@luck-design-biz/base": "0.0.49",
|
|
85
85
|
"@luck-design-biz/bpm": "0.0.5",
|
|
86
86
|
"@luck-helper/ui-design": "0.0.6",
|
|
87
87
|
"@types/classnames": "^2.3.1",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"js-cookie": "^2.2.1",
|
|
127
127
|
"jsdom-global": "^3.0.2",
|
|
128
128
|
"lint-staged": "^11.2.6",
|
|
129
|
-
"luck-design": "0.1.
|
|
129
|
+
"luck-design": "0.1.80",
|
|
130
130
|
"monaco-editor-webpack-plugin": "6.*.*",
|
|
131
131
|
"node-fetch": "^2.6.7",
|
|
132
132
|
"nprogress": "^0.2.0",
|