szld-libs 0.0.27 → 0.0.28
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/szld-components.es.js +2 -2
- package/dist/szld-components.umd.js +1 -1
- package/es/components/CreateForm/index.d.ts +3 -2
- package/es/components/CreateForm/index.js +2 -2
- package/lib/components/CreateForm/index.d.ts +3 -2
- package/lib/components/CreateForm/index.js +2 -2
- package/package.json +1 -1
|
@@ -20862,12 +20862,12 @@ const pN = /* @__PURE__ */ V_(OR.exports), iR = [Cf.jpeg, Cf.jpg, Cf.png], vN =
|
|
|
20862
20862
|
{
|
|
20863
20863
|
type: I.btnType === "submit" ? "primary" : "default",
|
|
20864
20864
|
...Bp.omit(I, ["btnType"]),
|
|
20865
|
-
key: I.btnType,
|
|
20865
|
+
key: I.key || I.btnType,
|
|
20866
20866
|
onClick: (me) => {
|
|
20867
20867
|
H == null || H(me, I);
|
|
20868
20868
|
}
|
|
20869
20869
|
},
|
|
20870
|
-
I.title
|
|
20870
|
+
I.title || I.children
|
|
20871
20871
|
)) });
|
|
20872
20872
|
break;
|
|
20873
20873
|
}
|
|
@@ -188,4 +188,4 @@ Check the render method of %s.`,He(tn)||"Unknown"));var m=lu(s,f);m.payload={ele
|
|
|
188
188
|
|
|
189
189
|
let root = createRoot(domContainer);
|
|
190
190
|
root.render(<App />);`),t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(u=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError),t.transitionCallbacks!==void 0&&t.transitionCallbacks);var f=tw(e,Yh,null,a,i,u,s);Hh(f.current,e);var p=e.nodeType===nn?e.parentNode:e;return Kd(p),new qS(f)}function Xm(e){this._internalRoot=e}function YO(e){e&&dh(e)}Xm.prototype.unstable_scheduleHydration=YO;function QO(e,t,a){if(!Km(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");ww(e),t===void 0&&C("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var i=a??null,u=a!=null&&a.hydratedSources||null,s=!1,f=!1,p="",m=Tw;a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onRecoverableError!==void 0&&(m=a.onRecoverableError));var S=nw(t,null,e,Yh,i,s,f,p,m);if(Hh(S.current,e),Kd(e),u)for(var E=0;E<u.length;E++){var D=u[E];eD(S,D)}return new Xm(S)}function Km(e){return!!(e&&(e.nodeType===Er||e.nodeType===Ma||e.nodeType===kl||!ft))}function $p(e){return!!(e&&(e.nodeType===Er||e.nodeType===Ma||e.nodeType===kl||e.nodeType===nn&&e.nodeValue===" react-mount-point-unstable "))}function ww(e){e.nodeType===Er&&e.tagName&&e.tagName.toUpperCase()==="BODY"&&C("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),op(e)&&(e._reactRootContainer?C("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):C("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}var WO=v.ReactCurrentOwner,Rw;Rw=function(e){if(e._reactRootContainer&&e.nodeType!==nn){var t=aw(e._reactRootContainer.current);t&&t.parentNode!==e&&C("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var a=!!e._reactRootContainer,i=XS(e),u=!!(i&&eo(i));u&&!a&&C("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),e.nodeType===Er&&e.tagName&&e.tagName.toUpperCase()==="BODY"&&C("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function XS(e){return e?e.nodeType===Ma?e.documentElement:e.firstChild:null}function bw(){}function GO(e,t,a,i,u){if(u){if(typeof i=="function"){var s=i;i=function(){var x=qm(f);s.call(x)}}var f=nw(t,i,e,no,null,!1,!1,"",bw);e._reactRootContainer=f,Hh(f.current,e);var p=e.nodeType===nn?e.parentNode:e;return Kd(p),cu(),f}else{for(var m;m=e.lastChild;)e.removeChild(m);if(typeof i=="function"){var S=i;i=function(){var x=qm(E);S.call(x)}}var E=tw(e,no,null,!1,!1,"",bw);e._reactRootContainer=E,Hh(E.current,e);var D=e.nodeType===nn?e.parentNode:e;return Kd(D),cu(function(){Ip(t,E,a,i)}),E}}function qO(e,t){e!==null&&typeof e!="function"&&C("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e)}function Zm(e,t,a,i,u){Rw(a),qO(u===void 0?null:u,"render");var s=a._reactRootContainer,f;if(!s)f=GO(a,t,e,u,i);else{if(f=s,typeof u=="function"){var p=u;u=function(){var m=qm(f);p.call(m)}}Ip(t,f,e,u)}return qm(f)}function XO(e){{var t=WO.current;if(t!==null&&t.stateNode!==null){var a=t.stateNode._warnedAboutRefsInRender;a||C("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Rt(t.type)||"A component"),t.stateNode._warnedAboutRefsInRender=!0}}return e==null?null:e.nodeType===Er?e:zO(e,"findDOMNode")}function KO(e,t,a){if(C("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!$p(t))throw new Error("Target container is not a DOM element.");{var i=op(t)&&t._reactRootContainer===void 0;i&&C("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return Zm(null,e,t,!0,a)}function ZO(e,t,a){if(C("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!$p(t))throw new Error("Target container is not a DOM element.");{var i=op(t)&&t._reactRootContainer===void 0;i&&C("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return Zm(null,e,t,!1,a)}function JO(e,t,a,i){if(C("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!$p(a))throw new Error("Target container is not a DOM element.");if(e==null||!Vo(e))throw new Error("parentComponent must be a valid React Component");return Zm(e,t,a,!1,i)}function eN(e){if(!$p(e))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var t=op(e)&&e._reactRootContainer===void 0;t&&C("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(e._reactRootContainer){{var a=XS(e),i=a&&!eo(a);i&&C("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return cu(function(){Zm(null,null,e,!1,function(){e._reactRootContainer=null,EC(e)})}),!0}else{{var u=XS(e),s=!!(u&&eo(u)),f=e.nodeType===Er&&$p(e.parentNode)&&!!e.parentNode._reactRootContainer;s&&C("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",f?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}fe(UO),lh(AO),ts(FO),Ld(va),oh(Zo),(typeof Map!="function"||Map.prototype==null||typeof Map.prototype.forEach!="function"||typeof Set!="function"||Set.prototype==null||typeof Set.prototype.clear!="function"||typeof Set.prototype.forEach!="function")&&C("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Vv(rx),Xs(kS,Q_,cu);function tN(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Km(t))throw new Error("Target container is not a DOM element.");return LO(e,t,null,a)}function nN(e,t,a,i){return JO(e,t,a,i)}var KS={usingClientEntryPoint:!1,Events:[eo,Zc,jh,qs,Fo,kS]};function rN(e,t){return KS.usingClientEntryPoint||C('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),$O(e,t)}function aN(e,t,a){return KS.usingClientEntryPoint||C('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),QO(e,t,a)}function iN(e){return zT()&&C("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),cu(e)}var lN=IO({findFiberByHostInstance:fs,bundleType:1,version:$S,rendererPackageName:"react-dom"});if(!lN&&yn&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var xw=window.location.protocol;/^(https?|file):$/.test(xw)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(xw==="file:"?`
|
|
191
|
-
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}Jr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KS,Jr.createPortal=tN,Jr.createRoot=rN,Jr.findDOMNode=XO,Jr.flushSync=iN,Jr.hydrate=KO,Jr.hydrateRoot=aN,Jr.render=ZO,Jr.unmountComponentAtNode=eN,Jr.unstable_batchedUpdates=kS,Jr.unstable_renderSubtreeIntoContainer=nN,Jr.version=$S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jr}(function(h){function g(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(v){console.error(v)}}}process.env.NODE_ENV==="production"?(g(),h.exports=tb()):h.exports=nb()})(M1);const rb=Ow(M1.exports),j1=[Ds.jpeg,Ds.jpg,Ds.png],V1=h=>{const{maxCount:g=1,listType:v="picture-card",fileList:R=[],maxSize:L=2,accept:H=j1.join(","),uploadBtnName:C="上传",uploadHint:K=null}=h,[M,I]=at.useState(!1),[me,X]=at.useState(""),ie=()=>v!=="text"?Dn("div",{children:[Se(MR,{}),Se("div",{style:{marginTop:8},children:C})]}):Dn(Jm,{children:[Se($e.Button,{icon:Se(HR,{}),children:C}),K]}),re=we=>{const Tt=H.split(","),Je=Zp(we.name)||"";return Tt.includes(Je)?we.size/1024/1024<L?!0:($e.message.error(`文件必须小于${L}MB`),$e.Upload.LIST_IGNORE):($e.message.error(`只允许上传 ${H} 文件`),$e.Upload.LIST_IGNORE)},ze=we=>{h.onChange&&h.onChange(we)},Ze=async we=>{let Tt=Zp(we.name)||"";if(Tt||(Tt=Zp(we.name||we.url)||""),Tt===Ds.pdf)return $e.Modal.info({title:"PDF",width:"60%",content:Se("iframe",{title:"PDF预览",src:we.url||we.response.url,frameBorder:"0",style:{width:"100%",height:"70vh"}}),okText:"关闭"});j1.includes(Tt)&&(!we.url&&!we.thumbUrl&&!we.preview&&(we.preview=await N1(we.originFileObj)),X(we.url||we.thumbUrl||we.preview),I(!0))};return Dn(Jm,{children:[Se($e.Upload,{...h,onPreview:Ze,beforeUpload:re,onChange:ze,listType:v,children:R.length>=g?null:ie()}),Se(ab,{visible:M,src:me,onVisibleChange:()=>{I(!1),X("")}})]})},ab=h=>{const{visible:g,src:v,onVisibleChange:R}=h;return rb.createPortal(Se($e.Image,{style:{display:"none"},src:v,preview:{visible:g,src:v,onVisibleChange:R}}),document.body)},Jp={fieldModal:"create-form-module_fieldModal_8bf3d",content:"create-form-module_content_61f84",suffix:"create-form-module_suffix_42205",placeholder:"create-form-module_placeholder_90d6a"},ib={labelCol:{span:4},wrapperCol:{span:20}},B1=h=>{switch(h){case"upload":return"fileList";case"switch":return"checked";default:return"value"}},P1=h=>{const{items:g,rowProps:v,formProps:R,readonly:L=!1,hiddenTitle:H=!1}=h,C=(M,I)=>{var me,X;if(I.btnType==="submit"){(me=R==null?void 0:R.form)==null||me.validateFields().then(ie=>{I.onClick&&I.onClick(ie)});return}if(I.btnType==="reset"){(X=R==null?void 0:R.form)==null||X.resetFields(),I.onClick&&I.onClick(M);return}I.btnType==="cancel"&&I.onClick&&I.onClick(M)},K=M=>Array.isArray(M)?M:M&&M.fileList;return Se($e.Form,{layout:"horizontal",form:R==null?void 0:R.form,...ib,...R||{},children:Se($e.Row,{gutter:16,...v,children:g.filter(M=>!M.hidden).map((M,I)=>{var me,X;return Se($e.Col,{...M.colProps||{span:24},children:Se($e.Form.Item,{...M.valueType==="upload"?{getValueFromEvent:K}:{},label:H?"":M.title,name:M.valueType==="btns"?void 0:M.dataIndex,...M.formItemProps,children:M.readonly?Se("div",{children:M.value||M.dataIndex&&((me=R==null?void 0:R.initialValues)==null?void 0:me[M.dataIndex])}):M.readonly===void 0&&L?Se("div",{children:M.value||M.dataIndex&&((X=R==null?void 0:R.initialValues)==null?void 0:X[M.dataIndex])}):Se(I1,{onChange:ie=>{var re;return(re=M==null?void 0:M.onChange)==null?void 0:re.call(M,ie)},valueType:M.valueType,onBtnClick:C,valueProps:M.valueProps})})},M.dataIndex||I)})})})},I1=h=>{const{valueType:g,valueProps:v,value:R,onChange:L,onBtnClick:H,inputRef:C}=h,K=at.useMemo(()=>{let M=Se($e.Input,{placeholder:"请输入",...v,allowClear:!0});switch(g){case"rate":M=Se($e.Rate,{...v});break;case"password":M=Se($e.Input.Password,{...v});break;case"modal":M=Se(lb,{...v});break;case"checkbox":M=Se($e.Checkbox.Group,{...v});break;case"select":M=Se($e.Select,{placeholder:"请选择",...v,allowClear:!0});break;case"inputNumber":M=Se($e.InputNumber,{style:{width:"100%"},placeholder:"请输入",...v});break;case"textarea":M=Se($e.Input.TextArea,{placeholder:"请输入",...v,allowClear:!0});break;case"radio":M=Se($e.Radio.Group,{...v});break;case"switch":M=Se($e.Switch,{...v});break;case"datePicker":M=Se($e.DatePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"rangePicker":M=Se($e.DatePicker.RangePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"timePicker":M=Se($e.TimePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"cascader":M=Se($e.Cascader,{...v,allowClear:!0});break;case"upload":M=Se(V1,{...v});break;case"btns":M=Se($e.Space,{children:v==null?void 0:v.map(I=>at.createElement($e.Button,{type:I.btnType==="submit"?"primary":"default",...Rf.omit(I,["btnType"]),key:I.btnType,onClick:me=>{H==null||H(me,I)}},I.title))});break}return M},[g,v,L,R]);if(g==="custom"){const M=v;return at.cloneElement(M.children,{[B1(g||"input")]:R,onChange:L,ref:C})}return at.cloneElement(K,{[B1(g||"input")]:R,onChange:L,ref:C})},lb=h=>{const{placeholder:g,labelKey:v,onToggle:R,value:L,onClear:H}=h;return Dn("div",{className:Jp.fieldModal,children:[Se("div",{className:Jp.content,onClick:()=>R(!0),children:L?Se("span",{children:L[v]}):Se("span",{className:Jp.placeholder,children:g})}),Se("span",{className:Jp.suffix,onClick:H,children:L&&Se(xR,{})})]})},ub={search:"search-table-module_search_17add"};function ob(h){const{tableProps:g={},searchProps:v}=h,{columns:R=[],...L}=g;return Dn(Jm,{children:[v&&Se(P1,{hiddenTitle:!0,...v,items:v.items}),Se($e.Table,{columns:R.filter(H=>!H.hidden),...L,className:kf(ub.table,g==null?void 0:g.className),pagination:typeof(g==null?void 0:g.pagination)=="boolean"?g.pagination:{hideOnSinglePage:!0,showPrevNextJumpers:!0,showQuickJumper:!0,showSizeChanger:!0,showTotal:H=>`共 ${H} 条`,...g==null?void 0:g.pagination}})]})}const sb={editableCellValueWrap:"editable-module_editableCellValueWrap_3b3d9"},$1=at.createContext(null),cb=({index:h,...g})=>{const[v]=$e.Form.useForm();return Se($e.Form,{form:v,component:!1,children:Se($1.Provider,{value:v,children:Se("tr",{...g})})})};function fb(h){const{title:g,editable:v,children:R,dataIndex:L,record:H,rules:C,onChange:K,type:M="input",valueProps:I,...me}=h,X=at.useRef(null),ie=at.useContext($1),re=async()=>{try{const we=await ie.validateFields();K({...H,...we})}catch(we){console.log("Save failed:",we)}},ze=()=>Se(I1,{valueType:M,valueProps:{...I,onBlur:re,onPressEnter:re},inputRef:X});let Ze=R;return v&&(Ze=Se($e.Form.Item,{style:{margin:0},initialValue:H[L],name:L,rules:C,children:ze()})),Se("td",{children:Ze})}function db(h){const{columns:g,onChange:v,...R}=h,L={body:{row:cb,cell:fb}},H=g==null?void 0:g.map(C=>C.editable?{...C,onCell:K=>({...C,record:K,onChange:v})}:C);return Se($e.Table,{...R,components:L,rowClassName:()=>sb.editableRow,columns:H})}const Y1=h=>{const{auth:g=!0,...v}=h;return g?Se($e.Button,{...v}):null},pb=h=>{const{PId:g,auths:v,...R}=h,L=at.useMemo(()=>!!(v&&v.find(H=>H.PId===g)),[g,v]);return Se(Y1,{...R,auth:L})},_n={main:"workflownode-module_main_dce7f",item:"workflownode-module_item_73d7c",tail:"workflownode-module_tail_3cb51",node:"workflownode-module_node_005fd",content:"workflownode-module_content_8334f",collpase:"workflownode-module_collpase_f2468",btn:"workflownode-module_btn_b0c06",title:"workflownode-module_title_cb34c",dateWrapper:"workflownode-module_dateWrapper_94849",remark:"workflownode-module_remark_4f910",itemActive:"workflownode-module_itemActive_2a29d",itemDone:"workflownode-module_itemDone_489bc",itemUnDo:"workflownode-module_itemUnDo_2914c"},vb=h=>{const{data:g,current:v}=h,[R,L]=at.useState(!1),H=at.useMemo(()=>!v||g.length===0?0:g.findIndex(I=>I.PNId===v),[v,g]),C=at.useMemo(()=>H>1?R?0:H-1:0,[H,R]),K=()=>{L(!0)};return Dn("ul",{className:_n.main,children:[H>1&&!R&&Dn("li",{className:kf(_n.item,_n.itemDone),children:[Se("div",{className:_n.tail}),Se("div",{className:_n.node}),Se("div",{className:_n.content,children:Dn("div",{className:_n.collpase,children:[Dn("div",{children:["已收起",Se("span",{children:H-1}),"个节点"]}),Dn("a",{className:_n.btn,onClick:K,children:["展开节点",Se(_R,{})]})]})})]}),g.slice(C).map((M,I)=>Dn("li",{className:kf(_n.item,H===I+C?_n.itemActive:H>I+C?_n.itemDone:_n.itemUnDo),children:[Se("div",{className:_n.tail}),Se("div",{className:_n.node}),Dn("div",{className:_n.content,children:[Se("div",{className:_n.title,children:M.PNName}),Dn("div",{className:_n.dateWrapper,children:[M.PlanFinishDate&&Dn("span",{children:["预计完成时间: ",M.PlanFinishDate]}),M.UpdateTime&&Dn("span",{style:{color:"#333",fontWeight:"bold"},children:["实际完成时间: ",M.UpdateTime]}),R&&H-1===I&&Dn("a",{className:_n.btn,onClick:()=>L(!1),children:["收起节点 ",Se(UR,{})]})]}),M.Remark&&Se("div",{className:_n.remark,children:M.Remark})]})]},M.PNId))]})},hb=h=>{const{current:g,data:v,...R}=h;return(()=>{$e.Modal.info({icon:null,title:"流程节点",width:700,content:Se(vb,{current:g,data:v}),closable:!0,footer:null,maskClosable:!0,...R})})(),null},mb=(h,g)=>{const v=new URL(h),R=new URL(g);return v.protocol===R.protocol&&v.host===R.host&&v.port===R.port},yb=h=>{const g=new URL(h).href.split("/");return g[g.length-1]},gb=h=>{var v;return(v=h.headers.get("content-disposition"))==null?void 0:v.split(";")[1].split("=")[1]},Sb=(h,g)=>{const v=g||yb(h);if(mb(h,window.location.href)){Cy(h,v);return}let R=g;fetch(h,{method:"get"}).then(L=>(R||(R=gb(L)),L.blob())).then(L=>{Q1(L,R||v)}).catch(()=>{Cy(h,"")})},Q1=(h,g)=>{let v=window.URL.createObjectURL(h);const R=window.navigator;if(R.msSaveOrOpenBlob){R.msSaveOrOpenBlob(h,g);return}Cy(v,g),window.URL.revokeObjectURL(v)},Cy=(h,g)=>{let v=document.createElement("a");v.style.display="none",v.href=h,v.target="_blank",v.download=g,document.body.appendChild(v),v.click(),document.body.removeChild(v)},Cb=Object.freeze(Object.defineProperty({__proto__:null,downloadUrl:Sb,downloadBlob:Q1},Symbol.toStringTag,{value:"Module"}));class Eb{constructor(g){kw(this,"options",{id:"",canvasId:"verifyCanvas",width:100,height:30,type:"blend",code:""});this.options=g}GVerify(){this.options.numArr="0,1,2,3,4,5,6,7,8,9".split(","),this.options.letterArr=this.getAllLetter(),this._init(),this.refresh()}_init(){const g=document.getElementById(this.options.id),v=document.createElement("canvas");v.id=this.options.canvasId,v.width=Number(this.options.width),v.height=Number(this.options.height),v.style.cursor="pointer",v.innerHTML="您的浏览器版本不支持canvas",g&&g.appendChild(v),v.onclick=()=>{this.refresh()}}refresh(){this.options.code="";const g=document.getElementById(this.options.canvasId);let v,R=[];if(g.getContext)v=g.getContext("2d");else return;v.textBaseline="middle",v.fillStyle=this.randomColor(180,240),v.fillRect(0,0,this.options.width,this.options.height),this.options.type=="blend"?R=this.options.numArr.concat(this.options.letterArr):this.options.type=="number"?R=this.options.numArr:R=this.options.letterArr;for(let L=1;L<=4;L++){const H=R[this.randomNum(0,R.length)];this.options.code+=H,v.font="20px SimHei",v.fillStyle=this.randomColor(50,160),v.shadowBlur=this.randomNum(-3,3),v.shadowColor="rgba(0, 0, 0, 0.3)";const C=Number(this.options.width)/5*L,K=Number(this.options.height)/2,M=this.randomNum(-30,30);v.translate(C,K),v.rotate(M*Math.PI/180),v.fillText(H,0,0),v.rotate(-M*Math.PI/180),v.translate(-C,-K)}for(let L=0;L<2;L++)v.strokeStyle=this.randomColor(40,180),v.beginPath(),v.moveTo(this.randomNum(0,Number(this.options.width)/2),this.randomNum(0,Number(this.options.height)/2)),v.lineTo(this.randomNum(0,Number(this.options.width)/2),this.randomNum(0,Number(this.options.height))),v.stroke();for(let L=0;L<Number(this.options.width)/10;L++)v.fillStyle=this.randomColor(0,255),v.beginPath(),v.arc(this.randomNum(0,this.options.width),this.randomNum(0,this.options.height),1,0,2*Math.PI),v.fill()}validate(g){const v=g.toLowerCase(),R=this.options.code.toLowerCase();return v==R}getAllLetter(){return"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z".split(",")}randomNum(g,v){return Math.floor(Math.random()*(v-g)+g)}randomColor(g,v){const R=this.randomNum(g,v),L=this.randomNum(g,v),H=this.randomNum(g,v);return"rgb("+R+","+L+","+H+")"}}const Tb=Object.freeze(Object.defineProperty({__proto__:null,getGVerify:Eb},Symbol.toStringTag,{value:"Module"}));_t.AuthButton=Y1,_t.BackHeader=BR,_t.CoralButton=pb,_t.CreateForm=P1,_t.EditTable=db,_t.SearchTable=ob,_t.UploadFile=V1,_t.download=Cb,_t.fileType=PR,_t.showWorkFlow=hb,_t.utils=ZR,_t.verfyCode=Tb,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
|
|
191
|
+
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}Jr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KS,Jr.createPortal=tN,Jr.createRoot=rN,Jr.findDOMNode=XO,Jr.flushSync=iN,Jr.hydrate=KO,Jr.hydrateRoot=aN,Jr.render=ZO,Jr.unmountComponentAtNode=eN,Jr.unstable_batchedUpdates=kS,Jr.unstable_renderSubtreeIntoContainer=nN,Jr.version=$S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jr}(function(h){function g(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g)}catch(v){console.error(v)}}}process.env.NODE_ENV==="production"?(g(),h.exports=tb()):h.exports=nb()})(M1);const rb=Ow(M1.exports),j1=[Ds.jpeg,Ds.jpg,Ds.png],V1=h=>{const{maxCount:g=1,listType:v="picture-card",fileList:R=[],maxSize:L=2,accept:H=j1.join(","),uploadBtnName:C="上传",uploadHint:K=null}=h,[M,I]=at.useState(!1),[me,X]=at.useState(""),ie=()=>v!=="text"?Dn("div",{children:[Se(MR,{}),Se("div",{style:{marginTop:8},children:C})]}):Dn(Jm,{children:[Se($e.Button,{icon:Se(HR,{}),children:C}),K]}),re=we=>{const Tt=H.split(","),Je=Zp(we.name)||"";return Tt.includes(Je)?we.size/1024/1024<L?!0:($e.message.error(`文件必须小于${L}MB`),$e.Upload.LIST_IGNORE):($e.message.error(`只允许上传 ${H} 文件`),$e.Upload.LIST_IGNORE)},ze=we=>{h.onChange&&h.onChange(we)},Ze=async we=>{let Tt=Zp(we.name)||"";if(Tt||(Tt=Zp(we.name||we.url)||""),Tt===Ds.pdf)return $e.Modal.info({title:"PDF",width:"60%",content:Se("iframe",{title:"PDF预览",src:we.url||we.response.url,frameBorder:"0",style:{width:"100%",height:"70vh"}}),okText:"关闭"});j1.includes(Tt)&&(!we.url&&!we.thumbUrl&&!we.preview&&(we.preview=await N1(we.originFileObj)),X(we.url||we.thumbUrl||we.preview),I(!0))};return Dn(Jm,{children:[Se($e.Upload,{...h,onPreview:Ze,beforeUpload:re,onChange:ze,listType:v,children:R.length>=g?null:ie()}),Se(ab,{visible:M,src:me,onVisibleChange:()=>{I(!1),X("")}})]})},ab=h=>{const{visible:g,src:v,onVisibleChange:R}=h;return rb.createPortal(Se($e.Image,{style:{display:"none"},src:v,preview:{visible:g,src:v,onVisibleChange:R}}),document.body)},Jp={fieldModal:"create-form-module_fieldModal_8bf3d",content:"create-form-module_content_61f84",suffix:"create-form-module_suffix_42205",placeholder:"create-form-module_placeholder_90d6a"},ib={labelCol:{span:4},wrapperCol:{span:20}},B1=h=>{switch(h){case"upload":return"fileList";case"switch":return"checked";default:return"value"}},P1=h=>{const{items:g,rowProps:v,formProps:R,readonly:L=!1,hiddenTitle:H=!1}=h,C=(M,I)=>{var me,X;if(I.btnType==="submit"){(me=R==null?void 0:R.form)==null||me.validateFields().then(ie=>{I.onClick&&I.onClick(ie)});return}if(I.btnType==="reset"){(X=R==null?void 0:R.form)==null||X.resetFields(),I.onClick&&I.onClick(M);return}I.btnType==="cancel"&&I.onClick&&I.onClick(M)},K=M=>Array.isArray(M)?M:M&&M.fileList;return Se($e.Form,{layout:"horizontal",form:R==null?void 0:R.form,...ib,...R||{},children:Se($e.Row,{gutter:16,...v,children:g.filter(M=>!M.hidden).map((M,I)=>{var me,X;return Se($e.Col,{...M.colProps||{span:24},children:Se($e.Form.Item,{...M.valueType==="upload"?{getValueFromEvent:K}:{},label:H?"":M.title,name:M.valueType==="btns"?void 0:M.dataIndex,...M.formItemProps,children:M.readonly?Se("div",{children:M.value||M.dataIndex&&((me=R==null?void 0:R.initialValues)==null?void 0:me[M.dataIndex])}):M.readonly===void 0&&L?Se("div",{children:M.value||M.dataIndex&&((X=R==null?void 0:R.initialValues)==null?void 0:X[M.dataIndex])}):Se(I1,{onChange:ie=>{var re;return(re=M==null?void 0:M.onChange)==null?void 0:re.call(M,ie)},valueType:M.valueType,onBtnClick:C,valueProps:M.valueProps})})},M.dataIndex||I)})})})},I1=h=>{const{valueType:g,valueProps:v,value:R,onChange:L,onBtnClick:H,inputRef:C}=h,K=at.useMemo(()=>{let M=Se($e.Input,{placeholder:"请输入",...v,allowClear:!0});switch(g){case"rate":M=Se($e.Rate,{...v});break;case"password":M=Se($e.Input.Password,{...v});break;case"modal":M=Se(lb,{...v});break;case"checkbox":M=Se($e.Checkbox.Group,{...v});break;case"select":M=Se($e.Select,{placeholder:"请选择",...v,allowClear:!0});break;case"inputNumber":M=Se($e.InputNumber,{style:{width:"100%"},placeholder:"请输入",...v});break;case"textarea":M=Se($e.Input.TextArea,{placeholder:"请输入",...v,allowClear:!0});break;case"radio":M=Se($e.Radio.Group,{...v});break;case"switch":M=Se($e.Switch,{...v});break;case"datePicker":M=Se($e.DatePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"rangePicker":M=Se($e.DatePicker.RangePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"timePicker":M=Se($e.TimePicker,{style:{width:"100%"},...v,allowClear:!0});break;case"cascader":M=Se($e.Cascader,{...v,allowClear:!0});break;case"upload":M=Se(V1,{...v});break;case"btns":M=Se($e.Space,{children:v==null?void 0:v.map(I=>at.createElement($e.Button,{type:I.btnType==="submit"?"primary":"default",...Rf.omit(I,["btnType"]),key:I.key||I.btnType,onClick:me=>{H==null||H(me,I)}},I.title||I.children))});break}return M},[g,v,L,R]);if(g==="custom"){const M=v;return at.cloneElement(M.children,{[B1(g||"input")]:R,onChange:L,ref:C})}return at.cloneElement(K,{[B1(g||"input")]:R,onChange:L,ref:C})},lb=h=>{const{placeholder:g,labelKey:v,onToggle:R,value:L,onClear:H}=h;return Dn("div",{className:Jp.fieldModal,children:[Se("div",{className:Jp.content,onClick:()=>R(!0),children:L?Se("span",{children:L[v]}):Se("span",{className:Jp.placeholder,children:g})}),Se("span",{className:Jp.suffix,onClick:H,children:L&&Se(xR,{})})]})},ub={search:"search-table-module_search_17add"};function ob(h){const{tableProps:g={},searchProps:v}=h,{columns:R=[],...L}=g;return Dn(Jm,{children:[v&&Se(P1,{hiddenTitle:!0,...v,items:v.items}),Se($e.Table,{columns:R.filter(H=>!H.hidden),...L,className:kf(ub.table,g==null?void 0:g.className),pagination:typeof(g==null?void 0:g.pagination)=="boolean"?g.pagination:{hideOnSinglePage:!0,showPrevNextJumpers:!0,showQuickJumper:!0,showSizeChanger:!0,showTotal:H=>`共 ${H} 条`,...g==null?void 0:g.pagination}})]})}const sb={editableCellValueWrap:"editable-module_editableCellValueWrap_3b3d9"},$1=at.createContext(null),cb=({index:h,...g})=>{const[v]=$e.Form.useForm();return Se($e.Form,{form:v,component:!1,children:Se($1.Provider,{value:v,children:Se("tr",{...g})})})};function fb(h){const{title:g,editable:v,children:R,dataIndex:L,record:H,rules:C,onChange:K,type:M="input",valueProps:I,...me}=h,X=at.useRef(null),ie=at.useContext($1),re=async()=>{try{const we=await ie.validateFields();K({...H,...we})}catch(we){console.log("Save failed:",we)}},ze=()=>Se(I1,{valueType:M,valueProps:{...I,onBlur:re,onPressEnter:re},inputRef:X});let Ze=R;return v&&(Ze=Se($e.Form.Item,{style:{margin:0},initialValue:H[L],name:L,rules:C,children:ze()})),Se("td",{children:Ze})}function db(h){const{columns:g,onChange:v,...R}=h,L={body:{row:cb,cell:fb}},H=g==null?void 0:g.map(C=>C.editable?{...C,onCell:K=>({...C,record:K,onChange:v})}:C);return Se($e.Table,{...R,components:L,rowClassName:()=>sb.editableRow,columns:H})}const Y1=h=>{const{auth:g=!0,...v}=h;return g?Se($e.Button,{...v}):null},pb=h=>{const{PId:g,auths:v,...R}=h,L=at.useMemo(()=>!!(v&&v.find(H=>H.PId===g)),[g,v]);return Se(Y1,{...R,auth:L})},_n={main:"workflownode-module_main_dce7f",item:"workflownode-module_item_73d7c",tail:"workflownode-module_tail_3cb51",node:"workflownode-module_node_005fd",content:"workflownode-module_content_8334f",collpase:"workflownode-module_collpase_f2468",btn:"workflownode-module_btn_b0c06",title:"workflownode-module_title_cb34c",dateWrapper:"workflownode-module_dateWrapper_94849",remark:"workflownode-module_remark_4f910",itemActive:"workflownode-module_itemActive_2a29d",itemDone:"workflownode-module_itemDone_489bc",itemUnDo:"workflownode-module_itemUnDo_2914c"},vb=h=>{const{data:g,current:v}=h,[R,L]=at.useState(!1),H=at.useMemo(()=>!v||g.length===0?0:g.findIndex(I=>I.PNId===v),[v,g]),C=at.useMemo(()=>H>1?R?0:H-1:0,[H,R]),K=()=>{L(!0)};return Dn("ul",{className:_n.main,children:[H>1&&!R&&Dn("li",{className:kf(_n.item,_n.itemDone),children:[Se("div",{className:_n.tail}),Se("div",{className:_n.node}),Se("div",{className:_n.content,children:Dn("div",{className:_n.collpase,children:[Dn("div",{children:["已收起",Se("span",{children:H-1}),"个节点"]}),Dn("a",{className:_n.btn,onClick:K,children:["展开节点",Se(_R,{})]})]})})]}),g.slice(C).map((M,I)=>Dn("li",{className:kf(_n.item,H===I+C?_n.itemActive:H>I+C?_n.itemDone:_n.itemUnDo),children:[Se("div",{className:_n.tail}),Se("div",{className:_n.node}),Dn("div",{className:_n.content,children:[Se("div",{className:_n.title,children:M.PNName}),Dn("div",{className:_n.dateWrapper,children:[M.PlanFinishDate&&Dn("span",{children:["预计完成时间: ",M.PlanFinishDate]}),M.UpdateTime&&Dn("span",{style:{color:"#333",fontWeight:"bold"},children:["实际完成时间: ",M.UpdateTime]}),R&&H-1===I&&Dn("a",{className:_n.btn,onClick:()=>L(!1),children:["收起节点 ",Se(UR,{})]})]}),M.Remark&&Se("div",{className:_n.remark,children:M.Remark})]})]},M.PNId))]})},hb=h=>{const{current:g,data:v,...R}=h;return(()=>{$e.Modal.info({icon:null,title:"流程节点",width:700,content:Se(vb,{current:g,data:v}),closable:!0,footer:null,maskClosable:!0,...R})})(),null},mb=(h,g)=>{const v=new URL(h),R=new URL(g);return v.protocol===R.protocol&&v.host===R.host&&v.port===R.port},yb=h=>{const g=new URL(h).href.split("/");return g[g.length-1]},gb=h=>{var v;return(v=h.headers.get("content-disposition"))==null?void 0:v.split(";")[1].split("=")[1]},Sb=(h,g)=>{const v=g||yb(h);if(mb(h,window.location.href)){Cy(h,v);return}let R=g;fetch(h,{method:"get"}).then(L=>(R||(R=gb(L)),L.blob())).then(L=>{Q1(L,R||v)}).catch(()=>{Cy(h,"")})},Q1=(h,g)=>{let v=window.URL.createObjectURL(h);const R=window.navigator;if(R.msSaveOrOpenBlob){R.msSaveOrOpenBlob(h,g);return}Cy(v,g),window.URL.revokeObjectURL(v)},Cy=(h,g)=>{let v=document.createElement("a");v.style.display="none",v.href=h,v.target="_blank",v.download=g,document.body.appendChild(v),v.click(),document.body.removeChild(v)},Cb=Object.freeze(Object.defineProperty({__proto__:null,downloadUrl:Sb,downloadBlob:Q1},Symbol.toStringTag,{value:"Module"}));class Eb{constructor(g){kw(this,"options",{id:"",canvasId:"verifyCanvas",width:100,height:30,type:"blend",code:""});this.options=g}GVerify(){this.options.numArr="0,1,2,3,4,5,6,7,8,9".split(","),this.options.letterArr=this.getAllLetter(),this._init(),this.refresh()}_init(){const g=document.getElementById(this.options.id),v=document.createElement("canvas");v.id=this.options.canvasId,v.width=Number(this.options.width),v.height=Number(this.options.height),v.style.cursor="pointer",v.innerHTML="您的浏览器版本不支持canvas",g&&g.appendChild(v),v.onclick=()=>{this.refresh()}}refresh(){this.options.code="";const g=document.getElementById(this.options.canvasId);let v,R=[];if(g.getContext)v=g.getContext("2d");else return;v.textBaseline="middle",v.fillStyle=this.randomColor(180,240),v.fillRect(0,0,this.options.width,this.options.height),this.options.type=="blend"?R=this.options.numArr.concat(this.options.letterArr):this.options.type=="number"?R=this.options.numArr:R=this.options.letterArr;for(let L=1;L<=4;L++){const H=R[this.randomNum(0,R.length)];this.options.code+=H,v.font="20px SimHei",v.fillStyle=this.randomColor(50,160),v.shadowBlur=this.randomNum(-3,3),v.shadowColor="rgba(0, 0, 0, 0.3)";const C=Number(this.options.width)/5*L,K=Number(this.options.height)/2,M=this.randomNum(-30,30);v.translate(C,K),v.rotate(M*Math.PI/180),v.fillText(H,0,0),v.rotate(-M*Math.PI/180),v.translate(-C,-K)}for(let L=0;L<2;L++)v.strokeStyle=this.randomColor(40,180),v.beginPath(),v.moveTo(this.randomNum(0,Number(this.options.width)/2),this.randomNum(0,Number(this.options.height)/2)),v.lineTo(this.randomNum(0,Number(this.options.width)/2),this.randomNum(0,Number(this.options.height))),v.stroke();for(let L=0;L<Number(this.options.width)/10;L++)v.fillStyle=this.randomColor(0,255),v.beginPath(),v.arc(this.randomNum(0,this.options.width),this.randomNum(0,this.options.height),1,0,2*Math.PI),v.fill()}validate(g){const v=g.toLowerCase(),R=this.options.code.toLowerCase();return v==R}getAllLetter(){return"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z".split(",")}randomNum(g,v){return Math.floor(Math.random()*(v-g)+g)}randomColor(g,v){const R=this.randomNum(g,v),L=this.randomNum(g,v),H=this.randomNum(g,v);return"rgb("+R+","+L+","+H+")"}}const Tb=Object.freeze(Object.defineProperty({__proto__:null,getGVerify:Eb},Symbol.toStringTag,{value:"Module"}));_t.AuthButton=Y1,_t.BackHeader=BR,_t.CoralButton=pb,_t.CreateForm=P1,_t.EditTable=db,_t.SearchTable=ob,_t.UploadFile=V1,_t.download=Cb,_t.fileType=PR,_t.showWorkFlow=hb,_t.utils=ZR,_t.verfyCode=Tb,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -7,8 +7,9 @@ import React, { ReactElement, ReactNode } from "react";
|
|
|
7
7
|
import { UploadFileProps } from "../Upload";
|
|
8
8
|
export type ValueType = "rangePicker" | "select" | "input" | "password" | "textarea" | "radio" | "inputNumber" | "switch" | "checkbox" | "timePicker" | "datePicker" | "cascader" | "upload" | "modal" | "rate" | "custom" | "btns";
|
|
9
9
|
interface ValueBtnProps extends ButtonProps {
|
|
10
|
-
title
|
|
11
|
-
btnType
|
|
10
|
+
title?: string;
|
|
11
|
+
btnType?: "submit" | "reset" | "cancel";
|
|
12
|
+
key?: React.Key;
|
|
12
13
|
}
|
|
13
14
|
interface ValueModalProps {
|
|
14
15
|
onClear?: () => void;
|
|
@@ -207,12 +207,12 @@ const FormFields = (props) => {
|
|
|
207
207
|
{
|
|
208
208
|
type: item.btnType === "submit" ? "primary" : "default",
|
|
209
209
|
..._.omit(item, ["btnType"]),
|
|
210
|
-
key: item.btnType,
|
|
210
|
+
key: item.key || item.btnType,
|
|
211
211
|
onClick: (e) => {
|
|
212
212
|
onBtnClick == null ? void 0 : onBtnClick(e, item);
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
item.title
|
|
215
|
+
item.title || item.children
|
|
216
216
|
)) });
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
@@ -7,8 +7,9 @@ import React, { ReactElement, ReactNode } from "react";
|
|
|
7
7
|
import { UploadFileProps } from "../Upload";
|
|
8
8
|
export type ValueType = "rangePicker" | "select" | "input" | "password" | "textarea" | "radio" | "inputNumber" | "switch" | "checkbox" | "timePicker" | "datePicker" | "cascader" | "upload" | "modal" | "rate" | "custom" | "btns";
|
|
9
9
|
interface ValueBtnProps extends ButtonProps {
|
|
10
|
-
title
|
|
11
|
-
btnType
|
|
10
|
+
title?: string;
|
|
11
|
+
btnType?: "submit" | "reset" | "cancel";
|
|
12
|
+
key?: React.Key;
|
|
12
13
|
}
|
|
13
14
|
interface ValueModalProps {
|
|
14
15
|
onClear?: () => void;
|
|
@@ -209,12 +209,12 @@ const FormFields = (props) => {
|
|
|
209
209
|
{
|
|
210
210
|
type: item.btnType === "submit" ? "primary" : "default",
|
|
211
211
|
..._.omit(item, ["btnType"]),
|
|
212
|
-
key: item.btnType,
|
|
212
|
+
key: item.key || item.btnType,
|
|
213
213
|
onClick: (e) => {
|
|
214
214
|
onBtnClick == null ? void 0 : onBtnClick(e, item);
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
|
-
item.title
|
|
217
|
+
item.title || item.children
|
|
218
218
|
)) });
|
|
219
219
|
break;
|
|
220
220
|
}
|