@kne-components/components-core 0.2.2 → 0.2.3

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.
Files changed (177) hide show
  1. package/build/asset-manifest.json +120 -120
  2. package/build/index.html +1 -1
  3. package/build/remoteEntry.js +1 -1
  4. package/build/remoteEntry.js.map +1 -1
  5. package/build/static/css/1151.841fca05.chunk.css +2 -0
  6. package/build/static/css/1151.841fca05.chunk.css.map +1 -0
  7. package/build/static/css/1153.382d399c.chunk.css +2 -0
  8. package/build/static/css/{1153.ea3b88f3.chunk.css.map → 1153.382d399c.chunk.css.map} +1 -1
  9. package/build/static/css/1454.c244b0e0.chunk.css +2 -0
  10. package/build/static/css/{1454.e445aff5.chunk.css.map → 1454.c244b0e0.chunk.css.map} +1 -1
  11. package/build/static/css/1554.e3fe8993.chunk.css +2 -0
  12. package/build/static/css/{1554.b567803b.chunk.css.map → 1554.e3fe8993.chunk.css.map} +1 -1
  13. package/build/static/css/{2503.d61c75d2.chunk.css → 2503.7249c0dc.chunk.css} +2 -2
  14. package/build/static/css/{2503.d61c75d2.chunk.css.map → 2503.7249c0dc.chunk.css.map} +1 -1
  15. package/build/static/css/2517.8da70e76.chunk.css +2 -0
  16. package/build/static/css/2517.8da70e76.chunk.css.map +1 -0
  17. package/build/static/css/2716.afb6cca1.chunk.css +2 -0
  18. package/build/static/css/{2716.375b6815.chunk.css.map → 2716.afb6cca1.chunk.css.map} +1 -1
  19. package/build/static/css/{2730.6ce16794.chunk.css → 2730.ad6ec746.chunk.css} +2 -2
  20. package/build/static/css/{2730.6ce16794.chunk.css.map → 2730.ad6ec746.chunk.css.map} +1 -1
  21. package/build/static/css/{289.035f9fa0.chunk.css → 289.79a8844e.chunk.css} +2 -2
  22. package/build/static/css/{289.035f9fa0.chunk.css.map → 289.79a8844e.chunk.css.map} +1 -1
  23. package/build/static/css/{3142.46608818.chunk.css → 3142.e9dd2d0e.chunk.css} +2 -2
  24. package/build/static/css/{3142.46608818.chunk.css.map → 3142.e9dd2d0e.chunk.css.map} +1 -1
  25. package/build/static/css/3174.431f88b1.chunk.css +2 -0
  26. package/build/static/css/{3174.465efe14.chunk.css.map → 3174.431f88b1.chunk.css.map} +1 -1
  27. package/build/static/css/3178.37c24e6a.chunk.css +2 -0
  28. package/build/static/css/3178.37c24e6a.chunk.css.map +1 -0
  29. package/build/static/css/3333.fa2418e7.chunk.css +2 -0
  30. package/build/static/css/3333.fa2418e7.chunk.css.map +1 -0
  31. package/build/static/css/{3843.df98188c.chunk.css → 3843.8b846111.chunk.css} +2 -2
  32. package/build/static/css/{3843.df98188c.chunk.css.map → 3843.8b846111.chunk.css.map} +1 -1
  33. package/build/static/css/398.81f13fe8.chunk.css +2 -0
  34. package/build/static/css/398.81f13fe8.chunk.css.map +1 -0
  35. package/build/static/css/4319.c63bb012.chunk.css +2 -0
  36. package/build/static/css/{4319.7b79a0de.chunk.css.map → 4319.c63bb012.chunk.css.map} +1 -1
  37. package/build/static/css/4666.317a4f26.chunk.css +2 -0
  38. package/build/static/css/{4666.64836903.chunk.css.map → 4666.317a4f26.chunk.css.map} +1 -1
  39. package/build/static/css/5443.3d68f4a3.chunk.css +2 -0
  40. package/build/static/css/5443.3d68f4a3.chunk.css.map +1 -0
  41. package/build/static/css/5600.2a386b79.chunk.css +2 -0
  42. package/build/static/css/5600.2a386b79.chunk.css.map +1 -0
  43. package/build/static/css/{5996.41561dbf.chunk.css → 5996.f7a01600.chunk.css} +2 -2
  44. package/build/static/css/{5996.41561dbf.chunk.css.map → 5996.f7a01600.chunk.css.map} +1 -1
  45. package/build/static/css/{6611.3a30a350.chunk.css → 6611.3a9fea0b.chunk.css} +2 -2
  46. package/build/static/css/{6611.3a30a350.chunk.css.map → 6611.3a9fea0b.chunk.css.map} +1 -1
  47. package/build/static/css/6779.91d67fb3.chunk.css +2 -0
  48. package/build/static/css/6779.91d67fb3.chunk.css.map +1 -0
  49. package/build/static/css/7121.7142f0c6.chunk.css +2 -0
  50. package/build/static/css/7121.7142f0c6.chunk.css.map +1 -0
  51. package/build/static/css/7227.a5f541be.chunk.css +2 -0
  52. package/build/static/css/{7227.a084c472.chunk.css.map → 7227.a5f541be.chunk.css.map} +1 -1
  53. package/build/static/css/{8725.ea1f0646.chunk.css → 8725.48ad06f8.chunk.css} +2 -2
  54. package/build/static/css/{8725.ea1f0646.chunk.css.map → 8725.48ad06f8.chunk.css.map} +1 -1
  55. package/build/static/css/931.7d24c94f.chunk.css +2 -0
  56. package/build/static/css/{931.de4ef84d.chunk.css.map → 931.7d24c94f.chunk.css.map} +1 -1
  57. package/build/static/css/9403.49c67ab5.chunk.css +2 -0
  58. package/build/static/css/{9403.65af256a.chunk.css.map → 9403.49c67ab5.chunk.css.map} +1 -1
  59. package/build/static/css/{9449.040250bd.chunk.css → 9449.6f764a25.chunk.css} +2 -2
  60. package/build/static/css/{9449.040250bd.chunk.css.map → 9449.6f764a25.chunk.css.map} +1 -1
  61. package/build/static/js/1153.8e710c6f.chunk.js +3 -0
  62. package/build/static/js/{1153.2dacd6a6.chunk.js.map → 1153.8e710c6f.chunk.js.map} +1 -1
  63. package/build/static/js/1454.352d8776.chunk.js +3 -0
  64. package/build/static/js/{1454.f5b0ddef.chunk.js.map → 1454.352d8776.chunk.js.map} +1 -1
  65. package/build/static/js/1554.a434303d.chunk.js +3 -0
  66. package/build/static/js/{1554.a8cc392e.chunk.js.map → 1554.a434303d.chunk.js.map} +1 -1
  67. package/build/static/js/2503.b5a9b12a.chunk.js +2 -0
  68. package/build/static/js/{2503.4e88e446.chunk.js.map → 2503.b5a9b12a.chunk.js.map} +1 -1
  69. package/build/static/js/2517.00bbfa77.chunk.js +2 -0
  70. package/build/static/js/{2517.e6a93d26.chunk.js.map → 2517.00bbfa77.chunk.js.map} +1 -1
  71. package/build/static/js/2615.a70da127.chunk.js +2 -0
  72. package/build/static/js/{2615.408a7189.chunk.js.map → 2615.a70da127.chunk.js.map} +1 -1
  73. package/build/static/js/2716.49f89bd4.chunk.js +3 -0
  74. package/build/static/js/{2716.2d038e25.chunk.js.map → 2716.49f89bd4.chunk.js.map} +1 -1
  75. package/build/static/js/2730.5f5f593d.chunk.js +2 -0
  76. package/build/static/js/{2730.3d41f53c.chunk.js.map → 2730.5f5f593d.chunk.js.map} +1 -1
  77. package/build/static/js/{289.a890d4de.chunk.js → 289.b5e9f5e8.chunk.js} +2 -2
  78. package/build/static/js/{289.a890d4de.chunk.js.map → 289.b5e9f5e8.chunk.js.map} +1 -1
  79. package/build/static/js/{3142.367892a4.chunk.js → 3142.f2e5d0e0.chunk.js} +2 -2
  80. package/build/static/js/{3142.367892a4.chunk.js.map → 3142.f2e5d0e0.chunk.js.map} +1 -1
  81. package/build/static/js/{3174.acbff207.chunk.js → 3174.9ed3d7f2.chunk.js} +2 -2
  82. package/build/static/js/3174.9ed3d7f2.chunk.js.map +1 -0
  83. package/build/static/js/3178.3641f3c4.chunk.js +2 -0
  84. package/build/static/js/{3178.1869b50f.chunk.js.map → 3178.3641f3c4.chunk.js.map} +1 -1
  85. package/build/static/js/{3333.bd18e3b1.chunk.js → 3333.e7b4ad77.chunk.js} +2 -2
  86. package/build/static/js/{3333.bd18e3b1.chunk.js.map → 3333.e7b4ad77.chunk.js.map} +1 -1
  87. package/build/static/js/36.2c076f0a.chunk.js +2 -0
  88. package/build/static/js/{36.fde9057d.chunk.js.map → 36.2c076f0a.chunk.js.map} +1 -1
  89. package/build/static/js/{3843.ac358d43.chunk.js → 3843.ad7343db.chunk.js} +2 -2
  90. package/build/static/js/{3843.ac358d43.chunk.js.map → 3843.ad7343db.chunk.js.map} +1 -1
  91. package/build/static/js/{398.9e7d3c7d.chunk.js → 398.b0284e64.chunk.js} +2 -2
  92. package/build/static/js/{398.9e7d3c7d.chunk.js.map → 398.b0284e64.chunk.js.map} +1 -1
  93. package/build/static/js/4319.ca0361b0.chunk.js +2 -0
  94. package/build/static/js/{4319.e38e5594.chunk.js.map → 4319.ca0361b0.chunk.js.map} +1 -1
  95. package/build/static/js/{4666.4f081c8e.chunk.js → 4666.1bbd8001.chunk.js} +3 -3
  96. package/build/static/js/{4666.4f081c8e.chunk.js.map → 4666.1bbd8001.chunk.js.map} +1 -1
  97. package/build/static/js/{5443.b765482d.chunk.js → 5443.af05bfd2.chunk.js} +2 -2
  98. package/build/static/js/{5443.b765482d.chunk.js.map → 5443.af05bfd2.chunk.js.map} +1 -1
  99. package/build/static/js/5600.52eae979.chunk.js +2 -0
  100. package/build/static/js/{5600.2c8647dd.chunk.js.map → 5600.52eae979.chunk.js.map} +1 -1
  101. package/build/static/js/5698.31a5b536.chunk.js +2 -0
  102. package/build/static/js/{5698.62b4c73b.chunk.js.map → 5698.31a5b536.chunk.js.map} +1 -1
  103. package/build/static/js/{5996.97effec5.chunk.js → 5996.ac6ffa4b.chunk.js} +2 -2
  104. package/build/static/js/{5996.97effec5.chunk.js.map → 5996.ac6ffa4b.chunk.js.map} +1 -1
  105. package/build/static/js/6611.6be3af66.chunk.js +2 -0
  106. package/build/static/js/{6611.61ae6dfa.chunk.js.map → 6611.6be3af66.chunk.js.map} +1 -1
  107. package/build/static/js/6779.227f480e.chunk.js +2 -0
  108. package/build/static/js/{6779.86d57e2e.chunk.js.map → 6779.227f480e.chunk.js.map} +1 -1
  109. package/build/static/js/7121.da979c4b.chunk.js +2 -0
  110. package/build/static/js/{7121.d71b7adb.chunk.js.map → 7121.da979c4b.chunk.js.map} +1 -1
  111. package/build/static/js/7227.731f9dee.chunk.js +3 -0
  112. package/build/static/js/{7227.66261e4b.chunk.js.map → 7227.731f9dee.chunk.js.map} +1 -1
  113. package/build/static/js/{8725.92a063ba.chunk.js → 8725.8d4b95e0.chunk.js} +2 -2
  114. package/build/static/js/{8725.92a063ba.chunk.js.map → 8725.8d4b95e0.chunk.js.map} +1 -1
  115. package/build/static/js/{931.062494fd.chunk.js → 931.ca44f0ac.chunk.js} +2 -2
  116. package/build/static/js/{931.062494fd.chunk.js.map → 931.ca44f0ac.chunk.js.map} +1 -1
  117. package/build/static/js/{9403.3a8b1514.chunk.js → 9403.918493bf.chunk.js} +2 -2
  118. package/build/static/js/9403.918493bf.chunk.js.map +1 -0
  119. package/build/static/js/9449.5c89782f.chunk.js +2 -0
  120. package/build/static/js/{9449.b28b65bb.chunk.js.map → 9449.5c89782f.chunk.js.map} +1 -1
  121. package/build/static/js/{main.91aa2aa0.js → main.0231d836.js} +2 -2
  122. package/build/static/js/{main.91aa2aa0.js.map → main.0231d836.js.map} +1 -1
  123. package/package.json +1 -1
  124. package/build/static/css/1151.78ad5ff7.chunk.css +0 -2
  125. package/build/static/css/1151.78ad5ff7.chunk.css.map +0 -1
  126. package/build/static/css/1153.ea3b88f3.chunk.css +0 -2
  127. package/build/static/css/1454.e445aff5.chunk.css +0 -2
  128. package/build/static/css/1554.b567803b.chunk.css +0 -2
  129. package/build/static/css/2517.2612da74.chunk.css +0 -2
  130. package/build/static/css/2517.2612da74.chunk.css.map +0 -1
  131. package/build/static/css/2716.375b6815.chunk.css +0 -2
  132. package/build/static/css/3174.465efe14.chunk.css +0 -2
  133. package/build/static/css/3178.96712c30.chunk.css +0 -2
  134. package/build/static/css/3178.96712c30.chunk.css.map +0 -1
  135. package/build/static/css/3333.f1e089de.chunk.css +0 -2
  136. package/build/static/css/3333.f1e089de.chunk.css.map +0 -1
  137. package/build/static/css/398.924dec67.chunk.css +0 -2
  138. package/build/static/css/398.924dec67.chunk.css.map +0 -1
  139. package/build/static/css/4319.7b79a0de.chunk.css +0 -2
  140. package/build/static/css/4666.64836903.chunk.css +0 -2
  141. package/build/static/css/5443.cf3d128a.chunk.css +0 -2
  142. package/build/static/css/5443.cf3d128a.chunk.css.map +0 -1
  143. package/build/static/css/5600.043c03e3.chunk.css +0 -2
  144. package/build/static/css/5600.043c03e3.chunk.css.map +0 -1
  145. package/build/static/css/6779.bba00a34.chunk.css +0 -2
  146. package/build/static/css/6779.bba00a34.chunk.css.map +0 -1
  147. package/build/static/css/7121.4a9abc08.chunk.css +0 -2
  148. package/build/static/css/7121.4a9abc08.chunk.css.map +0 -1
  149. package/build/static/css/7227.a084c472.chunk.css +0 -2
  150. package/build/static/css/931.de4ef84d.chunk.css +0 -2
  151. package/build/static/css/9403.65af256a.chunk.css +0 -2
  152. package/build/static/js/1153.2dacd6a6.chunk.js +0 -3
  153. package/build/static/js/1454.f5b0ddef.chunk.js +0 -3
  154. package/build/static/js/1554.a8cc392e.chunk.js +0 -3
  155. package/build/static/js/2503.4e88e446.chunk.js +0 -2
  156. package/build/static/js/2517.e6a93d26.chunk.js +0 -2
  157. package/build/static/js/2615.408a7189.chunk.js +0 -2
  158. package/build/static/js/2716.2d038e25.chunk.js +0 -3
  159. package/build/static/js/2730.3d41f53c.chunk.js +0 -2
  160. package/build/static/js/3174.acbff207.chunk.js.map +0 -1
  161. package/build/static/js/3178.1869b50f.chunk.js +0 -2
  162. package/build/static/js/36.fde9057d.chunk.js +0 -2
  163. package/build/static/js/4319.e38e5594.chunk.js +0 -2
  164. package/build/static/js/5600.2c8647dd.chunk.js +0 -2
  165. package/build/static/js/5698.62b4c73b.chunk.js +0 -2
  166. package/build/static/js/6611.61ae6dfa.chunk.js +0 -2
  167. package/build/static/js/6779.86d57e2e.chunk.js +0 -2
  168. package/build/static/js/7121.d71b7adb.chunk.js +0 -2
  169. package/build/static/js/7227.66261e4b.chunk.js +0 -3
  170. package/build/static/js/9403.3a8b1514.chunk.js.map +0 -1
  171. package/build/static/js/9449.b28b65bb.chunk.js +0 -2
  172. /package/build/static/js/{1153.2dacd6a6.chunk.js.LICENSE.txt → 1153.8e710c6f.chunk.js.LICENSE.txt} +0 -0
  173. /package/build/static/js/{1454.f5b0ddef.chunk.js.LICENSE.txt → 1454.352d8776.chunk.js.LICENSE.txt} +0 -0
  174. /package/build/static/js/{1554.a8cc392e.chunk.js.LICENSE.txt → 1554.a434303d.chunk.js.LICENSE.txt} +0 -0
  175. /package/build/static/js/{2716.2d038e25.chunk.js.LICENSE.txt → 2716.49f89bd4.chunk.js.LICENSE.txt} +0 -0
  176. /package/build/static/js/{4666.4f081c8e.chunk.js.LICENSE.txt → 4666.1bbd8001.chunk.js.LICENSE.txt} +0 -0
  177. /package/build/static/js/{7227.66261e4b.chunk.js.LICENSE.txt → 7227.731f9dee.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:()=>f,ImagePreview:()=>L,OSSFilePreview:()=>C,OfficePreview:()=>g,PdfPreview:()=>S,TextPreview:()=>b,UnknownPreview:()=>F,default:()=>R});var r=s(63114),a=s.n(r),n=s(73884),c=s(13050),o=s(83136),l=s.n(o);const i="style_container__9Fu-3__ln08u",d="style_loading__r3aiE__ln08u",m="style_text-outer__TzhuG__ln08u",u="style_error__wSaxt__ln08u";var h=s(87558),p=s(70579);const x=(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,p.jsx)("iframe",{title:"\u7b80\u5386\u9884\u89c8",frameBorder:"0",width:"100%",ref:s})})),f=e=>{let{className:t,url:s,maxWidth:r}=e;return(0,p.jsx)("div",{className:l()(t,i),style:{maxWidth:r},children:(0,p.jsx)(x,{url:s})})};var j=s(76329);const v=(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}=e;const a=T(t);return(0,n.createElement)(a,{...r,url:t,key:t,className:s})}))})),g=e=>{let{id:t,apis:s,className:r,...a}=e;const{apis:n}=(0,j.usePreset)(),c=Object.assign({},n,s);return(0,p.jsx)(v,{...a,...c.previewOffice,data:{id:t},className:r})};var _=s(55199),N=s(39165),w=(s(71975),s(36));const P=(0,n.memo)((e=>{let{url:t,maxWidth:s,scale:r,rotate:a,className:o}=e;const[m,u]=(0,n.useState)(0);N.pdfjs.GlobalWorkerOptions.workerSrc=(0,c.getPublicPath)("components-core")+"/pdfjs/build/pdf.worker.js";const[h,x]=(0,n.useState)(s),f=(0,w.useResize)((()=>{f.current&&f.current.clientWidth&&x(Math.min(f.current.clientWidth,s))}));return(0,p.jsx)("div",{ref:f,className:l()(o,i),style:{maxWidth:s},children:(0,p.jsx)(N.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,p.jsx)("div",{className:d,children:(0,p.jsx)(_.Spin,{})}),noData:"\u672a\u6307\u5b9aPDF\u6587\u4ef6",onLoadSuccess:e=>{let{numPages:t}=e;u(t),console.log("onLoadSuccess")},onLoadError:e=>{console.log("onLoadError",e)},onSourceError:e=>{console.log("onSourceError",e)},children:(0,p.jsx)(_.Space,{direction:"vertical",children:m>=1&&Array.from(new Array(m),((e,t)=>(0,p.jsx)(N.Page,{className:"preview-item",scale:r/100,rotate:a,pageNumber:t+1,width:h,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:"\u672a\u6307\u5b9a\u9875\u9762"},"page_".concat(t))))})})})}));P.defaultProps={autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200};const S=P;var y=s(91409),E=s.n(y),W=s(89946),k=s.n(W);const b=e=>{let{url:t,className:s,maxWidth:r}=e;const[a,c]=(0,n.useState)(""),[o,h]=(0,n.useState)(!0),[x,f]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{k().get(t).then((e=>{let{data:t}=e;c(t),h(!1)}),(()=>{h(!1),f(!0)}))}),[t]),(0,p.jsxs)("div",{className:l()(s,i),style:{maxWidth:r},children:[o?(0,p.jsx)("div",{className:d,children:(0,p.jsx)(_.Spin,{})}):null,(0,p.jsx)("div",{className:m,children:x?(0,p.jsx)("div",{className:u,children:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25"}):(0,p.jsx)(E(),{text:a})})]})},F=e=>{let{maxWidth:t}=e;return(0,p.jsx)("div",{className:i,style:{maxWidth:t},children:(0,p.jsx)("div",{className:m,children:(0,p.jsx)(_.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"})})})},L=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[o,m]=(0,n.useState)(!0),[h,x]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=new Image;e.src=t;const s=()=>{m(!1)},r=()=>{m(!1),x(!0)};return e.addEventListener("load",s),e.addEventListener("error",r),()=>{e.removeEventListener("load",s),e.removeEventListener("error",r)}}),[t,s,r]),(0,p.jsxs)("div",{className:l()(a,i),style:{maxWidth:c},children:[o?(0,p.jsx)("div",{className:d,children:(0,p.jsx)(_.Spin,{})}):null,h?(0,p.jsx)("div",{className:u,children:"\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}):(0,p.jsx)("img",{src:t,alt:"\u7b80\u5386\u9884\u89c8"})]})},D=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=D,T=e=>({txt:b,pdf:S,image:L,html:f,office:g,unknown:F}[D(e)]);const C=(0,s(97211).A)((e=>{let{data:t,id:s,className:r,...a}=e;const n=T(t);return"office"===O(t)?(0,p.jsx)(g,{...a,id:s,className:r}):(0,p.jsx)(n,{...a,className:r,url:t})})),R=e=>{let{id:t,originName:s,...r}=e;return"office"===O(s)?(0,p.jsx)(g,{...r,id:t,originName:s}):(0,p.jsx)(C,{...r,id:t,originName:s})}},71975:()=>{}}]);
2
- //# sourceMappingURL=3333.bd18e3b1.chunk.js.map
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:()=>f,ImagePreview:()=>L,OSSFilePreview:()=>C,OfficePreview:()=>g,PdfPreview:()=>S,TextPreview:()=>b,UnknownPreview:()=>F,default:()=>R});var r=s(63114),a=s.n(r),n=s(73884),c=s(13050),o=s(83136),l=s.n(o);const i="style_container__9Fu-3__oxjro",d="style_loading__r3aiE__oxjro",m="style_text-outer__TzhuG__oxjro",u="style_error__wSaxt__oxjro";var h=s(87558),x=s(70579);const p=(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:"\u7b80\u5386\u9884\u89c8",frameBorder:"0",width:"100%",ref:s})})),f=e=>{let{className:t,url:s,maxWidth:r}=e;return(0,x.jsx)("div",{className:l()(t,i),style:{maxWidth:r},children:(0,x.jsx)(p,{url:s})})};var j=s(76329);const v=(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}=e;const a=T(t);return(0,n.createElement)(a,{...r,url:t,key:t,className:s})}))})),g=e=>{let{id:t,apis:s,className:r,...a}=e;const{apis:n}=(0,j.usePreset)(),c=Object.assign({},n,s);return(0,x.jsx)(v,{...a,...c.previewOffice,data:{id:t},className:r})};var _=s(55199),N=s(39165),w=(s(71975),s(36));const P=(0,n.memo)((e=>{let{url:t,maxWidth:s,scale:r,rotate:a,className:o}=e;const[m,u]=(0,n.useState)(0);N.pdfjs.GlobalWorkerOptions.workerSrc=(0,c.getPublicPath)("components-core")+"/pdfjs/build/pdf.worker.js";const[h,p]=(0,n.useState)(s),f=(0,w.useResize)((()=>{f.current&&f.current.clientWidth&&p(Math.min(f.current.clientWidth,s))}));return(0,x.jsx)("div",{ref:f,className:l()(o,i),style:{maxWidth:s},children:(0,x.jsx)(N.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)(_.Spin,{})}),noData:"\u672a\u6307\u5b9aPDF\u6587\u4ef6",onLoadSuccess:e=>{let{numPages:t}=e;u(t),console.log("onLoadSuccess")},onLoadError:e=>{console.log("onLoadError",e)},onSourceError:e=>{console.log("onSourceError",e)},children:(0,x.jsx)(_.Space,{direction:"vertical",children:m>=1&&Array.from(new Array(m),((e,t)=>(0,x.jsx)(N.Page,{className:"preview-item",scale:r/100,rotate:a,pageNumber:t+1,width:h,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:"\u672a\u6307\u5b9a\u9875\u9762"},"page_".concat(t))))})})})}));P.defaultProps={autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200};const S=P;var y=s(91409),E=s.n(y),W=s(89946),k=s.n(W);const b=e=>{let{url:t,className:s,maxWidth:r}=e;const[a,c]=(0,n.useState)(""),[o,h]=(0,n.useState)(!0),[p,f]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{k().get(t).then((e=>{let{data:t}=e;c(t),h(!1)}),(()=>{h(!1),f(!0)}))}),[t]),(0,x.jsxs)("div",{className:l()(s,i),style:{maxWidth:r},children:[o?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(_.Spin,{})}):null,(0,x.jsx)("div",{className:m,children:p?(0,x.jsx)("div",{className:u,children:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)(E(),{text:a})})]})},F=e=>{let{maxWidth:t}=e;return(0,x.jsx)("div",{className:i,style:{maxWidth:t},children:(0,x.jsx)("div",{className:m,children:(0,x.jsx)(_.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"})})})},L=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[o,m]=(0,n.useState)(!0),[h,p]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=new Image;e.src=t;const s=()=>{m(!1)},r=()=>{m(!1),p(!0)};return e.addEventListener("load",s),e.addEventListener("error",r),()=>{e.removeEventListener("load",s),e.removeEventListener("error",r)}}),[t,s,r]),(0,x.jsxs)("div",{className:l()(a,i),style:{maxWidth:c},children:[o?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(_.Spin,{})}):null,h?(0,x.jsx)("div",{className:u,children:"\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)("img",{src:t,alt:"\u7b80\u5386\u9884\u89c8"})]})},D=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=D,T=e=>({txt:b,pdf:S,image:L,html:f,office:g,unknown:F}[D(e)]);const C=(0,s(97211).A)((e=>{let{data:t,id:s,className:r,...a}=e;const n=T(t);return"office"===O(t)?(0,x.jsx)(g,{...a,id:s,className:r}):(0,x.jsx)(n,{...a,className:r,url:t})})),R=e=>{let{id:t,originName:s,...r}=e;return"office"===O(s)?(0,x.jsx)(g,{...r,id:t,originName:s}):(0,x.jsx)(C,{...r,id:t,originName:s})}},71975:()=>{}}]);
2
+ //# sourceMappingURL=3333.e7b4ad77.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/3333.bd18e3b1.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4B,0BCM1gB,MAAMA,GAAmBC,EAAAA,EAAAA,iBAAgB,CACvCC,kBAAmBC,IAAe,IAAd,KAAEC,GAAMD,EAC1B,MAAO,CACLC,KAAM,CACJC,KAAM,IACNC,QAASF,GAEZ,GAPoBH,EAStBM,IAAe,IAAd,KAAEH,GAAMG,EACV,MAAMC,GAAMC,EAAAA,EAAAA,QAAO,MAqBnB,OApBAC,EAAAA,EAAAA,YAAU,KACR,MACMC,GADS,IAAIC,WACQC,gBAAgBT,EAAM,aACjDO,EAAYG,iBAAiB,UAAUC,SAASC,IAC9CA,EAAGC,cAAcC,YAAYF,EAAG,IAElC,MAAMG,GACJC,EAAAA,EAAAA,eAAc,mBAAqB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H,GACjC,SAEF,SAAS,EAGlB,IAEaxE,EAAuBV,IAClB,CACdsF,IAAKC,EACLC,IAAKnE,EACLqD,MAAOe,EACPC,KAAMC,EACNC,OAAQC,EACRC,QAASC,GAGId,EAAWjF,KCpC5B,MAQA,GARuBgG,E,SAAAA,IAAYtI,IAAwC,IAAvC,KAAEC,EAAI,GAAEkD,EAAE,UAAEd,KAAcO,GAAO5C,EACnE,MAAM+C,EAAmBC,EAAoB/C,GAC7C,MAAyB,WAArBsH,EAAWtH,IACN+B,EAAAA,EAAAA,KAACmG,EAAa,IAAKvF,EAAOO,GAAIA,EAAId,UAAWA,KAE/CL,EAAAA,EAAAA,KAACe,EAAgB,IAAKH,EAAOP,UAAWA,EAAWC,IAAKrC,GAAQ,ICEzE,EAPoBD,IAAmC,IAAlC,GAAEmD,EAAE,WAAEoF,KAAe3F,GAAO5C,EAC/C,MAA+B,WAA3BuH,EAAWgB,IACNvG,EAAAA,EAAAA,KAACmG,EAAa,IAAKvF,EAAOO,GAAIA,EAAIoF,WAAYA,KAEhDvG,EAAAA,EAAAA,KAACwG,EAAc,IAAK5F,EAAOO,GAAIA,EAAIoF,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__ln08u\",\"container-html\":\"style_container-html__IsNVq__ln08u\",\"html-inner\":\"style_html-inner__S05cI__ln08u\",\"loading\":\"style_loading__r3aiE__ln08u\",\"control-bar\":\"style_control-bar__kTKau__ln08u\",\"scroller\":\"style_scroller__HOq7b__ln08u\",\"outer\":\"style_outer__ntu--__ln08u\",\"file-name\":\"style_file-name__UPbbe__ln08u\",\"file-options\":\"style_file-options__5TE5l__ln08u\",\"scale-input\":\"style_scale-input__JdF1K__ln08u\",\"text-outer\":\"style_text-outer__TzhuG__ln08u\",\"error\":\"style_error__wSaxt__ln08u\",\"text-inner\":\"style_text-inner__jdi-A__ln08u\",\"image-inner\":\"style_image-inner__zTiFU__ln08u\"};","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 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 <HtmlInnerPreview url={url} />\n {/*<iframe\n title=\"简历预览\"\n src={url}\n frameBorder=\"0\"\n width=\"100%\"\n ref={ref}\n onLoad={() => {\n const scriptPath =\n getPublicPath(\"components-core\") +\n \"/iframeResizer.contentWindow.js\";\n if (!ref.current.contentDocument) {\n console.warn(\n `跨域情况无法开启自动高度计算,请将${scriptPath}脚本加入目标页面`\n );\n return;\n }\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n ref.current.contentDocument.head.appendChild(script);\n ref.current.contentDocument.body.style = \"pointer-events: none;\";\n }}\n />*/}\n </div>\n );\n};\n\nexport default HtmlPreview;\n","import { usePreset } from \"@components/Global\";\nimport { createWithFetch } from \"@kne/react-fetch\";\nimport { typeFormatComponent } from \"./typeFormat\";\n\nconst OfficePreviewInner = createWithFetch({\n cache: \"office-preview\",\n})(({ data, className, ...props }) => {\n const { data: fileList } = data;\n return fileList.map(({ url }) => {\n const PreviewComponent = 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 } = usePreset();\n const apis = Object.assign({}, baseApis, propsApis);\n return (\n <OfficePreviewInner\n {...props}\n {...apis.previewOffice}\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 typeFormatComponent = (url) => {\n const mapping = {\n txt: TextPreview,\n pdf: PdfPreview,\n image: ImagePreview,\n html: HtmlPreview,\n office: OfficePreview,\n unknown: UnknownPreview,\n };\n\n return mapping[typeFormat(url)];\n};\n","import withOSSFile from \"@common/hocs/withOSSFile\";\nimport typeFormat, { typeFormatComponent } from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\n\nconst OSSFilePreview = withOSSFile(({ data, id, className, ...props }) => {\n const PreviewComponent = typeFormatComponent(data);\n if (typeFormat(data) === \"office\") {\n return <OfficePreview {...props} id={id} className={className} />;\n }\n return <PreviewComponent {...props} className={className} url={data} />;\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":["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","url","maxWidth","classnames","children","OfficePreviewInner","cache","props","fileList","map","PreviewComponent","typeFormatComponent","_createElement","key","id","apis","propsApis","baseApis","usePreset","Object","assign","previewOffice","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","console","log","onLoadError","onSourceError","Space","direction","Array","from","index","Page","pageNumber","renderAnnotationLayer","renderTextLayer","concat","defaultProps","autoSize","text","setText","setLoading","setError","axios","then","_jsxs","TextEscape","Result","status","subTitle","image","Image","handlerLoad","handlerError","addEventListener","removeEventListener","alt","typeFormat","_path","split","toLowerCase","test","txt","TextPreview","pdf","ImagePreview","html","HtmlPreview","office","OfficePreview","unknown","UnknownPreview","withOSSFile","originName","OSSFilePreview"],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/3333.e7b4ad77.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4B,0BCM1gB,MAAMA,GAAmBC,EAAAA,EAAAA,iBAAgB,CACvCC,kBAAmBC,IAAe,IAAd,KAAEC,GAAMD,EAC1B,MAAO,CACLC,KAAM,CACJC,KAAM,IACNC,QAASF,GAEZ,GAPoBH,EAStBM,IAAe,IAAd,KAAEH,GAAMG,EACV,MAAMC,GAAMC,EAAAA,EAAAA,QAAO,MAqBnB,OApBAC,EAAAA,EAAAA,YAAU,KACR,MACMC,GADS,IAAIC,WACQC,gBAAgBT,EAAM,aACjDO,EAAYG,iBAAiB,UAAUC,SAASC,IAC9CA,EAAGC,cAAcC,YAAYF,EAAG,IAElC,MAAMG,GACJC,EAAAA,EAAAA,eAAc,mBAAqB,kCAC/BC,EAASC,SAASC,cAAc,UACtCF,EAAOG,IAAML,EACbR,EAAYc,KAAKC,YAAYL,GAC7B,MAAMM,EAAQL,SAASC,cAAc,SACrCI,EAAMC,UACJ,mFACFjB,EAAYc,KAAKC,YAAYC,GAC7BnB,EAAIqB,QAAQC,OAASnB,EAAYoB,gBAAgBC,SAAS,GACzD,CAAC5B,KACJM,EAAAA,EAAAA,YAAU,KACRuB,IAAAA,aAA0B,CAAEC,aAAa,GAAS1B,EAAIqB,QAAQ,GAC7D,KACIM,EAAAA,EAAAA,KAAA,UAAQC,MAAM,2BAA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AIA,EAAId,UAAWA,KAE/CL,EAAAA,EAAAA,KAACe,EAAgB,IAAKH,EAAOP,UAAWA,EAAWC,IAAKrC,GAAQ,ICEzE,EAPoBD,IAAmC,IAAlC,GAAEmD,EAAE,WAAEoF,KAAe3F,GAAO5C,EAC/C,MAA+B,WAA3BuH,EAAWgB,IACNvG,EAAAA,EAAAA,KAACmG,EAAa,IAAKvF,EAAOO,GAAIA,EAAIoF,WAAYA,KAEhDvG,EAAAA,EAAAA,KAACwG,EAAc,IAAK5F,EAAOO,GAAIA,EAAIoF,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__oxjro\",\"container-html\":\"style_container-html__IsNVq__oxjro\",\"html-inner\":\"style_html-inner__S05cI__oxjro\",\"loading\":\"style_loading__r3aiE__oxjro\",\"control-bar\":\"style_control-bar__kTKau__oxjro\",\"scroller\":\"style_scroller__HOq7b__oxjro\",\"outer\":\"style_outer__ntu--__oxjro\",\"file-name\":\"style_file-name__UPbbe__oxjro\",\"file-options\":\"style_file-options__5TE5l__oxjro\",\"scale-input\":\"style_scale-input__JdF1K__oxjro\",\"text-outer\":\"style_text-outer__TzhuG__oxjro\",\"error\":\"style_error__wSaxt__oxjro\",\"text-inner\":\"style_text-inner__jdi-A__oxjro\",\"image-inner\":\"style_image-inner__zTiFU__oxjro\"};","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 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 <HtmlInnerPreview url={url} />\n {/*<iframe\n title=\"简历预览\"\n src={url}\n frameBorder=\"0\"\n width=\"100%\"\n ref={ref}\n onLoad={() => {\n const scriptPath =\n getPublicPath(\"components-core\") +\n \"/iframeResizer.contentWindow.js\";\n if (!ref.current.contentDocument) {\n console.warn(\n `跨域情况无法开启自动高度计算,请将${scriptPath}脚本加入目标页面`\n );\n return;\n }\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n ref.current.contentDocument.head.appendChild(script);\n ref.current.contentDocument.body.style = \"pointer-events: none;\";\n }}\n />*/}\n </div>\n );\n};\n\nexport default HtmlPreview;\n","import { usePreset } from \"@components/Global\";\nimport { createWithFetch } from \"@kne/react-fetch\";\nimport { typeFormatComponent } from \"./typeFormat\";\n\nconst OfficePreviewInner = createWithFetch({\n cache: \"office-preview\",\n})(({ data, className, ...props }) => {\n const { data: fileList } = data;\n return fileList.map(({ url }) => {\n const PreviewComponent = 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 } = usePreset();\n const apis = Object.assign({}, baseApis, propsApis);\n return (\n <OfficePreviewInner\n {...props}\n {...apis.previewOffice}\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 typeFormatComponent = (url) => {\n const mapping = {\n txt: TextPreview,\n pdf: PdfPreview,\n image: ImagePreview,\n html: HtmlPreview,\n office: OfficePreview,\n unknown: UnknownPreview,\n };\n\n return mapping[typeFormat(url)];\n};\n","import withOSSFile from \"@common/hocs/withOSSFile\";\nimport typeFormat, { typeFormatComponent } from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\n\nconst OSSFilePreview = withOSSFile(({ data, id, className, ...props }) => {\n const PreviewComponent = typeFormatComponent(data);\n if (typeFormat(data) === \"office\") {\n return <OfficePreview {...props} id={id} className={className} />;\n }\n return <PreviewComponent {...props} className={className} url={data} />;\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":["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","url","maxWidth","classnames","children","OfficePreviewInner","cache","props","fileList","map","PreviewComponent","typeFormatComponent","_createElement","key","id","apis","propsApis","baseApis","usePreset","Object","assign","previewOffice","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","console","log","onLoadError","onSourceError","Space","direction","Array","from","index","Page","pageNumber","renderAnnotationLayer","renderTextLayer","concat","defaultProps","autoSize","text","setText","setLoading","setError","axios","then","_jsxs","TextEscape","Result","status","subTitle","image","Image","handlerLoad","handlerError","addEventListener","removeEventListener","alt","typeFormat","_path","split","toLowerCase","test","txt","TextPreview","pdf","ImagePreview","html","HtmlPreview","office","OfficePreview","unknown","UnknownPreview","withOSSFile","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,n)=>{n.d(t,{A:()=>a});n(73884);const a=n.p+"static/media/defaultAvatar.b1f2a8046cc7bee36d9a404ce6a0a1d7.svg"},93761:(e,t,n)=>{n.d(t,{qn:()=>R,TM:()=>G,LH:()=>L,Ay:()=>E,NY:()=>k,DF:()=>D});var a=n(30509),l=n(25438),s=n(55199),o=n(27047),r=n(83136),i=n.n(r),c=n(64671),d=n(73884),u=n(21485),p=n(56434),m=n.n(p),h=n(15797),_=n.n(h),g=n(33097),x=n.n(g);const f="style_address__DIuRX__oxjro",j="style_is-popup__tqVvp__oxjro",y="style_title__FAe12__oxjro",v="style_scroll-box__JWiDl__oxjro",C="style_scroll-plus-box__lidEW__oxjro",b="style_content__lAARZ__oxjro",A="style_col-left__WPfeS__oxjro",N="style_col-right__z0e9-__oxjro";var S=n(87558);const w=e=>({"en-US":()=>n.e(3691).then(n.bind(n,83691)),"zh-CN":()=>n.e(2253).then(n.bind(n,32253))}[e]());var O=n(58609),P=n(70579);const I=a.A.useContext,L=e=>{let{city:t,province:n,country:a}=e;const l=_()((()=>{const e=[];return["gangaotai","municipality"].forEach((n=>{e.push(...t.relations[n])})),["provinces","continents"].forEach((n=>{t.relations[n].forEach((n=>{e.push(n),e.push(...t.relations[n])}))})),e.map((e=>t.list[e]))}));return{getCity:_()((e=>{const n=t.list[e];return n?{city:n,parent:n.parentCode?t.list[n.parentCode]:null}:{city:null,parent:null}})),getChinaHotCities:_()((()=>t.relations[2].map((e=>t.list[e])))),getChinaCities:_()((()=>["2",...n.relations.municipality,...n.relations.provinces,"gangaotai"].map((e=>Object.assign({id:e},t.list[e]))))),getCountries:_()((()=>["1",...a.relations.continents].map((e=>Object.assign({id:e},a.list[e]))))),getList:_()(((e,l)=>{const{showChinaQuan:s,showForeignQuan:o}=Object.assign({},l);if("gangaotai"===e)return n.relations.gangaotai.map((e=>t.list[e]));const r=Object.assign({},t.list[e]);if(n.relations.municipality.indexOf(e)>-1)return r.name="".concat(s?"\u5168":"")+r.name,[r];const i=t.relations[e].map((e=>t.list[e]));return n.relations.provinces.indexOf(e)>-1&&s&&(r.name="\u5168"+r.name,i.splice(0,0,r)),a.relations.continents.indexOf(e)>-1&&o&&(r.name="\u5168"+r.name,i.splice(0,0,r)),i})),getNationalityList:_()((e=>{let n=m()(t);return"1"===e&&n.relations[1].unshift("410"),"350"===e&&n.relations[350].unshift("410"),n.relations[e].filter((e=>n.list[e])).map((e=>n.list[e]))})),getCityByName:_()((e=>{const t=l();let n;return[t=>t.name===e,t=>t.name===e.replace(/(\u7701|\u5e02)$/,""),t=>0===e.indexOf(t.name)].find((e=>(n=t.find(e),n))),n})),combineCities:_()(((e,n)=>[...n.filter((n=>t.list[n].parentCode!==e&&t.list[e].parentCode!==n&&e!==n)),e])),searchCities:_()((e=>{if(!e)return[];return l().filter((t=>["pinyin","name","enName","spelling"].some((n=>t[n].toUpperCase().indexOf(e.toUpperCase())>-1)))).map((e=>{const n=e.parentCode?t.list[e.parentCode]:null;return{label:n?"".concat(n.name,"\xb7").concat(e.name):e.name,value:e.code}}))}))}},k=(e,t)=>"en-US"===t?x()(e,"enName"):x()(e,"name"),M={cache:"CITY_DATA",isLocal:!0,ttl:864e5,loader:()=>n.e(7820).then(n.t.bind(n,37820,19)).then((e=>e.__esModule?e.default:e))},F=e=>{let{value:t,setValue:n}=e;const{fetchApi:a,props:r}=I(),[p,m]=(0,d.useState)(""),[h,_]=(0,d.useState)("2"),{formatMessage:g}=(0,O.useIntl)({moduleName:"AddressSelect"}),{locale:x}=(0,o.A)(),{getCity:S,getChinaCities:w,getCountries:M,getList:F,searchCities:T}=(0,d.useMemo)((()=>L(a.data)),[a.data]),R=e=>{if(r.single)return void n([e]);const a=t.slice(0),l=a.indexOf(e);l>-1?a.splice(l,1):a.push(e),n(a)},D=p&&(0,P.jsx)(u.A,{className:C,children:(0,P.jsx)(s.List,{className:l.A.list,size:"small",dataSource:T(p),rowKey:"value",renderItem:e=>(0,P.jsx)(s.List.Item,{className:l.A["list-item"],onClick:()=>{R(e.value),m("")},children:(0,P.jsx)("span",{className:l.A["item-label"],children:e.label})})})});return(0,P.jsxs)("div",{className:i()(f,{[j]:r.isPopup}),children:[(0,P.jsx)(s.Input.Search,{className:i()(l.A["search-input"],{[l.A["is-popup"]]:r.isPopup}),placeholder:r.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:b,children:D||(0,P.jsxs)(s.Row,{wrap:!1,children:[(0,P.jsx)(s.Col,{className:A,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:w().map((e=>({label:k(e,x),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,x),key:e.id})))})})}]})}),(0,P.jsxs)(s.Col,{flex:1,className:N,children:[(0,P.jsx)(s.Divider,{className:y,orientation:"left",children:k(S(h).city,x)}),(0,P.jsx)(u.A,{className:v,children:(0,P.jsx)(s.Space,{wrap:!0,children:F(h,{showChinaQuan:r.showChinaQuan,showForeignQuan:r.showForeignQuan}).map((e=>(0,P.jsx)(s.Tag.CheckableTag,{checked:t.indexOf(e.code)>-1,onChange:()=>{R(e.code)},children:k(e,x)},e.code)))})})]})]})})]})},T=e=>(0,P.jsx)(a.A,{...e,children:e=>{let{value:t,setValue:n}=e;return(0,P.jsx)(O.IntlProvider,{moduleName:"AddressSelect",importMessages:w,children:(0,P.jsx)(F,{value:t,setValue:n})})}});T.defaultProps={overlayWidth:"500px",isPopup:!0,api:M,dataFormat:(e,t)=>{let{city:n}=e;const{locale:a}=Object.assign({},t);return{list:Object.values(n.list).map((e=>Object.assign({},e,{value:e.code,label:k(e,a)})))}}};const R=(0,S.withFetch)((e=>{let{name:t,data:n,getAddressApi:a,children:l,...s}=e;const{locale:r}=(0,o.A)(),i=(0,d.useMemo)((()=>L(n)),[n]);return a?l(i):l(i.getCity(t),Object.assign({},s,{locale:r}))}));R.defaultProps={...M,displayParent:!1,children:(e,t)=>{let{city:n,parent:a}=e,{displayParent:l,locale:s}=t;return l&&a?"".concat(k(a,s),"\xb7").concat(k(n,s)):k(n,s)}};const D=e=>{const t=(0,S.withFetch)((t=>{let{data:n,...a}=t;const l=(0,d.useMemo)((()=>L(n)),[n]);return(0,P.jsx)(e,{...a,addressApi:l})}));return t.defaultProps={...M},t};T.AddressEnum=T.Enum=R,T.createAddressApi=L,T.withAddressApi=D,T.getLabelForLocal=k;const E=T;var z=n(10986),V=n.n(z),W=n(78491),B=n.n(W),U=n(20492),K=n(22616),q=n.n(K),H=n(1488),Q=n.n(H);const Z=e=>{const{isPopup:t,size:n,disabled:a,inputPlaceholder:l,onBlur:o,className:r,...i}=e,[c,d]=V()(e),u=["isPopup","searchPlaceholder","placeholder","overlayWidth","api","dataFormat"],{formatMessage:p}=(0,O.useIntl)({moduleName:"Common"}),m=B()((e=>{o&&o(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:r,disabled:a,single:!0,size:n,value:x()(c,"city"),onChange:e=>{d({city:e,detail:x()(c,"detail")})}})}),(0,P.jsx)(s.Col,{span:12,children:(0,P.jsx)(s.Input,{...Q()(i,u),className:r,placeholder:l||p({id:"pleaseInput"}),disabled:a,size:n,value:x()(c,"detail"),onChange:e=>{d({city:x()(c,"city"),detail:e.target.value})}})})]})})};Z.defaultProps={};const G=(0,O.createWithIntl)({importMessages:U.A,moduleName:"Common"})(Z)},12392:(e,t,n)=>{n.d(t,{Bm:()=>W,Eo:()=>z,NR:()=>A,Ay:()=>B});var a=n(55199),l=n(83136),s=n.n(l),o=n(30509),r=n(25438),i=n(26475),c=n(33097),d=n.n(c),u=n(34677),p=n.n(u);const m="create-list_scroll-loader__zoaS7__oxjro",h="create-list_is-popup__t3d-G__oxjro",_="create-list_is-not-full__FXtX1__oxjro",g="create-list_search-input__tV3vf__oxjro",x="create-list_left__EXr3i__oxjro",f="create-list_list-header__3xeJa__oxjro",j="create-list_is-modal__BMfya__oxjro";var y=n(73161),v=n(58609),C=n(70579);const b=o.A.useContext,A=e=>{let{renderList:t,defaultProps:n}=e;const l=e=>{let{value:n,setValue:l}=e;const{fetchApi:o,searchText:c,setSearchText:u,props:A,mapping:N}=b(),S=Object.assign({},{paramsType:"data",current:"currentPage",pageSizeName:"perPage",pageSize:20},A.pagination),w=d()(o.requestParams,[S.paramsType,S.current],1),O=d()(o.requestParams,[S.paramsType,S.pageSizeName])||S.pageSize,{formatMessage:P}=(0,v.useIntl)({moduleName:"Common"}),I=A.dataFormat(o.data),{right:L,leftBottom:k,leftSpan:M=24}=A,F=1===n.length&&"all"===n[0];return(0,C.jsxs)(a.Row,{wrap:!1,className:L?s()("is-not-full",_):"",children:[(0,C.jsxs)(a.Col,{span:M,className:s()(x,"advance-select-left"),children:[A.getSearchProps?(0,C.jsx)(y.A,{isPopup:A.isPopup,className:s()(g,r.A["search-input"],{[r.A["is-popup"]]:A.isPopup}),placeholder:A.searchPlaceholder||P({id:"search"}),value:c,onSearch:e=>{o.reload(A.getSearchProps(e)),u(e)}}):null,A.single||!A.showSelectedCount&&!A.allowSelectAll?null:(0,C.jsxs)(a.Flex,{className:s()(f,{[j]:!A.isPopup}),justify:"space-between",children:[A.showSelectedCount?(0,C.jsxs)(a.Space,{children:[(0,C.jsx)(a.Typography,{children:"\u5df2\u9009:"}),(0,C.jsx)(a.Typography.Link,{children:F?A.allLabel||(0,C.jsx)(v.FormattedMessage,{id:"all",moduleName:"Common"}):"".concat(n.length).concat(A.countUnit||P({id:"items"}))})]}):(0,C.jsx)("div",{}),A.allowSelectAll?(0,C.jsx)("div",{children:(0,C.jsx)(a.Checkbox,{checked:F,onChange:e=>{l(e.target.checked?[A.allValue||"all"]:[])},children:(0,C.jsx)(v.FormattedMessage,{id:"selectAll",moduleName:"Common",values:{label:A.allLabel||(0,C.jsx)(v.FormattedMessage,{id:"all",moduleName:"Common"})}})})}):(0,C.jsx)("div",{})]}),(0,C.jsx)(i.A,{completeTips:"",isLoading:!o.isComplete,className:s()(m,{[h]:A.isPopup}),noMore:!I.total||w*O>=I.total,onLoader:async()=>{console.log("on loader"),await o.loadMore(p()({[S.paramsType]:{[S.pageSizeName]:O,[S.current]:w+1}},A.getSearchProps&&A.getSearchProps(c)),A.mergeList)},children:t({props:A,value:n,setValue:l,list:I.list,itemIsSelected:e=>n.indexOf(e.value)>-1,isSelectedAll:F,onSelect:e=>{if(A.single)return void l([e.value]);const t=n.slice(0),a=t.indexOf(e.value);a>-1?t.splice(a,1):t.push(e.value),l(t)}})}),k&&k({fetchApi:o,value:n,mapping:N})]}),L&&L({value:n,mapping:N,fetchApi:o})]})},c=e=>{let{extra:t,...n}=e;return(0,C.jsx)(o.A,{...n,extra:t,children:e=>{let{value:t,setValue:n}=e;return(0,C.jsx)(l,{value:t,setValue:n})}})};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})},n),c},N="list_list__TGynD__oxjro",S="list_list-item__WSswf__oxjro",w="list_is-selected__6Wkgt__oxjro",O="list_item-label__bYzhe__oxjro",P="list_item-des__2nsEn__oxjro",I="list_is-disabled__qxCvO__oxjro",L="list_is-selected-all__Mp-hG__oxjro";var k=n(40438),M=n(64671);const F="user_list-inner__V508e__oxjro",T="user_list-info__y2nWo__oxjro",R="user_selected-icon__9OQJL__oxjro",D="user_item-des__o+7UR__oxjro",E="user_is-selected-all__2q0VZ__oxjro",z=A({renderList:e=>{let{list:t,onSelect:n,itemIsSelected:l,isSelectedAll:o}=e;return(0,C.jsx)(a.List,{size:"small",className:s()(N,{[L]:o,[E]:o}),dataSource:t,renderItem:e=>{const t=l(e);return(0,C.jsx)(a.List.Item,{className:s()(S,{[w]:t}),onClick:()=>n(e),children:(0,C.jsxs)(a.Row,{wrap:!1,align:"middle",className:F,children:[(0,C.jsx)(a.Col,{children:(0,C.jsx)(k.default.Avatar,{...Object.assign({},e.avatar),size:40,gender:"M"})}),(0,C.jsx)(a.Col,{className:T,flex:1,children:(0,C.jsxs)(a.Space,{direction:"vertical",children:[(0,C.jsx)("span",{className:O,children:e.label}),e.description&&(0,C.jsx)("span",{className:D,children:e.description})]})}),(0,C.jsx)(a.Col,{children:o||t?(0,C.jsx)(M.default,{className:R,type:"icon-gouxuan"}):null})]})})}})}}),V={"is-selected-all":"table_is-selected-all__IwXUY__oxjro"},W=A({defaultProps:{overlayWidth:"450px"},renderList:e=>{let{props:t,list:n,onSelect:l,value:o,setValue:r,itemIsSelected:i,isSelectedAll:c}=e;return(0,C.jsx)(a.Table,{className:s()(V.list,N,{[L]:c,[V["is-selected-all"]]:c}),size:"small",dataSource:n,columns:t.columns,rowClassName:e=>s()({"ant-table-row-selected":i(e)}),rowKey:t.rowKey||"value",pagination:!1,rowSelection:t.single?null:c?{selectedRowKeys:n.map((e=>{let{value:t}=e;return t})),getCheckboxProps:()=>({disabled:!0})}:{selectedRowKeys:o,onChange:e=>{r(e)}},sticky:!0,onRow:e=>({onClick:()=>l(e)})})}}),B=A({renderList:e=>{let{props:t,list:n,itemIsSelected:l,isSelectedAll:o,onSelect:r}=e;const{listClassName:i="",selectIcon:c=null}=t||{};return(0,C.jsx)(a.List,{className:s()(N,i,{[L]:o}),size:"small",dataSource:n,renderItem:e=>{var n;const i=l(e);return(0,C.jsxs)(a.List.Item,{className:s()(S,{[w]:t.single&&i,[I]:o||e.disabled}),onClick:()=>{e.disabled||r(e)},children:[(0,C.jsxs)(a.Row,{wrap:!1,children:[t.single?null:(0,C.jsx)(a.Col,{children:(0,C.jsx)(a.Checkbox,{checked:o||i,disabled:o||e.disabled})}),(0,C.jsx)(a.Col,{children:(0,C.jsxs)(a.Space,{className:null!==(n=null===e||void 0===e?void 0:e.className)&&void 0!==n?n:"",children:[(0,C.jsx)("span",{className:O,children:e.label}),e.description&&(0,C.jsx)("span",{className:P,children:e.description})]})})]}),i&&c]})}})}})},45776:(e,t,n)=>{n.d(t,{yK:()=>L,ON:()=>h,Ay:()=>R});var a=n(30509),l=n(73884),s=n(96418),o=n.n(s),r=n(55199),i=n(64671),c=n(73161),d=n(33097),u=n.n(d),p=n(79686),m=n.n(p);const h=e=>{const t=Array.from(e.values()),n=t.filter((e=>null===e.parentId)),a=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},l=t=>{const n=[],a=t=>{const l=e.get(t);l&&Array.isArray(l.children)&&l.children.length>0&&(n.push(...l.children),l.children.forEach((e=>{a(e.id)})))};return a(t),n},s=(t,n)=>{const a=t=>{const l=e.get(t);return l?n(l)?l:m()(l.parentId)?null:a(l.parentId):null};return a(t)},o=t=>{const a=e.get(t);if(!a)return[];const l=a.parentId;if(m()(l))return n;return e.get(l).children},r=(()=>{const e=n=>Array.isArray(n)&&n.length>0?n.map((n=>{const a=t.filter((e=>e.parentId===n.id));return Object.assign({},n,{children:e(a)})})):null;return e(n)})();return{mapping:e,getSelectedQueue:t=>{const n=e.get(t);if(!n)return[];const a=e=>{if(e.children&&e.children.length>0)return a(e.children.find((t=>t.children&&e.children.length>0))||u()(e.children,"0"));const t=l(e.parentId).find((e=>e.children&&e.children.length>0));return t?a(t):e},s=function(t){const n=[t,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]],a=e.get(t);return!a||m()(a.parentId)?n:s(a.parentId,n)},o=a(n);return s(u()(o,"id"))},getAllChildren:l,computedCheckboxStatus:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(s(t,(e=>n.indexOf(e.id)>-1)))return{checked:!0,indeterminate:!1};const a=((t,a)=>{const l=t=>{const a=e.get(t);return a?(s=a,n.indexOf(s.id)>-1?a:Array.isArray(a.children)&&a.children.length>0?a.children.find((e=>!!l(e.id))):void 0):null;var s};return!!l(t)})(t);return a?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1}},getSiblingNode:o,findInParents:s,setNodeChecked:function(t){const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),s=t=>{const r=e.get(t);if(!r)return;n.push(t),l(t).forEach((e=>{a(n,e.id)}));const i=o(t),c=i.every((e=>n.indexOf(e.id)>-1));r.parentId&&c&&(i.forEach((e=>{a(n,e.id)})),s(r.parentId))};return s(t),n},setNodeUnchecked:function(t){const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),l=t=>{const s=e.get(t);if(!s)return;if(n.indexOf(s.id)>-1)return void a(n,s.id);const r=o(t);s.parentId&&(r.forEach((e=>{t!==e.id&&n.push(e.id)})),l(s.parentId))};return l(t),n},treeData:r,treeMapping:new Map(r.map((e=>[e.id,e])))}};var _=n(74065),g=n.n(_),x=n(19853),f=n.n(x),j=n(17342),y=n(83136),v=n.n(y);const C={content:"style_content__Hxlt9__oxjro",columns:"style_columns__FmtPF__oxjro","content-item":"style_content-item__i6HCO__oxjro","last-level-area":"style_last-level-area__2y7jQ__oxjro","is-popup":"style_is-popup__+r3Mn__oxjro",menu:"style_menu__WZUVE__oxjro","scroll-plus-box":"style_scroll-plus-box__QcTst__oxjro","menu-label":"style_menu-label__iGt0Z__oxjro","menu-item":"style_menu-item__hXHfm__oxjro","checkbox-hidden":"style_checkbox-hidden__Xpx7J__oxjro",loading:"style_loading__ZwrVe__oxjro"};var b=n(87558),A=n(58609),N=n(25438),S=n(70579),w=n(27047);const O=new Map,P=(0,b.withFetch)((e=>{let{data:t,name:n,type:a,cache:s,children:o,getLabel:r,...i}=e;const c=(0,l.useMemo)((()=>new Map(t.map((e=>[e.code,{...e,id:e.code,label:r?r(e):e.chName,parentId:e.parentCode||null}])))),[t,r]).get(n);return O.set("".concat(n,"_").concat(a),c),o(c,i)})),I=e=>{const{locale:t}=(0,w.A)(),n="".concat(t,"_").concat(e.name,"_").concat(e.type),a=O.get(n);return a&&!e.force?e.children(a):(0,S.jsx)(P,{...e})};I.defaultProps={children:e=>u()(e,"label","")};const L=I,k=a.A.useContext,M=(0,b.withFetch)((e=>{let{data:t,computedIsChecked:n,onSelect:a}=e;return(0,S.jsx)(j.A,{className:C["scroll-plus-box"],children:(0,S.jsx)(r.List,{className:N.A.list,size:"small",dataSource:t,rowKey:"value",renderItem:e=>{const t=n(e);return(0,S.jsx)(r.List.Item,{className:v()(N.A["list-item"],{[N.A["is-selected"]]:t}),onClick:()=>a(e,t),children:(0,S.jsx)("span",{className:N.A["item-label"],children:e.label})})}})})})),F=e=>{let{value:t,setValue:n,size:a,selectLevel:s}=e;const{fetchApi:d,props:p}=k(),[m,_]=(0,l.useState)(""),x=o()(p.dataFormat),{formatMessage:y}=(0,A.useIntl)({moduleName:"Common"}),b=d.data,w=(0,l.useMemo)((()=>new Map(x(b).list.map((e=>[e.value,e])))),[b,x]),O=(0,l.useMemo)((()=>h(w)),[w]),P=(0,l.useRef)({});P.current={createMergeTree:p.createMergeTree,loadMore:d.loadMore,openLoadData:p.openLoadData,parentIdKey:p.parentIdKey,treeUtils:O};const[I,L]=(0,l.useState)((()=>{const e=t.find((e=>!!w.get(e)));return O.getSelectedQueue(e||u()(d.data.find((e=>e.children&&e.children.length>0)),"id")||u()(d.data,"[0].id"),w)}));(0,l.useEffect)((()=>{const{openLoadData:e,loadMore:t,parentIdKey:n,createMergeTree:a,treeUtils:l}=P.current;if(!e)return;const s=w.get(g()(I));if(!s)return;const o=l.getSelectedQueue(s.id);f()(I,o)?s.hasOwnProperty("children")||t({data:{[n]:s.id}},a(s.id)):L(o)}),[I,w]);const F=(e,l)=>{const s=(()=>{if(p.onlyAllowLastLevel&&e){const e=t.slice(0);return e.push(l),e}if(p.onlyAllowLastLevel){const e=t.slice(0);return e.splice(t.indexOf(l),1),e}return e?O.setNodeChecked(l,t):O.setNodeUnchecked(l,t)})();s.length>a?r.message.error(y({id:"maxSelectedCount"},{count:a})):n(p.single&&s.length>0?[g()(s)]:s)},T=e=>{const t=w.get(e);return!(!p.openLoadData||t.hasOwnProperty("children"))||t.children&&t.children.length>0},R=!p.openLoadData&&"function"===typeof p.onSearch,D=R&&m&&(0,S.jsx)(M,{data:{searchText:m},loader:e=>{let{data:t}=e;return p.onSearch(t.searchText,{mapping:w})},computedIsChecked:e=>t.indexOf(e.id)>-1,onSelect:(e,t)=>{F(!t,e.id),!t&&L(O.getSelectedQueue(e.id,w)),_("")}});return(0,S.jsxs)("div",{className:v()(C.content,{[C["is-popup"]]:p.isPopup,[C["has-search"]]:R}),style:{"--menu-item-width":p.menuItemWidth},children:[R&&(0,S.jsx)(c.A,{isPopup:p.isPopup,className:v()(N.A["search-input"],{[N.A["is-popup"]]:p.isPopup}),placeholder:p.searchPlaceholder||y({id:"search"}),value:m,onSearch:e=>{_(e)}}),D||(0,S.jsx)("div",{children:(0,S.jsx)(j.A,{className:C.scroller,options:{autoHide:!1},children:(0,S.jsxs)("div",{className:C.columns,children:[I.map(((e,n)=>{const a=w.get(e),o=O.getSiblingNode(e),c=!T(null===a||void 0===a?void 0:a.id)&&n>0;return(0,S.jsx)(j.A,{className:v()(C["content-item"],{[C["last-level-area"]]:c}),children:c?(0,S.jsx)(r.Space,{wrap:!0,children:o.map((e=>(0,l.createElement)(r.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,S.jsx)(r.Menu,{className:v()(C.menu),onSelect:e=>{const n=w.get(e.key);if(n)if(T(n.id))L(O.getSelectedQueue(n.id,w));else{const{checked:e}=O.computedCheckboxStatus(n.id,t);F(!e,n.id)}},selectedKeys:n===I.length-1?[]:I,items:o.map((e=>({key:e.id,label:(0,S.jsxs)(r.Space,{className:v()(C["menu-item"],{[C["checkbox-hidden"]]:p.onlyAllowLastLevel&&T(e.id)}),children:[!p.onlyAllowLastLevel&&(0,S.jsx)(r.Checkbox,{...O.computedCheckboxStatus(e.id,t),disabled:s>1&&t.indexOf(e.parentCode)>-1,onChange:t=>F(t.target.checked,e.id)}),(0,S.jsx)("div",{className:C["menu-label"],children:e.label}),T(e.id)&&(0,S.jsx)(i.default,{className:C["menu-item-icon"],type:"icon-arrow-thin-right",size:12})]})})))})},u()(o,"[0].id",n))})),d.isComplete?null:(0,S.jsx)("div",{className:C.loading,children:(0,S.jsx)(r.Spin,{size:"small"})})]})})})]})},T=e=>{let{maxLength:t,nodeFormat:n,dataFormat:l,...s}=e;return(0,S.jsx)(a.A,{...s,dataFormat:e=>l(e,n),children:e=>{let{value:n,setValue:a}=e;return(0,S.jsx)(F,{...s,size:t,value:n,setValue:a})}})};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:n}=t;return Array.from(n.values()).filter((t=>t.label.indexOf(e)>-1))},dataFormat:(e,t)=>{const n=(e,a)=>{const l=[];return l.push(...(e||[]).map((e=>("function"===typeof t&&Object.assign(e,t(e)),e.children&&e.children.length>0&&l.push(...n(e.children,e.id)),Object.assign({},e,{value:e.id,parentId:a}))))),l};return{list:n(e,null)}},createMergeTree:e=>(t,n)=>{const a=t=>t.map((t=>t.id===e?Object.assign({},t,{children:n&&n.map((t=>Object.assign({},t,{parentId:e})))}):Array.isArray(t.children)&&t.children.length>0?Object.assign({},t,{children:a(t.children)}):t));return a(t)}};const R=T},41654:(e,t,n)=>{n.d(t,{A:()=>m,K:()=>p});var a=n(45776),l=n(27047),s=n(33097),o=n.n(s),r=n(70579);const i=(e,t)=>"en-US"===t?o()(e,"enName"):o()(e,"chName"),c=()=>n.e(719).then(n.t.bind(n,10719,19)).then((e=>e.__esModule?e.default:e)),d={cache:"FUNCTION_DATA",isLocal:!0,ttl:864e5,loader:c},u=e=>{let{apis:t,...n}=e;const{apis:s,locale:o}=(0,l.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,r.jsx)(a.Ay,{...n,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:n}=(0,a.ON)(new Map(t.map((e=>[e.code,{...e,id:e.code,label:i(e,o),parentId:e.parentCode||null}]))));return n}},c.functionData)})};u.defaultProps={overlayWidth:"640px",getSearchProps:e=>({data:{searchText:e}})},u.defaultData=c;const p=e=>{let{apis:t,...n}=e;const{apis:s,locale:o}=(0,l.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,r.jsx)(a.yK,{...n,...c.functionData,type:"function",getLabel:e=>i(e,o),transformData:e=>{let{data:t}=e;return t}})};u.FunctionEnum=u.Enum=p;const m=u},53392:(e,t,n)=>{n.d(t,{A:()=>p,W:()=>u});var a=n(45776),l=n(27047),s=n(33097),o=n.n(s),r=n(70579);const i=(e,t)=>"en-US"===t?o()(e,"enName"):o()(e,"chName"),c={cache:"INDUSTRY_DATA",isLocal:!0,ttl:864e5,loader:()=>n.e(7183).then(n.t.bind(n,57183,19)).then((e=>e.__esModule?e.default:e))},d=e=>{let{apis:t,...n}=e;const{apis:s,locale:o}=(0,l.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,r.jsx)(a.Ay,{...n,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:n}=(0,a.ON)(new Map(t.filter((e=>"000"!==e.code)).map((e=>[e.code,{...e,id:e.code,label:i(e,o),parentId:e.parentCode||null}]))));return n}},d.industryData)})};d.defaultProps={overlayWidth:"635px"};const u=e=>{let{apis:t,...n}=e;const{apis:s,locale:o}=(0,l.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,r.jsx)(a.yK,{...n,...d.industryData,type:"function",getLabel:e=>i(e,o),transformData:e=>{let{data:t}=e;return t}})};d.IndustryEnum=d.Enum=u;const p=d},26475:(e,t,n)=>{n.d(t,{A:()=>_});var a=n(73884),l=n(55199),s=n(96418),o=n.n(s),r=n(21485),i=n(83136),c=n.n(i),d=n(51941);const u="style_scroller-no-more__EH2J+__oxjro";var p=n(70579);const m=e=>{let{getScrollerRef:t,loadMore:n,maxFullCount:l}=e;const s=o()(n),r=o()(t);return(0,a.useEffect)((()=>{let e=l;const t=r(),n=async()=>{t.clientHeight===t.scrollHeight&&e>0&&(await s().then((()=>new Promise((e=>{setTimeout(e,500)})))),e--,await n())};n()}),[l,s,r]),null},h=(0,a.forwardRef)(((e,t)=>{let{className:n,noMore:s,onLoader:i,isLoading:h,completeTips:_,maxFullCount:g,children:x}=e;const[f,j]=(0,a.useState)(!1),y=(0,a.useRef)(),v=o()(i),C=(0,a.useRef)(!s&&!h);C.current=!s&&!h,(0,a.useImperativeHandle)(t,(()=>y.current),[]);const b=(0,d.useThrottledCallback)((e=>{const t=e.target;C.current&&t.clientHeight+t.scrollTop+20>t.scrollHeight&&v()}),100);return(0,p.jsxs)(r.A,{ref:y,onScroll:b,className:c()("load-container",n),onReady:()=>{j(!0)},children:[f&&!h&&!s&&(0,p.jsx)(m,{maxFullCount:g,getScrollerRef:()=>y.current,loadMore:v}),(0,p.jsxs)(l.Space,{direction:"vertical",children:[(0,p.jsx)("div",{children:x}),h?(0,p.jsx)("div",{className:u,children:(0,p.jsx)(l.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,n)=>{n.d(t,{A:()=>m});var a=n(55199),l=n(83136),s=n.n(l);const o="style_search-input__8aH1G__oxjro",r="style_is-popup__L0973__oxjro";var i=n(64671),c=n(73884),d=n(51941),u=n(70579);const p=e=>{let{value:t,debounce:n,onSearch:l,isPopup:p,placeholder:m,className:h,..._}=e;const[g,x]=(0,c.useState)(t),f=(0,c.useRef)(t),j=(0,d.useDebouncedCallback)(l,n);return(0,c.useEffect)((()=>{t!==f.current&&(x(t),f.current=t)}),[t]),(0,u.jsx)(a.Input.Search,{..._,allowClear:!0,className:s()(h,o,{[r]: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;f.current=t,x(t),j(t)},onSearch:e=>{j(e)}})};p.defaultProps={debounce:500};const m=p},30509:(e,t,n)=>{n.d(t,{A:()=>B});const a={"ant-tag":"style_ant-tag__nNp8-__oxjro",overlay:"style_overlay__La5mO__oxjro",input:"style_input__SpJTE__oxjro","is-disabled":"style_is-disabled__joxdl__oxjro","input-icon":"style_input-icon__vVd8R__oxjro",large:"style_large__En6mL__oxjro",small:"style_small__DY0AQ__oxjro","input-inner":"style_input-inner__PWy27__oxjro","input-custom":"style_input-custom__ktsWD__oxjro","display-content":"style_display-content__hIKo+__oxjro","overlay-footer-extra":"style_overlay-footer-extra__Q+BiR__oxjro","selected-tag":"style_selected-tag__zXZZO__oxjro","selected-tag-list":"style_selected-tag-list__xUIms__oxjro","selected-tag-inner":"style_selected-tag-inner__Z5gPL__oxjro","text-inner":"style_text-inner__H24hY__oxjro",placeholder:"style_placeholder__x0ccE__oxjro","is-modal":"style_is-modal__JU+uq__oxjro","overlay-content":"style_overlay-content__WKqp+__oxjro"};var l=n(74981);const{context:s,useContext:o,Provider:r,Consumer:i}=(0,l.A)();var c=n(73884),d=n(10986),u=n.n(d),p=n(87558),m=n(33097),h=n.n(m),_=n(55199),g=n(83136),x=n.n(g),f=n(3382),j=n(64671),y=n(79686),v=n.n(y),C=n(41740),b=n.n(C),A=n(74065),N=n.n(A),S=n(21485),w=n(96418),O=n.n(w),P=n(77964),I=n(91176),L=n(58609),k=n(20492),M=n(27047),F=n(70579);const T=e=>{let{maxLength:t,single:n,setValue:a,value:l,message:s}=e;return e=>a(!n&&Number.isInteger(t)&&t>0&&e.length>t?(s(),l):e)},R=e=>{let{single:t,value:n,mapping:l,allValue:s,allLabel:o,onClose:r}=e;return n&&Array.isArray(n)&&0!==n.length?t?(0,F.jsx)("span",{className:a["text-inner"],children:h()(l.get(n[0]),"label")||n[0]}):1===n.length&&n[0]===(s||"all")?(0,F.jsx)("span",{className:a["text-inner"],children:o||(0,F.jsx)(L.FormattedMessage,{id:"all",moduleName:"Common"})}):n.map((e=>{const t=l.get(e);return(0,F.jsx)(_.Tag,{className:a["display-tag"],closable:!0,onClose:n=>{n.preventDefault(),r(e,t)},children:(0,F.jsx)("span",{className:a["tag-inner"],children:h()(t,"label")||e})},e)})):null},D=(0,c.forwardRef)(((e,t)=>{let{value:n,onChange:l,extra:s,showSelectedTag:o,renderSelectedContent:r,children:i,...d}=e;const[u,p]=(0,c.useState)(n),m=(0,c.useRef)(n),{formatMessage:h}=(0,L.useIntl)({moduleName:"Common"});m.current=n;const[g,x]=(0,c.useState)(!1),j=e=>{var t;x(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:()=>{j(!0)},close:()=>{j(!1)}}))),(0,F.jsx)(f.default,{...d,open:g,onConfirm:()=>{l(u)},onClose:()=>{j(!1)},footer:(0,F.jsxs)(_.Space,{direction:"vertical",className:a["overlay-footer"],children:[s&&(0,F.jsx)("div",{className:a["overlay-footer-extra"],children:s}),o&&r({value:u,setValue:v})]}),children:"function"===typeof i?i({value:u,setValue:v}):i})})),E=(0,c.forwardRef)(((e,t)=>{let{value:n,setValue:l,children:s,renderSelectedContent:o,showSelectedTag:r,placement:i,inputContent:d,single:u,extra:p,overlayWidth:m,wrapClassName:h,overlayClassName:g,disabled:f,...j}=e;const[y,v]=(0,c.useState)(!1),C=O()((e=>{var t;v(e),null===(t=j.onOpenChange)||void 0===t||t.call(j,e)}));return(0,c.useImperativeHandle)(t,(()=>({close:()=>{C(!1)}})),[C]),f?(0,F.jsx)("div",{className:a["input-inner"],children:d}):(0,F.jsx)(_.Popover,{...j,open:y,onOpenChange:C,transitionName:"ant-slide-up",overlayClassName:x()(a.overlay,g),arrow:!1,content:(0,F.jsxs)("div",{style:m?{"--overlay-width":m}:{},className:x()(a["overlay-content"],"over-content"),onClick:e=>{e.stopPropagation()},children:[(0,F.jsx)("div",{className:a["overlay-inner"],children:"function"===typeof s?s({value:n,setValue:e=>{(!u||n[0]!==e[0])&&l(e),u&&C(!1)}}):s}),(r||p)&&(0,F.jsxs)("div",{className:a["overlay-footer"],children:[p&&(0,F.jsx)("div",{className:a["overlay-footer-extra"],children:p}),r&&o({value:n,setValue:l})]})]}),trigger:"click",placement:i,children:(0,F.jsx)("div",{className:a["input-inner"],children:d})})})),z=(0,p.withFetch)((e=>{let{setFetchApi:t,wrapClassName:n,getContentRef:l,...s}=e;const[r,i]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useRef)(null),p=o(),{valueState:m,mapping:h,props:g,inputWidth:f}=p,[y,v]=m,{formatMessage:C}=(0,L.useIntl)({moduleName:"Common"}),{single:b,placement:A,getPopupContainer:N,placeholder:w,isPopup:P,disabled:k,showSelectedTag:M,extra:T,inputContent:z,allowClear:V,overlayClassName:W}=g,B=(0,c.useRef)(s);B.current=s;const U=O()(l);(0,c.useEffect)((()=>{U(P?u:d)}),[P,U]),(0,c.useEffect)((()=>{t(Object.assign({},B.current,{data:s.data,isComplete:s.isComplete}))}),[s.data,t,s.isComplete]);const K=R({single:b,value:y,mapping:h,allValue:g.allValue,allLabel:g.allLabel,onClose:e=>{v((t=>{const n=t.slice(0),a=t.indexOf(e);return a>-1&&n.splice(a,1),n}))}}),q=e=>{let{value:t,setValue:n}=e;return(0,F.jsxs)(_.Space,{className:a["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)(S.A,{className:a["selected-tag-list"],children:(0,F.jsx)("div",{className:a["selected-tag-inner"],children:R({value:t,mapping:h,allValue:g.allValue,allLabel:g.allLabel,onClose:e=>{n((t=>{const n=t.slice(0),a=t.indexOf(e);return a>-1&&n.splice(a,1),n}))}})})})]})},H=z?z(p):(0,F.jsxs)(_.Space,{className:a["display-content"],onMouseOver:()=>{i(!0)},onMouseOut:()=>{i(!1)},children:[(0,F.jsx)("div",{children:K||(0,F.jsx)("span",{className:a.placeholder,children:w||C({id:"pleaseSelect"})})}),r&&y&&y.length>0&&!k&&V?(0,F.jsx)(j.default,{className:x()(a.close,a["input-icon"],"close","input-icon"),type:"icon-shibai",onClick:e=>{e.stopPropagation(),v([])}}):(0,F.jsx)(j.default,{className:x()(a["input-icon"],"input-icon-arrow","input-icon"),type:"icon-arrow-thin-down"})]});return P?(0,F.jsx)(E,{ref:u,overlayWidth:(0,I.v)(Math.max(f,(0,I.j)(g.overlayWidth))),value:y,setValue:v,single:b,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:A,getPopupContainer:N,children:g.children}):(0,F.jsxs)("div",{className:a["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:x()(a.overlay,a["is-modal"],n),title:g.placeholder||C({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:n,displayItems:l,wrapClassName:s,...o}=e;const{locale:i}=(0,M.A)(),[d,p]=(0,c.useState)(""),[m,g]=(0,c.useState)(new Map(l.map((e=>[e.value,e])))),{formatMessage:f}=(0,L.useIntl)({moduleName:"Common"}),[j,y]=(0,c.useState)(0),C=(0,P.A)((e=>{y(e.clientWidth)})),[A,S]=(0,c.useState)({}),{message:w}=_.App.useApp(),O=e=>{const t=e.filter((e=>m.get(e.value)!==e));0!==t.length&&g((e=>{const n=b()(e);return t.forEach((e=>{n.set(e.value,e)})),n}))},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)(o.single?v()(e)?[]:[e]:e||[],O,o.valueType),[k,R]=u()(Object.assign({},o,{onChange:e=>{const t=((e,t,n)=>"all"!==n?e:e.map((e=>t.get(e))).filter((e=>!!e)))(e,m,o.valueType);o.onChange&&o.onChange(o.single?N()(t):t)}},"value"in o?{value:I(o.value)}:{defaultValue:I(o.defaultValue)})),D=T({maxLength:o.maxLength,single:o.single,setValue:R,value:k,message:()=>w.error(f({id:"maxSelectedCount"},{count:o.maxLength}))}),E=(0,c.useRef)(null);return(0,F.jsx)(r,{value:{inputWidth:j,mapping:m,searchText:d,setSearchText:p,appendMapping:O,setItems:e=>{A.setData(e),O(h()(o.dataFormat(e,{locale:i}),"list",[]))},getContentApi:()=>E.current,fetchApi:A,valueState:[k,D],props:o},children:(0,F.jsx)("div",{ref:C,className:x()(a["input".concat(o.inputContent&&"function"===typeof o.inputContent?"-custom":"")],{"select-input-disabled":!!o.disabled},n),children:(0,F.jsx)(z,{...t,wrapClassName:s,loading:null,setFetchApi:S,getContentRef:e=>{e.current&&(E.current=e.current)},onRequestSuccess:e=>{O(h()(o.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=o;const B=W},17342:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(8762),l=n.n(a);n(46733);const s=l()},21485:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(73884),l=n(44418),s=n.n(l),o=n(96418),r=n.n(o),i=n(70579);const c=(0,a.forwardRef)(((e,t)=>{let{children:n,onScroll:l,options:o,onReady:c,...d}=e;const u=(0,a.useRef)(null),p=(0,a.useRef)(null),m=(0,a.useRef)(o),h=r()(c),_=r()(l);return(0,a.useImperativeHandle)(t,(()=>p.current)),(0,a.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,n]),(0,i.jsx)("div",{...d,ref:u,children:n})}))},89319:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(55199),l=n(10986),s=n.n(l),o=n(57469),r=n.n(o),i=n(20492),c=n(58609),d=n(70579);const u=(0,c.createWithIntl)({importMessages:i.A,moduleName:"Common"})((e=>{let{...t}=e;const{formatMessage:n}=(0,c.useIntl)({moduleName:"Common"}),l=new Map([["date",n({id:"customTime"})],["month",n({id:"monthly"})],["week",n({id:"weekly"})]]),[o,i]=s()(t);return(0,d.jsxs)(a.Space.Compact,{children:[(0,d.jsx)(a.Select,{style:{width:"120px"},value:(null===o||void 0===o?void 0:o.type)||"date",onChange:e=>{i((t=>{var n;return{value:null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.length?[r()(t.value[0]).startOf(e||"date"),r()(t.value[1]).endOf(e||"date")]:null,type:e||"date"}}))},options:Array.from(l).map((e=>{let[t,n]=e;return{label:n,value:t}}))}),(0,d.jsx)(a.DatePicker.RangePicker,{...t,picker:(null===o||void 0===o?void 0:o.type)||"date",value:Array.isArray(null===o||void 0===o?void 0:o.value)&&2===o.value.length&&o.value.map((e=>e&&r()(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,n)=>{n.d(t,{A:()=>a});const a=e=>({"en-US":()=>n.e(3086).then(n.bind(n,13086)),"zh-CN":()=>n.e(4308).then(n.bind(n,84308))}[e]())},29574:(e,t,n)=>{n.d(t,{Zi:()=>_,FI:()=>g,AG:()=>x,Ay:()=>j,lN:()=>f});const a="style_input-file__3JGm6__oxjro",l="style_input-file-input__Fb5iw__oxjro";var s=n(83136),o=n.n(s),r=n(73884),i=n(55199),c=n(76329),d=n(28987),u=n(80111),p=n.n(u),m=n(70579);const h=e=>t=>{let{className:n,accept:s,multiple:i,onChange:c,children:d,...u}=t;const p=(0,r.useRef)(null);return(0,m.jsxs)(e,{...u,className:o()(n,a),children:[d,!0!==u.disabled&&(0,m.jsx)("input",{ref:p,type:"file",accept:s,multiple:i,className:l,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,...n}=e;return(0,m.jsx)(i.Typography.Link,{...n,className:t})})),x=h((e=>{let{className:t,...n}=e;return(0,m.jsx)(i.Typography.Text,{...n,className:o()("ant-btn",t)})})),f=e=>{const{message:t}=i.App.useApp(),{multiple:n,fileSize:a,maxLength:l,value:s,concurrentCount:o,onAdd:u,onError:m,onSave:h,onChange:_,ossUpload:g}=Object.assign({},{concurrentCount:1,value:[]},e),{apis:x}=(0,c.usePreset)(),[f,j]=(0,r.useState)([]),y=(0,r.useRef)(o),v=(0,r.useMemo)((()=>(0,d.A)(y.current)),[]);return{fileList:f,onFileSelected:async e=>{const o=l-s.length;1!==l&&!0===n&&e.length>o?t.error("\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf".concat(l)):await Promise.allSettled(e.map((async e=>{if(e.size>1024*a*1024)return void t.error("\u6587\u4ef6".concat(e.name,"\u4e0d\u80fd\u8d85\u8fc7").concat(a,"MB!"));const s=p()(),o=n=>{const a=n.message||"\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u9519\u8bef").concat(n.message?":"+n.message:"");t.error(a),m&&m({file:e,error:n,errMsg:a}),j((e=>{const t=e.slice(0),n=t.findIndex((e=>e.uuid===s));return n>-1&&t.splice(n,1),t}))};try{j(1===l||!0!==n?[{uuid:s,type:"uploading",filename:e.name}]:t=>{const n=t.slice(0);return n.unshift({uuid:s,type:"uploading",filename:e.name}),n}),u&&await Promise.resolve(u(e));const t=g||x.ossUpload,{data:a}=await v((()=>t({file:e})));if(0!==a.code)return void o(new Error("\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u5f02\u5e38").concat(a.msg?":"+a.msg:"")));const r=h?await Promise.resolve(h(a,e,s)):{filename:a.data.originalName||a.data.filename||e.name,id:a.data.id,ossId:a.data.id,uuid:s};j((e=>{const t=e.slice(0),n=t.findIndex((e=>e.uuid===s));return n>-1&&t.splice(n,1),t})),_(1===l||!0!==n?[r]:e=>{const t=e.slice(0);return t.push(r),t})}catch(r){o(r)}})))}}},j=h},97211:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(87558),l=n.n(a),s=n(76329),o=n(34677),r=n.n(o),i=n(70579);const c=e=>{const t=t=>{let{id:n,url:a,error:o,apis:c,loading:d,...u}=t;const{apis:p}=(0,s.usePreset)(),m=r()({},p,c);if(!n)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),x={};return x[h]={[_]:n},(0,i.jsx)(l(),{...Object.assign({},g,x),updateType:"refresh",error:o,loading:d,cache:"oss-file",ttl:6e6,render:t=>{let{data:a}=t;return(0,i.jsx)(e,{...u,id:n,data:a})}})};return t.defaultProps={loading:null},t}},27047:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(83694),l=n(33097),s=n.n(l);const o=()=>{const e=(0,a.useGlobalContext)();return s()(e,"preset",{apis:{}})}},77964:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(73884),l=n(79889),s=n.n(l),o=n(93950),r=n.n(o),i=n(96418),c=n.n(i);const d=(e,t)=>{const n=(0,a.useRef)(null);n.current=Object.assign({},{time:500,isDebounce:!1},t);const l=(0,a.useRef)(null),o=c()(e);return(0,a.useLayoutEffect)((()=>{const e=l.current,t=()=>window.requestAnimationFrame((()=>{e&&o(e)}));t();const a=new ResizeObserver((n.current.isDebounce?r():s())(t,n.current.time));return e&&a.observe(e),()=>{a.disconnect()}}),[o]),l}},81348:(e,t,n)=>{n.d(t,{A:()=>a});const a=(e,t)=>{if(e&&t){const n=Array.isArray(t)?t:t.split(","),a=e.name||"",l=(e.type||"").toLowerCase(),s=l.replace(/\/.*$/,"");return n.some((e=>{const t=e.trim().toLowerCase();return"."===t.charAt(0)?a.toLowerCase().endsWith(t):t.endsWith("/*")?s===t.replace(/\/.*$/,""):l===t}))}return!0}},69484:(e,t,n)=>{n.d(t,{A:()=>l,e:()=>a});const a=1e15,l=e=>{let t,n,l,s=["\u96f6","\u58f9","\u8d30","\u53c1","\u8086","\u4f0d","\u9646","\u67d2","\u634c","\u7396"],o=["","\u62fe","\u4f70","\u4edf"],r=["","\u4e07","\u4ebf","\u5146"],i=["\u89d2","\u5206","\u6beb","\u5398"],c="",d="";if(""===e)return"";if((e=parseFloat(e))>=a)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,n=""):(l=e.split("."),t=l[0],n=l[1].substr(0,4)),parseInt(t,10)>0){let e=0,n=t.length;for(let a=0;a<n;a++){let l=t.substr(a,1),i=n-a-1,d=i/4,u=i%4;"0"===l?e++:(e>0&&(c+=s[0]),e=0,c+=s[parseInt(l)]+o[u]),0===u&&e<4&&(c+=r[d])}c+="\u5143"}if(""!==n){let e=n.length;for(let t=0;t<e;t++){let e=n.substr(t,1);"0"!==e&&(c+=s[Number(e)]+i[t])}}return""===c?c+=s[0]+"\u5143\u6574":""===n&&(c+="\u6574"),c=d+c,c}},74981:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(73884);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.createContext)(e),{Provider:n,Consumer:l}=t;return{context:t,Provider:n,Consumer:l,useContext:()=>(0,a.useContext)(t)}}},28987:(e,t,n)=>{n.d(t,{A:()=>a});const a=e=>{const t=[];let n=0;const a=()=>{if(0!==t.length){if(n<e){const e=t.shift();n+=1,e().finally((()=>{n-=1,a()}))}}else n=0};return e=>new Promise((n=>{t.push((()=>{const t=Promise.resolve().then((()=>e()));return n(t),t})),a()}))}},55490:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(12322),l=n.n(a),s=n(26727),o=n.n(s),r=n(54052),i=n.n(r);const c=e=>{if(l()(e)){const t=o()(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,n)=>{n.d(t,{j:()=>l,v:()=>a});const a=e=>"number"===typeof e?"".concat(e,"px"):e,l=e=>{if(!e)return 0;const t=e.match(/^\d*(\.\d*)?/);return t?Number(t[0]):0}},36:(e,t,n)=>{n.r(t),n.d(t,{AddressEnum:()=>h.qn,AddressInputField:()=>h.TM,AddressSelectField:()=>h.Ay,AdvancedSelectField:()=>_.Ay,CascaderField:()=>g.Ay,FetchButton:()=>i.A,FunctionEnum:()=>x.K,FunctionSelectField:()=>x.A,IndustryEnum:()=>f.W,IndustrySelectField:()=>f.A,InputFileButton:()=>m.Zi,InputFileLink:()=>m.FI,InputFileText:()=>m.AG,ScrollLoader:()=>r.A,SearchInput:()=>u.A,SelectInnerInput:()=>p.A,SimpleBar:()=>d.A,SimpleBarBox:()=>c.A,TableField:()=>_.Bm,TypeDateRangePickerField:()=>j.A,UserField:()=>_.Eo,accept:()=>v.A,changeMoneyToChinese:()=>a.A,createAddressApi:()=>h.LH,createDeferred:()=>C.A,createListField:()=>_.NR,createTreeUtils:()=>g.ON,getContainerBody:()=>l.c,getPopupContainer:()=>s,getScrollEl:()=>l.h,isNotEmpty:()=>b.A,numberToPx:()=>A.v,pxToNumber:()=>A.j,useFileUpload:()=>m.lN,useResize:()=>y.A,withAddressApi:()=>h.DF,withInputFile:()=>m.Ay,withOSSFile:()=>o.A});var a=n(69484),l=n(76801);const s=e=>{const t=e=>{const n=(0,l.h)();if(!e||e===n||!e.parentElement)return n;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 o=n(97211),r=n(26475),i=n(73025),c=n(21485),d=n(17342),u=n(73161),p=n(30509),m=n(29574),h=n(93761),_=n(12392),g=n(45776),x=n(41654),f=n(53392),j=n(89319),y=n(77964),v=n(81348),C=n(28987),b=n(55490),A=n(91176)},40438:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var a=n(87558),l=n.n(a),s=n(97211),o=n(64671),r=n(83136),i=n.n(r),c=n(55199),d=n(73884);const u=e=>{let{params:t}=e;const{data:n}=t;return new Promise(((e,t)=>{const a=new window.Image;a.src=n,a.addEventListener("load",(()=>{e(n)})),a.addEventListener("error",(e=>{t(e)}))}))},p="style_img-outer__4QLY5__oxjro",m="style_img__PSExq__oxjro",h="style_loading__WCOwA__oxjro",_="style_error__+ECgZ__oxjro";var g=n(18411),x=n(70579);const f=e=>{let{data:t,className:n,alt:a,innerLoading:s,loading:o,error:r,innerError:c,children:d,onClick:p}=e;return(0,x.jsx)(l(),{loader:u,params:{data:t},error:c||r,loading:s||o,render:e=>{let{data:t}=e;return"function"===typeof d?d({alt:a,className:i()(n,m),src:t}):(0,x.jsx)("img",{alt:a,className:i()(n,m),src:t,onClick:p})}})},j=(0,s.A)(f),y=e=>{let{loading:t,error:n,src:a,id:l,alt:s,className:o,children:r,apis:i,onClick:c}=e;const u=t&&(0,d.cloneElement)(t,{className:h}),p=n&&(0,d.cloneElement)(n,{className:_});return a?(0,x.jsx)(f,{alt:s,className:o,data:a,loading:u,error:p,onClick:c,children:r}):l?(0,x.jsx)(j,{alt:s,className:o,id:l,loading:u,innerLoading:u,error:p,innerError:p,apis:i,onClick:c,children:r}):p},v=e=>{let{id:t,src:n,alt:a,onClick:l,loading:s,error:o,className:r,apis:c,...d}=e;return(0,x.jsx)("div",{...d,"data-testid":"components-core-image",className:i()(r,p),children:y({loading:s,error:o,src:n,id:t,alt:a,className:r,apis:c,onClick:l})})};v.Avatar=e=>{let{id:t,src:n,alt:a,gender:l,loading:s,error:r,className:d,gap:u,icon:m,children:h,shape:_,size:g,width:f,height:j,defaultAvatar:v,apis:C,...b}=e;const A=(()=>{const e=f&&j?{style:{width:f,height:j}}:{size:g};if(f&&f!==j&&(_="square"),t||n)return y({loading:s,error:r,src:n,defaultAvatar:v,id:t,alt:a,className:d,apis:C,children:t=>(0,x.jsx)(c.Avatar,{...t,gap:u,shape:_,...e})});if(l){const t=l&&["F","female","f"].indexOf(l)>-1?"icon-color-touxiang-nv":"icon-color-touxiang-nan";return(0,x.jsx)(c.Avatar,{...b,src:(0,x.jsx)(o.default,{role:"touxiang",colorful:!0,type:t}),gap:u,shape:_,...e})}return(0,x.jsx)(c.Avatar,{...b,gap:u,icon:m,shape:_,size:g,src:v,...e,children:h})})();return(0,x.jsx)("div",{...b,"data-testid":"components-core-image-avatar",className:i()(d,p),style:{width:f&&j?f:g,height:f&&j?j:g},children:A})};const C={error:(0,x.jsx)(o.default,{role:"error-icon",colorful:!0,type:"icon-color-touxiang-nan"}),loading:(0,x.jsx)(c.Skeleton.Avatar,{shape:"square",active:!0})};v.defaultProps=Object.assign({},C),v.Avatar.defaultProps=Object.assign({},C,{size:100,defaultAvatar:g.A});const b=v},3382:(e,t,n)=>{n.r(t),n.d(t,{ModalButton:()=>k,TabsModal:()=>O,TabsModalButton:()=>L,default:()=>S,useConfirmModal:()=>N,useModal:()=>A,useTabsModal:()=>P});var a=n(73884),l=n(55199),s=n(83136),o=n.n(s);const r={modal:"style_modal__Pm3cF__oxjro",large:"style_large__iaqVE__oxjro","modal-body-inner":"style_modal-body-inner__4PhpA__oxjro","modal-title":"style_modal-title__dswaw__oxjro","modal-outer":"style_modal-outer__r3SkX__oxjro","modal-body":"style_modal-body__jQJSI__oxjro","right-options-modal":"style_right-options-modal__FajDP__oxjro","right-options-row":"style_right-options-row__-mPb9__oxjro","right-options-col":"style_right-options-col__3ilee__oxjro","is-disabled-scroller":"style_is-disabled-scroller__PmHyk__oxjro",content:"style_content__k6MIF__oxjro","modal-footer":"style_modal-footer__-prbN__oxjro","modal-close":"style_modal-close__Oa5Kl__oxjro","confirm-modal-wrap":"style_confirm-modal-wrap__YFImr__oxjro","is-danger":"style_is-danger__H5110__oxjro",title:"style_title__orTym__oxjro","has-title":"style_has-title__qy0Wp__oxjro"},i=e=>({"en-US":()=>n.e(4628).then(n.bind(n,74628)),"zh-CN":()=>n.e(7478).then(n.bind(n,87478))}[e]());var c=n(58609),d=n(64671);const u=(e,t)=>"function"===typeof e?e(t):e;var p=n(81014),m=n(17342),h=n(70579);const _="Modal",g=e=>{let{options:t,children:n}=e;return t?(0,h.jsxs)(l.Row,{wrap:!1,className:r["right-options-row"],children:[(0,h.jsx)(l.Col,{span:18,className:r["right-options-col"],children:n}),(0,h.jsx)(l.Col,{span:6,className:r["right-options-col"],children:t})]}):n},x=(e,t)=>"".concat(e-48-(t?58:0),"px"),f=(e,t)=>"large"===e?{width:"".concat(Math.min(window.innerWidth-64,1500),"px"),style:{"--min-modal-height":x(500,t)}}:"small"===e?{width:"600px",style:{"--min-modal-height":x(300,t)}}:{width:"1000px",style:{"--min-modal-height":x(500,t)}},j=e=>{let{footer:t,footerButtons:n,onConfirm:s,onCancel:o,onClose:r,targetProps:d}=e;return(0,h.jsxs)(l.Row,{gutter:10,wrap:!1,children:[(0,h.jsx)(l.Col,{flex:1,children:t}),Array.isArray(n)&&0===n.length?null:(0,h.jsx)(l.Col,{children:(0,h.jsx)(l.Space,{children:(n||[{children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:_,children:(0,h.jsx)(c.FormattedMessage,{id:"Cancel",moduleName:_})}),onClick:o},{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:n,onClick:l,autoClose:s=!0,display:o,...i}=e;const c=n||p.default;return(0,a.createElement)(c,{...i,key:t,onClick:async function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const a=await Promise.resolve(l&&l(...t,d));return s&&!1!==a&&r&&r(),a}})}))})})]})},y=e=>{let{title:t,footer:n,disabledScroller:s,footerButtons:i,onClose:c,closable:u,onConfirm:p,onCancel:_,children:g,targetProps:x}=e;const f=(0,a.useRef)(null);return(0,h.jsxs)("div",{className:r["modal-outer"],"data-testid":"components-core-modal",children:[!1===u?null:(0,h.jsx)(l.Button,{"data-testid":"components-core-modal-close-btn",className:r["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:r["modal-title"],children:t}),(0,h.jsx)(m.A,{className:o()(r["modal-body"],{[r["is-disabled-scroller"]]:s},"modal-body"),ref:f,children:(0,h.jsx)("div",{className:o()(r["modal-body-inner"],"modal-body-inner"),children:g})}),null!==n||i?(0,h.jsx)("div",{className:o()(r["modal-footer"],"modal-footer"),children:(0,h.jsx)(j,{footer:n,footerButtons:i,onConfirm:p,onCancel:_,onClose:c,targetProps:x})}):null]})},v=e=>{let{withDecorator:t,footerButtons:n,title:a,closable:l,onClose:s,onConfirm:o,onCancel:r,footer:i,rightOptions:c,disabledScroller:d,childrenRef:p,children:m}=e;const _=e=>(e=Object.assign({},{title:a},e),(0,h.jsx)(y,{title:u(e.title,{...e,childrenRef:p,close:s}),closable:l,onClose:s,onConfirm:o,onCancel:r,footerButtons:u(n,{...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(_):_({})},C=e=>{let{children:t,rightOptions:n,footer:a,footerButtons:l,className:s,size:d,title:u,onClose:p,onConfirm:m,onCancel:_,closable:g,disabledScroller:x,withDecorator:j,childrenRef:y,...C}=e;return{...C,icon:null,centered:!0,title:null,maskClosable:!!C.hasOwnProperty("maskClosable")&&C.maskClosable,destroyOnClose:!0,footer:null,closable:!1,onCancel:p,className:o()(s,r.modal,r[d],{[r["right-options-modal"]]:n}),...f(d,!(null===a&&!l)),children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:"Modal",children:v({withDecorator:j,title:u,closable:g,onClose:p,onConfirm:m,onCancel:_,footer:a,footerButtons:l,rightOptions:n,disabledScroller:x,children:t,childrenRef:y})})}},b=e=>{const t=(0,a.useRef)(null);return(0,h.jsx)(l.Modal,{...C(Object.assign({},e,{childrenRef:t}))})};b.defaultProps={size:"default"};const A=()=>{const{modal:e}=l.App.useApp(),t=(0,a.useRef)(null);return n=>{const a={},{children:l,...s}=C({onClose:()=>a.close(),childrenRef:t,...n}),{destroy:o}=e.info({...s,content:l});return a.close=o,a}},N=()=>{const{modal:e}=l.App.useApp();return t=>{const n={},{type:a,icon:s,title:i,danger:c,wrapClassName:u,message:p,iconSetting:m={},confirmType:_="info",...g}={onClose:()=>n.close(),maskClosable:!1,...t},x=Object.assign({},{info:"icon-xinxi-tianchong",confirm:"icon-tishi-tianchong",warning:"icon-tishi-tianchong",error:"icon-shibai",success:"icon-chenggong"},m);if(e[a]){const{destroy:t}=e[a]({...g,icon:null,wrapClassName:o()(r["confirm-modal-wrap"],u,{[r["is-danger"]]:c}),title:(0,h.jsx)(l.Space,{direction:"vertical",onClick:e=>{e.stopPropagation()},children:i&&(0,h.jsxs)(l.Space,{size:0,align:"start",className:r.title,children:[c?(0,h.jsx)(d.default,{className:o()("title-icon","title-icon-".concat("confirm"===a?_:a)),type:s||x["confirm"===a?_:a]}):null,i]})}),content:(0,h.jsxs)(l.Space,{size:0,align:"start",className:o()(r.content,{[r["has-title"]]:i}),children:[!i&&c?(0,h.jsx)(d.default,{className:o()("title-icon","title-icon-".concat("confirm"===a?_:a)),type:s||x["confirm"===a?_:a]}):null,p]})});n.close=t}return n}},S=b,w=e=>{let{items:t,className:n,activeKey:a,withDecorator:s,defaultActiveKey:r,onChange:i,...c}=e;return{...c,className:o()(n,"tabs-modal"),withDecorator:e=>{const n=n=>(0,h.jsx)(l.Tabs,{items:t.map((t=>{let{withDecorator:a,...l}=t;return Object.assign({},l,{children:"function"===typeof a?a((t=>e(Object.assign({},n,t,{children:l.children})))):e(Object.assign({},n,{children:l.children}))})})),destroyInactiveTabPane:!0,activeKey:a,defaultActiveKey:r,onChange:i});return"function"===typeof s?s(n):n()},children:e=>{let{children:t,...n}=e;return"function"===typeof t?t(n):t}}},O=e=>(0,h.jsx)(S,{...w(e)}),P=()=>{const e=A();return t=>e(w(t))};var I=n(73025);const L=e=>{const t=P();return(0,h.jsx)(I.A,{...e,modalFunc:t})},k=e=>{const t=A();return(0,h.jsx)(I.A,{...e,modalFunc:t})}},25438:(e,t,n)=>{n.d(t,{A:()=>a});const a={"search-input":"common_search-input__P6qLg__oxjro","is-popup":"common_is-popup__fJq+g__oxjro",list:"common_list__TKFzS__oxjro","list-item":"common_list-item__ASse7__oxjro","is-selected":"common_is-selected__-PU4Y__oxjro","item-label":"common_item-label__u+qz1__oxjro","item-des":"common_item-des__no2z0__oxjro"}}}]);
2
+ //# sourceMappingURL=36.2c076f0a.chunk.js.map