@kne-components/components-core 0.2.18 → 0.2.20
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/build/asset-manifest.json +126 -126
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/css/1151.c5bf4295.chunk.css +2 -0
- package/build/static/css/{1151.9ece0968.chunk.css.map → 1151.c5bf4295.chunk.css.map} +1 -1
- package/build/static/css/1153.e1136bb7.chunk.css +2 -0
- package/build/static/css/1153.e1136bb7.chunk.css.map +1 -0
- package/build/static/css/1154.6ec816e9.chunk.css +2 -0
- package/build/static/css/{1154.92e0cef9.chunk.css.map → 1154.6ec816e9.chunk.css.map} +1 -1
- package/build/static/css/1454.70aff5cc.chunk.css +2 -0
- package/build/static/css/{1454.7c4477fa.chunk.css.map → 1454.70aff5cc.chunk.css.map} +1 -1
- package/build/static/css/1554.09f99760.chunk.css +2 -0
- package/build/static/css/{1554.3ea29969.chunk.css.map → 1554.09f99760.chunk.css.map} +1 -1
- package/build/static/css/2503.bcfba63d.chunk.css +2 -0
- package/build/static/css/{2503.f0422b14.chunk.css.map → 2503.bcfba63d.chunk.css.map} +1 -1
- package/build/static/css/2517.24af23f9.chunk.css +2 -0
- package/build/static/css/{2517.7e8e9d10.chunk.css.map → 2517.24af23f9.chunk.css.map} +1 -1
- package/build/static/css/2716.e46dcd15.chunk.css +2 -0
- package/build/static/css/{2716.715705fe.chunk.css.map → 2716.e46dcd15.chunk.css.map} +1 -1
- package/build/static/css/2730.9d5b19ce.chunk.css +2 -0
- package/build/static/css/{2730.e366ad70.chunk.css.map → 2730.9d5b19ce.chunk.css.map} +1 -1
- package/build/static/css/289.7c187ff7.chunk.css +2 -0
- package/build/static/css/{289.120cb10b.chunk.css.map → 289.7c187ff7.chunk.css.map} +1 -1
- package/build/static/css/3142.3c420caf.chunk.css +2 -0
- package/build/static/css/{3142.3098d764.chunk.css.map → 3142.3c420caf.chunk.css.map} +1 -1
- package/build/static/css/3333.1b58c0aa.chunk.css +2 -0
- package/build/static/css/{3333.70b0a061.chunk.css.map → 3333.1b58c0aa.chunk.css.map} +1 -1
- package/build/static/css/{3843.9b3df104.chunk.css → 3843.ba90a8f5.chunk.css} +2 -2
- package/build/static/css/{3843.9b3df104.chunk.css.map → 3843.ba90a8f5.chunk.css.map} +1 -1
- package/build/static/css/4029.072027ce.chunk.css +2 -0
- package/build/static/css/4029.072027ce.chunk.css.map +1 -0
- package/build/static/css/4265.321acd22.chunk.css +2 -0
- package/build/static/css/4265.321acd22.chunk.css.map +1 -0
- package/build/static/css/4666.e331554d.chunk.css +2 -0
- package/build/static/css/{4666.f8fecae2.chunk.css.map → 4666.e331554d.chunk.css.map} +1 -1
- package/build/static/css/5443.02545310.chunk.css +2 -0
- package/build/static/css/5443.02545310.chunk.css.map +1 -0
- package/build/static/css/5600.84a76396.chunk.css +2 -0
- package/build/static/css/{5600.1e446cf5.chunk.css.map → 5600.84a76396.chunk.css.map} +1 -1
- package/build/static/css/5873.9f3477b5.chunk.css +2 -0
- package/build/static/css/{5873.ecec28f5.chunk.css.map → 5873.9f3477b5.chunk.css.map} +1 -1
- package/build/static/css/{5996.32912f4a.chunk.css → 5996.0620077d.chunk.css} +2 -2
- package/build/static/css/{5996.32912f4a.chunk.css.map → 5996.0620077d.chunk.css.map} +1 -1
- package/build/static/css/6611.b88ef3ff.chunk.css +2 -0
- package/build/static/css/{6611.64be6858.chunk.css.map → 6611.b88ef3ff.chunk.css.map} +1 -1
- package/build/static/css/6779.3cfa629d.chunk.css +2 -0
- package/build/static/css/{6779.e919416a.chunk.css.map → 6779.3cfa629d.chunk.css.map} +1 -1
- package/build/static/css/7121.a0adccf8.chunk.css +2 -0
- package/build/static/css/{7121.6805366e.chunk.css.map → 7121.a0adccf8.chunk.css.map} +1 -1
- package/build/static/css/7227.2b968bc6.chunk.css +2 -0
- package/build/static/css/{7227.336533bd.chunk.css.map → 7227.2b968bc6.chunk.css.map} +1 -1
- package/build/static/css/8017.9290aea6.chunk.css +2 -0
- package/build/static/css/8017.9290aea6.chunk.css.map +1 -0
- package/build/static/css/{8725.9b17e317.chunk.css → 8725.63f5c01d.chunk.css} +2 -2
- package/build/static/css/{8725.9b17e317.chunk.css.map → 8725.63f5c01d.chunk.css.map} +1 -1
- package/build/static/css/9968.8205089a.chunk.css +2 -0
- package/build/static/css/9968.8205089a.chunk.css.map +1 -0
- package/build/static/js/{1106.0808aa44.chunk.js → 1106.7e84f0e8.chunk.js} +2 -2
- package/build/static/js/{1106.0808aa44.chunk.js.map → 1106.7e84f0e8.chunk.js.map} +1 -1
- package/build/static/js/{1153.64e33657.chunk.js → 1153.6af03d54.chunk.js} +3 -3
- package/build/static/js/{1153.64e33657.chunk.js.map → 1153.6af03d54.chunk.js.map} +1 -1
- package/build/static/js/1154.ed937d28.chunk.js +2 -0
- package/build/static/js/1154.ed937d28.chunk.js.map +1 -0
- package/build/static/js/{1454.9a98280d.chunk.js → 1454.f07e6f93.chunk.js} +3 -3
- package/build/static/js/{1454.9a98280d.chunk.js.map → 1454.f07e6f93.chunk.js.map} +1 -1
- package/build/static/js/1554.47b37595.chunk.js +3 -0
- package/build/static/js/{1554.f82d0139.chunk.js.map → 1554.47b37595.chunk.js.map} +1 -1
- package/build/static/js/{2503.3bd2a3d8.chunk.js → 2503.1da25d3a.chunk.js} +2 -2
- package/build/static/js/{2503.3bd2a3d8.chunk.js.map → 2503.1da25d3a.chunk.js.map} +1 -1
- package/build/static/js/2517.968ce983.chunk.js +2 -0
- package/build/static/js/{2517.1e69f1c5.chunk.js.map → 2517.968ce983.chunk.js.map} +1 -1
- package/build/static/js/2716.6d68d7db.chunk.js +3 -0
- package/build/static/js/{2716.b72822b4.chunk.js.map → 2716.6d68d7db.chunk.js.map} +1 -1
- package/build/static/js/2730.671e63e6.chunk.js +2 -0
- package/build/static/js/{2730.077b9b90.chunk.js.map → 2730.671e63e6.chunk.js.map} +1 -1
- package/build/static/js/2814.fde668d0.chunk.js +2 -0
- package/build/static/js/{2814.00baadb3.chunk.js.map → 2814.fde668d0.chunk.js.map} +1 -1
- package/build/static/js/{289.f82501c0.chunk.js → 289.8f2e287e.chunk.js} +2 -2
- package/build/static/js/{289.f82501c0.chunk.js.map → 289.8f2e287e.chunk.js.map} +1 -1
- package/build/static/js/{3142.f469a4dc.chunk.js → 3142.24199eba.chunk.js} +2 -2
- package/build/static/js/{3142.f469a4dc.chunk.js.map → 3142.24199eba.chunk.js.map} +1 -1
- package/build/static/js/{3245.9bfa7de9.chunk.js → 3245.ff8461d8.chunk.js} +3 -3
- package/build/static/js/{3245.9bfa7de9.chunk.js.LICENSE.txt → 3245.ff8461d8.chunk.js.LICENSE.txt} +2 -2
- package/build/static/js/3245.ff8461d8.chunk.js.map +1 -0
- package/build/static/js/{3333.7a95660d.chunk.js → 3333.26eda487.chunk.js} +2 -2
- package/build/static/js/{3333.7a95660d.chunk.js.map → 3333.26eda487.chunk.js.map} +1 -1
- package/build/static/js/36.ec11950f.chunk.js +2 -0
- package/build/static/js/{36.c88da7cd.chunk.js.map → 36.ec11950f.chunk.js.map} +1 -1
- package/build/static/js/{3843.9faba580.chunk.js → 3843.ee7f001a.chunk.js} +2 -2
- package/build/static/js/{3843.9faba580.chunk.js.map → 3843.ee7f001a.chunk.js.map} +1 -1
- package/build/static/js/{4029.9b9a8bcc.chunk.js → 4029.62b6ec9d.chunk.js} +2 -2
- package/build/static/js/4029.62b6ec9d.chunk.js.map +1 -0
- package/build/static/js/4265.a85b8e8d.chunk.js +2 -0
- package/build/static/js/{4265.780e572b.chunk.js.map → 4265.a85b8e8d.chunk.js.map} +1 -1
- package/build/static/js/{4666.ef32bda0.chunk.js → 4666.0cbf32b3.chunk.js} +3 -3
- package/build/static/js/{4666.ef32bda0.chunk.js.map → 4666.0cbf32b3.chunk.js.map} +1 -1
- package/build/static/js/5443.376b47b4.chunk.js +2 -0
- package/build/static/js/{5443.6edd0f1b.chunk.js.map → 5443.376b47b4.chunk.js.map} +1 -1
- package/build/static/js/5600.0d345385.chunk.js +2 -0
- package/build/static/js/{5600.7b152df4.chunk.js.map → 5600.0d345385.chunk.js.map} +1 -1
- package/build/static/js/{5873.478c105e.chunk.js → 5873.8f470e43.chunk.js} +2 -2
- package/build/static/js/{5873.478c105e.chunk.js.map → 5873.8f470e43.chunk.js.map} +1 -1
- package/build/static/js/{5996.61df8d3a.chunk.js → 5996.faeee14d.chunk.js} +2 -2
- package/build/static/js/{5996.61df8d3a.chunk.js.map → 5996.faeee14d.chunk.js.map} +1 -1
- package/build/static/js/{6569.8ede8882.chunk.js → 6569.913e09b0.chunk.js} +2 -2
- package/build/static/js/{6569.8ede8882.chunk.js.map → 6569.913e09b0.chunk.js.map} +1 -1
- package/build/static/js/6611.32ab972c.chunk.js +2 -0
- package/build/static/js/{6611.452dc755.chunk.js.map → 6611.32ab972c.chunk.js.map} +1 -1
- package/build/static/js/6779.2e08f473.chunk.js +2 -0
- package/build/static/js/{6779.8d474307.chunk.js.map → 6779.2e08f473.chunk.js.map} +1 -1
- package/build/static/js/6915.c62232e0.chunk.js +2 -0
- package/build/static/js/{6915.1145718f.chunk.js.map → 6915.c62232e0.chunk.js.map} +1 -1
- package/build/static/js/{7121.5637a35b.chunk.js → 7121.6a1f5220.chunk.js} +2 -2
- package/build/static/js/{7121.5637a35b.chunk.js.map → 7121.6a1f5220.chunk.js.map} +1 -1
- package/build/static/js/7227.542429d0.chunk.js +3 -0
- package/build/static/js/{7227.db8e2bcd.chunk.js.map → 7227.542429d0.chunk.js.map} +1 -1
- package/build/static/js/{7790.8a284137.chunk.js → 7790.4e0ecb9c.chunk.js} +2 -2
- package/build/static/js/{7790.8a284137.chunk.js.map → 7790.4e0ecb9c.chunk.js.map} +1 -1
- package/build/static/js/{8017.3c30274e.chunk.js → 8017.850296f4.chunk.js} +2 -2
- package/build/static/js/{8017.3c30274e.chunk.js.map → 8017.850296f4.chunk.js.map} +1 -1
- package/build/static/js/{8620.0bbfd66d.chunk.js → 8620.621c46be.chunk.js} +2 -2
- package/build/static/js/8620.621c46be.chunk.js.map +1 -0
- package/build/static/js/{8725.3dc0b988.chunk.js → 8725.19452b01.chunk.js} +2 -2
- package/build/static/js/{8725.3dc0b988.chunk.js.map → 8725.19452b01.chunk.js.map} +1 -1
- package/build/static/js/9968.692d3e83.chunk.js +2 -0
- package/build/static/js/{9968.2b6a3cf0.chunk.js.map → 9968.692d3e83.chunk.js.map} +1 -1
- package/build/static/js/{main.ac48a622.js → main.a062cc0d.js} +2 -2
- package/build/static/js/{main.ac48a622.js.map → main.a062cc0d.js.map} +1 -1
- package/package.json +1 -1
- package/build/static/css/1151.9ece0968.chunk.css +0 -2
- package/build/static/css/1153.26c56643.chunk.css +0 -2
- package/build/static/css/1153.26c56643.chunk.css.map +0 -1
- package/build/static/css/1154.92e0cef9.chunk.css +0 -2
- package/build/static/css/1454.7c4477fa.chunk.css +0 -2
- package/build/static/css/1554.3ea29969.chunk.css +0 -2
- package/build/static/css/2503.f0422b14.chunk.css +0 -2
- package/build/static/css/2517.7e8e9d10.chunk.css +0 -2
- package/build/static/css/2716.715705fe.chunk.css +0 -2
- package/build/static/css/2730.e366ad70.chunk.css +0 -2
- package/build/static/css/289.120cb10b.chunk.css +0 -2
- package/build/static/css/3142.3098d764.chunk.css +0 -2
- package/build/static/css/3333.70b0a061.chunk.css +0 -2
- package/build/static/css/4029.19601758.chunk.css +0 -2
- package/build/static/css/4029.19601758.chunk.css.map +0 -1
- package/build/static/css/4265.d066d3e0.chunk.css +0 -2
- package/build/static/css/4265.d066d3e0.chunk.css.map +0 -1
- package/build/static/css/4666.f8fecae2.chunk.css +0 -2
- package/build/static/css/5443.945db84d.chunk.css +0 -2
- package/build/static/css/5443.945db84d.chunk.css.map +0 -1
- package/build/static/css/5600.1e446cf5.chunk.css +0 -2
- package/build/static/css/5873.ecec28f5.chunk.css +0 -2
- package/build/static/css/6611.64be6858.chunk.css +0 -2
- package/build/static/css/6779.e919416a.chunk.css +0 -2
- package/build/static/css/7121.6805366e.chunk.css +0 -2
- package/build/static/css/7227.336533bd.chunk.css +0 -2
- package/build/static/css/8017.e0a47291.chunk.css +0 -2
- package/build/static/css/8017.e0a47291.chunk.css.map +0 -1
- package/build/static/css/9968.1d4992d6.chunk.css +0 -2
- package/build/static/css/9968.1d4992d6.chunk.css.map +0 -1
- package/build/static/js/1154.42511af5.chunk.js +0 -2
- package/build/static/js/1154.42511af5.chunk.js.map +0 -1
- package/build/static/js/1554.f82d0139.chunk.js +0 -3
- package/build/static/js/2517.1e69f1c5.chunk.js +0 -2
- package/build/static/js/2716.b72822b4.chunk.js +0 -3
- package/build/static/js/2730.077b9b90.chunk.js +0 -2
- package/build/static/js/2814.00baadb3.chunk.js +0 -2
- package/build/static/js/3245.9bfa7de9.chunk.js.map +0 -1
- package/build/static/js/36.c88da7cd.chunk.js +0 -2
- package/build/static/js/4029.9b9a8bcc.chunk.js.map +0 -1
- package/build/static/js/4265.780e572b.chunk.js +0 -2
- package/build/static/js/5443.6edd0f1b.chunk.js +0 -2
- package/build/static/js/5600.7b152df4.chunk.js +0 -2
- package/build/static/js/6611.452dc755.chunk.js +0 -2
- package/build/static/js/6779.8d474307.chunk.js +0 -2
- package/build/static/js/6915.1145718f.chunk.js +0 -2
- package/build/static/js/7227.db8e2bcd.chunk.js +0 -3
- package/build/static/js/8620.0bbfd66d.chunk.js.map +0 -1
- package/build/static/js/9968.2b6a3cf0.chunk.js +0 -2
- /package/build/static/js/{1153.64e33657.chunk.js.LICENSE.txt → 1153.6af03d54.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1454.9a98280d.chunk.js.LICENSE.txt → 1454.f07e6f93.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1554.f82d0139.chunk.js.LICENSE.txt → 1554.47b37595.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2716.b72822b4.chunk.js.LICENSE.txt → 2716.6d68d7db.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4666.ef32bda0.chunk.js.LICENSE.txt → 4666.0cbf32b3.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7227.db8e2bcd.chunk.js.LICENSE.txt → 7227.542429d0.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[3333,1151,9034],{10419:(e,t,s)=>{s.r(t),s.d(t,{HtmlPreview:()=>j,ImagePreview:()=>U,OSSFilePreview:()=>A,OfficePreview:()=>g,PdfPreview:()=>E,TextPreview:()=>
|
|
2
|
-
//# sourceMappingURL=3333.
|
|
1
|
+
"use strict";(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[3333,1151,9034],{10419:(e,t,s)=>{s.r(t),s.d(t,{HtmlPreview:()=>j,ImagePreview:()=>U,OSSFilePreview:()=>A,OfficePreview:()=>g,PdfPreview:()=>E,TextPreview:()=>L,UnknownPreview:()=>R,default:()=>z});var r=s(63114),a=s.n(r),n=s(73884),c=s(13050),i=s(83136),l=s.n(i);const o="style_container__9Fu-3__+Svgs",d="style_loading__r3aiE__+Svgs",m="style_text-outer__TzhuG__+Svgs",u="style_error__wSaxt__+Svgs",p="style_html-preview-iframe__bQQiA__+Svgs";var h=s(87558),x=s(70579);const f=e=>{if(!/^http?s:\/\//.test(e))return!1;const t=new URL(window.location.href),s=new URL(e);return["protocol","hostname","port"].some((e=>t[e]!==s[e]))},v=(0,h.createWithFetch)({transformResponse:e=>{let{data:t}=e;return{data:{code:200,results:t}}}})((e=>{let{data:t}=e;const s=(0,n.useRef)(null);return(0,n.useEffect)((()=>{const e=(new DOMParser).parseFromString(t,"text/html");e.querySelectorAll("script").forEach((e=>{e.parentElement.removeChild(e)}));const r=(0,c.getPublicPath)("components-core")+"/iframeResizer.contentWindow.js",a=document.createElement("script");a.src=r,e.head.appendChild(a);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",e.head.appendChild(n),s.current.srcdoc=e.documentElement.outerHTML}),[t]),(0,n.useEffect)((()=>{a().iframeResize({checkOrigin:!1},s.current)}),[]),(0,x.jsx)("iframe",{title:"\u6587\u4ef6\u9884\u89c8",frameBorder:"0",width:"100%",ref:s})})),j=e=>{let{className:t,url:s,maxWidth:r}=e;return(0,x.jsx)("div",{className:l()(t,o),style:{maxWidth:r},children:f(s)?(0,x.jsx)("iframe",{title:"\u6587\u4ef6\u9884\u89c8",src:s,frameBorder:"0",width:"100%",className:p}):(0,x.jsx)(v,{url:s})})};var w=s(63908);const _=(0,h.createWithFetch)({cache:"office-preview"})((e=>{let{data:t,className:s,...r}=e;const{data:a}=t;return a.map((e=>{let{url:t,type:a}=e;const c=D[a]||T(t);return(0,n.createElement)(c,{...r,url:t,key:t,className:s})}))})),g=e=>{let{id:t,apis:s,className:r,...a}=e;const{apis:n,staticUrl:c,ajax:i}=(0,w.usePreset)(),l=Object.assign({},n,s);return(0,x.jsx)(_,{...a,...l.previewOffice||{loader:async e=>{var t;let{data:s}=e;const{data:r}=await i(Object.assign({},l.oss,null!==(t=l.oss)&&void 0!==t&&t.url?{url:(l.oss.url||"").replace("{id}",s.id)}:{}));return{data:[{url:"https://view.officeapps.live.com/op/view.aspx?src=".concat(encodeURIComponent((c||"")+r),"&wdPrint=0&wdEmbedCode=0"),type:"html"}]}}},data:{id:t},className:r})};var N=s(55199),P=s(39165),S=(s(71975),s(36));const y=(0,n.memo)((e=>{let{url:t,maxWidth:s,scale:r,rotate:a,className:i}=e;const[m,u]=(0,n.useState)(0);P.pdfjs.GlobalWorkerOptions.workerSrc=(0,c.getPublicPath)("components-core")+"/pdfjs/build/pdf.worker.js";const[p,h]=(0,n.useState)(s),f=(0,S.useResize)((()=>{f.current&&f.current.clientWidth&&h(Math.min(f.current.clientWidth,s))}));return(0,x.jsx)("div",{ref:f,className:l()(i,o),style:{maxWidth:s},children:(0,x.jsx)(P.Document,{file:{url:t},options:{standardFontDataUrl:(0,c.getPublicPath)("components-core")+"/pdfjs/standard_fonts/",cMapUrl:(0,c.getPublicPath)("components-core")+"/pdfjs/cmaps/",cMapPacked:!0},error:"PDF\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",loading:(0,x.jsx)("div",{className:d,children:(0,x.jsx)(N.Spin,{})}),noData:"\u672a\u6307\u5b9aPDF\u6587\u4ef6",onLoadSuccess:e=>{let{numPages:t}=e;u(t)},onLoadError:e=>{},onSourceError:e=>{},children:(0,x.jsx)(N.Space,{direction:"vertical",children:m>=1&&Array.from(new Array(m),((e,t)=>(0,x.jsx)(P.Page,{className:"preview-item",scale:r/100,rotate:a,pageNumber:t+1,width:p,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:"\u672a\u6307\u5b9a\u9875\u9762"},"page_".concat(t))))})})})}));y.defaultProps={autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200};const E=y;var b=s(91409),W=s.n(b),k=s(89946),F=s.n(k);const L=e=>{let{url:t,className:s,maxWidth:r}=e;const[a,c]=(0,n.useState)(""),[i,p]=(0,n.useState)(!0),[h,f]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{F().get(t).then((e=>{let{data:t}=e;c(t),p(!1)}),(()=>{p(!1),f(!0)}))}),[t]),(0,x.jsxs)("div",{className:l()(s,o),style:{maxWidth:r},children:[i?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(N.Spin,{})}):null,(0,x.jsx)("div",{className:m,children:h?(0,x.jsx)("div",{className:u,children:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)(W(),{text:a})})]})},R=e=>{let{maxWidth:t}=e;return(0,x.jsx)("div",{className:o,style:{maxWidth:t},children:(0,x.jsx)("div",{className:m,children:(0,x.jsx)(N.Result,{status:"500",title:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",subTitle:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8"})})})},U=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[i,m]=(0,n.useState)(!0),[p,h]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=new Image;e.src=t;const s=()=>{m(!1)},r=()=>{m(!1),h(!0)};return e.addEventListener("load",s),e.addEventListener("error",r),()=>{e.removeEventListener("load",s),e.removeEventListener("error",r)}}),[t,s,r]),(0,x.jsxs)("div",{className:l()(a,o),style:{maxWidth:c},children:[i?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(N.Spin,{})}):null,p?(0,x.jsx)("div",{className:u,children:"\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)("img",{src:t,alt:"\u7b80\u5386\u9884\u89c8"})]})},C=e=>{const t=(e||"").split("?")[0].toLowerCase();return/.txt$/.test(t)?"txt":/.pdf$/.test(t)?"pdf":/.(png|jpg|jpeg)$/.test(t)?"image":/.(html|htm)$/.test(t)?"html":/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(t)?"office":"unknown"},O=C,D={txt:L,pdf:E,image:U,html:j,office:g,unknown:R},T=e=>D[C(e)];const A=(0,s(97211).A)((e=>{let{data:t,id:s,staticUrl:r,className:a,...n}=e;const{staticUrl:c}=(0,w.usePreset)(),i=r||c||"",l=T(t);return"office"===O(t)?(0,x.jsx)(g,{...n,id:s,className:a}):(0,x.jsx)(l,{...n,className:a,url:/^https?:\/\//.test(t)?t:i+t})})),z=e=>{let{id:t,originName:s,...r}=e;return"office"===O(s)?(0,x.jsx)(g,{...r,id:t,originName:s}):(0,x.jsx)(A,{...r,id:t,originName:s})}},71975:()=>{}}]);
|
|
2
|
+
//# sourceMappingURL=3333.26eda487.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/js/3333.7a95660d.chunk.js","mappings":"mYACA,QAA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uB,CAClCoF,IAAKC,EACLC,IAAK/D,EACLkD,MAAOc,EACPC,KAAMC,EACNC,OAAQC,EACRC,QAASC,GAGE5F,EAAuB9D,GAC3B6D,EAAqBgF,EAAW7I,ICnCzC,MAkBA,GAlBuB2J,E,SAAAA,IACrB9I,IAAmE,IAAlE,KAAEC,EAAI,GAAEmD,EAAII,UAAWuF,EAAc,UAAE1G,KAAcM,GAAO3C,EAC3D,MAAQwD,UAAWwF,IAAkBtF,EAAAA,EAAAA,aAC/BF,EAAYuF,GAAkBC,GAAiB,GAC/CjG,EAAmBE,EAAoBhD,GAC7C,MAAyB,WAArB+H,EAAW/H,IACN+B,EAAAA,EAAAA,KAAC2G,EAAa,IAAKhG,EAAOS,GAAIA,EAAIf,UAAWA,KAGpDL,EAAAA,EAAAA,KAACe,EAAgB,IACXJ,EACJN,UAAWA,EACXlD,IAAK,eAAeC,KAAKa,GAAQA,EAAOuD,EAAYvD,GACpD,ICPR,EAPoBD,IAAmC,IAAlC,GAAEoD,EAAE,WAAE6F,KAAetG,GAAO3C,EAC/C,MAA+B,WAA3BgI,EAAWiB,IACNjH,EAAAA,EAAAA,KAAC2G,EAAa,IAAKhG,EAAOS,GAAIA,EAAI6F,WAAYA,KAEhDjH,EAAAA,EAAAA,KAACkH,EAAc,IAAKvG,EAAOS,GAAIA,EAAI6F,WAAYA,GAAc,C","sources":["webpack://@kne-components/components-core/./src/components/FilePreview/style.module.scss?a805","components/FilePreview/HtmlPreview.js","components/FilePreview/OfficePreview.js","components/FilePreview/PdfPreview.js","components/FilePreview/TextPreview.js","components/FilePreview/UnknownPreview.js","components/FilePreview/ImagePreview.js","components/FilePreview/typeFormat.js","components/FilePreview/OSSFilePreview.js","components/FilePreview/FilePreview.js"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport default {\"container\":\"style_container__9Fu-3__uZ6Ly\",\"container-html\":\"style_container-html__IsNVq__uZ6Ly\",\"html-inner\":\"style_html-inner__S05cI__uZ6Ly\",\"loading\":\"style_loading__r3aiE__uZ6Ly\",\"control-bar\":\"style_control-bar__kTKau__uZ6Ly\",\"scroller\":\"style_scroller__HOq7b__uZ6Ly\",\"outer\":\"style_outer__ntu--__uZ6Ly\",\"file-name\":\"style_file-name__UPbbe__uZ6Ly\",\"file-options\":\"style_file-options__5TE5l__uZ6Ly\",\"scale-input\":\"style_scale-input__JdF1K__uZ6Ly\",\"text-outer\":\"style_text-outer__TzhuG__uZ6Ly\",\"error\":\"style_error__wSaxt__uZ6Ly\",\"text-inner\":\"style_text-inner__jdi-A__uZ6Ly\",\"image-inner\":\"style_image-inner__zTiFU__uZ6Ly\",\"html-preview-iframe\":\"style_html-preview-iframe__bQQiA__uZ6Ly\"};","import iFrameResize from \"iframe-resizer\";\nimport { useEffect, useRef } from \"react\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\nimport style from \"./style.module.scss\";\nimport { createWithFetch } from \"@kne/react-fetch\";\n\nconst isCrossDomain = (url) => {\n if (!/^http?s:\\/\\//.test(url)) {\n return false;\n }\n const currentURL = new URL(window.location.href);\n const targetURL = new URL(url);\n return [\"protocol\", \"hostname\", \"port\"].some(\n (name) => currentURL[name] !== targetURL[name]\n );\n};\n\nconst HtmlInnerPreview = createWithFetch({\n transformResponse: ({ data }) => {\n return {\n data: {\n code: 200,\n results: data,\n },\n };\n },\n})(({ data }) => {\n const ref = useRef(null);\n useEffect(() => {\n const parser = new DOMParser();\n const domDocument = parser.parseFromString(data, \"text/html\");\n domDocument.querySelectorAll(\"script\").forEach((el) => {\n el.parentElement.removeChild(el);\n });\n const scriptPath =\n getPublicPath(\"components-core\") + \"/iframeResizer.contentWindow.js\";\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n domDocument.head.appendChild(script);\n const style = document.createElement(\"style\");\n style.innerText =\n \"html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}\";\n domDocument.head.appendChild(style);\n ref.current.srcdoc = domDocument.documentElement.outerHTML;\n }, [data]);\n useEffect(() => {\n iFrameResize.iframeResize({ checkOrigin: false }, ref.current);\n }, []);\n return <iframe title=\"文件预览\" frameBorder=\"0\" width=\"100%\" ref={ref} />;\n});\n\nconst HtmlPreview = ({ className, url, maxWidth }) => {\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {isCrossDomain(url) ? (\n <iframe\n title=\"文件预览\"\n src={url}\n frameBorder=\"0\"\n width=\"100%\"\n className={style[\"html-preview-iframe\"]}\n />\n ) : (\n <HtmlInnerPreview url={url} />\n )}\n </div>\n );\n};\n\nexport default HtmlPreview;\n","import { usePreset } from \"@components/Global\";\nimport { createWithFetch } from \"@kne/react-fetch\";\nimport { typeFormatComponent, typeComponentMapping } from \"./typeFormat\";\n\nconst OfficePreviewInner = createWithFetch({\n cache: \"office-preview\",\n})(({ data, className, ...props }) => {\n const { data: fileList } = data;\n return fileList.map(({ url, type }) => {\n const PreviewComponent =\n typeComponentMapping[type] || typeFormatComponent(url);\n return (\n <PreviewComponent {...props} url={url} key={url} className={className} />\n );\n });\n});\n\nconst OfficePreview = ({ id, apis: propsApis, className, ...props }) => {\n const { apis: baseApis, staticUrl, ajax } = usePreset();\n const apis = Object.assign({}, baseApis, propsApis);\n return (\n <OfficePreviewInner\n {...props}\n {...(apis.previewOffice || {\n loader: async ({ data }) => {\n const { data: resData } = await ajax(\n Object.assign(\n {},\n apis.oss,\n apis.oss?.url\n ? {\n url: (apis.oss.url || \"\").replace(\"{id}\", data.id),\n }\n : {}\n )\n );\n return {\n data: [\n {\n url: `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(\n (staticUrl || \"\") + resData\n )}&wdPrint=0&wdEmbedCode=0`,\n type: \"html\",\n },\n ],\n };\n },\n })}\n data={{ id }}\n className={className}\n />\n );\n};\n\nexport default OfficePreview;\n","import { memo, useState } from \"react\";\nimport { Space, Spin } from \"antd\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport \"react-pdf/dist/esm/Page/TextLayer.css\";\nimport style from \"./style.module.scss\";\nimport { useResize } from \"@components/Common\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\n\nconst PdfPreview = memo(({ url, maxWidth, scale, rotate, className }) => {\n const [numPages, setNumPages] = useState(0);\n pdfjs.GlobalWorkerOptions.workerSrc =\n getPublicPath(\"components-core\") + \"/pdfjs/build/pdf.worker.js\";\n const [width, setWidth] = useState(maxWidth);\n const ref = useResize(() => {\n if (ref.current && ref.current.clientWidth) {\n setWidth(Math.min(ref.current.clientWidth, maxWidth));\n }\n });\n\n return (\n <div\n ref={ref}\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth: maxWidth,\n }}\n >\n <Document\n file={{ url }}\n options={{\n standardFontDataUrl:\n getPublicPath(\"components-core\") + \"/pdfjs/standard_fonts/\",\n cMapUrl: getPublicPath(\"components-core\") + \"/pdfjs/cmaps/\",\n cMapPacked: true,\n }}\n error=\"PDF文件加载失败\"\n loading={\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n }\n noData=\"未指定PDF文件\"\n onLoadSuccess={({ numPages }) => {\n setNumPages(numPages);\n //console.log(\"onLoadSuccess\");\n }}\n onLoadError={(props) => {\n //console.log(\"onLoadError\", props);\n }}\n onSourceError={(props) => {\n //console.log(\"onSourceError\", props);\n }}\n >\n <Space direction=\"vertical\">\n {numPages >= 1 &&\n Array.from(new Array(numPages), (el, index) => (\n <Page\n key={`page_${index}`}\n className=\"preview-item\"\n scale={scale / 100}\n rotate={rotate}\n pageNumber={index + 1}\n width={width}\n loading={null}\n renderAnnotationLayer={false}\n renderTextLayer={true}\n noData=\"未指定页面\"\n />\n ))}\n </Space>\n </Document>\n </div>\n );\n});\n\nPdfPreview.defaultProps = {\n autoSize: true,\n renderTextLayer: false,\n scale: 100,\n rotate: 0,\n maxWidth: 1200,\n};\n\nexport default PdfPreview;\n","import { useState, useEffect } from \"react\";\nimport TextEscape from \"@kne/react-text-escape\";\nimport axios from \"axios\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst TextPreview = ({ url, className, maxWidth }) => {\n const [text, setText] = useState(\"\");\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n axios.get(url).then(\n ({ data }) => {\n setText(data);\n setLoading(false);\n },\n () => {\n setLoading(false);\n setError(true);\n }\n );\n }, [url]);\n\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n <div className={style[\"text-outer\"]}>\n {error ? (\n <div className={style[\"error\"]}>文件加载失败</div>\n ) : (\n <TextEscape text={text} />\n )}\n </div>\n </div>\n );\n};\n\nexport default TextPreview;\n","import { Result } from \"antd\";\nimport style from \"./style.module.scss\";\n\nconst UnknownPreview = ({ maxWidth }) => {\n return (\n <div\n className={style[\"container\"]}\n style={{\n maxWidth,\n }}\n >\n <div className={style[\"text-outer\"]}>\n <Result\n status=\"500\"\n title=\"不支持的文件类型\"\n subTitle=\"系统不支持该文件类型预览,请下载到本地后进行预览\"\n />\n </div>\n </div>\n );\n};\n\nexport default UnknownPreview;\n","import { useEffect, useState } from \"react\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst ImagePreview = ({ url, scale, rotate, className, maxWidth }) => {\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n const image = new Image();\n image.src = url;\n const handlerLoad = () => {\n setLoading(false);\n };\n\n const handlerError = () => {\n setLoading(false);\n setError(true);\n };\n\n image.addEventListener(\"load\", handlerLoad);\n image.addEventListener(\"error\", handlerError);\n return () => {\n image.removeEventListener(\"load\", handlerLoad);\n image.removeEventListener(\"error\", handlerError);\n };\n }, [url, scale, rotate]);\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n {error ? (\n <div className={style[\"error\"]}>图片加载失败</div>\n ) : (\n <img src={url} alt=\"简历预览\" />\n )}\n </div>\n );\n};\n\nexport default ImagePreview;\n","import HtmlPreview from \"./HtmlPreview\";\nimport OfficePreview from \"./OfficePreview\";\nimport PdfPreview from \"./PdfPreview\";\nimport TextPreview from \"./TextPreview\";\nimport UnknownPreview from \"./UnknownPreview\";\nimport ImagePreview from \"./ImagePreview\";\n\nconst typeFormat = (url) => {\n const path = (url || \"\").split(\"?\")[0];\n const _path = path.toLowerCase();\n if (/.txt$/.test(_path)) {\n return \"txt\";\n }\n if (/.pdf$/.test(_path)) {\n return \"pdf\";\n }\n if (/.(png|jpg|jpeg)$/.test(_path)) {\n return \"image\";\n }\n if (/.(html|htm)$/.test(_path)) {\n return \"html\";\n }\n if (/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(_path)) {\n return \"office\";\n }\n return \"unknown\";\n};\n\nexport default typeFormat;\n\nexport const typeComponentMapping = {\n txt: TextPreview,\n pdf: PdfPreview,\n image: ImagePreview,\n html: HtmlPreview,\n office: OfficePreview,\n unknown: UnknownPreview,\n};\n\nexport const typeFormatComponent = (url) => {\n return typeComponentMapping[typeFormat(url)];\n};\n","import withOSSFile from \"@common/hocs/withOSSFile\";\nimport typeFormat, { typeFormatComponent } from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\nimport { usePreset } from \"@components/Global\";\n\nconst OSSFilePreview = withOSSFile(\n ({ data, id, staticUrl: staticUrlProps, className, ...props }) => {\n const { staticUrl: staticUrlBase } = usePreset();\n const staticUrl = staticUrlProps || staticUrlBase || \"\";\n const PreviewComponent = typeFormatComponent(data);\n if (typeFormat(data) === \"office\") {\n return <OfficePreview {...props} id={id} className={className} />;\n }\n return (\n <PreviewComponent\n {...props}\n className={className}\n url={/^https?:\\/\\//.test(data) ? data : staticUrl + data}\n />\n );\n }\n);\n\nexport default OSSFilePreview;\n","import typeFormat from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\nimport OSSFilePreview from \"./OSSFilePreview\";\n\nconst FilePreview = ({ id, originName, ...props }) => {\n if (typeFormat(originName) === \"office\") {\n return <OfficePreview {...props} id={id} originName={originName} />;\n }\n return <OSSFilePreview {...props} id={id} originName={originName} />;\n};\n\nexport default FilePreview;\n"],"names":["isCrossDomain","url","test","currentURL","URL","window","location","href","targetURL","some","name","HtmlInnerPreview","createWithFetch","transformResponse","_ref","data","code","results","_ref2","ref","useRef","useEffect","domDocument","DOMParser","parseFromString","querySelectorAll","forEach","el","parentElement","removeChild","scriptPath","getPublicPath","script","document","createElement","src","head","appendChild","style","innerText","current","srcdoc","documentElement","outerHTML","iFrameResize","checkOrigin","_jsx","title","frameBorder","width","_ref3","className","maxWidth","classnames","children","OfficePreviewInner","cache","props","fileList","map","type","PreviewComponent","typeComponentMapping","typeFormatComponent","_createElement","key","id","apis","propsApis","baseApis","staticUrl","ajax","usePreset","Object","assign","previewOffice","loader","async","_apis$oss","_ref4","resData","oss","replace","concat","encodeURIComponent","PdfPreview","memo","scale","rotate","numPages","setNumPages","useState","pdfjs","GlobalWorkerOptions","workerSrc","setWidth","useResize","clientWidth","Math","min","Document","file","options","standardFontDataUrl","cMapUrl","cMapPacked","error","loading","Spin","noData","onLoadSuccess","onLoadError","onSourceError","Space","direction","Array","from","index","Page","pageNumber","renderAnnotationLayer","renderTextLayer","defaultProps","autoSize","text","setText","setLoading","setError","axios","then","_jsxs","TextEscape","Result","status","subTitle","image","Image","handlerLoad","handlerError","addEventListener","removeEventListener","alt","typeFormat","_path","split","toLowerCase","txt","TextPreview","pdf","ImagePreview","html","HtmlPreview","office","OfficePreview","unknown","UnknownPreview","withOSSFile","staticUrlProps","staticUrlBase","originName","OSSFilePreview"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"static/js/3333.26eda487.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4BAA1gB,EAA0pB,0C,0B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,EACRC,QAASC,GAGE5F,EAAuB9D,GAC3B6D,EAAqBgF,EAAW7I,ICnCzC,MAkBA,GAlBuB2J,E,SAAAA,IACrB9I,IAAmE,IAAlE,KAAEC,EAAI,GAAEmD,EAAII,UAAWuF,EAAc,UAAE1G,KAAcM,GAAO3C,EAC3D,MAAQwD,UAAWwF,IAAkBtF,EAAAA,EAAAA,aAC/BF,EAAYuF,GAAkBC,GAAiB,GAC/CjG,EAAmBE,EAAoBhD,GAC7C,MAAyB,WAArB+H,EAAW/H,IACN+B,EAAAA,EAAAA,KAAC2G,EAAa,IAAKhG,EAAOS,GAAIA,EAAIf,UAAWA,KAGpDL,EAAAA,EAAAA,KAACe,EAAgB,IACXJ,EACJN,UAAWA,EACXlD,IAAK,eAAeC,KAAKa,GAAQA,EAAOuD,EAAYvD,GACpD,ICPR,EAPoBD,IAAmC,IAAlC,GAAEoD,EAAE,WAAE6F,KAAetG,GAAO3C,EAC/C,MAA+B,WAA3BgI,EAAWiB,IACNjH,EAAAA,EAAAA,KAAC2G,EAAa,IAAKhG,EAAOS,GAAIA,EAAI6F,WAAYA,KAEhDjH,EAAAA,EAAAA,KAACkH,EAAc,IAAKvG,EAAOS,GAAIA,EAAI6F,WAAYA,GAAc,C","sources":["webpack://@kne-components/components-core/./src/components/FilePreview/style.module.scss?a805","components/FilePreview/HtmlPreview.js","components/FilePreview/OfficePreview.js","components/FilePreview/PdfPreview.js","components/FilePreview/TextPreview.js","components/FilePreview/UnknownPreview.js","components/FilePreview/ImagePreview.js","components/FilePreview/typeFormat.js","components/FilePreview/OSSFilePreview.js","components/FilePreview/FilePreview.js"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport default {\"container\":\"style_container__9Fu-3__+Svgs\",\"container-html\":\"style_container-html__IsNVq__+Svgs\",\"html-inner\":\"style_html-inner__S05cI__+Svgs\",\"loading\":\"style_loading__r3aiE__+Svgs\",\"control-bar\":\"style_control-bar__kTKau__+Svgs\",\"scroller\":\"style_scroller__HOq7b__+Svgs\",\"outer\":\"style_outer__ntu--__+Svgs\",\"file-name\":\"style_file-name__UPbbe__+Svgs\",\"file-options\":\"style_file-options__5TE5l__+Svgs\",\"scale-input\":\"style_scale-input__JdF1K__+Svgs\",\"text-outer\":\"style_text-outer__TzhuG__+Svgs\",\"error\":\"style_error__wSaxt__+Svgs\",\"text-inner\":\"style_text-inner__jdi-A__+Svgs\",\"image-inner\":\"style_image-inner__zTiFU__+Svgs\",\"html-preview-iframe\":\"style_html-preview-iframe__bQQiA__+Svgs\"};","import iFrameResize from \"iframe-resizer\";\nimport { useEffect, useRef } from \"react\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\nimport style from \"./style.module.scss\";\nimport { createWithFetch } from \"@kne/react-fetch\";\n\nconst isCrossDomain = (url) => {\n if (!/^http?s:\\/\\//.test(url)) {\n return false;\n }\n const currentURL = new URL(window.location.href);\n const targetURL = new URL(url);\n return [\"protocol\", \"hostname\", \"port\"].some(\n (name) => currentURL[name] !== targetURL[name]\n );\n};\n\nconst HtmlInnerPreview = createWithFetch({\n transformResponse: ({ data }) => {\n return {\n data: {\n code: 200,\n results: data,\n },\n };\n },\n})(({ data }) => {\n const ref = useRef(null);\n useEffect(() => {\n const parser = new DOMParser();\n const domDocument = parser.parseFromString(data, \"text/html\");\n domDocument.querySelectorAll(\"script\").forEach((el) => {\n el.parentElement.removeChild(el);\n });\n const scriptPath =\n getPublicPath(\"components-core\") + \"/iframeResizer.contentWindow.js\";\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n domDocument.head.appendChild(script);\n const style = document.createElement(\"style\");\n style.innerText =\n \"html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}\";\n domDocument.head.appendChild(style);\n ref.current.srcdoc = domDocument.documentElement.outerHTML;\n }, [data]);\n useEffect(() => {\n iFrameResize.iframeResize({ checkOrigin: false }, ref.current);\n }, []);\n return <iframe title=\"文件预览\" frameBorder=\"0\" width=\"100%\" ref={ref} />;\n});\n\nconst HtmlPreview = ({ className, url, maxWidth }) => {\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {isCrossDomain(url) ? (\n <iframe\n title=\"文件预览\"\n src={url}\n frameBorder=\"0\"\n width=\"100%\"\n className={style[\"html-preview-iframe\"]}\n />\n ) : (\n <HtmlInnerPreview url={url} />\n )}\n </div>\n );\n};\n\nexport default HtmlPreview;\n","import { usePreset } from \"@components/Global\";\nimport { createWithFetch } from \"@kne/react-fetch\";\nimport { typeFormatComponent, typeComponentMapping } from \"./typeFormat\";\n\nconst OfficePreviewInner = createWithFetch({\n cache: \"office-preview\",\n})(({ data, className, ...props }) => {\n const { data: fileList } = data;\n return fileList.map(({ url, type }) => {\n const PreviewComponent =\n typeComponentMapping[type] || typeFormatComponent(url);\n return (\n <PreviewComponent {...props} url={url} key={url} className={className} />\n );\n });\n});\n\nconst OfficePreview = ({ id, apis: propsApis, className, ...props }) => {\n const { apis: baseApis, staticUrl, ajax } = usePreset();\n const apis = Object.assign({}, baseApis, propsApis);\n return (\n <OfficePreviewInner\n {...props}\n {...(apis.previewOffice || {\n loader: async ({ data }) => {\n const { data: resData } = await ajax(\n Object.assign(\n {},\n apis.oss,\n apis.oss?.url\n ? {\n url: (apis.oss.url || \"\").replace(\"{id}\", data.id),\n }\n : {}\n )\n );\n return {\n data: [\n {\n url: `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(\n (staticUrl || \"\") + resData\n )}&wdPrint=0&wdEmbedCode=0`,\n type: \"html\",\n },\n ],\n };\n },\n })}\n data={{ id }}\n className={className}\n />\n );\n};\n\nexport default OfficePreview;\n","import { memo, useState } from \"react\";\nimport { Space, Spin } from \"antd\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport \"react-pdf/dist/esm/Page/TextLayer.css\";\nimport style from \"./style.module.scss\";\nimport { useResize } from \"@components/Common\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\n\nconst PdfPreview = memo(({ url, maxWidth, scale, rotate, className }) => {\n const [numPages, setNumPages] = useState(0);\n pdfjs.GlobalWorkerOptions.workerSrc =\n getPublicPath(\"components-core\") + \"/pdfjs/build/pdf.worker.js\";\n const [width, setWidth] = useState(maxWidth);\n const ref = useResize(() => {\n if (ref.current && ref.current.clientWidth) {\n setWidth(Math.min(ref.current.clientWidth, maxWidth));\n }\n });\n\n return (\n <div\n ref={ref}\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth: maxWidth,\n }}\n >\n <Document\n file={{ url }}\n options={{\n standardFontDataUrl:\n getPublicPath(\"components-core\") + \"/pdfjs/standard_fonts/\",\n cMapUrl: getPublicPath(\"components-core\") + \"/pdfjs/cmaps/\",\n cMapPacked: true,\n }}\n error=\"PDF文件加载失败\"\n loading={\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n }\n noData=\"未指定PDF文件\"\n onLoadSuccess={({ numPages }) => {\n setNumPages(numPages);\n //console.log(\"onLoadSuccess\");\n }}\n onLoadError={(props) => {\n //console.log(\"onLoadError\", props);\n }}\n onSourceError={(props) => {\n //console.log(\"onSourceError\", props);\n }}\n >\n <Space direction=\"vertical\">\n {numPages >= 1 &&\n Array.from(new Array(numPages), (el, index) => (\n <Page\n key={`page_${index}`}\n className=\"preview-item\"\n scale={scale / 100}\n rotate={rotate}\n pageNumber={index + 1}\n width={width}\n loading={null}\n renderAnnotationLayer={false}\n renderTextLayer={true}\n noData=\"未指定页面\"\n />\n ))}\n </Space>\n </Document>\n </div>\n );\n});\n\nPdfPreview.defaultProps = {\n autoSize: true,\n renderTextLayer: false,\n scale: 100,\n rotate: 0,\n maxWidth: 1200,\n};\n\nexport default PdfPreview;\n","import { useState, useEffect } from \"react\";\nimport TextEscape from \"@kne/react-text-escape\";\nimport axios from \"axios\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst TextPreview = ({ url, className, maxWidth }) => {\n const [text, setText] = useState(\"\");\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n axios.get(url).then(\n ({ data }) => {\n setText(data);\n setLoading(false);\n },\n () => {\n setLoading(false);\n setError(true);\n }\n );\n }, [url]);\n\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n <div className={style[\"text-outer\"]}>\n {error ? (\n <div className={style[\"error\"]}>文件加载失败</div>\n ) : (\n <TextEscape text={text} />\n )}\n </div>\n </div>\n );\n};\n\nexport default TextPreview;\n","import { Result } from \"antd\";\nimport style from \"./style.module.scss\";\n\nconst UnknownPreview = ({ maxWidth }) => {\n return (\n <div\n className={style[\"container\"]}\n style={{\n maxWidth,\n }}\n >\n <div className={style[\"text-outer\"]}>\n <Result\n status=\"500\"\n title=\"不支持的文件类型\"\n subTitle=\"系统不支持该文件类型预览,请下载到本地后进行预览\"\n />\n </div>\n </div>\n );\n};\n\nexport default UnknownPreview;\n","import { useEffect, useState } from \"react\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst ImagePreview = ({ url, scale, rotate, className, maxWidth }) => {\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n const image = new Image();\n image.src = url;\n const handlerLoad = () => {\n setLoading(false);\n };\n\n const handlerError = () => {\n setLoading(false);\n setError(true);\n };\n\n image.addEventListener(\"load\", handlerLoad);\n image.addEventListener(\"error\", handlerError);\n return () => {\n image.removeEventListener(\"load\", handlerLoad);\n image.removeEventListener(\"error\", handlerError);\n };\n }, [url, scale, rotate]);\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n {error ? (\n <div className={style[\"error\"]}>图片加载失败</div>\n ) : (\n <img src={url} alt=\"简历预览\" />\n )}\n </div>\n );\n};\n\nexport default ImagePreview;\n","import HtmlPreview from \"./HtmlPreview\";\nimport OfficePreview from \"./OfficePreview\";\nimport PdfPreview from \"./PdfPreview\";\nimport TextPreview from \"./TextPreview\";\nimport UnknownPreview from \"./UnknownPreview\";\nimport ImagePreview from \"./ImagePreview\";\n\nconst typeFormat = (url) => {\n const path = (url || \"\").split(\"?\")[0];\n const _path = path.toLowerCase();\n if (/.txt$/.test(_path)) {\n return \"txt\";\n }\n if (/.pdf$/.test(_path)) {\n return \"pdf\";\n }\n if (/.(png|jpg|jpeg)$/.test(_path)) {\n return \"image\";\n }\n if (/.(html|htm)$/.test(_path)) {\n return \"html\";\n }\n if (/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(_path)) {\n return \"office\";\n }\n return \"unknown\";\n};\n\nexport default typeFormat;\n\nexport const typeComponentMapping = {\n txt: TextPreview,\n pdf: PdfPreview,\n image: ImagePreview,\n html: HtmlPreview,\n office: OfficePreview,\n unknown: UnknownPreview,\n};\n\nexport const typeFormatComponent = (url) => {\n return typeComponentMapping[typeFormat(url)];\n};\n","import withOSSFile from \"@common/hocs/withOSSFile\";\nimport typeFormat, { typeFormatComponent } from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\nimport { usePreset } from \"@components/Global\";\n\nconst OSSFilePreview = withOSSFile(\n ({ data, id, staticUrl: staticUrlProps, className, ...props }) => {\n const { staticUrl: staticUrlBase } = usePreset();\n const staticUrl = staticUrlProps || staticUrlBase || \"\";\n const PreviewComponent = typeFormatComponent(data);\n if (typeFormat(data) === \"office\") {\n return <OfficePreview {...props} id={id} className={className} />;\n }\n return (\n <PreviewComponent\n {...props}\n className={className}\n url={/^https?:\\/\\//.test(data) ? data : staticUrl + data}\n />\n );\n }\n);\n\nexport default OSSFilePreview;\n","import typeFormat from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\nimport OSSFilePreview from \"./OSSFilePreview\";\n\nconst FilePreview = ({ id, originName, ...props }) => {\n if (typeFormat(originName) === \"office\") {\n return <OfficePreview {...props} id={id} originName={originName} />;\n }\n return <OSSFilePreview {...props} id={id} originName={originName} />;\n};\n\nexport default FilePreview;\n"],"names":["isCrossDomain","url","test","currentURL","URL","window","location","href","targetURL","some","name","HtmlInnerPreview","createWithFetch","transformResponse","_ref","data","code","results","_ref2","ref","useRef","useEffect","domDocument","DOMParser","parseFromString","querySelectorAll","forEach","el","parentElement","removeChild","scriptPath","getPublicPath","script","document","createElement","src","head","appendChild","style","innerText","current","srcdoc","documentElement","outerHTML","iFrameResize","checkOrigin","_jsx","title","frameBorder","width","_ref3","className","maxWidth","classnames","children","OfficePreviewInner","cache","props","fileList","map","type","PreviewComponent","typeComponentMapping","typeFormatComponent","_createElement","key","id","apis","propsApis","baseApis","staticUrl","ajax","usePreset","Object","assign","previewOffice","loader","async","_apis$oss","_ref4","resData","oss","replace","concat","encodeURIComponent","PdfPreview","memo","scale","rotate","numPages","setNumPages","useState","pdfjs","GlobalWorkerOptions","workerSrc","setWidth","useResize","clientWidth","Math","min","Document","file","options","standardFontDataUrl","cMapUrl","cMapPacked","error","loading","Spin","noData","onLoadSuccess","onLoadError","onSourceError","Space","direction","Array","from","index","Page","pageNumber","renderAnnotationLayer","renderTextLayer","defaultProps","autoSize","text","setText","setLoading","setError","axios","then","_jsxs","TextEscape","Result","status","subTitle","image","Image","handlerLoad","handlerError","addEventListener","removeEventListener","alt","typeFormat","_path","split","toLowerCase","txt","TextPreview","pdf","ImagePreview","html","HtmlPreview","office","OfficePreview","unknown","UnknownPreview","withOSSFile","staticUrlProps","staticUrlBase","originName","OSSFilePreview"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[36],{18411:(e,t,s)=>{s.d(t,{A:()=>n});s(73884);const n=s.p+"static/media/defaultAvatar.b1f2a8046cc7bee36d9a404ce6a0a1d7.svg"},93761:(e,t,s)=>{s.d(t,{qn:()=>R,TM:()=>G,LH:()=>L,Ay:()=>E,NY:()=>k,DF:()=>D});var n=s(30509),a=s(25438),l=s(55199),r=s(27047),o=s(83136),i=s.n(o),c=s(64671),d=s(73884),u=s(21485),p=s(56434),m=s.n(p),h=s(15797),g=s.n(h),_=s(33097),v=s.n(_);const f="style_address__DIuRX__+Svgs",x="style_is-popup__tqVvp__+Svgs",y="style_title__FAe12__+Svgs",S="style_scroll-box__JWiDl__+Svgs",C="style_scroll-plus-box__lidEW__+Svgs",j="style_content__lAARZ__+Svgs",b="style_col-left__WPfeS__+Svgs",A="style_col-right__z0e9-__+Svgs";var N=s(87558);const w=e=>({"en-US":()=>s.e(3691).then(s.bind(s,83691)),"zh-CN":()=>s.e(2253).then(s.bind(s,32253))}[e]());var O=s(58609),P=s(70579);const I=n.A.useContext,L=e=>{let{city:t,province:s,country:n}=e;const a=g()((()=>{const e=[];return["gangaotai","municipality"].forEach((s=>{e.push(...t.relations[s])})),["provinces","continents"].forEach((s=>{t.relations[s].forEach((s=>{e.push(s),e.push(...t.relations[s])}))})),e.map((e=>t.list[e]))}));return{getCity:g()((e=>{const s=t.list[e];return s?{city:s,parent:s.parentCode?t.list[s.parentCode]:null}:{city:null,parent:null}})),getChinaHotCities:g()((()=>t.relations[2].map((e=>t.list[e])))),getChinaCities:g()((()=>["2",...s.relations.municipality,...s.relations.provinces,"gangaotai"].map((e=>Object.assign({id:e},t.list[e]))))),getCountries:g()((()=>["1",...n.relations.continents].map((e=>Object.assign({id:e},n.list[e]))))),getList:g()(((e,a)=>{const{showChinaQuan:l,showForeignQuan:r}=Object.assign({},a);if("gangaotai"===e)return s.relations.gangaotai.map((e=>t.list[e]));const o=Object.assign({},t.list[e]);if(s.relations.municipality.indexOf(e)>-1)return o.name="".concat(l?"\u5168":"")+o.name,[o];const i=t.relations[e].map((e=>t.list[e]));return s.relations.provinces.indexOf(e)>-1&&l&&(o.name="\u5168"+o.name,i.splice(0,0,o)),n.relations.continents.indexOf(e)>-1&&r&&(o.name="\u5168"+o.name,i.splice(0,0,o)),i})),getNationalityList:g()((e=>{let s=m()(t);return"1"===e&&s.relations[1].unshift("410"),"350"===e&&s.relations[350].unshift("410"),s.relations[e].filter((e=>s.list[e])).map((e=>s.list[e]))})),getCityByName:g()((e=>{const t=a();let s;return[t=>t.name===e,t=>t.name===e.replace(/(\u7701|\u5e02)$/,""),t=>0===e.indexOf(t.name)].find((e=>(s=t.find(e),s))),s})),combineCities:g()(((e,s)=>[...s.filter((s=>t.list[s].parentCode!==e&&t.list[e].parentCode!==s&&e!==s)),e])),searchCities:g()((e=>{if(!e)return[];return a().filter((t=>["pinyin","name","enName","spelling"].some((s=>t[s].toUpperCase().indexOf(e.toUpperCase())>-1)))).map((e=>{const s=e.parentCode?t.list[e.parentCode]:null;return{label:s?"".concat(s.name,"\xb7").concat(e.name):e.name,value:e.code}}))}))}},k=(e,t)=>"en-US"===t?v()(e,"enName"):v()(e,"name"),M={cache:"CITY_DATA",isLocal:!0,ttl:864e5,loader:()=>s.e(7820).then(s.t.bind(s,37820,19)).then((e=>e.__esModule?e.default:e))},F=e=>{let{value:t,setValue:s}=e;const{fetchApi:n,props:o}=I(),[p,m]=(0,d.useState)(""),[h,g]=(0,d.useState)("2"),{formatMessage:_}=(0,O.useIntl)({moduleName:"AddressSelect"}),{locale:v}=(0,r.A)(),{getCity:N,getChinaCities:w,getCountries:M,getList:F,searchCities:T}=(0,d.useMemo)((()=>L(n.data)),[n.data]),R=e=>{if(o.single)return void s([e]);const n=t.slice(0),a=n.indexOf(e);a>-1?n.splice(a,1):n.push(e),s(n)},D=p&&(0,P.jsx)(u.A,{className:C,children:(0,P.jsx)(l.List,{className:a.A.list,size:"small",dataSource:T(p),rowKey:"value",renderItem:e=>(0,P.jsx)(l.List.Item,{className:a.A["list-item"],onClick:()=>{R(e.value),m("")},children:(0,P.jsx)("span",{className:a.A["item-label"],children:e.label})})})});return(0,P.jsxs)("div",{className:i()(f,{[x]:o.isPopup}),children:[(0,P.jsx)(l.Input.Search,{className:i()(a.A["search-input"],{[a.A["is-popup"]]:o.isPopup}),placeholder:o.searchPlaceholder||_({id:"searchCity"}),prefix:(0,P.jsx)(c.default,{type:"icon-sousuo"}),enterButton:(0,P.jsx)(c.default,{type:"icon-sousuo"}),value:p,allowClear:!0,onChange:e=>{const t=e.target.value;m(t)},onSearch:e=>{m(e)}}),(0,P.jsx)("div",{className:j,children:D||(0,P.jsxs)(l.Row,{wrap:!1,children:[(0,P.jsx)(l.Col,{className:b,children:(0,P.jsx)(l.Tabs,{centered:!0,onChange:e=>{g(e)},items:[{key:"2",label:(0,P.jsx)(O.FormattedMessage,{id:"domestic",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5185"}),children:(0,P.jsx)(u.A,{className:S,children:(0,P.jsx)(l.Menu,{selectedKeys:[h],onSelect:e=>{g(e.key)},items:w().map((e=>({label:k(e,v),key:e.id})))})})},{key:"1",label:(0,P.jsx)(O.FormattedMessage,{id:"abroad",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5916"}),children:(0,P.jsx)(u.A,{className:S,children:(0,P.jsx)(l.Menu,{selectedKeys:[h],onSelect:e=>{g(e.key)},items:M().map((e=>({label:k(e,v),key:e.id})))})})}]})}),(0,P.jsxs)(l.Col,{flex:1,className:A,children:[(0,P.jsx)(l.Divider,{className:y,orientation:"left",children:k(N(h).city,v)}),(0,P.jsx)(u.A,{className:S,children:(0,P.jsx)(l.Space,{wrap:!0,children:F(h,{showChinaQuan:o.showChinaQuan,showForeignQuan:o.showForeignQuan}).map((e=>(0,P.jsx)(l.Tag.CheckableTag,{checked:t.indexOf(e.code)>-1,onChange:()=>{R(e.code)},children:k(e,v)},e.code)))})})]})]})})]})},T=e=>(0,P.jsx)(n.A,{...e,children:e=>{let{value:t,setValue:s}=e;return(0,P.jsx)(O.IntlProvider,{moduleName:"AddressSelect",importMessages:w,children:(0,P.jsx)(F,{value:t,setValue:s})})}});T.defaultProps={overlayWidth:"500px",isPopup:!0,api:M,dataFormat:(e,t)=>{let{city:s}=e;const{locale:n}=Object.assign({},t);return{list:Object.values(s.list).map((e=>Object.assign({},e,{value:e.code,label:k(e,n)})))}}};const R=(0,N.withFetch)((e=>{let{name:t,data:s,getAddressApi:n,children:a,...l}=e;const{locale:o}=(0,r.A)(),i=(0,d.useMemo)((()=>L(s)),[s]);return n?a(i):a(i.getCity(t),Object.assign({},l,{locale:o}))}));R.defaultProps={...M,displayParent:!1,children:(e,t)=>{let{city:s,parent:n}=e,{displayParent:a,locale:l}=t;return a&&n?"".concat(k(n,l),"\xb7").concat(k(s,l)):k(s,l)}};const D=e=>{const t=(0,N.withFetch)((t=>{let{data:s,...n}=t;const a=(0,d.useMemo)((()=>L(s)),[s]);return(0,P.jsx)(e,{...n,addressApi:a})}));return t.defaultProps={...M},t};T.AddressEnum=T.Enum=R,T.createAddressApi=L,T.withAddressApi=D,T.getLabelForLocal=k;const E=T;var z=s(10986),V=s.n(z),W=s(78491),U=s.n(W),B=s(20492),K=s(22616),q=s.n(K),H=s(1488),Q=s.n(H);const Z=e=>{const{isPopup:t,size:s,disabled:n,inputPlaceholder:a,onBlur:r,className:o,...i}=e,[c,d]=V()(e),u=["isPopup","searchPlaceholder","placeholder","overlayWidth","api","dataFormat"],{formatMessage:p}=(0,O.useIntl)({moduleName:"Common"}),m=U()((e=>{r&&r(e)}));return(0,P.jsx)("div",{ref:m,children:(0,P.jsxs)(l.Row,{gutter:10,children:[(0,P.jsx)(l.Col,{span:12,children:(0,P.jsx)(E,{...q()(i,u),className:o,disabled:n,single:!0,size:s,value:v()(c,"city"),onChange:e=>{d({city:e,detail:v()(c,"detail")})}})}),(0,P.jsx)(l.Col,{span:12,children:(0,P.jsx)(l.Input,{...Q()(i,u),className:o,placeholder:a||p({id:"pleaseInput"}),disabled:n,size:s,value:v()(c,"detail"),onChange:e=>{d({city:v()(c,"city"),detail:e.target.value})}})})]})})};Z.defaultProps={};const G=(0,O.createWithIntl)({importMessages:B.A,moduleName:"Common"})(Z)},12392:(e,t,s)=>{s.d(t,{Bm:()=>W,Eo:()=>z,NR:()=>b,Ay:()=>U});var n=s(55199),a=s(83136),l=s.n(a),r=s(30509),o=s(25438),i=s(26475),c=s(33097),d=s.n(c),u=s(34677),p=s.n(u);const m="create-list_scroll-loader__zoaS7__+Svgs",h="create-list_is-popup__t3d-G__+Svgs",g="create-list_is-not-full__FXtX1__+Svgs",_="create-list_search-input__tV3vf__+Svgs",v="create-list_left__EXr3i__+Svgs",f="create-list_list-header__3xeJa__+Svgs",x="create-list_is-modal__BMfya__+Svgs";var y=s(73161),S=s(58609),C=s(70579);const j=r.A.useContext,b=e=>{let{renderList:t,defaultProps:s}=e;const a=e=>{let{value:s,setValue:a}=e;const{fetchApi:r,searchText:c,setSearchText:u,props:b,mapping:A}=j(),N=Object.assign({},{paramsType:"data",current:"currentPage",pageSizeName:"perPage",pageSize:20},b.pagination),w=d()(r.requestParams,[N.paramsType,N.current],1),O=d()(r.requestParams,[N.paramsType,N.pageSizeName])||N.pageSize,{formatMessage:P}=(0,S.useIntl)({moduleName:"Common"}),I=b.dataFormat(r.data),{right:L,leftBottom:k,leftSpan:M=24}=b,F=1===s.length&&"all"===s[0];return(0,C.jsxs)(n.Row,{wrap:!1,className:L?l()("is-not-full",g):"",children:[(0,C.jsxs)(n.Col,{span:M,className:l()(v,"advance-select-left"),children:[b.getSearchProps?(0,C.jsx)(y.A,{isPopup:b.isPopup,className:l()(_,o.A["search-input"],{[o.A["is-popup"]]:b.isPopup}),placeholder:b.searchPlaceholder||P({id:"search"}),value:c,onSearch:e=>{r.reload(b.getSearchProps(e)),u(e)}}):null,b.single||!b.showSelectedCount&&!b.allowSelectAll?null:(0,C.jsxs)(n.Flex,{className:l()(f,{[x]:!b.isPopup}),justify:"space-between",children:[b.showSelectedCount?(0,C.jsxs)(n.Space,{children:[(0,C.jsx)(n.Typography,{children:"\u5df2\u9009:"}),(0,C.jsx)(n.Typography.Link,{children:F?b.allLabel||(0,C.jsx)(S.FormattedMessage,{id:"all",moduleName:"Common"}):"".concat(s.length).concat(b.countUnit||P({id:"items"}))})]}):(0,C.jsx)("div",{}),b.allowSelectAll?(0,C.jsx)("div",{children:(0,C.jsx)(n.Checkbox,{checked:F,onChange:e=>{a(e.target.checked?[b.allValue||"all"]:[])},children:(0,C.jsx)(S.FormattedMessage,{id:"selectAll",moduleName:"Common",values:{label:b.allLabel||(0,C.jsx)(S.FormattedMessage,{id:"all",moduleName:"Common"})}})})}):(0,C.jsx)("div",{})]}),(0,C.jsx)(i.A,{completeTips:"",isLoading:!r.isComplete,className:l()(m,{[h]:b.isPopup}),noMore:!I.total||w*O>=I.total,onLoader:async()=>{console.log("on loader"),await r.loadMore(p()({[N.paramsType]:{[N.pageSizeName]:O,[N.current]:w+1}},b.getSearchProps&&b.getSearchProps(c)),b.mergeList)},children:t({props:b,value:s,setValue:a,list:I.list,itemIsSelected:e=>s.indexOf(e.value)>-1,isSelectedAll:F,onSelect:e=>{if(b.single)return void a([e.value]);const t=s.slice(0),n=t.indexOf(e.value);n>-1?t.splice(n,1):t.push(e.value),a(t)}})}),k&&k({fetchApi:r,value:s,mapping:A})]}),L&&L({value:s,mapping:A,fetchApi:r})]})},c=e=>{let{extra:t,...s}=e;return(0,C.jsx)(r.A,{...s,extra:t,children:e=>{let{value:t,setValue:s}=e;return(0,C.jsx)(a,{value:t,setValue:s})}})};return c.defaultProps=Object.assign({},{isPopup:!0,pagination:{},mergeList:(e,t)=>Object.assign({},t,{pageData:e.pageData.concat(t.pageData)}),dataFormat:e=>({list:e.pageData,total:e.totalCount})},s),c},A="list_list__TGynD__+Svgs",N="list_list-item__WSswf__+Svgs",w="list_is-selected__6Wkgt__+Svgs",O="list_item-label__bYzhe__+Svgs",P="list_item-des__2nsEn__+Svgs",I="list_is-disabled__qxCvO__+Svgs",L="list_is-selected-all__Mp-hG__+Svgs";var k=s(40438),M=s(64671);const F="user_list-inner__V508e__+Svgs",T="user_list-info__y2nWo__+Svgs",R="user_selected-icon__9OQJL__+Svgs",D="user_item-des__o+7UR__+Svgs",E="user_is-selected-all__2q0VZ__+Svgs",z=b({renderList:e=>{let{list:t,onSelect:s,itemIsSelected:a,isSelectedAll:r}=e;return(0,C.jsx)(n.List,{size:"small",className:l()(A,{[L]:r,[E]:r}),dataSource:t,renderItem:e=>{const t=a(e);return(0,C.jsx)(n.List.Item,{className:l()(N,{[w]:t}),onClick:()=>s(e),children:(0,C.jsxs)(n.Row,{wrap:!1,align:"middle",className:F,children:[(0,C.jsx)(n.Col,{children:(0,C.jsx)(k.default.Avatar,{...Object.assign({},e.avatar),size:40,gender:"M"})}),(0,C.jsx)(n.Col,{className:T,flex:1,children:(0,C.jsxs)(n.Space,{direction:"vertical",children:[(0,C.jsx)("span",{className:O,children:e.label}),e.description&&(0,C.jsx)("span",{className:D,children:e.description})]})}),(0,C.jsx)(n.Col,{children:r||t?(0,C.jsx)(M.default,{className:R,type:"icon-gouxuan"}):null})]})})}})}}),V={"is-selected-all":"table_is-selected-all__IwXUY__+Svgs"},W=b({defaultProps:{overlayWidth:"450px"},renderList:e=>{let{props:t,list:s,onSelect:a,value:r,setValue:o,itemIsSelected:i,isSelectedAll:c}=e;return(0,C.jsx)(n.Table,{className:l()(V.list,A,{[L]:c,[V["is-selected-all"]]:c}),size:"small",dataSource:s,columns:t.columns,rowClassName:e=>l()({"ant-table-row-selected":i(e)}),rowKey:t.rowKey||"value",pagination:!1,rowSelection:t.single?null:c?{selectedRowKeys:s.map((e=>{let{value:t}=e;return t})),getCheckboxProps:()=>({disabled:!0})}:{selectedRowKeys:r,onChange:e=>{o(e)}},sticky:!0,onRow:e=>({onClick:()=>a(e)})})}}),U=b({renderList:e=>{let{props:t,list:s,itemIsSelected:a,isSelectedAll:r,onSelect:o}=e;const{listClassName:i="",selectIcon:c=null}=t||{};return(0,C.jsx)(n.List,{className:l()(A,i,{[L]:r}),size:"small",dataSource:s,renderItem:e=>{var s;const i=a(e);return(0,C.jsxs)(n.List.Item,{className:l()(N,{[w]:t.single&&i,[I]:r||e.disabled}),onClick:()=>{e.disabled||o(e)},children:[(0,C.jsxs)(n.Row,{wrap:!1,children:[t.single?null:(0,C.jsx)(n.Col,{children:(0,C.jsx)(n.Checkbox,{checked:r||i,disabled:r||e.disabled})}),(0,C.jsx)(n.Col,{children:(0,C.jsxs)(n.Space,{className:null!==(s=null===e||void 0===e?void 0:e.className)&&void 0!==s?s:"",children:[(0,C.jsx)("span",{className:O,children:e.label}),e.description&&(0,C.jsx)("span",{className:P,children:e.description})]})})]}),i&&c]})}})}})},45776:(e,t,s)=>{s.d(t,{yK:()=>L,ON:()=>h,Ay:()=>R});var n=s(30509),a=s(73884),l=s(96418),r=s.n(l),o=s(55199),i=s(64671),c=s(73161),d=s(33097),u=s.n(d),p=s(79686),m=s.n(p);const h=e=>{const t=Array.from(e.values()),s=t.filter((e=>null===e.parentId)),n=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},a=t=>{const s=[],n=t=>{const a=e.get(t);a&&Array.isArray(a.children)&&a.children.length>0&&(s.push(...a.children),a.children.forEach((e=>{n(e.id)})))};return n(t),s},l=(t,s)=>{const n=t=>{const a=e.get(t);return a?s(a)?a:m()(a.parentId)?null:n(a.parentId):null};return n(t)},r=t=>{const n=e.get(t);if(!n)return[];const a=n.parentId;if(m()(a))return s;return e.get(a).children},o=(()=>{const e=s=>Array.isArray(s)&&s.length>0?s.map((s=>{const n=t.filter((e=>e.parentId===s.id));return Object.assign({},s,{children:e(n)})})):null;return e(s)})();return{mapping:e,getSelectedQueue:t=>{const s=e.get(t);if(!s)return[];const n=e=>{if(e.children&&e.children.length>0)return n(e.children.find((t=>t.children&&e.children.length>0))||u()(e.children,"0"));const t=a(e.parentId).find((e=>e.children&&e.children.length>0));return t?n(t):e},l=function(t){const s=[t,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]],n=e.get(t);return!n||m()(n.parentId)?s:l(n.parentId,s)},r=n(s);return l(u()(r,"id"))},getAllChildren:a,computedCheckboxStatus:function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(l(t,(e=>s.indexOf(e.id)>-1)))return{checked:!0,indeterminate:!1};const n=(t=>{const n=t=>{const a=e.get(t);return a?(l=a,s.indexOf(l.id)>-1?a:Array.isArray(a.children)&&a.children.length>0?a.children.find((e=>!!n(e.id))):void 0):null;var l};return!!n(t)})(t);return n?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1}},getSiblingNode:r,findInParents:l,setNodeChecked:function(t){const s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),l=t=>{const o=e.get(t);if(!o)return;s.push(t),a(t).forEach((e=>{n(s,e.id)}));const i=r(t),c=i.every((e=>s.indexOf(e.id)>-1));o.parentId&&c&&(i.forEach((e=>{n(s,e.id)})),l(o.parentId))};return l(t),s},setNodeUnchecked:function(t){const s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),a=t=>{const l=e.get(t);if(!l)return;if(s.indexOf(l.id)>-1)return void n(s,l.id);const o=r(t);l.parentId&&(o.forEach((e=>{t!==e.id&&s.push(e.id)})),a(l.parentId))};return a(t),s},treeData:o,treeMapping:new Map(o.map((e=>[e.id,e])))}};var g=s(74065),_=s.n(g),v=s(19853),f=s.n(v),x=s(17342),y=s(83136),S=s.n(y);const C={content:"style_content__Hxlt9__+Svgs",columns:"style_columns__FmtPF__+Svgs","content-item":"style_content-item__i6HCO__+Svgs","last-level-area":"style_last-level-area__2y7jQ__+Svgs","is-popup":"style_is-popup__+r3Mn__+Svgs",menu:"style_menu__WZUVE__+Svgs","scroll-plus-box":"style_scroll-plus-box__QcTst__+Svgs","menu-label":"style_menu-label__iGt0Z__+Svgs","menu-item":"style_menu-item__hXHfm__+Svgs","checkbox-hidden":"style_checkbox-hidden__Xpx7J__+Svgs",loading:"style_loading__ZwrVe__+Svgs"};var j=s(87558),b=s(58609),A=s(25438),N=s(70579),w=s(27047);const O=new Map,P=(0,j.withFetch)((e=>{let{data:t,name:s,type:n,cache:l,children:r,getLabel:o,...i}=e;const c=(0,a.useMemo)((()=>new Map(t.map((e=>[e.code,{...e,id:e.code,label:o?o(e):e.chName,parentId:e.parentCode||null}])))),[t,o]).get(s);return O.set("".concat(s,"_").concat(n),c),r(c,i)})),I=e=>{const{locale:t}=(0,w.A)(),s="".concat(t,"_").concat(e.name,"_").concat(e.type),n=O.get(s);return n&&!e.force?e.children(n):(0,N.jsx)(P,{...e})};I.defaultProps={children:e=>u()(e,"label","")};const L=I,k=n.A.useContext,M=(0,j.withFetch)((e=>{let{data:t,computedIsChecked:s,onSelect:n}=e;return(0,N.jsx)(x.A,{className:C["scroll-plus-box"],children:(0,N.jsx)(o.List,{className:A.A.list,size:"small",dataSource:t,rowKey:"value",renderItem:e=>{const t=s(e);return(0,N.jsx)(o.List.Item,{className:S()(A.A["list-item"],{[A.A["is-selected"]]:t}),onClick:()=>n(e,t),children:(0,N.jsx)("span",{className:A.A["item-label"],children:e.label})})}})})})),F=e=>{let{value:t,setValue:s,size:n,selectLevel:l}=e;const{fetchApi:d,props:p}=k(),[m,g]=(0,a.useState)(""),v=r()(p.dataFormat),{formatMessage:y}=(0,b.useIntl)({moduleName:"Common"}),j=d.data,w=(0,a.useMemo)((()=>new Map(v(j).list.map((e=>[e.value,e])))),[j,v]),O=(0,a.useMemo)((()=>h(w)),[w]),P=(0,a.useRef)({});P.current={createMergeTree:p.createMergeTree,loadMore:d.loadMore,openLoadData:p.openLoadData,parentIdKey:p.parentIdKey,treeUtils:O};const[I,L]=(0,a.useState)((()=>{const e=t.find((e=>!!w.get(e)));return O.getSelectedQueue(e||u()(d.data.find((e=>e.children&&e.children.length>0)),"id")||u()(d.data,"[0].id"),w)}));(0,a.useEffect)((()=>{const{openLoadData:e,loadMore:t,parentIdKey:s,createMergeTree:n,treeUtils:a}=P.current;if(!e)return;const l=w.get(_()(I));if(!l)return;const r=a.getSelectedQueue(l.id);f()(I,r)?l.hasOwnProperty("children")||t({data:{[s]:l.id}},n(l.id)):L(r)}),[I,w]);const F=(e,a)=>{const l=(()=>{if(p.onlyAllowLastLevel&&e){const e=t.slice(0);return e.push(a),e}if(p.onlyAllowLastLevel){const e=t.slice(0);return e.splice(t.indexOf(a),1),e}return e?O.setNodeChecked(a,t):O.setNodeUnchecked(a,t)})();l.length>n?o.message.error(y({id:"maxSelectedCount"},{count:n})):s(p.single&&l.length>0?[_()(l)]:l)},T=e=>{const t=w.get(e);return!(!p.openLoadData||t.hasOwnProperty("children"))||t.children&&t.children.length>0},R=!p.openLoadData&&"function"===typeof p.onSearch,D=R&&m&&(0,N.jsx)(M,{data:{searchText:m},loader:e=>{let{data:t}=e;return p.onSearch(t.searchText,{mapping:w})},computedIsChecked:e=>t.indexOf(e.id)>-1,onSelect:(e,t)=>{F(!t,e.id),!t&&L(O.getSelectedQueue(e.id,w)),g("")}});return(0,N.jsxs)("div",{className:S()(C.content,{[C["is-popup"]]:p.isPopup,[C["has-search"]]:R}),style:{"--menu-item-width":p.menuItemWidth},children:[R&&(0,N.jsx)(c.A,{isPopup:p.isPopup,className:S()(A.A["search-input"],{[A.A["is-popup"]]:p.isPopup}),placeholder:p.searchPlaceholder||y({id:"search"}),value:m,onSearch:e=>{g(e)}}),D||(0,N.jsx)("div",{children:(0,N.jsx)(x.A,{className:C.scroller,options:{autoHide:!1},children:(0,N.jsxs)("div",{className:C.columns,children:[I.map(((e,s)=>{const n=w.get(e),r=O.getSiblingNode(e),c=!T(null===n||void 0===n?void 0:n.id)&&s>0;return(0,N.jsx)(x.A,{className:S()(C["content-item"],{[C["last-level-area"]]:c}),children:c?(0,N.jsx)(o.Space,{wrap:!0,children:r.map((e=>(0,a.createElement)(o.Checkbox,{...O.computedCheckboxStatus(e.id,t),disabled:l>1&&(t.indexOf(e.parentCode)>-1||t.indexOf(e.code.slice(0,3))>-1),key:e.id,onChange:t=>F(t.target.checked,e.id)},e.label)))}):(0,N.jsx)(o.Menu,{className:S()(C.menu),onSelect:e=>{const s=w.get(e.key);if(s)if(T(s.id))L(O.getSelectedQueue(s.id,w));else{const{checked:e}=O.computedCheckboxStatus(s.id,t);F(!e,s.id)}},selectedKeys:s===I.length-1?[]:I,items:r.map((e=>({key:e.id,label:(0,N.jsxs)(o.Space,{className:S()(C["menu-item"],{[C["checkbox-hidden"]]:p.onlyAllowLastLevel&&T(e.id)}),children:[!p.onlyAllowLastLevel&&(0,N.jsx)(o.Checkbox,{...O.computedCheckboxStatus(e.id,t),disabled:l>1&&t.indexOf(e.parentCode)>-1,onChange:t=>F(t.target.checked,e.id)}),(0,N.jsx)("div",{className:C["menu-label"],children:e.label}),T(e.id)&&(0,N.jsx)(i.default,{className:C["menu-item-icon"],type:"icon-arrow-thin-right",size:12})]})})))})},u()(r,"[0].id",s))})),d.isComplete?null:(0,N.jsx)("div",{className:C.loading,children:(0,N.jsx)(o.Spin,{size:"small"})})]})})})]})},T=e=>{let{maxLength:t,nodeFormat:s,dataFormat:a,...l}=e;return(0,N.jsx)(n.A,{...l,dataFormat:e=>a(e,s),children:e=>{let{value:s,setValue:n}=e;return(0,N.jsx)(F,{...l,size:t,value:s,setValue:n})}})};T.defaultProps={maxLength:Number.MAX_VALUE,size:"middle",isPopup:!0,overlayWidth:"460px",menuItemWidth:"180px",openLoadData:!1,onlyAllowLastLevel:!1,parentIdKey:"id",onSearch:(e,t)=>{let{mapping:s}=t;return Array.from(s.values()).filter((t=>t.label.indexOf(e)>-1))},dataFormat:(e,t)=>{const s=(e,n)=>{const a=[];return a.push(...(e||[]).map((e=>("function"===typeof t&&Object.assign(e,t(e)),e.children&&e.children.length>0&&a.push(...s(e.children,e.id)),Object.assign({},e,{value:e.id,parentId:n}))))),a};return{list:s(e,null)}},createMergeTree:e=>(t,s)=>{const n=t=>t.map((t=>t.id===e?Object.assign({},t,{children:s&&s.map((t=>Object.assign({},t,{parentId:e})))}):Array.isArray(t.children)&&t.children.length>0?Object.assign({},t,{children:n(t.children)}):t));return n(t)}};const R=T},41654:(e,t,s)=>{s.d(t,{A:()=>m,K:()=>p});var n=s(45776),a=s(27047),l=s(33097),r=s.n(l),o=s(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c=()=>s.e(719).then(s.t.bind(s,10719,19)).then((e=>e.__esModule?e.default:e)),d={cache:"FUNCTION_DATA",isLocal:!0,ttl:864e5,loader:c},u=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.Ay,{...s,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:s}=(0,n.ON)(new Map(t.map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return s}},c.functionData)})};u.defaultProps={overlayWidth:"640px",getSearchProps:e=>({data:{searchText:e}})},u.defaultData=c;const p=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.yK,{...s,...c.functionData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};u.FunctionEnum=u.Enum=p;const m=u},53392:(e,t,s)=>{s.d(t,{A:()=>p,W:()=>u});var n=s(45776),a=s(27047),l=s(33097),r=s.n(l),o=s(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c={cache:"INDUSTRY_DATA",isLocal:!0,ttl:864e5,loader:()=>s.e(7183).then(s.t.bind(s,57183,19)).then((e=>e.__esModule?e.default:e))},d=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.Ay,{...s,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:s}=(0,n.ON)(new Map(t.filter((e=>"000"!==e.code)).map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return s}},d.industryData)})};d.defaultProps={overlayWidth:"635px"};const u=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.yK,{...s,...d.industryData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};d.IndustryEnum=d.Enum=u;const p=d},26475:(e,t,s)=>{s.d(t,{A:()=>g});var n=s(73884),a=s(55199),l=s(96418),r=s.n(l),o=s(21485),i=s(83136),c=s.n(i),d=s(51941);const u="style_scroller-no-more__EH2J+__+Svgs";var p=s(70579);const m=e=>{let{getScrollerRef:t,loadMore:s,maxFullCount:a}=e;const l=r()(s),o=r()(t);return(0,n.useEffect)((()=>{let e=a;const t=o(),s=async()=>{t.clientHeight===t.scrollHeight&&e>0&&(await l().then((()=>new Promise((e=>{setTimeout(e,500)})))),e--,await s())};s()}),[a,l,o]),null},h=(0,n.forwardRef)(((e,t)=>{let{className:s,noMore:l,onLoader:i,isLoading:h,completeTips:g,maxFullCount:_,children:v}=e;const[f,x]=(0,n.useState)(!1),y=(0,n.useRef)(),S=r()(i),C=(0,n.useRef)(!l&&!h);C.current=!l&&!h,(0,n.useImperativeHandle)(t,(()=>y.current),[]);const j=(0,d.useThrottledCallback)((e=>{const t=e.target;C.current&&t.clientHeight+t.scrollTop+20>t.scrollHeight&&S()}),100);return(0,p.jsxs)(o.A,{ref:y,onScroll:j,className:c()("load-container",s),onReady:()=>{x(!0)},children:[f&&!h&&!l&&(0,p.jsx)(m,{maxFullCount:_,getScrollerRef:()=>y.current,loadMore:S}),(0,p.jsxs)(a.Space,{direction:"vertical",children:[(0,p.jsx)("div",{children:v}),h?(0,p.jsx)("div",{className:u,children:(0,p.jsx)(a.Spin,{size:"small"})}):null,l&&g?(0,p.jsx)("div",{className:u,children:g}):null]})]})}));h.defaultProps={maxFullCount:3,completeTips:"\u52a0\u8f7d\u5b8c\u6210"};const g=h},73161:(e,t,s)=>{s.d(t,{A:()=>m});var n=s(55199),a=s(83136),l=s.n(a);const r="style_search-input__8aH1G__+Svgs",o="style_is-popup__L0973__+Svgs";var i=s(64671),c=s(73884),d=s(51941),u=s(70579);const p=e=>{let{value:t,debounce:s,onSearch:a,isPopup:p,placeholder:m,className:h,...g}=e;const[_,v]=(0,c.useState)(t),f=(0,c.useRef)(t),x=(0,d.useDebouncedCallback)(a,s);return(0,c.useEffect)((()=>{t!==f.current&&(v(t),f.current=t)}),[t]),(0,u.jsx)(n.Input.Search,{...g,allowClear:!0,className:l()(h,r,{[o]:p}),value:_,placeholder:m,prefix:(0,u.jsx)(i.default,{type:"icon-sousuo"}),enterButton:(0,u.jsx)(i.default,{type:"icon-sousuo"}),onChange:e=>{const t=e.target.value;f.current=t,v(t),x(t)},onSearch:e=>{x(e)}})};p.defaultProps={debounce:500};const m=p},30509:(e,t,s)=>{s.d(t,{A:()=>U});const n={"ant-tag":"style_ant-tag__nNp8-__+Svgs",overlay:"style_overlay__La5mO__+Svgs",input:"style_input__SpJTE__+Svgs","is-disabled":"style_is-disabled__joxdl__+Svgs","input-icon":"style_input-icon__vVd8R__+Svgs",large:"style_large__En6mL__+Svgs",small:"style_small__DY0AQ__+Svgs","input-inner":"style_input-inner__PWy27__+Svgs","input-custom":"style_input-custom__ktsWD__+Svgs","display-content":"style_display-content__hIKo+__+Svgs","overlay-footer-extra":"style_overlay-footer-extra__Q+BiR__+Svgs","selected-tag":"style_selected-tag__zXZZO__+Svgs","selected-tag-list":"style_selected-tag-list__xUIms__+Svgs","selected-tag-inner":"style_selected-tag-inner__Z5gPL__+Svgs","text-inner":"style_text-inner__H24hY__+Svgs",placeholder:"style_placeholder__x0ccE__+Svgs","is-modal":"style_is-modal__JU+uq__+Svgs","overlay-content":"style_overlay-content__WKqp+__+Svgs"};var a=s(74981);const{context:l,useContext:r,Provider:o,Consumer:i}=(0,a.A)();var c=s(73884),d=s(10986),u=s.n(d),p=s(87558),m=s(33097),h=s.n(m),g=s(55199),_=s(83136),v=s.n(_),f=s(3382),x=s(64671),y=s(79686),S=s.n(y),C=s(41740),j=s.n(C),b=s(74065),A=s.n(b),N=s(21485),w=s(96418),O=s.n(w),P=s(77964),I=s(91176),L=s(58609),k=s(20492),M=s(27047),F=s(70579);const T=e=>{let{maxLength:t,single:s,setValue:n,value:a,message:l}=e;return e=>n(!s&&Number.isInteger(t)&&t>0&&e.length>t?(l(),a):e)},R=e=>{let{single:t,value:s,mapping:a,allValue:l,allLabel:r,onClose:o}=e;return s&&Array.isArray(s)&&0!==s.length?t?(0,F.jsx)("span",{className:n["text-inner"],children:h()(a.get(s[0]),"label")||s[0]}):1===s.length&&s[0]===(l||"all")?(0,F.jsx)("span",{className:n["text-inner"],children:r||(0,F.jsx)(L.FormattedMessage,{id:"all",moduleName:"Common"})}):s.map((e=>{const t=a.get(e);return(0,F.jsx)(g.Tag,{className:n["display-tag"],closable:!0,onClose:s=>{s.preventDefault(),o(e,t)},children:(0,F.jsx)("span",{className:n["tag-inner"],children:h()(t,"label")||e})},e)})):null},D=(0,c.forwardRef)(((e,t)=>{let{value:s,onChange:a,extra:l,showSelectedTag:r,renderSelectedContent:o,children:i,...d}=e;const[u,p]=(0,c.useState)(s),m=(0,c.useRef)(s),{formatMessage:h}=(0,L.useIntl)({moduleName:"Common"});m.current=s;const[_,v]=(0,c.useState)(!1),x=e=>{var t;v(e),null===(t=d.onOpenChange)||void 0===t||t.call(d,e)},{message:y}=g.App.useApp(),S=T({maxLength:d.maxLength,single:d.single,setValue:p,value:u,message:()=>y.error(h({id:"maxSelectedCount"},{count:d.maxLength}))});return(0,c.useEffect)((()=>{_&&p(m.current)}),[_]),(0,c.useImperativeHandle)(t,(()=>({modalOpen:()=>{x(!0)},close:()=>{x(!1)}}))),(0,F.jsx)(f.default,{...d,open:_,onConfirm:()=>{a(u)},onClose:()=>{x(!1)},footer:(0,F.jsxs)(g.Space,{direction:"vertical",className:n["overlay-footer"],children:[l&&(0,F.jsx)("div",{className:n["overlay-footer-extra"],children:l}),r&&o({value:u,setValue:S})]}),children:"function"===typeof i?i({value:u,setValue:S}):i})})),E=(0,c.forwardRef)(((e,t)=>{let{value:s,setValue:a,children:l,renderSelectedContent:r,showSelectedTag:o,placement:i,inputContent:d,single:u,extra:p,overlayWidth:m,wrapClassName:h,overlayClassName:_,disabled:f,...x}=e;const[y,S]=(0,c.useState)(!1),C=O()((e=>{var t;S(e),null===(t=x.onOpenChange)||void 0===t||t.call(x,e)}));return(0,c.useImperativeHandle)(t,(()=>({close:()=>{C(!1)}})),[C]),f?(0,F.jsx)("div",{className:n["input-inner"],children:d}):(0,F.jsx)(g.Popover,{...x,open:y,onOpenChange:C,transitionName:"ant-slide-up",overlayClassName:v()(n.overlay,_),arrow:!1,content:(0,F.jsxs)("div",{style:m?{"--overlay-width":m}:{},className:v()(n["overlay-content"],"over-content"),onClick:e=>{e.stopPropagation()},children:[(0,F.jsx)("div",{className:n["overlay-inner"],children:"function"===typeof l?l({value:s,setValue:e=>{(!u||s[0]!==e[0])&&a(e),u&&C(!1)}}):l}),(o||p)&&(0,F.jsxs)("div",{className:n["overlay-footer"],children:[p&&(0,F.jsx)("div",{className:n["overlay-footer-extra"],children:p}),o&&r({value:s,setValue:a})]})]}),trigger:"click",placement:i,children:(0,F.jsx)("div",{className:n["input-inner"],children:d})})})),z=(0,p.withFetch)((e=>{let{setFetchApi:t,wrapClassName:s,getContentRef:a,...l}=e;const[o,i]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useRef)(null),p=r(),{valueState:m,mapping:h,props:_,inputWidth:f}=p,[y,S]=m,{formatMessage:C}=(0,L.useIntl)({moduleName:"Common"}),{single:j,placement:b,getPopupContainer:A,placeholder:w,isPopup:P,disabled:k,showSelectedTag:M,extra:T,inputContent:z,allowClear:V,overlayClassName:W}=_,U=(0,c.useRef)(l);U.current=l;const B=O()(a);(0,c.useEffect)((()=>{B(P?u:d)}),[P,B]),(0,c.useEffect)((()=>{t(Object.assign({},U.current,{data:l.data,isComplete:l.isComplete}))}),[l.data,t,l.isComplete]);const K=R({single:j,value:y,mapping:h,allValue:_.allValue,allLabel:_.allLabel,onClose:e=>{S((t=>{const s=t.slice(0),n=t.indexOf(e);return n>-1&&s.splice(n,1),s}))}}),q=e=>{let{value:t,setValue:s}=e;return(0,F.jsxs)(g.Space,{className:n["selected-tag"],align:"center",wrap:!1,children:[(0,F.jsxs)("div",{children:[(0,F.jsx)(L.FormattedMessage,{id:"selectedTextAdvanced",moduleName:"Common",defaultMessage:"\u5df2\u9009"}),!_.single&&Number.isInteger(_.maxLength)&&_.maxLength>0?"(".concat(t.length,"/").concat(_.maxLength,")"):"",":"]}),(0,F.jsx)(N.A,{className:n["selected-tag-list"],children:(0,F.jsx)("div",{className:n["selected-tag-inner"],children:R({value:t,mapping:h,allValue:_.allValue,allLabel:_.allLabel,onClose:e=>{s((t=>{const s=t.slice(0),n=t.indexOf(e);return n>-1&&s.splice(n,1),s}))}})})})]})},H=z?z(p):(0,F.jsxs)(g.Space,{className:n["display-content"],onMouseOver:()=>{i(!0)},onMouseOut:()=>{i(!1)},children:[(0,F.jsx)("div",{children:K||(0,F.jsx)("span",{className:n.placeholder,children:w||C({id:"pleaseSelect"})})}),o&&y&&y.length>0&&!k&&V?(0,F.jsx)(x.default,{className:v()(n.close,n["input-icon"],"close","input-icon"),type:"icon-shibai",onClick:e=>{e.stopPropagation(),S([])}}):(0,F.jsx)(x.default,{className:v()(n["input-icon"],"input-icon-arrow","input-icon"),type:"icon-arrow-thin-down"})]});return P?(0,F.jsx)(E,{ref:u,overlayWidth:(0,I.v)(Math.max(f,(0,I.j)(_.overlayWidth))),value:y,setValue:S,single:j,disabled:k,inputContent:H,onOpenChange:_.onOpenChange,overlayClassName:W,extra:"function"===typeof T?T({close:()=>u.current.close(),context:p}):T,renderSelectedContent:q,showSelectedTag:M,trigger:"click",placement:b,getPopupContainer:A,children:_.children}):(0,F.jsxs)("div",{className:n["input-inner"],onClick:()=>{k||d.current.modalOpen()},children:[(0,F.jsx)(D,{size:_.modalSize,ref:d,single:_.single,maxLength:_.maxLength,onOpenChange:_.onOpenChange,disabledScroller:!0,wrapClassName:v()(n.overlay,n["is-modal"],s),title:_.placeholder||C({id:"pleaseSelect"}),value:y,onChange:S,extra:"function"===typeof T?T({close:()=>d.current.close(),context:p}):T,showSelectedTag:M,renderSelectedContent:q,children:_.children}),H]})})),V=e=>{let{api:t,className:s,displayItems:a,wrapClassName:l,...r}=e;const{locale:i}=(0,M.A)(),[d,p]=(0,c.useState)(""),[m,_]=(0,c.useState)(new Map(a.map((e=>[e.value,e])))),{formatMessage:f}=(0,L.useIntl)({moduleName:"Common"}),[x,y]=(0,c.useState)(0),C=(0,P.A)((e=>{y(e.clientWidth)})),[b,N]=(0,c.useState)({}),{message:w}=g.App.useApp(),O=e=>{const t=e.filter((e=>m.get(e.value)!==e));0!==t.length&&_((e=>{const s=j()(e);return t.forEach((e=>{s.set(e.value,e)})),s}))},I=e=>((e,t)=>Array.isArray(e)&&e.every((e=>e&&e.hasOwnProperty("value")&&e.hasOwnProperty("label")))?(t(e),e.map((e=>e.value))):e)(r.single?S()(e)?[]:[e]:e||[],O,r.valueType),[k,R]=u()(Object.assign({},r,{onChange:e=>{const t=((e,t,s)=>"all"!==s?e:e.map((e=>t.get(e))).filter((e=>!!e)))(e,m,r.valueType);r.onChange&&r.onChange(r.single?A()(t):t)}},"value"in r?{value:I(r.value)}:{defaultValue:I(r.defaultValue)})),D=T({maxLength:r.maxLength,single:r.single,setValue:R,value:k,message:()=>w.error(f({id:"maxSelectedCount"},{count:r.maxLength}))}),E=(0,c.useRef)(null);return(0,F.jsx)(o,{value:{inputWidth:x,mapping:m,searchText:d,setSearchText:p,appendMapping:O,setItems:e=>{b.setData(e),O(h()(r.dataFormat(e,{locale:i}),"list",[]))},getContentApi:()=>E.current,fetchApi:b,valueState:[k,D],props:r},children:(0,F.jsx)("div",{ref:C,className:v()(n["input".concat(r.inputContent&&"function"===typeof r.inputContent?"-custom":"")],{"select-input-disabled":!!r.disabled},s),children:(0,F.jsx)(z,{...t,wrapClassName:l,loading:null,setFetchApi:N,getContentRef:e=>{e.current&&(E.current=e.current)},onRequestSuccess:e=>{O(h()(r.dataFormat(e,{locale:i}),"list",[])),t.onRequestSuccess&&t.onRequestSuccess(e)}})})})};V.defaultProps={displayItems:[],extra:null,api:{loader:()=>[]},dataFormat:e=>({list:e}),placement:"bottomLeft",showSelectedTag:!0,allowClear:!0};const W=(0,L.createWithIntl)({importMessages:k.A,moduleName:"Common"})(V);W.useContext=r;const U=W},17342:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(8762),a=s.n(n);s(46733);const l=a()},21485:(e,t,s)=>{s.d(t,{A:()=>c});var n=s(73884),a=s(44418),l=s.n(a),r=s(96418),o=s.n(r),i=s(70579);const c=(0,n.forwardRef)(((e,t)=>{let{children:s,onScroll:a,options:r,onReady:c,...d}=e;const u=(0,n.useRef)(null),p=(0,n.useRef)(null),m=(0,n.useRef)(r),h=o()(c),g=o()(a);return(0,n.useImperativeHandle)(t,(()=>p.current)),(0,n.useEffect)((()=>{const e=new(l())(u.current,m.current);return p.current=e.getScrollElement(),p.current.addEventListener("scroll",g),h(p.current),()=>{p.current.removeEventListener("scroll",g)}}),[g,h,s]),(0,i.jsx)("div",{...d,ref:u,children:s})}))},89319:(e,t,s)=>{s.d(t,{A:()=>u});var n=s(55199),a=s(10986),l=s.n(a),r=s(57469),o=s.n(r),i=s(20492),c=s(58609),d=s(70579);const u=(0,c.createWithIntl)({importMessages:i.A,moduleName:"Common"})((e=>{let{...t}=e;const{formatMessage:s}=(0,c.useIntl)({moduleName:"Common"}),a=new Map([["date",s({id:"customTime"})],["month",s({id:"monthly"})],["week",s({id:"weekly"})]]),[r,i]=l()(t);return(0,d.jsxs)(n.Space.Compact,{children:[(0,d.jsx)(n.Select,{style:{width:"120px"},value:(null===r||void 0===r?void 0:r.type)||"date",onChange:e=>{i((t=>{var s;return{value:null!==t&&void 0!==t&&null!==(s=t.value)&&void 0!==s&&s.length?[o()(t.value[0]).startOf(e||"date"),o()(t.value[1]).endOf(e||"date")]:null,type:e||"date"}}))},options:Array.from(a).map((e=>{let[t,s]=e;return{label:s,value:t}}))}),(0,d.jsx)(n.DatePicker.RangePicker,{...t,picker:(null===r||void 0===r?void 0:r.type)||"date",value:Array.isArray(null===r||void 0===r?void 0:r.value)&&2===r.value.length&&r.value.map((e=>e&&o()(e))),onChange:e=>{i((t=>(console.log(Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]})),Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]}))))}})]})}))},20492:(e,t,s)=>{s.d(t,{A:()=>n});const n=e=>({"en-US":()=>s.e(3086).then(s.bind(s,13086)),"zh-CN":()=>s.e(4308).then(s.bind(s,84308))}[e]())},29574:(e,t,s)=>{s.d(t,{Zi:()=>g,FI:()=>_,AG:()=>v,Ay:()=>x,lN:()=>f});const n="style_input-file__3JGm6__+Svgs",a="style_input-file-input__Fb5iw__+Svgs";var l=s(83136),r=s.n(l),o=s(73884),i=s(55199),c=s(63908),d=s(28987),u=s(80111),p=s.n(u),m=s(70579);const h=e=>t=>{let{className:s,accept:l,multiple:i,onChange:c,children:d,...u}=t;const p=(0,o.useRef)(null);return(0,m.jsxs)(e,{...u,className:r()(s,n),children:[d,!0!==u.disabled&&(0,m.jsx)("input",{ref:p,type:"file",accept:l,multiple:i,className:a,onChange:e=>{const t=[].slice.call(e.target.files,0);0!==t.length&&(p.current.setAttribute("type","text"),p.current.setAttribute("type","file"),c(t))}})]})},g=h(i.Button),_=h((e=>{let{className:t,...s}=e;return(0,m.jsx)(i.Typography.Link,{...s,className:t})})),v=h((e=>{let{className:t,...s}=e;return(0,m.jsx)(i.Typography.Text,{...s,className:r()("ant-btn",t)})})),f=e=>{const{message:t}=i.App.useApp(),{multiple:s,fileSize:n,maxLength:a,value:l,concurrentCount:r,onAdd:u,onError:m,onSave:h,onChange:g,ossUpload:_}=Object.assign({},{concurrentCount:1,value:[]},e),{apis:v}=(0,c.usePreset)(),[f,x]=(0,o.useState)([]),y=(0,o.useRef)(r),S=(0,o.useMemo)((()=>(0,d.A)(y.current)),[]);return{fileList:f,onFileSelected:async e=>{const r=a-l.length;1!==a&&!0===s&&e.length>r?t.error("\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf".concat(a)):await Promise.allSettled(e.map((async e=>{if(e.size>1024*n*1024)return void t.error("\u6587\u4ef6".concat(e.name,"\u4e0d\u80fd\u8d85\u8fc7").concat(n,"MB!"));const l=p()(),r=s=>{const n=s.message||"\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u9519\u8bef").concat(s.message?":"+s.message:"");t.error(n),m&&m({file:e,error:s,errMsg:n}),x((e=>{const t=e.slice(0),s=t.findIndex((e=>e.uuid===l));return s>-1&&t.splice(s,1),t}))};try{x(1===a||!0!==s?[{uuid:l,type:"uploading",filename:e.name}]:t=>{const s=t.slice(0);return s.unshift({uuid:l,type:"uploading",filename:e.name}),s}),u&&await Promise.resolve(u(e));const t=_||v.ossUpload,{data:n}=await S((()=>t({file:e})));if(0!==n.code)return void r(new Error("\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u5f02\u5e38").concat(n.msg?":"+n.msg:"")));const o=h?await Promise.resolve(h(n,e,l)):{filename:n.data.originalName||n.data.filename||e.name,id:n.data.id,ossId:n.data.id,uuid:l};x((e=>{const t=e.slice(0),s=t.findIndex((e=>e.uuid===l));return s>-1&&t.splice(s,1),t})),g(1===a||!0!==s?[o]:e=>{const t=e.slice(0);return t.push(o),t})}catch(o){r(o)}})))}}},x=h},97211:(e,t,s)=>{s.d(t,{A:()=>c});var n=s(87558),a=s.n(n),l=s(63908),r=s(34677),o=s.n(r),i=s(70579);const c=e=>{const t=t=>{let{id:s,url:n,error:r,apis:c,loading:d,...u}=t;const{apis:p}=(0,l.usePreset)(),m=o()({},p,c);if(!s)return null;if(!m.oss)throw new Error("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.oss\u53c2\u6570");const{paramsType:h,paramsName:g,..._}=Object.assign({paramsType:"params",paramsName:"id"},m.oss),v={};return v[h]={[g]:s},(0,i.jsx)(a(),{...Object.assign({},_,v),updateType:"refresh",error:r,loading:d,cache:"oss-file",ttl:6e6,render:t=>{let{data:n}=t;return(0,i.jsx)(e,{...u,id:s,data:n})}})};return t.defaultProps={loading:null},t}},27047:(e,t,s)=>{s.d(t,{A:()=>r});var n=s(83694),a=s(33097),l=s.n(a);const r=()=>{const e=(0,n.useGlobalContext)();return l()(e,"preset",{apis:{}})}},77964:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(73884),a=s(79889),l=s.n(a),r=s(93950),o=s.n(r),i=s(96418),c=s.n(i);const d=(e,t)=>{const s=(0,n.useRef)(null);s.current=Object.assign({},{time:500,isDebounce:!1},t);const a=(0,n.useRef)(null),r=c()(e);return(0,n.useLayoutEffect)((()=>{const e=a.current,t=()=>window.requestAnimationFrame((()=>{e&&r(e)}));t();const n=new ResizeObserver((s.current.isDebounce?o():l())(t,s.current.time));return e&&n.observe(e),()=>{n.disconnect()}}),[r]),a}},81348:(e,t,s)=>{s.d(t,{A:()=>n});const n=(e,t)=>{if(e&&t){const s=Array.isArray(t)?t:t.split(","),n=e.name||"",a=(e.type||"").toLowerCase(),l=a.replace(/\/.*$/,"");return s.some((e=>{const t=e.trim().toLowerCase();return"."===t.charAt(0)?n.toLowerCase().endsWith(t):t.endsWith("/*")?l===t.replace(/\/.*$/,""):a===t}))}return!0}},69484:(e,t,s)=>{s.d(t,{A:()=>a,e:()=>n});const n=1e15,a=e=>{let t,s,a,l=["\u96f6","\u58f9","\u8d30","\u53c1","\u8086","\u4f0d","\u9646","\u67d2","\u634c","\u7396"],r=["","\u62fe","\u4f70","\u4edf"],o=["","\u4e07","\u4ebf","\u5146"],i=["\u89d2","\u5206","\u6beb","\u5398"],c="",d="";if(""===e)return"";if((e=parseFloat(e))>=n)return c="\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57",console.error("\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57"),c;if(0===e)return c=l[0]+"\u5143\u6574",c;if(e<0&&(e=-e,d="\u8d1f "),-1===(e=e.toString()).indexOf(".")?(t=e,s=""):(a=e.split("."),t=a[0],s=a[1].substr(0,4)),parseInt(t,10)>0){let e=0,s=t.length;for(let n=0;n<s;n++){let a=t.substr(n,1),i=s-n-1,d=i/4,u=i%4;"0"===a?e++:(e>0&&(c+=l[0]),e=0,c+=l[parseInt(a)]+r[u]),0===u&&e<4&&(c+=o[d])}c+="\u5143"}if(""!==s){let e=s.length;for(let t=0;t<e;t++){let e=s.substr(t,1);"0"!==e&&(c+=l[Number(e)]+i[t])}}return""===c?c+=l[0]+"\u5143\u6574":""===s&&(c+="\u6574"),c=d+c,c}},74981:(e,t,s)=>{s.d(t,{A:()=>a});var n=s(73884);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.createContext)(e),{Provider:s,Consumer:a}=t;return{context:t,Provider:s,Consumer:a,useContext:()=>(0,n.useContext)(t)}}},28987:(e,t,s)=>{s.d(t,{A:()=>n});const n=e=>{const t=[];let s=0;const n=()=>{if(0!==t.length){if(s<e){const e=t.shift();s+=1,e().finally((()=>{s-=1,n()}))}}else s=0};return e=>new Promise((s=>{t.push((()=>{const t=Promise.resolve().then((()=>e()));return s(t),t})),n()}))}},55490:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(12322),a=s.n(n),l=s(26727),r=s.n(l),o=s(54052),i=s.n(o);const c=e=>{if(a()(e)){const t=r()(e);return t.length>0&&t.some((e=>c(e)))}return i()(e)?e.length>0&&e.some((e=>c(e))):"number"===typeof e?!isNaN(e):!(void 0===e||null===e||""===e||0===e.length)},d=c},91176:(e,t,s)=>{s.d(t,{j:()=>a,v:()=>n});const n=e=>"number"===typeof e?"".concat(e,"px"):e,a=e=>{if(!e)return 0;const t=e.match(/^\d*(\.\d*)?/);return t?Number(t[0]):0}},36:(e,t,s)=>{s.r(t),s.d(t,{AddressEnum:()=>h.qn,AddressInputField:()=>h.TM,AddressSelectField:()=>h.Ay,AdvancedSelectField:()=>g.Ay,CascaderField:()=>_.Ay,FetchButton:()=>i.A,FunctionEnum:()=>v.K,FunctionSelectField:()=>v.A,IndustryEnum:()=>f.W,IndustrySelectField:()=>f.A,InputFileButton:()=>m.Zi,InputFileLink:()=>m.FI,InputFileText:()=>m.AG,ScrollLoader:()=>o.A,SearchInput:()=>u.A,SelectInnerInput:()=>p.A,SimpleBar:()=>d.A,SimpleBarBox:()=>c.A,TableField:()=>g.Bm,TypeDateRangePickerField:()=>x.A,UserField:()=>g.Eo,accept:()=>S.A,changeMoneyToChinese:()=>n.A,createAddressApi:()=>h.LH,createDeferred:()=>C.A,createListField:()=>g.NR,createTreeUtils:()=>_.ON,getContainerBody:()=>a.c,getPopupContainer:()=>l,getScrollEl:()=>a.h,isNotEmpty:()=>j.A,numberToPx:()=>b.v,pxToNumber:()=>b.j,useFileUpload:()=>m.lN,useResize:()=>y.A,withAddressApi:()=>h.DF,withInputFile:()=>m.Ay,withOSSFile:()=>r.A});var n=s(69484),a=s(76801);const l=e=>{const t=e=>{const s=(0,a.h)();if(!e||e===s||!e.parentElement)return s;return[].slice.call(e.classList,0).find((e=>["ant-modal-body","ant-modal-content","ant-popover-content"].indexOf(e)>-1))?e:t(e.parentElement)};return t(e)};var r=s(97211),o=s(26475),i=s(73025),c=s(21485),d=s(17342),u=s(73161),p=s(30509),m=s(29574),h=s(93761),g=s(12392),_=s(45776),v=s(41654),f=s(53392),x=s(89319),y=s(77964),S=s(81348),C=s(28987),j=s(55490),b=s(91176)},40438:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var n=s(87558),a=s.n(n),l=s(97211),r=s(64671),o=s(83136),i=s.n(o),c=s(55199),d=s(73884);const u=e=>{let{params:t}=e;const{data:s}=t;return new Promise(((e,t)=>{const n=new window.Image;n.src=s,n.addEventListener("load",(()=>{e(s)})),n.addEventListener("error",(e=>{t(e)}))}))},p="style_img-outer__4QLY5__+Svgs",m="style_img__PSExq__+Svgs",h="style_loading__WCOwA__+Svgs",g="style_error__+ECgZ__+Svgs";var _=s(18411),v=s(63908),f=s(70579);const x=e=>{let{data:t,className:s,alt:n,innerLoading:l,loading:r,error:o,innerError:c,children:d,onClick:p,staticUrl:h}=e;const{staticUrl:g}=(0,v.usePreset)(),_=h||g||"";return(0,f.jsx)(a(),{loader:u,params:{data:/^https?:\/\//.test(t)?t:_+t},error:c||o,loading:l||r,render:e=>{let{data:t}=e;return"function"===typeof d?d({alt:n,className:i()(s,m),src:t}):(0,f.jsx)("img",{alt:n,className:i()(s,m),src:t,onClick:p})}})},y=(0,l.A)(x),S=e=>{let{loading:t,error:s,src:n,id:a,alt:l,className:r,children:o,apis:i,onClick:c}=e;const u=t&&(0,d.cloneElement)(t,{className:h}),p=s&&(0,d.cloneElement)(s,{className:g});return n?(0,f.jsx)(x,{alt:l,className:r,data:n,loading:u,error:p,onClick:c,children:o}):a?(0,f.jsx)(y,{alt:l,className:r,id:a,loading:u,innerLoading:u,error:p,innerError:p,apis:i,onClick:c,children:o}):p},C=e=>{let{id:t,src:s,alt:n,onClick:a,loading:l,error:r,className:o,apis:c,...d}=e;return(0,f.jsx)("div",{...d,"data-testid":"components-core-image",className:i()(o,p),children:S({loading:l,error:r,src:s,id:t,alt:n,className:o,apis:c,onClick:a})})};C.Avatar=e=>{let{id:t,src:s,alt:n,gender:a,loading:l,error:o,className:d,gap:u,icon:m,children:h,shape:g,size:_,width:v,height:x,defaultAvatar:y,apis:C,...j}=e;const b=(()=>{const e=v&&x?{style:{width:v,height:x}}:{size:_};if(v&&v!==x&&(g="square"),t||s)return S({loading:l,error:o,src:s,defaultAvatar:y,id:t,alt:n,className:d,apis:C,children:t=>(0,f.jsx)(c.Avatar,{...t,gap:u,shape:g,...e})});if(a){const t=a&&["F","female","f"].indexOf(a)>-1?"icon-color-touxiang-nv":"icon-color-touxiang-nan";return(0,f.jsx)(c.Avatar,{...j,src:(0,f.jsx)(r.default,{role:"touxiang",colorful:!0,type:t}),gap:u,shape:g,...e})}return(0,f.jsx)(c.Avatar,{...j,gap:u,icon:m,shape:g,size:_,src:y,...e,children:h})})();return(0,f.jsx)("div",{...j,"data-testid":"components-core-image-avatar",className:i()(d,p),style:{width:v&&x?v:_,height:v&&x?x:_},children:b})};const j={error:(0,f.jsx)(r.default,{role:"error-icon",colorful:!0,type:"icon-color-touxiang-nan"}),loading:(0,f.jsx)(c.Skeleton.Avatar,{shape:"square",active:!0})};C.defaultProps=Object.assign({},j),C.Avatar.defaultProps=Object.assign({},j,{size:100,defaultAvatar:_.A});const b=C},3382:(e,t,s)=>{s.r(t),s.d(t,{ModalButton:()=>k,TabsModal:()=>O,TabsModalButton:()=>L,default:()=>N,useConfirmModal:()=>A,useModal:()=>b,useTabsModal:()=>P});var n=s(73884),a=s(55199),l=s(83136),r=s.n(l);const o={modal:"style_modal__Pm3cF__+Svgs",large:"style_large__iaqVE__+Svgs","modal-body-inner":"style_modal-body-inner__4PhpA__+Svgs","modal-title":"style_modal-title__dswaw__+Svgs","modal-outer":"style_modal-outer__r3SkX__+Svgs","modal-body":"style_modal-body__jQJSI__+Svgs","right-options-modal":"style_right-options-modal__FajDP__+Svgs","right-options-row":"style_right-options-row__-mPb9__+Svgs","right-options-col":"style_right-options-col__3ilee__+Svgs","is-disabled-scroller":"style_is-disabled-scroller__PmHyk__+Svgs",content:"style_content__k6MIF__+Svgs","modal-footer":"style_modal-footer__-prbN__+Svgs","modal-close":"style_modal-close__Oa5Kl__+Svgs","confirm-modal-wrap":"style_confirm-modal-wrap__YFImr__+Svgs","is-danger":"style_is-danger__H5110__+Svgs",title:"style_title__orTym__+Svgs","has-title":"style_has-title__qy0Wp__+Svgs"},i=e=>({"en-US":()=>s.e(4628).then(s.bind(s,74628)),"zh-CN":()=>s.e(7478).then(s.bind(s,87478))}[e]());var c=s(58609),d=s(64671);const u=(e,t)=>"function"===typeof e?e(t):e;var p=s(81014),m=s(17342),h=s(70579);const g="Modal",_=e=>{let{options:t,children:s}=e;return t?(0,h.jsxs)(a.Row,{wrap:!1,className:o["right-options-row"],children:[(0,h.jsx)(a.Col,{span:18,className:o["right-options-col"],children:s}),(0,h.jsx)(a.Col,{span:6,className:o["right-options-col"],children:t})]}):s},v=(e,t)=>"".concat(e-48-(t?58:0),"px"),f=(e,t)=>"large"===e?{width:"".concat(Math.min(window.innerWidth-64,1500),"px"),style:{"--min-modal-height":v(500,t)}}:"small"===e?{width:"600px",style:{"--min-modal-height":v(300,t)}}:{width:"1000px",style:{"--min-modal-height":v(500,t)}},x=e=>{let{footer:t,footerButtons:s,onConfirm:l,onCancel:r,onClose:o,targetProps:d}=e;return(0,h.jsxs)(a.Row,{gutter:10,wrap:!1,children:[(0,h.jsx)(a.Col,{flex:1,children:t}),Array.isArray(s)&&0===s.length?null:(0,h.jsx)(a.Col,{children:(0,h.jsx)(a.Space,{children:(s||[{children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:g,children:(0,h.jsx)(c.FormattedMessage,{id:"Cancel",moduleName:g})}),onClick:r},{type:"primary",children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:g,children:(0,h.jsx)(c.FormattedMessage,{id:"Confirm",moduleName:g})}),onClick:l}]).filter((e=>"function"===typeof(null===e||void 0===e?void 0:e.display)?null===e||void 0===e?void 0:e.display():!1!==(null===e||void 0===e?void 0:e.display))).map(((e,t)=>{let{ButtonComponent:s,onClick:a,autoClose:l=!0,display:r,...i}=e;const c=s||p.default;return(0,n.createElement)(c,{...i,key:t,onClick:async function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];const n=await Promise.resolve(a&&a(...t,d));return l&&!1!==n&&o&&o(),n}})}))})})]})},y=e=>{let{title:t,footer:s,disabledScroller:l,footerButtons:i,onClose:c,closable:u,onConfirm:p,onCancel:g,children:_,targetProps:v}=e;const f=(0,n.useRef)(null);return(0,h.jsxs)("div",{className:o["modal-outer"],"data-testid":"components-core-modal",children:[!1===u?null:(0,h.jsx)(a.Button,{"data-testid":"components-core-modal-close-btn",className:o["modal-close"],type:"text",icon:(0,h.jsx)(d.default,{type:"icon-close-thin"}),onClick:e=>{e.stopPropagation(),c&&c()}}),t&&(0,h.jsx)("div",{className:o["modal-title"],children:t}),(0,h.jsx)(m.A,{className:r()(o["modal-body"],{[o["is-disabled-scroller"]]:l},"modal-body"),ref:f,children:(0,h.jsx)("div",{className:r()(o["modal-body-inner"],"modal-body-inner"),children:_})}),null!==s||i?(0,h.jsx)("div",{className:r()(o["modal-footer"],"modal-footer"),children:(0,h.jsx)(x,{footer:s,footerButtons:i,onConfirm:p,onCancel:g,onClose:c,targetProps:v})}):null]})},S=e=>{let{withDecorator:t,footerButtons:s,title:n,closable:a,onClose:l,onConfirm:r,onCancel:o,footer:i,rightOptions:c,disabledScroller:d,childrenRef:p,children:m}=e;const g=e=>(e=Object.assign({},{title:n},e),(0,h.jsx)(y,{title:u(e.title,{...e,childrenRef:p,close:l}),closable:a,onClose:l,onConfirm:r,onCancel:o,footerButtons:u(s,{...e,close:l}),disabledScroller:d,footer:u(i,{...e,childrenRef:p,close:l}),targetProps:Object.assign({},e,{childrenRef:p,close:l}),children:(0,h.jsx)(_,{options:u(c,{...e,childrenRef:p,close:l}),children:u(m,{...e,childrenRef:p,close:l})})}));return"function"===typeof t?t(g):g({})},C=e=>{let{children:t,rightOptions:s,footer:n,footerButtons:a,className:l,size:d,title:u,onClose:p,onConfirm:m,onCancel:g,closable:_,disabledScroller:v,withDecorator:x,childrenRef:y,...C}=e;return{...C,icon:null,centered:!0,title:null,maskClosable:!!C.hasOwnProperty("maskClosable")&&C.maskClosable,destroyOnClose:!0,footer:null,closable:!1,onCancel:p,className:r()(l,o.modal,o[d],{[o["right-options-modal"]]:s}),...f(d,!(null===n&&!a)),children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:"Modal",children:S({withDecorator:x,title:u,closable:_,onClose:p,onConfirm:m,onCancel:g,footer:n,footerButtons:a,rightOptions:s,disabledScroller:v,children:t,childrenRef:y})})}},j=e=>{const t=(0,n.useRef)(null);return(0,h.jsx)(a.Modal,{...C(Object.assign({},e,{childrenRef:t}))})};j.defaultProps={size:"default"};const b=()=>{const{modal:e}=a.App.useApp(),t=(0,n.useRef)(null);return s=>{const n={},{children:a,...l}=C({onClose:()=>n.close(),childrenRef:t,...s}),{destroy:r}=e.info({...l,content:a});return n.close=r,n}},A=()=>{const{modal:e}=a.App.useApp();return t=>{const s={},{type:n,icon:l,title:i,danger:c,wrapClassName:u,message:p,iconSetting:m={},confirmType:g="info",..._}={onClose:()=>s.close(),maskClosable:!1,...t},v=Object.assign({},{info:"icon-xinxi-tianchong",confirm:"icon-tishi-tianchong",warning:"icon-tishi-tianchong",error:"icon-shibai",success:"icon-chenggong"},m);if(e[n]){const{destroy:t}=e[n]({..._,icon:null,wrapClassName:r()(o["confirm-modal-wrap"],u,{[o["is-danger"]]:c}),title:(0,h.jsx)(a.Space,{direction:"vertical",onClick:e=>{e.stopPropagation()},children:i&&(0,h.jsxs)(a.Space,{size:0,align:"start",className:o.title,children:[c?(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?g:n)),type:l||v["confirm"===n?g:n]}):null,i]})}),content:(0,h.jsxs)(a.Space,{size:0,align:"start",className:r()(o.content,{[o["has-title"]]:i}),children:[!i&&c?(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?g:n)),type:l||v["confirm"===n?g:n]}):null,p]})});s.close=t}return s}},N=j,w=e=>{let{items:t,className:s,activeKey:n,withDecorator:l,defaultActiveKey:o,onChange:i,...c}=e;return{...c,className:r()(s,"tabs-modal"),withDecorator:e=>{const s=s=>(0,h.jsx)(a.Tabs,{items:t.map((t=>{let{withDecorator:n,...a}=t;return Object.assign({},a,{children:"function"===typeof n?n((t=>e(Object.assign({},s,t,{children:a.children})))):e(Object.assign({},s,{children:a.children}))})})),destroyInactiveTabPane:!0,activeKey:n,defaultActiveKey:o,onChange:i});return"function"===typeof l?l(s):s()},children:e=>{let{children:t,...s}=e;return"function"===typeof t?t(s):t}}},O=e=>(0,h.jsx)(N,{...w(e)}),P=()=>{const e=b();return t=>e(w(t))};var I=s(73025);const L=e=>{const t=P();return(0,h.jsx)(I.A,{...e,modalFunc:t})},k=e=>{const t=b();return(0,h.jsx)(I.A,{...e,modalFunc:t})}},25438:(e,t,s)=>{s.d(t,{A:()=>n});const n={"search-input":"common_search-input__P6qLg__+Svgs","is-popup":"common_is-popup__fJq+g__+Svgs",list:"common_list__TKFzS__+Svgs","list-item":"common_list-item__ASse7__+Svgs","is-selected":"common_is-selected__-PU4Y__+Svgs","item-label":"common_item-label__u+qz1__+Svgs","item-des":"common_item-des__no2z0__+Svgs"}}}]);
|
|
2
|
+
//# sourceMappingURL=36.ec11950f.chunk.js.map
|