@kne-components/components-core 0.2.18 → 0.2.19
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.b62a0a46.chunk.css +2 -0
- package/build/static/css/{1151.9ece0968.chunk.css.map → 1151.b62a0a46.chunk.css.map} +1 -1
- package/build/static/css/1153.26b68e3d.chunk.css +2 -0
- package/build/static/css/{1153.26c56643.chunk.css.map → 1153.26b68e3d.chunk.css.map} +1 -1
- package/build/static/css/1154.6ce4d1ce.chunk.css +2 -0
- package/build/static/css/{1154.92e0cef9.chunk.css.map → 1154.6ce4d1ce.chunk.css.map} +1 -1
- package/build/static/css/1454.1ce92048.chunk.css +2 -0
- package/build/static/css/{1454.7c4477fa.chunk.css.map → 1454.1ce92048.chunk.css.map} +1 -1
- package/build/static/css/1554.6bdfd8b6.chunk.css +2 -0
- package/build/static/css/{1554.3ea29969.chunk.css.map → 1554.6bdfd8b6.chunk.css.map} +1 -1
- package/build/static/css/{2503.f0422b14.chunk.css → 2503.9dcf8e36.chunk.css} +2 -2
- package/build/static/css/{2503.f0422b14.chunk.css.map → 2503.9dcf8e36.chunk.css.map} +1 -1
- package/build/static/css/{2517.7e8e9d10.chunk.css → 2517.c1ea5948.chunk.css} +2 -2
- package/build/static/css/{2517.7e8e9d10.chunk.css.map → 2517.c1ea5948.chunk.css.map} +1 -1
- package/build/static/css/2716.f501e646.chunk.css +2 -0
- package/build/static/css/{2716.715705fe.chunk.css.map → 2716.f501e646.chunk.css.map} +1 -1
- package/build/static/css/{2730.e366ad70.chunk.css → 2730.ed9213b5.chunk.css} +2 -2
- package/build/static/css/{2730.e366ad70.chunk.css.map → 2730.ed9213b5.chunk.css.map} +1 -1
- package/build/static/css/{289.120cb10b.chunk.css → 289.e0ea33d4.chunk.css} +2 -2
- package/build/static/css/{289.120cb10b.chunk.css.map → 289.e0ea33d4.chunk.css.map} +1 -1
- package/build/static/css/{3142.3098d764.chunk.css → 3142.bd58b245.chunk.css} +2 -2
- package/build/static/css/{3142.3098d764.chunk.css.map → 3142.bd58b245.chunk.css.map} +1 -1
- package/build/static/css/3333.f73580a7.chunk.css +2 -0
- package/build/static/css/{3333.70b0a061.chunk.css.map → 3333.f73580a7.chunk.css.map} +1 -1
- package/build/static/css/{3843.9b3df104.chunk.css → 3843.e194fb98.chunk.css} +2 -2
- package/build/static/css/{3843.9b3df104.chunk.css.map → 3843.e194fb98.chunk.css.map} +1 -1
- package/build/static/css/4029.34ed89fc.chunk.css +2 -0
- package/build/static/css/{4029.19601758.chunk.css.map → 4029.34ed89fc.chunk.css.map} +1 -1
- package/build/static/css/4265.9dd523a1.chunk.css +2 -0
- package/build/static/css/{4265.d066d3e0.chunk.css.map → 4265.9dd523a1.chunk.css.map} +1 -1
- package/build/static/css/4666.bbdf0532.chunk.css +2 -0
- package/build/static/css/{4666.f8fecae2.chunk.css.map → 4666.bbdf0532.chunk.css.map} +1 -1
- package/build/static/css/5443.3b77faae.chunk.css +2 -0
- package/build/static/css/{5443.945db84d.chunk.css.map → 5443.3b77faae.chunk.css.map} +1 -1
- package/build/static/css/5600.6e93098d.chunk.css +2 -0
- package/build/static/css/{5600.1e446cf5.chunk.css.map → 5600.6e93098d.chunk.css.map} +1 -1
- package/build/static/css/{5873.ecec28f5.chunk.css → 5873.53c523b7.chunk.css} +2 -2
- package/build/static/css/{5873.ecec28f5.chunk.css.map → 5873.53c523b7.chunk.css.map} +1 -1
- package/build/static/css/{5996.32912f4a.chunk.css → 5996.7dffc103.chunk.css} +2 -2
- package/build/static/css/{5996.32912f4a.chunk.css.map → 5996.7dffc103.chunk.css.map} +1 -1
- package/build/static/css/{6611.64be6858.chunk.css → 6611.d8476515.chunk.css} +2 -2
- package/build/static/css/{6611.64be6858.chunk.css.map → 6611.d8476515.chunk.css.map} +1 -1
- package/build/static/css/6779.2e724d89.chunk.css +2 -0
- package/build/static/css/{6779.e919416a.chunk.css.map → 6779.2e724d89.chunk.css.map} +1 -1
- package/build/static/css/7121.eed5972d.chunk.css +2 -0
- package/build/static/css/{7121.6805366e.chunk.css.map → 7121.eed5972d.chunk.css.map} +1 -1
- package/build/static/css/7227.ca6e7f8b.chunk.css +2 -0
- package/build/static/css/{7227.336533bd.chunk.css.map → 7227.ca6e7f8b.chunk.css.map} +1 -1
- package/build/static/css/8017.897324af.chunk.css +2 -0
- package/build/static/css/{8017.e0a47291.chunk.css.map → 8017.897324af.chunk.css.map} +1 -1
- package/build/static/css/{8725.9b17e317.chunk.css → 8725.4bf25476.chunk.css} +2 -2
- package/build/static/css/{8725.9b17e317.chunk.css.map → 8725.4bf25476.chunk.css.map} +1 -1
- package/build/static/css/9968.16bbe983.chunk.css +2 -0
- package/build/static/css/{9968.1d4992d6.chunk.css.map → 9968.16bbe983.chunk.css.map} +1 -1
- package/build/static/js/{1106.0808aa44.chunk.js → 1106.ea4beed9.chunk.js} +2 -2
- package/build/static/js/{1106.0808aa44.chunk.js.map → 1106.ea4beed9.chunk.js.map} +1 -1
- package/build/static/js/{1153.64e33657.chunk.js → 1153.c6ac48e2.chunk.js} +3 -3
- package/build/static/js/{1153.64e33657.chunk.js.map → 1153.c6ac48e2.chunk.js.map} +1 -1
- package/build/static/js/{1154.42511af5.chunk.js → 1154.5b9402d8.chunk.js} +2 -2
- package/build/static/js/1154.5b9402d8.chunk.js.map +1 -0
- package/build/static/js/1454.fa2294da.chunk.js +3 -0
- package/build/static/js/{1454.9a98280d.chunk.js.map → 1454.fa2294da.chunk.js.map} +1 -1
- package/build/static/js/1554.5dad89e6.chunk.js +3 -0
- package/build/static/js/{1554.f82d0139.chunk.js.map → 1554.5dad89e6.chunk.js.map} +1 -1
- package/build/static/js/2503.a07ff447.chunk.js +2 -0
- package/build/static/js/{2503.3bd2a3d8.chunk.js.map → 2503.a07ff447.chunk.js.map} +1 -1
- package/build/static/js/2517.d13df720.chunk.js +2 -0
- package/build/static/js/{2517.1e69f1c5.chunk.js.map → 2517.d13df720.chunk.js.map} +1 -1
- package/build/static/js/2716.6151f538.chunk.js +3 -0
- package/build/static/js/{2716.b72822b4.chunk.js.map → 2716.6151f538.chunk.js.map} +1 -1
- package/build/static/js/2730.53414d5e.chunk.js +2 -0
- package/build/static/js/{2730.077b9b90.chunk.js.map → 2730.53414d5e.chunk.js.map} +1 -1
- package/build/static/js/2814.24db70f4.chunk.js +2 -0
- package/build/static/js/{2814.00baadb3.chunk.js.map → 2814.24db70f4.chunk.js.map} +1 -1
- package/build/static/js/{289.f82501c0.chunk.js → 289.18f2b53a.chunk.js} +2 -2
- package/build/static/js/{289.f82501c0.chunk.js.map → 289.18f2b53a.chunk.js.map} +1 -1
- package/build/static/js/{3142.f469a4dc.chunk.js → 3142.48308dbb.chunk.js} +2 -2
- package/build/static/js/{3142.f469a4dc.chunk.js.map → 3142.48308dbb.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.5f2df437.chunk.js} +2 -2
- package/build/static/js/{3333.7a95660d.chunk.js.map → 3333.5f2df437.chunk.js.map} +1 -1
- package/build/static/js/36.4ae1c1f1.chunk.js +2 -0
- package/build/static/js/{36.c88da7cd.chunk.js.map → 36.4ae1c1f1.chunk.js.map} +1 -1
- package/build/static/js/{3843.9faba580.chunk.js → 3843.e1ad2ca0.chunk.js} +2 -2
- package/build/static/js/{3843.9faba580.chunk.js.map → 3843.e1ad2ca0.chunk.js.map} +1 -1
- package/build/static/js/{4029.9b9a8bcc.chunk.js → 4029.6461d512.chunk.js} +2 -2
- package/build/static/js/4029.6461d512.chunk.js.map +1 -0
- package/build/static/js/4265.48fd8a97.chunk.js +2 -0
- package/build/static/js/{4265.780e572b.chunk.js.map → 4265.48fd8a97.chunk.js.map} +1 -1
- package/build/static/js/{4666.ef32bda0.chunk.js → 4666.90aad599.chunk.js} +3 -3
- package/build/static/js/{4666.ef32bda0.chunk.js.map → 4666.90aad599.chunk.js.map} +1 -1
- package/build/static/js/5443.5fc68fc4.chunk.js +2 -0
- package/build/static/js/{5443.6edd0f1b.chunk.js.map → 5443.5fc68fc4.chunk.js.map} +1 -1
- package/build/static/js/5600.2e0c1827.chunk.js +2 -0
- package/build/static/js/{5600.7b152df4.chunk.js.map → 5600.2e0c1827.chunk.js.map} +1 -1
- package/build/static/js/{5873.478c105e.chunk.js → 5873.1a59f898.chunk.js} +2 -2
- package/build/static/js/{5873.478c105e.chunk.js.map → 5873.1a59f898.chunk.js.map} +1 -1
- package/build/static/js/{5996.61df8d3a.chunk.js → 5996.d9e6b139.chunk.js} +2 -2
- package/build/static/js/{5996.61df8d3a.chunk.js.map → 5996.d9e6b139.chunk.js.map} +1 -1
- package/build/static/js/{6569.8ede8882.chunk.js → 6569.abfd3311.chunk.js} +2 -2
- package/build/static/js/{6569.8ede8882.chunk.js.map → 6569.abfd3311.chunk.js.map} +1 -1
- package/build/static/js/6611.1f171d6f.chunk.js +2 -0
- package/build/static/js/{6611.452dc755.chunk.js.map → 6611.1f171d6f.chunk.js.map} +1 -1
- package/build/static/js/6779.36115c53.chunk.js +2 -0
- package/build/static/js/{6779.8d474307.chunk.js.map → 6779.36115c53.chunk.js.map} +1 -1
- package/build/static/js/6915.bc30742e.chunk.js +2 -0
- package/build/static/js/{6915.1145718f.chunk.js.map → 6915.bc30742e.chunk.js.map} +1 -1
- package/build/static/js/7121.e32ec3f6.chunk.js +2 -0
- package/build/static/js/{7121.5637a35b.chunk.js.map → 7121.e32ec3f6.chunk.js.map} +1 -1
- package/build/static/js/{7227.db8e2bcd.chunk.js → 7227.5e62b993.chunk.js} +3 -3
- package/build/static/js/{7227.db8e2bcd.chunk.js.map → 7227.5e62b993.chunk.js.map} +1 -1
- package/build/static/js/{7790.8a284137.chunk.js → 7790.b13a7921.chunk.js} +2 -2
- package/build/static/js/{7790.8a284137.chunk.js.map → 7790.b13a7921.chunk.js.map} +1 -1
- package/build/static/js/{8017.3c30274e.chunk.js → 8017.58ebd894.chunk.js} +2 -2
- package/build/static/js/{8017.3c30274e.chunk.js.map → 8017.58ebd894.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.0b820018.chunk.js} +2 -2
- package/build/static/js/{8725.3dc0b988.chunk.js.map → 8725.0b820018.chunk.js.map} +1 -1
- package/build/static/js/{9968.2b6a3cf0.chunk.js → 9968.f5340652.chunk.js} +2 -2
- package/build/static/js/{9968.2b6a3cf0.chunk.js.map → 9968.f5340652.chunk.js.map} +1 -1
- package/build/static/js/{main.ac48a622.js → main.08c1ed8c.js} +2 -2
- package/build/static/js/{main.ac48a622.js.map → main.08c1ed8c.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/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/2716.715705fe.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/4265.d066d3e0.chunk.css +0 -2
- package/build/static/css/4666.f8fecae2.chunk.css +0 -2
- package/build/static/css/5443.945db84d.chunk.css +0 -2
- package/build/static/css/5600.1e446cf5.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/9968.1d4992d6.chunk.css +0 -2
- package/build/static/js/1154.42511af5.chunk.js.map +0 -1
- package/build/static/js/1454.9a98280d.chunk.js +0 -3
- package/build/static/js/1554.f82d0139.chunk.js +0 -3
- package/build/static/js/2503.3bd2a3d8.chunk.js +0 -2
- 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/7121.5637a35b.chunk.js +0 -2
- package/build/static/js/8620.0bbfd66d.chunk.js.map +0 -1
- /package/build/static/js/{1153.64e33657.chunk.js.LICENSE.txt → 1153.c6ac48e2.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1454.9a98280d.chunk.js.LICENSE.txt → 1454.fa2294da.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1554.f82d0139.chunk.js.LICENSE.txt → 1554.5dad89e6.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2716.b72822b4.chunk.js.LICENSE.txt → 2716.6151f538.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4666.ef32bda0.chunk.js.LICENSE.txt → 4666.90aad599.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7227.db8e2bcd.chunk.js.LICENSE.txt → 7227.5e62b993.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:()=>
|
|
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:()=>w,ImagePreview:()=>R,OSSFilePreview:()=>A,OfficePreview:()=>g,PdfPreview:()=>S,TextPreview:()=>C,UnknownPreview:()=>L,default:()=>z});var r=s(63114),a=s.n(r),n=s(73884),c=s(13050),l=s(83136),i=s.n(l);const o="style_container__9Fu-3__Cwdbl",d="style_loading__r3aiE__Cwdbl",m="style_text-outer__TzhuG__Cwdbl",u="style_error__wSaxt__Cwdbl",p="style_html-preview-iframe__bQQiA__Cwdbl";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})})),w=e=>{let{className:t,url:s,maxWidth:r}=e;return(0,x.jsx)("div",{className:i()(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 j=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:l}=(0,j.usePreset)(),i=Object.assign({},n,s);return(0,x.jsx)(_,{...a,...i.previewOffice||{loader:async e=>{var t;let{data:s}=e;const{data:r}=await l(Object.assign({},i.oss,null!==(t=i.oss)&&void 0!==t&&t.url?{url:(i.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),y=(s(71975),s(36));const b=(0,n.memo)((e=>{let{url:t,maxWidth:s,scale:r,rotate:a,className:l}=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,y.useResize)((()=>{f.current&&f.current.clientWidth&&h(Math.min(f.current.clientWidth,s))}));return(0,x.jsx)("div",{ref:f,className:i()(l,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))))})})})}));b.defaultProps={autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200};const S=b;var E=s(91409),W=s.n(E),k=s(89946),F=s.n(k);const C=e=>{let{url:t,className:s,maxWidth:r}=e;const[a,c]=(0,n.useState)(""),[l,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:i()(s,o),style:{maxWidth:r},children:[l?(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})})]})},L=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"})})})},R=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[l,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:i()(a,o),style:{maxWidth:c},children:[l?(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"})]})},U=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=U,D={txt:C,pdf:S,image:R,html:w,office:g,unknown:L},T=e=>D[U(e)];const A=(0,s(97211).A)((e=>{let{data:t,id:s,staticUrl:r,className:a,...n}=e;const{staticUrl:c}=(0,j.usePreset)(),l=r||c||"",i=T(t);return"office"===O(t)?(0,x.jsx)(g,{...n,id:s,className:a}):(0,x.jsx)(i,{...n,className:a,url:/^https?:\/\//.test(t)?t:l+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.5f2df437.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/js/3333.7a95660d.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4BAA1gB,EAA0pB,0C,0BCM1pB,MAAMA,EAAiBC,IACrB,IAAK,eAAeC,KAAKD,GACvB,OAAO,EAET,MAAME,EAAa,IAAIC,IAAIC,OAAOC,SAASC,MACrCC,EAAY,IAAIJ,IAAIH,GAC1B,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AII,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.5f2df437.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4BAA1gB,EAA0pB,0C,0BCM1pB,MAAMA,EAAiBC,IACrB,IAAK,eAAeC,KAAKD,GACvB,OAAO,EAET,MAAME,EAAa,IAAIC,IAAIC,OAAOC,SAASC,MACrCC,EAAY,IAAIJ,IAAIH,GAC1B,MAAO,CAAC,WAAY,WAAY,QAAQQ,MACrCC,GAASP,EAAWO,KAAUF,EAAUE,IAC1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tF,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__Cwdbl\",\"container-html\":\"style_container-html__IsNVq__Cwdbl\",\"html-inner\":\"style_html-inner__S05cI__Cwdbl\",\"loading\":\"style_loading__r3aiE__Cwdbl\",\"control-bar\":\"style_control-bar__kTKau__Cwdbl\",\"scroller\":\"style_scroller__HOq7b__Cwdbl\",\"outer\":\"style_outer__ntu--__Cwdbl\",\"file-name\":\"style_file-name__UPbbe__Cwdbl\",\"file-options\":\"style_file-options__5TE5l__Cwdbl\",\"scale-input\":\"style_scale-input__JdF1K__Cwdbl\",\"text-outer\":\"style_text-outer__TzhuG__Cwdbl\",\"error\":\"style_error__wSaxt__Cwdbl\",\"text-inner\":\"style_text-inner__jdi-A__Cwdbl\",\"image-inner\":\"style_image-inner__zTiFU__Cwdbl\",\"html-preview-iframe\":\"style_html-preview-iframe__bQQiA__Cwdbl\"};","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,l)=>{l.d(t,{A:()=>n});l(73884);const n=l.p+"static/media/defaultAvatar.b1f2a8046cc7bee36d9a404ce6a0a1d7.svg"},93761:(e,t,l)=>{l.d(t,{qn:()=>R,TM:()=>G,LH:()=>L,Ay:()=>E,NY:()=>k,DF:()=>D});var n=l(30509),a=l(25438),s=l(55199),r=l(27047),o=l(83136),i=l.n(o),c=l(64671),d=l(73884),u=l(21485),p=l(56434),m=l.n(p),h=l(15797),_=l.n(h),g=l(33097),f=l.n(g);const C="style_address__DIuRX__Cwdbl",x="style_is-popup__tqVvp__Cwdbl",y="style_title__FAe12__Cwdbl",v="style_scroll-box__JWiDl__Cwdbl",b="style_scroll-plus-box__lidEW__Cwdbl",w="style_content__lAARZ__Cwdbl",j="style_col-left__WPfeS__Cwdbl",A="style_col-right__z0e9-__Cwdbl";var N=l(87558);const S=e=>({"en-US":()=>l.e(3691).then(l.bind(l,83691)),"zh-CN":()=>l.e(2253).then(l.bind(l,32253))}[e]());var O=l(58609),P=l(70579);const I=n.A.useContext,L=e=>{let{city:t,province:l,country:n}=e;const a=_()((()=>{const e=[];return["gangaotai","municipality"].forEach((l=>{e.push(...t.relations[l])})),["provinces","continents"].forEach((l=>{t.relations[l].forEach((l=>{e.push(l),e.push(...t.relations[l])}))})),e.map((e=>t.list[e]))}));return{getCity:_()((e=>{const l=t.list[e];return l?{city:l,parent:l.parentCode?t.list[l.parentCode]:null}:{city:null,parent:null}})),getChinaHotCities:_()((()=>t.relations[2].map((e=>t.list[e])))),getChinaCities:_()((()=>["2",...l.relations.municipality,...l.relations.provinces,"gangaotai"].map((e=>Object.assign({id:e},t.list[e]))))),getCountries:_()((()=>["1",...n.relations.continents].map((e=>Object.assign({id:e},n.list[e]))))),getList:_()(((e,a)=>{const{showChinaQuan:s,showForeignQuan:r}=Object.assign({},a);if("gangaotai"===e)return l.relations.gangaotai.map((e=>t.list[e]));const o=Object.assign({},t.list[e]);if(l.relations.municipality.indexOf(e)>-1)return o.name="".concat(s?"\u5168":"")+o.name,[o];const i=t.relations[e].map((e=>t.list[e]));return l.relations.provinces.indexOf(e)>-1&&s&&(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:_()((e=>{let l=m()(t);return"1"===e&&l.relations[1].unshift("410"),"350"===e&&l.relations[350].unshift("410"),l.relations[e].filter((e=>l.list[e])).map((e=>l.list[e]))})),getCityByName:_()((e=>{const t=a();let l;return[t=>t.name===e,t=>t.name===e.replace(/(\u7701|\u5e02)$/,""),t=>0===e.indexOf(t.name)].find((e=>(l=t.find(e),l))),l})),combineCities:_()(((e,l)=>[...l.filter((l=>t.list[l].parentCode!==e&&t.list[e].parentCode!==l&&e!==l)),e])),searchCities:_()((e=>{if(!e)return[];return a().filter((t=>["pinyin","name","enName","spelling"].some((l=>t[l].toUpperCase().indexOf(e.toUpperCase())>-1)))).map((e=>{const l=e.parentCode?t.list[e.parentCode]:null;return{label:l?"".concat(l.name,"\xb7").concat(e.name):e.name,value:e.code}}))}))}},k=(e,t)=>"en-US"===t?f()(e,"enName"):f()(e,"name"),M={cache:"CITY_DATA",isLocal:!0,ttl:864e5,loader:()=>l.e(7820).then(l.t.bind(l,37820,19)).then((e=>e.__esModule?e.default:e))},F=e=>{let{value:t,setValue:l}=e;const{fetchApi:n,props:o}=I(),[p,m]=(0,d.useState)(""),[h,_]=(0,d.useState)("2"),{formatMessage:g}=(0,O.useIntl)({moduleName:"AddressSelect"}),{locale:f}=(0,r.A)(),{getCity:N,getChinaCities:S,getCountries:M,getList:F,searchCities:T}=(0,d.useMemo)((()=>L(n.data)),[n.data]),R=e=>{if(o.single)return void l([e]);const n=t.slice(0),a=n.indexOf(e);a>-1?n.splice(a,1):n.push(e),l(n)},D=p&&(0,P.jsx)(u.A,{className:b,children:(0,P.jsx)(s.List,{className:a.A.list,size:"small",dataSource:T(p),rowKey:"value",renderItem:e=>(0,P.jsx)(s.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()(C,{[x]:o.isPopup}),children:[(0,P.jsx)(s.Input.Search,{className:i()(a.A["search-input"],{[a.A["is-popup"]]:o.isPopup}),placeholder:o.searchPlaceholder||g({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:w,children:D||(0,P.jsxs)(s.Row,{wrap:!1,children:[(0,P.jsx)(s.Col,{className:j,children:(0,P.jsx)(s.Tabs,{centered:!0,onChange:e=>{_(e)},items:[{key:"2",label:(0,P.jsx)(O.FormattedMessage,{id:"domestic",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5185"}),children:(0,P.jsx)(u.A,{className:v,children:(0,P.jsx)(s.Menu,{selectedKeys:[h],onSelect:e=>{_(e.key)},items:S().map((e=>({label:k(e,f),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:v,children:(0,P.jsx)(s.Menu,{selectedKeys:[h],onSelect:e=>{_(e.key)},items:M().map((e=>({label:k(e,f),key:e.id})))})})}]})}),(0,P.jsxs)(s.Col,{flex:1,className:A,children:[(0,P.jsx)(s.Divider,{className:y,orientation:"left",children:k(N(h).city,f)}),(0,P.jsx)(u.A,{className:v,children:(0,P.jsx)(s.Space,{wrap:!0,children:F(h,{showChinaQuan:o.showChinaQuan,showForeignQuan:o.showForeignQuan}).map((e=>(0,P.jsx)(s.Tag.CheckableTag,{checked:t.indexOf(e.code)>-1,onChange:()=>{R(e.code)},children:k(e,f)},e.code)))})})]})]})})]})},T=e=>(0,P.jsx)(n.A,{...e,children:e=>{let{value:t,setValue:l}=e;return(0,P.jsx)(O.IntlProvider,{moduleName:"AddressSelect",importMessages:S,children:(0,P.jsx)(F,{value:t,setValue:l})})}});T.defaultProps={overlayWidth:"500px",isPopup:!0,api:M,dataFormat:(e,t)=>{let{city:l}=e;const{locale:n}=Object.assign({},t);return{list:Object.values(l.list).map((e=>Object.assign({},e,{value:e.code,label:k(e,n)})))}}};const R=(0,N.withFetch)((e=>{let{name:t,data:l,getAddressApi:n,children:a,...s}=e;const{locale:o}=(0,r.A)(),i=(0,d.useMemo)((()=>L(l)),[l]);return n?a(i):a(i.getCity(t),Object.assign({},s,{locale:o}))}));R.defaultProps={...M,displayParent:!1,children:(e,t)=>{let{city:l,parent:n}=e,{displayParent:a,locale:s}=t;return a&&n?"".concat(k(n,s),"\xb7").concat(k(l,s)):k(l,s)}};const D=e=>{const t=(0,N.withFetch)((t=>{let{data:l,...n}=t;const a=(0,d.useMemo)((()=>L(l)),[l]);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=l(10986),V=l.n(z),W=l(78491),U=l.n(W),B=l(20492),K=l(22616),q=l.n(K),H=l(1488),Q=l.n(H);const Z=e=>{const{isPopup:t,size:l,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)(s.Row,{gutter:10,children:[(0,P.jsx)(s.Col,{span:12,children:(0,P.jsx)(E,{...q()(i,u),className:o,disabled:n,single:!0,size:l,value:f()(c,"city"),onChange:e=>{d({city:e,detail:f()(c,"detail")})}})}),(0,P.jsx)(s.Col,{span:12,children:(0,P.jsx)(s.Input,{...Q()(i,u),className:o,placeholder:a||p({id:"pleaseInput"}),disabled:n,size:l,value:f()(c,"detail"),onChange:e=>{d({city:f()(c,"city"),detail:e.target.value})}})})]})})};Z.defaultProps={};const G=(0,O.createWithIntl)({importMessages:B.A,moduleName:"Common"})(Z)},12392:(e,t,l)=>{l.d(t,{Bm:()=>W,Eo:()=>z,NR:()=>j,Ay:()=>U});var n=l(55199),a=l(83136),s=l.n(a),r=l(30509),o=l(25438),i=l(26475),c=l(33097),d=l.n(c),u=l(34677),p=l.n(u);const m="create-list_scroll-loader__zoaS7__Cwdbl",h="create-list_is-popup__t3d-G__Cwdbl",_="create-list_is-not-full__FXtX1__Cwdbl",g="create-list_search-input__tV3vf__Cwdbl",f="create-list_left__EXr3i__Cwdbl",C="create-list_list-header__3xeJa__Cwdbl",x="create-list_is-modal__BMfya__Cwdbl";var y=l(73161),v=l(58609),b=l(70579);const w=r.A.useContext,j=e=>{let{renderList:t,defaultProps:l}=e;const a=e=>{let{value:l,setValue:a}=e;const{fetchApi:r,searchText:c,setSearchText:u,props:j,mapping:A}=w(),N=Object.assign({},{paramsType:"data",current:"currentPage",pageSizeName:"perPage",pageSize:20},j.pagination),S=d()(r.requestParams,[N.paramsType,N.current],1),O=d()(r.requestParams,[N.paramsType,N.pageSizeName])||N.pageSize,{formatMessage:P}=(0,v.useIntl)({moduleName:"Common"}),I=j.dataFormat(r.data),{right:L,leftBottom:k,leftSpan:M=24}=j,F=1===l.length&&"all"===l[0];return(0,b.jsxs)(n.Row,{wrap:!1,className:L?s()("is-not-full",_):"",children:[(0,b.jsxs)(n.Col,{span:M,className:s()(f,"advance-select-left"),children:[j.getSearchProps?(0,b.jsx)(y.A,{isPopup:j.isPopup,className:s()(g,o.A["search-input"],{[o.A["is-popup"]]:j.isPopup}),placeholder:j.searchPlaceholder||P({id:"search"}),value:c,onSearch:e=>{r.reload(j.getSearchProps(e)),u(e)}}):null,j.single||!j.showSelectedCount&&!j.allowSelectAll?null:(0,b.jsxs)(n.Flex,{className:s()(C,{[x]:!j.isPopup}),justify:"space-between",children:[j.showSelectedCount?(0,b.jsxs)(n.Space,{children:[(0,b.jsx)(n.Typography,{children:"\u5df2\u9009:"}),(0,b.jsx)(n.Typography.Link,{children:F?j.allLabel||(0,b.jsx)(v.FormattedMessage,{id:"all",moduleName:"Common"}):"".concat(l.length).concat(j.countUnit||P({id:"items"}))})]}):(0,b.jsx)("div",{}),j.allowSelectAll?(0,b.jsx)("div",{children:(0,b.jsx)(n.Checkbox,{checked:F,onChange:e=>{a(e.target.checked?[j.allValue||"all"]:[])},children:(0,b.jsx)(v.FormattedMessage,{id:"selectAll",moduleName:"Common",values:{label:j.allLabel||(0,b.jsx)(v.FormattedMessage,{id:"all",moduleName:"Common"})}})})}):(0,b.jsx)("div",{})]}),(0,b.jsx)(i.A,{completeTips:"",isLoading:!r.isComplete,className:s()(m,{[h]:j.isPopup}),noMore:!I.total||S*O>=I.total,onLoader:async()=>{console.log("on loader"),await r.loadMore(p()({[N.paramsType]:{[N.pageSizeName]:O,[N.current]:S+1}},j.getSearchProps&&j.getSearchProps(c)),j.mergeList)},children:t({props:j,value:l,setValue:a,list:I.list,itemIsSelected:e=>l.indexOf(e.value)>-1,isSelectedAll:F,onSelect:e=>{if(j.single)return void a([e.value]);const t=l.slice(0),n=t.indexOf(e.value);n>-1?t.splice(n,1):t.push(e.value),a(t)}})}),k&&k({fetchApi:r,value:l,mapping:A})]}),L&&L({value:l,mapping:A,fetchApi:r})]})},c=e=>{let{extra:t,...l}=e;return(0,b.jsx)(r.A,{...l,extra:t,children:e=>{let{value:t,setValue:l}=e;return(0,b.jsx)(a,{value:t,setValue:l})}})};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})},l),c},A="list_list__TGynD__Cwdbl",N="list_list-item__WSswf__Cwdbl",S="list_is-selected__6Wkgt__Cwdbl",O="list_item-label__bYzhe__Cwdbl",P="list_item-des__2nsEn__Cwdbl",I="list_is-disabled__qxCvO__Cwdbl",L="list_is-selected-all__Mp-hG__Cwdbl";var k=l(40438),M=l(64671);const F="user_list-inner__V508e__Cwdbl",T="user_list-info__y2nWo__Cwdbl",R="user_selected-icon__9OQJL__Cwdbl",D="user_item-des__o+7UR__Cwdbl",E="user_is-selected-all__2q0VZ__Cwdbl",z=j({renderList:e=>{let{list:t,onSelect:l,itemIsSelected:a,isSelectedAll:r}=e;return(0,b.jsx)(n.List,{size:"small",className:s()(A,{[L]:r,[E]:r}),dataSource:t,renderItem:e=>{const t=a(e);return(0,b.jsx)(n.List.Item,{className:s()(N,{[S]:t}),onClick:()=>l(e),children:(0,b.jsxs)(n.Row,{wrap:!1,align:"middle",className:F,children:[(0,b.jsx)(n.Col,{children:(0,b.jsx)(k.default.Avatar,{...Object.assign({},e.avatar),size:40,gender:"M"})}),(0,b.jsx)(n.Col,{className:T,flex:1,children:(0,b.jsxs)(n.Space,{direction:"vertical",children:[(0,b.jsx)("span",{className:O,children:e.label}),e.description&&(0,b.jsx)("span",{className:D,children:e.description})]})}),(0,b.jsx)(n.Col,{children:r||t?(0,b.jsx)(M.default,{className:R,type:"icon-gouxuan"}):null})]})})}})}}),V={"is-selected-all":"table_is-selected-all__IwXUY__Cwdbl"},W=j({defaultProps:{overlayWidth:"450px"},renderList:e=>{let{props:t,list:l,onSelect:a,value:r,setValue:o,itemIsSelected:i,isSelectedAll:c}=e;return(0,b.jsx)(n.Table,{className:s()(V.list,A,{[L]:c,[V["is-selected-all"]]:c}),size:"small",dataSource:l,columns:t.columns,rowClassName:e=>s()({"ant-table-row-selected":i(e)}),rowKey:t.rowKey||"value",pagination:!1,rowSelection:t.single?null:c?{selectedRowKeys:l.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=j({renderList:e=>{let{props:t,list:l,itemIsSelected:a,isSelectedAll:r,onSelect:o}=e;const{listClassName:i="",selectIcon:c=null}=t||{};return(0,b.jsx)(n.List,{className:s()(A,i,{[L]:r}),size:"small",dataSource:l,renderItem:e=>{var l;const i=a(e);return(0,b.jsxs)(n.List.Item,{className:s()(N,{[S]:t.single&&i,[I]:r||e.disabled}),onClick:()=>{e.disabled||o(e)},children:[(0,b.jsxs)(n.Row,{wrap:!1,children:[t.single?null:(0,b.jsx)(n.Col,{children:(0,b.jsx)(n.Checkbox,{checked:r||i,disabled:r||e.disabled})}),(0,b.jsx)(n.Col,{children:(0,b.jsxs)(n.Space,{className:null!==(l=null===e||void 0===e?void 0:e.className)&&void 0!==l?l:"",children:[(0,b.jsx)("span",{className:O,children:e.label}),e.description&&(0,b.jsx)("span",{className:P,children:e.description})]})})]}),i&&c]})}})}})},45776:(e,t,l)=>{l.d(t,{yK:()=>L,ON:()=>h,Ay:()=>R});var n=l(30509),a=l(73884),s=l(96418),r=l.n(s),o=l(55199),i=l(64671),c=l(73161),d=l(33097),u=l.n(d),p=l(79686),m=l.n(p);const h=e=>{const t=Array.from(e.values()),l=t.filter((e=>null===e.parentId)),n=(e,t)=>{const l=e.indexOf(t);l>-1&&e.splice(l,1)},a=t=>{const l=[],n=t=>{const a=e.get(t);a&&Array.isArray(a.children)&&a.children.length>0&&(l.push(...a.children),a.children.forEach((e=>{n(e.id)})))};return n(t),l},s=(t,l)=>{const n=t=>{const a=e.get(t);return a?l(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 l;return e.get(a).children},o=(()=>{const e=l=>Array.isArray(l)&&l.length>0?l.map((l=>{const n=t.filter((e=>e.parentId===l.id));return Object.assign({},l,{children:e(n)})})):null;return e(l)})();return{mapping:e,getSelectedQueue:t=>{const l=e.get(t);if(!l)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},s=function(t){const l=[t,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]],n=e.get(t);return!n||m()(n.parentId)?l:s(n.parentId,l)},r=n(l);return s(u()(r,"id"))},getAllChildren:a,computedCheckboxStatus:function(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(s(t,(e=>l.indexOf(e.id)>-1)))return{checked:!0,indeterminate:!1};const n=(t=>{const n=t=>{const a=e.get(t);return a?(s=a,l.indexOf(s.id)>-1?a:Array.isArray(a.children)&&a.children.length>0?a.children.find((e=>!!n(e.id))):void 0):null;var s};return!!n(t)})(t);return n?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1}},getSiblingNode:r,findInParents:s,setNodeChecked:function(t){const l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),s=t=>{const o=e.get(t);if(!o)return;l.push(t),a(t).forEach((e=>{n(l,e.id)}));const i=r(t),c=i.every((e=>l.indexOf(e.id)>-1));o.parentId&&c&&(i.forEach((e=>{n(l,e.id)})),s(o.parentId))};return s(t),l},setNodeUnchecked:function(t){const l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),a=t=>{const s=e.get(t);if(!s)return;if(l.indexOf(s.id)>-1)return void n(l,s.id);const o=r(t);s.parentId&&(o.forEach((e=>{t!==e.id&&l.push(e.id)})),a(s.parentId))};return a(t),l},treeData:o,treeMapping:new Map(o.map((e=>[e.id,e])))}};var _=l(74065),g=l.n(_),f=l(19853),C=l.n(f),x=l(17342),y=l(83136),v=l.n(y);const b={content:"style_content__Hxlt9__Cwdbl",columns:"style_columns__FmtPF__Cwdbl","content-item":"style_content-item__i6HCO__Cwdbl","last-level-area":"style_last-level-area__2y7jQ__Cwdbl","is-popup":"style_is-popup__+r3Mn__Cwdbl",menu:"style_menu__WZUVE__Cwdbl","scroll-plus-box":"style_scroll-plus-box__QcTst__Cwdbl","menu-label":"style_menu-label__iGt0Z__Cwdbl","menu-item":"style_menu-item__hXHfm__Cwdbl","checkbox-hidden":"style_checkbox-hidden__Xpx7J__Cwdbl",loading:"style_loading__ZwrVe__Cwdbl"};var w=l(87558),j=l(58609),A=l(25438),N=l(70579),S=l(27047);const O=new Map,P=(0,w.withFetch)((e=>{let{data:t,name:l,type:n,cache:s,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(l);return O.set("".concat(l,"_").concat(n),c),r(c,i)})),I=e=>{const{locale:t}=(0,S.A)(),l="".concat(t,"_").concat(e.name,"_").concat(e.type),n=O.get(l);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,w.withFetch)((e=>{let{data:t,computedIsChecked:l,onSelect:n}=e;return(0,N.jsx)(x.A,{className:b["scroll-plus-box"],children:(0,N.jsx)(o.List,{className:A.A.list,size:"small",dataSource:t,rowKey:"value",renderItem:e=>{const t=l(e);return(0,N.jsx)(o.List.Item,{className:v()(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:l,size:n,selectLevel:s}=e;const{fetchApi:d,props:p}=k(),[m,_]=(0,a.useState)(""),f=r()(p.dataFormat),{formatMessage:y}=(0,j.useIntl)({moduleName:"Common"}),w=d.data,S=(0,a.useMemo)((()=>new Map(f(w).list.map((e=>[e.value,e])))),[w,f]),O=(0,a.useMemo)((()=>h(S)),[S]),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=>!!S.get(e)));return O.getSelectedQueue(e||u()(d.data.find((e=>e.children&&e.children.length>0)),"id")||u()(d.data,"[0].id"),S)}));(0,a.useEffect)((()=>{const{openLoadData:e,loadMore:t,parentIdKey:l,createMergeTree:n,treeUtils:a}=P.current;if(!e)return;const s=S.get(g()(I));if(!s)return;const r=a.getSelectedQueue(s.id);C()(I,r)?s.hasOwnProperty("children")||t({data:{[l]:s.id}},n(s.id)):L(r)}),[I,S]);const F=(e,a)=>{const s=(()=>{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)})();s.length>n?o.message.error(y({id:"maxSelectedCount"},{count:n})):l(p.single&&s.length>0?[g()(s)]:s)},T=e=>{const t=S.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:S})},computedIsChecked:e=>t.indexOf(e.id)>-1,onSelect:(e,t)=>{F(!t,e.id),!t&&L(O.getSelectedQueue(e.id,S)),_("")}});return(0,N.jsxs)("div",{className:v()(b.content,{[b["is-popup"]]:p.isPopup,[b["has-search"]]:R}),style:{"--menu-item-width":p.menuItemWidth},children:[R&&(0,N.jsx)(c.A,{isPopup:p.isPopup,className:v()(A.A["search-input"],{[A.A["is-popup"]]:p.isPopup}),placeholder:p.searchPlaceholder||y({id:"search"}),value:m,onSearch:e=>{_(e)}}),D||(0,N.jsx)("div",{children:(0,N.jsx)(x.A,{className:b.scroller,options:{autoHide:!1},children:(0,N.jsxs)("div",{className:b.columns,children:[I.map(((e,l)=>{const n=S.get(e),r=O.getSiblingNode(e),c=!T(null===n||void 0===n?void 0:n.id)&&l>0;return(0,N.jsx)(x.A,{className:v()(b["content-item"],{[b["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:s>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:v()(b.menu),onSelect:e=>{const l=S.get(e.key);if(l)if(T(l.id))L(O.getSelectedQueue(l.id,S));else{const{checked:e}=O.computedCheckboxStatus(l.id,t);F(!e,l.id)}},selectedKeys:l===I.length-1?[]:I,items:r.map((e=>({key:e.id,label:(0,N.jsxs)(o.Space,{className:v()(b["menu-item"],{[b["checkbox-hidden"]]:p.onlyAllowLastLevel&&T(e.id)}),children:[!p.onlyAllowLastLevel&&(0,N.jsx)(o.Checkbox,{...O.computedCheckboxStatus(e.id,t),disabled:s>1&&t.indexOf(e.parentCode)>-1,onChange:t=>F(t.target.checked,e.id)}),(0,N.jsx)("div",{className:b["menu-label"],children:e.label}),T(e.id)&&(0,N.jsx)(i.default,{className:b["menu-item-icon"],type:"icon-arrow-thin-right",size:12})]})})))})},u()(r,"[0].id",l))})),d.isComplete?null:(0,N.jsx)("div",{className:b.loading,children:(0,N.jsx)(o.Spin,{size:"small"})})]})})})]})},T=e=>{let{maxLength:t,nodeFormat:l,dataFormat:a,...s}=e;return(0,N.jsx)(n.A,{...s,dataFormat:e=>a(e,l),children:e=>{let{value:l,setValue:n}=e;return(0,N.jsx)(F,{...s,size:t,value:l,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:l}=t;return Array.from(l.values()).filter((t=>t.label.indexOf(e)>-1))},dataFormat:(e,t)=>{const l=(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(...l(e.children,e.id)),Object.assign({},e,{value:e.id,parentId:n}))))),a};return{list:l(e,null)}},createMergeTree:e=>(t,l)=>{const n=t=>t.map((t=>t.id===e?Object.assign({},t,{children:l&&l.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,l)=>{l.d(t,{A:()=>m,K:()=>p});var n=l(45776),a=l(27047),s=l(33097),r=l.n(s),o=l(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c=()=>l.e(719).then(l.t.bind(l,10719,19)).then((e=>e.__esModule?e.default:e)),d={cache:"FUNCTION_DATA",isLocal:!0,ttl:864e5,loader:c},u=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.Ay,{...l,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:l}=(0,n.ON)(new Map(t.map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return l}},c.functionData)})};u.defaultProps={overlayWidth:"640px",getSearchProps:e=>({data:{searchText:e}})},u.defaultData=c;const p=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.yK,{...l,...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,l)=>{l.d(t,{A:()=>p,W:()=>u});var n=l(45776),a=l(27047),s=l(33097),r=l.n(s),o=l(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c={cache:"INDUSTRY_DATA",isLocal:!0,ttl:864e5,loader:()=>l.e(7183).then(l.t.bind(l,57183,19)).then((e=>e.__esModule?e.default:e))},d=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.Ay,{...l,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:l}=(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 l}},d.industryData)})};d.defaultProps={overlayWidth:"635px"};const u=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.yK,{...l,...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,l)=>{l.d(t,{A:()=>_});var n=l(73884),a=l(55199),s=l(96418),r=l.n(s),o=l(21485),i=l(83136),c=l.n(i),d=l(51941);const u="style_scroller-no-more__EH2J+__Cwdbl";var p=l(70579);const m=e=>{let{getScrollerRef:t,loadMore:l,maxFullCount:a}=e;const s=r()(l),o=r()(t);return(0,n.useEffect)((()=>{let e=a;const t=o(),l=async()=>{t.clientHeight===t.scrollHeight&&e>0&&(await s().then((()=>new Promise((e=>{setTimeout(e,500)})))),e--,await l())};l()}),[a,s,o]),null},h=(0,n.forwardRef)(((e,t)=>{let{className:l,noMore:s,onLoader:i,isLoading:h,completeTips:_,maxFullCount:g,children:f}=e;const[C,x]=(0,n.useState)(!1),y=(0,n.useRef)(),v=r()(i),b=(0,n.useRef)(!s&&!h);b.current=!s&&!h,(0,n.useImperativeHandle)(t,(()=>y.current),[]);const w=(0,d.useThrottledCallback)((e=>{const t=e.target;b.current&&t.clientHeight+t.scrollTop+20>t.scrollHeight&&v()}),100);return(0,p.jsxs)(o.A,{ref:y,onScroll:w,className:c()("load-container",l),onReady:()=>{x(!0)},children:[C&&!h&&!s&&(0,p.jsx)(m,{maxFullCount:g,getScrollerRef:()=>y.current,loadMore:v}),(0,p.jsxs)(a.Space,{direction:"vertical",children:[(0,p.jsx)("div",{children:f}),h?(0,p.jsx)("div",{className:u,children:(0,p.jsx)(a.Spin,{size:"small"})}):null,s&&_?(0,p.jsx)("div",{className:u,children:_}):null]})]})}));h.defaultProps={maxFullCount:3,completeTips:"\u52a0\u8f7d\u5b8c\u6210"};const _=h},73161:(e,t,l)=>{l.d(t,{A:()=>m});var n=l(55199),a=l(83136),s=l.n(a);const r="style_search-input__8aH1G__Cwdbl",o="style_is-popup__L0973__Cwdbl";var i=l(64671),c=l(73884),d=l(51941),u=l(70579);const p=e=>{let{value:t,debounce:l,onSearch:a,isPopup:p,placeholder:m,className:h,..._}=e;const[g,f]=(0,c.useState)(t),C=(0,c.useRef)(t),x=(0,d.useDebouncedCallback)(a,l);return(0,c.useEffect)((()=>{t!==C.current&&(f(t),C.current=t)}),[t]),(0,u.jsx)(n.Input.Search,{..._,allowClear:!0,className:s()(h,r,{[o]:p}),value:g,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;C.current=t,f(t),x(t)},onSearch:e=>{x(e)}})};p.defaultProps={debounce:500};const m=p},30509:(e,t,l)=>{l.d(t,{A:()=>U});const n={"ant-tag":"style_ant-tag__nNp8-__Cwdbl",overlay:"style_overlay__La5mO__Cwdbl",input:"style_input__SpJTE__Cwdbl","is-disabled":"style_is-disabled__joxdl__Cwdbl","input-icon":"style_input-icon__vVd8R__Cwdbl",large:"style_large__En6mL__Cwdbl",small:"style_small__DY0AQ__Cwdbl","input-inner":"style_input-inner__PWy27__Cwdbl","input-custom":"style_input-custom__ktsWD__Cwdbl","display-content":"style_display-content__hIKo+__Cwdbl","overlay-footer-extra":"style_overlay-footer-extra__Q+BiR__Cwdbl","selected-tag":"style_selected-tag__zXZZO__Cwdbl","selected-tag-list":"style_selected-tag-list__xUIms__Cwdbl","selected-tag-inner":"style_selected-tag-inner__Z5gPL__Cwdbl","text-inner":"style_text-inner__H24hY__Cwdbl",placeholder:"style_placeholder__x0ccE__Cwdbl","is-modal":"style_is-modal__JU+uq__Cwdbl","overlay-content":"style_overlay-content__WKqp+__Cwdbl"};var a=l(74981);const{context:s,useContext:r,Provider:o,Consumer:i}=(0,a.A)();var c=l(73884),d=l(10986),u=l.n(d),p=l(87558),m=l(33097),h=l.n(m),_=l(55199),g=l(83136),f=l.n(g),C=l(3382),x=l(64671),y=l(79686),v=l.n(y),b=l(41740),w=l.n(b),j=l(74065),A=l.n(j),N=l(21485),S=l(96418),O=l.n(S),P=l(77964),I=l(91176),L=l(58609),k=l(20492),M=l(27047),F=l(70579);const T=e=>{let{maxLength:t,single:l,setValue:n,value:a,message:s}=e;return e=>n(!l&&Number.isInteger(t)&&t>0&&e.length>t?(s(),a):e)},R=e=>{let{single:t,value:l,mapping:a,allValue:s,allLabel:r,onClose:o}=e;return l&&Array.isArray(l)&&0!==l.length?t?(0,F.jsx)("span",{className:n["text-inner"],children:h()(a.get(l[0]),"label")||l[0]}):1===l.length&&l[0]===(s||"all")?(0,F.jsx)("span",{className:n["text-inner"],children:r||(0,F.jsx)(L.FormattedMessage,{id:"all",moduleName:"Common"})}):l.map((e=>{const t=a.get(e);return(0,F.jsx)(_.Tag,{className:n["display-tag"],closable:!0,onClose:l=>{l.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:l,onChange:a,extra:s,showSelectedTag:r,renderSelectedContent:o,children:i,...d}=e;const[u,p]=(0,c.useState)(l),m=(0,c.useRef)(l),{formatMessage:h}=(0,L.useIntl)({moduleName:"Common"});m.current=l;const[g,f]=(0,c.useState)(!1),x=e=>{var t;f(e),null===(t=d.onOpenChange)||void 0===t||t.call(d,e)},{message:y}=_.App.useApp(),v=T({maxLength:d.maxLength,single:d.single,setValue:p,value:u,message:()=>y.error(h({id:"maxSelectedCount"},{count:d.maxLength}))});return(0,c.useEffect)((()=>{g&&p(m.current)}),[g]),(0,c.useImperativeHandle)(t,(()=>({modalOpen:()=>{x(!0)},close:()=>{x(!1)}}))),(0,F.jsx)(C.default,{...d,open:g,onConfirm:()=>{a(u)},onClose:()=>{x(!1)},footer:(0,F.jsxs)(_.Space,{direction:"vertical",className:n["overlay-footer"],children:[s&&(0,F.jsx)("div",{className:n["overlay-footer-extra"],children:s}),r&&o({value:u,setValue:v})]}),children:"function"===typeof i?i({value:u,setValue:v}):i})})),E=(0,c.forwardRef)(((e,t)=>{let{value:l,setValue:a,children:s,renderSelectedContent:r,showSelectedTag:o,placement:i,inputContent:d,single:u,extra:p,overlayWidth:m,wrapClassName:h,overlayClassName:g,disabled:C,...x}=e;const[y,v]=(0,c.useState)(!1),b=O()((e=>{var t;v(e),null===(t=x.onOpenChange)||void 0===t||t.call(x,e)}));return(0,c.useImperativeHandle)(t,(()=>({close:()=>{b(!1)}})),[b]),C?(0,F.jsx)("div",{className:n["input-inner"],children:d}):(0,F.jsx)(_.Popover,{...x,open:y,onOpenChange:b,transitionName:"ant-slide-up",overlayClassName:f()(n.overlay,g),arrow:!1,content:(0,F.jsxs)("div",{style:m?{"--overlay-width":m}:{},className:f()(n["overlay-content"],"over-content"),onClick:e=>{e.stopPropagation()},children:[(0,F.jsx)("div",{className:n["overlay-inner"],children:"function"===typeof s?s({value:l,setValue:e=>{(!u||l[0]!==e[0])&&a(e),u&&b(!1)}}):s}),(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:l,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:l,getContentRef:a,...s}=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:g,inputWidth:C}=p,[y,v]=m,{formatMessage:b}=(0,L.useIntl)({moduleName:"Common"}),{single:w,placement:j,getPopupContainer:A,placeholder:S,isPopup:P,disabled:k,showSelectedTag:M,extra:T,inputContent:z,allowClear:V,overlayClassName:W}=g,U=(0,c.useRef)(s);U.current=s;const B=O()(a);(0,c.useEffect)((()=>{B(P?u:d)}),[P,B]),(0,c.useEffect)((()=>{t(Object.assign({},U.current,{data:s.data,isComplete:s.isComplete}))}),[s.data,t,s.isComplete]);const K=R({single:w,value:y,mapping:h,allValue:g.allValue,allLabel:g.allLabel,onClose:e=>{v((t=>{const l=t.slice(0),n=t.indexOf(e);return n>-1&&l.splice(n,1),l}))}}),q=e=>{let{value:t,setValue:l}=e;return(0,F.jsxs)(_.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"}),!g.single&&Number.isInteger(g.maxLength)&&g.maxLength>0?"(".concat(t.length,"/").concat(g.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:g.allValue,allLabel:g.allLabel,onClose:e=>{l((t=>{const l=t.slice(0),n=t.indexOf(e);return n>-1&&l.splice(n,1),l}))}})})})]})},H=z?z(p):(0,F.jsxs)(_.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:S||b({id:"pleaseSelect"})})}),o&&y&&y.length>0&&!k&&V?(0,F.jsx)(x.default,{className:f()(n.close,n["input-icon"],"close","input-icon"),type:"icon-shibai",onClick:e=>{e.stopPropagation(),v([])}}):(0,F.jsx)(x.default,{className:f()(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(C,(0,I.j)(g.overlayWidth))),value:y,setValue:v,single:w,disabled:k,inputContent:H,onOpenChange:g.onOpenChange,overlayClassName:W,extra:"function"===typeof T?T({close:()=>u.current.close(),context:p}):T,renderSelectedContent:q,showSelectedTag:M,trigger:"click",placement:j,getPopupContainer:A,children:g.children}):(0,F.jsxs)("div",{className:n["input-inner"],onClick:()=>{k||d.current.modalOpen()},children:[(0,F.jsx)(D,{size:g.modalSize,ref:d,single:g.single,maxLength:g.maxLength,onOpenChange:g.onOpenChange,disabledScroller:!0,wrapClassName:f()(n.overlay,n["is-modal"],l),title:g.placeholder||b({id:"pleaseSelect"}),value:y,onChange:v,extra:"function"===typeof T?T({close:()=>d.current.close(),context:p}):T,showSelectedTag:M,renderSelectedContent:q,children:g.children}),H]})})),V=e=>{let{api:t,className:l,displayItems:a,wrapClassName:s,...r}=e;const{locale:i}=(0,M.A)(),[d,p]=(0,c.useState)(""),[m,g]=(0,c.useState)(new Map(a.map((e=>[e.value,e])))),{formatMessage:C}=(0,L.useIntl)({moduleName:"Common"}),[x,y]=(0,c.useState)(0),b=(0,P.A)((e=>{y(e.clientWidth)})),[j,N]=(0,c.useState)({}),{message:S}=_.App.useApp(),O=e=>{const t=e.filter((e=>m.get(e.value)!==e));0!==t.length&&g((e=>{const l=w()(e);return t.forEach((e=>{l.set(e.value,e)})),l}))},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?v()(e)?[]:[e]:e||[],O,r.valueType),[k,R]=u()(Object.assign({},r,{onChange:e=>{const t=((e,t,l)=>"all"!==l?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:()=>S.error(C({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=>{j.setData(e),O(h()(r.dataFormat(e,{locale:i}),"list",[]))},getContentApi:()=>E.current,fetchApi:j,valueState:[k,D],props:r},children:(0,F.jsx)("div",{ref:b,className:f()(n["input".concat(r.inputContent&&"function"===typeof r.inputContent?"-custom":"")],{"select-input-disabled":!!r.disabled},l),children:(0,F.jsx)(z,{...t,wrapClassName:s,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,l)=>{l.d(t,{A:()=>s});var n=l(8762),a=l.n(n);l(46733);const s=a()},21485:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(73884),a=l(44418),s=l.n(a),r=l(96418),o=l.n(r),i=l(70579);const c=(0,n.forwardRef)(((e,t)=>{let{children:l,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),_=o()(a);return(0,n.useImperativeHandle)(t,(()=>p.current)),(0,n.useEffect)((()=>{const e=new(s())(u.current,m.current);return p.current=e.getScrollElement(),p.current.addEventListener("scroll",_),h(p.current),()=>{p.current.removeEventListener("scroll",_)}}),[_,h,l]),(0,i.jsx)("div",{...d,ref:u,children:l})}))},89319:(e,t,l)=>{l.d(t,{A:()=>u});var n=l(55199),a=l(10986),s=l.n(a),r=l(57469),o=l.n(r),i=l(20492),c=l(58609),d=l(70579);const u=(0,c.createWithIntl)({importMessages:i.A,moduleName:"Common"})((e=>{let{...t}=e;const{formatMessage:l}=(0,c.useIntl)({moduleName:"Common"}),a=new Map([["date",l({id:"customTime"})],["month",l({id:"monthly"})],["week",l({id:"weekly"})]]),[r,i]=s()(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 l;return{value:null!==t&&void 0!==t&&null!==(l=t.value)&&void 0!==l&&l.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,l]=e;return{label:l,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,l)=>{l.d(t,{A:()=>n});const n=e=>({"en-US":()=>l.e(3086).then(l.bind(l,13086)),"zh-CN":()=>l.e(4308).then(l.bind(l,84308))}[e]())},29574:(e,t,l)=>{l.d(t,{Zi:()=>_,FI:()=>g,AG:()=>f,Ay:()=>x,lN:()=>C});const n="style_input-file__3JGm6__Cwdbl",a="style_input-file-input__Fb5iw__Cwdbl";var s=l(83136),r=l.n(s),o=l(73884),i=l(55199),c=l(63908),d=l(28987),u=l(80111),p=l.n(u),m=l(70579);const h=e=>t=>{let{className:l,accept:s,multiple:i,onChange:c,children:d,...u}=t;const p=(0,o.useRef)(null);return(0,m.jsxs)(e,{...u,className:r()(l,n),children:[d,!0!==u.disabled&&(0,m.jsx)("input",{ref:p,type:"file",accept:s,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))}})]})},_=h(i.Button),g=h((e=>{let{className:t,...l}=e;return(0,m.jsx)(i.Typography.Link,{...l,className:t})})),f=h((e=>{let{className:t,...l}=e;return(0,m.jsx)(i.Typography.Text,{...l,className:r()("ant-btn",t)})})),C=e=>{const{message:t}=i.App.useApp(),{multiple:l,fileSize:n,maxLength:a,value:s,concurrentCount:r,onAdd:u,onError:m,onSave:h,onChange:_,ossUpload:g}=Object.assign({},{concurrentCount:1,value:[]},e),{apis:f}=(0,c.usePreset)(),[C,x]=(0,o.useState)([]),y=(0,o.useRef)(r),v=(0,o.useMemo)((()=>(0,d.A)(y.current)),[]);return{fileList:C,onFileSelected:async e=>{const r=a-s.length;1!==a&&!0===l&&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 s=p()(),r=l=>{const n=l.message||"\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u9519\u8bef").concat(l.message?":"+l.message:"");t.error(n),m&&m({file:e,error:l,errMsg:n}),x((e=>{const t=e.slice(0),l=t.findIndex((e=>e.uuid===s));return l>-1&&t.splice(l,1),t}))};try{x(1===a||!0!==l?[{uuid:s,type:"uploading",filename:e.name}]:t=>{const l=t.slice(0);return l.unshift({uuid:s,type:"uploading",filename:e.name}),l}),u&&await Promise.resolve(u(e));const t=g||f.ossUpload,{data:n}=await v((()=>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,s)):{filename:n.data.originalName||n.data.filename||e.name,id:n.data.id,ossId:n.data.id,uuid:s};x((e=>{const t=e.slice(0),l=t.findIndex((e=>e.uuid===s));return l>-1&&t.splice(l,1),t})),_(1===a||!0!==l?[o]:e=>{const t=e.slice(0);return t.push(o),t})}catch(o){r(o)}})))}}},x=h},97211:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(87558),a=l.n(n),s=l(63908),r=l(34677),o=l.n(r),i=l(70579);const c=e=>{const t=t=>{let{id:l,url:n,error:r,apis:c,loading:d,...u}=t;const{apis:p}=(0,s.usePreset)(),m=o()({},p,c);if(!l)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),f={};return f[h]={[_]:l},(0,i.jsx)(a(),{...Object.assign({},g,f),updateType:"refresh",error:r,loading:d,cache:"oss-file",ttl:6e6,render:t=>{let{data:n}=t;return(0,i.jsx)(e,{...u,id:l,data:n})}})};return t.defaultProps={loading:null},t}},27047:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(83694),a=l(33097),s=l.n(a);const r=()=>{const e=(0,n.useGlobalContext)();return s()(e,"preset",{apis:{}})}},77964:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(73884),a=l(79889),s=l.n(a),r=l(93950),o=l.n(r),i=l(96418),c=l.n(i);const d=(e,t)=>{const l=(0,n.useRef)(null);l.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((l.current.isDebounce?o():s())(t,l.current.time));return e&&n.observe(e),()=>{n.disconnect()}}),[r]),a}},81348:(e,t,l)=>{l.d(t,{A:()=>n});const n=(e,t)=>{if(e&&t){const l=Array.isArray(t)?t:t.split(","),n=e.name||"",a=(e.type||"").toLowerCase(),s=a.replace(/\/.*$/,"");return l.some((e=>{const t=e.trim().toLowerCase();return"."===t.charAt(0)?n.toLowerCase().endsWith(t):t.endsWith("/*")?s===t.replace(/\/.*$/,""):a===t}))}return!0}},69484:(e,t,l)=>{l.d(t,{A:()=>a,e:()=>n});const n=1e15,a=e=>{let t,l,a,s=["\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=s[0]+"\u5143\u6574",c;if(e<0&&(e=-e,d="\u8d1f "),-1===(e=e.toString()).indexOf(".")?(t=e,l=""):(a=e.split("."),t=a[0],l=a[1].substr(0,4)),parseInt(t,10)>0){let e=0,l=t.length;for(let n=0;n<l;n++){let a=t.substr(n,1),i=l-n-1,d=i/4,u=i%4;"0"===a?e++:(e>0&&(c+=s[0]),e=0,c+=s[parseInt(a)]+r[u]),0===u&&e<4&&(c+=o[d])}c+="\u5143"}if(""!==l){let e=l.length;for(let t=0;t<e;t++){let e=l.substr(t,1);"0"!==e&&(c+=s[Number(e)]+i[t])}}return""===c?c+=s[0]+"\u5143\u6574":""===l&&(c+="\u6574"),c=d+c,c}},74981:(e,t,l)=>{l.d(t,{A:()=>a});var n=l(73884);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.createContext)(e),{Provider:l,Consumer:a}=t;return{context:t,Provider:l,Consumer:a,useContext:()=>(0,n.useContext)(t)}}},28987:(e,t,l)=>{l.d(t,{A:()=>n});const n=e=>{const t=[];let l=0;const n=()=>{if(0!==t.length){if(l<e){const e=t.shift();l+=1,e().finally((()=>{l-=1,n()}))}}else l=0};return e=>new Promise((l=>{t.push((()=>{const t=Promise.resolve().then((()=>e()));return l(t),t})),n()}))}},55490:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(12322),a=l.n(n),s=l(26727),r=l.n(s),o=l(54052),i=l.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,l)=>{l.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,l)=>{l.r(t),l.d(t,{AddressEnum:()=>h.qn,AddressInputField:()=>h.TM,AddressSelectField:()=>h.Ay,AdvancedSelectField:()=>_.Ay,CascaderField:()=>g.Ay,FetchButton:()=>i.A,FunctionEnum:()=>f.K,FunctionSelectField:()=>f.A,IndustryEnum:()=>C.W,IndustrySelectField:()=>C.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:()=>_.Bm,TypeDateRangePickerField:()=>x.A,UserField:()=>_.Eo,accept:()=>v.A,changeMoneyToChinese:()=>n.A,createAddressApi:()=>h.LH,createDeferred:()=>b.A,createListField:()=>_.NR,createTreeUtils:()=>g.ON,getContainerBody:()=>a.c,getPopupContainer:()=>s,getScrollEl:()=>a.h,isNotEmpty:()=>w.A,numberToPx:()=>j.v,pxToNumber:()=>j.j,useFileUpload:()=>m.lN,useResize:()=>y.A,withAddressApi:()=>h.DF,withInputFile:()=>m.Ay,withOSSFile:()=>r.A});var n=l(69484),a=l(76801);const s=e=>{const t=e=>{const l=(0,a.h)();if(!e||e===l||!e.parentElement)return l;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=l(97211),o=l(26475),i=l(73025),c=l(21485),d=l(17342),u=l(73161),p=l(30509),m=l(29574),h=l(93761),_=l(12392),g=l(45776),f=l(41654),C=l(53392),x=l(89319),y=l(77964),v=l(81348),b=l(28987),w=l(55490),j=l(91176)},40438:(e,t,l)=>{l.r(t),l.d(t,{default:()=>j});var n=l(87558),a=l.n(n),s=l(97211),r=l(64671),o=l(83136),i=l.n(o),c=l(55199),d=l(73884);const u=e=>{let{params:t}=e;const{data:l}=t;return new Promise(((e,t)=>{const n=new window.Image;n.src=l,n.addEventListener("load",(()=>{e(l)})),n.addEventListener("error",(e=>{t(e)}))}))},p="style_img-outer__4QLY5__Cwdbl",m="style_img__PSExq__Cwdbl",h="style_loading__WCOwA__Cwdbl",_="style_error__+ECgZ__Cwdbl";var g=l(18411),f=l(63908),C=l(70579);const x=e=>{let{data:t,className:l,alt:n,innerLoading:s,loading:r,error:o,innerError:c,children:d,onClick:p,staticUrl:h}=e;const{staticUrl:_}=(0,f.usePreset)(),g=h||_||"";return(0,C.jsx)(a(),{loader:u,params:{data:/^https?:\/\//.test(t)?t:g+t},error:c||o,loading:s||r,render:e=>{let{data:t}=e;return"function"===typeof d?d({alt:n,className:i()(l,m),src:t}):(0,C.jsx)("img",{alt:n,className:i()(l,m),src:t,onClick:p})}})},y=(0,s.A)(x),v=e=>{let{loading:t,error:l,src:n,id:a,alt:s,className:r,children:o,apis:i,onClick:c}=e;const u=t&&(0,d.cloneElement)(t,{className:h}),p=l&&(0,d.cloneElement)(l,{className:_});return n?(0,C.jsx)(x,{alt:s,className:r,data:n,loading:u,error:p,onClick:c,children:o}):a?(0,C.jsx)(y,{alt:s,className:r,id:a,loading:u,innerLoading:u,error:p,innerError:p,apis:i,onClick:c,children:o}):p},b=e=>{let{id:t,src:l,alt:n,onClick:a,loading:s,error:r,className:o,apis:c,...d}=e;return(0,C.jsx)("div",{...d,"data-testid":"components-core-image",className:i()(o,p),children:v({loading:s,error:r,src:l,id:t,alt:n,className:o,apis:c,onClick:a})})};b.Avatar=e=>{let{id:t,src:l,alt:n,gender:a,loading:s,error:o,className:d,gap:u,icon:m,children:h,shape:_,size:g,width:f,height:x,defaultAvatar:y,apis:b,...w}=e;const j=(()=>{const e=f&&x?{style:{width:f,height:x}}:{size:g};if(f&&f!==x&&(_="square"),t||l)return v({loading:s,error:o,src:l,defaultAvatar:y,id:t,alt:n,className:d,apis:b,children:t=>(0,C.jsx)(c.Avatar,{...t,gap:u,shape:_,...e})});if(a){const t=a&&["F","female","f"].indexOf(a)>-1?"icon-color-touxiang-nv":"icon-color-touxiang-nan";return(0,C.jsx)(c.Avatar,{...w,src:(0,C.jsx)(r.default,{role:"touxiang",colorful:!0,type:t}),gap:u,shape:_,...e})}return(0,C.jsx)(c.Avatar,{...w,gap:u,icon:m,shape:_,size:g,src:y,...e,children:h})})();return(0,C.jsx)("div",{...w,"data-testid":"components-core-image-avatar",className:i()(d,p),style:{width:f&&x?f:g,height:f&&x?x:g},children:j})};const w={error:(0,C.jsx)(r.default,{role:"error-icon",colorful:!0,type:"icon-color-touxiang-nan"}),loading:(0,C.jsx)(c.Skeleton.Avatar,{shape:"square",active:!0})};b.defaultProps=Object.assign({},w),b.Avatar.defaultProps=Object.assign({},w,{size:100,defaultAvatar:g.A});const j=b},3382:(e,t,l)=>{l.r(t),l.d(t,{ModalButton:()=>k,TabsModal:()=>O,TabsModalButton:()=>L,default:()=>N,useConfirmModal:()=>A,useModal:()=>j,useTabsModal:()=>P});var n=l(73884),a=l(55199),s=l(83136),r=l.n(s);const o={modal:"style_modal__Pm3cF__Cwdbl",large:"style_large__iaqVE__Cwdbl","modal-body-inner":"style_modal-body-inner__4PhpA__Cwdbl","modal-title":"style_modal-title__dswaw__Cwdbl","modal-outer":"style_modal-outer__r3SkX__Cwdbl","modal-body":"style_modal-body__jQJSI__Cwdbl","right-options-modal":"style_right-options-modal__FajDP__Cwdbl","right-options-row":"style_right-options-row__-mPb9__Cwdbl","right-options-col":"style_right-options-col__3ilee__Cwdbl","is-disabled-scroller":"style_is-disabled-scroller__PmHyk__Cwdbl",content:"style_content__k6MIF__Cwdbl","modal-footer":"style_modal-footer__-prbN__Cwdbl","modal-close":"style_modal-close__Oa5Kl__Cwdbl","confirm-modal-wrap":"style_confirm-modal-wrap__YFImr__Cwdbl","is-danger":"style_is-danger__H5110__Cwdbl",title:"style_title__orTym__Cwdbl","has-title":"style_has-title__qy0Wp__Cwdbl"},i=e=>({"en-US":()=>l.e(4628).then(l.bind(l,74628)),"zh-CN":()=>l.e(7478).then(l.bind(l,87478))}[e]());var c=l(58609),d=l(64671);const u=(e,t)=>"function"===typeof e?e(t):e;var p=l(81014),m=l(17342),h=l(70579);const _="Modal",g=e=>{let{options:t,children:l}=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:l}),(0,h.jsx)(a.Col,{span:6,className:o["right-options-col"],children:t})]}):l},f=(e,t)=>"".concat(e-48-(t?58:0),"px"),C=(e,t)=>"large"===e?{width:"".concat(Math.min(window.innerWidth-64,1500),"px"),style:{"--min-modal-height":f(500,t)}}:"small"===e?{width:"600px",style:{"--min-modal-height":f(300,t)}}:{width:"1000px",style:{"--min-modal-height":f(500,t)}},x=e=>{let{footer:t,footerButtons:l,onConfirm:s,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(l)&&0===l.length?null:(0,h.jsx)(a.Col,{children:(0,h.jsx)(a.Space,{children:(l||[{children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:_,children:(0,h.jsx)(c.FormattedMessage,{id:"Cancel",moduleName:_})}),onClick:r},{type:"primary",children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:_,children:(0,h.jsx)(c.FormattedMessage,{id:"Confirm",moduleName:_})}),onClick:s}]).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:l,onClick:a,autoClose:s=!0,display:r,...i}=e;const c=l||p.default;return(0,n.createElement)(c,{...i,key:t,onClick:async function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const n=await Promise.resolve(a&&a(...t,d));return s&&!1!==n&&o&&o(),n}})}))})})]})},y=e=>{let{title:t,footer:l,disabledScroller:s,footerButtons:i,onClose:c,closable:u,onConfirm:p,onCancel:_,children:g,targetProps:f}=e;const C=(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"]]:s},"modal-body"),ref:C,children:(0,h.jsx)("div",{className:r()(o["modal-body-inner"],"modal-body-inner"),children:g})}),null!==l||i?(0,h.jsx)("div",{className:r()(o["modal-footer"],"modal-footer"),children:(0,h.jsx)(x,{footer:l,footerButtons:i,onConfirm:p,onCancel:_,onClose:c,targetProps:f})}):null]})},v=e=>{let{withDecorator:t,footerButtons:l,title:n,closable:a,onClose:s,onConfirm:r,onCancel:o,footer:i,rightOptions:c,disabledScroller:d,childrenRef:p,children:m}=e;const _=e=>(e=Object.assign({},{title:n},e),(0,h.jsx)(y,{title:u(e.title,{...e,childrenRef:p,close:s}),closable:a,onClose:s,onConfirm:r,onCancel:o,footerButtons:u(l,{...e,close:s}),disabledScroller:d,footer:u(i,{...e,childrenRef:p,close:s}),targetProps:Object.assign({},e,{childrenRef:p,close:s}),children:(0,h.jsx)(g,{options:u(c,{...e,childrenRef:p,close:s}),children:u(m,{...e,childrenRef:p,close:s})})}));return"function"===typeof t?t(_):_({})},b=e=>{let{children:t,rightOptions:l,footer:n,footerButtons:a,className:s,size:d,title:u,onClose:p,onConfirm:m,onCancel:_,closable:g,disabledScroller:f,withDecorator:x,childrenRef:y,...b}=e;return{...b,icon:null,centered:!0,title:null,maskClosable:!!b.hasOwnProperty("maskClosable")&&b.maskClosable,destroyOnClose:!0,footer:null,closable:!1,onCancel:p,className:r()(s,o.modal,o[d],{[o["right-options-modal"]]:l}),...C(d,!(null===n&&!a)),children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:"Modal",children:v({withDecorator:x,title:u,closable:g,onClose:p,onConfirm:m,onCancel:_,footer:n,footerButtons:a,rightOptions:l,disabledScroller:f,children:t,childrenRef:y})})}},w=e=>{const t=(0,n.useRef)(null);return(0,h.jsx)(a.Modal,{...b(Object.assign({},e,{childrenRef:t}))})};w.defaultProps={size:"default"};const j=()=>{const{modal:e}=a.App.useApp(),t=(0,n.useRef)(null);return l=>{const n={},{children:a,...s}=b({onClose:()=>n.close(),childrenRef:t,...l}),{destroy:r}=e.info({...s,content:a});return n.close=r,n}},A=()=>{const{modal:e}=a.App.useApp();return t=>{const l={},{type:n,icon:s,title:i,danger:c,wrapClassName:u,message:p,iconSetting:m={},confirmType:_="info",...g}={onClose:()=>l.close(),maskClosable:!1,...t},f=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]({...g,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?_:n)),type:s||f["confirm"===n?_: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?_:n)),type:s||f["confirm"===n?_:n]}):null,p]})});l.close=t}return l}},N=w,S=e=>{let{items:t,className:l,activeKey:n,withDecorator:s,defaultActiveKey:o,onChange:i,...c}=e;return{...c,className:r()(l,"tabs-modal"),withDecorator:e=>{const l=l=>(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({},l,t,{children:a.children})))):e(Object.assign({},l,{children:a.children}))})})),destroyInactiveTabPane:!0,activeKey:n,defaultActiveKey:o,onChange:i});return"function"===typeof s?s(l):l()},children:e=>{let{children:t,...l}=e;return"function"===typeof t?t(l):t}}},O=e=>(0,h.jsx)(N,{...S(e)}),P=()=>{const e=j();return t=>e(S(t))};var I=l(73025);const L=e=>{const t=P();return(0,h.jsx)(I.A,{...e,modalFunc:t})},k=e=>{const t=j();return(0,h.jsx)(I.A,{...e,modalFunc:t})}},25438:(e,t,l)=>{l.d(t,{A:()=>n});const n={"search-input":"common_search-input__P6qLg__Cwdbl","is-popup":"common_is-popup__fJq+g__Cwdbl",list:"common_list__TKFzS__Cwdbl","list-item":"common_list-item__ASse7__Cwdbl","is-selected":"common_is-selected__-PU4Y__Cwdbl","item-label":"common_item-label__u+qz1__Cwdbl","item-des":"common_item-des__no2z0__Cwdbl"}}}]);
|
|
2
|
+
//# sourceMappingURL=36.4ae1c1f1.chunk.js.map
|