zy-react-library 1.1.2 → 1.1.4
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/components/Cascader/Area/index.js +1 -20
- package/components/Cascader/Basic/index.js +1 -57
- package/components/Cascader/Dictionary/index.js +1 -42
- package/components/Cascader/Industry/index.js +1 -21
- package/components/Editor/index.js +1 -82
- package/components/FormBuilder/FormBuilder.js +1 -97
- package/components/FormBuilder/FormItemsRenderer.js +1 -589
- package/components/FormBuilder/index.js +1 -5
- package/components/HeaderBack/index.js +1 -44
- package/components/HiddenInfo/gwj/index.js +1 -586
- package/components/Icon/AddIcon/index.js +1 -9
- package/components/Icon/BackIcon/index.js +1 -9
- package/components/Icon/DeleteIcon/index.js +1 -9
- package/components/Icon/DownloadIcon/index.js +1 -9
- package/components/Icon/EditIcon/index.js +1 -9
- package/components/Icon/ExportIcon/index.js +1 -9
- package/components/Icon/ImportIcon/index.js +1 -9
- package/components/Icon/LocationIcon/index.js +1 -9
- package/components/Icon/PrintIcon/index.js +1 -9
- package/components/Icon/ResetIcon/index.js +1 -9
- package/components/Icon/SearchIcon/index.js +1 -9
- package/components/Icon/VideoIcon/index.js +1 -9
- package/components/Icon/ViewIcon/index.js +1 -9
- package/components/ImportFile/index.js +1 -94
- package/components/LeftTree/Area/index.js +1 -15
- package/components/LeftTree/Basic/index.js +1 -160
- package/components/LeftTree/Department/Gwj/index.js +1 -29
- package/components/LeftTree/Dictionary/index.js +1 -42
- package/components/Map/MapSelector.js +1 -280
- package/components/Map/index.js +1 -90
- package/components/Page/index.js +1 -59
- package/components/Pdf/index.js +1 -136
- package/components/PreviewImg/index.js +1 -26
- package/components/PreviewPdf/index.js +1 -78
- package/components/Search/index.js +1 -147
- package/components/Select/Basic/index.js +1 -70
- package/components/Select/Dictionary/index.js +1 -42
- package/components/Select/Personnel/Gwj/index.js +1 -45
- package/components/SelectCreate/index.js +1 -48
- package/components/SelectTree/Area/index.js +1 -20
- package/components/SelectTree/Basic/index.js +1 -105
- package/components/SelectTree/Department/Gwj/index.js +1 -40
- package/components/SelectTree/Dictionary/index.js +1 -42
- package/components/SelectTree/HiddenLevel/Gwj/index.js +1 -70
- package/components/SelectTree/HiddenPart/Gwj/index.js +1 -36
- package/components/SelectTree/Industry/index.js +1 -21
- package/components/Signature/index.js +1 -100
- package/components/Table/index.js +1 -77
- package/components/TooltipPreviewImg/index.js +1 -28
- package/components/Upload/index.js +1 -229
- package/components/Video/AliPlayer.js +1 -182
- package/components/Video/index.js +1 -71
- package/enum/dictionary/index.js +1 -9
- package/enum/formItemRender/index.js +1 -39
- package/enum/hidden/gwj/index.js +1 -70
- package/enum/uploadFile/gwj/index.js +1 -258
- package/hooks/useDeleteFile/index.js +1 -95
- package/hooks/useDictionary/index.js +1 -64
- package/hooks/useDownloadBlob/index.js +1 -80
- package/hooks/useDownloadFile/index.js +1 -78
- package/hooks/useGetFile/index.js +1 -74
- package/hooks/useGetUrlQuery/index.js +1 -15
- package/hooks/useGetUserInfo/index.js +1 -42
- package/hooks/useIdle/index.js +1 -65
- package/hooks/useImportFile/index.js +1 -61
- package/hooks/useIsExistenceDuplicateSelection/index.js +1 -27
- package/hooks/useTable/index.js +1 -124
- package/hooks/useUploadFile/index.js +1 -144
- package/hooks/useUrlQueryCriteria/index.js +1 -84
- package/package.json +5 -1
- package/regular/index.js +1 -56
- package/utils/index.js +1 -591
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import BasicCascader from '../Basic/index.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
function AreaCascader(props) {
|
|
6
|
-
const {
|
|
7
|
-
placeholder = "属地",
|
|
8
|
-
...restProps
|
|
9
|
-
} = props;
|
|
10
|
-
return /*#__PURE__*/jsx(BasicCascader, {
|
|
11
|
-
data: Area,
|
|
12
|
-
placeholder: placeholder,
|
|
13
|
-
nameKey: "label",
|
|
14
|
-
idKey: "value",
|
|
15
|
-
...restProps
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
AreaCascader.displayName = "AreaCascader";
|
|
19
|
-
|
|
20
|
-
export { AreaCascader as default };
|
|
1
|
+
import e from"../../../json/area.json";import a from"../Basic/index.js";import{jsx as r}from"react/jsx-runtime";function o(o){const{placeholder:t="属地",...i}=o;return r(a,{data:e,placeholder:t,nameKey:"label",idKey:"value",...i})}o.displayName="AreaCascader";export{o as default};
|
|
@@ -1,57 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { processTreeDataByLevel } from '../../../utils/index.js';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function BasicCascader(props) {
|
|
7
|
-
const {
|
|
8
|
-
onGetData,
|
|
9
|
-
onChange,
|
|
10
|
-
onGetNodePaths,
|
|
11
|
-
onGetNodePathsIsIncludeOneself = true,
|
|
12
|
-
placeholder = "",
|
|
13
|
-
data = [],
|
|
14
|
-
nameKey = "name",
|
|
15
|
-
idKey = "id",
|
|
16
|
-
childrenKey = "children",
|
|
17
|
-
level,
|
|
18
|
-
...restProps
|
|
19
|
-
} = props;
|
|
20
|
-
|
|
21
|
-
// 根据 level 处理树数据
|
|
22
|
-
const processedData = level ? processTreeDataByLevel({
|
|
23
|
-
data,
|
|
24
|
-
level,
|
|
25
|
-
childrenKey,
|
|
26
|
-
currentLevel: 1
|
|
27
|
-
}) : data;
|
|
28
|
-
const getNodePaths = selectedOptions => {
|
|
29
|
-
let nodePaths = selectedOptions;
|
|
30
|
-
if (!onGetNodePathsIsIncludeOneself && selectedOptions) {
|
|
31
|
-
nodePaths = selectedOptions.slice(0, -1);
|
|
32
|
-
}
|
|
33
|
-
return nodePaths || [];
|
|
34
|
-
};
|
|
35
|
-
const handleChange = (value, selectedOptions) => {
|
|
36
|
-
const parentNodes = getNodePaths(selectedOptions);
|
|
37
|
-
onGetNodePaths?.(parentNodes);
|
|
38
|
-
onChange?.(value, selectedOptions);
|
|
39
|
-
};
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
onGetData?.(data, processedData);
|
|
42
|
-
}, [data, processedData]);
|
|
43
|
-
return /*#__PURE__*/jsx(Cascader, {
|
|
44
|
-
options: processedData,
|
|
45
|
-
placeholder: `请选择${placeholder}`,
|
|
46
|
-
onChange: handleChange,
|
|
47
|
-
fieldNames: {
|
|
48
|
-
label: nameKey,
|
|
49
|
-
value: idKey,
|
|
50
|
-
children: childrenKey
|
|
51
|
-
},
|
|
52
|
-
...restProps
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
BasicCascader.displayName = "BasicCascader";
|
|
56
|
-
|
|
57
|
-
export { BasicCascader as default };
|
|
1
|
+
import{Cascader as e}from"antd";import{useEffect as a}from"react";import{processTreeDataByLevel as t}from"../../../utils/index.js";import{jsx as n}from"react/jsx-runtime";function r(r){const{onGetData:l,onChange:o,onGetNodePaths:d,onGetNodePathsIsIncludeOneself:i=!0,placeholder:c="",data:s=[],nameKey:m="name",idKey:h="id",childrenKey:p="children",level:u,...f}=r,y=u?t({data:s,level:u,childrenKey:p,currentLevel:1}):s;return a(()=>{l?.(s,y)},[s,y]),n(e,{options:y,placeholder:`请选择${c}`,onChange:(e,a)=>{const t=(e=>{let a=e;return!i&&e&&(a=e.slice(0,-1)),a||[]})(a);d?.(t),o?.(e,a)},fieldNames:{label:m,value:h,children:p},...f})}r.displayName="BasicCascader";export{r as default};
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { DICTIONARY_APP_KEY_ENUM } from '../../../enum/dictionary/index.js';
|
|
4
|
-
import BasicCascader from '../Basic/index.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function DictionaryCascader(props) {
|
|
8
|
-
const {
|
|
9
|
-
appKey = DICTIONARY_APP_KEY_ENUM.DEFAULT,
|
|
10
|
-
dictValue = "",
|
|
11
|
-
nameKey = "dictLabel",
|
|
12
|
-
idKey = "dictValue",
|
|
13
|
-
...restProps
|
|
14
|
-
} = props;
|
|
15
|
-
const [treeData, setTreeData] = useState([]);
|
|
16
|
-
const getData = async () => {
|
|
17
|
-
if (!Object.values(DICTIONARY_APP_KEY_ENUM).includes(appKey)) {
|
|
18
|
-
console.error("传入的 appKey 不在 DICTIONARY_APP_KEY_ENUM 中");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
setTreeData([]);
|
|
22
|
-
const {
|
|
23
|
-
data
|
|
24
|
-
} = await request("/config/dict-trees/list/by/dictValues", "get", {
|
|
25
|
-
appKey,
|
|
26
|
-
dictValue
|
|
27
|
-
});
|
|
28
|
-
setTreeData(data);
|
|
29
|
-
};
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
dictValue && getData();
|
|
32
|
-
}, [dictValue]);
|
|
33
|
-
return /*#__PURE__*/jsx(BasicCascader, {
|
|
34
|
-
data: treeData,
|
|
35
|
-
nameKey: nameKey,
|
|
36
|
-
idKey: idKey,
|
|
37
|
-
...restProps
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
DictionaryCascader.displayName = "DictionaryCascader";
|
|
41
|
-
|
|
42
|
-
export { DictionaryCascader as default };
|
|
1
|
+
import{request as e}from"@cqsjjb/jjb-common-lib/http";import{useState as t,useEffect as i}from"react";import{DICTIONARY_APP_KEY_ENUM as a}from"../../../enum/dictionary/index.js";import r from"../Basic/index.js";import{jsx as o}from"react/jsx-runtime";function c(c){const{appKey:n=a.DEFAULT,dictValue:d="",nameKey:m="dictLabel",idKey:s="dictValue",...p}=c,[l,u]=t([]);return i(()=>{d&&(async()=>{if(!Object.values(a).includes(n))return void console.error("传入的 appKey 不在 DICTIONARY_APP_KEY_ENUM 中");u([]);const{data:t}=await e("/config/dict-trees/list/by/dictValues","get",{appKey:n,dictValue:d});u(t)})()},[d]),o(r,{data:l,nameKey:m,idKey:s,...p})}c.displayName="DictionaryCascader";export{c as default};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import BasicCascader from '../Basic/index.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
function IndustryCascader(props) {
|
|
6
|
-
const {
|
|
7
|
-
placeholder = "行业类型",
|
|
8
|
-
...restProps
|
|
9
|
-
} = props;
|
|
10
|
-
return /*#__PURE__*/jsx(BasicCascader, {
|
|
11
|
-
data: Industry,
|
|
12
|
-
placeholder: placeholder,
|
|
13
|
-
nameKey: "dict_label",
|
|
14
|
-
idKey: "dict_value",
|
|
15
|
-
childrenKey: "childrenList",
|
|
16
|
-
...restProps
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
IndustryCascader.displayName = "IndustryCascader";
|
|
20
|
-
|
|
21
|
-
export { IndustryCascader as default };
|
|
1
|
+
import e from"../../../json/industry.json";import r from"../Basic/index.js";import{jsx as t}from"react/jsx-runtime";function a(a){const{placeholder:i="行业类型",...d}=a;return t(r,{data:e,placeholder:i,nameKey:"dict_label",idKey:"dict_value",childrenKey:"childrenList",...d})}a.displayName="IndustryCascader";export{a as default};
|
|
@@ -1,82 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
3
|
-
import { normalizeEmptyHtml } from '../../utils/index.js';
|
|
4
|
-
import '@wangeditor/editor/dist/css/style.css';
|
|
5
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
const Editor = /*#__PURE__*/forwardRef(({
|
|
8
|
-
value,
|
|
9
|
-
onChange,
|
|
10
|
-
disabled
|
|
11
|
-
}, ref) => {
|
|
12
|
-
const [editor, setEditor] = useState(null);
|
|
13
|
-
const [html, setHtml] = useState("");
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setHtml(value);
|
|
16
|
-
}, [value]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!editor) return;
|
|
19
|
-
if (disabled) editor.disable();else editor.enable();
|
|
20
|
-
}, [disabled]);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
return () => {
|
|
23
|
-
if (!editor) return;
|
|
24
|
-
editor.destroy();
|
|
25
|
-
setEditor(null);
|
|
26
|
-
};
|
|
27
|
-
}, [editor]);
|
|
28
|
-
useImperativeHandle(ref, () => ({
|
|
29
|
-
getEditorInstance: () => editor,
|
|
30
|
-
getHtml: () => editor && editor.getHtml(),
|
|
31
|
-
setHtml: value => {
|
|
32
|
-
editor && editor.setHtml(value);
|
|
33
|
-
},
|
|
34
|
-
getText: () => editor && editor.getText()
|
|
35
|
-
}));
|
|
36
|
-
const handleCreated = editor => {
|
|
37
|
-
setEditor(editor);
|
|
38
|
-
if (disabled) editor.disable();
|
|
39
|
-
};
|
|
40
|
-
const handleChange = editor => {
|
|
41
|
-
setHtml(editor.getHtml());
|
|
42
|
-
onChange?.(normalizeEmptyHtml(editor.getHtml()));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// 工具栏配置
|
|
46
|
-
const toolbarConfig = {
|
|
47
|
-
excludeKeys: ["group-image", "group-video", "insertLink", "emotion", "todo", "fullScreen", "insertTable", "codeBlock"]
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// 编辑器配置
|
|
51
|
-
const editorConfig = {
|
|
52
|
-
placeholder: "请输入内容..."
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/jsx(Fragment, {
|
|
55
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
56
|
-
style: {
|
|
57
|
-
border: "1px solid #ccc"
|
|
58
|
-
},
|
|
59
|
-
children: [/*#__PURE__*/jsx(Toolbar, {
|
|
60
|
-
editor: editor,
|
|
61
|
-
defaultConfig: toolbarConfig,
|
|
62
|
-
mode: "default",
|
|
63
|
-
style: {
|
|
64
|
-
borderBottom: "1px solid #ccc"
|
|
65
|
-
}
|
|
66
|
-
}), /*#__PURE__*/jsx(Editor$1, {
|
|
67
|
-
defaultConfig: editorConfig,
|
|
68
|
-
value: html,
|
|
69
|
-
onCreated: handleCreated,
|
|
70
|
-
onChange: handleChange,
|
|
71
|
-
mode: "default",
|
|
72
|
-
style: {
|
|
73
|
-
height: "500px",
|
|
74
|
-
overflowY: "hidden"
|
|
75
|
-
}
|
|
76
|
-
})]
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
Editor.displayName = "Editor";
|
|
81
|
-
|
|
82
|
-
export { Editor as default };
|
|
1
|
+
import{Toolbar as e,Editor as t}from"@wangeditor/editor-for-react";import{forwardRef as o,useState as r,useEffect as l,useImperativeHandle as d}from"react";import{normalizeEmptyHtml as i}from"../../utils/index.js";import"@wangeditor/editor/dist/css/style.css";import{jsx as s,Fragment as a,jsxs as n}from"react/jsx-runtime";const m=o(({value:o,onChange:m,disabled:c},g)=>{const[u,f]=r(null),[p,x]=r("");return l(()=>{x(o)},[o]),l(()=>{u&&(c?u.disable():u.enable())},[c]),l(()=>()=>{u&&(u.destroy(),f(null))},[u]),d(g,()=>({getEditorInstance:()=>u,getHtml:()=>u&&u.getHtml(),setHtml:e=>{u&&u.setHtml(e)},getText:()=>u&&u.getText()})),s(a,{children:n("div",{style:{border:"1px solid #ccc"},children:[s(e,{editor:u,defaultConfig:{excludeKeys:["group-image","group-video","insertLink","emotion","todo","fullScreen","insertTable","codeBlock"]},mode:"default",style:{borderBottom:"1px solid #ccc"}}),s(t,{defaultConfig:{placeholder:"请输入内容..."},value:p,onCreated:e=>{f(e),c&&e.disable()},onChange:e=>{x(e.getHtml()),m?.(i(e.getHtml()))},mode:"default",style:{height:"500px",overflowY:"hidden"}})]})})});m.displayName="Editor";export{m as default};
|
|
@@ -1,97 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import FormItemsRenderer from './FormItemsRenderer.js';
|
|
3
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
const FormBuilder = props => {
|
|
6
|
-
const {
|
|
7
|
-
values,
|
|
8
|
-
options,
|
|
9
|
-
gutter = 24,
|
|
10
|
-
span = 12,
|
|
11
|
-
labelCol = {
|
|
12
|
-
span: 4
|
|
13
|
-
},
|
|
14
|
-
useAutoGenerateRequired = true,
|
|
15
|
-
showActionButtons = true,
|
|
16
|
-
submitButtonText = "提交",
|
|
17
|
-
cancelButtonText = "取消",
|
|
18
|
-
showSubmitButton = true,
|
|
19
|
-
showCancelButton = true,
|
|
20
|
-
customActionButtons,
|
|
21
|
-
extraActionButtons,
|
|
22
|
-
loading = false,
|
|
23
|
-
...restProps
|
|
24
|
-
} = props;
|
|
25
|
-
const handleCancel = () => {
|
|
26
|
-
window.history.back();
|
|
27
|
-
};
|
|
28
|
-
return /*#__PURE__*/jsx(Spin, {
|
|
29
|
-
spinning: loading,
|
|
30
|
-
children: /*#__PURE__*/jsxs(Form, {
|
|
31
|
-
labelCol: labelCol,
|
|
32
|
-
scrollToFirstError: true,
|
|
33
|
-
wrapperCol: {
|
|
34
|
-
span: 24 - labelCol.span
|
|
35
|
-
},
|
|
36
|
-
initialValues: values,
|
|
37
|
-
onFinishFailed: () => {
|
|
38
|
-
message.error("请补全必填项");
|
|
39
|
-
},
|
|
40
|
-
style: {
|
|
41
|
-
width: `calc(100% - ${gutter * 2}px)`,
|
|
42
|
-
margin: `0 auto`
|
|
43
|
-
},
|
|
44
|
-
...restProps,
|
|
45
|
-
children: [/*#__PURE__*/jsx(Row, {
|
|
46
|
-
gutter: gutter,
|
|
47
|
-
children: /*#__PURE__*/jsx(FormItemsRenderer, {
|
|
48
|
-
options: options,
|
|
49
|
-
labelCol: labelCol,
|
|
50
|
-
span: span,
|
|
51
|
-
gutter: gutter,
|
|
52
|
-
useAutoGenerateRequired: useAutoGenerateRequired,
|
|
53
|
-
initialValues: values
|
|
54
|
-
})
|
|
55
|
-
}), showActionButtons && /*#__PURE__*/jsxs("div", {
|
|
56
|
-
style: {
|
|
57
|
-
transform: 'scale(1)',
|
|
58
|
-
margin: '0px -44px'
|
|
59
|
-
},
|
|
60
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
61
|
-
style: {
|
|
62
|
-
height: "52px"
|
|
63
|
-
}
|
|
64
|
-
}), /*#__PURE__*/jsx(Row, {
|
|
65
|
-
gutter: gutter,
|
|
66
|
-
style: {
|
|
67
|
-
textAlign: "center",
|
|
68
|
-
backgroundColor: "rgb(241, 241, 242)",
|
|
69
|
-
padding: "10px 0",
|
|
70
|
-
position: "fixed",
|
|
71
|
-
bottom: "0",
|
|
72
|
-
width: "100%"
|
|
73
|
-
},
|
|
74
|
-
children: /*#__PURE__*/jsx(Col, {
|
|
75
|
-
span: 24,
|
|
76
|
-
style: {
|
|
77
|
-
textAlign: "center"
|
|
78
|
-
},
|
|
79
|
-
children: customActionButtons || /*#__PURE__*/jsxs(Space, {
|
|
80
|
-
children: [showSubmitButton && /*#__PURE__*/jsx(Button, {
|
|
81
|
-
type: "primary",
|
|
82
|
-
htmlType: "submit",
|
|
83
|
-
children: submitButtonText
|
|
84
|
-
}), extraActionButtons, showCancelButton && /*#__PURE__*/jsx(Button, {
|
|
85
|
-
onClick: handleCancel,
|
|
86
|
-
children: cancelButtonText
|
|
87
|
-
})]
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
})]
|
|
91
|
-
})]
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
FormBuilder.displayName = "FormBuilder";
|
|
96
|
-
|
|
97
|
-
export { FormBuilder as default };
|
|
1
|
+
import{Spin as e,Form as t,Row as n,Col as i,Space as r,Button as o,message as s}from"antd";import{useState as l,useEffect as a}from"react";import d from"./FormItemsRenderer.js";import{jsx as u,jsxs as c,Fragment as p}from"react/jsx-runtime";const m=m=>{const{values:h,options:g,gutter:w=24,span:x=12,labelCol:b={span:4},useAutoGenerateRequired:y=!0,showActionButtons:f=!0,submitButtonText:B="提交",cancelButtonText:A="取消",showSubmitButton:C=!0,showCancelButton:T=!0,customActionButtons:v,extraActionButtons:F,loading:k=!1,...q}=m,[E,R]=l(window.innerWidth),j=()=>{const e=document.querySelector("#page");e&&R(e.offsetWidth)};return a(()=>{const e=setTimeout(()=>{j()},0);return f&&window.addEventListener("resize",j),()=>{f&&window.removeEventListener("resize",j),clearTimeout(e)}},[f]),u(e,{spinning:k,children:c(t,{labelCol:b,scrollToFirstError:!0,wrapperCol:{span:24-b.span},initialValues:h,onFinishFailed:()=>{s.error("请补全必填项")},style:{width:`calc(100% - ${2*w}px)`,margin:"0 auto"},...q,children:[u(n,{gutter:w,children:u(d,{options:g,labelCol:b,span:x,gutter:w,useAutoGenerateRequired:y,initialValues:h})}),f&&c(p,{children:[u("div",{style:{height:"32px"}}),u(n,{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:E,margin:"0 -44px"},children:u(i,{span:24,style:{textAlign:"center"},children:v||c(r,{children:[C&&u(o,{type:"primary",htmlType:"submit",children:B}),F,T&&u(o,{onClick:()=>{window.history.back()},children:A})]})})})]})]})})};m.displayName="FormBuilder";export{m as default};
|