szld-libs 0.2.99 → 0.3.2
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/style.css +1 -1
- package/dist/szld-components.es.js +32023 -20148
- package/dist/szld-components.umd.js +72 -60
- package/es/components/DynamicForm/index.js +3 -2
- package/es/components/DynamicForm/selectModelBackfillFormItem/index.js +8 -7
- package/es/components/DynamicFormMobile/func.d.ts +35 -0
- package/es/components/DynamicFormMobile/func.js +204 -0
- package/es/components/DynamicFormMobile/index.d.ts +116 -0
- package/es/components/DynamicFormMobile/index.js +134 -0
- package/es/components/DynamicFormMobile/myCascader/index.d.ts +17 -0
- package/es/components/DynamicFormMobile/myCascader/index.js +196 -0
- package/es/components/DynamicFormMobile/myCascader/vite.svg +1 -0
- package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +19 -0
- package/es/components/DynamicFormMobile/myCheckbox/index.js +109 -0
- package/es/components/DynamicFormMobile/myCheckbox/vite.svg +1 -0
- package/es/components/DynamicFormMobile/myRadio/index.d.ts +20 -0
- package/es/components/DynamicFormMobile/myRadio/index.js +107 -0
- package/es/components/DynamicFormMobile/myRadio/vite.svg +1 -0
- package/es/components/DynamicFormMobile/mySelect/index.css +31 -0
- package/es/components/DynamicFormMobile/mySelect/index.d.ts +16 -0
- package/es/components/DynamicFormMobile/mySelect/index.js +147 -0
- package/es/components/DynamicFormMobile/mySelect/vite.svg +1 -0
- package/es/components/DynamicFormMobile/myUpload/index.css +3 -0
- package/es/components/DynamicFormMobile/myUpload/index.d.ts +16 -0
- package/es/components/DynamicFormMobile/myUpload/index.js +103 -0
- package/es/components/DynamicFormMobile/myUpload/vite.svg +1 -0
- package/es/components/DynamicFormMobile/radioCard/index.d.ts +12 -0
- package/es/components/DynamicFormMobile/radioCard/index.js +142 -0
- package/es/components/DynamicFormMobile/radioCard/vite.svg +1 -0
- package/es/components/DynamicFormMobile/selectModel/index.d.ts +22 -0
- package/es/components/DynamicFormMobile/selectModel/index.js +235 -0
- package/es/components/DynamicFormMobile/selectModel/vite.svg +1 -0
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +27 -0
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.js +242 -0
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/vite.svg +1 -0
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +43 -0
- package/es/components/DynamicFormMobile/useDynamicForm.js +772 -0
- package/es/components/DynamicFormMobile/vite.svg +1 -0
- package/es/index.css +1 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +35 -29
- package/es/main.d.ts +2 -1
- package/es/main.js +22 -20
- package/es/mock/index.js +20 -59
- package/es/services/index.js +3 -5
- package/es/services/request.js +2 -2
- package/es/utils/method.d.ts +6 -1
- package/es/utils/method.js +60 -34
- package/lib/components/DynamicForm/index.js +3 -2
- package/lib/components/DynamicForm/selectModelBackfillFormItem/index.js +8 -7
- package/lib/components/DynamicFormMobile/func.d.ts +35 -0
- package/lib/components/DynamicFormMobile/func.js +204 -0
- package/lib/components/DynamicFormMobile/index.d.ts +116 -0
- package/lib/components/DynamicFormMobile/index.js +133 -0
- package/lib/components/DynamicFormMobile/myCascader/index.d.ts +17 -0
- package/lib/components/DynamicFormMobile/myCascader/index.js +195 -0
- package/lib/components/DynamicFormMobile/myCascader/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +19 -0
- package/lib/components/DynamicFormMobile/myCheckbox/index.js +108 -0
- package/lib/components/DynamicFormMobile/myCheckbox/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/myRadio/index.d.ts +20 -0
- package/lib/components/DynamicFormMobile/myRadio/index.js +106 -0
- package/lib/components/DynamicFormMobile/myRadio/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/mySelect/index.css +31 -0
- package/lib/components/DynamicFormMobile/mySelect/index.d.ts +16 -0
- package/lib/components/DynamicFormMobile/mySelect/index.js +146 -0
- package/lib/components/DynamicFormMobile/mySelect/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/myUpload/index.css +3 -0
- package/lib/components/DynamicFormMobile/myUpload/index.d.ts +16 -0
- package/lib/components/DynamicFormMobile/myUpload/index.js +102 -0
- package/lib/components/DynamicFormMobile/myUpload/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/radioCard/index.d.ts +12 -0
- package/lib/components/DynamicFormMobile/radioCard/index.js +141 -0
- package/lib/components/DynamicFormMobile/radioCard/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/selectModel/index.d.ts +22 -0
- package/lib/components/DynamicFormMobile/selectModel/index.js +235 -0
- package/lib/components/DynamicFormMobile/selectModel/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +27 -0
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.js +242 -0
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +43 -0
- package/lib/components/DynamicFormMobile/useDynamicForm.js +771 -0
- package/lib/components/DynamicFormMobile/vite.svg +1 -0
- package/lib/index.css +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +35 -29
- package/lib/main.d.ts +2 -1
- package/lib/main.js +2 -0
- package/lib/mock/index.js +20 -59
- package/lib/services/index.js +3 -5
- package/lib/services/request.js +2 -2
- package/lib/utils/method.d.ts +6 -1
- package/lib/utils/method.js +60 -34
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/lib/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import './index.css';
|
package/lib/index.js
CHANGED
|
@@ -1,45 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const services = require("./services");
|
|
4
|
+
const method = require("./utils/method");
|
|
5
|
+
const main = require("./main");
|
|
5
6
|
const reactRouterDom = require("react-router-dom");
|
|
6
7
|
const antd = require("antd");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const reactVant = require("react-vant");
|
|
9
|
+
const react = require("react");
|
|
10
|
+
const ReactDOM = require("react-dom/client");
|
|
10
11
|
const zhCN = require("antd/es/locale/zh_CN");
|
|
12
|
+
const mock = require("./mock");
|
|
11
13
|
const dayjs = require("dayjs");
|
|
14
|
+
const index = "";
|
|
12
15
|
dayjs.locale("zh-cn");
|
|
13
16
|
const Demo = () => {
|
|
14
17
|
react.useEffect(() => {
|
|
15
18
|
}, []);
|
|
16
19
|
const formRef = react.useRef(null);
|
|
17
|
-
|
|
18
|
-
const onFinish = (values) => {
|
|
19
|
-
};
|
|
20
|
+
reactVant.Form.useForm();
|
|
20
21
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
21
22
|
/* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
main.DynamicFormMobile,
|
|
25
|
+
{
|
|
26
|
+
formConfig: method.handleAttrList(mock.attrList),
|
|
27
|
+
readonly: false,
|
|
28
|
+
relatedid: "guid",
|
|
29
|
+
colNum: 1,
|
|
30
|
+
defaultWidth: "100%",
|
|
31
|
+
commonRequestWidthParams: services.commonRequestWidthParams,
|
|
32
|
+
uploadAction: services.uploadFormAction,
|
|
33
|
+
commonRequest: services.commonRequest,
|
|
34
|
+
instructionShowMode: "icon",
|
|
35
|
+
ref: formRef,
|
|
36
|
+
formShowType: "table"
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
reactVant.Button,
|
|
41
|
+
{
|
|
42
|
+
onClick: async () => {
|
|
43
|
+
var _a;
|
|
44
|
+
await ((_a = formRef.current) == null ? void 0 : _a.submitForm());
|
|
45
|
+
},
|
|
46
|
+
children: "提交"
|
|
47
|
+
}
|
|
48
|
+
),
|
|
43
49
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
44
50
|
"2. 测试循环滚动组件",
|
|
45
51
|
/* @__PURE__ */ jsxRuntime.jsx(
|
package/lib/main.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import LoopSlide from './components/LoopSlide';
|
|
|
9
9
|
import showWorkFlow, { WorkFlowNode } from './components/WorkFlowNode';
|
|
10
10
|
import CustomPagination from './components/CustomPagination';
|
|
11
11
|
import DynamicForm from './components/DynamicForm';
|
|
12
|
+
import DynamicFormMobile from './components/DynamicFormMobile';
|
|
12
13
|
import * as download from './utils/download';
|
|
13
14
|
import * as fileType from './utils/filetype';
|
|
14
15
|
import * as FormRules from './utils/formRules';
|
|
@@ -26,4 +27,4 @@ import useConfig from './hooks/useConfig';
|
|
|
26
27
|
import useRemember from './hooks/useRemember';
|
|
27
28
|
import useRowSelection from './hooks/useRowSelection';
|
|
28
29
|
import useDetailRender from './hooks/useDetailRender';
|
|
29
|
-
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, EditTable, HmacSHA512, HmacSM3, LoopSlide, SearchTable, showWorkFlow, UploadFile, DynamicForm, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, WorkFlowNode, CustomPagination, useDetailRender, utils, download, fileType, FormRules, verfyCode, method, szxkFunc, };
|
|
30
|
+
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, EditTable, HmacSHA512, HmacSM3, LoopSlide, SearchTable, showWorkFlow, UploadFile, DynamicForm, DynamicFormMobile, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, WorkFlowNode, CustomPagination, useDetailRender, utils, download, fileType, FormRules, verfyCode, method, szxkFunc, };
|
package/lib/main.js
CHANGED
|
@@ -11,6 +11,7 @@ const LoopSlide = require("./components/LoopSlide");
|
|
|
11
11
|
const WorkFlowNode = require("./components/WorkFlowNode");
|
|
12
12
|
const CustomPagination = require("./components/CustomPagination");
|
|
13
13
|
const DynamicForm = require("./components/DynamicForm");
|
|
14
|
+
const DynamicFormMobile = require("./components/DynamicFormMobile");
|
|
14
15
|
const download = require("./utils/download");
|
|
15
16
|
const filetype = require("./utils/filetype");
|
|
16
17
|
const formRules = require("./utils/formRules");
|
|
@@ -66,6 +67,7 @@ Object.defineProperty(exports, "WorkFlowNode", {
|
|
|
66
67
|
exports.showWorkFlow = WorkFlowNode;
|
|
67
68
|
exports.CustomPagination = CustomPagination;
|
|
68
69
|
exports.DynamicForm = DynamicForm;
|
|
70
|
+
exports.DynamicFormMobile = DynamicFormMobile;
|
|
69
71
|
exports.download = download__namespace;
|
|
70
72
|
exports.fileType = filetype__namespace;
|
|
71
73
|
exports.FormRules = formRules__namespace;
|
package/lib/mock/index.js
CHANGED
|
@@ -4,78 +4,39 @@ const baseAttrList = [];
|
|
|
4
4
|
const attrList = [
|
|
5
5
|
{
|
|
6
6
|
xh: 1,
|
|
7
|
-
asid: "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
attrid: "02FAE63A990E4E9D87609D3DA764B10C",
|
|
11
|
-
attrname: "唯一编号",
|
|
7
|
+
asid: "904A28FACAF346DFA63CBEEB3437BDA8",
|
|
8
|
+
attrid: "6970C54A08E54463888CD8F9E7FD851B",
|
|
9
|
+
attrname: "喂药日期",
|
|
12
10
|
attrtype: 0,
|
|
13
|
-
info: '{"input":"
|
|
11
|
+
info: '{"input":"multiple-date-picker","range-picker-save":"single","dataType":"string","length":1000}',
|
|
14
12
|
info_base64: 0,
|
|
15
|
-
createtime: "2026-01-
|
|
16
|
-
attrvalue: "",
|
|
17
|
-
serialnum: 0,
|
|
18
|
-
children: []
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
xh: 2,
|
|
22
|
-
asid: "FB5D3B940E544EA898A6983A31FD1504",
|
|
23
|
-
astype: 0,
|
|
24
|
-
tname: "ygzh_table",
|
|
25
|
-
attrid: "3A8EC89103A740F192CB5FD582CA5678",
|
|
26
|
-
attrname: "账号",
|
|
27
|
-
attrtype: 0,
|
|
28
|
-
info: '{"input":"text","dataType":"string","length":100}',
|
|
29
|
-
info_base64: 0,
|
|
30
|
-
createtime: "2026-01-26 10:23:31",
|
|
31
|
-
attrvalue: "",
|
|
13
|
+
createtime: "2026-01-05 15:33:36",
|
|
32
14
|
serialnum: 1,
|
|
33
|
-
|
|
15
|
+
label_list: []
|
|
34
16
|
},
|
|
35
17
|
{
|
|
36
|
-
xh:
|
|
37
|
-
asid: "
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
attrid: "7795221133E0479D956D254A71858B39",
|
|
41
|
-
attrname: "密码",
|
|
18
|
+
xh: 2,
|
|
19
|
+
asid: "904A28FACAF346DFA63CBEEB3437BDA8",
|
|
20
|
+
attrid: "98FD46568CAC4F248B5FD66D52DF5086",
|
|
21
|
+
attrname: "当日次数",
|
|
42
22
|
attrtype: 0,
|
|
43
|
-
info: '{"input":"text","dataType":"string","length":
|
|
23
|
+
info: '{"input":"text","dataType":"string","length":1}',
|
|
44
24
|
info_base64: 0,
|
|
45
|
-
createtime: "2026-01-
|
|
46
|
-
attrvalue: "",
|
|
25
|
+
createtime: "2026-01-05 15:33:45",
|
|
47
26
|
serialnum: 2,
|
|
48
|
-
|
|
27
|
+
label_list: []
|
|
49
28
|
},
|
|
50
29
|
{
|
|
51
|
-
xh:
|
|
52
|
-
asid: "
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
attrid: "7039599603174845B3CD03CA351EEB62",
|
|
56
|
-
attrname: "关联人员编号",
|
|
30
|
+
xh: 3,
|
|
31
|
+
asid: "904A28FACAF346DFA63CBEEB3437BDA8",
|
|
32
|
+
attrid: "E7C4B706E65E4F81B51AAA9D313B5482",
|
|
33
|
+
attrname: "当日时间",
|
|
57
34
|
attrtype: 0,
|
|
58
|
-
info: '{
|
|
35
|
+
info: '{"input":"mult-select","inputType":"local","data":["09:00","10:00","11:00","12:00","13:00","14:00"],"dataType":"string","length":100}',
|
|
59
36
|
info_base64: 0,
|
|
60
|
-
createtime: "2026-01-
|
|
61
|
-
attrvalue: "",
|
|
37
|
+
createtime: "2026-01-05 15:34:22",
|
|
62
38
|
serialnum: 3,
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
xh: 5,
|
|
67
|
-
asid: "FB5D3B940E544EA898A6983A31FD1504",
|
|
68
|
-
astype: 0,
|
|
69
|
-
tname: "ygzh_table",
|
|
70
|
-
attrid: "3DD9CF67A3E34A62A9857CD1DB9CD782",
|
|
71
|
-
attrname: "关联人员姓名",
|
|
72
|
-
attrtype: 0,
|
|
73
|
-
info: '{\r\n "input": "mul-field-modal-select",\r\n "inputType": "url",\r\n "dataType": "string",\r\n "length": 100,\r\n "modal-caption": "关联人员",\r\n "modal-width": 800,\r\n "modal-height": 500,\r\n "modal-field-list": {\r\n "CAB51378248F4097BE2CF327F78E408B": "姓名",\r\n "F7CB899C4AE140948D2D0E161F9B1F50": "性别",\r\n "FF3E62E516124D8296D3A0BF6A7160EC": "出生年月日",\r\n "E84B71814D2C4921943B62243903F9CA": "职位"\r\n },\r\n "action-url": "http://113.219.243.107:19003/ucc?AppID=KF_SZLD_YLFWLR&Password=KF_SZLD_YLFWLR2557013&return=true&PageName=YLFWLRInstanceData&Controlname=List",\r\n "action-url-extra-params": {\r\n "asid": "3D6CD87DC9EC4CCB9FA1149A1F04E93A"\r\n },\r\n "key-field": {\r\n "3DD9CF67A3E34A62A9857CD1DB9CD782": {\r\n "list": ["CAB51378248F4097BE2CF327F78E408B"],\r\n "delimiter": "-"\r\n },\r\n "7039599603174845B3CD03CA351EEB62": {\r\n "list": ["9416A2FA296846E199738345A393E264"],\r\n "delimiter": "-"\r\n }\r\n }\r\n}',
|
|
74
|
-
info_base64: 0,
|
|
75
|
-
createtime: "2026-01-26 10:27:29",
|
|
76
|
-
attrvalue: "",
|
|
77
|
-
serialnum: 4,
|
|
78
|
-
children: []
|
|
39
|
+
label_list: []
|
|
79
40
|
}
|
|
80
41
|
];
|
|
81
42
|
exports.attrList = attrList;
|
package/lib/services/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const queryString = require("query-string");
|
|
4
4
|
const request = require("./request");
|
|
5
5
|
const _enum = require("../utils/enum");
|
|
6
|
-
const
|
|
6
|
+
const main = require("../main");
|
|
7
7
|
const commonRequest = async (InterfaceType, data) => {
|
|
8
8
|
return request.post("", data, {
|
|
9
9
|
params: {
|
|
@@ -36,7 +36,6 @@ const commonRequestActionUrl = async (data) => {
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
const uploadAction = () => {
|
|
39
|
-
var _a;
|
|
40
39
|
const SessionID = sessionStorage.getItem(_enum.TOKEN);
|
|
41
40
|
const params = {
|
|
42
41
|
...request.domainSetting.baseParams,
|
|
@@ -52,12 +51,11 @@ const uploadAction = () => {
|
|
|
52
51
|
obj[key] = params[key] || "";
|
|
53
52
|
});
|
|
54
53
|
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
55
|
-
const sha = new
|
|
54
|
+
const sha = new main.HmacSHA512("HnSzldjt#2557013#");
|
|
56
55
|
params["TokenId"] = sha.encrypt(encryptParams);
|
|
57
56
|
return request.domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
58
57
|
};
|
|
59
58
|
const uploadFormAction = () => {
|
|
60
|
-
var _a;
|
|
61
59
|
const SessionID = sessionStorage.getItem(_enum.TOKEN);
|
|
62
60
|
const params = {
|
|
63
61
|
...request.domainSetting.baseParams,
|
|
@@ -73,7 +71,7 @@ const uploadFormAction = () => {
|
|
|
73
71
|
obj[key] = params[key] || "";
|
|
74
72
|
});
|
|
75
73
|
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
76
|
-
const sha = new
|
|
74
|
+
const sha = new main.HmacSHA512("HnSzldjt#2557013#");
|
|
77
75
|
params["TokenId"] = sha.encrypt(encryptParams);
|
|
78
76
|
return request.domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
79
77
|
};
|
package/lib/services/request.js
CHANGED
|
@@ -17,8 +17,8 @@ const domainSetting = {
|
|
|
17
17
|
if (env === "test" || env === "dev") {
|
|
18
18
|
domainSetting.baseUrl = "/ucc";
|
|
19
19
|
domainSetting.baseParams = {
|
|
20
|
-
AppID: "
|
|
21
|
-
Password: "
|
|
20
|
+
AppID: "KF_SZLD_DDGLXT",
|
|
21
|
+
Password: "KF_SZLD_DDGLXT2557013"
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
if (env === "dev") {
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -10,7 +10,12 @@ export declare function isBase64(str: string): boolean;
|
|
|
10
10
|
* @param isListToObj 是否将列表转换为提交数据格式对象,默认false
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
|
-
export declare const handleSubmitForm: (originalData:
|
|
13
|
+
export declare const handleSubmitForm: (originalData: {
|
|
14
|
+
attr_list: any[];
|
|
15
|
+
isMobile?: boolean;
|
|
16
|
+
guid?: string;
|
|
17
|
+
isListToObj?: boolean;
|
|
18
|
+
}, allValues: any) => {
|
|
14
19
|
updatedData: any;
|
|
15
20
|
uploadedFiles: any[];
|
|
16
21
|
};
|
package/lib/utils/method.js
CHANGED
|
@@ -29,31 +29,36 @@ function isBase64(str) {
|
|
|
29
29
|
const base64Regex = /^[A-Za-z0-9+/]+(?:=?=?)$/;
|
|
30
30
|
return base64Regex.test(str);
|
|
31
31
|
}
|
|
32
|
-
const handleSubmitForm = (originalData, allValues
|
|
32
|
+
const handleSubmitForm = (originalData, allValues) => {
|
|
33
|
+
var _a;
|
|
33
34
|
let updatedData = _.cloneDeep(originalData);
|
|
35
|
+
const { attr_list = [] } = updatedData;
|
|
36
|
+
const { isMobile = false, guid, isListToObj = false } = originalData;
|
|
34
37
|
let uploadedFiles = [];
|
|
35
|
-
const processAttrList = (attrList) => {
|
|
38
|
+
const processAttrList = (attrList, values) => {
|
|
36
39
|
try {
|
|
37
40
|
const attrMap = new Map(attrList.map((item, index) => [item.attrid, index]));
|
|
38
|
-
for (const [fieldName, formValue] of Object.entries(
|
|
41
|
+
for (const [fieldName, formValue] of Object.entries(values)) {
|
|
39
42
|
const index = attrMap.get(fieldName);
|
|
40
|
-
if (index === void 0)
|
|
43
|
+
if (index === void 0) {
|
|
41
44
|
continue;
|
|
42
|
-
|
|
45
|
+
}
|
|
46
|
+
let attrItem = attrList[index];
|
|
43
47
|
if (!formValue && formValue !== 0) {
|
|
44
48
|
attrItem.attrvalue = "";
|
|
45
49
|
continue;
|
|
46
50
|
}
|
|
47
|
-
handleDealValue(attrItem, formValue);
|
|
51
|
+
attrItem = handleDealValue(attrItem, formValue, isMobile);
|
|
48
52
|
}
|
|
49
53
|
attrList.forEach((item) => {
|
|
50
54
|
if (item.children && Array.isArray(item.children) && item.children.length > 0 && !Array.isArray(item.children[0])) {
|
|
51
|
-
processAttrList(item.children);
|
|
55
|
+
processAttrList(item.children, values[item.attrid]);
|
|
52
56
|
}
|
|
53
57
|
if (item.children && Array.isArray(item.children) && item.children.length > 0 && Array.isArray(item.children[0])) {
|
|
54
|
-
item.children.forEach((v) => {
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
item.children.forEach((v, i) => {
|
|
59
|
+
var _a2;
|
|
60
|
+
if (v && Array.isArray(v)) {
|
|
61
|
+
processAttrList(v, (_a2 = values == null ? void 0 : values[item.attrid]) == null ? void 0 : _a2[i]);
|
|
57
62
|
}
|
|
58
63
|
});
|
|
59
64
|
}
|
|
@@ -61,9 +66,9 @@ const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
|
61
66
|
} catch (error) {
|
|
62
67
|
}
|
|
63
68
|
};
|
|
64
|
-
const handleDealValue = (attrItem, formValue) => {
|
|
65
|
-
var
|
|
66
|
-
const inputType = (
|
|
69
|
+
const handleDealValue = (attrItem, formValue, isMobile2) => {
|
|
70
|
+
var _a2, _b, _c, _d;
|
|
71
|
+
const inputType = (_a2 = attrItem.json) == null ? void 0 : _a2.input;
|
|
67
72
|
const format = (_b = attrItem.json) == null ? void 0 : _b["format"];
|
|
68
73
|
switch (inputType) {
|
|
69
74
|
case "image":
|
|
@@ -77,8 +82,8 @@ const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
|
77
82
|
}
|
|
78
83
|
const existingFiles = parsedValue.filter((file) => file.FileId);
|
|
79
84
|
const uploadedFileList = parsedValue.filter((file) => {
|
|
80
|
-
var
|
|
81
|
-
return file.status === "done" && ((
|
|
85
|
+
var _a3;
|
|
86
|
+
return file.status === "done" && ((_a3 = file.response) == null ? void 0 : _a3.data);
|
|
82
87
|
}).map((file) => file.response.data);
|
|
83
88
|
const allFiles = [...existingFiles, ...uploadedFileList];
|
|
84
89
|
uploadedFiles = [...uploadedFiles, ...uploadedFileList];
|
|
@@ -93,17 +98,33 @@ const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
|
93
98
|
}
|
|
94
99
|
break;
|
|
95
100
|
case "range-picker":
|
|
96
|
-
if (
|
|
97
|
-
|
|
101
|
+
if (isMobile2) {
|
|
102
|
+
if (Array.isArray(formValue) && formValue.length > 0) {
|
|
103
|
+
attrItem.attrvalue = formValue == null ? void 0 : formValue.map((v) => dayjs(v).format(format || "YYYY-MM-DD")).join("~");
|
|
104
|
+
} else {
|
|
105
|
+
attrItem.attrvalue = "";
|
|
106
|
+
}
|
|
98
107
|
} else {
|
|
99
|
-
|
|
108
|
+
if (Array.isArray(formValue) && formValue.length > 0) {
|
|
109
|
+
attrItem.attrvalue = formValue.join("~");
|
|
110
|
+
} else {
|
|
111
|
+
attrItem.attrvalue = "";
|
|
112
|
+
}
|
|
100
113
|
}
|
|
101
114
|
break;
|
|
102
115
|
case "multiple-date-picker":
|
|
103
|
-
if (
|
|
104
|
-
|
|
116
|
+
if (isMobile2) {
|
|
117
|
+
if (Array.isArray(formValue) && formValue.length > 0) {
|
|
118
|
+
attrItem.attrvalue = formValue == null ? void 0 : formValue.map((v) => dayjs(v).format(format || "YYYY-MM-DD")).join(",");
|
|
119
|
+
} else {
|
|
120
|
+
attrItem.attrvalue = formValue;
|
|
121
|
+
}
|
|
105
122
|
} else {
|
|
106
|
-
|
|
123
|
+
if (Array.isArray(formValue) && formValue.length > 0) {
|
|
124
|
+
attrItem.attrvalue = formValue.join(",");
|
|
125
|
+
} else {
|
|
126
|
+
attrItem.attrvalue = formValue;
|
|
127
|
+
}
|
|
107
128
|
}
|
|
108
129
|
break;
|
|
109
130
|
case "checkbox":
|
|
@@ -134,10 +155,25 @@ const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
|
134
155
|
}
|
|
135
156
|
break;
|
|
136
157
|
}
|
|
158
|
+
return attrItem;
|
|
137
159
|
};
|
|
138
160
|
if (updatedData.attr_list && Array.isArray(updatedData.attr_list)) {
|
|
139
|
-
processAttrList(
|
|
161
|
+
processAttrList(attr_list, allValues);
|
|
140
162
|
}
|
|
163
|
+
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
164
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
165
|
+
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"])) {
|
|
166
|
+
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
167
|
+
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
168
|
+
}
|
|
169
|
+
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid") {
|
|
170
|
+
v.attrvalue = guid || "";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if ((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) {
|
|
174
|
+
v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
141
177
|
return {
|
|
142
178
|
updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
|
|
143
179
|
uploadedFiles
|
|
@@ -315,12 +351,8 @@ const handleAttrListToObj = (attrList) => {
|
|
|
315
351
|
data_list: [processLevel(item.children)]
|
|
316
352
|
};
|
|
317
353
|
} else if (item.attrtype === 1 && item.children.length > 0 && Array.isArray(item.children)) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (Array.isArray(attrvalue) && (attrvalue == null ? void 0 : attrvalue.length)) {
|
|
321
|
-
item.children = attrvalue.map((v) => {
|
|
322
|
-
return handleObjDetailToSignleAttrList((children == null ? void 0 : children[0]) || [], v);
|
|
323
|
-
});
|
|
354
|
+
const { children = [] } = item || {};
|
|
355
|
+
if ((children == null ? void 0 : children.length) && Array.isArray(children == null ? void 0 : children[0])) {
|
|
324
356
|
result[key] = {
|
|
325
357
|
asid: ((_e = (_d = (_c = item.children) == null ? void 0 : _c[0]) == null ? void 0 : _d[0]) == null ? void 0 : _e.asid) || "",
|
|
326
358
|
data_list: item.children.map((child) => {
|
|
@@ -473,12 +505,6 @@ const handleSelectOptions = async ({
|
|
|
473
505
|
}
|
|
474
506
|
return options;
|
|
475
507
|
};
|
|
476
|
-
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
477
|
-
return attrList.map((item) => ({
|
|
478
|
-
...item,
|
|
479
|
-
attrvalue: detail[item.attrid] || ""
|
|
480
|
-
}));
|
|
481
|
-
};
|
|
482
508
|
exports.base64ToString = base64ToString;
|
|
483
509
|
exports.getJson = getJson;
|
|
484
510
|
exports.handleAttrList = handleAttrList;
|