@boteteam/utils 0.0.28 → 0.0.29
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/README.md +23 -23
- package/dist/cjs/CookieUtils.js.map +1 -1
- package/dist/cjs/asyncStorage.js.map +1 -1
- package/dist/cjs/environment.js.map +1 -1
- package/dist/cjs/file.js.map +1 -1
- package/dist/cjs/fileToBase64.js.map +1 -1
- package/dist/cjs/formatModule/formatModuleData.js +99 -9
- package/dist/cjs/formatModule/formatModuleData.js.map +2 -2
- package/dist/cjs/formatModule/helpers/formRulsRegMap.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatCarouselProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatChartsProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatControlBtn.d.ts +8 -0
- package/dist/cjs/formatModule/helpers/formatControlBtn.js +67 -0
- package/dist/cjs/formatModule/helpers/formatControlBtn.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatDescriptionsProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatEchartCommonProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatEchartLineProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatEchartPieProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatFormProps.d.ts +4 -1
- package/dist/cjs/formatModule/helpers/formatFormProps.js +51 -28
- package/dist/cjs/formatModule/helpers/formatFormProps.js.map +2 -2
- package/dist/cjs/formatModule/helpers/formatHighCodeProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatIconProps.d.ts +16 -0
- package/dist/cjs/formatModule/helpers/formatIconProps.js +49 -0
- package/dist/cjs/formatModule/helpers/formatIconProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatImageProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatListProps.js +69 -44
- package/dist/cjs/formatModule/helpers/formatListProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatLoopProps.d.ts +26 -2
- package/dist/cjs/formatModule/helpers/formatLoopProps.js +17 -10
- package/dist/cjs/formatModule/helpers/formatLoopProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/formatPanelProps.d.ts +8 -0
- package/dist/cjs/formatModule/helpers/formatPanelProps.js +67 -0
- package/dist/cjs/formatModule/helpers/formatPanelProps.js.map +7 -0
- package/dist/cjs/formatModule/helpers/formatStepsProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatStyleProps.js.map +1 -1
- package/dist/cjs/formatModule/helpers/formatTableProps.d.ts +5 -0
- package/dist/cjs/formatModule/helpers/formatTableProps.js +20 -0
- package/dist/cjs/formatModule/helpers/formatTableProps.js.map +3 -3
- package/dist/cjs/formatModule/helpers/index.d.ts +4 -1
- package/dist/cjs/formatModule/helpers/index.js +9 -0
- package/dist/cjs/formatModule/helpers/index.js.map +3 -3
- package/dist/cjs/formatModule/helpers/patternTransitionRegExp.js.map +1 -1
- package/dist/cjs/formatModule/helpers/staticCodeAssemble.js.map +1 -1
- package/dist/cjs/formatModule/helpers/stringPramarsValTransition.js.map +1 -1
- package/dist/cjs/formatModule/helpers/stringScriptExecution.js.map +1 -1
- package/dist/cjs/formatModule/helpers/urlPrefix.js.map +1 -1
- package/dist/cjs/getValueByPath.d.ts +10 -0
- package/dist/cjs/getValueByPath.js +69 -0
- package/dist/cjs/getValueByPath.js.map +7 -0
- package/dist/cjs/http.d.ts +8 -0
- package/dist/cjs/http.js +37 -1
- package/dist/cjs/http.js.map +2 -2
- package/dist/cjs/index.d.ts +5 -2
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/loopPageServiceApiMap.d.ts +17 -0
- package/dist/cjs/loopPageServiceApiMap.js +54 -0
- package/dist/cjs/loopPageServiceApiMap.js.map +7 -0
- package/dist/cjs/loopPageStaticCodeMap.js.map +1 -1
- package/dist/cjs/markdownEscape.js.map +1 -1
- package/dist/cjs/pathArgsUtils.js.map +1 -1
- package/dist/cjs/scriptExecution.js.map +1 -1
- package/dist/cjs/securityUtils.js +1 -1
- package/dist/cjs/securityUtils.js.map +2 -2
- package/dist/cjs/stringUtils.js.map +1 -1
- package/dist/cjs/timeFormat.d.ts +44 -0
- package/dist/cjs/timeFormat.js +127 -0
- package/dist/cjs/timeFormat.js.map +7 -0
- package/dist/cjs/treeUtils.js.map +1 -1
- package/dist/cjs/watchMatchMedia.js.map +1 -1
- package/dist/esm/CookieUtils.js.map +1 -1
- package/dist/esm/asyncStorage.js +4 -4
- package/dist/esm/asyncStorage.js.map +1 -1
- package/dist/esm/environment.js +3 -3
- package/dist/esm/environment.js.map +1 -1
- package/dist/esm/file.js +32 -32
- package/dist/esm/file.js.map +1 -1
- package/dist/esm/fileToBase64.js +4 -4
- package/dist/esm/fileToBase64.js.map +1 -1
- package/dist/esm/formatModule/formatModuleData.js +118 -26
- package/dist/esm/formatModule/formatModuleData.js.map +1 -1
- package/dist/esm/formatModule/helpers/formRulsRegMap.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatCarouselProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatChartsProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatControlBtn.d.ts +8 -0
- package/dist/esm/formatModule/helpers/formatControlBtn.js +41 -0
- package/dist/esm/formatModule/helpers/formatControlBtn.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatDescriptionsProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatEchartCommonProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatEchartLineProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatEchartPieProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatFormProps.d.ts +4 -1
- package/dist/esm/formatModule/helpers/formatFormProps.js +93 -31
- package/dist/esm/formatModule/helpers/formatFormProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatHighCodeProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatIconProps.d.ts +16 -0
- package/dist/esm/formatModule/helpers/formatIconProps.js +25 -0
- package/dist/esm/formatModule/helpers/formatIconProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatImageProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatListProps.js +69 -44
- package/dist/esm/formatModule/helpers/formatListProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatLoopProps.d.ts +26 -2
- package/dist/esm/formatModule/helpers/formatLoopProps.js +35 -7
- package/dist/esm/formatModule/helpers/formatLoopProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatPanelProps.d.ts +8 -0
- package/dist/esm/formatModule/helpers/formatPanelProps.js +41 -0
- package/dist/esm/formatModule/helpers/formatPanelProps.js.map +1 -0
- package/dist/esm/formatModule/helpers/formatStepsProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatStyleProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatTableProps.d.ts +5 -0
- package/dist/esm/formatModule/helpers/formatTableProps.js +12 -0
- package/dist/esm/formatModule/helpers/formatTableProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/index.d.ts +4 -1
- package/dist/esm/formatModule/helpers/index.js +4 -1
- package/dist/esm/formatModule/helpers/index.js.map +1 -1
- package/dist/esm/formatModule/helpers/patternTransitionRegExp.js.map +1 -1
- package/dist/esm/formatModule/helpers/staticCodeAssemble.js +4 -4
- package/dist/esm/formatModule/helpers/staticCodeAssemble.js.map +1 -1
- package/dist/esm/formatModule/helpers/stringPramarsValTransition.js.map +1 -1
- package/dist/esm/formatModule/helpers/stringScriptExecution.js.map +1 -1
- package/dist/esm/formatModule/helpers/urlPrefix.js.map +1 -1
- package/dist/esm/getValueByPath.d.ts +10 -0
- package/dist/esm/getValueByPath.js +87 -0
- package/dist/esm/getValueByPath.js.map +1 -0
- package/dist/esm/http.d.ts +8 -0
- package/dist/esm/http.js +97 -58
- package/dist/esm/http.js.map +1 -1
- package/dist/esm/index.d.ts +5 -2
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loopPageServiceApiMap.d.ts +17 -0
- package/dist/esm/loopPageServiceApiMap.js +40 -0
- package/dist/esm/loopPageServiceApiMap.js.map +1 -0
- package/dist/esm/loopPageStaticCodeMap.js.map +1 -1
- package/dist/esm/markdownEscape.js.map +1 -1
- package/dist/esm/pathArgsUtils.js +8 -8
- package/dist/esm/pathArgsUtils.js.map +1 -1
- package/dist/esm/scriptExecution.js.map +1 -1
- package/dist/esm/securityUtils.js +20 -20
- package/dist/esm/securityUtils.js.map +1 -1
- package/dist/esm/stringUtils.js.map +1 -1
- package/dist/esm/timeFormat.d.ts +44 -0
- package/dist/esm/timeFormat.js +121 -0
- package/dist/esm/timeFormat.js.map +1 -0
- package/dist/esm/treeUtils.js +8 -8
- package/dist/esm/treeUtils.js.map +1 -1
- package/dist/esm/watchMatchMedia.js.map +1 -1
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# pro-components
|
|
2
|
-
|
|
3
|
-
[](https://npmjs.com/package/pro-components)
|
|
4
|
-
[](https://npmjs.com/package/pro-components)
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
$ yarn install
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$ npm run dev
|
|
14
|
-
$ npm run build
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Options
|
|
18
|
-
|
|
19
|
-
TODO
|
|
20
|
-
|
|
21
|
-
## LICENSE
|
|
22
|
-
|
|
23
|
-
MIT
|
|
1
|
+
# pro-components
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/pro-components)
|
|
4
|
+
[](https://npmjs.com/package/pro-components)
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
$ yarn install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ npm run dev
|
|
14
|
+
$ npm run build
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
TODO
|
|
20
|
+
|
|
21
|
+
## LICENSE
|
|
22
|
+
|
|
23
|
+
MIT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/CookieUtils.ts"],
|
|
4
|
-
"sourcesContent": ["import { getDocument } from './environment';\
|
|
4
|
+
"sourcesContent": ["import { getDocument } from './environment';\n\nconst CookieUtils = {\n get(name: string): string | null {\n const doc = getDocument();\n if (!doc) return null;\n\n const cookieName = `${encodeURIComponent(name)}=`;\n const cookieStart = doc.cookie.indexOf(cookieName);\n let cookieValue: string | null = null;\n let cookieEnd: number;\n if (cookieStart > -1) {\n cookieEnd = doc.cookie.indexOf(';', cookieStart);\n if (cookieEnd === -1) {\n cookieEnd = doc.cookie.length;\n }\n cookieValue = decodeURIComponent(\n doc.cookie.substring(cookieStart + cookieName.length, cookieEnd),\n );\n }\n return cookieValue;\n },\n\n set(\n name: string,\n value: string,\n expires?: Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n ): void {\n const doc = getDocument();\n if (!doc) return;\n\n let cookieText = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;\n if (expires instanceof Date) {\n cookieText += `; expires=${expires.toUTCString()}`;\n }\n if (path) {\n cookieText += `; path=${path}`;\n }\n if (domain) {\n cookieText += `; domain=${domain}`;\n }\n if (secure) {\n cookieText += '; secure';\n }\n doc.cookie = cookieText;\n },\n\n unset(name: string, path?: string, domain?: string, secure?: boolean): void {\n this.set(name, '', new Date(0), path, domain, secure);\n },\n\n // React Native 异步版本\n async getAsync(name: string): Promise<string | null> {\n return this.get(name);\n },\n\n async setAsync(\n name: string,\n value: string,\n expires?: Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n ): Promise<void> {\n this.set(name, value, expires, path, domain, secure);\n },\n\n async unsetAsync(name: string, path?: string, domain?: string, secure?: boolean): Promise<void> {\n this.unset(name, path, domain, secure);\n },\n};\n\nexport default CookieUtils;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAE5B,IAAM,cAAc;AAAA,EAClB,IAAI,MAA6B;AAC/B,UAAM,UAAM,gCAAY;AACxB,QAAI,CAAC;AAAK,aAAO;AAEjB,UAAM,aAAa,GAAG,mBAAmB,IAAI;AAC7C,UAAM,cAAc,IAAI,OAAO,QAAQ,UAAU;AACjD,QAAI,cAA6B;AACjC,QAAI;AACJ,QAAI,cAAc,IAAI;AACpB,kBAAY,IAAI,OAAO,QAAQ,KAAK,WAAW;AAC/C,UAAI,cAAc,IAAI;AACpB,oBAAY,IAAI,OAAO;AAAA,MACzB;AACA,oBAAc;AAAA,QACZ,IAAI,OAAO,UAAU,cAAc,WAAW,QAAQ,SAAS;AAAA,MACjE;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EAEA,IACE,MACA,OACA,SACA,MACA,QACA,QACM;AACN,UAAM,UAAM,gCAAY;AACxB,QAAI,CAAC;AAAK;AAEV,QAAI,aAAa,GAAG,mBAAmB,IAAI,KAAK,mBAAmB,KAAK;AACxE,QAAI,mBAAmB,MAAM;AAC3B,oBAAc,aAAa,QAAQ,YAAY;AAAA,IACjD;AACA,QAAI,MAAM;AACR,oBAAc,UAAU;AAAA,IAC1B;AACA,QAAI,QAAQ;AACV,oBAAc,YAAY;AAAA,IAC5B;AACA,QAAI,QAAQ;AACV,oBAAc;AAAA,IAChB;AACA,QAAI,SAAS;AAAA,EACf;AAAA,EAEA,MAAM,MAAc,MAAe,QAAiB,QAAwB;AAC1E,SAAK,IAAI,MAAM,IAAI,oBAAI,KAAK,CAAC,GAAG,MAAM,QAAQ,MAAM;AAAA,EACtD;AAAA;AAAA,EAGA,MAAM,SAAS,MAAsC;AACnD,WAAO,KAAK,IAAI,IAAI;AAAA,EACtB;AAAA,EAEA,MAAM,SACJ,MACA,OACA,SACA,MACA,QACA,QACe;AACf,SAAK,IAAI,MAAM,OAAO,SAAS,MAAM,QAAQ,MAAM;AAAA,EACrD;AAAA,EAEA,MAAM,WAAW,MAAc,MAAe,QAAiB,QAAiC;AAC9F,SAAK,MAAM,MAAM,MAAM,QAAQ,MAAM;AAAA,EACvC;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/asyncStorage.ts"],
|
|
4
|
-
"sourcesContent": ["export interface asyncLocalStorageType {\
|
|
4
|
+
"sourcesContent": ["export interface asyncLocalStorageType {\n setItem: (key: string, value: string) => Promise<string | void | null>,\n getItem: (key: string) => Promise<string | void | null>,\n removeItem: (key: string) => Promise<string | void | null>,\n}\n\nexport interface asyncSessionStorageType {\n setItem: (key: string, value: string) => Promise<string | void | null>,\n getItem: (key: string) => Promise<string | void | null>,\n removeItem: (key: string) => Promise<string | void | null>,\n}\n\n/**\n * localStorage异步函数\n */\nconst asyncLocalStorage:asyncLocalStorageType = {\n setItem (key: string, value: string) {\n return Promise.resolve().then(() => {\n localStorage.setItem(key, value);\n });\n },\n getItem (key: string) {\n return Promise.resolve().then(() => {\n return localStorage.getItem(key);\n });\n },\n removeItem (key: string) {\n return Promise.resolve().then(() => {\n return localStorage.removeItem(key);\n });\n },\n};\n\n/**\n * sessionStorage异步函数\n */\nconst asyncSessionStorage:asyncSessionStorageType = {\n setItem (key: string, value: string) {\n return Promise.resolve().then(() => {\n sessionStorage.setItem(key, value);\n });\n },\n getItem (key: string) {\n return Promise.resolve().then(() => {\n return sessionStorage.getItem(key);\n });\n },\n removeItem (key: string) {\n return Promise.resolve().then(() => {\n return sessionStorage.removeItem(key);\n });\n },\n};\n\n\nexport {\n asyncLocalStorage,\n asyncSessionStorage,\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,IAAM,oBAA0C;AAAA,EAC9C,QAAS,KAAa,OAAe;AACnC,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,mBAAa,QAAQ,KAAK,KAAK;AAAA,IACjC,CAAC;AAAA,EACH;AAAA,EACA,QAAS,KAAa;AACpB,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,aAAO,aAAa,QAAQ,GAAG;AAAA,IACjC,CAAC;AAAA,EACH;AAAA,EACA,WAAY,KAAa;AACvB,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,aAAO,aAAa,WAAW,GAAG;AAAA,IACpC,CAAC;AAAA,EACH;AACF;AAKA,IAAM,sBAA8C;AAAA,EAClD,QAAS,KAAa,OAAe;AACnC,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,qBAAe,QAAQ,KAAK,KAAK;AAAA,IACnC,CAAC;AAAA,EACH;AAAA,EACA,QAAS,KAAa;AACpB,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,aAAO,eAAe,QAAQ,GAAG;AAAA,IACnC,CAAC;AAAA,EACH;AAAA,EACA,WAAY,KAAa;AACvB,WAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM;AAClC,aAAO,eAAe,WAAW,GAAG;AAAA,IACtC,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/environment.ts"],
|
|
4
|
-
"sourcesContent": ["/**\
|
|
4
|
+
"sourcesContent": ["/**\n * 环境检测工具\n * 用于判断当前运行环境,提供跨平台兼容性支持\n */\n\n// 检测是否为 React Native 环境\nexport const isReactNative = (): boolean => {\n return typeof global !== 'undefined' &&\n global.navigator &&\n global.navigator.product === 'ReactNative';\n};\n\n// 检测是否为 Web 环境\nexport const isWeb = (): boolean => {\n return typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n !isReactNative();\n};\n\n// 检测是否为 Node.js 环境\nexport const isNode = (): boolean => {\n return typeof process !== 'undefined' &&\n process.versions &&\n Boolean(process.versions.node);\n};\n\n// 获取当前环境类型\nexport const getEnvironment = (): 'web' | 'react-native' | 'node' => {\n if (isReactNative()) {\n return 'react-native';\n }\n if (isWeb()) {\n return 'web';\n }\n if (isNode()) {\n return 'node';\n }\n return 'web'; // 默认返回 web\n};\n\n// 安全地获取 window 对象\nexport const getWindow = (): Window | null => {\n if (isWeb()) {\n return window;\n }\n return null;\n};\n\n// 安全地获取 document 对象\nexport const getDocument = (): Document | null => {\n if (isWeb()) {\n return document;\n }\n return null;\n};\n\n// 安全地获取 location 对象\nexport const getLocation = (): Location | null => {\n const win = getWindow();\n return win ? win.location : null;\n};\n\n\n// 判断是否为移动端,不能用宽度,因为宽度在浏览器中会变化\n// 使用 navigator.userAgent 判断\nexport const isMobile = (): boolean => {\n const win = getWindow();\n return win ? /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(win.navigator.userAgent) : false;\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,gBAAgB,MAAe;AAC1C,SAAO,OAAO,WAAW,eAClB,OAAO,aACP,OAAO,UAAU,YAAY;AACtC;AAGO,IAAM,QAAQ,MAAe;AAClC,SAAO,OAAO,WAAW,eAClB,OAAO,aAAa,eACpB,CAAC,cAAc;AACxB;AAGO,IAAM,SAAS,MAAe;AACnC,SAAO,OAAO,YAAY,eACnB,QAAQ,YACR,QAAQ,QAAQ,SAAS,IAAI;AACtC;AAGO,IAAM,iBAAiB,MAAuC;AACnE,MAAI,cAAc,GAAG;AACnB,WAAO;AAAA,EACT;AACA,MAAI,MAAM,GAAG;AACX,WAAO;AAAA,EACT;AACA,MAAI,OAAO,GAAG;AACZ,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGO,IAAM,YAAY,MAAqB;AAC5C,MAAI,MAAM,GAAG;AACX,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGO,IAAM,cAAc,MAAuB;AAChD,MAAI,MAAM,GAAG;AACX,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGO,IAAM,cAAc,MAAuB;AAChD,QAAM,MAAM,UAAU;AACtB,SAAO,MAAM,IAAI,WAAW;AAC9B;AAKO,IAAM,WAAW,MAAe;AACrC,QAAM,MAAM,UAAU;AACtB,SAAO,MAAM,iEAAiE,KAAK,IAAI,UAAU,SAAS,IAAI;AAChH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
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';\
|
|
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\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 getFileUrlByFileInfoId = (\n fileInfoId: 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, tenantId } = getSearchObj() || {};\n const queryParams:{[key:string]:any} = {\n fileInfoId,\n ...params,\n };\n if (token) {\n queryParams.token = token;\n }\n if (tenantId) {\n queryParams.tenantId = tenantId;\n }\n const query = argsToString(queryParams);\n const url = `${baseUrl}/file/downloadByFileInfoId?${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: { botePageCode: 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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;AAWO,IAAM,yBAAyB,CACpC,YACA;AAAA,EACE;AAAA,EACA,aAAa;AAAA,EACb;AACF,IAII,CAAC,MACF;AACH,QAAM,UAAU,SAAS,OAAO,QAAQ,OAAO,EAAE,IAAI;AAErD,QAAM,EAAE,OAAO,SAAS,QAAI,mCAAa,KAAK,CAAC;AAC/C,QAAM,cAAiC;AAAA,IACrC;AAAA,IACA,GAAG;AAAA,EACL;AACA,MAAI,OAAO;AACT,gBAAY,QAAQ;AAAA,EACtB;AACA,MAAI,UAAU;AACZ,gBAAY,WAAW;AAAA,EACzB;AACA,QAAM,YAAQ,mCAAa,WAAW;AACtC,QAAM,MAAM,GAAG,qCAAqC;AACpD,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,cAAc,UAAU,GAAG,mCAAS,OAAO;AAAA,EACvD,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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/fileToBase64.ts"],
|
|
4
|
-
"sourcesContent": ["type fileToBase64Type = (file: File) => Promise<string>;\
|
|
4
|
+
"sourcesContent": ["type fileToBase64Type = (file: File) => Promise<string>;\n\n/**\n * 图片文件转base64\n * @param file\n * @returns\n */\nconst fileToBase64: fileToBase64Type = (file: File) =>\n new Promise((resolve, reject) => {\n try {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n resolve(reader.result as string);\n });\n reader.readAsDataURL(file);\n } catch (err) {\n reject(err);\n }\n });\n\nexport { type fileToBase64Type };\nexport default fileToBase64;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAM,eAAiC,CAAC,SACtC,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/B,MAAI;AACF,UAAM,SAAS,IAAI,WAAW;AAC9B,WAAO,iBAAiB,QAAQ,MAAM;AACpC,cAAQ,OAAO,MAAgB;AAAA,IACjC,CAAC;AACD,WAAO,cAAc,IAAI;AAAA,EAC3B,SAAS,KAAP;AACA,WAAO,GAAG;AAAA,EACZ;AACF,CAAC;AAGH,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,6 +23,7 @@ __export(formatModuleData_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(formatModuleData_exports);
|
|
25
25
|
var import_ses = require("ses");
|
|
26
|
+
var import_lodash = require("lodash");
|
|
26
27
|
var import_treeUtils = require("../treeUtils");
|
|
27
28
|
var import_helpers = require("./helpers");
|
|
28
29
|
var formatModuleData = ({
|
|
@@ -37,9 +38,9 @@ var formatModuleData = ({
|
|
|
37
38
|
var _a, _b, _c;
|
|
38
39
|
let moduleDataRes = {};
|
|
39
40
|
const allParametrs = {
|
|
40
|
-
...parameters || {},
|
|
41
|
-
pageData: pageData || {},
|
|
42
|
-
loopItem: loopItemData || {}
|
|
41
|
+
...(0, import_lodash.cloneDeep)(parameters || {}),
|
|
42
|
+
pageData: (0, import_lodash.cloneDeep)(pageData || {}),
|
|
43
|
+
loopItem: (0, import_lodash.cloneDeep)(loopItemData || {})
|
|
43
44
|
};
|
|
44
45
|
const {
|
|
45
46
|
staticCodeMap,
|
|
@@ -47,11 +48,14 @@ var formatModuleData = ({
|
|
|
47
48
|
} = (0, import_helpers.staticCodeAssemble)(staticCodeList);
|
|
48
49
|
if (moduleData) {
|
|
49
50
|
const {
|
|
51
|
+
commonProps,
|
|
50
52
|
compProps,
|
|
51
53
|
compType,
|
|
52
54
|
children,
|
|
53
55
|
moduleTitle,
|
|
56
|
+
moduleTitleIcon,
|
|
54
57
|
moduleDescribe,
|
|
58
|
+
controlBtns: moduleControlBtns,
|
|
55
59
|
id
|
|
56
60
|
} = moduleData;
|
|
57
61
|
moduleDataRes = {
|
|
@@ -59,7 +63,8 @@ var formatModuleData = ({
|
|
|
59
63
|
key: id,
|
|
60
64
|
disabled,
|
|
61
65
|
compProps: {},
|
|
62
|
-
|
|
66
|
+
commonProps: {},
|
|
67
|
+
originModule: (0, import_lodash.cloneDeep)(moduleData)
|
|
63
68
|
// 配置moduled的信息
|
|
64
69
|
};
|
|
65
70
|
const {
|
|
@@ -85,12 +90,64 @@ var formatModuleData = ({
|
|
|
85
90
|
if (moduleTitle) {
|
|
86
91
|
moduleDataRes.moduleTitle = (0, import_helpers.stringPramarsValTransition)(moduleTitle, allParametrs);
|
|
87
92
|
}
|
|
93
|
+
if (moduleTitleIcon) {
|
|
94
|
+
moduleDataRes.moduleTitleIcon = null;
|
|
95
|
+
if ((moduleTitleIcon == null ? void 0 : moduleTitleIcon.type) === "icon") {
|
|
96
|
+
const iconProps = (0, import_helpers.formatIconProps)({
|
|
97
|
+
icon: moduleTitleIcon == null ? void 0 : moduleTitleIcon.icon,
|
|
98
|
+
parameters: allParametrs
|
|
99
|
+
});
|
|
100
|
+
if (iconProps == null ? void 0 : iconProps.icon) {
|
|
101
|
+
moduleDataRes.moduleTitleIcon = {
|
|
102
|
+
type: "icon",
|
|
103
|
+
icon: iconProps,
|
|
104
|
+
style: (moduleTitleIcon == null ? void 0 : moduleTitleIcon.style) || {},
|
|
105
|
+
className: (moduleTitleIcon == null ? void 0 : moduleTitleIcon.className) || ""
|
|
106
|
+
};
|
|
107
|
+
} else {
|
|
108
|
+
moduleDataRes.moduleTitleIcon = null;
|
|
109
|
+
}
|
|
110
|
+
} else if ((moduleTitleIcon == null ? void 0 : moduleTitleIcon.type) === "image") {
|
|
111
|
+
const imageProps = (0, import_helpers.formatImageProps)({
|
|
112
|
+
options: {
|
|
113
|
+
dataSource: moduleTitleIcon == null ? void 0 : moduleTitleIcon.image
|
|
114
|
+
},
|
|
115
|
+
parameters: allParametrs
|
|
116
|
+
});
|
|
117
|
+
if (imageProps == null ? void 0 : imageProps.src) {
|
|
118
|
+
moduleDataRes.moduleTitleIcon = {
|
|
119
|
+
type: "image",
|
|
120
|
+
image: imageProps,
|
|
121
|
+
style: (moduleTitleIcon == null ? void 0 : moduleTitleIcon.style) || {},
|
|
122
|
+
className: (moduleTitleIcon == null ? void 0 : moduleTitleIcon.className) || ""
|
|
123
|
+
};
|
|
124
|
+
} else {
|
|
125
|
+
moduleDataRes.moduleTitleIcon = null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
88
129
|
if (moduleDescribe) {
|
|
89
130
|
moduleDataRes.moduleDescribe = (0, import_helpers.stringPramarsValTransition)(moduleDescribe, allParametrs);
|
|
90
131
|
}
|
|
91
132
|
if (otherCompProps == null ? void 0 : otherCompProps.title) {
|
|
92
133
|
moduleDataRes.compProps.title = (0, import_helpers.stringPramarsValTransition)(otherCompProps == null ? void 0 : otherCompProps.title, allParametrs);
|
|
93
134
|
}
|
|
135
|
+
if (commonProps && Object.keys(commonProps).length > 0) {
|
|
136
|
+
Object.keys(commonProps).forEach((key) => {
|
|
137
|
+
if (key === "hidden") {
|
|
138
|
+
if (typeof commonProps[key] === "boolean" || typeof commonProps[key] === "string") {
|
|
139
|
+
if (typeof commonProps[key] === "boolean") {
|
|
140
|
+
moduleDataRes.commonProps.hidden = commonProps[key];
|
|
141
|
+
} else if (typeof commonProps[key] === "string") {
|
|
142
|
+
const hidden = (0, import_helpers.stringScriptExecution)(commonProps[key], allParametrs);
|
|
143
|
+
moduleDataRes.commonProps.hidden = hidden;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
moduleDataRes.commonProps[key] = commonProps[key];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
94
151
|
moduleDataRes.parentCompProps = (parentModuleData == null ? void 0 : parentModuleData.compProps) || {};
|
|
95
152
|
if (compType === "page") {
|
|
96
153
|
if (events && (events == null ? void 0 : events.length) > 0) {
|
|
@@ -105,8 +162,8 @@ var formatModuleData = ({
|
|
|
105
162
|
moduleDataRes.compProps.eventFlag = { checked: true };
|
|
106
163
|
}
|
|
107
164
|
}
|
|
108
|
-
if (["panel", "div", "page"].indexOf(compType) >= 0
|
|
109
|
-
const childs = children.map((item) => {
|
|
165
|
+
if (["panel", "div", "page"].indexOf(compType) >= 0) {
|
|
166
|
+
const childs = Array.isArray(children) && children.length > 0 ? children.map((item) => {
|
|
110
167
|
return formatModuleData({
|
|
111
168
|
moduleData: item,
|
|
112
169
|
parentModuleData: moduleData,
|
|
@@ -116,8 +173,16 @@ var formatModuleData = ({
|
|
|
116
173
|
disabled,
|
|
117
174
|
pageData
|
|
118
175
|
});
|
|
119
|
-
});
|
|
120
|
-
|
|
176
|
+
}) : [];
|
|
177
|
+
if ((childs == null ? void 0 : childs.length) > 0) {
|
|
178
|
+
moduleDataRes.children = childs;
|
|
179
|
+
}
|
|
180
|
+
if (compType === "panel") {
|
|
181
|
+
moduleDataRes.compProps = (0, import_helpers.formatPanelProps)({
|
|
182
|
+
compProps: otherCompProps,
|
|
183
|
+
parameters: allParametrs
|
|
184
|
+
});
|
|
185
|
+
}
|
|
121
186
|
} else {
|
|
122
187
|
if (otherCompProps && ((_a = Object == null ? void 0 : Object.keys(otherCompProps)) == null ? void 0 : _a.length) > 0) {
|
|
123
188
|
Object == null ? void 0 : Object.keys(otherCompProps).forEach((compPropKey) => {
|
|
@@ -140,6 +205,7 @@ var formatModuleData = ({
|
|
|
140
205
|
}
|
|
141
206
|
if (compType === "typography") {
|
|
142
207
|
if (articleContent) {
|
|
208
|
+
console.log("articleContent", articleContent, allParametrs);
|
|
143
209
|
moduleDataRes.compProps.articleContent = (0, import_helpers.stringPramarsValTransition)(articleContent, allParametrs);
|
|
144
210
|
}
|
|
145
211
|
}
|
|
@@ -161,6 +227,22 @@ var formatModuleData = ({
|
|
|
161
227
|
...carouselProps
|
|
162
228
|
};
|
|
163
229
|
}
|
|
230
|
+
if (compType === "icon") {
|
|
231
|
+
const iconProps = (0, import_helpers.formatIconProps)({
|
|
232
|
+
icon: compProps == null ? void 0 : compProps.icon,
|
|
233
|
+
parameters: allParametrs
|
|
234
|
+
});
|
|
235
|
+
moduleDataRes.compProps = {
|
|
236
|
+
...(moduleDataRes == null ? void 0 : moduleDataRes.compProps) || {},
|
|
237
|
+
icon: iconProps
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
if (compType === "txt") {
|
|
241
|
+
moduleDataRes.compProps = {
|
|
242
|
+
...(moduleDataRes == null ? void 0 : moduleDataRes.compProps) || {},
|
|
243
|
+
content: (0, import_helpers.stringPramarsValTransition)(compProps == null ? void 0 : compProps.content, allParametrs)
|
|
244
|
+
};
|
|
245
|
+
}
|
|
164
246
|
if (compType === "image" && compDataSource && (compDataSource == null ? void 0 : compDataSource.dataType)) {
|
|
165
247
|
const imageProps = (0, import_helpers.formatImageProps)({
|
|
166
248
|
options: {
|
|
@@ -232,7 +314,8 @@ var formatModuleData = ({
|
|
|
232
314
|
if (compType === "loop") {
|
|
233
315
|
const loopProps = (0, import_helpers.formatLoopProps)({
|
|
234
316
|
options: {
|
|
235
|
-
dataSource: compDataSource
|
|
317
|
+
dataSource: compDataSource,
|
|
318
|
+
id
|
|
236
319
|
},
|
|
237
320
|
parameters: allParametrs,
|
|
238
321
|
staticCodeMap
|
|
@@ -296,6 +379,7 @@ var formatModuleData = ({
|
|
|
296
379
|
...otherCompProps,
|
|
297
380
|
rowKey,
|
|
298
381
|
rowSelection,
|
|
382
|
+
id,
|
|
299
383
|
attrs,
|
|
300
384
|
itemLabel: listItemLabel,
|
|
301
385
|
itemContent: listItemContent,
|
|
@@ -360,6 +444,12 @@ var formatModuleData = ({
|
|
|
360
444
|
...stepsProps
|
|
361
445
|
};
|
|
362
446
|
}
|
|
447
|
+
if (Array.isArray(moduleControlBtns) && moduleControlBtns.length > 0) {
|
|
448
|
+
moduleDataRes.controlBtns = moduleControlBtns.map((btn) => (0, import_helpers.formatControlBtn)({
|
|
449
|
+
btnProps: btn,
|
|
450
|
+
parameters: allParametrs
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
363
453
|
moduleDataRes.compProps.style = (0, import_helpers.formatStyleProps)(moduleData, parentModuleData);
|
|
364
454
|
if ((moduleData == null ? void 0 : moduleData.compProps) && fieldName) {
|
|
365
455
|
moduleDataRes.compProps.fieldName = fieldName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/formatModule/formatModuleData.ts"],
|
|
4
|
-
"sourcesContent": ["import 'ses';\r\nimport { getDataArr } from '../treeUtils';\r\nimport {\r\n urlPrefix,\r\n formatListProps,\r\n formatTableProps,\r\n formatCarouselProps,\r\n formatImageProps,\r\n formatFormProps,\r\n formatHighCodeProps,\r\n formatDescriptionsProps,\r\n formatLoopProps,\r\n formatStyleProps,\r\n formatEchartLineProps,\r\n formatEchartPieProps,\r\n formatChartsProps,\r\n formatStepsProps,\r\n staticCodeAssemble,\r\n stringPramarsValTransition,\r\n} from './helpers';\r\n\r\ntype formatModuleProps = {\r\n moduleData: { [key: string]: any } | null; // 页面配置数据\r\n parentModuleData?: { [key: string]: any } | null; // 父级配置数据\r\n pageData?: { [key: string]: any } | null; // 页面组件数据\r\n parameters?: any; // 入参上下文\r\n loopItemData?: any; // 循环体数据\r\n staticCodeList?: { [key: string]: any } | null; // 静态资源数据\r\n disabled?: boolean;\r\n};\r\n\r\nconst formatModuleData = ({\r\n moduleData,\r\n parentModuleData,\r\n parameters,\r\n loopItemData,\r\n staticCodeList,\r\n disabled,\r\n pageData,\r\n}: formatModuleProps): { [key: string]: any } | null => {\r\n let moduleDataRes: { [key: string]: any } = { };\r\n const allParametrs:{ [key: string]: any } = {\r\n ...(parameters || {}),\r\n pageData: pageData || {},\r\n loopItem: loopItemData || {},\r\n }; // 把页面数据与入参组装到一起\r\n const {\r\n staticCodeMap,\r\n staticOptionsMap,\r\n } = staticCodeAssemble(staticCodeList);\r\n\r\n if (moduleData) {\r\n const {\r\n compProps,\r\n compType,\r\n children,\r\n moduleTitle,\r\n moduleDescribe,\r\n id,\r\n } = moduleData;\r\n // 组装静态数据映射\r\n moduleDataRes = {\r\n ...moduleData,\r\n key: id,\r\n disabled,\r\n compProps: {},\r\n originModule: moduleData, // 配置moduled的信息\r\n };\r\n const {\r\n itemLabel: listItemLabel,\r\n itemContent: listItemContent,\r\n itemDescribe: listItemDescribe,\r\n dataSource: compDataSource,\r\n columns: compColumns,\r\n tableBodyHeight,\r\n fileProps,\r\n attrs,\r\n rowSelection,\r\n hasSelectAll,\r\n rowKey,\r\n fieldName,\r\n column,\r\n articleContent,\r\n eventFlag,\r\n events,\r\n ...otherCompProps // 无需处理的属性\r\n } = compProps || {};\r\n if (moduleTitle) {\r\n moduleDataRes.moduleTitle = stringPramarsValTransition(moduleTitle, allParametrs);\r\n }\r\n if (moduleDescribe) {\r\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\r\n }\r\n if (otherCompProps?.title) {\r\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\r\n }\r\n \r\n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\r\n // 处理page组件的onLoad事件\r\n if (compType === 'page') {\r\n if (events && events?.length > 0) {\r\n const onLoadEvent = events.find(\r\n (item: any) => item?.key === 'pageLoad',\r\n );\r\n if (onLoadEvent) {\r\n moduleDataRes.compProps.onLoad = onLoadEvent?.event;\r\n }\r\n }\r\n if (eventFlag) {\r\n moduleDataRes.compProps.eventFlag = { checked: true };\r\n }\r\n }\r\n if (\r\n ['panel', 'div', 'page'].indexOf(compType) >= 0 &&\r\n Array.isArray(children) &&\r\n children.length > 0\r\n ) {\r\n const childs = children.map((item) => {\r\n return formatModuleData({\r\n moduleData: item,\r\n parentModuleData: moduleData,\r\n parameters,\r\n loopItemData,\r\n staticCodeList,\r\n disabled,\r\n pageData,\r\n });\r\n });\r\n moduleDataRes.children = childs;\r\n } else {\r\n if (otherCompProps && Object?.keys(otherCompProps)?.length > 0) {\r\n Object?.keys(otherCompProps).forEach(compPropKey => {\r\n if (otherCompProps?.[compPropKey] || typeof otherCompProps?.[compPropKey] === 'number') {\r\n moduleDataRes.compProps[compPropKey] = otherCompProps?.[compPropKey];\r\n }\r\n });\r\n }\r\n if (rowSelection) {\r\n moduleDataRes.compProps.rowSelection = rowSelection;\r\n if (hasSelectAll && rowSelection?.type === 'checkbox') {\r\n moduleDataRes.compProps.hasSelectAll = hasSelectAll;\r\n } else {\r\n delete moduleDataRes.compProps.hasSelectAll;\r\n }\r\n }\r\n const rowKeyIndexArr = getDataArr(rowKey);\r\n\r\n if (Array.isArray(rowKeyIndexArr) && rowKeyIndexArr.length > 0) {\r\n moduleDataRes.compProps.rowKey = rowKeyIndexArr.slice(-1)?.[0];\r\n }\r\n\r\n if (compType === 'typography') {\r\n if (articleContent) {\r\n moduleDataRes.compProps.articleContent = stringPramarsValTransition(articleContent, allParametrs);\r\n }\r\n }\r\n if (compType === 'iframe') {\r\n moduleDataRes.compProps.url = stringPramarsValTransition(\r\n otherCompProps?.url,\r\n allParametrs,\r\n );\r\n }\r\n\r\n if (compType === 'carousel' && compDataSource && compDataSource?.dataType) {\r\n const carouselProps = formatCarouselProps({\r\n options: {\r\n dataSource: compDataSource,\r\n },\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...carouselProps,\r\n };\r\n }\r\n if (compType === 'image' && compDataSource && compDataSource?.dataType) {\r\n const imageProps = formatImageProps({\r\n options: {\r\n dataSource: compDataSource,\r\n },\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...imageProps,\r\n };\r\n }\r\n\r\n if (compType === 'highCodeComp') {\r\n const highCodeCompProps = formatHighCodeProps({\r\n options: { fileProps },\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...highCodeCompProps,\r\n };\r\n }\r\n\r\n if (compType === 'table') {\r\n const tableProps = formatTableProps({\r\n options: {\r\n ...otherCompProps,\r\n columns: compColumns,\r\n dataSource: compDataSource,\r\n attrs,\r\n tableBodyHeight,\r\n },\r\n staticCodeMap,\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...tableProps,\r\n };\r\n }\r\n if (compType === 'form') {\r\n const formProps = formatFormProps({\r\n options: {\r\n column,\r\n children,\r\n },\r\n parameters: allParametrs,\r\n staticCodeMap,\r\n staticOptionsMap,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...formProps,\r\n };\r\n }\r\n if (compType === 'descriptions') {\r\n const descriptionsProps = formatDescriptionsProps({\r\n options: {\r\n column,\r\n attrs,\r\n },\r\n parameters: allParametrs,\r\n staticCodeMap,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...descriptionsProps,\r\n };\r\n }\r\n if (compType === 'loop') {\r\n const loopProps = formatLoopProps({\r\n options: {\r\n dataSource: compDataSource,\r\n },\r\n parameters: allParametrs,\r\n staticCodeMap,\r\n });\r\n const loopChilds:({[key:string]:any}|null)[] = [];\r\n if (\r\n Array.isArray(loopProps?.dataSource) && loopProps?.dataSource?.length > 0 &&\r\n Array.isArray(children) && children.length > 0\r\n ) {\r\n loopProps?.dataSource.forEach((dataItem) => {\r\n const dataItemKey = moduleDataRes?.compProps?.rowKey && dataItem?.[moduleDataRes?.compProps?.rowKey] ?\r\n dataItem?.[moduleDataRes?.compProps?.rowKey] : '';\r\n loopChilds.push({\r\n id: dataItemKey,\r\n key: dataItemKey,\r\n compType: 'loopItem',\r\n compProps: {},\r\n originItem: dataItem,\r\n children: children.map((item:{[key:string]:any}) => {\r\n const loopChildInfo = formatModuleData({\r\n moduleData: item,\r\n parentModuleData: moduleData,\r\n loopItemData: typeof dataItem === 'object' ? dataItem : { item: dataItem },\r\n parameters,\r\n staticCodeList,\r\n disabled,\r\n pageData,\r\n });\r\n return loopChildInfo;\r\n }),\r\n });\r\n });\r\n } else if (Array.isArray(children) && children.length > 0) {\r\n loopChilds.push({\r\n id: '1',\r\n key: '1',\r\n compType: 'loopItem',\r\n compProps: {},\r\n originItem: {},\r\n children: children.map((item:{[key:string]:any}) => {\r\n const loopChildInfo = formatModuleData({\r\n moduleData: item,\r\n parentModuleData: moduleData,\r\n loopItemData: {},\r\n parameters,\r\n staticCodeList,\r\n disabled,\r\n pageData,\r\n });\r\n return loopChildInfo;\r\n }),\r\n });\r\n }\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes?.compProps || {}),\r\n ...loopProps,\r\n column,\r\n children: loopChilds,\r\n };\r\n }\r\n if (['list', 'card', 'recommendList'].includes(compType)) {\r\n const resProps = formatListProps({\r\n options: {\r\n ...otherCompProps,\r\n rowKey,\r\n rowSelection,\r\n attrs,\r\n itemLabel: listItemLabel,\r\n itemContent: listItemContent,\r\n itemDescribe: listItemDescribe,\r\n dataSource: compDataSource,\r\n },\r\n urlPrefix,\r\n staticCodeMap,\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes.compProps || {}),\r\n ...resProps,\r\n };\r\n }\r\n if (['echartBar', 'echartLine'].includes(compType)) {\r\n const echartProps = formatEchartLineProps({\r\n options: { ...otherCompProps, dataSource: compDataSource },\r\n parameters: allParametrs,\r\n });\r\n\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes.compProps || {}),\r\n ...echartProps,\r\n };\r\n }\r\n if (compType === 'echartPie') {\r\n const echartProps = formatEchartPieProps({\r\n options: {\r\n dataSource: compDataSource,\r\n ...otherCompProps,\r\n },\r\n parameters: allParametrs,\r\n });\r\n\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes.compProps || {}),\r\n ...echartProps,\r\n };\r\n }\r\n if (compType === 'charts') {\r\n const chartsProps = formatChartsProps({\r\n options: {\r\n echartsOptions: compProps?.echartsOptions,\r\n },\r\n parameters: allParametrs,\r\n });\r\n\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes.compProps || {}),\r\n ...chartsProps,\r\n };\r\n }\r\n }\r\n if (compType === 'steps') {\r\n const stepsProps = formatStepsProps({\r\n options: {\r\n dataSource: compDataSource,\r\n ...otherCompProps,\r\n },\r\n parameters: allParametrs,\r\n });\r\n moduleDataRes.compProps = {\r\n ...(moduleDataRes.compProps || {}),\r\n ...stepsProps,\r\n };\r\n }\r\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\r\n // 所有的模版 拼一个组装数据的key值\r\n if (moduleData?.compProps && fieldName) {\r\n moduleDataRes.compProps.fieldName = fieldName;\r\n }\r\n }\r\n\r\n return moduleDataRes;\r\n};\r\n\r\nexport default formatModuleData;\r\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AACP,uBAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import 'ses';\nimport { cloneDeep } from 'lodash';\nimport { getDataArr } from '../treeUtils';\nimport {\n urlPrefix,\n formatListProps,\n formatTableProps,\n formatPanelProps,\n formatCarouselProps,\n formatImageProps,\n formatFormProps,\n formatHighCodeProps,\n formatDescriptionsProps,\n formatLoopProps,\n formatStyleProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatChartsProps,\n formatStepsProps,\n formatIconProps,\n formatControlBtn,\n staticCodeAssemble,\n stringPramarsValTransition,\n stringScriptExecution,\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 ...cloneDeep(parameters || {}),\n pageData: cloneDeep(pageData || {}),\n loopItem: cloneDeep(loopItemData || {}),\n }; // 把页面数据与入参组装到一起\n const {\n staticCodeMap,\n staticOptionsMap,\n } = staticCodeAssemble(staticCodeList);\n\n if (moduleData) {\n const {\n commonProps,\n compProps,\n compType,\n children,\n moduleTitle,\n moduleTitleIcon,\n moduleDescribe,\n controlBtns: moduleControlBtns,\n id,\n } = moduleData;\n // 组装静态数据映射\n moduleDataRes = {\n ...moduleData,\n key: id,\n disabled,\n compProps: {},\n commonProps: {},\n originModule: cloneDeep(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 (moduleTitleIcon) {\n moduleDataRes.moduleTitleIcon = null;\n if (moduleTitleIcon?.type === 'icon') {\n const iconProps = formatIconProps({\n icon: moduleTitleIcon?.icon,\n parameters: allParametrs,\n });\n if (iconProps?.icon) {\n moduleDataRes.moduleTitleIcon = {\n type: 'icon',\n icon: iconProps,\n style: moduleTitleIcon?.style || {},\n className: moduleTitleIcon?.className || '',\n };\n } else {\n moduleDataRes.moduleTitleIcon = null;\n }\n } else if (moduleTitleIcon?.type === 'image') {\n const imageProps = formatImageProps({\n options: {\n dataSource: moduleTitleIcon?.image,\n },\n parameters: allParametrs,\n });\n if (imageProps?.src) {\n moduleDataRes.moduleTitleIcon = {\n type: 'image',\n image: imageProps,\n style: moduleTitleIcon?.style || {},\n className: moduleTitleIcon?.className || '',\n };\n } else {\n moduleDataRes.moduleTitleIcon = null;\n }\n }\n }\n if (moduleDescribe) {\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\n }\n \n if (otherCompProps?.title) {\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\n }\n\n if (commonProps && Object.keys(commonProps).length > 0) {\n Object.keys(commonProps).forEach(key => {\n if (key === 'hidden') {\n if (typeof commonProps[key] === 'boolean' || typeof commonProps[key] === 'string') {\n if (typeof commonProps[key] === 'boolean') {\n moduleDataRes.commonProps.hidden = commonProps[key];\n } else if (typeof commonProps[key] === 'string') {\n const hidden = stringScriptExecution(commonProps[key], allParametrs);\n moduleDataRes.commonProps.hidden = hidden;\n }\n }\n } else {\n moduleDataRes.commonProps[key] = commonProps[key];\n }\n });\n }\n\n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\n // 处理page组件的onLoad事件\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 if (\n ['panel', 'div', 'page'].indexOf(compType) >= 0) {\n const childs = Array.isArray(children) &&\n children.length > 0 ? 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 if (childs?.length > 0) {\n moduleDataRes.children = childs;\n }\n if (compType === 'panel') {\n moduleDataRes.compProps = formatPanelProps({\n compProps: otherCompProps,\n parameters: allParametrs,\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 console.log('articleContent', articleContent, allParametrs);\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 === 'icon') {\n const iconProps = formatIconProps({\n icon: compProps?.icon,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n icon: iconProps,\n };\n }\n if (compType === 'txt') {\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n content: stringPramarsValTransition(compProps?.content, allParametrs),\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 id,\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 id,\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 if (Array.isArray(moduleControlBtns) && moduleControlBtns.length > 0) {\n moduleDataRes.controlBtns = moduleControlBtns.map(btn => formatControlBtn({\n btnProps: btn,\n parameters: allParametrs,\n }));\n }\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\n // 所有的模版 拼一个组装数据的key值\n if (moduleData?.compProps && fieldName) {\n moduleDataRes.compProps.fieldName = fieldName;\n }\n }\n return moduleDataRes;\n};\n\nexport default formatModuleData;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AACP,oBAA0B;AAC1B,uBAA2B;AAC3B,qBAqBO;AAYP,IAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAwD;AA5CxD;AA6CE,MAAI,gBAAwC,CAAC;AAC7C,QAAM,eAAuC;AAAA,IAC3C,OAAG,yBAAU,cAAc,CAAC,CAAC;AAAA,IAC7B,cAAU,yBAAU,YAAY,CAAC,CAAC;AAAA,IAClC,cAAU,yBAAU,gBAAgB,CAAC,CAAC;AAAA,EACxC;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,MACA;AAAA,MACA,aAAa;AAAA,MACb;AAAA,IACF,IAAI;AAEJ,oBAAgB;AAAA,MACd,GAAG;AAAA,MACH,KAAK;AAAA,MACL;AAAA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AA,IACtC;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["_a", "_b", "_c"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/formatModule/helpers/formRulsRegMap.ts"],
|
|
4
|
-
"sourcesContent": ["const formRulsRegMap:{[key:string]: RegExp} = {\
|
|
4
|
+
"sourcesContent": ["const formRulsRegMap:{[key:string]: RegExp} = {\n phone: /^(?:(?:\\+|00)86)?1[3-9]\\d{9}$/,\n email: /^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/,\n};\n\nexport default formRulsRegMap;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,iBAAwC;AAAA,EAC5C,OAAO;AAAA,EACP,OAAO;AACT;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/formatModule/helpers/formatCarouselProps.ts"],
|
|
4
|
-
"sourcesContent": ["import { getParamsContentByParamKeys } from '../../treeUtils';\
|
|
4
|
+
"sourcesContent": ["import { getParamsContentByParamKeys } from '../../treeUtils';\nimport { getFileUrlById } from '../../file';\n\n\nexport type formatCarouselPropsType = {\n options?: {\n dataSource?: {[key:string]: any}\n },\n parameters?:{[key:string]: any};\n}\n\nconst formatCarouselProps = ({\n options = {},\n parameters,\n}: formatCarouselPropsType) => {\n const { dataSource } = options;\n const caroueProps:{[key:string]: any} = {};\n if (\n dataSource?.dataType === 'staticData' &&\n Array.isArray(dataSource?.fileList) &&\n dataSource?.fileList.length > 0\n ) {\n caroueProps.dataSource = dataSource?.fileList.map((fileItem:{[key:string]: any}) => {\n const fileItemObj:{[key:string]: any} = {};\n fileItemObj.fileUrl = getFileUrlById(fileItem?.fileId);\n fileItemObj.fileDesc = fileItem?.fileName;\n return fileItemObj;\n });\n }\n if (\n dataSource?.dataType === 'context' &&\n dataSource?.fileUrl\n ) {\n const fileDataSourceArr = getParamsContentByParamKeys(dataSource?.fileUrl, parameters || {});\n const fileDataDescArr = getParamsContentByParamKeys(dataSource?.fileDesc, parameters || {});\n \n if (Array.isArray(fileDataSourceArr)) {\n caroueProps.dataSource = fileDataSourceArr.map((fileUrl:{[key:string]: any}, idx:number) => {\n return {\n fileUrl,\n fileDesc: fileDataDescArr?.[idx] || '',\n };\n });\n } else {\n caroueProps.dataSource = [];\n }\n }\n return caroueProps;\n};\n\nexport default formatCarouselProps;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA4C;AAC5C,kBAA+B;AAU/B,IAAM,sBAAsB,CAAC;AAAA,EAC3B,UAAU,CAAC;AAAA,EACX;AACF,MAA+B;AAC7B,QAAM,EAAE,WAAW,IAAI;AACvB,QAAM,cAAkC,CAAC;AACzC,OACE,yCAAY,cAAa,gBACvB,MAAM,QAAQ,yCAAY,QAAQ,MAClC,yCAAY,SAAS,UAAS,GAChC;AACA,gBAAY,aAAa,yCAAY,SAAS,IAAI,CAAC,aAAiC;AAClF,YAAM,cAAkC,CAAC;AACzC,kBAAY,cAAU,4BAAe,qCAAU,MAAM;AACrD,kBAAY,WAAW,qCAAU;AACjC,aAAO;AAAA,IACT;AAAA,EACF;AACA,OACE,yCAAY,cAAa,cACzB,yCAAY,UACZ;AACA,UAAM,wBAAoB,8CAA4B,yCAAY,SAAS,cAAc,CAAC,CAAC;AAC3F,UAAM,sBAAkB,8CAA4B,yCAAY,UAAU,cAAc,CAAC,CAAC;AAE1F,QAAI,MAAM,QAAQ,iBAAiB,GAAG;AACpC,kBAAY,aAAa,kBAAkB,IAAI,CAAC,SAA6B,QAAe;AAC1F,eAAO;AAAA,UACL;AAAA,UACA,WAAU,mDAAkB,SAAQ;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,kBAAY,aAAa,CAAC;AAAA,IAC5B;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/formatModule/helpers/formatChartsProps.ts"],
|
|
4
|
-
"sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\
|
|
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
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
6
|
"names": ["stringPramarsValTransition"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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/formatControlBtn.ts
|
|
30
|
+
var formatControlBtn_exports = {};
|
|
31
|
+
__export(formatControlBtn_exports, {
|
|
32
|
+
default: () => formatControlBtn_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(formatControlBtn_exports);
|
|
35
|
+
var import_formatIconProps = __toESM(require("./formatIconProps"));
|
|
36
|
+
var import_formatImageProps = __toESM(require("./formatImageProps"));
|
|
37
|
+
var formatControlBtn = ({
|
|
38
|
+
parameters,
|
|
39
|
+
btnProps = {}
|
|
40
|
+
}) => {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
const res = { ...btnProps };
|
|
43
|
+
if (((_a = res == null ? void 0 : res.btnIcon) == null ? void 0 : _a.type) === "icon") {
|
|
44
|
+
const iconProps = (0, import_formatIconProps.default)({
|
|
45
|
+
icon: (_b = res == null ? void 0 : res.btnIcon) == null ? void 0 : _b.icon,
|
|
46
|
+
parameters
|
|
47
|
+
});
|
|
48
|
+
res.btnIcon = (iconProps == null ? void 0 : iconProps.icon) ? {
|
|
49
|
+
type: "icon",
|
|
50
|
+
icon: iconProps
|
|
51
|
+
} : null;
|
|
52
|
+
} else if (((_c = res == null ? void 0 : res.btnIcon) == null ? void 0 : _c.type) === "image") {
|
|
53
|
+
const imageProps = (0, import_formatImageProps.default)({
|
|
54
|
+
options: {
|
|
55
|
+
dataSource: (_d = res == null ? void 0 : res.btnIcon) == null ? void 0 : _d.image
|
|
56
|
+
},
|
|
57
|
+
parameters
|
|
58
|
+
});
|
|
59
|
+
res.btnIcon = (imageProps == null ? void 0 : imageProps.src) ? {
|
|
60
|
+
type: "image",
|
|
61
|
+
image: imageProps
|
|
62
|
+
} : null;
|
|
63
|
+
}
|
|
64
|
+
return res;
|
|
65
|
+
};
|
|
66
|
+
var formatControlBtn_default = formatControlBtn;
|
|
67
|
+
//# sourceMappingURL=formatControlBtn.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/formatModule/helpers/formatControlBtn.ts"],
|
|
4
|
+
"sourcesContent": ["import formatIconProps from './formatIconProps';\nimport formatImageProps from './formatImageProps';\n\nexport type formatControlBtnProps = {\n btnProps?: any;\n parameters?: {[key:string]: any};\n}\n\nconst formatControlBtn = ({\n parameters,\n btnProps = {},\n}: formatControlBtnProps): formatControlBtnProps => {\n const res = { ...btnProps };\n if (res?.btnIcon?.type === 'icon') {\n const iconProps = formatIconProps({\n icon: res?.btnIcon?.icon,\n parameters,\n });\n res.btnIcon = iconProps?.icon ? {\n type: 'icon',\n icon: iconProps,\n } : null;\n } else if (res?.btnIcon?.type === 'image') {\n const imageProps = formatImageProps({\n options: {\n dataSource: res?.btnIcon?.image,\n },\n parameters,\n });\n res.btnIcon = imageProps?.src ? {\n type: 'image',\n image: imageProps,\n } : null;\n }\n return res;\n};\n\nexport default formatControlBtn;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA4B;AAC5B,8BAA6B;AAO7B,IAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA,WAAW,CAAC;AACd,MAAoD;AAXpD;AAYE,QAAM,MAAM,EAAE,GAAG,SAAS;AAC1B,QAAI,gCAAK,YAAL,mBAAc,UAAS,QAAQ;AACjC,UAAM,gBAAY,uBAAAA,SAAgB;AAAA,MAChC,OAAM,gCAAK,YAAL,mBAAc;AAAA,MACpB;AAAA,IACF,CAAC;AACD,QAAI,WAAU,uCAAW,QAAO;AAAA,MAC9B,MAAM;AAAA,MACN,MAAM;AAAA,IACR,IAAI;AAAA,EACN,aAAW,gCAAK,YAAL,mBAAc,UAAS,SAAS;AACzC,UAAM,iBAAa,wBAAAC,SAAiB;AAAA,MAClC,SAAS;AAAA,QACP,aAAY,gCAAK,YAAL,mBAAc;AAAA,MAC5B;AAAA,MACA;AAAA,IACF,CAAC;AACD,QAAI,WAAU,yCAAY,OAAM;AAAA,MAC9B,MAAM;AAAA,MACN,OAAO;AAAA,IACT,IAAI;AAAA,EACN;AACA,SAAO;AACT;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": ["formatIconProps", "formatImageProps"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/formatModule/helpers/formatDescriptionsProps.ts"],
|
|
4
|
-
"sourcesContent": ["import { set } from 'lodash';\
|
|
4
|
+
"sourcesContent": ["import { set } from 'lodash';\nimport stringPramarsValTransition from './stringPramarsValTransition';\n\nexport type formatDescriptionsPropsType = {\n options?: {[key:string]: any};\n staticCodeMap?: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nexport type formatListPropsExportType = {[key: string]: any}\n\nconst formatDescriptionsProps = ({\n options = {},\n parameters,\n staticCodeMap,\n}: formatDescriptionsPropsType): formatListPropsExportType => {\n const { column, attrs } = options;\n const dataList: { [key: string]: any }[] = [];\n const res:{[key:string]: any} = {\n column: column || 1,\n };\n if (Array.isArray(attrs) && attrs.length > 0) {\n attrs.forEach((attrItem) => {\n const dataObj: { [key: string]: any } = {\n label: attrItem?.attrName,\n };\n if (attrItem?.defaultValue) {\n const descValue = stringPramarsValTransition(attrItem?.defaultValue, parameters || {});\n dataObj.description = descValue;\n // 如果存在静态数组,则翻译静态数据\n if (\n attrItem?.staticCode &&\n staticCodeMap?.[attrItem?.staticCode]?.[descValue]\n ) {\n dataObj.description =\n staticCodeMap?.[attrItem?.staticCode]?.[descValue];\n }\n }\n dataList.push(dataObj);\n });\n set(res, ['dataSource'], dataList);\n }\n return res;\n};\n\n\nexport default formatDescriptionsProps;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoB;AACpB,wCAAuC;AAUvC,IAAM,0BAA0B,CAAC;AAAA,EAC/B,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8D;AAC5D,QAAM,EAAE,QAAQ,MAAM,IAAI;AAC1B,QAAM,WAAqC,CAAC;AAC5C,QAAM,MAA0B;AAAA,IAC9B,QAAQ,UAAU;AAAA,EACpB;AACA,MAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,GAAG;AAC5C,UAAM,QAAQ,CAAC,aAAa;AAtBhC;AAuBM,YAAM,UAAkC;AAAA,QACtC,OAAO,qCAAU;AAAA,MACnB;AACA,UAAI,qCAAU,cAAc;AAC1B,cAAM,gBAAY,kCAAAA,SAA2B,qCAAU,cAAc,cAAc,CAAC,CAAC;AACrF,gBAAQ,cAAc;AAEtB,aACE,qCAAU,iBACJ,oDAAgB,qCAAU,gBAA1B,mBAAwC,aAC9C;AACA,kBAAQ,eACA,oDAAgB,qCAAU,gBAA1B,mBAAwC;AAAA,QAClD;AAAA,MACF;AACA,eAAS,KAAK,OAAO;AAAA,IACvB,CAAC;AACD,2BAAI,KAAK,CAAC,YAAY,GAAG,QAAQ;AAAA,EACnC;AACA,SAAO;AACT;AAGA,IAAO,kCAAQ;",
|
|
6
6
|
"names": ["stringPramarsValTransition"]
|
|
7
7
|
}
|