@boteteam/utils 0.0.31 → 0.0.33
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/dist/cjs/file.js +4 -4
- package/dist/cjs/file.js.map +2 -2
- package/dist/cjs/formatModule/formatModuleData.d.ts +3 -1
- package/dist/cjs/formatModule/formatModuleData.js +102 -17
- package/dist/cjs/formatModule/formatModuleData.js.map +3 -3
- package/dist/cjs/formatModule/helpers/checkDataSourceOfFn.d.ts +2 -0
- package/dist/cjs/formatModule/helpers/checkDataSourceOfFn.js +33 -0
- package/dist/cjs/formatModule/helpers/checkDataSourceOfFn.js.map +7 -0
- package/dist/cjs/formatModule/helpers/cssToJson.d.ts +22 -0
- package/dist/cjs/formatModule/helpers/cssToJson.js +78 -0
- package/dist/cjs/formatModule/helpers/cssToJson.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatDataProps.d.ts +19 -0
- package/dist/cjs/formatModule/helpers/formatDataProps.js +65 -0
- package/dist/cjs/formatModule/helpers/formatDataProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatFormProps.js +7 -0
- package/dist/cjs/formatModule/helpers/formatFormProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatListProps.js +25 -9
- package/dist/cjs/formatModule/helpers/formatListProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatLoopProps.d.ts +1 -4
- package/dist/cjs/formatModule/helpers/formatLoopProps.js +20 -8
- package/dist/cjs/formatModule/helpers/formatLoopProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatStepsProps.js +49 -32
- package/dist/cjs/formatModule/helpers/formatStepsProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatStyleProps.d.ts +16 -3
- package/dist/cjs/formatModule/helpers/formatStyleProps.js +100 -37
- package/dist/cjs/formatModule/helpers/formatStyleProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatTableProps.d.ts +7 -1
- package/dist/cjs/formatModule/helpers/formatTableProps.js +46 -11
- package/dist/cjs/formatModule/helpers/formatTableProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatTabsProps.d.ts +15 -0
- package/dist/cjs/formatModule/helpers/formatTabsProps.js +49 -0
- package/dist/cjs/formatModule/helpers/formatTabsProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatVideoProps.d.ts +12 -0
- package/dist/cjs/formatModule/helpers/formatVideoProps.js +45 -0
- package/dist/cjs/formatModule/helpers/formatVideoProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/index.d.ts +6 -1
- package/dist/cjs/formatModule/helpers/index.js +15 -0
- package/dist/cjs/formatModule/helpers/index.js.map +3 -3
- package/dist/cjs/formatModule/helpers/stringScriptExecution.js +1 -1
- package/dist/cjs/formatModule/helpers/stringScriptExecution.js.map +1 -1
- package/dist/cjs/http.d.ts +17 -0
- package/dist/cjs/http.js +123 -1
- package/dist/cjs/http.js.map +2 -2
- package/dist/cjs/index.d.ts +5 -4
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/treeUtils.d.ts +31 -3
- package/dist/cjs/treeUtils.js +53 -10
- package/dist/cjs/treeUtils.js.map +3 -3
- package/dist/cjs/watermark.d.ts +80 -0
- package/dist/cjs/watermark.js +350 -0
- package/dist/cjs/watermark.js.map +7 -0
- package/dist/esm/file.js +5 -4
- package/dist/esm/file.js.map +1 -1
- package/dist/esm/formatModule/formatModuleData.d.ts +3 -1
- package/dist/esm/formatModule/formatModuleData.js +121 -40
- package/dist/esm/formatModule/formatModuleData.js.map +1 -1
- package/dist/esm/formatModule/helpers/checkDataSourceOfFn.d.ts +2 -0
- package/dist/esm/formatModule/helpers/checkDataSourceOfFn.js +9 -0
- package/dist/esm/formatModule/helpers/checkDataSourceOfFn.js.map +1 -0
- package/dist/esm/formatModule/helpers/cssToJson.d.ts +22 -0
- package/dist/esm/formatModule/helpers/cssToJson.js +103 -0
- package/dist/esm/formatModule/helpers/cssToJson.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatDataProps.d.ts +19 -0
- package/dist/esm/formatModule/helpers/formatDataProps.js +26 -0
- package/dist/esm/formatModule/helpers/formatDataProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatFormProps.js +6 -0
- package/dist/esm/formatModule/helpers/formatFormProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatListProps.js +26 -9
- package/dist/esm/formatModule/helpers/formatListProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatLoopProps.d.ts +1 -4
- package/dist/esm/formatModule/helpers/formatLoopProps.js +13 -12
- package/dist/esm/formatModule/helpers/formatLoopProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatStepsProps.js +38 -31
- package/dist/esm/formatModule/helpers/formatStepsProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatStyleProps.d.ts +16 -3
- package/dist/esm/formatModule/helpers/formatStyleProps.js +90 -43
- package/dist/esm/formatModule/helpers/formatStyleProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatTableProps.d.ts +7 -1
- package/dist/esm/formatModule/helpers/formatTableProps.js +57 -8
- package/dist/esm/formatModule/helpers/formatTableProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatTabsProps.d.ts +15 -0
- package/dist/esm/formatModule/helpers/formatTabsProps.js +46 -0
- package/dist/esm/formatModule/helpers/formatTabsProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatVideoProps.d.ts +12 -0
- package/dist/esm/formatModule/helpers/formatVideoProps.js +31 -0
- package/dist/esm/formatModule/helpers/formatVideoProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/index.d.ts +6 -1
- package/dist/esm/formatModule/helpers/index.js +6 -1
- package/dist/esm/formatModule/helpers/index.js.map +1 -1
- package/dist/esm/formatModule/helpers/stringScriptExecution.js +1 -1
- package/dist/esm/formatModule/helpers/stringScriptExecution.js.map +1 -1
- package/dist/esm/http.d.ts +17 -0
- package/dist/esm/http.js +208 -43
- package/dist/esm/http.js.map +1 -1
- package/dist/esm/index.d.ts +5 -4
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/treeUtils.d.ts +31 -3
- package/dist/esm/treeUtils.js +118 -15
- package/dist/esm/treeUtils.js.map +1 -1
- package/dist/esm/watermark.d.ts +80 -0
- package/dist/esm/watermark.js +487 -0
- package/dist/esm/watermark.js.map +1 -0
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { contralBtnProps } from '@boteteam/types';
|
|
2
2
|
export type formatTablePropsType = {
|
|
3
3
|
options?: {
|
|
4
|
+
columnsSource?: 'staticColumns' | 'paramsColumns';
|
|
4
5
|
attrs?: {
|
|
5
6
|
[key: string]: any;
|
|
6
7
|
}[];
|
|
@@ -13,10 +14,14 @@ export type formatTablePropsType = {
|
|
|
13
14
|
columnMaxWidth?: string;
|
|
14
15
|
tableBodyHeight?: string;
|
|
15
16
|
controlBtns?: contralBtnProps[];
|
|
17
|
+
hasEdit?: boolean;
|
|
16
18
|
};
|
|
17
19
|
staticCodeMap?: {
|
|
18
20
|
[key: string]: any;
|
|
19
21
|
};
|
|
22
|
+
staticOptionsMap?: {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
20
25
|
parameters?: {
|
|
21
26
|
[key: string]: any;
|
|
22
27
|
};
|
|
@@ -35,6 +40,7 @@ export type formatTablePropsExportType = {
|
|
|
35
40
|
controlBtns?: {
|
|
36
41
|
[key: string]: any;
|
|
37
42
|
}[];
|
|
43
|
+
hasEdit?: boolean;
|
|
38
44
|
};
|
|
39
|
-
declare const formatTableProps: ({ staticCodeMap, parameters, options, }: formatTablePropsType) => formatTablePropsExportType;
|
|
45
|
+
declare const formatTableProps: ({ staticCodeMap, staticOptionsMap, parameters, options, }: formatTablePropsType) => formatTablePropsExportType;
|
|
40
46
|
export default formatTableProps;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -9,8 +15,11 @@ import { stringScriptExecution } from "./stringScriptExecution";
|
|
|
9
15
|
// import stringPramarsValTransition from './stringPramarsValTransition';
|
|
10
16
|
import { get } from 'lodash';
|
|
11
17
|
import formatControlBtn from "./formatControlBtn";
|
|
18
|
+
import checkDataSourceOfFn from "./checkDataSourceOfFn";
|
|
12
19
|
var formatTableProps = function formatTableProps(_ref) {
|
|
13
20
|
var staticCodeMap = _ref.staticCodeMap,
|
|
21
|
+
_ref$staticOptionsMap = _ref.staticOptionsMap,
|
|
22
|
+
staticOptionsMap = _ref$staticOptionsMap === void 0 ? {} : _ref$staticOptionsMap,
|
|
14
23
|
parameters = _ref.parameters,
|
|
15
24
|
_ref$options = _ref.options,
|
|
16
25
|
options = _ref$options === void 0 ? {} : _ref$options;
|
|
@@ -21,12 +30,24 @@ var formatTableProps = function formatTableProps(_ref) {
|
|
|
21
30
|
columnWidth = options.columnWidth,
|
|
22
31
|
columnMinWidth = options.columnMinWidth,
|
|
23
32
|
columnMaxWidth = options.columnMaxWidth,
|
|
24
|
-
tableBodyHeight = options.tableBodyHeight
|
|
33
|
+
tableBodyHeight = options.tableBodyHeight,
|
|
34
|
+
columnsSource = options.columnsSource,
|
|
35
|
+
hasEdit = options.hasEdit;
|
|
25
36
|
var _columns = [];
|
|
26
37
|
var dataList = [];
|
|
27
38
|
var controlBtnsList = [];
|
|
28
39
|
var scroll = {};
|
|
29
|
-
|
|
40
|
+
var _columnsSource = columnsSource;
|
|
41
|
+
|
|
42
|
+
// 如果未配置表头数据源,则根据列数据源配置判断
|
|
43
|
+
if (!columnsSource) {
|
|
44
|
+
if (typeof columns === 'string' && columns) {
|
|
45
|
+
_columnsSource = 'paramsColumns';
|
|
46
|
+
} else {
|
|
47
|
+
_columnsSource = 'staticColumns';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (_columnsSource === 'paramsColumns' && typeof columns === 'string' && columns) {
|
|
30
51
|
var columnsArr = getDataArr(columns);
|
|
31
52
|
var columnsList = get(parameters, columnsArr);
|
|
32
53
|
if (Array.isArray(columnsList)) {
|
|
@@ -57,7 +78,7 @@ var formatTableProps = function formatTableProps(_ref) {
|
|
|
57
78
|
_columns.push(colObj);
|
|
58
79
|
});
|
|
59
80
|
}
|
|
60
|
-
} else if (Array.isArray(attrs) && attrs.length > 0) {
|
|
81
|
+
} else if (_columnsSource === 'staticColumns' && Array.isArray(attrs) && attrs.length > 0) {
|
|
61
82
|
attrs.forEach(function (attrItem) {
|
|
62
83
|
var attrsDisplay = true;
|
|
63
84
|
if (typeof (attrItem === null || attrItem === void 0 ? void 0 : attrItem.display) === 'boolean' || typeof (attrItem === null || attrItem === void 0 ? void 0 : attrItem.display) === 'string') {
|
|
@@ -98,6 +119,7 @@ var formatTableProps = function formatTableProps(_ref) {
|
|
|
98
119
|
var dataIndexArr = getDataArr(attrItem === null || attrItem === void 0 ? void 0 : attrItem.defaultValue);
|
|
99
120
|
if (Array.isArray(dataIndexArr) && dataIndexArr.length > 0) {
|
|
100
121
|
var _dataIndexArr$slice;
|
|
122
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
101
123
|
colObj.dataIndex = (_dataIndexArr$slice = dataIndexArr.slice(-1)) === null || _dataIndexArr$slice === void 0 ? void 0 : _dataIndexArr$slice[0];
|
|
102
124
|
}
|
|
103
125
|
if (attrItem !== null && attrItem !== void 0 && attrItem.staticCode && staticCodeMap !== null && staticCodeMap !== void 0 && staticCodeMap[attrItem === null || attrItem === void 0 ? void 0 : attrItem.staticCode]) {
|
|
@@ -106,16 +128,42 @@ var formatTableProps = function formatTableProps(_ref) {
|
|
|
106
128
|
return (staticCodeMap === null || staticCodeMap === void 0 || (_staticCodeMap$attrIt = staticCodeMap[attrItem === null || attrItem === void 0 ? void 0 : attrItem.staticCode]) === null || _staticCodeMap$attrIt === void 0 ? void 0 : _staticCodeMap$attrIt[val]) || val;
|
|
107
129
|
};
|
|
108
130
|
}
|
|
131
|
+
// 如果是可编辑模式下,添加编辑相关属性
|
|
132
|
+
if (hasEdit && attrItem !== null && attrItem !== void 0 && attrItem.canEdit) {
|
|
133
|
+
var rules = [];
|
|
134
|
+
colObj.type = (attrItem === null || attrItem === void 0 ? void 0 : attrItem.componentType) || 'input';
|
|
135
|
+
colObj.canEdit = true;
|
|
136
|
+
colObj.componentProps = _objectSpread({}, (attrItem === null || attrItem === void 0 ? void 0 : attrItem.componentProps) || {});
|
|
137
|
+
if (attrItem !== null && attrItem !== void 0 && attrItem.required) {
|
|
138
|
+
rules.push({
|
|
139
|
+
required: true,
|
|
140
|
+
message: "".concat(attrItem === null || attrItem === void 0 ? void 0 : attrItem.attrName, "\u4E0D\u80FD\u4E3A\u7A7A")
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (Array.isArray(attrItem === null || attrItem === void 0 ? void 0 : attrItem.rules) && (attrItem === null || attrItem === void 0 ? void 0 : attrItem.rules.length) > 0) {
|
|
144
|
+
rules.concat.apply(rules, _toConsumableArray(attrItem === null || attrItem === void 0 ? void 0 : attrItem.rules));
|
|
145
|
+
}
|
|
146
|
+
if (attrItem !== null && attrItem !== void 0 && attrItem.staticCode) {
|
|
147
|
+
colObj.componentProps.options = (staticOptionsMap === null || staticOptionsMap === void 0 ? void 0 : staticOptionsMap[attrItem === null || attrItem === void 0 ? void 0 : attrItem.staticCode]) || [];
|
|
148
|
+
}
|
|
149
|
+
colObj.formProps = {
|
|
150
|
+
rules: rules
|
|
151
|
+
};
|
|
152
|
+
}
|
|
109
153
|
_columns.push(colObj);
|
|
110
154
|
}
|
|
111
155
|
});
|
|
112
156
|
}
|
|
113
157
|
if (dataSource) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
158
|
+
if (checkDataSourceOfFn(dataSource)) {
|
|
159
|
+
dataList = stringScriptExecution(dataSource) || [];
|
|
160
|
+
} else {
|
|
161
|
+
var dataSourceArr = getDataArr(dataSource);
|
|
162
|
+
if (parameters) {
|
|
163
|
+
var dataSourceList = get(parameters, dataSourceArr);
|
|
164
|
+
if (Array.isArray(dataSourceList)) {
|
|
165
|
+
dataList = dataSourceList;
|
|
166
|
+
}
|
|
119
167
|
}
|
|
120
168
|
}
|
|
121
169
|
}
|
|
@@ -136,6 +184,7 @@ var formatTableProps = function formatTableProps(_ref) {
|
|
|
136
184
|
columns: _columns,
|
|
137
185
|
dataSource: dataList,
|
|
138
186
|
controlBtns: controlBtnsList,
|
|
187
|
+
hasEdit: hasEdit,
|
|
139
188
|
scroll: scroll
|
|
140
189
|
};
|
|
141
190
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDataArr","stringScriptExecution","get","formatControlBtn","formatTableProps","_ref","staticCodeMap","parameters","_ref$options","options","attrs","dataSource","controlBtns","columns","columnWidth","columnMinWidth","columnMaxWidth","tableBodyHeight","_columns","dataList","controlBtnsList","scroll","columnsArr","columnsList","Array","isArray","forEach","colItem","colObj","key","dataIndex","title","colWidth","width","colMinWidth","minWidth","colMaxWidth","maxWidth","style","_objectSpread","push","length","attrItem","attrsDisplay","display","codeExtendVal","attrCode","attrName","attrWidth","attrMinWidth","attrMaxWidth","dataIndexArr","defaultValue","_dataIndexArr$slice","slice","staticCode","render","val","_staticCodeMap$attrIt","dataSourceArr","dataSourceList","y","map","btn","btnProps"],"sources":["../../../../src/formatModule/helpers/formatTableProps.ts"],"sourcesContent":["import { getDataArr } from '../../treeUtils';\nimport { stringScriptExecution } from './stringScriptExecution';\n// import stringPramarsValTransition from './stringPramarsValTransition';\nimport { get } from 'lodash';\nimport { contralBtnProps } from '@boteteam/types';\nimport formatControlBtn from './formatControlBtn';\n\nexport type formatTablePropsType = {\n options?: {\n attrs?: {[key:string]: any}[];\n columns?: {[key: string]: any}[];\n dataSource?: string;\n columnWidth?: string;\n columnMinWidth?: string;\n columnMaxWidth?: string;\n tableBodyHeight?: string;\n controlBtns?: contralBtnProps[];\n }\n staticCodeMap?: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nexport type formatTablePropsExportType = {\n columns: {[key: string]: any}[]\n dataSource: {[key: string]: any}[]\n scroll?: { y?: string, x?: string };\n controlBtns?: {[key: string]: any}[];\n}\n\nconst formatTableProps = ({\n staticCodeMap,\n parameters,\n options = {},\n}: formatTablePropsType): formatTablePropsExportType => {\n const {\n attrs,\n dataSource,\n controlBtns,\n columns,\n columnWidth,\n columnMinWidth,\n columnMaxWidth,\n tableBodyHeight,\n } = options;\n const _columns: {[key: string]: any}[] = [];\n let dataList: {[key: string]: any}[] = [];\n let controlBtnsList: {[key: string]: any}[] = [];\n let scroll: { y?: string, x?: string } = {};\n\n if (typeof columns === 'string' && columns) {\n const columnsArr = getDataArr(columns);\n const columnsList = get(\n parameters,\n columnsArr,\n );\n if (Array.isArray(columnsList)) {\n columnsList.forEach((colItem) => {\n const colObj: { [key: string]: any } = {\n key: colItem?.dataIndex,\n title: colItem?.title,\n dataIndex: colItem?.dataIndex,\n };\n const colWidth = colItem?.width || columnWidth;\n const colMinWidth = colItem?.minWidth || columnMinWidth;\n const colMaxWidth = colItem?.maxWidth || columnMaxWidth;\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n _columns.push(colObj);\n });\n }\n } else if (Array.isArray(attrs) && attrs.length > 0) {\n attrs.forEach((attrItem) => {\n let attrsDisplay: boolean = true;\n if (typeof attrItem?.display === 'boolean' || typeof attrItem?.display === 'string') {\n if (typeof attrItem?.display === 'boolean') {\n attrsDisplay = attrItem?.display;\n } else if (typeof attrItem?.display === 'string' && attrItem?.display) {\n // const scriptCodeStr = stringPramarsValTransition(attrItem?.display, parameters || {});\n const codeExtendVal = stringScriptExecution(\n attrItem?.display,\n parameters || {},\n );\n attrsDisplay = codeExtendVal;\n }\n }\n\n if (attrsDisplay) {\n const colObj: { [key: string]: any } = {\n key: attrItem?.attrCode,\n title: attrItem?.attrName,\n };\n const colWidth = attrItem?.attrWidth || columnWidth;\n const colMinWidth = attrItem?.attrMinWidth || columnMinWidth;\n const colMaxWidth = attrItem?.attrMaxWidth || columnMaxWidth;\n if (typeof attrItem?.attrWidth === 'string') {\n colObj.width = attrItem?.attrWidth;\n }\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n const dataIndexArr = getDataArr(attrItem?.defaultValue);\n if (Array.isArray(dataIndexArr) && dataIndexArr.length > 0) {\n colObj.dataIndex = dataIndexArr.slice(-1)?.[0];\n }\n if (\n attrItem?.staticCode &&\n staticCodeMap?.[attrItem?.staticCode]\n ) {\n colObj.render = (val: string) => {\n return staticCodeMap?.[attrItem?.staticCode]?.[val] || val;\n };\n }\n _columns.push(colObj);\n }\n });\n }\n if (dataSource) {\n const dataSourceArr = getDataArr(dataSource);\n if (parameters) {\n const dataSourceList = get(\n parameters,\n dataSourceArr,\n );\n if (Array.isArray(dataSourceList)) {\n dataList = dataSourceList;\n }\n }\n }\n if (typeof tableBodyHeight === 'string' && tableBodyHeight) {\n scroll = {\n y: tableBodyHeight,\n };\n }\n if (Array.isArray(controlBtns) && controlBtns.length > 0) {\n controlBtnsList = controlBtns.map(btn => formatControlBtn({\n btnProps: btn,\n parameters,\n }));\n }\n return {\n columns: _columns,\n dataSource: dataList,\n controlBtns: controlBtnsList,\n scroll,\n };\n};\n\nexport default formatTableProps;\n"],"mappings":";;;;;;AAAA,SAASA,UAAU;AACnB,SAASC,qBAAqB;AAC9B;AACA,SAASC,GAAG,QAAQ,QAAQ;AAE5B,OAAOC,gBAAgB;AAwBvB,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAIkC;EAAA,IAHtDC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAAC,YAAA,GAAAH,IAAA,CACVI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;EAEZ,IACEE,KAAK,GAQHD,OAAO,CARTC,KAAK;IACLC,UAAU,GAORF,OAAO,CAPTE,UAAU;IACVC,WAAW,GAMTH,OAAO,CANTG,WAAW;IACXC,OAAO,GAKLJ,OAAO,CALTI,OAAO;IACPC,WAAW,GAITL,OAAO,CAJTK,WAAW;IACXC,cAAc,GAGZN,OAAO,CAHTM,cAAc;IACdC,cAAc,GAEZP,OAAO,CAFTO,cAAc;IACdC,eAAe,GACbR,OAAO,CADTQ,eAAe;EAEjB,IAAMC,QAAgC,GAAG,EAAE;EAC3C,IAAIC,QAAgC,GAAG,EAAE;EACzC,IAAIC,eAAuC,GAAG,EAAE;EAChD,IAAIC,MAAkC,GAAG,CAAC,CAAC;EAE3C,IAAI,OAAOR,OAAO,KAAK,QAAQ,IAAIA,OAAO,EAAE;IAC1C,IAAMS,UAAU,GAAGtB,UAAU,CAACa,OAAO,CAAC;IACtC,IAAMU,WAAW,GAAGrB,GAAG,CACrBK,UAAU,EACVe,UACF,CAAC;IACD,IAAIE,KAAK,CAACC,OAAO,CAACF,WAAW,CAAC,EAAE;MAC9BA,WAAW,CAACG,OAAO,CAAC,UAACC,OAAO,EAAK;QAC/B,IAAMC,MAA8B,GAAG;UACrCC,GAAG,EAAE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,CAAEa,UAAU,CAAC,cAAAG,qBAAA,uBAArCA,qBAAA,CAAwCD,GAAG,CAAC,KAAIA,GAAG;UAC5D,CAAC;QACH;QACAvC,QAAQ,CAACsB,IAAI,CAACZ,MAAM,CAAC;MACvB;IACF,CAAC,CAAC;EACJ;EACA,IAAIjB,UAAU,EAAE;IACd,IAAMgD,aAAa,GAAG3D,UAAU,CAACW,UAAU,CAAC;IAC5C,IAAIJ,UAAU,EAAE;MACd,IAAMqD,cAAc,GAAG1D,GAAG,CACxBK,UAAU,EACVoD,aACF,CAAC;MACD,IAAInC,KAAK,CAACC,OAAO,CAACmC,cAAc,CAAC,EAAE;QACjCzC,QAAQ,GAAGyC,cAAc;MAC3B;IACF;EACF;EACA,IAAI,OAAO3C,eAAe,KAAK,QAAQ,IAAIA,eAAe,EAAE;IAC1DI,MAAM,GAAG;MACPwC,CAAC,EAAE5C;IACL,CAAC;EACH;EACA,IAAIO,KAAK,CAACC,OAAO,CAACb,WAAW,CAAC,IAAIA,WAAW,CAAC6B,MAAM,GAAG,CAAC,EAAE;IACxDrB,eAAe,GAAGR,WAAW,CAACkD,GAAG,CAAC,UAAAC,GAAG;MAAA,OAAI5D,gBAAgB,CAAC;QACxD6D,QAAQ,EAAED,GAAG;QACbxD,UAAU,EAAVA;MACF,CAAC,CAAC;IAAA,EAAC;EACL;EACA,OAAO;IACLM,OAAO,EAAEK,QAAQ;IACjBP,UAAU,EAAEQ,QAAQ;IACpBP,WAAW,EAAEQ,eAAe;IAC5BC,MAAM,EAANA;EACF,CAAC;AACH,CAAC;AAED,eAAejB,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["getDataArr","stringScriptExecution","get","formatControlBtn","checkDataSourceOfFn","formatTableProps","_ref","staticCodeMap","_ref$staticOptionsMap","staticOptionsMap","parameters","_ref$options","options","attrs","dataSource","controlBtns","columns","columnWidth","columnMinWidth","columnMaxWidth","tableBodyHeight","columnsSource","hasEdit","_columns","dataList","controlBtnsList","scroll","_columnsSource","columnsArr","columnsList","Array","isArray","forEach","colItem","colObj","key","dataIndex","title","colWidth","width","colMinWidth","minWidth","colMaxWidth","maxWidth","style","_objectSpread","push","length","attrItem","attrsDisplay","display","codeExtendVal","attrCode","attrName","attrWidth","attrMinWidth","attrMaxWidth","dataIndexArr","defaultValue","_dataIndexArr$slice","slice","staticCode","render","val","_staticCodeMap$attrIt","canEdit","rules","type","componentType","componentProps","required","message","concat","apply","_toConsumableArray","formProps","dataSourceArr","dataSourceList","y","map","btn","btnProps"],"sources":["../../../../src/formatModule/helpers/formatTableProps.ts"],"sourcesContent":["import { getDataArr } from '../../treeUtils';\nimport { stringScriptExecution } from './stringScriptExecution';\n// import stringPramarsValTransition from './stringPramarsValTransition';\nimport { get } from 'lodash';\nimport { contralBtnProps } from '@boteteam/types';\nimport formatControlBtn from './formatControlBtn';\nimport checkDataSourceOfFn from './checkDataSourceOfFn';\n\nexport type formatTablePropsType = {\n options?: {\n columnsSource?: 'staticColumns' | 'paramsColumns';\n attrs?: {[key:string]: any}[];\n columns?: {[key: string]: any}[];\n dataSource?: string;\n columnWidth?: string;\n columnMinWidth?: string;\n columnMaxWidth?: string;\n tableBodyHeight?: string;\n controlBtns?: contralBtnProps[];\n hasEdit?: boolean;\n }\n staticCodeMap?: {[key:string]: any};\n staticOptionsMap?: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nexport type formatTablePropsExportType = {\n columns: {[key: string]: any}[]\n dataSource: {[key: string]: any}[]\n scroll?: { y?: string, x?: string };\n controlBtns?: {[key: string]: any}[];\n hasEdit?: boolean;\n}\n\nconst formatTableProps = ({\n staticCodeMap,\n staticOptionsMap = {},\n parameters,\n options = {},\n}: formatTablePropsType): formatTablePropsExportType => {\n const {\n attrs,\n dataSource,\n controlBtns,\n columns,\n columnWidth,\n columnMinWidth,\n columnMaxWidth,\n tableBodyHeight,\n columnsSource,\n hasEdit,\n } = options;\n const _columns: {[key: string]: any}[] = [];\n let dataList: {[key: string]: any}[] = [];\n let controlBtnsList: {[key: string]: any}[] = [];\n let scroll: { y?: string, x?: string } = {};\n let _columnsSource = columnsSource;\n\n // 如果未配置表头数据源,则根据列数据源配置判断\n if (!columnsSource) {\n if (typeof columns === 'string' && columns) {\n _columnsSource = 'paramsColumns';\n } else {\n _columnsSource = 'staticColumns';\n }\n }\n if (_columnsSource === 'paramsColumns' && typeof columns === 'string' && columns) {\n const columnsArr = getDataArr(columns);\n const columnsList = get(\n parameters,\n columnsArr,\n );\n if (Array.isArray(columnsList)) {\n columnsList.forEach((colItem) => {\n const colObj: { [key: string]: any } = {\n key: colItem?.dataIndex,\n title: colItem?.title,\n dataIndex: colItem?.dataIndex,\n };\n const colWidth = colItem?.width || columnWidth;\n const colMinWidth = colItem?.minWidth || columnMinWidth;\n const colMaxWidth = colItem?.maxWidth || columnMaxWidth;\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n _columns.push(colObj);\n });\n }\n } else if (_columnsSource === 'staticColumns' && Array.isArray(attrs) && attrs.length > 0) {\n attrs.forEach((attrItem) => {\n let attrsDisplay: boolean = true;\n if (typeof attrItem?.display === 'boolean' || typeof attrItem?.display === 'string') {\n if (typeof attrItem?.display === 'boolean') {\n attrsDisplay = attrItem?.display;\n } else if (typeof attrItem?.display === 'string' && attrItem?.display) {\n // const scriptCodeStr = stringPramarsValTransition(attrItem?.display, parameters || {});\n const codeExtendVal = stringScriptExecution(\n attrItem?.display,\n parameters || {},\n );\n attrsDisplay = codeExtendVal;\n }\n }\n\n if (attrsDisplay) {\n const colObj: { [key: string]: any } = {\n key: attrItem?.attrCode,\n title: attrItem?.attrName,\n };\n const colWidth = attrItem?.attrWidth || columnWidth;\n const colMinWidth = attrItem?.attrMinWidth || columnMinWidth;\n const colMaxWidth = attrItem?.attrMaxWidth || columnMaxWidth;\n if (typeof attrItem?.attrWidth === 'string') {\n colObj.width = attrItem?.attrWidth;\n }\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n const dataIndexArr = getDataArr(attrItem?.defaultValue);\n if (Array.isArray(dataIndexArr) && dataIndexArr.length > 0) {\n // eslint-disable-next-line no-template-curly-in-string\n colObj.dataIndex = dataIndexArr.slice(-1)?.[0];\n }\n if (\n attrItem?.staticCode &&\n staticCodeMap?.[attrItem?.staticCode]\n ) {\n colObj.render = (val: string) => {\n return staticCodeMap?.[attrItem?.staticCode]?.[val] || val;\n };\n }\n // 如果是可编辑模式下,添加编辑相关属性\n if (hasEdit && attrItem?.canEdit) {\n const rules = [];\n colObj.type = attrItem?.componentType || 'input';\n colObj.canEdit = true;\n colObj.componentProps = { ...(attrItem?.componentProps || {}) };\n if (attrItem?.required) {\n rules.push({ required: true, message: `${attrItem?.attrName}不能为空` });\n }\n if (Array.isArray(attrItem?.rules) && attrItem?.rules.length > 0) {\n rules.concat(...attrItem?.rules);\n }\n if (attrItem?.staticCode) {\n colObj.componentProps.options = staticOptionsMap?.[attrItem?.staticCode] || [];\n }\n colObj.formProps = {\n rules,\n };\n }\n _columns.push(colObj);\n }\n });\n }\n if (dataSource) {\n if (checkDataSourceOfFn(dataSource)) {\n dataList = stringScriptExecution(dataSource) || [];\n } else {\n const dataSourceArr = getDataArr(dataSource);\n if (parameters) {\n const dataSourceList = get(\n parameters,\n dataSourceArr,\n );\n if (Array.isArray(dataSourceList)) {\n dataList = dataSourceList;\n }\n }\n }\n }\n if (typeof tableBodyHeight === 'string' && tableBodyHeight) {\n scroll = {\n y: tableBodyHeight,\n };\n }\n if (Array.isArray(controlBtns) && controlBtns.length > 0) {\n controlBtnsList = controlBtns.map(btn => formatControlBtn({\n btnProps: btn,\n parameters,\n }));\n }\n\n return {\n columns: _columns,\n dataSource: dataList,\n controlBtns: controlBtnsList,\n hasEdit,\n scroll,\n };\n};\n\nexport default formatTableProps;\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,UAAU;AACnB,SAASC,qBAAqB;AAC9B;AACA,SAASC,GAAG,QAAQ,QAAQ;AAE5B,OAAOC,gBAAgB;AACvB,OAAOC,mBAAmB;AA4B1B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKkC;EAAA,IAJtDC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAAC,qBAAA,GAAAF,IAAA,CACbG,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,CAAC,CAAC,GAAAA,qBAAA;IACrBE,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAAC,YAAA,GAAAL,IAAA,CACVM,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;EAEZ,IACEE,KAAK,GAUHD,OAAO,CAVTC,KAAK;IACLC,UAAU,GASRF,OAAO,CATTE,UAAU;IACVC,WAAW,GAQTH,OAAO,CARTG,WAAW;IACXC,OAAO,GAOLJ,OAAO,CAPTI,OAAO;IACPC,WAAW,GAMTL,OAAO,CANTK,WAAW;IACXC,cAAc,GAKZN,OAAO,CALTM,cAAc;IACdC,cAAc,GAIZP,OAAO,CAJTO,cAAc;IACdC,eAAe,GAGbR,OAAO,CAHTQ,eAAe;IACfC,aAAa,GAEXT,OAAO,CAFTS,aAAa;IACbC,OAAO,GACLV,OAAO,CADTU,OAAO;EAET,IAAMC,QAAgC,GAAG,EAAE;EAC3C,IAAIC,QAAgC,GAAG,EAAE;EACzC,IAAIC,eAAuC,GAAG,EAAE;EAChD,IAAIC,MAAkC,GAAG,CAAC,CAAC;EAC3C,IAAIC,cAAc,GAAGN,aAAa;;EAElC;EACA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AM,GAAG;MACPoD,CAAC,EAAE1D;IACL,CAAC;EACH;EACA,IAAIU,KAAK,CAACC,OAAO,CAAChB,WAAW,CAAC,IAAIA,WAAW,CAACgC,MAAM,GAAG,CAAC,EAAE;IACxDtB,eAAe,GAAGV,WAAW,CAACgE,GAAG,CAAC,UAAAC,GAAG;MAAA,OAAI7E,gBAAgB,CAAC;QACxD8E,QAAQ,EAAED,GAAG;QACbtE,UAAU,EAAVA;MACF,CAAC,CAAC;IAAA,EAAC;EACL;EAEA,OAAO;IACLM,OAAO,EAAEO,QAAQ;IACjBT,UAAU,EAAEU,QAAQ;IACpBT,WAAW,EAAEU,eAAe;IAC5BH,OAAO,EAAPA,OAAO;IACPI,MAAM,EAANA;EACF,CAAC;AACH,CAAC;AAED,eAAerB,gBAAgB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type formatTabsPropsType = {
|
|
2
|
+
key: string;
|
|
3
|
+
compProps: {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
parameters?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const formatTabsProps: ({ key, compProps, parameters, }: formatTabsPropsType) => {
|
|
11
|
+
items: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
export default formatTabsProps;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["tabsItems", "renderChildren"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
var formatTabsProps = function formatTabsProps(_ref) {
|
|
11
|
+
var key = _ref.key,
|
|
12
|
+
compProps = _ref.compProps,
|
|
13
|
+
parameters = _ref.parameters;
|
|
14
|
+
var tabsItems = compProps.tabsItems,
|
|
15
|
+
renderChildren = compProps.renderChildren,
|
|
16
|
+
otherCompProps = _objectWithoutProperties(compProps, _excluded);
|
|
17
|
+
var items = [];
|
|
18
|
+
if (tabsItems) {
|
|
19
|
+
if (tabsItems.type === 'static' && Array.isArray(tabsItems.items) && tabsItems.items.length > 0) {
|
|
20
|
+
items = tabsItems.items.map(function (item, index) {
|
|
21
|
+
var itemKey = "".concat(key, "-tab").concat(index + 1);
|
|
22
|
+
return {
|
|
23
|
+
key: itemKey,
|
|
24
|
+
label: item.label
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// if (dataSource) {
|
|
30
|
+
// const dataSourceArr = getDataArr(dataSource);
|
|
31
|
+
// if (parameters) {
|
|
32
|
+
// const dataSourceList = get(
|
|
33
|
+
// parameters,
|
|
34
|
+
// dataSourceArr,
|
|
35
|
+
// );
|
|
36
|
+
// if (Array.isArray(dataSourceList)) {
|
|
37
|
+
// dataList = dataSourceList;
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
40
|
+
// }
|
|
41
|
+
return _objectSpread(_objectSpread({}, otherCompProps), {}, {
|
|
42
|
+
items: items
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export default formatTabsProps;
|
|
46
|
+
//# sourceMappingURL=formatTabsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["formatTabsProps","_ref","key","compProps","parameters","tabsItems","renderChildren","otherCompProps","_objectWithoutProperties","_excluded","items","type","Array","isArray","length","map","item","index","itemKey","concat","label","_objectSpread"],"sources":["../../../../src/formatModule/helpers/formatTabsProps.ts"],"sourcesContent":["\nexport type formatTabsPropsType = {\n key: string;\n compProps: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nconst formatTabsProps = ({\n key,\n compProps,\n parameters,\n}: formatTabsPropsType) => {\n const { tabsItems, renderChildren, ...otherCompProps } = compProps;\n let items:{[key:string]: any}[] = [];\n if (tabsItems) {\n if (\n tabsItems.type === 'static' &&\n Array.isArray(tabsItems.items) && tabsItems.items.length > 0\n ) {\n items = tabsItems.items.map((item:{[key:string]: any}, index:number) => {\n const itemKey = `${key}-tab${index + 1}`;\n return {\n key: itemKey,\n label: item.label,\n };\n });\n }\n }\n // if (dataSource) {\n // const dataSourceArr = getDataArr(dataSource);\n // if (parameters) {\n // const dataSourceList = get(\n // parameters,\n // dataSourceArr,\n // );\n // if (Array.isArray(dataSourceList)) {\n // dataList = dataSourceList;\n // }\n // }\n // }\n return {\n ...otherCompProps,\n items,\n };\n};\n\nexport default formatTabsProps;\n"],"mappings":";;;;;;;;;AAOA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAIM;EAAA,IAHzBC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,UAAU,GAAAH,IAAA,CAAVG,UAAU;EAEV,IAAQC,SAAS,GAAwCF,SAAS,CAA1DE,SAAS;IAAEC,cAAc,GAAwBH,SAAS,CAA/CG,cAAc;IAAKC,cAAc,GAAAC,wBAAA,CAAKL,SAAS,EAAAM,SAAA;EAClE,IAAIC,KAA2B,GAAG,EAAE;EACpC,IAAIL,SAAS,EAAE;IACb,IACEA,SAAS,CAACM,IAAI,KAAK,QAAQ,IAC3BC,KAAK,CAACC,OAAO,CAACR,SAAS,CAACK,KAAK,CAAC,IAAIL,SAAS,CAACK,KAAK,CAACI,MAAM,GAAG,CAAC,EAC5D;MACAJ,KAAK,GAAGL,SAAS,CAACK,KAAK,CAACK,GAAG,CAAC,UAACC,IAAwB,EAAEC,KAAY,EAAK;QACtE,IAAMC,OAAO,MAAAC,MAAA,CAAMjB,GAAG,UAAAiB,MAAA,CAAOF,KAAK,GAAG,CAAC,CAAE;QACxC,OAAO;UACLf,GAAG,EAAEgB,OAAO;UACZE,KAAK,EAAEJ,IAAI,CAACI;QACd,CAAC;MACH,CAAC,CAAC;IACJ;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAAC,aAAA,CAAAA,aAAA,KACKd,cAAc;IACjBG,KAAK,EAALA;EAAK;AAET,CAAC;AAED,eAAeV,eAAe"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type formatImagePropsType = {
|
|
2
|
+
options?: {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
parameters?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare const formatVideoProps: ({ parameters, options, }: formatImagePropsType) => {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export default formatVideoProps;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["dataSource"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { getParamsContentByParamKeys } from "../../treeUtils";
|
|
11
|
+
import { getFileUrlById } from "../../file";
|
|
12
|
+
var formatVideoProps = function formatVideoProps(_ref) {
|
|
13
|
+
var parameters = _ref.parameters,
|
|
14
|
+
_ref$options = _ref.options,
|
|
15
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
16
|
+
var dataSource = options.dataSource,
|
|
17
|
+
otherOptions = _objectWithoutProperties(options, _excluded);
|
|
18
|
+
var res = _objectSpread({}, otherOptions);
|
|
19
|
+
if ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.dataType) === 'staticData' && Array.isArray(dataSource === null || dataSource === void 0 ? void 0 : dataSource.fileList) && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.fileList.length) > 0) {
|
|
20
|
+
var _dataSource$fileList, _dataSource$fileList2;
|
|
21
|
+
res.src = getFileUrlById(dataSource === null || dataSource === void 0 || (_dataSource$fileList = dataSource.fileList) === null || _dataSource$fileList === void 0 || (_dataSource$fileList = _dataSource$fileList[0]) === null || _dataSource$fileList === void 0 ? void 0 : _dataSource$fileList.fileId);
|
|
22
|
+
res.alt = dataSource === null || dataSource === void 0 || (_dataSource$fileList2 = dataSource.fileList) === null || _dataSource$fileList2 === void 0 || (_dataSource$fileList2 = _dataSource$fileList2[0]) === null || _dataSource$fileList2 === void 0 ? void 0 : _dataSource$fileList2.fileName;
|
|
23
|
+
}
|
|
24
|
+
if ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.dataType) === 'context' && dataSource !== null && dataSource !== void 0 && dataSource.fileUrl) {
|
|
25
|
+
res.src = getParamsContentByParamKeys(dataSource === null || dataSource === void 0 ? void 0 : dataSource.fileUrl, parameters) || '';
|
|
26
|
+
res.alt = getParamsContentByParamKeys(dataSource === null || dataSource === void 0 ? void 0 : dataSource.fileDesc, parameters) || '';
|
|
27
|
+
}
|
|
28
|
+
return res;
|
|
29
|
+
};
|
|
30
|
+
export default formatVideoProps;
|
|
31
|
+
//# sourceMappingURL=formatVideoProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getParamsContentByParamKeys","getFileUrlById","formatVideoProps","_ref","parameters","_ref$options","options","dataSource","otherOptions","_objectWithoutProperties","_excluded","res","_objectSpread","dataType","Array","isArray","fileList","length","_dataSource$fileList","_dataSource$fileList2","src","fileId","alt","fileName","fileUrl","fileDesc"],"sources":["../../../../src/formatModule/helpers/formatVideoProps.ts"],"sourcesContent":["import { getParamsContentByParamKeys } from '../../treeUtils';\nimport { getFileUrlById } from '../../file';\n\nexport type formatImagePropsType = {\n options?: {[key:string]: any}\n parameters?: {[key:string]: any};\n}\n\nconst formatVideoProps = ({\n parameters,\n options = {},\n}: formatImagePropsType):{[key:string]: any} => {\n const { dataSource, ...otherOptions } = options;\n const res:{[key:string]: any} = { ...otherOptions };if (\n dataSource?.dataType === 'staticData' &&\n Array.isArray(dataSource?.fileList) &&\n dataSource?.fileList.length > 0\n ) {\n res.src = getFileUrlById(dataSource?.fileList?.[0]?.fileId);\n res.alt = dataSource?.fileList?.[0]?.fileName;\n }\n if (\n dataSource?.dataType === 'context' &&\n dataSource?.fileUrl\n ) {\n res.src = getParamsContentByParamKeys(dataSource?.fileUrl, parameters) || '';\n res.alt = getParamsContentByParamKeys(dataSource?.fileDesc, parameters) || '';\n }\n return res;\n};\n\nexport default formatVideoProps;\n"],"mappings":";;;;;;;;;AAAA,SAASA,2BAA2B;AACpC,SAASC,cAAc;AAOvB,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAG0B;EAAA,IAF9CC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IAAAC,YAAA,GAAAF,IAAA,CACVG,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;EAEZ,IAAQE,UAAU,GAAsBD,OAAO,CAAvCC,UAAU;IAAKC,YAAY,GAAAC,wBAAA,CAAKH,OAAO,EAAAI,SAAA;EAC/C,IAAMC,GAAuB,GAAAC,aAAA,KAAQJ,YAAY,CAAE;EAAC,IAClD,CAAAD,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEM,QAAQ,MAAK,YAAY,IACjCC,KAAK,CAACC,OAAO,CAACR,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAES,QAAQ,CAAC,IACnC,CAAAT,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAES,QAAQ,CAACC,MAAM,IAAG,CAAC,EACnC;IAAA,IAAAC,oBAAA,EAAAC,qBAAA;IACAR,GAAG,CAACS,GAAG,GAAGnB,cAAc,CAACM,UAAU,aAAVA,UAAU,gBAAAW,oBAAA,GAAVX,UAAU,CAAES,QAAQ,cAAAE,oBAAA,gBAAAA,oBAAA,GAApBA,oBAAA,CAAuB,CAAC,CAAC,cAAAA,oBAAA,uBAAzBA,oBAAA,CAA2BG,MAAM,CAAC;IAC3DV,GAAG,CAACW,GAAG,GAAGf,UAAU,aAAVA,UAAU,gBAAAY,qBAAA,GAAVZ,UAAU,CAAES,QAAQ,cAAAG,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAuB,CAAC,CAAC,cAAAA,qBAAA,uBAAzBA,qBAAA,CAA2BI,QAAQ;EAC/C;EACA,IACE,CAAAhB,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEM,QAAQ,MAAK,SAAS,IAClCN,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEiB,OAAO,EACnB;IACAb,GAAG,CAACS,GAAG,GAAGpB,2BAA2B,CAACO,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEiB,OAAO,EAAEpB,UAAU,CAAC,IAAI,EAAE;IAC5EO,GAAG,CAACW,GAAG,GAAGtB,2BAA2B,CAACO,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEkB,QAAQ,EAAErB,UAAU,CAAC,IAAI,EAAE;EAC/E;EACA,OAAOO,GAAG;AACZ,CAAC;AAED,eAAeT,gBAAgB"}
|
|
@@ -16,8 +16,13 @@ import formatLoopProps from './formatLoopProps';
|
|
|
16
16
|
import formatStyleProps from './formatStyleProps';
|
|
17
17
|
import formatStepsProps from './formatStepsProps';
|
|
18
18
|
import formatIconProps from './formatIconProps';
|
|
19
|
+
import formatVideoProps from './formatVideoProps';
|
|
19
20
|
import formatControlBtn from './formatControlBtn';
|
|
21
|
+
import formatTabsProps from './formatTabsProps';
|
|
20
22
|
import formRulsRegMap from './formRulsRegMap';
|
|
23
|
+
import formatDataProps from './formatDataProps';
|
|
24
|
+
import checkDataSourceOfFn from './checkDataSourceOfFn';
|
|
21
25
|
import urlPrefix from './urlPrefix';
|
|
22
26
|
import { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';
|
|
23
|
-
|
|
27
|
+
import cssToJson from './cssToJson';
|
|
28
|
+
export { urlPrefix, formRulsRegMap, formatTabsProps, formatPanelProps, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, formatIconProps, formatVideoProps, formatControlBtn, formatDataProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution, cssToJson, checkDataSourceOfFn, };
|
|
@@ -16,9 +16,14 @@ import formatLoopProps from "./formatLoopProps";
|
|
|
16
16
|
import formatStyleProps from "./formatStyleProps";
|
|
17
17
|
import formatStepsProps from "./formatStepsProps";
|
|
18
18
|
import formatIconProps from "./formatIconProps";
|
|
19
|
+
import formatVideoProps from "./formatVideoProps";
|
|
19
20
|
import formatControlBtn from "./formatControlBtn";
|
|
21
|
+
import formatTabsProps from "./formatTabsProps";
|
|
20
22
|
import formRulsRegMap from "./formRulsRegMap";
|
|
23
|
+
import formatDataProps from "./formatDataProps";
|
|
24
|
+
import checkDataSourceOfFn from "./checkDataSourceOfFn";
|
|
21
25
|
import urlPrefix from "./urlPrefix";
|
|
22
26
|
import { stringScriptExecution, createCompartmentExecution } from "./stringScriptExecution";
|
|
23
|
-
|
|
27
|
+
import cssToJson from "./cssToJson";
|
|
28
|
+
export { urlPrefix, formRulsRegMap, formatTabsProps, formatPanelProps, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, formatIconProps, formatVideoProps, formatControlBtn, formatDataProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution, cssToJson, checkDataSourceOfFn };
|
|
24
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stringPramarsValTransition","patternTransitionRegExp","staticCodeAssemble","formatPanelProps","formatTableProps","formatListProps","formatImageProps","formatCarouselProps","formatDescriptionsProps","formatHighCodeProps","formatFormProps","formatEchartLineProps","formatEchartPieProps","formatChartsProps","formatLoopProps","formatStyleProps","formatStepsProps","formatIconProps","formatControlBtn","formRulsRegMap","urlPrefix","stringScriptExecution","createCompartmentExecution"],"sources":["../../../../src/formatModule/helpers/index.ts"],"sourcesContent":["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\nimport formatPanelProps from './formatPanelProps';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formatImageProps from './formatImageProps';\nimport formatCarouselProps from './formatCarouselProps';\nimport formatDescriptionsProps from './formatDescriptionsProps';\nimport formatHighCodeProps from './formatHighCodeProps';\nimport formatFormProps from './formatFormProps';\nimport formatEchartLineProps from './formatEchartLineProps';\nimport formatEchartPieProps from './formatEchartPieProps';\nimport formatChartsProps from './formatChartsProps';\nimport formatLoopProps from './formatLoopProps';\nimport formatStyleProps from './formatStyleProps';\nimport formatStepsProps from './formatStepsProps';\nimport formatIconProps from './formatIconProps';\nimport formatControlBtn from './formatControlBtn';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';\n\nexport {\n urlPrefix,\n formRulsRegMap,\n formatPanelProps,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatDescriptionsProps,\n formatFormProps,\n formatHighCodeProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatChartsProps,\n formatLoopProps,\n formatStyleProps,\n formatStepsProps,\n formatIconProps,\n formatControlBtn,\n staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n createCompartmentExecution,\n};\n"],"mappings":"AAAA,OAAOA,0BAA0B;AACjC,OAAOC,uBAAuB;AAC9B,OAAOC,kBAAkB;AACzB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,mBAAmB;AAC1B,OAAOC,uBAAuB;AAC9B,OAAOC,mBAAmB;AAC1B,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,oBAAoB;AAC3B,OAAOC,iBAAiB;AACxB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,SAASC,qBAAqB,EAAEC,0BAA0B;
|
|
1
|
+
{"version":3,"names":["stringPramarsValTransition","patternTransitionRegExp","staticCodeAssemble","formatPanelProps","formatTableProps","formatListProps","formatImageProps","formatCarouselProps","formatDescriptionsProps","formatHighCodeProps","formatFormProps","formatEchartLineProps","formatEchartPieProps","formatChartsProps","formatLoopProps","formatStyleProps","formatStepsProps","formatIconProps","formatVideoProps","formatControlBtn","formatTabsProps","formRulsRegMap","formatDataProps","checkDataSourceOfFn","urlPrefix","stringScriptExecution","createCompartmentExecution","cssToJson"],"sources":["../../../../src/formatModule/helpers/index.ts"],"sourcesContent":["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\nimport formatPanelProps from './formatPanelProps';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formatImageProps from './formatImageProps';\nimport formatCarouselProps from './formatCarouselProps';\nimport formatDescriptionsProps from './formatDescriptionsProps';\nimport formatHighCodeProps from './formatHighCodeProps';\nimport formatFormProps from './formatFormProps';\nimport formatEchartLineProps from './formatEchartLineProps';\nimport formatEchartPieProps from './formatEchartPieProps';\nimport formatChartsProps from './formatChartsProps';\nimport formatLoopProps from './formatLoopProps';\nimport formatStyleProps from './formatStyleProps';\nimport formatStepsProps from './formatStepsProps';\nimport formatIconProps from './formatIconProps';\nimport formatVideoProps from './formatVideoProps';\nimport formatControlBtn from './formatControlBtn';\nimport formatTabsProps from './formatTabsProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport formatDataProps from './formatDataProps';\nimport checkDataSourceOfFn from './checkDataSourceOfFn';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';\nimport cssToJson from './cssToJson';\n\nexport {\n urlPrefix,\n formRulsRegMap,\n formatTabsProps,\n formatPanelProps,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatDescriptionsProps,\n formatFormProps,\n formatHighCodeProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatChartsProps,\n formatLoopProps,\n formatStyleProps,\n formatStepsProps,\n formatIconProps,\n formatVideoProps,\n formatControlBtn,\n formatDataProps,\n staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n createCompartmentExecution,\n cssToJson,\n checkDataSourceOfFn,\n};\n"],"mappings":"AAAA,OAAOA,0BAA0B;AACjC,OAAOC,uBAAuB;AAC9B,OAAOC,kBAAkB;AACzB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,mBAAmB;AAC1B,OAAOC,uBAAuB;AAC9B,OAAOC,mBAAmB;AAC1B,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,oBAAoB;AAC3B,OAAOC,iBAAiB;AACxB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,eAAe;AACtB,OAAOC,mBAAmB;AAC1B,OAAOC,SAAS;AAChB,SAASC,qBAAqB,EAAEC,0BAA0B;AAC1D,OAAOC,SAAS;AAEhB,SACEH,SAAS,EACTH,cAAc,EACdD,eAAe,EACfjB,gBAAgB,EAChBE,eAAe,EACfD,gBAAgB,EAChBG,mBAAmB,EACnBD,gBAAgB,EAChBE,uBAAuB,EACvBE,eAAe,EACfD,mBAAmB,EACnBE,qBAAqB,EACrBC,oBAAoB,EACpBC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBG,eAAe,EACfpB,kBAAkB,EAClBD,uBAAuB,EACvBD,0BAA0B,EAC1ByB,qBAAqB,EACrBC,0BAA0B,EAC1BC,SAAS,EACTJ,mBAAmB"}
|
|
@@ -26,7 +26,7 @@ export var stringScriptExecution = function stringScriptExecution(scriptCode) {
|
|
|
26
26
|
return scriptCode ? compartment.evaluate(scriptCode) : null;
|
|
27
27
|
} catch (err) {
|
|
28
28
|
console.error(err);
|
|
29
|
-
return
|
|
29
|
+
return undefined;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
export var createCompartmentExecution = function createCompartmentExecution(globals) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stringScriptExecution","scriptCode","root","arguments","length","undefined","compartment","Compartment","window","evaluate","err","console","error","createCompartmentExecution","globals"],"sources":["../../../../src/formatModule/helpers/stringScriptExecution.ts"],"sourcesContent":["import 'ses';\nimport type { CompartmentOptions } from 'ses';\n/* eslint-disable no-new-func */\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\n// try {\n// if (scriptCode) {\n// // 将参数作为全局变量传递\n// const func = new Function('root', `return ${scriptCode}`);\n// const result = func(root);\n// console.log(result, root, scriptCode);\n// return result;\n// }\n// throw new Error('No script code provided');\n// } catch (err) {\n// console.error(err);\n// return null;\n// }\n// };\n\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\n const compartment = new Compartment({ root, window });\n try {\n return scriptCode ? compartment.evaluate(scriptCode) : null;\n } catch (err) {\n console.error(err);\n return
|
|
1
|
+
{"version":3,"names":["stringScriptExecution","scriptCode","root","arguments","length","undefined","compartment","Compartment","window","evaluate","err","console","error","createCompartmentExecution","globals"],"sources":["../../../../src/formatModule/helpers/stringScriptExecution.ts"],"sourcesContent":["import 'ses';\nimport type { CompartmentOptions } from 'ses';\n/* eslint-disable no-new-func */\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\n// try {\n// if (scriptCode) {\n// // 将参数作为全局变量传递\n// const func = new Function('root', `return ${scriptCode}`);\n// const result = func(root);\n// console.log(result, root, scriptCode);\n// return result;\n// }\n// throw new Error('No script code provided');\n// } catch (err) {\n// console.error(err);\n// return null;\n// }\n// };\n\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\n const compartment = new Compartment({ root, window });\n try {\n return scriptCode ? compartment.evaluate(scriptCode) : null;\n } catch (err) {\n console.error(err);\n return undefined;\n }\n};\n\nexport const createCompartmentExecution = (globals?: CompartmentOptions) => {\n return new Compartment(globals);\n};\n"],"mappings":"AAAA,OAAO,KAAK;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,UAAkB,EAAqB;EAAA,IAAnBC,IAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtE,IAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC;IAAEL,IAAI,EAAJA,IAAI;IAAEM,MAAM,EAANA;EAAO,CAAC,CAAC;EACrD,IAAI;IACF,OAAOP,UAAU,GAAGK,WAAW,CAACG,QAAQ,CAACR,UAAU,CAAC,GAAG,IAAI;EAC7D,CAAC,CAAC,OAAOS,GAAG,EAAE;IACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;IAClB,OAAOL,SAAS;EAClB;AACF,CAAC;AAED,OAAO,IAAMQ,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAIC,OAA4B,EAAK;EAC1E,OAAO,IAAIP,WAAW,CAACO,OAAO,CAAC;AACjC,CAAC"}
|
package/dist/esm/http.d.ts
CHANGED
|
@@ -27,6 +27,16 @@ declare const request: {
|
|
|
27
27
|
getTenantIcon: ({ tenantId }: {
|
|
28
28
|
tenantId: string;
|
|
29
29
|
}) => string | undefined;
|
|
30
|
+
getLargeModelIcon: ({ modelId, tenantId }: {
|
|
31
|
+
modelId: string;
|
|
32
|
+
tenantId: string;
|
|
33
|
+
}) => string | undefined;
|
|
34
|
+
getDataTableIcon: ({ tableId, tenantId, updatedTime, isSecurity }: {
|
|
35
|
+
tableId: string;
|
|
36
|
+
tenantId: string;
|
|
37
|
+
updatedTime?: string | undefined;
|
|
38
|
+
isSecurity?: boolean | undefined;
|
|
39
|
+
}) => string | undefined;
|
|
30
40
|
docChain: {
|
|
31
41
|
referenceDocUrl: ({ tenantId, docId, token, }: {
|
|
32
42
|
[key: string]: string;
|
|
@@ -51,5 +61,12 @@ declare const request: {
|
|
|
51
61
|
};
|
|
52
62
|
get: (url: string, cfg: any) => Promise<unknown>;
|
|
53
63
|
post: (url: string, cfg: any) => Promise<unknown>;
|
|
64
|
+
download: ({ url, fileName, method, data, params, }: {
|
|
65
|
+
url: string;
|
|
66
|
+
fileName?: string | undefined;
|
|
67
|
+
method?: "get" | "post" | undefined;
|
|
68
|
+
data?: any;
|
|
69
|
+
params?: any;
|
|
70
|
+
}, callback?: ((objectUrl: string) => void) | undefined, errorCallback?: () => void) => Promise<void>;
|
|
54
71
|
};
|
|
55
72
|
export { request };
|