@boteteam/utils 0.0.17 → 0.0.19
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 +10 -1
- package/dist/cjs/file.js.map +2 -2
- package/dist/cjs/formatModule/formatModuleData.js +26 -3
- package/dist/cjs/formatModule/formatModuleData.js.map +2 -2
- package/dist/cjs/formatModule/helpers/formatChartsProps.d.ts +13 -0
- package/dist/cjs/formatModule/helpers/formatChartsProps.js +48 -0
- package/dist/cjs/formatModule/helpers/formatChartsProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/index.d.ts +2 -1
- package/dist/cjs/formatModule/helpers/index.js +3 -0
- package/dist/cjs/formatModule/helpers/index.js.map +3 -3
- package/dist/cjs/formatModule/helpers/stringPramarsValTransition.d.ts +1 -1
- package/dist/cjs/securityUtils.js +1 -1
- package/dist/cjs/securityUtils.js.map +2 -2
- package/dist/cjs/treeUtils.d.ts +1 -1
- package/dist/cjs/treeUtils.js +4 -1
- package/dist/cjs/treeUtils.js.map +2 -2
- package/dist/esm/file.js +10 -3
- package/dist/esm/file.js.map +1 -1
- package/dist/esm/formatModule/formatModuleData.js +27 -9
- package/dist/esm/formatModule/formatModuleData.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatChartsProps.d.ts +13 -0
- package/dist/esm/formatModule/helpers/formatChartsProps.js +12 -0
- package/dist/esm/formatModule/helpers/formatChartsProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/index.d.ts +2 -1
- package/dist/esm/formatModule/helpers/index.js +2 -1
- package/dist/esm/formatModule/helpers/index.js.map +1 -1
- package/dist/esm/formatModule/helpers/stringPramarsValTransition.d.ts +1 -1
- package/dist/esm/securityUtils.js +1 -1
- package/dist/esm/securityUtils.js.map +1 -1
- package/dist/esm/treeUtils.d.ts +1 -1
- package/dist/esm/treeUtils.js +5 -0
- package/dist/esm/treeUtils.js.map +1 -1
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/file.js
CHANGED
|
@@ -42,8 +42,17 @@ var getFileUrlById = (fileId, {
|
|
|
42
42
|
isSecurity = true,
|
|
43
43
|
params
|
|
44
44
|
} = {}) => {
|
|
45
|
+
var _a;
|
|
45
46
|
const baseUrl = prefix ? prefix.replace(/\/$/, "") : DEFAULT_PREFIX;
|
|
46
|
-
const
|
|
47
|
+
const token = ((_a = (0, import_pathArgsUtils.getSearchObj)()) == null ? void 0 : _a.token) || "";
|
|
48
|
+
const queryParams = {
|
|
49
|
+
fileId,
|
|
50
|
+
...params
|
|
51
|
+
};
|
|
52
|
+
if (token) {
|
|
53
|
+
queryParams.token = token;
|
|
54
|
+
}
|
|
55
|
+
const query = (0, import_pathArgsUtils.argsToString)(queryParams);
|
|
47
56
|
const url = `${baseUrl}/file/download?${query}`;
|
|
48
57
|
return isSecurity ? import_security.default.autoSecurityWithUrl(url) : url;
|
|
49
58
|
};
|
package/dist/cjs/file.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/file.ts"],
|
|
4
|
-
"sourcesContent": ["import security from '@lingxiteam/security';\nimport { argsToString } from './pathArgsUtils';\n\n// 暂时放到utils中,后续考虑独立在@boteteam/service包\n\nconst DEFAULT_PREFIX = `${process.env.REACT_APP_REQ_PREFIX}/bote`;\n\n/**\n * 根据文件ID生成文件URL地址\n * @param fileId 文件ID\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getFileUrlById = (\n fileId: string,\n {\n prefix,\n isSecurity = true,\n params,\n }: {\n prefix?: string;\n isSecurity?: boolean;\n params?: Record<string, any>;\n } = {},\n) => {\n const baseUrl = prefix ? prefix.replace(/\\/$/, '') : DEFAULT_PREFIX;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["import security from '@lingxiteam/security';\nimport { argsToString, getSearchObj } from './pathArgsUtils';\n\n// 暂时放到utils中,后续考虑独立在@boteteam/service包\n\nconst DEFAULT_PREFIX = `${process.env.REACT_APP_REQ_PREFIX}/bote`;\n\n/**\n * 根据文件ID生成文件URL地址\n * @param fileId 文件ID\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getFileUrlById = (\n fileId: string,\n {\n prefix,\n isSecurity = true,\n params,\n }: {\n prefix?: string;\n isSecurity?: boolean;\n params?: Record<string, any>;\n } = {},\n) => {\n const baseUrl = prefix ? prefix.replace(/\\/$/, '') : DEFAULT_PREFIX;\n // 如果url中存在token,则把token添加到query参数中\n const token = getSearchObj()?.token || '';\n const queryParams:{[key:string]:any} = {\n fileId,\n ...params,\n };\n if (token) {\n queryParams.token = token;\n }\n const query = argsToString(queryParams);\n const url = `${baseUrl}/file/download?${query}`;\n return isSecurity ? security.autoSecurityWithUrl(url) : url;\n};\n\nconst getRemoteComponentUrl = ({\n prefix,\n isSecurity = true,\n params = {},\n}: {\n prefix?: string;\n isSecurity?: boolean;\n params?: Record<string, any>;\n} = {}) => {\n const baseUrl = prefix ? prefix.replace(/\\/$/, '') : DEFAULT_PREFIX;\n const query = argsToString(params);\n const url = `${baseUrl}/manager/skill/page/getRemoteComponent?${query}`;\n return isSecurity ? security.autoSecurityWithUrl(url) : url;\n};\n\n/**\n * 根据页面编码生成远程组件URL地址\n * @param pageCode 页面编码\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getRemoteComponentUrlByCode = (\n pageCode: string,\n options: Parameters<typeof getRemoteComponentUrl>[0],\n) => {\n return getRemoteComponentUrl({\n ...options,\n params: { pageCode, ...options?.params },\n });\n};\n\n/**\n * 根据文件ID生成远程组件URL地址\n * @param fileInfoId 文件ID\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getRemoteComponentUrlById = (\n fileInfoId: string,\n options: Parameters<typeof getRemoteComponentUrl>[0],\n) => {\n return getRemoteComponentUrl({\n ...options,\n params: { fileInfoId, ...options?.params },\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqB;AACrB,2BAA2C;AAI3C,IAAM,iBAAiB,GAAG,QAAQ,IAAI;AAW/B,IAAM,iBAAiB,CAC5B,QACA;AAAA,EACE;AAAA,EACA,aAAa;AAAA,EACb;AACF,IAII,CAAC,MACF;AA3BL;AA4BE,QAAM,UAAU,SAAS,OAAO,QAAQ,OAAO,EAAE,IAAI;AAErD,QAAM,UAAQ,4CAAa,MAAb,mBAAgB,UAAS;AACvC,QAAM,cAAiC;AAAA,IACrC;AAAA,IACA,GAAG;AAAA,EACL;AACA,MAAI,OAAO;AACT,gBAAY,QAAQ;AAAA,EACtB;AACA,QAAM,YAAQ,mCAAa,WAAW;AACtC,QAAM,MAAM,GAAG,yBAAyB;AACxC,SAAO,aAAa,gBAAAA,QAAS,oBAAoB,GAAG,IAAI;AAC1D;AAEA,IAAM,wBAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,aAAa;AAAA,EACb,SAAS,CAAC;AACZ,IAII,CAAC,MAAM;AACT,QAAM,UAAU,SAAS,OAAO,QAAQ,OAAO,EAAE,IAAI;AACrD,QAAM,YAAQ,mCAAa,MAAM;AACjC,QAAM,MAAM,GAAG,iDAAiD;AAChE,SAAO,aAAa,gBAAAA,QAAS,oBAAoB,GAAG,IAAI;AAC1D;AAWO,IAAM,8BAA8B,CACzC,UACA,YACG;AACH,SAAO,sBAAsB;AAAA,IAC3B,GAAG;AAAA,IACH,QAAQ,EAAE,UAAU,GAAG,mCAAS,OAAO;AAAA,EACzC,CAAC;AACH;AAWO,IAAM,4BAA4B,CACvC,YACA,YACG;AACH,SAAO,sBAAsB;AAAA,IAC3B,GAAG;AAAA,IACH,QAAQ,EAAE,YAAY,GAAG,mCAAS,OAAO;AAAA,EAC3C,CAAC;AACH;",
|
|
6
6
|
"names": ["security"]
|
|
7
7
|
}
|
|
@@ -78,6 +78,7 @@ var formatModuleData = ({
|
|
|
78
78
|
column,
|
|
79
79
|
articleContent,
|
|
80
80
|
eventFlag,
|
|
81
|
+
events,
|
|
81
82
|
...otherCompProps
|
|
82
83
|
// 无需处理的属性
|
|
83
84
|
} = compProps || {};
|
|
@@ -90,9 +91,6 @@ var formatModuleData = ({
|
|
|
90
91
|
if (otherCompProps == null ? void 0 : otherCompProps.title) {
|
|
91
92
|
moduleDataRes.compProps.title = (0, import_helpers.stringPramarsValTransition)(otherCompProps == null ? void 0 : otherCompProps.title, allParametrs);
|
|
92
93
|
}
|
|
93
|
-
if (eventFlag) {
|
|
94
|
-
moduleDataRes.compProps.eventFlag = { checked: true };
|
|
95
|
-
}
|
|
96
94
|
moduleDataRes.parentCompProps = (parentModuleData == null ? void 0 : parentModuleData.compProps) || {};
|
|
97
95
|
if (["panel", "div", "page"].indexOf(compType) >= 0 && Array.isArray(children) && children.length > 0) {
|
|
98
96
|
const childs = children.map((item) => {
|
|
@@ -107,6 +105,19 @@ var formatModuleData = ({
|
|
|
107
105
|
});
|
|
108
106
|
});
|
|
109
107
|
moduleDataRes.children = childs;
|
|
108
|
+
if (compType === "page") {
|
|
109
|
+
if (events && (events == null ? void 0 : events.length) > 0) {
|
|
110
|
+
const onLoadEvent = events.find(
|
|
111
|
+
(item) => (item == null ? void 0 : item.key) === "pageLoad"
|
|
112
|
+
);
|
|
113
|
+
if (onLoadEvent) {
|
|
114
|
+
moduleDataRes.compProps.onLoad = onLoadEvent == null ? void 0 : onLoadEvent.event;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (eventFlag) {
|
|
118
|
+
moduleDataRes.compProps.eventFlag = { checked: true };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
110
121
|
} else {
|
|
111
122
|
if (otherCompProps && ((_a = Object == null ? void 0 : Object.keys(otherCompProps)) == null ? void 0 : _a.length) > 0) {
|
|
112
123
|
Object == null ? void 0 : Object.keys(otherCompProps).forEach((compPropKey) => {
|
|
@@ -323,6 +334,18 @@ var formatModuleData = ({
|
|
|
323
334
|
...echartProps
|
|
324
335
|
};
|
|
325
336
|
}
|
|
337
|
+
if (compType === "charts") {
|
|
338
|
+
const chartsProps = (0, import_helpers.formatChartsProps)({
|
|
339
|
+
options: {
|
|
340
|
+
echartsOptions: compProps == null ? void 0 : compProps.echartsOptions
|
|
341
|
+
},
|
|
342
|
+
parameters: allParametrs
|
|
343
|
+
});
|
|
344
|
+
moduleDataRes.compProps = {
|
|
345
|
+
...moduleDataRes.compProps || {},
|
|
346
|
+
...chartsProps
|
|
347
|
+
};
|
|
348
|
+
}
|
|
326
349
|
}
|
|
327
350
|
if (compType === "steps") {
|
|
328
351
|
const stepsProps = (0, import_helpers.formatStepsProps)({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/formatModule/formatModuleData.ts"],
|
|
4
|
-
"sourcesContent": ["import 'ses';\nimport { getDataArr } from '../treeUtils';\nimport {\n urlPrefix,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatFormProps,\n formatHighCodeProps,\n formatDescriptionsProps,\n formatLoopProps,\n formatStyleProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatStepsProps,\n staticCodeAssemble,\n stringPramarsValTransition,\n} from './helpers';\n\ntype formatModuleProps = {\n moduleData: { [key: string]: any } | null; // 页面配置数据\n parentModuleData?: { [key: string]: any } | null; // 父级配置数据\n pageData?: { [key: string]: any } | null; // 页面组件数据\n parameters?: any; // 入参上下文\n loopItemData?: any; // 循环体数据\n staticCodeList?: { [key: string]: any } | null; // 静态资源数据\n disabled?: boolean;\n};\n\nconst formatModuleData = ({\n moduleData,\n parentModuleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n}: formatModuleProps): { [key: string]: any } | null => {\n let moduleDataRes: { [key: string]: any } = { };\n const allParametrs:{ [key: string]: any } = {\n ...(parameters || {}),\n pageData: pageData || {},\n loopItem: loopItemData || {},\n }; // 把页面数据与入参组装到一起\n const {\n staticCodeMap,\n staticOptionsMap,\n } = staticCodeAssemble(staticCodeList);\n\n if (moduleData) {\n const {\n compProps,\n compType,\n children,\n moduleTitle,\n moduleDescribe,\n id,\n } = moduleData;\n // 组装静态数据映射\n moduleDataRes = {\n ...moduleData,\n key: id,\n disabled,\n compProps: {},\n originModule: moduleData, // 配置moduled的信息\n };\n const {\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n columns: compColumns,\n tableBodyHeight,\n fileProps,\n attrs,\n rowSelection,\n hasSelectAll,\n rowKey,\n fieldName,\n column,\n articleContent,\n eventFlag,\n ...otherCompProps // 无需处理的属性\n } = compProps || {};\n if (moduleTitle) {\n moduleDataRes.moduleTitle = stringPramarsValTransition(moduleTitle, allParametrs);\n }\n if (moduleDescribe) {\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\n }\n if (otherCompProps?.title) {\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\n }\n if (eventFlag) {\n moduleDataRes.compProps.eventFlag = { checked: true };\n }\n \n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\n if (\n ['panel', 'div', 'page'].indexOf(compType) >= 0 &&\n Array.isArray(children) &&\n children.length > 0\n ) {\n const childs = children.map((item) => {\n return formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n });\n });\n moduleDataRes.children = childs;\n } else {\n if (otherCompProps && Object?.keys(otherCompProps)?.length > 0) {\n Object?.keys(otherCompProps).forEach(compPropKey => {\n if (otherCompProps?.[compPropKey] || typeof otherCompProps?.[compPropKey] === 'number') {\n moduleDataRes.compProps[compPropKey] = otherCompProps?.[compPropKey];\n }\n });\n }\n if (rowSelection) {\n moduleDataRes.compProps.rowSelection = rowSelection;\n if (hasSelectAll && rowSelection?.type === 'checkbox') {\n moduleDataRes.compProps.hasSelectAll = hasSelectAll;\n } else {\n delete moduleDataRes.compProps.hasSelectAll;\n }\n }\n const rowKeyIndexArr = getDataArr(rowKey);\n\n if (Array.isArray(rowKeyIndexArr) && rowKeyIndexArr.length > 0) {\n moduleDataRes.compProps.rowKey = rowKeyIndexArr.slice(-1)?.[0];\n }\n\n if (compType === 'typography') {\n if (articleContent) {\n moduleDataRes.compProps.articleContent = stringPramarsValTransition(articleContent, allParametrs);\n }\n }\n if (compType === 'iframe') {\n moduleDataRes.compProps.url = stringPramarsValTransition(\n otherCompProps?.url,\n allParametrs,\n );\n }\n\n if (compType === 'carousel' && compDataSource && compDataSource?.dataType) {\n const carouselProps = formatCarouselProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...carouselProps,\n };\n }\n if (compType === 'image' && compDataSource && compDataSource?.dataType) {\n const imageProps = formatImageProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...imageProps,\n };\n }\n\n if (compType === 'highCodeComp') {\n const highCodeCompProps = formatHighCodeProps({\n options: { fileProps },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...highCodeCompProps,\n };\n }\n\n if (compType === 'table') {\n const tableProps = formatTableProps({\n options: {\n ...otherCompProps,\n columns: compColumns,\n dataSource: compDataSource,\n attrs,\n tableBodyHeight,\n },\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...tableProps,\n };\n }\n if (compType === 'form') {\n const formProps = formatFormProps({\n options: {\n column,\n children,\n },\n parameters: allParametrs,\n staticCodeMap,\n staticOptionsMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...formProps,\n };\n }\n if (compType === 'descriptions') {\n const descriptionsProps = formatDescriptionsProps({\n options: {\n column,\n attrs,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...descriptionsProps,\n };\n }\n if (compType === 'loop') {\n const loopProps = formatLoopProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n const loopChilds:({[key:string]:any}|null)[] = [];\n if (\n Array.isArray(loopProps?.dataSource) && loopProps?.dataSource?.length > 0 &&\n Array.isArray(children) && children.length > 0\n ) {\n loopProps?.dataSource.forEach((dataItem) => {\n const dataItemKey = moduleDataRes?.compProps?.rowKey && dataItem?.[moduleDataRes?.compProps?.rowKey] ?\n dataItem?.[moduleDataRes?.compProps?.rowKey] : '';\n loopChilds.push({\n id: dataItemKey,\n key: dataItemKey,\n compType: 'loopItem',\n compProps: {},\n originItem: dataItem,\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: typeof dataItem === 'object' ? dataItem : { item: dataItem },\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n });\n } else if (Array.isArray(children) && children.length > 0) {\n loopChilds.push({\n id: '1',\n key: '1',\n compType: 'loopItem',\n compProps: {},\n originItem: {},\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: {},\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n }\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...loopProps,\n column,\n children: loopChilds,\n };\n }\n if (['list', 'card', 'recommendList'].includes(compType)) {\n const resProps = formatListProps({\n options: {\n ...otherCompProps,\n rowKey,\n rowSelection,\n attrs,\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n },\n urlPrefix,\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...resProps,\n };\n }\n if (['echartBar', 'echartLine'].includes(compType)) {\n const echartProps = formatEchartLineProps({\n options: { ...otherCompProps, dataSource: compDataSource },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n if (compType === 'echartPie') {\n const echartProps = formatEchartPieProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n }\n if (compType === 'steps') {\n const stepsProps = formatStepsProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...stepsProps,\n };\n }\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\n // 所有的模版 拼一个组装数据的key值\n if (moduleData?.compProps && fieldName) {\n moduleDataRes.compProps.fieldName = fieldName;\n }\n }\n \n // console.log('moduleDataRes', moduleDataRes);\n return moduleDataRes;\n};\n\nexport default formatModuleData;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AACP,uBAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import 'ses';\nimport { getDataArr } from '../treeUtils';\nimport {\n urlPrefix,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatFormProps,\n formatHighCodeProps,\n formatDescriptionsProps,\n formatLoopProps,\n formatStyleProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatChartsProps,\n formatStepsProps,\n staticCodeAssemble,\n stringPramarsValTransition,\n} from './helpers';\n\ntype formatModuleProps = {\n moduleData: { [key: string]: any } | null; // 页面配置数据\n parentModuleData?: { [key: string]: any } | null; // 父级配置数据\n pageData?: { [key: string]: any } | null; // 页面组件数据\n parameters?: any; // 入参上下文\n loopItemData?: any; // 循环体数据\n staticCodeList?: { [key: string]: any } | null; // 静态资源数据\n disabled?: boolean;\n};\n\nconst formatModuleData = ({\n moduleData,\n parentModuleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n}: formatModuleProps): { [key: string]: any } | null => {\n let moduleDataRes: { [key: string]: any } = { };\n const allParametrs:{ [key: string]: any } = {\n ...(parameters || {}),\n pageData: pageData || {},\n loopItem: loopItemData || {},\n }; // 把页面数据与入参组装到一起\n const {\n staticCodeMap,\n staticOptionsMap,\n } = staticCodeAssemble(staticCodeList);\n\n if (moduleData) {\n const {\n compProps,\n compType,\n children,\n moduleTitle,\n moduleDescribe,\n id,\n } = moduleData;\n // 组装静态数据映射\n moduleDataRes = {\n ...moduleData,\n key: id,\n disabled,\n compProps: {},\n originModule: moduleData, // 配置moduled的信息\n };\n const {\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n columns: compColumns,\n tableBodyHeight,\n fileProps,\n attrs,\n rowSelection,\n hasSelectAll,\n rowKey,\n fieldName,\n column,\n articleContent,\n eventFlag,\n events,\n ...otherCompProps // 无需处理的属性\n } = compProps || {};\n if (moduleTitle) {\n moduleDataRes.moduleTitle = stringPramarsValTransition(moduleTitle, allParametrs);\n }\n if (moduleDescribe) {\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\n }\n if (otherCompProps?.title) {\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\n }\n \n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\n if (\n ['panel', 'div', 'page'].indexOf(compType) >= 0 &&\n Array.isArray(children) &&\n children.length > 0\n ) {\n const childs = children.map((item) => {\n return formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n });\n });\n moduleDataRes.children = childs;\n if (compType === 'page') {\n if (events && events?.length > 0) {\n const onLoadEvent = events.find(\n (item: any) => item?.key === 'pageLoad',\n );\n if (onLoadEvent) {\n moduleDataRes.compProps.onLoad = onLoadEvent?.event;\n }\n }\n if (eventFlag) {\n moduleDataRes.compProps.eventFlag = { checked: true };\n }\n }\n } else {\n if (otherCompProps && Object?.keys(otherCompProps)?.length > 0) {\n Object?.keys(otherCompProps).forEach(compPropKey => {\n if (otherCompProps?.[compPropKey] || typeof otherCompProps?.[compPropKey] === 'number') {\n moduleDataRes.compProps[compPropKey] = otherCompProps?.[compPropKey];\n }\n });\n }\n if (rowSelection) {\n moduleDataRes.compProps.rowSelection = rowSelection;\n if (hasSelectAll && rowSelection?.type === 'checkbox') {\n moduleDataRes.compProps.hasSelectAll = hasSelectAll;\n } else {\n delete moduleDataRes.compProps.hasSelectAll;\n }\n }\n const rowKeyIndexArr = getDataArr(rowKey);\n\n if (Array.isArray(rowKeyIndexArr) && rowKeyIndexArr.length > 0) {\n moduleDataRes.compProps.rowKey = rowKeyIndexArr.slice(-1)?.[0];\n }\n\n if (compType === 'typography') {\n if (articleContent) {\n moduleDataRes.compProps.articleContent = stringPramarsValTransition(articleContent, allParametrs);\n }\n }\n if (compType === 'iframe') {\n moduleDataRes.compProps.url = stringPramarsValTransition(\n otherCompProps?.url,\n allParametrs,\n );\n }\n\n if (compType === 'carousel' && compDataSource && compDataSource?.dataType) {\n const carouselProps = formatCarouselProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...carouselProps,\n };\n }\n if (compType === 'image' && compDataSource && compDataSource?.dataType) {\n const imageProps = formatImageProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...imageProps,\n };\n }\n\n if (compType === 'highCodeComp') {\n const highCodeCompProps = formatHighCodeProps({\n options: { fileProps },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...highCodeCompProps,\n };\n }\n\n if (compType === 'table') {\n const tableProps = formatTableProps({\n options: {\n ...otherCompProps,\n columns: compColumns,\n dataSource: compDataSource,\n attrs,\n tableBodyHeight,\n },\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...tableProps,\n };\n }\n if (compType === 'form') {\n const formProps = formatFormProps({\n options: {\n column,\n children,\n },\n parameters: allParametrs,\n staticCodeMap,\n staticOptionsMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...formProps,\n };\n }\n if (compType === 'descriptions') {\n const descriptionsProps = formatDescriptionsProps({\n options: {\n column,\n attrs,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...descriptionsProps,\n };\n }\n if (compType === 'loop') {\n const loopProps = formatLoopProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n const loopChilds:({[key:string]:any}|null)[] = [];\n if (\n Array.isArray(loopProps?.dataSource) && loopProps?.dataSource?.length > 0 &&\n Array.isArray(children) && children.length > 0\n ) {\n loopProps?.dataSource.forEach((dataItem) => {\n const dataItemKey = moduleDataRes?.compProps?.rowKey && dataItem?.[moduleDataRes?.compProps?.rowKey] ?\n dataItem?.[moduleDataRes?.compProps?.rowKey] : '';\n loopChilds.push({\n id: dataItemKey,\n key: dataItemKey,\n compType: 'loopItem',\n compProps: {},\n originItem: dataItem,\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: typeof dataItem === 'object' ? dataItem : { item: dataItem },\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n });\n } else if (Array.isArray(children) && children.length > 0) {\n loopChilds.push({\n id: '1',\n key: '1',\n compType: 'loopItem',\n compProps: {},\n originItem: {},\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: {},\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n }\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...loopProps,\n column,\n children: loopChilds,\n };\n }\n if (['list', 'card', 'recommendList'].includes(compType)) {\n const resProps = formatListProps({\n options: {\n ...otherCompProps,\n rowKey,\n rowSelection,\n attrs,\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n },\n urlPrefix,\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...resProps,\n };\n }\n if (['echartBar', 'echartLine'].includes(compType)) {\n const echartProps = formatEchartLineProps({\n options: { ...otherCompProps, dataSource: compDataSource },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n if (compType === 'echartPie') {\n const echartProps = formatEchartPieProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n if (compType === 'charts') {\n const chartsProps = formatChartsProps({\n options: {\n echartsOptions: compProps?.echartsOptions,\n },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...chartsProps,\n };\n }\n }\n if (compType === 'steps') {\n const stepsProps = formatStepsProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...stepsProps,\n };\n }\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\n // 所有的模版 拼一个组装数据的key值\n if (moduleData?.compProps && fieldName) {\n moduleDataRes.compProps.fieldName = fieldName;\n }\n }\n\n return moduleDataRes;\n};\n\nexport default formatModuleData;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AACP,uBAA2B;AAC3B,qBAiBO;AAYP,IAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAwD;AAvCxD;AAwCE,MAAI,gBAAwC,CAAE;AAC9C,QAAM,eAAsC;AAAA,IAC1C,GAAI,cAAc,CAAC;AAAA,IACnB,UAAU,YAAY,CAAC;AAAA,IACvB,UAAU,gBAAgB,CAAC;AAAA,EAC7B;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,QAAI,mCAAmB,cAAc;AAErC,MAAI,YAAY;AACd,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI;AAEJ,oBAAgB;AAAA,M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C;AAAA,UAChC,GAAG;AAAA,QACL;AAAA,MACF;AAAA,IACF;AACA,QAAI,aAAa,SAAS;AACxB,YAAM,iBAAa,iCAAiB;AAAA,QAClC,SAAS;AAAA,UACP,YAAY;AAAA,UACZ,GAAG;AAAA,QACL;AAAA,QACA,YAAY;AAAA,MACd,CAAC;AACD,oBAAc,YAAY;AAAA,QACxB,GAAI,cAAc,aAAa,CAAC;AAAA,QAChC,GAAG;AAAA,MACL;AAAA,IACF;AACA,kBAAc,UAAU,YAAQ,iCAAiB,YAAY,gBAAgB;AAE7E,SAAI,yCAAY,cAAa,WAAW;AACtC,oBAAc,UAAU,YAAY;AAAA,IACtC;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["_a", "_b", "_c"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type formatChartsPropsType = {
|
|
2
|
+
options?: {
|
|
3
|
+
echartsOptions?: string;
|
|
4
|
+
};
|
|
5
|
+
parameters?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type formatChartsPropsExportType = {
|
|
10
|
+
options: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
declare const formatChartsProps: ({ parameters, options, }: formatChartsPropsType) => formatChartsPropsExportType;
|
|
13
|
+
export default formatChartsProps;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/formatModule/helpers/formatChartsProps.ts
|
|
30
|
+
var formatChartsProps_exports = {};
|
|
31
|
+
__export(formatChartsProps_exports, {
|
|
32
|
+
default: () => formatChartsProps_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(formatChartsProps_exports);
|
|
35
|
+
var import_stringPramarsValTransition = __toESM(require("./stringPramarsValTransition"));
|
|
36
|
+
var formatChartsProps = ({
|
|
37
|
+
parameters,
|
|
38
|
+
options = {}
|
|
39
|
+
}) => {
|
|
40
|
+
const {
|
|
41
|
+
echartsOptions
|
|
42
|
+
} = options;
|
|
43
|
+
return {
|
|
44
|
+
options: (0, import_stringPramarsValTransition.default)(echartsOptions || "", parameters, true)
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
var formatChartsProps_default = formatChartsProps;
|
|
48
|
+
//# sourceMappingURL=formatChartsProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/formatModule/helpers/formatChartsProps.ts"],
|
|
4
|
+
"sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\n\nexport type formatChartsPropsType = {\n options?: {\n echartsOptions?: string;\n }\n parameters?: {[key:string]: any};\n}\n\nexport type formatChartsPropsExportType = {\n options: string | undefined\n}\n\nconst formatChartsProps = ({\n parameters,\n options = {},\n}: formatChartsPropsType): formatChartsPropsExportType => {\n const {\n echartsOptions,\n } = options;\n\n return {\n options: stringPramarsValTransition(echartsOptions || '', parameters, true),\n };\n};\n\nexport default formatChartsProps;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAuC;AAavC,IAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA,UAAU,CAAC;AACb,MAA0D;AACxD,QAAM;AAAA,IACJ;AAAA,EACF,IAAI;AAEJ,SAAO;AAAA,IACL,aAAS,kCAAAA,SAA2B,kBAAkB,IAAI,YAAY,IAAI;AAAA,EAC5E;AACF;AAEA,IAAO,4BAAQ;",
|
|
6
|
+
"names": ["stringPramarsValTransition"]
|
|
7
|
+
}
|
|
@@ -10,10 +10,11 @@ import formatHighCodeProps from './formatHighCodeProps';
|
|
|
10
10
|
import formatFormProps from './formatFormProps';
|
|
11
11
|
import formatEchartLineProps from './formatEchartLineProps';
|
|
12
12
|
import formatEchartPieProps from './formatEchartPieProps';
|
|
13
|
+
import formatChartsProps from './formatChartsProps';
|
|
13
14
|
import formatLoopProps from './formatLoopProps';
|
|
14
15
|
import formatStyleProps from './formatStyleProps';
|
|
15
16
|
import formatStepsProps from './formatStepsProps';
|
|
16
17
|
import formRulsRegMap from './formRulsRegMap';
|
|
17
18
|
import urlPrefix from './urlPrefix';
|
|
18
19
|
import { stringScriptExecution } from './stringScriptExecution';
|
|
19
|
-
export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
|
|
20
|
+
export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
|
|
@@ -31,6 +31,7 @@ var helpers_exports = {};
|
|
|
31
31
|
__export(helpers_exports, {
|
|
32
32
|
formRulsRegMap: () => import_formRulsRegMap.default,
|
|
33
33
|
formatCarouselProps: () => import_formatCarouselProps.default,
|
|
34
|
+
formatChartsProps: () => import_formatChartsProps.default,
|
|
34
35
|
formatDescriptionsProps: () => import_formatDescriptionsProps.default,
|
|
35
36
|
formatEchartLineProps: () => import_formatEchartLineProps.default,
|
|
36
37
|
formatEchartPieProps: () => import_formatEchartPieProps.default,
|
|
@@ -61,6 +62,7 @@ var import_formatHighCodeProps = __toESM(require("./formatHighCodeProps"));
|
|
|
61
62
|
var import_formatFormProps = __toESM(require("./formatFormProps"));
|
|
62
63
|
var import_formatEchartLineProps = __toESM(require("./formatEchartLineProps"));
|
|
63
64
|
var import_formatEchartPieProps = __toESM(require("./formatEchartPieProps"));
|
|
65
|
+
var import_formatChartsProps = __toESM(require("./formatChartsProps"));
|
|
64
66
|
var import_formatLoopProps = __toESM(require("./formatLoopProps"));
|
|
65
67
|
var import_formatStyleProps = __toESM(require("./formatStyleProps"));
|
|
66
68
|
var import_formatStepsProps = __toESM(require("./formatStepsProps"));
|
|
@@ -71,6 +73,7 @@ var import_stringScriptExecution = require("./stringScriptExecution");
|
|
|
71
73
|
0 && (module.exports = {
|
|
72
74
|
formRulsRegMap,
|
|
73
75
|
formatCarouselProps,
|
|
76
|
+
formatChartsProps,
|
|
74
77
|
formatDescriptionsProps,
|
|
75
78
|
formatEchartLineProps,
|
|
76
79
|
formatEchartPieProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/formatModule/helpers/index.ts"],
|
|
4
|
-
"sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\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 formatLoopProps from './formatLoopProps';\nimport formatStyleProps from './formatStyleProps';\nimport formatStepsProps from './formatStepsProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution } from './stringScriptExecution';\n\nexport {\n urlPrefix,\n formRulsRegMap,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatDescriptionsProps,\n formatFormProps,\n formatHighCodeProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatLoopProps,\n formatStyleProps,\n formatStepsProps,\n staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,0DAAAC;AAAA,EAAA,wDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,sDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,oDAAAC;AAAA,EAAA,oEAAAC;AAAA,EAAA;AAAA,oCAAAC;AAAA;AAAA;AAAA,wCAAuC;AACvC,qCAAoC;AACpC,gCAA+B;AAC/B,8BAA6B;AAC7B,6BAA4B;AAC5B,8BAA6B;AAC7B,iCAAgC;AAChC,qCAAoC;AACpC,iCAAgC;AAChC,6BAA4B;AAC5B,mCAAkC;AAClC,kCAAiC;AACjC,6BAA4B;AAC5B,8BAA6B;AAC7B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAsC;",
|
|
6
|
-
"names": ["formRulsRegMap", "formatCarouselProps", "formatDescriptionsProps", "formatEchartLineProps", "formatEchartPieProps", "formatFormProps", "formatHighCodeProps", "formatImageProps", "formatListProps", "formatLoopProps", "formatStepsProps", "formatStyleProps", "formatTableProps", "patternTransitionRegExp", "staticCodeAssemble", "stringPramarsValTransition", "urlPrefix"]
|
|
4
|
+
"sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\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 formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution } from './stringScriptExecution';\n\nexport {\n urlPrefix,\n formRulsRegMap,\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 staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;AAAA,EAAA,kDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,0DAAAC;AAAA,EAAA,wDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,sDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,oDAAAC;AAAA,EAAA,oEAAAC;AAAA,EAAA;AAAA,oCAAAC;AAAA;AAAA;AAAA,wCAAuC;AACvC,qCAAoC;AACpC,gCAA+B;AAC/B,8BAA6B;AAC7B,6BAA4B;AAC5B,8BAA6B;AAC7B,iCAAgC;AAChC,qCAAoC;AACpC,iCAAgC;AAChC,6BAA4B;AAC5B,mCAAkC;AAClC,kCAAiC;AACjC,+BAA8B;AAC9B,6BAA4B;AAC5B,8BAA6B;AAC7B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAsC;",
|
|
6
|
+
"names": ["formRulsRegMap", "formatCarouselProps", "formatChartsProps", "formatDescriptionsProps", "formatEchartLineProps", "formatEchartPieProps", "formatFormProps", "formatHighCodeProps", "formatImageProps", "formatListProps", "formatLoopProps", "formatStepsProps", "formatStyleProps", "formatTableProps", "patternTransitionRegExp", "staticCodeAssemble", "stringPramarsValTransition", "urlPrefix"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/securityUtils.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * 安全工具函数,用于防止XSS等安全漏洞\n */\n\n/**\n * 验证URL是否安全,防止XSS攻击\n * @param url 待验证的URL\n * @returns 是否为安全的URL\n */\nexport const isValidUrl = (url: string): boolean => {\n if (!url || typeof url !== 'string') {\n return false;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n \n // 只允许http和https协议,防止javascript:等危险协议\n if (!['http:', 'https:'].includes(urlObj.protocol)) {\n return false;\n }\n\n // 检查是否包含危险字符\n const dangerousPatterns = [\n /javascript:/i,\n /vbscript:/i,\n /data:/i,\n /file:/i,\n /<script/i,\n /onload=/i,\n /onerror=/i,\n /onclick=/i,\n ];\n\n return !dangerousPatterns.some(pattern => pattern.test(url));\n } catch {\n return false;\n }\n};\n\n/**\n * 清理和验证重定向URL,确保安全\n * @param url 待清理的URL\n * @param allowedDomains 允许的域名列表,为空时允许同源URL\n * @returns 清理后的安全URL,如果不安全则返回默认URL\n */\nexport const sanitizeRedirectUrl = (\n url: string,\n allowedDomains: string[] = [],\n defaultUrl: string = '/'\n): string => {\n if (!url || typeof url !== 'string') {\n return defaultUrl;\n }\n\n // 基本URL验证\n if (!isValidUrl(url)) {\n return defaultUrl;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n const currentHost = window.location.hostname;\n\n // 如果没有指定允许的域名,只允许同源URL\n if (allowedDomains.length === 0) {\n if (urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n } else {\n // 检查是否在允许的域名列表中\n const isAllowedDomain = allowedDomains.some(domain =>\n urlObj.hostname === domain || urlObj.hostname.endsWith(`.${domain}`)\n );\n \n if (!isAllowedDomain && urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n }\n\n return urlObj.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,aAAa,CAAC,QAAyB;AAClD,MAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;AACnC,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM;AAGlD,QAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,SAAS,OAAO,QAAQ,GAAG;AAClD,aAAO;AAAA,IACT;AAGA,UAAM,oBAAoB;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO,CAAC,kBAAkB,KAAK,aAAW,QAAQ,KAAK,GAAG,CAAC;AAAA,EAC7D,QAAE;AACA,WAAO;AAAA,EACT;AACF;AAQO,IAAM,sBAAsB,CACjC,KACA,iBAA2B,CAAC,GAC5B,aAAqB,QACV;AACX,MAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;AACnC,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM;AAClD,UAAM,cAAc,OAAO,SAAS;AAGpC,QAAI,eAAe,WAAW,GAAG;AAC/B,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO;AAAA,MACT;AAAA,IACF,OAAO;AAEL,YAAM,kBAAkB,eAAe;AAAA,QAAK,YAC1C,OAAO,aAAa,UAAU,OAAO,SAAS,SAAS,IAAI,QAAQ;AAAA,MACrE;AAEA,UAAI,CAAC,mBAAmB,OAAO,aAAa,aAAa;AACvD,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO,OAAO,
|
|
4
|
+
"sourcesContent": ["/**\n * 安全工具函数,用于防止XSS等安全漏洞\n */\n\n/**\n * 验证URL是否安全,防止XSS攻击\n * @param url 待验证的URL\n * @returns 是否为安全的URL\n */\nexport const isValidUrl = (url: string): boolean => {\n if (!url || typeof url !== 'string') {\n return false;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n \n // 只允许http和https协议,防止javascript:等危险协议\n if (!['http:', 'https:'].includes(urlObj.protocol)) {\n return false;\n }\n\n // 检查是否包含危险字符\n const dangerousPatterns = [\n /javascript:/i,\n /vbscript:/i,\n /data:/i,\n /file:/i,\n /<script/i,\n /onload=/i,\n /onerror=/i,\n /onclick=/i,\n ];\n\n return !dangerousPatterns.some(pattern => pattern.test(url));\n } catch {\n return false;\n }\n};\n\n/**\n * 清理和验证重定向URL,确保安全\n * @param url 待清理的URL\n * @param allowedDomains 允许的域名列表,为空时允许同源URL\n * @returns 清理后的安全URL,如果不安全则返回默认URL\n */\nexport const sanitizeRedirectUrl = (\n url: string,\n allowedDomains: string[] = [],\n defaultUrl: string = '/'\n): string => {\n if (!url || typeof url !== 'string') {\n return defaultUrl;\n }\n\n // 基本URL验证\n if (!isValidUrl(url)) {\n return defaultUrl;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n const currentHost = window.location.hostname;\n\n // 如果没有指定允许的域名,只允许同源URL\n if (allowedDomains.length === 0) {\n if (urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n } else {\n // 检查是否在允许的域名列表中\n const isAllowedDomain = allowedDomains.some(domain =>\n urlObj.hostname === domain || urlObj.hostname.endsWith(`.${domain}`)\n );\n \n if (!isAllowedDomain && urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n }\n\n return urlObj.pathname + urlObj.search;\n } catch {\n return defaultUrl;\n }\n};\n\n/**\n * 安全地设置window.location.href,防止XSS攻击\n * @param url 目标URL\n * @param allowedDomains 允许的域名列表\n */\nexport const safeRedirect = (url: string, allowedDomains: string[] = []): void => {\n const safeUrl = sanitizeRedirectUrl(url, allowedDomains);\n window.location.href = safeUrl;\n};\n\n/**\n * 验证和清理事件处理器,防止恶意代码注入\n * @param handler 事件处理函数\n * @returns 安全的事件处理函数\n */\nexport const sanitizeEventHandler = (handler: Function): Function => {\n if (typeof handler !== 'function') {\n return () => {};\n }\n \n return (...args: any[]) => {\n try {\n handler(...args);\n } catch (error) {\n console.error('Event handler error:', error);\n }\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,aAAa,CAAC,QAAyB;AAClD,MAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;AACnC,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM;AAGlD,QAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,SAAS,OAAO,QAAQ,GAAG;AAClD,aAAO;AAAA,IACT;AAGA,UAAM,oBAAoB;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO,CAAC,kBAAkB,KAAK,aAAW,QAAQ,KAAK,GAAG,CAAC;AAAA,EAC7D,QAAE;AACA,WAAO;AAAA,EACT;AACF;AAQO,IAAM,sBAAsB,CACjC,KACA,iBAA2B,CAAC,GAC5B,aAAqB,QACV;AACX,MAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;AACnC,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM;AAClD,UAAM,cAAc,OAAO,SAAS;AAGpC,QAAI,eAAe,WAAW,GAAG;AAC/B,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO;AAAA,MACT;AAAA,IACF,OAAO;AAEL,YAAM,kBAAkB,eAAe;AAAA,QAAK,YAC1C,OAAO,aAAa,UAAU,OAAO,SAAS,SAAS,IAAI,QAAQ;AAAA,MACrE;AAEA,UAAI,CAAC,mBAAmB,OAAO,aAAa,aAAa;AACvD,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO,OAAO,WAAW,OAAO;AAAA,EAClC,QAAE;AACA,WAAO;AAAA,EACT;AACF;AAOO,IAAM,eAAe,CAAC,KAAa,iBAA2B,CAAC,MAAY;AAChF,QAAM,UAAU,oBAAoB,KAAK,cAAc;AACvD,SAAO,SAAS,OAAO;AACzB;AAOO,IAAM,uBAAuB,CAAC,YAAgC;AACnE,MAAI,OAAO,YAAY,YAAY;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AAEA,SAAO,IAAI,SAAgB;AACzB,QAAI;AACF,cAAQ,GAAG,IAAI;AAAA,IACjB,SAAS,OAAP;AACA,cAAQ,MAAM,wBAAwB,KAAK;AAAA,IAC7C;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/treeUtils.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const replaceLoopBodyParamsValue: (contentStr: string, options: {
|
|
|
19
19
|
}) => string;
|
|
20
20
|
export declare const replaceParamsValue: (contentStr: string, pararms?: {
|
|
21
21
|
[key: string]: any;
|
|
22
|
-
}) => string;
|
|
22
|
+
}, isObject2String?: boolean) => string;
|
|
23
23
|
/**
|
|
24
24
|
* 提供给事件参数转换那边的方法
|
|
25
25
|
* 和replaceParamsValue 区别,
|
package/dist/cjs/treeUtils.js
CHANGED
|
@@ -136,11 +136,14 @@ var replaceLoopBodyParamsValue = (contentStr, options) => {
|
|
|
136
136
|
}
|
|
137
137
|
return nowTemp;
|
|
138
138
|
};
|
|
139
|
-
var replaceParamsValue = (contentStr, pararms = {}) => {
|
|
139
|
+
var replaceParamsValue = (contentStr, pararms = {}, isObject2String = false) => {
|
|
140
140
|
let nowContent = "";
|
|
141
141
|
if (typeof contentStr === "string" && contentStr && pararms) {
|
|
142
142
|
nowContent = contentStr.replace(/\$\{\{?[^{}]+}?\}/g, (match) => {
|
|
143
143
|
const filedVal = getParamsContentByParamKeys(match, pararms);
|
|
144
|
+
if (isObject2String && typeof filedVal === "object") {
|
|
145
|
+
return JSON.stringify(filedVal);
|
|
146
|
+
}
|
|
144
147
|
return filedVal || "";
|
|
145
148
|
});
|
|
146
149
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/treeUtils.ts"],
|
|
4
|
-
"sourcesContent": ["import { get, cloneDeep } from 'lodash';\nimport escapeString from './markdownEscape';\n\nexport const getDataArr = (content: string) => {\n let matchArr:string[] = [];\n if (content && typeof content === 'string') {\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 变量正则表达式,${{xxx}}\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n let matchs = escapeRegex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n } else {\n matchs = regex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n }\n }\n return matchArr?.filter((item, idx) => !(idx === 0 && ['root', 'pageParams'].includes(item)) && !(idx === 1 && ['pageParams'].includes(item))); // 过滤掉第一个root,pageParams\n }\n return matchArr;\n};\n\nconst loopNodeByParamsPath:any = (\n paramsArr:string[],\n data: {[key:string]: any},\n escape:boolean = false\n) => {\n if (Array.isArray(paramsArr) && paramsArr.length > 0) {\n for (const keyword of paramsArr) {\n const dataNode = get(data, keyword);\n let nextParamsArr = paramsArr.slice(1); // 取下一个节点字段\n if (Array.isArray(dataNode)) {\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(nextParamsArr?.[0])) {\n const idxNum = nextParamsArr?.[0].replace(/\\[|\\]/g, '');\n if (dataNode?.[Number(idxNum)] instanceof Object) {\n return loopNodeByParamsPath(nextParamsArr.slice(1), dataNode?.[Number(idxNum)], escape);\n }\n return escape ? escapeString(dataNode?.[Number(idxNum)]) : dataNode?.[Number(idxNum)];\n }\n // 否则或缺中间节点,直接往下取值\n nextParamsArr = nextParamsArr.slice(1);\n if (nextParamsArr?.length >= 1) {\n return dataNode.map((item:any) => {\n // 如果数组节点是对象,则继续递归取值\n if (item instanceof Object && nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, item, escape);\n }\n // 否则直接返回数组值\n return escape ? escapeString(item) : item;\n });\n }\n return dataNode;\n } if (nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, dataNode, escape);\n }\n return escape ? escapeString(dataNode) : dataNode;\n }\n }\n return '';\n};\n\n\nexport const getParamsContentByParamKeys = (paramNames: string, data: {[key:string]: any} = {}) => {\n if (!paramNames || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 匹配${{}}格式的参数,属于需转义内容\n const paramNameList = getDataArr(paramNames);\n return loopNodeByParamsPath(paramNameList, data, escapeRegex.test(paramNames));\n};\n\n// 获取替换循环体内的参数值\nexport const replaceLoopBodyParamsValue = (\n contentStr: string,\n options: {\n loopParams: { [key: string]: any } // 循环体参数\n loopSourceArr: string[], // 循环体数据源\n loopData: {[key: string]: any}[], // 循环数据源数据\n parameters?: {[key: string]: any}, // 全量参数\n staticCodeMap?: {[key: string]: any}, // 静态数据\n },\n) => {\n const {\n loopParams = {},\n loopSourceArr = [],\n loopData = [],\n parameters = {},\n } = options || {};\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && loopParams) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/gi, (match) => {\n const paramsPath = getDataArr(match).filter((itemKey) => !loopSourceArr.includes(itemKey));\n let filedVal:any = '';\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(paramsPath?.[0])) {\n const idxNum = paramsPath?.[0].replace(/\\[|\\]/g, '');\n if (loopData?.[Number(idxNum)] instanceof Object) {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopData?.[Number(idxNum)]);\n } else {\n filedVal = loopData?.[Number(idxNum)] || '';\n }\n } else {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopParams);\n\n // 循环体内查找不到,则从参数中取值,但忽略循环体本身\n if (!filedVal && parameters) {\n const _parameters = cloneDeep(parameters);\n if (Array.isArray(loopSourceArr) && loopSourceArr.length > 0) {\n loopSourceArr.forEach((sourceKey:string) => {\n delete _parameters[sourceKey];\n });\n }\n const paramNameList = getDataArr(match);\n filedVal = loopNodeByParamsPath(paramNameList, _parameters);\n }\n }\n return filedVal || '';\n });\n }\n return nowTemp;\n};\n\nexport const replaceParamsValue = (\n contentStr: string,\n pararms: { [key: string]: any } = {},\n) => {\n let nowContent:string = '';\n if (typeof contentStr === 'string' && contentStr && pararms) {\n nowContent = contentStr.replace(/\\$\\{\\{?[^{}]+}?\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeys(match, pararms);\n return filedVal || '';\n });\n }\n return nowContent;\n};\n\n\n/** ======下面几个方法主要提供给事件参数使用 勿共用 ===== */\nconst splitStringWithTemplateLiteral = (input: string) => {\n // 正则表达式:匹配 ${...} 模式\n const templateRegex = /\\$\\{[^}]*\\}/;\n\n // 检查字符串是否包含 ${...}\n if (!templateRegex.test(input)) {\n return [input]; // 返回原始字符串\n }\n\n // 匹配所有 ${...} 模式\n const matches = input.match(templateRegex);\n\n if (!matches || matches.length === 0) {\n return [input]; // 返回原始字符串\n }\n\n // 分割字符串,同时保留 ${...} 模式\n const result = input.split(templateRegex).filter(Boolean); // 去掉空字符串\n\n // 将匹配到的 ${...} 模式重新插入到结果数组中\n matches.forEach((match, index) => {\n result.splice(index * 2 + 1, 0, match); // 插入到对应位置\n });\n\n return result;\n};\n\nconst getParamsContentByParamKeysForEvent = (\n paramNames: string,\n data: { [key: string]: any } = {},\n) => {\n let paramNameList: string[] = [];\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n if (paramNames && typeof paramNames === 'string') {\n const matchs = regex.exec(paramNames);\n if (matchs?.[1]) {\n paramNameList = matchs?.[1]?.split('.');\n }\n }\n\n // 如果替换不成功,需要返回字符串原始的值\n return paramNameList.length > 0\n ? loopNodeByParamsPath(paramNameList, data) || ''\n : paramNames;\n};\n\n\n/**\n * 提供给事件参数转换那边的方法\n * 和replaceParamsValue 区别,\n * 1、不能去掉pageParams那一层\n * 2、字符串拼对象,需要把对象做JSON.stringify转换\n * 3、如果替换不成功,需要返回字符串原始的值\n * @param contentStr \"你好\" ,\"你$好, ${pageParams.userName}\" , \"${pageData}, ${pageParams.userList[0]}\"\n * @param data 数据\n */\nexport const replaceParamsValueForEvent = (\n contentStr: string,\n data: { [key: string]: any } = {},\n) => {\n if (!contentStr || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n\n const valueArr = splitStringWithTemplateLiteral(contentStr);\n // 单个字符串, 没有拼接\n if (valueArr.length === 1) {\n return getParamsContentByParamKeysForEvent(valueArr[0], data);\n }\n\n\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && data) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeysForEvent(match, data);\n if (typeof filedVal === 'string') {\n return filedVal;\n }\n // 字符串拼对象,需要把对象做JSON.stringify转换\n try {\n return JSON.stringify(filedVal);\n } catch {\n return '';\n }\n });\n }\n return nowTemp;\n};\n\n/** ======上面几个方法主要提供给事件参数使用 勿共用 ===== */\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+B;AAC/B,4BAAyB;AAElB,IAAM,aAAa,CAAC,YAAoB;AAC7C,MAAI,WAAoB,CAAC;AACzB,MAAI,WAAW,OAAO,YAAY,UAAU;AAC1C,UAAM,cAAc;AACpB,UAAM,QAAQ;AACd,QAAI,SA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AM,CAAC,GAAG,UAAU;AAG/D,YAAI,CAAC,YAAY,YAAY;AAC3B,gBAAM,kBAAc,yBAAU,UAAU;AACxC,cAAI,MAAM,QAAQ,aAAa,KAAK,cAAc,SAAS,GAAG;AAC5D,0BAAc,QAAQ,CAAC,cAAqB;AAC1C,qBAAO,YAAY,SAAS;AAAA,YAC9B,CAAC;AAAA,UACH;AACA,gBAAM,gBAAgB,WAAW,KAAK;AACtC,qBAAW,qBAAqB,eAAe,WAAW;AAAA,QAC5D;AAAA,MACF;AACA,aAAO,YAAY;AAAA,IACrB,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,IAAM,qBAAqB,CAChC,YACA,UAAkC,CAAC,
|
|
4
|
+
"sourcesContent": ["import { get, cloneDeep } from 'lodash';\nimport escapeString from './markdownEscape';\n\nexport const getDataArr = (content: string) => {\n let matchArr:string[] = [];\n if (content && typeof content === 'string') {\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 变量正则表达式,${{xxx}}\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n let matchs = escapeRegex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n } else {\n matchs = regex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n }\n }\n return matchArr?.filter((item, idx) => !(idx === 0 && ['root', 'pageParams'].includes(item)) && !(idx === 1 && ['pageParams'].includes(item))); // 过滤掉第一个root,pageParams\n }\n return matchArr;\n};\n\nconst loopNodeByParamsPath:any = (\n paramsArr:string[],\n data: {[key:string]: any},\n escape:boolean = false\n) => {\n if (Array.isArray(paramsArr) && paramsArr.length > 0) {\n for (const keyword of paramsArr) {\n const dataNode = get(data, keyword);\n let nextParamsArr = paramsArr.slice(1); // 取下一个节点字段\n if (Array.isArray(dataNode)) {\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(nextParamsArr?.[0])) {\n const idxNum = nextParamsArr?.[0].replace(/\\[|\\]/g, '');\n if (dataNode?.[Number(idxNum)] instanceof Object) {\n return loopNodeByParamsPath(nextParamsArr.slice(1), dataNode?.[Number(idxNum)], escape);\n }\n return escape ? escapeString(dataNode?.[Number(idxNum)]) : dataNode?.[Number(idxNum)];\n }\n // 否则或缺中间节点,直接往下取值\n nextParamsArr = nextParamsArr.slice(1);\n if (nextParamsArr?.length >= 1) {\n return dataNode.map((item:any) => {\n // 如果数组节点是对象,则继续递归取值\n if (item instanceof Object && nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, item, escape);\n }\n // 否则直接返回数组值\n return escape ? escapeString(item) : item;\n });\n }\n return dataNode;\n } if (nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, dataNode, escape);\n }\n return escape ? escapeString(dataNode) : dataNode;\n }\n }\n return '';\n};\n\n\nexport const getParamsContentByParamKeys = (paramNames: string, data: {[key:string]: any} = {}) => {\n if (!paramNames || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 匹配${{}}格式的参数,属于需转义内容\n const paramNameList = getDataArr(paramNames);\n return loopNodeByParamsPath(paramNameList, data, escapeRegex.test(paramNames));\n};\n\n// 获取替换循环体内的参数值\nexport const replaceLoopBodyParamsValue = (\n contentStr: string,\n options: {\n loopParams: { [key: string]: any } // 循环体参数\n loopSourceArr: string[], // 循环体数据源\n loopData: {[key: string]: any}[], // 循环数据源数据\n parameters?: {[key: string]: any}, // 全量参数\n staticCodeMap?: {[key: string]: any}, // 静态数据\n },\n) => {\n const {\n loopParams = {},\n loopSourceArr = [],\n loopData = [],\n parameters = {},\n } = options || {};\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && loopParams) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/gi, (match) => {\n const paramsPath = getDataArr(match).filter((itemKey) => !loopSourceArr.includes(itemKey));\n let filedVal:any = '';\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(paramsPath?.[0])) {\n const idxNum = paramsPath?.[0].replace(/\\[|\\]/g, '');\n if (loopData?.[Number(idxNum)] instanceof Object) {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopData?.[Number(idxNum)]);\n } else {\n filedVal = loopData?.[Number(idxNum)] || '';\n }\n } else {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopParams);\n\n // 循环体内查找不到,则从参数中取值,但忽略循环体本身\n if (!filedVal && parameters) {\n const _parameters = cloneDeep(parameters);\n if (Array.isArray(loopSourceArr) && loopSourceArr.length > 0) {\n loopSourceArr.forEach((sourceKey:string) => {\n delete _parameters[sourceKey];\n });\n }\n const paramNameList = getDataArr(match);\n filedVal = loopNodeByParamsPath(paramNameList, _parameters);\n }\n }\n return filedVal || '';\n });\n }\n return nowTemp;\n};\n\nexport const replaceParamsValue = (\n contentStr: string,\n pararms: { [key: string]: any } = {},\n isObject2String: boolean = false,\n) => {\n let nowContent:string = '';\n if (typeof contentStr === 'string' && contentStr && pararms) {\n nowContent = contentStr.replace(/\\$\\{\\{?[^{}]+}?\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeys(match, pararms);\n if (isObject2String && typeof filedVal === 'object') {\n return JSON.stringify(filedVal);\n }\n return filedVal || '';\n });\n }\n return nowContent;\n};\n\n\n/** ======下面几个方法主要提供给事件参数使用 勿共用 ===== */\nconst splitStringWithTemplateLiteral = (input: string) => {\n // 正则表达式:匹配 ${...} 模式\n const templateRegex = /\\$\\{[^}]*\\}/;\n\n // 检查字符串是否包含 ${...}\n if (!templateRegex.test(input)) {\n return [input]; // 返回原始字符串\n }\n\n // 匹配所有 ${...} 模式\n const matches = input.match(templateRegex);\n\n if (!matches || matches.length === 0) {\n return [input]; // 返回原始字符串\n }\n\n // 分割字符串,同时保留 ${...} 模式\n const result = input.split(templateRegex).filter(Boolean); // 去掉空字符串\n\n // 将匹配到的 ${...} 模式重新插入到结果数组中\n matches.forEach((match, index) => {\n result.splice(index * 2 + 1, 0, match); // 插入到对应位置\n });\n\n return result;\n};\n\nconst getParamsContentByParamKeysForEvent = (\n paramNames: string,\n data: { [key: string]: any } = {},\n) => {\n let paramNameList: string[] = [];\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n if (paramNames && typeof paramNames === 'string') {\n const matchs = regex.exec(paramNames);\n if (matchs?.[1]) {\n paramNameList = matchs?.[1]?.split('.');\n }\n }\n\n // 如果替换不成功,需要返回字符串原始的值\n return paramNameList.length > 0\n ? loopNodeByParamsPath(paramNameList, data) || ''\n : paramNames;\n};\n\n\n/**\n * 提供给事件参数转换那边的方法\n * 和replaceParamsValue 区别,\n * 1、不能去掉pageParams那一层\n * 2、字符串拼对象,需要把对象做JSON.stringify转换\n * 3、如果替换不成功,需要返回字符串原始的值\n * @param contentStr \"你好\" ,\"你$好, ${pageParams.userName}\" , \"${pageData}, ${pageParams.userList[0]}\"\n * @param data 数据\n */\nexport const replaceParamsValueForEvent = (\n contentStr: string,\n data: { [key: string]: any } = {},\n) => {\n if (!contentStr || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n\n const valueArr = splitStringWithTemplateLiteral(contentStr);\n // 单个字符串, 没有拼接\n if (valueArr.length === 1) {\n return getParamsContentByParamKeysForEvent(valueArr[0], data);\n }\n\n\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && data) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeysForEvent(match, data);\n if (typeof filedVal === 'string') {\n return filedVal;\n }\n // 字符串拼对象,需要把对象做JSON.stringify转换\n try {\n return JSON.stringify(filedVal);\n } catch {\n return '';\n }\n });\n }\n return nowTemp;\n};\n\n/** ======上面几个方法主要提供给事件参数使用 勿共用 ===== */\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;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PropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
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); }
|
|
7
7
|
import security from '@lingxiteam/security';
|
|
8
|
-
import { argsToString } from "./pathArgsUtils";
|
|
8
|
+
import { argsToString, getSearchObj } from "./pathArgsUtils";
|
|
9
9
|
|
|
10
10
|
// 暂时放到utils中,后续考虑独立在@boteteam/service包
|
|
11
11
|
|
|
@@ -21,15 +21,22 @@ var DEFAULT_PREFIX = "".concat(process.env.REACT_APP_REQ_PREFIX, "/bote");
|
|
|
21
21
|
* @returns 文件URL地址
|
|
22
22
|
*/
|
|
23
23
|
export var getFileUrlById = function getFileUrlById(fileId) {
|
|
24
|
+
var _getSearchObj;
|
|
24
25
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
25
26
|
prefix = _ref.prefix,
|
|
26
27
|
_ref$isSecurity = _ref.isSecurity,
|
|
27
28
|
isSecurity = _ref$isSecurity === void 0 ? true : _ref$isSecurity,
|
|
28
29
|
params = _ref.params;
|
|
29
30
|
var baseUrl = prefix ? prefix.replace(/\/$/, '') : DEFAULT_PREFIX;
|
|
30
|
-
|
|
31
|
+
// 如果url中存在token,则把token添加到query参数中
|
|
32
|
+
var token = ((_getSearchObj = getSearchObj()) === null || _getSearchObj === void 0 ? void 0 : _getSearchObj.token) || '';
|
|
33
|
+
var queryParams = _objectSpread({
|
|
31
34
|
fileId: fileId
|
|
32
|
-
}, params)
|
|
35
|
+
}, params);
|
|
36
|
+
if (token) {
|
|
37
|
+
queryParams.token = token;
|
|
38
|
+
}
|
|
39
|
+
var query = argsToString(queryParams);
|
|
33
40
|
var url = "".concat(baseUrl, "/file/download?").concat(query);
|
|
34
41
|
return isSecurity ? security.autoSecurityWithUrl(url) : url;
|
|
35
42
|
};
|
package/dist/esm/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["security","argsToString","DEFAULT_PREFIX","concat","process","env","REACT_APP_REQ_PREFIX","getFileUrlById","fileId","_ref","arguments","length","undefined","prefix","_ref$isSecurity","isSecurity","params","baseUrl","replace","
|
|
1
|
+
{"version":3,"names":["security","argsToString","getSearchObj","DEFAULT_PREFIX","concat","process","env","REACT_APP_REQ_PREFIX","getFileUrlById","fileId","_getSearchObj","_ref","arguments","length","undefined","prefix","_ref$isSecurity","isSecurity","params","baseUrl","replace","token","queryParams","_objectSpread","query","url","autoSecurityWithUrl","getRemoteComponentUrl","_ref2","_ref2$isSecurity","_ref2$params","getRemoteComponentUrlByCode","pageCode","options","getRemoteComponentUrlById","fileInfoId"],"sources":["../../src/file.ts"],"sourcesContent":["import security from '@lingxiteam/security';\nimport { argsToString, getSearchObj } from './pathArgsUtils';\n\n// 暂时放到utils中,后续考虑独立在@boteteam/service包\n\nconst DEFAULT_PREFIX = `${process.env.REACT_APP_REQ_PREFIX}/bote`;\n\n/**\n * 根据文件ID生成文件URL地址\n * @param fileId 文件ID\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getFileUrlById = (\n fileId: string,\n {\n prefix,\n isSecurity = true,\n params,\n }: {\n prefix?: string;\n isSecurity?: boolean;\n params?: Record<string, any>;\n } = {},\n) => {\n const baseUrl = prefix ? prefix.replace(/\\/$/, '') : DEFAULT_PREFIX;\n // 如果url中存在token,则把token添加到query参数中\n const token = getSearchObj()?.token || '';\n const queryParams:{[key:string]:any} = {\n fileId,\n ...params,\n };\n if (token) {\n queryParams.token = token;\n }\n const query = argsToString(queryParams);\n const url = `${baseUrl}/file/download?${query}`;\n return isSecurity ? security.autoSecurityWithUrl(url) : url;\n};\n\nconst getRemoteComponentUrl = ({\n prefix,\n isSecurity = true,\n params = {},\n}: {\n prefix?: string;\n isSecurity?: boolean;\n params?: Record<string, any>;\n} = {}) => {\n const baseUrl = prefix ? prefix.replace(/\\/$/, '') : DEFAULT_PREFIX;\n const query = argsToString(params);\n const url = `${baseUrl}/manager/skill/page/getRemoteComponent?${query}`;\n return isSecurity ? security.autoSecurityWithUrl(url) : url;\n};\n\n/**\n * 根据页面编码生成远程组件URL地址\n * @param pageCode 页面编码\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getRemoteComponentUrlByCode = (\n pageCode: string,\n options: Parameters<typeof getRemoteComponentUrl>[0],\n) => {\n return getRemoteComponentUrl({\n ...options,\n params: { pageCode, ...options?.params },\n });\n};\n\n/**\n * 根据文件ID生成远程组件URL地址\n * @param fileInfoId 文件ID\n * @param options 配置选项\n * @param options.prefix 自定义请求前缀(默认使用环境变量配置)\n * @param options.isSecurity 是否启用安全处理(默认true), 将对url地址参数加密或加签\n * @param options.params 自定义参数,将添加到query参数中\n * @returns 文件URL地址\n */\nexport const getRemoteComponentUrlById = (\n fileInfoId: string,\n options: Parameters<typeof getRemoteComponentUrl>[0],\n) => {\n return getRemoteComponentUrl({\n ...options,\n params: { fileInfoId, ...options?.params },\n });\n};\n"],"mappings":";;;;;;AAAA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,YAAY,EAAEC,YAAY;;AAEnC;;AAEA,IAAMC,cAAc,MAAAC,MAAA,CAAMC,OAAO,CAACC,GAAG,CAACC,oBAAoB,UAAO;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,cAAc,GAAG,SAAjBA,c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