@boteteam/utils 0.0.15 → 0.0.18
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 +31 -1
- 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/formatFormProps.js +20 -27
- package/dist/cjs/formatModule/helpers/formatFormProps.js.map +2 -2
- package/dist/cjs/formatModule/helpers/formatStepsProps.d.ts +23 -0
- package/dist/cjs/formatModule/helpers/formatStepsProps.js +88 -0
- package/dist/cjs/formatModule/helpers/formatStepsProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatTableProps.d.ts +11 -0
- package/dist/cjs/formatModule/helpers/formatTableProps.js +76 -6
- package/dist/cjs/formatModule/helpers/formatTableProps.js.map +2 -2
- package/dist/cjs/formatModule/helpers/index.d.ts +3 -1
- package/dist/cjs/formatModule/helpers/index.js +6 -0
- package/dist/cjs/formatModule/helpers/index.js.map +3 -3
- package/dist/cjs/formatModule/helpers/stringPramarsValTransition.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/securityUtils.d.ts +28 -0
- package/dist/cjs/securityUtils.js +103 -0
- package/dist/cjs/securityUtils.js.map +7 -0
- 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 -7
- 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/formatFormProps.js +25 -32
- package/dist/esm/formatModule/helpers/formatFormProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatStepsProps.d.ts +23 -0
- package/dist/esm/formatModule/helpers/formatStepsProps.js +58 -0
- package/dist/esm/formatModule/helpers/formatStepsProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatTableProps.d.ts +11 -0
- package/dist/esm/formatModule/helpers/formatTableProps.js +73 -6
- package/dist/esm/formatModule/helpers/formatTableProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/index.d.ts +3 -1
- package/dist/esm/formatModule/helpers/index.js +3 -1
- package/dist/esm/formatModule/helpers/index.js.map +1 -1
- package/dist/esm/formatModule/helpers/stringPramarsValTransition.d.ts +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/securityUtils.d.ts +28 -0
- package/dist/esm/securityUtils.js +101 -0
- package/dist/esm/securityUtils.js.map +1 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["itemLabel", "itemContent", "itemDescribe", "dataSource", "fileProps", "attrs", "rowSelection", "hasSelectAll", "rowKey", "fieldName", "column", "articleContent", "eventFlag"];
|
|
1
|
+
var _excluded = ["itemLabel", "itemContent", "itemDescribe", "dataSource", "columns", "tableBodyHeight", "fileProps", "attrs", "rowSelection", "hasSelectAll", "rowKey", "fieldName", "column", "articleContent", "eventFlag"];
|
|
2
2
|
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); }
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
9
9
|
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); }
|
|
10
10
|
import 'ses';
|
|
11
11
|
import { getDataArr } from "../treeUtils";
|
|
12
|
-
import { urlPrefix, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatFormProps, formatHighCodeProps, formatDescriptionsProps, formatLoopProps, formatStyleProps, formatEchartLineProps, formatEchartPieProps, staticCodeAssemble, stringPramarsValTransition } from "./helpers";
|
|
12
|
+
import { urlPrefix, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatFormProps, formatHighCodeProps, formatDescriptionsProps, formatLoopProps, formatStyleProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatStepsProps, staticCodeAssemble, stringPramarsValTransition } from "./helpers";
|
|
13
13
|
var formatModuleData = function formatModuleData(_ref) {
|
|
14
14
|
var moduleData = _ref.moduleData,
|
|
15
15
|
parentModuleData = _ref.parentModuleData,
|
|
@@ -45,6 +45,8 @@ var formatModuleData = function formatModuleData(_ref) {
|
|
|
45
45
|
listItemContent = _ref2.itemContent,
|
|
46
46
|
listItemDescribe = _ref2.itemDescribe,
|
|
47
47
|
compDataSource = _ref2.dataSource,
|
|
48
|
+
compColumns = _ref2.columns,
|
|
49
|
+
tableBodyHeight = _ref2.tableBodyHeight,
|
|
48
50
|
fileProps = _ref2.fileProps,
|
|
49
51
|
attrs = _ref2.attrs,
|
|
50
52
|
rowSelection = _ref2.rowSelection,
|
|
@@ -146,10 +148,12 @@ var formatModuleData = function formatModuleData(_ref) {
|
|
|
146
148
|
if (compType === 'table') {
|
|
147
149
|
var _moduleDataRes4;
|
|
148
150
|
var tableProps = formatTableProps({
|
|
149
|
-
options: {
|
|
151
|
+
options: _objectSpread(_objectSpread({}, otherCompProps), {}, {
|
|
152
|
+
columns: compColumns,
|
|
153
|
+
dataSource: compDataSource,
|
|
150
154
|
attrs: attrs,
|
|
151
|
-
|
|
152
|
-
},
|
|
155
|
+
tableBodyHeight: tableBodyHeight
|
|
156
|
+
}),
|
|
153
157
|
staticCodeMap: staticCodeMap,
|
|
154
158
|
parameters: allParametrs
|
|
155
159
|
});
|
|
@@ -277,6 +281,24 @@ var formatModuleData = function formatModuleData(_ref) {
|
|
|
277
281
|
});
|
|
278
282
|
moduleDataRes.compProps = _objectSpread(_objectSpread({}, moduleDataRes.compProps || {}), _echartProps);
|
|
279
283
|
}
|
|
284
|
+
if (compType === 'charts') {
|
|
285
|
+
var chartsProps = formatChartsProps({
|
|
286
|
+
options: {
|
|
287
|
+
echartsOptions: compProps === null || compProps === void 0 ? void 0 : compProps.echartsOptions
|
|
288
|
+
},
|
|
289
|
+
parameters: allParametrs
|
|
290
|
+
});
|
|
291
|
+
moduleDataRes.compProps = _objectSpread(_objectSpread({}, moduleDataRes.compProps || {}), chartsProps);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (compType === 'steps') {
|
|
295
|
+
var stepsProps = formatStepsProps({
|
|
296
|
+
options: _objectSpread({
|
|
297
|
+
dataSource: compDataSource
|
|
298
|
+
}, otherCompProps),
|
|
299
|
+
parameters: allParametrs
|
|
300
|
+
});
|
|
301
|
+
moduleDataRes.compProps = _objectSpread(_objectSpread({}, moduleDataRes.compProps || {}), stepsProps);
|
|
280
302
|
}
|
|
281
303
|
moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);
|
|
282
304
|
// 所有的模版 拼一个组装数据的key值
|
|
@@ -284,8 +306,6 @@ var formatModuleData = function formatModuleData(_ref) {
|
|
|
284
306
|
moduleDataRes.compProps.fieldName = fieldName;
|
|
285
307
|
}
|
|
286
308
|
}
|
|
287
|
-
|
|
288
|
-
// console.log('moduleDataRes', moduleDataRes);
|
|
289
309
|
return moduleDataRes;
|
|
290
310
|
};
|
|
291
311
|
export default formatModuleData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDataArr","urlPrefix","formatListProps","formatTableProps","formatCarouselProps","formatImageProps","formatFormProps","formatHighCodeProps","formatDescriptionsProps","formatLoopProps","formatStyleProps","formatEchartLineProps","formatEchartPieProps","staticCodeAssemble","stringPramarsValTransition","formatModuleData","_ref","moduleData","parentModuleData","parameters","loopItemData","staticCodeList","disabled","pageData","moduleDataRes","allParametrs","_objectSpread","loopItem","_staticCodeAssemble","staticCodeMap","staticOptionsMap","compProps","compType","children","moduleTitle","moduleDescribe","id","key","originModule","_ref2","listItemLabel","itemLabel","listItemContent","itemContent","listItemDescribe","itemDescribe","compDataSource","dataSource","fileProps","attrs","rowSelection","hasSelectAll","rowKey","fieldName","column","articleContent","eventFlag","otherCompProps","_objectWithoutProperties","_excluded","title","checked","parentCompProps","indexOf","Array","isArray","length","childs","map","item","_Object$keys","Object","keys","forEach","compPropKey","type","rowKeyIndexArr","_rowKeyIndexArr$slice","slice","url","dataType","_moduleDataRes","carouselProps","options","_moduleDataRes2","imageProps","_moduleDataRes3","highCodeCompProps","_moduleDataRes4","tableProps","_moduleDataRes5","formProps","_moduleDataRes6","descriptionsProps","_loopProps$dataSource","_moduleDataRes10","loopProps","loopChilds","dataItem","_moduleDataRes7","_moduleDataRes8","_moduleDataRes9","dataItemKey","push","originItem","loopChildInfo","_typeof","includes","resProps","echartProps","style"],"sources":["../../../src/formatModule/formatModuleData.ts"],"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 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 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 attrs,\n dataSource: compDataSource,\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 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"],"mappings":";;;;;;;;;AAAA,OAAO,KAAK;AACZ,SAASA,UAAU;AACnB,SACEC,SAAS,EACTC,eAAe,EACfC,gBAAgB,EAChBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,mBAAmB,EACnBC,uBAAuB,EACvBC,eAAe,EACfC,gBAAgB,EAChBC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,0BAA0B;AAa5B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAQkC;EAAA,IAPtDC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAChBC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,cAAc,GAAAL,IAAA,CAAdK,cAAc;IACdC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;EAER,IAAIC,aAAqC,GAAG,CAAE,CAAC;EAC/C,IAAMC,YAAmC,GAAAC,aAAA,CAAAA,aAAA,KACnCP,UAAU,IAAI,CAAC,CAAC;IACpBI,QAAQ,EAAEA,QAAQ,IAAI,CAAC,CAAC;IACxBI,QAAQ,EAAEP,YAAY,IAAI,CAAC;EAAC,EAC7B,CAAC,CAAC;EACH,IAAAQ,mBAAA,GAGIf,kBAAkB,CAACQ,cAAc,CAAC;IAFpCQ,aAAa,GAAAD,mBAAA,CAAbC,aAAa;IACbC,gBAAgB,GAAAF,mBAAA,CAA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UACxCwE,OAAO,EAAAzD,aAAA,CAAAA,aAAA,KAAO+B,cAAc;YAAEV,UAAU,EAAED;UAAc,EAAE;UAC1D3B,UAAU,EAAEM;QACd,CAAC,CAAC;QAEFD,aAAa,CAACO,SAAS,GAAAL,aAAA,CAAAA,aAAA,KACjBF,aAAa,CAACO,SAAS,IAAI,CAAC,CAAC,GAC9B8E,WAAW,CACf;MACH;MACA,IAAI7E,QAAQ,KAAK,WAAW,EAAE;QAC5B,IAAM6E,YAAW,GAAGjG,oBAAoB,CAAC;UACvCuE,OAAO,EAAAzD,aAAA;YACLqB,UAAU,EAAED;UAAc,GACvBW,cAAc,CAClB;UACDtC,UAAU,EAAEM;QACd,CAAC,CAAC;QAEFD,aAAa,CAACO,SAAS,GAAAL,aAAA,CAAAA,aAAA,KACjBF,aAAa,CAACO,SAAS,IAAI,CAAC,CAAC,GAC9B8E,YAAW,CACf;MACH;IACF;IACArF,aAAa,CAACO,SAAS,CAAC+E,KAAK,GAAGpG,gBAAgB,CAACO,UAAU,EAAEC,gBAAgB,CAAC;IAC9E;IACA,IAAID,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEc,SAAS,IAAIsB,SAAS,EAAE;MACtC7B,aAAa,CAACO,SAAS,CAACsB,SAAS,GAAGA,SAAS;IAC/C;EACF;;EAEA;EACA,OAAO7B,aAAa;AACtB,CAAC;AAED,eAAeT,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["getDataArr","urlPrefix","formatListProps","formatTableProps","formatCarouselProps","formatImageProps","formatFormProps","formatHighCodeProps","formatDescriptionsProps","formatLoopProps","formatStyleProps","formatEchartLineProps","formatEchartPieProps","formatChartsProps","formatStepsProps","staticCodeAssemble","stringPramarsValTransition","formatModuleData","_ref","moduleData","parentModuleData","parameters","loopItemData","staticCodeList","disabled","pageData","moduleDataRes","allParametrs","_objectSpread","loopItem","_staticCodeAssemble","staticCodeMap","staticOptionsMap","compProps","compType","children","moduleTitle","moduleDescribe","id","key","originModule","_ref2","listItemLabel","itemLabel","listItemContent","itemContent","listItemDescribe","itemDescribe","compDataSource","dataSource","compColumns","columns","tableBodyHeight","fileProps","attrs","rowSelection","hasSelectAll","rowKey","fieldName","column","articleContent","eventFlag","otherCompProps","_objectWithoutProperties","_excluded","title","checked","parentCompProps","indexOf","Array","isArray","length","childs","map","item","_Object$keys","Object","keys","forEach","compPropKey","type","rowKeyIndexArr","_rowKeyIndexArr$slice","slice","url","dataType","_moduleDataRes","carouselProps","options","_moduleDataRes2","imageProps","_moduleDataRes3","highCodeCompProps","_moduleDataRes4","tableProps","_moduleDataRes5","formProps","_moduleDataRes6","descriptionsProps","_loopProps$dataSource","_moduleDataRes10","loopProps","loopChilds","dataItem","_moduleDataRes7","_moduleDataRes8","_moduleDataRes9","dataItemKey","push","originItem","loopChildInfo","_typeof","includes","resProps","echartProps","chartsProps","echartsOptions","stepsProps","style"],"sources":["../../../src/formatModule/formatModuleData.ts"],"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 ...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 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"],"mappings":";;;;;;;;;AAAA,OAAO,KAAK;AACZ,SAASA,UAAU;AACnB,SACEC,SAAS,EACTC,eAAe,EACfC,gBAAgB,EAChBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,mBAAmB,EACnBC,uBAAuB,EACvBC,eAAe,EACfC,gBAAgB,EAChBC,qBAAqB,EACrBC,oBAAoB,EACpBC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,0BAA0B;AAa5B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB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};
|
|
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,12 @@
|
|
|
1
|
+
import stringPramarsValTransition from "./stringPramarsValTransition";
|
|
2
|
+
var formatChartsProps = function formatChartsProps(_ref) {
|
|
3
|
+
var parameters = _ref.parameters,
|
|
4
|
+
_ref$options = _ref.options,
|
|
5
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
6
|
+
var echartsOptions = options.echartsOptions;
|
|
7
|
+
return {
|
|
8
|
+
options: stringPramarsValTransition(echartsOptions || '', parameters, true)
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default formatChartsProps;
|
|
12
|
+
//# sourceMappingURL=formatChartsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stringPramarsValTransition","formatChartsProps","_ref","parameters","_ref$options","options","echartsOptions"],"sources":["../../../../src/formatModule/helpers/formatChartsProps.ts"],"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"],"mappings":"AAAA,OAAOA,0BAA0B;AAajC,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAGmC;EAAA,IAFxDC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IAAAC,YAAA,GAAAF,IAAA,CACVG,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;EAEZ,IACEE,cAAc,GACZD,OAAO,CADTC,cAAc;EAGhB,OAAO;IACLD,OAAO,EAAEL,0BAA0B,CAACM,cAAc,IAAI,EAAE,EAAEH,UAAU,EAAE,IAAI;EAC5E,CAAC;AACH,CAAC;AAED,eAAeF,iBAAiB"}
|
|
@@ -86,30 +86,23 @@ var formatFormProps = function formatFormProps(_ref) {
|
|
|
86
86
|
delete formItem.formProps.extend;
|
|
87
87
|
}
|
|
88
88
|
if ((attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType) === 'table') {
|
|
89
|
-
var _attrItem$compProps, _attrItem$compProps2, _attrItem$compProps3, _attrItem$compProps4, _attrItem$compProps5
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}),
|
|
98
|
-
columns = _formatTableProps.columns,
|
|
99
|
-
dataSource = _formatTableProps.dataSource;
|
|
100
|
-
var rowKeys = getDataArr(attrItem === null || attrItem === void 0 || (_attrItem$compProps3 = attrItem.compProps) === null || _attrItem$compProps3 === void 0 ? void 0 : _attrItem$compProps3.rowKey);
|
|
101
|
-
formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
|
|
102
|
-
columns: columns,
|
|
103
|
-
dataSource: dataSource,
|
|
89
|
+
var _attrItem$compProps, _attrItem$compProps2, _attrItem$compProps3, _attrItem$compProps4, _attrItem$compProps5;
|
|
90
|
+
var tableProps = formatTableProps({
|
|
91
|
+
options: attrItem === null || attrItem === void 0 ? void 0 : attrItem.compProps,
|
|
92
|
+
staticCodeMap: staticCodeMap,
|
|
93
|
+
parameters: parameters
|
|
94
|
+
});
|
|
95
|
+
var rowKeys = getDataArr(attrItem === null || attrItem === void 0 || (_attrItem$compProps = attrItem.compProps) === null || _attrItem$compProps === void 0 ? void 0 : _attrItem$compProps.rowKey);
|
|
96
|
+
formItem.props = _objectSpread(_objectSpread(_objectSpread({}, formItem.props), tableProps), {}, {
|
|
104
97
|
rowKey: (rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys.length) > 0 ? rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys[(rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys.length) - 1] : 'key',
|
|
105
|
-
hasSelectAll: attrItem !== null && attrItem !== void 0 && (_attrItem$
|
|
106
|
-
rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$
|
|
98
|
+
hasSelectAll: attrItem !== null && attrItem !== void 0 && (_attrItem$compProps2 = attrItem.compProps) !== null && _attrItem$compProps2 !== void 0 && _attrItem$compProps2.rowSelection && attrItem !== null && attrItem !== void 0 && (_attrItem$compProps3 = attrItem.compProps) !== null && _attrItem$compProps3 !== void 0 && _attrItem$compProps3.hasSelectAll ? attrItem === null || attrItem === void 0 || (_attrItem$compProps4 = attrItem.compProps) === null || _attrItem$compProps4 === void 0 ? void 0 : _attrItem$compProps4.hasSelectAll : null,
|
|
99
|
+
rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps5 = attrItem.compProps) === null || _attrItem$compProps5 === void 0 ? void 0 : _attrItem$compProps5.rowSelection) || {
|
|
107
100
|
type: 'radio'
|
|
108
101
|
}
|
|
109
102
|
});
|
|
110
103
|
}
|
|
111
104
|
if (['list', 'card'].includes(attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType)) {
|
|
112
|
-
var _attrItem$
|
|
105
|
+
var _attrItem$compProps6;
|
|
113
106
|
var resProps = formatListProps({
|
|
114
107
|
options: attrItem === null || attrItem === void 0 ? void 0 : attrItem.compProps,
|
|
115
108
|
staticCodeMap: staticCodeMap,
|
|
@@ -117,35 +110,35 @@ var formatFormProps = function formatFormProps(_ref) {
|
|
|
117
110
|
urlPrefix: urlPrefix
|
|
118
111
|
});
|
|
119
112
|
formItem.props = _objectSpread(_objectSpread({}, resProps), {}, {
|
|
120
|
-
rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$
|
|
113
|
+
rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps6 = attrItem.compProps) === null || _attrItem$compProps6 === void 0 ? void 0 : _attrItem$compProps6.rowSelection) || {
|
|
121
114
|
type: 'radio'
|
|
122
115
|
}
|
|
123
116
|
});
|
|
124
117
|
}
|
|
125
118
|
if ((attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType) === 'upload') {
|
|
126
|
-
var _attrItem$
|
|
127
|
-
if (attrItem !== null && attrItem !== void 0 && (_attrItem$
|
|
128
|
-
var _attrItem$
|
|
119
|
+
var _attrItem$compProps7, _Object$keys, _attrItem$compProps8, _attrItem$compProps13, _attrItem$compProps14;
|
|
120
|
+
if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps7 = attrItem.compProps) !== null && _attrItem$compProps7 !== void 0 && _attrItem$compProps7.data && ((_Object$keys = Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps8 = attrItem.compProps) === null || _attrItem$compProps8 === void 0 ? void 0 : _attrItem$compProps8.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
|
|
121
|
+
var _attrItem$compProps9;
|
|
129
122
|
var uploadDataParams = {};
|
|
130
|
-
Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$
|
|
131
|
-
var _attrItem$
|
|
132
|
-
if (/\$\{(.+?)\}/g.test(attrItem === null || attrItem === void 0 || (_attrItem$
|
|
133
|
-
var _attrItem$
|
|
123
|
+
Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps9 = attrItem.compProps) === null || _attrItem$compProps9 === void 0 ? void 0 : _attrItem$compProps9.data).forEach(function (paramsName) {
|
|
124
|
+
var _attrItem$compProps10;
|
|
125
|
+
if (/\$\{(.+?)\}/g.test(attrItem === null || attrItem === void 0 || (_attrItem$compProps10 = attrItem.compProps) === null || _attrItem$compProps10 === void 0 || (_attrItem$compProps10 = _attrItem$compProps10.data) === null || _attrItem$compProps10 === void 0 ? void 0 : _attrItem$compProps10[paramsName])) {
|
|
126
|
+
var _attrItem$compProps11;
|
|
134
127
|
// const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);
|
|
135
|
-
uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem === null || attrItem === void 0 || (_attrItem$
|
|
128
|
+
uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem === null || attrItem === void 0 || (_attrItem$compProps11 = attrItem.compProps) === null || _attrItem$compProps11 === void 0 || (_attrItem$compProps11 = _attrItem$compProps11.data) === null || _attrItem$compProps11 === void 0 ? void 0 : _attrItem$compProps11[paramsName], parameters);
|
|
136
129
|
} else {
|
|
137
|
-
var _attrItem$
|
|
138
|
-
uploadDataParams[paramsName] = attrItem === null || attrItem === void 0 || (_attrItem$
|
|
130
|
+
var _attrItem$compProps12;
|
|
131
|
+
uploadDataParams[paramsName] = attrItem === null || attrItem === void 0 || (_attrItem$compProps12 = attrItem.compProps) === null || _attrItem$compProps12 === void 0 || (_attrItem$compProps12 = _attrItem$compProps12.data) === null || _attrItem$compProps12 === void 0 ? void 0 : _attrItem$compProps12[paramsName];
|
|
139
132
|
}
|
|
140
133
|
});
|
|
141
134
|
formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
|
|
142
135
|
data: uploadDataParams
|
|
143
136
|
});
|
|
144
137
|
}
|
|
145
|
-
if (attrItem !== null && attrItem !== void 0 && (_attrItem$
|
|
146
|
-
var _attrItem$
|
|
138
|
+
if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps13 = attrItem.compProps) !== null && _attrItem$compProps13 !== void 0 && (_attrItem$compProps13 = _attrItem$compProps13.action) !== null && _attrItem$compProps13 !== void 0 && _attrItem$compProps13.url && typeof (attrItem === null || attrItem === void 0 || (_attrItem$compProps14 = attrItem.compProps) === null || _attrItem$compProps14 === void 0 || (_attrItem$compProps14 = _attrItem$compProps14.action) === null || _attrItem$compProps14 === void 0 ? void 0 : _attrItem$compProps14.url) === 'string') {
|
|
139
|
+
var _attrItem$compProps15;
|
|
147
140
|
formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
|
|
148
|
-
action: attrItem === null || attrItem === void 0 || (_attrItem$
|
|
141
|
+
action: attrItem === null || attrItem === void 0 || (_attrItem$compProps15 = attrItem.compProps) === null || _attrItem$compProps15 === void 0 || (_attrItem$compProps15 = _attrItem$compProps15.action) === null || _attrItem$compProps15 === void 0 ? void 0 : _attrItem$compProps15.url
|
|
149
142
|
});
|
|
150
143
|
}
|
|
151
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["get","stringScriptExecution","getDataArr","getParamsContentByParamKeys","replaceParamsValue","formatTableProps","formatListProps","formRulsRegMap","urlPrefix","patternTransitionRegExp","formatOptionsRecursively","data","labelApiPath","valApiPath","map","item","option","label","value","children","Array","isArray","formatFormProps","_ref","parameters","staticCodeMap","staticOptionsMap","_ref$options","options","column","res","formItems","initValues","length","forEach","attrItem","_extend$controlBtns","_otherAttrFormProps$r","_attrItem$formProps","_ref2","attrCompProps","compProps","attrFormProps","formProps","_ref3","required","extend","attrFormPropsDisplay","display","otherAttrFormProps","_objectWithoutProperties","_excluded","_ref4","dataOptions","otherAttrCompProps","_excluded2","formItem","key","id","name","type","compType","props","originModule","text","_objectSpread","controlBtns","_attrItem$compProps","_attrItem$compProps2","_attrItem$compProps3","_attrItem$compProps4","_attrItem$compProps5","_attrItem$compProps6","_attrItem$compProps7","_formatTableProps","attrs","dataSource","columns","rowKeys","rowKey","hasSelectAll","rowSelection","includes","_attrItem$compProps8","resProps","_attrItem$compProps9","_Object$keys","_attrItem$compProps10","_attrItem$compProps15","_attrItem$compProps16","Object","keys","_attrItem$compProps11","uploadDataParams","paramsName","_attrItem$compProps12","test","_attrItem$compProps13","_attrItem$compProps14","action","url","_attrItem$compProps17","otherRules","rules","filter","defaultValue","attrDefVal","_attrItem$formProps2","valuePropName","_attrItem$formProps3","pattern","message","formItemDisplay","codeExtendVal","formItemRequired","concat","_toConsumableArray","attrItemDataOptions","staticCode","_staticCodeMap$attrIt","_staticCodeMap$attrIt2","attrCode","formatToTreeData","optionsItems","optItem","title","treeData","contextOptions","_attrItemDataOptions$","_attrItemDataOptions$2","optLabelStr","optValueStr","splitParamsPath","paramsPathStr","paramsPathArr","replace","split","idx","optValArr","optLabelArr","optData","slice","push","formMode","span","initialValues"],"sources":["../../../../src/formatModule/helpers/formatFormProps.ts"],"sourcesContent":["import { get } from 'lodash';\nimport { stringScriptExecution } from './stringScriptExecution';\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport patternTransitionRegExp from './patternTransitionRegExp';\n\nexport type formatFormPropsType = {\n options?: {\n column?: number;\n children?: {[key:string]: any}[]\n }\n parameters: {[key:string]: any};\n staticCodeMap: {[key:string]: any};\n staticOptionsMap: {[key:string]: any};\n}\n\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\n return data.map((item) => {\n const option: any = {\n label: get(item, labelApiPath),\n value: get(item, valApiPath),\n };\n \n // 如果存在children属性,递归处理\n if (item.children && Array.isArray(item.children)) {\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\n }\n \n return option;\n });\n};\n\nconst formatFormProps = ({\n parameters,\n staticCodeMap,\n staticOptionsMap,\n options = {},\n}: formatFormPropsType):{[key:string]: any} => {\n const { children, column } = options;\n const res:{[key:string]: any} = {};\n const formItems: { [key: string]: any }[] = [];\n const initValues: { [key: string]: any } = {};\n if (Array.isArray(children) && children.length > 0) {\n children.forEach((attrItem) => {\n const {\n compProps: attrCompProps,\n formProps: attrFormProps,\n } = attrItem || {};\n const {\n required,\n extend,\n display: attrFormPropsDisplay,\n ...otherAttrFormProps\n } = attrFormProps || {};\n const {\n dataOptions,\n ...otherAttrCompProps\n } = attrCompProps || {};\n const formItem:{[key:string]: any} = {\n key: attrItem?.id,\n label: attrFormProps?.label,\n name: attrFormProps?.name,\n type: attrItem?.compType,\n props: otherAttrCompProps || {},\n formProps: otherAttrFormProps || {},\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\n };\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\n formItem.formProps = {\n ...formItem.formProps,\n extend: {\n ...extend,\n text: replaceParamsValue(extend?.text, parameters),\n },\n };\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\n formItem.formProps = {\n ...formItem.formProps,\n extend: {\n ...extend,\n controlBtns: extend?.controlBtns,\n },\n };\n } else {\n delete formItem.formProps.extend;\n }\n if (attrItem?.compType === 'table') {\n const {\n columns,\n dataSource,\n } = formatTableProps({\n options: {\n attrs: attrItem?.compProps?.attrs,\n dataSource: attrItem?.compProps?.dataSource,\n },\n staticCodeMap,\n parameters,\n });\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\n formItem.props = {\n ...formItem.props,\n columns,\n dataSource,\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\n };\n }\n if (['list', 'card'].includes(attrItem?.compType)) {\n const resProps = formatListProps({\n options: attrItem?.compProps,\n staticCodeMap,\n parameters,\n urlPrefix,\n });\n formItem.props = {\n ...resProps,\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\n };\n }\n if (attrItem?.compType === 'upload') {\n if (\n attrItem?.compProps?.data &&\n Object.keys(attrItem?.compProps?.data)?.length > 0\n ) {\n const uploadDataParams:{[key:string]: any} = {};\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\n } else {\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\n }\n });\n formItem.props = {\n ...formItem.props,\n data: uploadDataParams,\n };\n }\n if (\n attrItem?.compProps?.action?.url &&\n typeof attrItem?.compProps?.action?.url === 'string'\n ) {\n formItem.props = {\n ...formItem.props,\n action: attrItem?.compProps?.action?.url,\n };\n }\n }\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\n if (attrItem?.formProps?.defaultValue) {\n let attrDefVal:any = '';\n if (attrItem?.compType === 'upload') {\n formItem.formProps = {\n ...formItem.formProps,\n valuePropName: 'fileList',\n };\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\n } else {\n delete formItem.formProps.valuePropName;\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\n }\n initValues[otherAttrFormProps?.name] = attrDefVal;\n }\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\n formRulsRegMap?.[item?.type] || ''\n ),\n message: item?.message,\n }));\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\n let formItemDisplay:boolean = true;\n if (typeof attrFormPropsDisplay === 'boolean') {\n formItemDisplay = attrFormPropsDisplay;\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\n const codeExtendVal = stringScriptExecution(\n attrFormPropsDisplay,\n parameters,\n );\n formItemDisplay = codeExtendVal;\n }\n formItem.display = formItemDisplay;\n }\n if (typeof required === 'boolean' || typeof required === 'string') {\n let formItemRequired:boolean = false;\n if (typeof required === 'boolean') {\n formItemRequired = required;\n } else if (typeof required === 'string' && required) {\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\n const codeExtendVal = stringScriptExecution(required, parameters);\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\n }\n formItem.formProps = {\n ...formItem.formProps,\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\n };\n } else {\n formItem.formProps = {\n ...formItem.formProps,\n rules: otherRules,\n };\n }\n if (dataOptions) {\n const attrItemDataOptions = dataOptions || {};\n if (attrItemDataOptions?.staticCode) {\n if (\n attrItem?.defaultValue &&\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\n ) {\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\n }\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\n if (Array.isArray(optionsItems)) {\n return optionsItems.map(optItem => ({\n title: optItem?.label,\n value: optItem?.value,\n children: formatToTreeData(optItem?.children),\n }));\n }\n return [];\n };\n if (attrItem?.compType === 'treeSelect') {\n formItem.props = {\n ...formItem.props,\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\n };\n } else {\n formItem.props = {\n ...formItem.props,\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\n };\n }\n } else if (attrItemDataOptions?.contextOptions && parameters) {\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\n const splitParamsPath = (paramsPathStr: string) => {\n if (typeof paramsPathStr === 'string') {\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\n }\n return [];\n };\n if (optValueStr) {\n const optValArr = splitParamsPath(optValueStr);\n const optLabelArr = splitParamsPath(optLabelStr);\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\n const labelApiPath: string[] = optLabelArr?.slice(2);\n const valApiPath: string[] = optValArr?.slice(2);\n \n formItem.props = {\n ...formItem.props,\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\n };\n }\n }\n }\n formItems.push(formItem);\n });\n }\n if (typeof column === 'number' && column > 1) {\n res.formMode = 'grid';\n res.span = 24 / column;\n } else {\n res.formMode = 'default';\n delete res.span;\n }\n res.formItems = formItems;\n res.initialValues = initValues;\n return res;\n};\n\nexport default formatFormProps;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,UAAU,EAAEC,2BAA2B,EAAEC,kBAAkB;AACpE,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,OAAOC,uBAAuB;AAY9B,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,IAAW,EAAEC,YAAsB,EAAEC,UAAoB,EAAY;EACrG,OAAOF,IAAI,CAACG,GAAG,CAAC,UAACC,IAAI,EAAK;IACxB,IAAMC,MAAW,GAAG;MAClBC,KAAK,EAAEjB,GAAG,CAACe,IAAI,EAAEH,YAAY,CAAC;MAC9BM,KAAK,EAAElB,GAAG,CAACe,IAAI,EAAEF,UAAU;IAC7B,CAAC;;IAED;IACA,IAAIE,IAAI,CAACI,QAAQ,IAAIC,KAAK,CAACC,OAAO,CAACN,IAAI,CAACI,QAAQ,CAAC,EAAE;MACjDH,MAAM,CAACG,QAAQ,GAAGT,wBAAwB,CAACK,IAAI,CAACI,QAAQ,EAAEP,YAAY,EAAEC,UAAU,CAAC;IACrF;IAEA,OAAOG,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,IAAMM,eAAe,GAAG,SAAlBA,eAA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AAGxH,KAAK,CAACC,OAAO,CAACG,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGkH,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,CAAC,CAAC,CAAC,CAAC,GAAGlH,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGkH,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,CAAC,CAAC,CAAC,GAAG,EAAE;YACtG,IAAM9H,YAAsB,GAAG+H,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEE,KAAK,CAAC,CAAC,CAAC;YACpD,IAAMhI,UAAoB,GAAG6H,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEG,KAAK,CAAC,CAAC,CAAC;YAEhDrF,QAAQ,CAACM,KAAK,GAAAG,aAAA,CAAAA,aAAA,KACTT,QAAQ,CAACM,KAAK;cACjBlC,OAAO,EAAElB,wBAAwB,CAACkI,OAAO,EAAEhI,YAAY,EAAEC,UAAU;YAAC,EACrE;UACH;QACF;MACF;MACAkB,SAAS,CAAC+G,IAAI,CAACtF,QAAQ,CAAC;IAC1B,CAAC,CAAC;EACJ;EACA,IAAI,OAAO3B,MAAM,KAAK,QAAQ,IAAIA,MAAM,GAAG,CAAC,EAAE;IAC5CC,GAAG,CAACiH,QAAQ,GAAG,MAAM;IACrBjH,GAAG,CAACkH,IAAI,GAAG,EAAE,GAAGnH,MAAM;EACxB,CAAC,MAAM;IACLC,GAAG,CAACiH,QAAQ,GAAG,SAAS;IACxB,OAAOjH,GAAG,CAACkH,IAAI;EACjB;EACAlH,GAAG,CAACC,SAAS,GAAGA,SAAS;EACzBD,GAAG,CAACmH,aAAa,GAAGjH,UAAU;EAC9B,OAAOF,GAAG;AACZ,CAAC;AAED,eAAeR,eAAe"}
|
|
1
|
+
{"version":3,"names":["get","stringScriptExecution","getDataArr","getParamsContentByParamKeys","replaceParamsValue","formatTableProps","formatListProps","formRulsRegMap","urlPrefix","patternTransitionRegExp","formatOptionsRecursively","data","labelApiPath","valApiPath","map","item","option","label","value","children","Array","isArray","formatFormProps","_ref","parameters","staticCodeMap","staticOptionsMap","_ref$options","options","column","res","formItems","initValues","length","forEach","attrItem","_extend$controlBtns","_otherAttrFormProps$r","_attrItem$formProps","_ref2","attrCompProps","compProps","attrFormProps","formProps","_ref3","required","extend","attrFormPropsDisplay","display","otherAttrFormProps","_objectWithoutProperties","_excluded","_ref4","dataOptions","otherAttrCompProps","_excluded2","formItem","key","id","name","type","compType","props","originModule","text","_objectSpread","controlBtns","_attrItem$compProps","_attrItem$compProps2","_attrItem$compProps3","_attrItem$compProps4","_attrItem$compProps5","tableProps","rowKeys","rowKey","hasSelectAll","rowSelection","includes","_attrItem$compProps6","resProps","_attrItem$compProps7","_Object$keys","_attrItem$compProps8","_attrItem$compProps13","_attrItem$compProps14","Object","keys","_attrItem$compProps9","uploadDataParams","paramsName","_attrItem$compProps10","test","_attrItem$compProps11","_attrItem$compProps12","action","url","_attrItem$compProps15","otherRules","rules","filter","defaultValue","attrDefVal","_attrItem$formProps2","valuePropName","_attrItem$formProps3","pattern","message","formItemDisplay","codeExtendVal","formItemRequired","concat","_toConsumableArray","attrItemDataOptions","staticCode","_staticCodeMap$attrIt","_staticCodeMap$attrIt2","attrCode","formatToTreeData","optionsItems","optItem","title","treeData","contextOptions","_attrItemDataOptions$","_attrItemDataOptions$2","optLabelStr","optValueStr","splitParamsPath","paramsPathStr","paramsPathArr","replace","split","idx","optValArr","optLabelArr","optData","slice","push","formMode","span","initialValues"],"sources":["../../../../src/formatModule/helpers/formatFormProps.ts"],"sourcesContent":["import { get } from 'lodash';\nimport { stringScriptExecution } from './stringScriptExecution';\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport patternTransitionRegExp from './patternTransitionRegExp';\n\nexport type formatFormPropsType = {\n options?: {\n column?: number;\n children?: {[key:string]: any}[]\n }\n parameters: {[key:string]: any};\n staticCodeMap: {[key:string]: any};\n staticOptionsMap: {[key:string]: any};\n}\n\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\n return data.map((item) => {\n const option: any = {\n label: get(item, labelApiPath),\n value: get(item, valApiPath),\n };\n \n // 如果存在children属性,递归处理\n if (item.children && Array.isArray(item.children)) {\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\n }\n \n return option;\n });\n};\n\nconst formatFormProps = ({\n parameters,\n staticCodeMap,\n staticOptionsMap,\n options = {},\n}: formatFormPropsType):{[key:string]: any} => {\n const { children, column } = options;\n const res:{[key:string]: any} = {};\n const formItems: { [key: string]: any }[] = [];\n const initValues: { [key: string]: any } = {};\n if (Array.isArray(children) && children.length > 0) {\n children.forEach((attrItem) => {\n const {\n compProps: attrCompProps,\n formProps: attrFormProps,\n } = attrItem || {};\n const {\n required,\n extend,\n display: attrFormPropsDisplay,\n ...otherAttrFormProps\n } = attrFormProps || {};\n const {\n dataOptions,\n ...otherAttrCompProps\n } = attrCompProps || {};\n const formItem:{[key:string]: any} = {\n key: attrItem?.id,\n label: attrFormProps?.label,\n name: attrFormProps?.name,\n type: attrItem?.compType,\n props: otherAttrCompProps || {},\n formProps: otherAttrFormProps || {},\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\n };\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\n formItem.formProps = {\n ...formItem.formProps,\n extend: {\n ...extend,\n text: replaceParamsValue(extend?.text, parameters),\n },\n };\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\n formItem.formProps = {\n ...formItem.formProps,\n extend: {\n ...extend,\n controlBtns: extend?.controlBtns,\n },\n };\n } else {\n delete formItem.formProps.extend;\n }\n if (attrItem?.compType === 'table') {\n const tableProps = formatTableProps({\n options: attrItem?.compProps,\n staticCodeMap,\n parameters,\n });\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\n formItem.props = {\n ...formItem.props,\n ...tableProps,\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\n };\n }\n if (['list', 'card'].includes(attrItem?.compType)) {\n const resProps = formatListProps({\n options: attrItem?.compProps,\n staticCodeMap,\n parameters,\n urlPrefix,\n });\n formItem.props = {\n ...resProps,\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\n };\n }\n if (attrItem?.compType === 'upload') {\n if (\n attrItem?.compProps?.data &&\n Object.keys(attrItem?.compProps?.data)?.length > 0\n ) {\n const uploadDataParams:{[key:string]: any} = {};\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\n } else {\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\n }\n });\n formItem.props = {\n ...formItem.props,\n data: uploadDataParams,\n };\n }\n if (\n attrItem?.compProps?.action?.url &&\n typeof attrItem?.compProps?.action?.url === 'string'\n ) {\n formItem.props = {\n ...formItem.props,\n action: attrItem?.compProps?.action?.url,\n };\n }\n }\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\n if (attrItem?.formProps?.defaultValue) {\n let attrDefVal:any = '';\n if (attrItem?.compType === 'upload') {\n formItem.formProps = {\n ...formItem.formProps,\n valuePropName: 'fileList',\n };\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\n } else {\n delete formItem.formProps.valuePropName;\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\n }\n initValues[otherAttrFormProps?.name] = attrDefVal;\n }\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\n formRulsRegMap?.[item?.type] || ''\n ),\n message: item?.message,\n }));\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\n let formItemDisplay:boolean = true;\n if (typeof attrFormPropsDisplay === 'boolean') {\n formItemDisplay = attrFormPropsDisplay;\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\n const codeExtendVal = stringScriptExecution(\n attrFormPropsDisplay,\n parameters,\n );\n formItemDisplay = codeExtendVal;\n }\n formItem.display = formItemDisplay;\n }\n if (typeof required === 'boolean' || typeof required === 'string') {\n let formItemRequired:boolean = false;\n if (typeof required === 'boolean') {\n formItemRequired = required;\n } else if (typeof required === 'string' && required) {\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\n const codeExtendVal = stringScriptExecution(required, parameters);\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\n }\n formItem.formProps = {\n ...formItem.formProps,\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\n };\n } else {\n formItem.formProps = {\n ...formItem.formProps,\n rules: otherRules,\n };\n }\n if (dataOptions) {\n const attrItemDataOptions = dataOptions || {};\n if (attrItemDataOptions?.staticCode) {\n if (\n attrItem?.defaultValue &&\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\n ) {\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\n }\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\n if (Array.isArray(optionsItems)) {\n return optionsItems.map(optItem => ({\n title: optItem?.label,\n value: optItem?.value,\n children: formatToTreeData(optItem?.children),\n }));\n }\n return [];\n };\n if (attrItem?.compType === 'treeSelect') {\n formItem.props = {\n ...formItem.props,\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\n };\n } else {\n formItem.props = {\n ...formItem.props,\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\n };\n }\n } else if (attrItemDataOptions?.contextOptions && parameters) {\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\n const splitParamsPath = (paramsPathStr: string) => {\n if (typeof paramsPathStr === 'string') {\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\n }\n return [];\n };\n if (optValueStr) {\n const optValArr = splitParamsPath(optValueStr);\n const optLabelArr = splitParamsPath(optLabelStr);\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\n const labelApiPath: string[] = optLabelArr?.slice(2);\n const valApiPath: string[] = optValArr?.slice(2);\n \n formItem.props = {\n ...formItem.props,\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\n };\n }\n }\n }\n formItems.push(formItem);\n });\n }\n if (typeof column === 'number' && column > 1) {\n res.formMode = 'grid';\n res.span = 24 / column;\n } else {\n res.formMode = 'default';\n delete res.span;\n }\n res.formItems = formItems;\n res.initialValues = initValues;\n return res;\n};\n\nexport default formatFormProps;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,UAAU,EAAEC,2BAA2B,EAAEC,kBAAkB;AACpE,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,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,SAAS;EACzBD,GAAG,CAAC8G,aAAa,GAAG5G,UAAU;EAC9B,OAAOF,GAAG;AACZ,CAAC;AAED,eAAeR,eAAe"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type formatImagePropsType = {
|
|
2
|
+
options?: {
|
|
3
|
+
dataSource?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
direction?: string;
|
|
9
|
+
statusMap?: {
|
|
10
|
+
wait?: string;
|
|
11
|
+
process?: string;
|
|
12
|
+
finish?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
parameters?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
declare const formatStepsProps: ({ parameters, options, }: formatImagePropsType) => {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
export default formatStepsProps;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getDataArr, replaceLoopBodyParamsValue } from "../../treeUtils";
|
|
2
|
+
import { get } from 'lodash';
|
|
3
|
+
var formatStepsProps = function formatStepsProps(_ref) {
|
|
4
|
+
var parameters = _ref.parameters,
|
|
5
|
+
_ref$options = _ref.options,
|
|
6
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
7
|
+
var dataSource = options.dataSource,
|
|
8
|
+
title = options.title,
|
|
9
|
+
description = options.description,
|
|
10
|
+
status = options.status,
|
|
11
|
+
direction = options.direction,
|
|
12
|
+
statusMap = options.statusMap;
|
|
13
|
+
var res = {
|
|
14
|
+
size: 'small'
|
|
15
|
+
};
|
|
16
|
+
if (dataSource) {
|
|
17
|
+
var dataSourceArr = getDataArr(dataSource);
|
|
18
|
+
if (parameters) {
|
|
19
|
+
var dataSourceList = get(parameters, dataSourceArr);
|
|
20
|
+
var replaceParamsValue = function replaceParamsValue(contentStr, item) {
|
|
21
|
+
return replaceLoopBodyParamsValue(contentStr, {
|
|
22
|
+
parameters: parameters,
|
|
23
|
+
loopParams: item,
|
|
24
|
+
loopData: dataSourceList,
|
|
25
|
+
loopSourceArr: dataSourceArr
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
if (Array.isArray(dataSourceList)) {
|
|
29
|
+
res.items = dataSourceList.map(function (item) {
|
|
30
|
+
// 获取状态值
|
|
31
|
+
var recordStatus = status && replaceParamsValue(status, item) ? replaceParamsValue(status, item) : '';
|
|
32
|
+
// 根据状态映射,转换状态值为步骤状态
|
|
33
|
+
if (statusMap && Object.keys(statusMap).length > 0) {
|
|
34
|
+
Object.keys(statusMap).forEach(function (key) {
|
|
35
|
+
var statusValue = "".concat(statusMap === null || statusMap === void 0 ? void 0 : statusMap[key]) || '';
|
|
36
|
+
if (recordStatus && statusValue && "".concat(recordStatus) === statusValue) {
|
|
37
|
+
recordStatus = key;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
title: title ? replaceParamsValue(title, item) : '',
|
|
43
|
+
description: description ? replaceParamsValue(description, item) : '',
|
|
44
|
+
status: recordStatus || 'default'
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (direction === 'horizontal') {
|
|
50
|
+
res.labelPlacement = 'vertical';
|
|
51
|
+
} else if (res !== null && res !== void 0 && res.labelPlacement) {
|
|
52
|
+
delete res.labelPlacement;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return res;
|
|
56
|
+
};
|
|
57
|
+
export default formatStepsProps;
|
|
58
|
+
//# sourceMappingURL=formatStepsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getDataArr","replaceLoopBodyParamsValue","get","formatStepsProps","_ref","parameters","_ref$options","options","dataSource","title","description","status","direction","statusMap","res","size","dataSourceArr","dataSourceList","replaceParamsValue","contentStr","item","loopParams","loopData","loopSourceArr","Array","isArray","items","map","recordStatus","Object","keys","length","forEach","key","statusValue","concat","labelPlacement"],"sources":["../../../../src/formatModule/helpers/formatStepsProps.ts"],"sourcesContent":["import { getDataArr, replaceLoopBodyParamsValue } from '../../treeUtils';\nimport { get } from 'lodash';\n\nexport type formatImagePropsType = {\n options?: {\n dataSource?: string,\n title?: string,\n description?: string,\n status?: string,\n size?: string,\n direction?: string,\n statusMap?: {\n wait?: string,\n process?: string,\n finish?: string,\n error?: string,\n }\n }\n parameters?: {[key:string]: any};\n}\n\nconst formatStepsProps = ({\n parameters,\n options = {},\n}: formatImagePropsType):{[key:string]: any} => {\n const {\n dataSource,\n title,\n description,\n status,\n direction,\n statusMap,\n } = options;\n const res:{[key:string]: any} = {\n size: 'small',\n };\n\n if (dataSource) {\n const dataSourceArr = getDataArr(dataSource);\n if (parameters) {\n const dataSourceList = get(\n parameters,\n dataSourceArr,\n );\n\n const replaceParamsValue = (\n contentStr: string,\n item: { [key: string]: any },\n ) => {\n return replaceLoopBodyParamsValue(\n contentStr, {\n parameters,\n loopParams: item,\n loopData: dataSourceList,\n loopSourceArr: dataSourceArr,\n });\n };\n if (Array.isArray(dataSourceList)) {\n res.items = dataSourceList.map(item => {\n // 获取状态值\n let recordStatus = status && replaceParamsValue(status, item) ? replaceParamsValue(status, item) : '';\n // 根据状态映射,转换状态值为步骤状态\n if (statusMap && Object.keys(statusMap).length > 0) {\n Object.keys(statusMap).forEach(key => {\n const statusValue = `${statusMap?.[key as keyof typeof statusMap]}` || '';\n if (recordStatus && statusValue && `${recordStatus}` === statusValue) {\n recordStatus = key;\n }\n });\n }\n return ({\n title: title ? replaceParamsValue(title, item) : '',\n description: description ? replaceParamsValue(description, item) : '',\n status: recordStatus || 'default',\n });\n });\n }\n }\n if (direction === 'horizontal') {\n res.labelPlacement = 'vertical';\n } else if (res?.labelPlacement) {\n delete res.labelPlacement;\n }\n }\n return res;\n};\n\nexport default formatStepsProps;\n"],"mappings":"AAAA,SAASA,UAAU,EA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AAE;UACrG;UACA,IAAIP,SAAS,IAAIgB,MAAM,CAACC,IAAI,CAACjB,SAAS,CAAC,CAACkB,MAAM,GAAG,CAAC,EAAE;YAClDF,MAAM,CAACC,IAAI,CAACjB,SAAS,CAAC,CAACmB,OAAO,CAAC,UAAAC,GAAG,EAAI;cACpC,IAAMC,WAAW,GAAG,GAAAC,MAAA,CAAGtB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAGoB,GAAG,CAA2B,KAAM,EAAE;cACzE,IAAIL,YAAY,IAAIM,WAAW,IAAI,GAAAC,MAAA,CAAGP,YAAY,MAAOM,WAAW,EAAE;gBACpEN,YAAY,GAAGK,GAAG;cACpB;YACF,CAAC,CAAC;UACJ;UACA,OAAQ;YACNxB,KAAK,EAAEA,KAAK,GAAGS,kBAAkB,CAACT,KAAK,EAAEW,IAAI,CAAC,GAAG,EAAE;YACnDV,WAAW,EAAEA,WAAW,GAAGQ,kBAAkB,CAACR,WAAW,EAAEU,IAAI,CAAC,GAAG,EAAE;YACrET,MAAM,EAAEiB,YAAY,IAAI;UAC1B,CAAC;QACH,CAAC,CAAC;MACJ;IACF;IACA,IAAIhB,SAAS,KAAK,YAAY,EAAE;MAC9BE,GAAG,CAACsB,cAAc,GAAG,UAAU;IACjC,CAAC,MAAM,IAAItB,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEsB,cAAc,EAAE;MAC9B,OAAOtB,GAAG,CAACsB,cAAc;IAC3B;EACF;EACA,OAAOtB,GAAG;AACZ,CAAC;AAED,eAAeX,gBAAgB"}
|
|
@@ -3,7 +3,14 @@ export type formatTablePropsType = {
|
|
|
3
3
|
attrs?: {
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
}[];
|
|
6
|
+
columns?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}[];
|
|
6
9
|
dataSource?: string;
|
|
10
|
+
columnWidth?: string;
|
|
11
|
+
columnMinWidth?: string;
|
|
12
|
+
columnMaxWidth?: string;
|
|
13
|
+
tableBodyHeight?: string;
|
|
7
14
|
};
|
|
8
15
|
staticCodeMap?: {
|
|
9
16
|
[key: string]: any;
|
|
@@ -19,6 +26,10 @@ export type formatTablePropsExportType = {
|
|
|
19
26
|
dataSource: {
|
|
20
27
|
[key: string]: any;
|
|
21
28
|
}[];
|
|
29
|
+
scroll?: {
|
|
30
|
+
y?: string;
|
|
31
|
+
x?: string;
|
|
32
|
+
};
|
|
22
33
|
};
|
|
23
34
|
declare const formatTableProps: ({ staticCodeMap, parameters, options, }: formatTablePropsType) => formatTablePropsExportType;
|
|
24
35
|
export default formatTableProps;
|