@kne-components/components-core 0.1.65 → 0.1.67

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 (174) hide show
  1. package/build/asset-manifest.json +122 -122
  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.d8e0a28b.chunk.css +2 -0
  6. package/build/static/css/{1151.09c186c4.chunk.css.map → 1151.d8e0a28b.chunk.css.map} +1 -1
  7. package/build/static/css/1153.994282f3.chunk.css +2 -0
  8. package/build/static/css/{1153.f71bbb4d.chunk.css.map → 1153.994282f3.chunk.css.map} +1 -1
  9. package/build/static/css/1454.d9baad5b.chunk.css +2 -0
  10. package/build/static/css/{1454.ac7e29c1.chunk.css.map → 1454.d9baad5b.chunk.css.map} +1 -1
  11. package/build/static/css/1554.4f8de5f7.chunk.css +2 -0
  12. package/build/static/css/{1554.6767cb42.chunk.css.map → 1554.4f8de5f7.chunk.css.map} +1 -1
  13. package/build/static/css/{2503.1041a7cd.chunk.css → 2503.d3630010.chunk.css} +2 -2
  14. package/build/static/css/{2503.1041a7cd.chunk.css.map → 2503.d3630010.chunk.css.map} +1 -1
  15. package/build/static/css/{2517.4b2ffe1c.chunk.css → 2517.e6401508.chunk.css} +2 -2
  16. package/build/static/css/{2517.4b2ffe1c.chunk.css.map → 2517.e6401508.chunk.css.map} +1 -1
  17. package/build/static/css/2716.9f329728.chunk.css +2 -0
  18. package/build/static/css/{2716.426319cd.chunk.css.map → 2716.9f329728.chunk.css.map} +1 -1
  19. package/build/static/css/{2730.cacd6939.chunk.css → 2730.b1126875.chunk.css} +2 -2
  20. package/build/static/css/{2730.cacd6939.chunk.css.map → 2730.b1126875.chunk.css.map} +1 -1
  21. package/build/static/css/{289.2216e089.chunk.css → 289.5c3f0830.chunk.css} +2 -2
  22. package/build/static/css/{289.2216e089.chunk.css.map → 289.5c3f0830.chunk.css.map} +1 -1
  23. package/build/static/css/2999.874fdfb4.chunk.css +2 -0
  24. package/build/static/css/{2999.bb10a4ea.chunk.css.map → 2999.874fdfb4.chunk.css.map} +1 -1
  25. package/build/static/css/3040.c06719a2.chunk.css +2 -0
  26. package/build/static/css/{3040.03db7c9c.chunk.css.map → 3040.c06719a2.chunk.css.map} +1 -1
  27. package/build/static/css/3333.bf129b30.chunk.css +2 -0
  28. package/build/static/css/{3333.0b014710.chunk.css.map → 3333.bf129b30.chunk.css.map} +1 -1
  29. package/build/static/css/3801.b045dd9e.chunk.css +2 -0
  30. package/build/static/css/{3801.7117b4fc.chunk.css.map → 3801.b045dd9e.chunk.css.map} +1 -1
  31. package/build/static/css/{3843.7ad7aefd.chunk.css → 3843.e7f3e14d.chunk.css} +2 -2
  32. package/build/static/css/{3843.7ad7aefd.chunk.css.map → 3843.e7f3e14d.chunk.css.map} +1 -1
  33. package/build/static/css/4666.1ac1eb1f.chunk.css +2 -0
  34. package/build/static/css/{4666.75d33960.chunk.css.map → 4666.1ac1eb1f.chunk.css.map} +1 -1
  35. package/build/static/css/5600.59d51d91.chunk.css +2 -0
  36. package/build/static/css/{5600.a6f953a8.chunk.css.map → 5600.59d51d91.chunk.css.map} +1 -1
  37. package/build/static/css/5846.2962ad20.chunk.css +2 -0
  38. package/build/static/css/{5846.88210d70.chunk.css.map → 5846.2962ad20.chunk.css.map} +1 -1
  39. package/build/static/css/5868.0481b519.chunk.css +2 -0
  40. package/build/static/css/{5868.6e1c8951.chunk.css.map → 5868.0481b519.chunk.css.map} +1 -1
  41. package/build/static/css/{5996.ef12a721.chunk.css → 5996.d271ec06.chunk.css} +2 -2
  42. package/build/static/css/{5996.ef12a721.chunk.css.map → 5996.d271ec06.chunk.css.map} +1 -1
  43. package/build/static/css/6779.6b8915f2.chunk.css +2 -0
  44. package/build/static/css/{6779.4ec546c9.chunk.css.map → 6779.6b8915f2.chunk.css.map} +1 -1
  45. package/build/static/css/7227.d79f4fd5.chunk.css +2 -0
  46. package/build/static/css/{7227.40beb6bd.chunk.css.map → 7227.d79f4fd5.chunk.css.map} +1 -1
  47. package/build/static/css/8148.21686a40.chunk.css +2 -0
  48. package/build/static/css/{8148.c96d014d.chunk.css.map → 8148.21686a40.chunk.css.map} +1 -1
  49. package/build/static/css/8393.b7402cc8.chunk.css +2 -0
  50. package/build/static/css/{8393.bb66f96b.chunk.css.map → 8393.b7402cc8.chunk.css.map} +1 -1
  51. package/build/static/css/{8725.92be1696.chunk.css → 8725.a3989f3f.chunk.css} +2 -2
  52. package/build/static/css/{8725.92be1696.chunk.css.map → 8725.a3989f3f.chunk.css.map} +1 -1
  53. package/build/static/css/9053.851234ed.chunk.css +2 -0
  54. package/build/static/css/{9053.46c298ac.chunk.css.map → 9053.851234ed.chunk.css.map} +1 -1
  55. package/build/static/css/931.88997084.chunk.css +2 -0
  56. package/build/static/css/{931.db19ba4c.chunk.css.map → 931.88997084.chunk.css.map} +1 -1
  57. package/build/static/css/{9449.bb650cdd.chunk.css → 9449.7e13fdf2.chunk.css} +2 -2
  58. package/build/static/css/{9449.bb650cdd.chunk.css.map → 9449.7e13fdf2.chunk.css.map} +1 -1
  59. package/build/static/css/9689.f753c909.chunk.css +2 -0
  60. package/build/static/css/{9689.a378c0d6.chunk.css.map → 9689.f753c909.chunk.css.map} +1 -1
  61. package/build/static/js/{1153.1e765379.chunk.js → 1153.6fbe6326.chunk.js} +3 -3
  62. package/build/static/js/{1153.1e765379.chunk.js.map → 1153.6fbe6326.chunk.js.map} +1 -1
  63. package/build/static/js/1454.c5c431e5.chunk.js +3 -0
  64. package/build/static/js/{1454.7e01c768.chunk.js.map → 1454.c5c431e5.chunk.js.map} +1 -1
  65. package/build/static/js/1554.9c96ba44.chunk.js +3 -0
  66. package/build/static/js/{1554.75b20234.chunk.js.map → 1554.9c96ba44.chunk.js.map} +1 -1
  67. package/build/static/js/{2503.311139a9.chunk.js → 2503.1575e401.chunk.js} +2 -2
  68. package/build/static/js/{2503.311139a9.chunk.js.map → 2503.1575e401.chunk.js.map} +1 -1
  69. package/build/static/js/2517.b184c58b.chunk.js +2 -0
  70. package/build/static/js/{2517.ebfe379d.chunk.js.map → 2517.b184c58b.chunk.js.map} +1 -1
  71. package/build/static/js/2716.2b02e4c1.chunk.js +3 -0
  72. package/build/static/js/{2716.0835366f.chunk.js.map → 2716.2b02e4c1.chunk.js.map} +1 -1
  73. package/build/static/js/2730.7a565d2d.chunk.js +2 -0
  74. package/build/static/js/{2730.6e6bbd50.chunk.js.map → 2730.7a565d2d.chunk.js.map} +1 -1
  75. package/build/static/js/{289.11cbf5b0.chunk.js → 289.fe13ce71.chunk.js} +2 -2
  76. package/build/static/js/{289.11cbf5b0.chunk.js.map → 289.fe13ce71.chunk.js.map} +1 -1
  77. package/build/static/js/2999.1264c621.chunk.js +2 -0
  78. package/build/static/js/2999.1264c621.chunk.js.map +1 -0
  79. package/build/static/js/{3040.6505e983.chunk.js → 3040.872c2329.chunk.js} +2 -2
  80. package/build/static/js/3040.872c2329.chunk.js.map +1 -0
  81. package/build/static/js/{3333.1816dece.chunk.js → 3333.6cbfa6ba.chunk.js} +2 -2
  82. package/build/static/js/{3333.1816dece.chunk.js.map → 3333.6cbfa6ba.chunk.js.map} +1 -1
  83. package/build/static/js/36.f521ef8e.chunk.js +2 -0
  84. package/build/static/js/{36.32568b2b.chunk.js.map → 36.f521ef8e.chunk.js.map} +1 -1
  85. package/build/static/js/3801.6a0e84c2.chunk.js +2 -0
  86. package/build/static/js/3801.6a0e84c2.chunk.js.map +1 -0
  87. package/build/static/js/{3843.9ad0280b.chunk.js → 3843.fbee58b7.chunk.js} +2 -2
  88. package/build/static/js/{3843.9ad0280b.chunk.js.map → 3843.fbee58b7.chunk.js.map} +1 -1
  89. package/build/static/js/{4666.e958816e.chunk.js → 4666.e156a9b1.chunk.js} +3 -3
  90. package/build/static/js/{4666.e958816e.chunk.js.map → 4666.e156a9b1.chunk.js.map} +1 -1
  91. package/build/static/js/{5009.c54b6ce3.chunk.js → 5009.9ac7622a.chunk.js} +2 -2
  92. package/build/static/js/{5009.c54b6ce3.chunk.js.map → 5009.9ac7622a.chunk.js.map} +1 -1
  93. package/build/static/js/5600.e92a0d9a.chunk.js +2 -0
  94. package/build/static/js/{5600.db7a237d.chunk.js.map → 5600.e92a0d9a.chunk.js.map} +1 -1
  95. package/build/static/js/5846.a5f4d40e.chunk.js +2 -0
  96. package/build/static/js/5846.a5f4d40e.chunk.js.map +1 -0
  97. package/build/static/js/5868.dbc78b1c.chunk.js +2 -0
  98. package/build/static/js/{5868.691cc3d1.chunk.js.map → 5868.dbc78b1c.chunk.js.map} +1 -1
  99. package/build/static/js/{5996.87668f05.chunk.js → 5996.0da2f9cb.chunk.js} +2 -2
  100. package/build/static/js/{5996.87668f05.chunk.js.map → 5996.0da2f9cb.chunk.js.map} +1 -1
  101. package/build/static/js/{6213.c2ce3098.chunk.js → 6213.402182f5.chunk.js} +2 -2
  102. package/build/static/js/6213.402182f5.chunk.js.map +1 -0
  103. package/build/static/js/6779.91e3f628.chunk.js +2 -0
  104. package/build/static/js/{6779.5687f2a6.chunk.js.map → 6779.91e3f628.chunk.js.map} +1 -1
  105. package/build/static/js/{6900.556d8258.chunk.js → 6900.9cc96100.chunk.js} +2 -2
  106. package/build/static/js/6900.9cc96100.chunk.js.map +1 -0
  107. package/build/static/js/{7227.dc98e5a5.chunk.js → 7227.c96a9448.chunk.js} +3 -3
  108. package/build/static/js/{7227.dc98e5a5.chunk.js.map → 7227.c96a9448.chunk.js.map} +1 -1
  109. package/build/static/js/{7777.f92782a0.chunk.js → 7777.14c16d25.chunk.js} +2 -2
  110. package/build/static/js/{7777.f92782a0.chunk.js.map → 7777.14c16d25.chunk.js.map} +1 -1
  111. package/build/static/js/{8148.098850f5.chunk.js → 8148.53ee3ac2.chunk.js} +3 -3
  112. package/build/static/js/{8148.098850f5.chunk.js.map → 8148.53ee3ac2.chunk.js.map} +1 -1
  113. package/build/static/js/8393.2127ea9d.chunk.js +2 -0
  114. package/build/static/js/8393.2127ea9d.chunk.js.map +1 -0
  115. package/build/static/js/{8725.b1e0c118.chunk.js → 8725.26238a87.chunk.js} +2 -2
  116. package/build/static/js/{8725.b1e0c118.chunk.js.map → 8725.26238a87.chunk.js.map} +1 -1
  117. package/build/static/js/{9053.dea29532.chunk.js → 9053.39345c9a.chunk.js} +3 -3
  118. package/build/static/js/{9053.dea29532.chunk.js.map → 9053.39345c9a.chunk.js.map} +1 -1
  119. package/build/static/js/{931.d4b46c3f.chunk.js → 931.a3677464.chunk.js} +2 -2
  120. package/build/static/js/{931.d4b46c3f.chunk.js.map → 931.a3677464.chunk.js.map} +1 -1
  121. package/build/static/js/9449.289daefa.chunk.js +2 -0
  122. package/build/static/js/{9449.b13e3199.chunk.js.map → 9449.289daefa.chunk.js.map} +1 -1
  123. package/build/static/js/{main.76eaa0f9.js → main.de9e2598.js} +2 -2
  124. package/build/static/js/{main.76eaa0f9.js.map → main.de9e2598.js.map} +1 -1
  125. package/package.json +1 -1
  126. package/build/static/css/1151.09c186c4.chunk.css +0 -2
  127. package/build/static/css/1153.f71bbb4d.chunk.css +0 -2
  128. package/build/static/css/1454.ac7e29c1.chunk.css +0 -2
  129. package/build/static/css/1554.6767cb42.chunk.css +0 -2
  130. package/build/static/css/2716.426319cd.chunk.css +0 -2
  131. package/build/static/css/2999.bb10a4ea.chunk.css +0 -2
  132. package/build/static/css/3040.03db7c9c.chunk.css +0 -2
  133. package/build/static/css/3333.0b014710.chunk.css +0 -2
  134. package/build/static/css/3801.7117b4fc.chunk.css +0 -2
  135. package/build/static/css/4666.75d33960.chunk.css +0 -2
  136. package/build/static/css/5600.a6f953a8.chunk.css +0 -2
  137. package/build/static/css/5846.88210d70.chunk.css +0 -2
  138. package/build/static/css/5868.6e1c8951.chunk.css +0 -2
  139. package/build/static/css/6779.4ec546c9.chunk.css +0 -2
  140. package/build/static/css/7227.40beb6bd.chunk.css +0 -2
  141. package/build/static/css/8148.c96d014d.chunk.css +0 -2
  142. package/build/static/css/8393.bb66f96b.chunk.css +0 -2
  143. package/build/static/css/9053.46c298ac.chunk.css +0 -2
  144. package/build/static/css/931.db19ba4c.chunk.css +0 -2
  145. package/build/static/css/9689.a378c0d6.chunk.css +0 -2
  146. package/build/static/js/1454.7e01c768.chunk.js +0 -3
  147. package/build/static/js/1554.75b20234.chunk.js +0 -3
  148. package/build/static/js/2517.ebfe379d.chunk.js +0 -2
  149. package/build/static/js/2716.0835366f.chunk.js +0 -3
  150. package/build/static/js/2730.6e6bbd50.chunk.js +0 -2
  151. package/build/static/js/2999.e7f01852.chunk.js +0 -2
  152. package/build/static/js/2999.e7f01852.chunk.js.map +0 -1
  153. package/build/static/js/3040.6505e983.chunk.js.map +0 -1
  154. package/build/static/js/36.32568b2b.chunk.js +0 -2
  155. package/build/static/js/3801.e1fbf1f5.chunk.js +0 -2
  156. package/build/static/js/3801.e1fbf1f5.chunk.js.map +0 -1
  157. package/build/static/js/5600.db7a237d.chunk.js +0 -2
  158. package/build/static/js/5846.4c3e8ca1.chunk.js +0 -2
  159. package/build/static/js/5846.4c3e8ca1.chunk.js.map +0 -1
  160. package/build/static/js/5868.691cc3d1.chunk.js +0 -2
  161. package/build/static/js/6213.c2ce3098.chunk.js.map +0 -1
  162. package/build/static/js/6779.5687f2a6.chunk.js +0 -2
  163. package/build/static/js/6900.556d8258.chunk.js.map +0 -1
  164. package/build/static/js/8393.66cde464.chunk.js +0 -2
  165. package/build/static/js/8393.66cde464.chunk.js.map +0 -1
  166. package/build/static/js/9449.b13e3199.chunk.js +0 -2
  167. /package/build/static/js/{1153.1e765379.chunk.js.LICENSE.txt → 1153.6fbe6326.chunk.js.LICENSE.txt} +0 -0
  168. /package/build/static/js/{1454.7e01c768.chunk.js.LICENSE.txt → 1454.c5c431e5.chunk.js.LICENSE.txt} +0 -0
  169. /package/build/static/js/{1554.75b20234.chunk.js.LICENSE.txt → 1554.9c96ba44.chunk.js.LICENSE.txt} +0 -0
  170. /package/build/static/js/{2716.0835366f.chunk.js.LICENSE.txt → 2716.2b02e4c1.chunk.js.LICENSE.txt} +0 -0
  171. /package/build/static/js/{4666.e958816e.chunk.js.LICENSE.txt → 4666.e156a9b1.chunk.js.LICENSE.txt} +0 -0
  172. /package/build/static/js/{7227.dc98e5a5.chunk.js.LICENSE.txt → 7227.c96a9448.chunk.js.LICENSE.txt} +0 -0
  173. /package/build/static/js/{8148.098850f5.chunk.js.LICENSE.txt → 8148.53ee3ac2.chunk.js.LICENSE.txt} +0 -0
  174. /package/build/static/js/{9053.dea29532.chunk.js.LICENSE.txt → 9053.39345c9a.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:()=>k,UnknownPreview:()=>b,default:()=>I});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__FI1dY",d="style_loading__r3aiE__FI1dY",m="style_text-outer__TzhuG__FI1dY",u="style_error__wSaxt__FI1dY";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),F=s(89946),W=s.n(F);const k=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)((()=>{W().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})})]})},b=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:k,pdf:S,image:L,html:f,office:g,unknown:b}[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})})),I=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.1816dece.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:()=>T,OfficePreview:()=>g,PdfPreview:()=>S,TextPreview:()=>b,UnknownPreview:()=>F,default:()=>C});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__fzO9l",d="style_loading__r3aiE__fzO9l",m="style_text-outer__TzhuG__fzO9l",u="style_error__wSaxt__fzO9l";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=D(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"})]})},O=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"},z=O,D=e=>({txt:b,pdf:S,image:L,html:f,office:g,unknown:F}[O(e)]);const T=(0,s(97211).A)((e=>{let{data:t,id:s,className:r,...a}=e;const n=D(t);return"office"===z(t)?(0,p.jsx)(g,{...a,id:s,className:r}):(0,p.jsx)(n,{...a,className:r,url:t})})),C=e=>{let{id:t,originName:s,...r}=e;return"office"===z(s)?(0,p.jsx)(g,{...r,id:t,originName:s}):(0,p.jsx)(T,{...r,id:t,originName:s})}},71975:()=>{}}]);
2
+ //# sourceMappingURL=3333.6cbfa6ba.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/3333.1816dece.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,MAq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JC,EAAcjF,IAClB,MACMkF,GADQlF,GAAO,IAAImF,MAAM,KAAK,GACjBC,cACnB,MAAI,QAAQC,KAAKH,GACR,MAEL,QAAQG,KAAKH,GACR,MAEL,mBAAmBG,KAAKH,GACnB,QAEL,eAAeG,KAAKH,GACf,OAEL,iCAAiCG,KAAKH,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__FI1dY\",\"container-html\":\"style_container-html__IsNVq__FI1dY\",\"html-inner\":\"style_html-inner__S05cI__FI1dY\",\"loading\":\"style_loading__r3aiE__FI1dY\",\"control-bar\":\"style_control-bar__kTKau__FI1dY\",\"scroller\":\"style_scroller__HOq7b__FI1dY\",\"outer\":\"style_outer__ntu--__FI1dY\",\"file-name\":\"style_file-name__UPbbe__FI1dY\",\"file-options\":\"style_file-options__5TE5l__FI1dY\",\"scale-input\":\"style_scale-input__JdF1K__FI1dY\",\"text-outer\":\"style_text-outer__TzhuG__FI1dY\",\"error\":\"style_error__wSaxt__FI1dY\",\"text-inner\":\"style_text-inner__jdi-A__FI1dY\",\"image-inner\":\"style_image-inner__zTiFU__FI1dY\"};","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.6cbfa6ba.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,Y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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__fzO9l\",\"container-html\":\"style_container-html__IsNVq__fzO9l\",\"html-inner\":\"style_html-inner__S05cI__fzO9l\",\"loading\":\"style_loading__r3aiE__fzO9l\",\"control-bar\":\"style_control-bar__kTKau__fzO9l\",\"scroller\":\"style_scroller__HOq7b__fzO9l\",\"outer\":\"style_outer__ntu--__fzO9l\",\"file-name\":\"style_file-name__UPbbe__fzO9l\",\"file-options\":\"style_file-options__5TE5l__fzO9l\",\"scale-input\":\"style_scale-input__JdF1K__fzO9l\",\"text-outer\":\"style_text-outer__TzhuG__fzO9l\",\"error\":\"style_error__wSaxt__fzO9l\",\"text-inner\":\"style_text-inner__jdi-A__fzO9l\",\"image-inner\":\"style_image-inner__zTiFU__fzO9l\"};","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,l)=>{l.d(t,{A:()=>n});l(73884);const n=l.p+"static/media/defaultAvatar.b1f2a8046cc7bee36d9a404ce6a0a1d7.svg"},93761:(e,t,l)=>{l.d(t,{qn:()=>T,TM:()=>G,LH:()=>I,Ay:()=>D,NY:()=>L,DF:()=>R});var n=l(30509),a=l(25438),s=l(55199),r=l(27047),o=l(83136),i=l.n(o),c=l(64671),d=l(73884),u=l(21485),p=l(56434),m=l.n(p),h=l(15797),f=l.n(h),_=l(33097),g=l.n(_);const x="style_address__DIuRX__fzO9l",y="style_is-popup__tqVvp__fzO9l",v="style_title__FAe12__fzO9l",C="style_scroll-box__JWiDl__fzO9l",j="style_scroll-plus-box__lidEW__fzO9l",b="style_content__lAARZ__fzO9l",A="style_col-left__WPfeS__fzO9l",N="style_col-right__z0e9-__fzO9l";var O=l(87558);const S=e=>({"en-US":()=>l.e(3691).then(l.bind(l,83691)),"zh-CN":()=>l.e(2253).then(l.bind(l,32253))}[e]());var w=l(58609),z=l(70579);const P=n.A.useContext,I=e=>{let{city:t,province:l,country:n}=e;const a=f()((()=>{const e=[];return["gangaotai","municipality"].forEach((l=>{e.push(...t.relations[l])})),["provinces","continents"].forEach((l=>{t.relations[l].forEach((l=>{e.push(l),e.push(...t.relations[l])}))})),e.map((e=>t.list[e]))}));return{getCity:f()((e=>{const l=t.list[e];return l?{city:l,parent:l.parentCode?t.list[l.parentCode]:null}:{city:null,parent:null}})),getChinaHotCities:f()((()=>t.relations[2].map((e=>t.list[e])))),getChinaCities:f()((()=>["2",...l.relations.municipality,...l.relations.provinces,"gangaotai"].map((e=>Object.assign({id:e},t.list[e]))))),getCountries:f()((()=>["1",...n.relations.continents].map((e=>Object.assign({id:e},n.list[e]))))),getList:f()(((e,a)=>{const{showChinaQuan:s,showForeignQuan:r}=Object.assign({},a);if("gangaotai"===e)return l.relations.gangaotai.map((e=>t.list[e]));const o=Object.assign({},t.list[e]);if(l.relations.municipality.indexOf(e)>-1)return o.name="".concat(s?"\u5168":"")+o.name,[o];const i=t.relations[e].map((e=>t.list[e]));return l.relations.provinces.indexOf(e)>-1&&s&&(o.name="\u5168"+o.name,i.splice(0,0,o)),n.relations.continents.indexOf(e)>-1&&r&&(o.name="\u5168"+o.name,i.splice(0,0,o)),i})),getNationalityList:f()((e=>{let l=m()(t);return"1"===e&&l.relations[1].unshift("410"),"350"===e&&l.relations[350].unshift("410"),l.relations[e].filter((e=>l.list[e])).map((e=>l.list[e]))})),getCityByName:f()((e=>{const t=a();let l;return[t=>t.name===e,t=>t.name===e.replace(/(\u7701|\u5e02)$/,""),t=>0===e.indexOf(t.name)].find((e=>(l=t.find(e),l))),l})),combineCities:f()(((e,l)=>[...l.filter((l=>t.list[l].parentCode!==e&&t.list[e].parentCode!==l&&e!==l)),e])),searchCities:f()((e=>{if(!e)return[];return a().filter((t=>["pinyin","name","enName","spelling"].some((l=>t[l].toUpperCase().indexOf(e.toUpperCase())>-1)))).map((e=>{const l=e.parentCode?t.list[e.parentCode]:null;return{label:l?"".concat(l.name,"\xb7").concat(e.name):e.name,value:e.code}}))}))}},L=(e,t)=>"en-US"===t?g()(e,"enName"):g()(e,"name"),k={cache:"CITY_DATA",isLocal:!0,ttl:864e5,loader:()=>l.e(7820).then(l.t.bind(l,37820,19)).then((e=>e.__esModule?e.default:e))},M=e=>{let{value:t,setValue:l}=e;const{fetchApi:n,props:o}=P(),[p,m]=(0,d.useState)(""),[h,f]=(0,d.useState)("2"),{formatMessage:_}=(0,w.useIntl)({moduleName:"AddressSelect"}),{locale:g}=(0,r.A)(),{getCity:O,getChinaCities:S,getCountries:k,getList:M,searchCities:F}=(0,d.useMemo)((()=>I(n.data)),[n.data]),T=e=>{if(o.single)return void l([e]);const n=t.slice(0),a=n.indexOf(e);a>-1?n.splice(a,1):n.push(e),l(n)},R=p&&(0,z.jsx)(u.A,{className:j,children:(0,z.jsx)(s.List,{className:a.A.list,size:"small",dataSource:F(p),rowKey:"value",renderItem:e=>(0,z.jsx)(s.List.Item,{className:a.A["list-item"],onClick:()=>{T(e.value),m("")},children:(0,z.jsx)("span",{className:a.A["item-label"],children:e.label})})})});return(0,z.jsxs)("div",{className:i()(x,{[y]:o.isPopup}),children:[(0,z.jsx)(s.Input.Search,{className:i()(a.A["search-input"],{[a.A["is-popup"]]:o.isPopup}),placeholder:o.searchPlaceholder||_({id:"searchCity"}),prefix:(0,z.jsx)(c.default,{type:"icon-sousuo"}),enterButton:(0,z.jsx)(c.default,{type:"icon-sousuo"}),value:p,allowClear:!0,onChange:e=>{const t=e.target.value;m(t)},onSearch:e=>{m(e)}}),(0,z.jsx)("div",{className:b,children:R||(0,z.jsxs)(s.Row,{wrap:!1,children:[(0,z.jsx)(s.Col,{className:A,children:(0,z.jsx)(s.Tabs,{centered:!0,onChange:e=>{f(e)},items:[{key:"2",label:(0,z.jsx)(w.FormattedMessage,{id:"domestic",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5185"}),children:(0,z.jsx)(u.A,{className:C,children:(0,z.jsx)(s.Menu,{selectedKeys:[h],onSelect:e=>{f(e.key)},items:S().map((e=>({label:L(e,g),key:e.id})))})})},{key:"1",label:(0,z.jsx)(w.FormattedMessage,{id:"abroad",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5916"}),children:(0,z.jsx)(u.A,{className:C,children:(0,z.jsx)(s.Menu,{selectedKeys:[h],onSelect:e=>{f(e.key)},items:k().map((e=>({label:L(e,g),key:e.id})))})})}]})}),(0,z.jsxs)(s.Col,{flex:1,className:N,children:[(0,z.jsx)(s.Divider,{className:v,orientation:"left",children:L(O(h).city,g)}),(0,z.jsx)(u.A,{className:C,children:(0,z.jsx)(s.Space,{wrap:!0,children:M(h,{showChinaQuan:o.showChinaQuan,showForeignQuan:o.showForeignQuan}).map((e=>(0,z.jsx)(s.Tag.CheckableTag,{checked:t.indexOf(e.code)>-1,onChange:()=>{T(e.code)},children:L(e,g)},e.code)))})})]})]})})]})},F=e=>(0,z.jsx)(n.A,{...e,children:e=>{let{value:t,setValue:l}=e;return(0,z.jsx)(w.IntlProvider,{moduleName:"AddressSelect",importMessages:S,children:(0,z.jsx)(M,{value:t,setValue:l})})}});F.defaultProps={overlayWidth:"500px",isPopup:!0,api:k,dataFormat:(e,t)=>{let{city:l}=e;const{locale:n}=Object.assign({},t);return{list:Object.values(l.list).map((e=>Object.assign({},e,{value:e.code,label:L(e,n)})))}}};const T=(0,O.withFetch)((e=>{let{name:t,data:l,getAddressApi:n,children:a,...s}=e;const{locale:o}=(0,r.A)(),i=(0,d.useMemo)((()=>I(l)),[l]);return n?a(i):a(i.getCity(t),Object.assign({},s,{locale:o}))}));T.defaultProps={...k,displayParent:!1,children:(e,t)=>{let{city:l,parent:n}=e,{displayParent:a,locale:s}=t;return a&&n?"".concat(L(n,s),"\xb7").concat(L(l,s)):L(l,s)}};const R=e=>{const t=(0,O.withFetch)((t=>{let{data:l,...n}=t;const a=(0,d.useMemo)((()=>I(l)),[l]);return(0,z.jsx)(e,{...n,addressApi:a})}));return t.defaultProps={...k},t};F.AddressEnum=F.Enum=T,F.createAddressApi=I,F.withAddressApi=R,F.getLabelForLocal=L;const D=F;var E=l(10986),V=l.n(E),W=l(78491),B=l.n(W),U=l(20492),K=l(22616),q=l.n(K),H=l(1488),Q=l.n(H);const Z=e=>{const{isPopup:t,size:l,disabled:n,inputPlaceholder:a,onBlur:r,className:o,...i}=e,[c,d]=V()(e),u=["isPopup","searchPlaceholder","placeholder","overlayWidth","api","dataFormat"],{formatMessage:p}=(0,w.useIntl)({moduleName:"Common"}),m=B()((e=>{r&&r(e)}));return(0,z.jsx)("div",{ref:m,children:(0,z.jsxs)(s.Row,{gutter:10,children:[(0,z.jsx)(s.Col,{span:12,children:(0,z.jsx)(D,{...q()(i,u),className:o,disabled:n,single:!0,size:l,value:g()(c,"city"),onChange:e=>{d({city:e,detail:g()(c,"detail")})}})}),(0,z.jsx)(s.Col,{span:12,children:(0,z.jsx)(s.Input,{...Q()(i,u),className:o,placeholder:a||p({id:"pleaseInput"}),disabled:n,size:l,value:g()(c,"detail"),onChange:e=>{d({city:g()(c,"city"),detail:e.target.value})}})})]})})};Z.defaultProps={};const G=(0,w.createWithIntl)({importMessages:U.A,moduleName:"Common"})(Z)},12392:(e,t,l)=>{l.d(t,{Bm:()=>W,Eo:()=>E,NR:()=>A,Ay:()=>B});var n=l(55199),a=l(83136),s=l.n(a),r=l(30509),o=l(25438),i=l(26475),c=l(33097),d=l.n(c),u=l(34677),p=l.n(u);const m="create-list_scroll-loader__zoaS7__fzO9l",h="create-list_is-popup__t3d-G__fzO9l",f="create-list_is-not-full__FXtX1__fzO9l",_="create-list_search-input__tV3vf__fzO9l",g="create-list_left__EXr3i__fzO9l",x="create-list_list-header__3xeJa__fzO9l",y="create-list_is-modal__BMfya__fzO9l";var v=l(73161),C=l(58609),j=l(70579);const b=r.A.useContext,A=e=>{let{renderList:t,defaultProps:l}=e;const a=e=>{let{value:l,setValue:a}=e;const{fetchApi:r,searchText:c,setSearchText:u,props:A,mapping:N}=b(),O=Object.assign({},{paramsType:"data",current:"currentPage",pageSizeName:"perPage",pageSize:20},A.pagination),S=d()(r.requestParams,[O.paramsType,O.current],1),w=d()(r.requestParams,[O.paramsType,O.pageSizeName])||O.pageSize,{formatMessage:z}=(0,C.useIntl)({moduleName:"Common"}),P=A.dataFormat(r.data),{right:I,leftBottom:L,leftSpan:k=24}=A,M=1===l.length&&"all"===l[0];return(0,j.jsxs)(n.Row,{wrap:!1,className:I?f:"",children:[(0,j.jsxs)(n.Col,{span:k,className:s()(g,"advance-select-left"),children:[A.getSearchProps?(0,j.jsx)(v.A,{isPopup:A.isPopup,className:s()(_,o.A["search-input"],{[o.A["is-popup"]]:A.isPopup}),placeholder:A.searchPlaceholder||z({id:"search"}),value:c,onSearch:e=>{r.reload(A.getSearchProps(e)),u(e)}}):null,A.single||!A.showSelectedCount&&!A.allowSelectAll?null:(0,j.jsxs)(n.Flex,{className:s()(x,{[y]:!A.isPopup}),justify:"space-between",children:[A.showSelectedCount?(0,j.jsxs)(n.Space,{children:[(0,j.jsx)(n.Typography,{children:"\u5df2\u9009:"}),(0,j.jsx)(n.Typography.Link,{children:M?A.allLabel||(0,j.jsx)(C.FormattedMessage,{id:"all",moduleName:"Common"}):"".concat(l.length).concat(A.countUnit||z({id:"items"}))})]}):(0,j.jsx)("div",{}),A.allowSelectAll?(0,j.jsx)("div",{children:(0,j.jsx)(n.Checkbox,{checked:M,onChange:e=>{a(e.target.checked?[A.allValue||"all"]:[])},children:(0,j.jsx)(C.FormattedMessage,{id:"selectAll",moduleName:"Common",values:{label:A.allLabel||(0,j.jsx)(C.FormattedMessage,{id:"all",moduleName:"Common"})}})})}):(0,j.jsx)("div",{})]}),(0,j.jsx)(i.A,{completeTips:"",isLoading:!r.isComplete,className:s()(m,{[h]:A.isPopup}),noMore:!P.total||S*w>=P.total,onLoader:async()=>{console.log("on loader"),await r.loadMore(p()({[O.paramsType]:{[O.pageSizeName]:w,[O.current]:S+1}},A.getSearchProps&&A.getSearchProps(c)),A.mergeList)},children:t({props:A,value:l,setValue:a,list:P.list,itemIsSelected:e=>l.indexOf(e.value)>-1,isSelectedAll:M,onSelect:e=>{if(A.single)return void a([e.value]);const t=l.slice(0),n=t.indexOf(e.value);n>-1?t.splice(n,1):t.push(e.value),a(t)}})}),L&&L({fetchApi:r,value:l,mapping:N})]}),I&&I({value:l,mapping:N,fetchApi:r})]})},c=e=>{let{extra:t,...l}=e;return(0,j.jsx)(r.A,{...l,extra:t,children:e=>{let{value:t,setValue:l}=e;return(0,j.jsx)(a,{value:t,setValue:l})}})};return c.defaultProps=Object.assign({},{isPopup:!0,pagination:{},mergeList:(e,t)=>Object.assign({},t,{pageData:e.pageData.concat(t.pageData)}),dataFormat:e=>({list:e.pageData,total:e.totalCount})},l),c},N="list_list__TGynD__fzO9l",O="list_list-item__WSswf__fzO9l",S="list_is-selected__6Wkgt__fzO9l",w="list_item-label__bYzhe__fzO9l",z="list_item-des__2nsEn__fzO9l",P="list_is-disabled__qxCvO__fzO9l",I="list_is-selected-all__Mp-hG__fzO9l";var L=l(40438),k=l(64671);const M="user_list-inner__V508e__fzO9l",F="user_list-info__y2nWo__fzO9l",T="user_selected-icon__9OQJL__fzO9l",R="user_item-des__o+7UR__fzO9l",D="user_is-selected-all__2q0VZ__fzO9l",E=A({renderList:e=>{let{list:t,onSelect:l,itemIsSelected:a,isSelectedAll:r}=e;return(0,j.jsx)(n.List,{size:"small",className:s()(N,{[I]:r,[D]:r}),dataSource:t,renderItem:e=>{const t=a(e);return(0,j.jsx)(n.List.Item,{className:s()(O,{[S]:t}),onClick:()=>l(e),children:(0,j.jsxs)(n.Row,{wrap:!1,align:"middle",className:M,children:[(0,j.jsx)(n.Col,{children:(0,j.jsx)(L.default.Avatar,{...Object.assign({},e.avatar),size:40,gender:"M"})}),(0,j.jsx)(n.Col,{className:F,flex:1,children:(0,j.jsxs)(n.Space,{direction:"vertical",children:[(0,j.jsx)("span",{className:w,children:e.label}),e.description&&(0,j.jsx)("span",{className:R,children:e.description})]})}),(0,j.jsx)(n.Col,{children:r||t?(0,j.jsx)(k.default,{className:T,type:"icon-gouxuan"}):null})]})})}})}}),V={"is-selected-all":"table_is-selected-all__IwXUY__fzO9l"},W=A({defaultProps:{overlayWidth:"450px"},renderList:e=>{let{props:t,list:l,onSelect:a,value:r,setValue:o,itemIsSelected:i,isSelectedAll:c}=e;return(0,j.jsx)(n.Table,{className:s()(V.list,N,{[I]:c,[V["is-selected-all"]]:c}),size:"small",dataSource:l,columns:t.columns,rowClassName:e=>s()({"ant-table-row-selected":i(e)}),rowKey:t.rowKey||"value",pagination:!1,rowSelection:t.single?null:c?{selectedRowKeys:l.map((e=>{let{value:t}=e;return t})),getCheckboxProps:()=>({disabled:!0})}:{selectedRowKeys:r,onChange:e=>{o(e)}},sticky:!0,onRow:e=>({onClick:()=>a(e)})})}}),B=A({renderList:e=>{let{props:t,list:l,itemIsSelected:a,isSelectedAll:r,onSelect:o}=e;const{listClassName:i="",selectIcon:c=null}=t||{};return(0,j.jsx)(n.List,{className:s()(N,i,{[I]:r}),size:"small",dataSource:l,renderItem:e=>{var l;const i=a(e);return(0,j.jsxs)(n.List.Item,{className:s()(O,{[S]:t.single&&i,[P]:r||e.disabled}),onClick:()=>{e.disabled||o(e)},children:[(0,j.jsxs)(n.Row,{wrap:!1,children:[t.single?null:(0,j.jsx)(n.Col,{children:(0,j.jsx)(n.Checkbox,{checked:r||i,disabled:r||e.disabled})}),(0,j.jsx)(n.Col,{children:(0,j.jsxs)(n.Space,{className:null!==(l=null===e||void 0===e?void 0:e.className)&&void 0!==l?l:"",children:[(0,j.jsx)("span",{className:w,children:e.label}),e.description&&(0,j.jsx)("span",{className:z,children:e.description})]})})]}),i&&c]})}})}})},45776:(e,t,l)=>{l.d(t,{yK:()=>I,ON:()=>h,Ay:()=>T});var n=l(30509),a=l(73884),s=l(96418),r=l.n(s),o=l(55199),i=l(64671),c=l(73161),d=l(33097),u=l.n(d),p=l(79686),m=l.n(p);const h=e=>{const t=Array.from(e.values()),l=t.filter((e=>null===e.parentId)),n=(e,t)=>{const l=e.indexOf(t);l>-1&&e.splice(l,1)},a=t=>{const l=[],n=t=>{const a=e.get(t);a&&Array.isArray(a.children)&&a.children.length>0&&(l.push(...a.children),a.children.forEach((e=>{n(e.id)})))};return n(t),l},s=(t,l)=>{const n=t=>{const a=e.get(t);return a?l(a)?a:m()(a.parentId)?null:n(a.parentId):null};return n(t)},r=t=>{const n=e.get(t);if(!n)return[];const a=n.parentId;if(m()(a))return l;return e.get(a).children},o=(()=>{const e=l=>Array.isArray(l)&&l.length>0?l.map((l=>{const n=t.filter((e=>e.parentId===l.id));return Object.assign({},l,{children:e(n)})})):null;return e(l)})();return{mapping:e,getSelectedQueue:t=>{const l=e.get(t);if(!l)return[];const n=e=>{if(e.children&&e.children.length>0)return n(e.children.find((t=>t.children&&e.children.length>0))||u()(e.children,"0"));const t=a(e.parentId).find((e=>e.children&&e.children.length>0));return t?n(t):e},s=function(t){const l=[t,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]],n=e.get(t);return!n||m()(n.parentId)?l:s(n.parentId,l)},r=n(l);return s(u()(r,"id"))},getAllChildren:a,computedCheckboxStatus:function(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(s(t,(e=>l.indexOf(e.id)>-1)))return{checked:!0,indeterminate:!1};const n=((t,n)=>{const a=t=>{const n=e.get(t);return n?(s=n,l.indexOf(s.id)>-1?n:Array.isArray(n.children)&&n.children.length>0?n.children.find((e=>!!a(e.id))):void 0):null;var s};return!!a(t)})(t);return n?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1}},getSiblingNode:r,findInParents:s,setNodeChecked:function(t){const l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),s=t=>{const o=e.get(t);if(!o)return;l.push(t),a(t).forEach((e=>{n(l,e.id)}));const i=r(t),c=i.every((e=>l.indexOf(e.id)>-1));o.parentId&&c&&(i.forEach((e=>{n(l,e.id)})),s(o.parentId))};return s(t),l},setNodeUnchecked:function(t){const l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),a=t=>{const s=e.get(t);if(!s)return;if(l.indexOf(s.id)>-1)return void n(l,s.id);const o=r(t);s.parentId&&(o.forEach((e=>{t!==e.id&&l.push(e.id)})),a(s.parentId))};return a(t),l},treeData:o,treeMapping:new Map(o.map((e=>[e.id,e])))}};var f=l(74065),_=l.n(f),g=l(19853),x=l.n(g),y=l(17342),v=l(83136),C=l.n(v);const j={content:"style_content__Hxlt9__fzO9l",columns:"style_columns__FmtPF__fzO9l","content-item":"style_content-item__i6HCO__fzO9l","last-level-area":"style_last-level-area__2y7jQ__fzO9l","is-popup":"style_is-popup__+r3Mn__fzO9l",menu:"style_menu__WZUVE__fzO9l","scroll-plus-box":"style_scroll-plus-box__QcTst__fzO9l","menu-label":"style_menu-label__iGt0Z__fzO9l","menu-item":"style_menu-item__hXHfm__fzO9l","checkbox-hidden":"style_checkbox-hidden__Xpx7J__fzO9l",loading:"style_loading__ZwrVe__fzO9l"};var b=l(87558),A=l(58609),N=l(25438),O=l(70579),S=l(27047);const w=new Map,z=(0,b.withFetch)((e=>{let{data:t,name:l,type:n,cache:s,children:r,getLabel:o,...i}=e;const c=(0,a.useMemo)((()=>new Map(t.map((e=>[e.code,{...e,id:e.code,label:o?o(e):e.chName,parentId:e.parentCode||null}])))),[t,o]).get(l);return w.set("".concat(l,"_").concat(n),c),r(c,i)})),P=e=>{const{locale:t}=(0,S.A)(),l="".concat(t,"_").concat(e.name,"_").concat(e.type),n=w.get(l);return n&&!e.force?e.children(n):(0,O.jsx)(z,{...e})};P.defaultProps={children:e=>u()(e,"label","")};const I=P,L=n.A.useContext,k=(0,b.withFetch)((e=>{let{data:t,computedIsChecked:l,onSelect:n}=e;return(0,O.jsx)(y.A,{className:j["scroll-plus-box"],children:(0,O.jsx)(o.List,{className:N.A.list,size:"small",dataSource:t,rowKey:"value",renderItem:e=>{const t=l(e);return(0,O.jsx)(o.List.Item,{className:C()(N.A["list-item"],{[N.A["is-selected"]]:t}),onClick:()=>n(e,t),children:(0,O.jsx)("span",{className:N.A["item-label"],children:e.label})})}})})})),M=e=>{let{value:t,setValue:l,size:n}=e;const{fetchApi:s,props:d}=L(),[p,m]=(0,a.useState)(""),f=r()(d.dataFormat),{formatMessage:g}=(0,A.useIntl)({moduleName:"Common"}),v=s.data,b=(0,a.useMemo)((()=>new Map(f(v).list.map((e=>[e.value,e])))),[v,f]),S=(0,a.useMemo)((()=>h(b)),[b]),w=(0,a.useRef)({});w.current={createMergeTree:d.createMergeTree,loadMore:s.loadMore,openLoadData:d.openLoadData,parentIdKey:d.parentIdKey,treeUtils:S};const[z,P]=(0,a.useState)((()=>{const e=t.find((e=>!!b.get(e)));return S.getSelectedQueue(e||u()(s.data.find((e=>e.children&&e.children.length>0)),"id")||u()(s.data,"[0].id"),b)}));(0,a.useEffect)((()=>{const{openLoadData:e,loadMore:t,parentIdKey:l,createMergeTree:n,treeUtils:a}=w.current;if(!e)return;const s=b.get(_()(z));if(!s)return;const r=a.getSelectedQueue(s.id);x()(z,r)?s.hasOwnProperty("children")||t({data:{[l]:s.id}},n(s.id)):P(r)}),[z,b]);const I=(e,a)=>{const s=(()=>{if(d.onlyAllowLastLevel&&e){const e=t.slice(0);return e.push(a),e}if(d.onlyAllowLastLevel){const e=t.slice(0);return e.splice(t.indexOf(a),1),e}return e?S.setNodeChecked(a,t):S.setNodeUnchecked(a,t)})();s.length>n?o.message.error(g({id:"maxSelectedCount"},{count:n})):l(d.single&&s.length>0?[_()(s)]:s)},M=e=>{const t=b.get(e);return!(!d.openLoadData||t.hasOwnProperty("children"))||t.children&&t.children.length>0},F=!d.openLoadData&&"function"===typeof d.onSearch,T=F&&p&&(0,O.jsx)(k,{data:{searchText:p},loader:e=>{let{data:t}=e;return d.onSearch(t.searchText,{mapping:b})},computedIsChecked:e=>t.indexOf(e.id)>-1,onSelect:(e,t)=>{I(!t,e.id),!t&&P(S.getSelectedQueue(e.id,b)),m("")}});return(0,O.jsxs)("div",{className:C()(j.content,{[j["is-popup"]]:d.isPopup,[j["has-search"]]:F}),style:{"--menu-item-width":d.menuItemWidth},children:[F&&(0,O.jsx)(c.A,{isPopup:d.isPopup,className:C()(N.A["search-input"],{[N.A["is-popup"]]:d.isPopup}),placeholder:d.searchPlaceholder||g({id:"search"}),value:p,onSearch:e=>{m(e)}}),T||(0,O.jsx)("div",{children:(0,O.jsx)(y.A,{className:j.scroller,options:{autoHide:!1},children:(0,O.jsxs)("div",{className:j.columns,children:[z.map(((e,l)=>{const n=b.get(e),s=S.getSiblingNode(e),r=!M(null===n||void 0===n?void 0:n.id)&&l>0;return(0,O.jsx)(y.A,{className:C()(j["content-item"],{[j["last-level-area"]]:r}),children:r?(0,O.jsx)(o.Space,{wrap:!0,children:s.map((e=>(0,a.createElement)(o.Checkbox,{...S.computedCheckboxStatus(e.id,t),key:e.id,onChange:t=>I(t.target.checked,e.id)},e.label)))}):(0,O.jsx)(o.Menu,{className:C()(j.menu),onSelect:e=>{const l=b.get(e.key);if(l)if(M(l.id))P(S.getSelectedQueue(l.id,b));else{const{checked:e}=S.computedCheckboxStatus(l.id,t);I(!e,l.id)}},selectedKeys:l===z.length-1?[]:z,items:s.map((e=>({key:e.id,label:(0,O.jsxs)(o.Space,{className:C()(j["menu-item"],{[j["checkbox-hidden"]]:d.onlyAllowLastLevel&&M(e.id)}),children:[!d.onlyAllowLastLevel&&(0,O.jsx)(o.Checkbox,{...S.computedCheckboxStatus(e.id,t),onChange:t=>I(t.target.checked,e.id)}),(0,O.jsx)("div",{className:j["menu-label"],children:e.label}),M(e.id)&&(0,O.jsx)(i.default,{className:j["menu-item-icon"],type:"icon-arrow-thin-right",size:12})]})})))})},u()(s,"[0].id",l))})),s.isComplete?null:(0,O.jsx)("div",{className:j.loading,children:(0,O.jsx)(o.Spin,{size:"small"})})]})})})]})},F=e=>{let{maxLength:t,nodeFormat:l,dataFormat:a,...s}=e;return(0,O.jsx)(n.A,{...s,dataFormat:e=>a(e,l),children:e=>{let{value:l,setValue:n}=e;return(0,O.jsx)(M,{size:t,value:l,setValue:n})}})};F.defaultProps={maxLength:Number.MAX_VALUE,size:"middle",isPopup:!0,overlayWidth:"460px",menuItemWidth:"180px",openLoadData:!1,onlyAllowLastLevel:!1,parentIdKey:"id",onSearch:(e,t)=>{let{mapping:l}=t;return Array.from(l.values()).filter((t=>t.label.indexOf(e)>-1))},dataFormat:(e,t)=>{const l=(e,n)=>{const a=[];return a.push(...(e||[]).map((e=>("function"===typeof t&&Object.assign(e,t(e)),e.children&&e.children.length>0&&a.push(...l(e.children,e.id)),Object.assign({},e,{value:e.id,parentId:n}))))),a};return{list:l(e,null)}},createMergeTree:e=>(t,l)=>{const n=t=>t.map((t=>t.id===e?Object.assign({},t,{children:l&&l.map((t=>Object.assign({},t,{parentId:e})))}):Array.isArray(t.children)&&t.children.length>0?Object.assign({},t,{children:n(t.children)}):t));return n(t)}};const T=F},41654:(e,t,l)=>{l.d(t,{A:()=>m,K:()=>p});var n=l(45776),a=l(27047),s=l(33097),r=l.n(s),o=l(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c=()=>l.e(719).then(l.t.bind(l,10719,19)).then((e=>e.__esModule?e.default:e)),d={cache:"FUNCTION_DATA",isLocal:!0,ttl:864e5,loader:c},u=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.Ay,{...l,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:l}=(0,n.ON)(new Map(t.map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return l}},c.functionData)})};u.defaultProps={overlayWidth:"640px",getSearchProps:e=>({data:{searchText:e}})},u.defaultData=c;const p=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.yK,{...l,...c.functionData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};u.FunctionEnum=u.Enum=p;const m=u},53392:(e,t,l)=>{l.d(t,{A:()=>p,W:()=>u});var n=l(45776),a=l(27047),s=l(33097),r=l.n(s),o=l(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c={cache:"INDUSTRY_DATA",isLocal:!0,ttl:864e5,loader:()=>l.e(7183).then(l.t.bind(l,57183,19)).then((e=>e.__esModule?e.default:e))},d=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.Ay,{...l,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:l}=(0,n.ON)(new Map(t.filter((e=>"000"!==e.code)).map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return l}},d.industryData)})};d.defaultProps={overlayWidth:"635px"};const u=e=>{let{apis:t,...l}=e;const{apis:s,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===s||void 0===s?void 0:s.staticData,t);return(0,o.jsx)(n.yK,{...l,...d.industryData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};d.IndustryEnum=d.Enum=u;const p=d},26475:(e,t,l)=>{l.d(t,{A:()=>f});var n=l(73884),a=l(55199),s=l(96418),r=l.n(s),o=l(21485),i=l(83136),c=l.n(i),d=l(51941);const u="style_scroller-no-more__EH2J+__fzO9l";var p=l(70579);const m=e=>{let{getScrollerRef:t,loadMore:l,maxFullCount:a}=e;const s=r()(l),o=r()(t);return(0,n.useEffect)((()=>{let e=a;const t=o(),l=async()=>{t.clientHeight===t.scrollHeight&&e>0&&(await s().then((()=>new Promise((e=>{setTimeout(e,500)})))),e--,await l())};l()}),[a,s,o]),null},h=(0,n.forwardRef)(((e,t)=>{let{className:l,noMore:s,onLoader:i,isLoading:h,completeTips:f,maxFullCount:_,children:g}=e;const[x,y]=(0,n.useState)(!1),v=(0,n.useRef)(),C=r()(i),j=(0,n.useRef)(!s&&!h);j.current=!s&&!h,(0,n.useImperativeHandle)(t,(()=>v.current),[]);const b=(0,d.useThrottledCallback)((e=>{const t=e.target;j.current&&t.clientHeight+t.scrollTop+20>t.scrollHeight&&C()}),100);return(0,p.jsxs)(o.A,{ref:v,onScroll:b,className:c()("load-container",l),onReady:()=>{y(!0)},children:[x&&!h&&!s&&(0,p.jsx)(m,{maxFullCount:_,getScrollerRef:()=>v.current,loadMore:C}),(0,p.jsxs)(a.Space,{direction:"vertical",children:[(0,p.jsx)("div",{children:g}),h?(0,p.jsx)("div",{className:u,children:(0,p.jsx)(a.Spin,{size:"small"})}):null,s&&f?(0,p.jsx)("div",{className:u,children:f}):null]})]})}));h.defaultProps={maxFullCount:3,completeTips:"\u52a0\u8f7d\u5b8c\u6210"};const f=h},73161:(e,t,l)=>{l.d(t,{A:()=>m});var n=l(55199),a=l(83136),s=l.n(a);const r="style_search-input__8aH1G__fzO9l",o="style_is-popup__L0973__fzO9l";var i=l(64671),c=l(73884),d=l(51941),u=l(70579);const p=e=>{let{value:t,debounce:l,onSearch:a,isPopup:p,placeholder:m,className:h,...f}=e;const[_,g]=(0,c.useState)(t),x=(0,c.useRef)(t),y=(0,d.useDebouncedCallback)(a,l);return(0,c.useEffect)((()=>{t!==x.current&&(g(t),x.current=t)}),[t]),(0,u.jsx)(n.Input.Search,{...f,allowClear:!0,className:s()(h,r,{[o]:p}),value:_,placeholder:m,prefix:(0,u.jsx)(i.default,{type:"icon-sousuo"}),enterButton:(0,u.jsx)(i.default,{type:"icon-sousuo"}),onChange:e=>{const t=e.target.value;x.current=t,g(t),y(t)},onSearch:e=>{y(e)}})};p.defaultProps={debounce:500};const m=p},30509:(e,t,l)=>{l.d(t,{A:()=>B});const n={"ant-tag":"style_ant-tag__nNp8-__fzO9l",overlay:"style_overlay__La5mO__fzO9l",input:"style_input__SpJTE__fzO9l","is-disabled":"style_is-disabled__joxdl__fzO9l","input-icon":"style_input-icon__vVd8R__fzO9l",large:"style_large__En6mL__fzO9l",small:"style_small__DY0AQ__fzO9l","input-inner":"style_input-inner__PWy27__fzO9l","input-custom":"style_input-custom__ktsWD__fzO9l","display-content":"style_display-content__hIKo+__fzO9l","overlay-footer-extra":"style_overlay-footer-extra__Q+BiR__fzO9l","selected-tag":"style_selected-tag__zXZZO__fzO9l","selected-tag-list":"style_selected-tag-list__xUIms__fzO9l","selected-tag-inner":"style_selected-tag-inner__Z5gPL__fzO9l","text-inner":"style_text-inner__H24hY__fzO9l",placeholder:"style_placeholder__x0ccE__fzO9l","is-modal":"style_is-modal__JU+uq__fzO9l","overlay-content":"style_overlay-content__WKqp+__fzO9l"};var a=l(74981);const{context:s,useContext:r,Provider:o,Consumer:i}=(0,a.A)();var c=l(73884),d=l(10986),u=l.n(d),p=l(87558),m=l(33097),h=l.n(m),f=l(55199),_=l(83136),g=l.n(_),x=l(3382),y=l(64671),v=l(79686),C=l.n(v),j=l(41740),b=l.n(j),A=l(74065),N=l.n(A),O=l(21485),S=l(96418),w=l.n(S),z=l(77964),P=l(91176),I=l(58609),L=l(20492),k=l(27047),M=l(70579);const F=e=>{let{maxLength:t,single:l,setValue:n,value:a,message:s}=e;return e=>n(!l&&Number.isInteger(t)&&t>0&&e.length>t?(s(),a):e)},T=e=>{let{single:t,value:l,mapping:a,allValue:s,allLabel:r,onClose:o}=e;return l&&Array.isArray(l)&&0!==l.length?t?(0,M.jsx)("span",{className:n["text-inner"],children:h()(a.get(l[0]),"label")||l[0]}):1===l.length&&l[0]===(s||"all")?(0,M.jsx)("span",{className:n["text-inner"],children:r||(0,M.jsx)(I.FormattedMessage,{id:"all",moduleName:"Common"})}):l.map((e=>{const t=a.get(e);return(0,M.jsx)(f.Tag,{className:n["display-tag"],closable:!0,onClose:l=>{l.preventDefault(),o(e,t)},children:(0,M.jsx)("span",{className:n["tag-inner"],children:h()(t,"label")||e})},e)})):null},R=(0,c.forwardRef)(((e,t)=>{let{value:l,onChange:a,extra:s,showSelectedTag:r,renderSelectedContent:o,children:i,...d}=e;const[u,p]=(0,c.useState)(l),m=(0,c.useRef)(l),{formatMessage:h}=(0,I.useIntl)({moduleName:"Common"});m.current=l;const[_,g]=(0,c.useState)(!1),y=e=>{var t;g(e),null===(t=d.onOpenChange)||void 0===t||t.call(d,e)},{message:v}=f.App.useApp(),C=F({maxLength:d.maxLength,single:d.single,setValue:p,value:u,message:()=>v.error(h({id:"maxSelectedCount"},{count:d.maxLength}))});return(0,c.useEffect)((()=>{_&&p(m.current)}),[_]),(0,c.useImperativeHandle)(t,(()=>({modalOpen:()=>{y(!0)},close:()=>{y(!1)}}))),(0,M.jsx)(x.default,{...d,open:_,onConfirm:()=>{a(u)},onClose:()=>{y(!1)},footer:(r||s)&&(0,M.jsxs)(f.Space,{direction:"vertical",className:n["overlay-footer"],children:[s&&(0,M.jsx)("div",{className:n["overlay-footer-extra"],children:s}),r&&o({value:u,setValue:C})]}),children:"function"===typeof i?i({value:u,setValue:C}):i})})),D=(0,c.forwardRef)(((e,t)=>{let{value:l,setValue:a,children:s,renderSelectedContent:r,showSelectedTag:o,placement:i,inputContent:d,single:u,extra:p,overlayWidth:m,wrapClassName:h,overlayClassName:_,disabled:x,...y}=e;const[v,C]=(0,c.useState)(!1),j=w()((e=>{var t;C(e),null===(t=y.onOpenChange)||void 0===t||t.call(y,e)}));return(0,c.useImperativeHandle)(t,(()=>({close:()=>{j(!1)}})),[j]),x?(0,M.jsx)("div",{className:n["input-inner"],children:d}):(0,M.jsx)(f.Popover,{...y,open:v,onOpenChange:j,transitionName:"ant-slide-up",overlayClassName:g()(n.overlay,_),arrow:!1,content:(0,M.jsxs)("div",{style:m?{"--overlay-width":m}:{},className:g()(n["overlay-content"],"over-content"),onClick:e=>{e.stopPropagation()},children:[(0,M.jsx)("div",{className:n["overlay-inner"],children:"function"===typeof s?s({value:l,setValue:e=>{(!u||l[0]!==e[0])&&a(e),u&&j(!1)}}):s}),(o||p)&&(0,M.jsxs)("div",{className:n["overlay-footer"],children:[p&&(0,M.jsx)("div",{className:n["overlay-footer-extra"],children:p}),o&&r({value:l,setValue:a})]})]}),trigger:"click",placement:i,children:(0,M.jsx)("div",{className:n["input-inner"],children:d})})})),E=(0,p.withFetch)((e=>{let{setFetchApi:t,wrapClassName:l,getContentRef:a,...s}=e;const[o,i]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useRef)(null),p=r(),{valueState:m,mapping:h,props:_,inputWidth:x}=p,[v,C]=m,{formatMessage:j}=(0,I.useIntl)({moduleName:"Common"}),{single:b,placement:A,getPopupContainer:N,placeholder:S,isPopup:z,disabled:L,showSelectedTag:k,extra:F,inputContent:E,allowClear:V,overlayClassName:W}=_,B=(0,c.useRef)(s);B.current=s;const U=w()(a);(0,c.useEffect)((()=>{U(z?u:d)}),[z,U]),(0,c.useEffect)((()=>{t(Object.assign({},B.current,{data:s.data,isComplete:s.isComplete}))}),[s.data,t,s.isComplete]);const K=T({single:b,value:v,mapping:h,allValue:_.allValue,allLabel:_.allLabel,onClose:e=>{C((t=>{const l=t.slice(0),n=t.indexOf(e);return n>-1&&l.splice(n,1),l}))}}),q=e=>{let{value:t,setValue:l}=e;return(0,M.jsxs)(f.Space,{className:n["selected-tag"],align:"center",wrap:!1,children:[(0,M.jsxs)("div",{children:[(0,M.jsx)(I.FormattedMessage,{id:"selectedTextAdvanced",moduleName:"Common",defaultMessage:"\u5df2\u9009"}),!_.single&&Number.isInteger(_.maxLength)&&_.maxLength>0?"(".concat(t.length,"/").concat(_.maxLength,")"):"",":"]}),(0,M.jsx)(O.A,{className:n["selected-tag-list"],children:(0,M.jsx)("div",{className:n["selected-tag-inner"],children:T({value:t,mapping:h,allValue:_.allValue,allLabel:_.allLabel,onClose:e=>{l((t=>{const l=t.slice(0),n=t.indexOf(e);return n>-1&&l.splice(n,1),l}))}})})})]})},H=E?E(p):(0,M.jsxs)(f.Space,{className:n["display-content"],onMouseOver:()=>{i(!0)},onMouseOut:()=>{i(!1)},children:[(0,M.jsx)("div",{children:K||(0,M.jsx)("span",{className:n.placeholder,children:S||j({id:"pleaseSelect"})})}),o&&v&&v.length>0&&!L&&V?(0,M.jsx)(y.default,{className:g()(n.close,n["input-icon"],"close","input-icon"),type:"icon-shibai",onClick:e=>{e.stopPropagation(),C([])}}):(0,M.jsx)(y.default,{className:g()(n["input-icon"],"input-icon-arrow","input-icon"),type:"icon-arrow-thin-down"})]});return z?(0,M.jsx)(D,{ref:u,overlayWidth:(0,P.v)(Math.max(x,(0,P.j)(_.overlayWidth))),value:v,setValue:C,single:b,disabled:L,inputContent:H,onOpenChange:_.onOpenChange,overlayClassName:W,extra:"function"===typeof F?F({close:()=>u.current.close(),context:p}):F,renderSelectedContent:q,showSelectedTag:k,trigger:"click",placement:A,getPopupContainer:N,children:_.children}):(0,M.jsxs)("div",{className:n["input-inner"],onClick:()=>{L||d.current.modalOpen()},children:[(0,M.jsx)(R,{size:_.modalSize,ref:d,single:_.single,maxLength:_.maxLength,onOpenChange:_.onOpenChange,disabledScroller:!0,wrapClassName:g()(n.overlay,n["is-modal"],l),title:_.placeholder||j({id:"pleaseSelect"}),value:v,onChange:C,extra:"function"===typeof F?F({close:()=>d.current.close(),context:p}):F,showSelectedTag:k,renderSelectedContent:q,children:_.children}),H]})})),V=e=>{let{api:t,className:l,displayItems:a,wrapClassName:s,...r}=e;const{locale:i}=(0,k.A)(),[d,p]=(0,c.useState)(""),[m,_]=(0,c.useState)(new Map(a.map((e=>[e.value,e])))),{formatMessage:x}=(0,I.useIntl)({moduleName:"Common"}),[y,v]=(0,c.useState)(0),j=(0,z.A)((e=>{v(e.clientWidth)})),[A,O]=(0,c.useState)({}),{message:S}=f.App.useApp(),w=e=>{const t=e.filter((e=>m.get(e.value)!==e));0!==t.length&&_((e=>{const l=b()(e);return t.forEach((e=>{l.set(e.value,e)})),l}))},P=e=>((e,t)=>Array.isArray(e)&&e.every((e=>e&&e.hasOwnProperty("value")&&e.hasOwnProperty("label")))?(t(e),e.map((e=>e.value))):e)(r.single?C()(e)?[]:[e]:e||[],w,r.valueType),[L,T]=u()(Object.assign({},r,{onChange:e=>{const t=((e,t,l)=>"all"!==l?e:e.map((e=>t.get(e))).filter((e=>!!e)))(e,m,r.valueType);r.onChange&&r.onChange(r.single?N()(t):t)}},"value"in r?{value:P(r.value)}:{defaultValue:P(r.defaultValue)})),R=F({maxLength:r.maxLength,single:r.single,setValue:T,value:L,message:()=>S.error(x({id:"maxSelectedCount"},{count:r.maxLength}))}),D=(0,c.useRef)(null);return(0,M.jsx)(o,{value:{inputWidth:y,mapping:m,searchText:d,setSearchText:p,appendMapping:w,setItems:e=>{A.setData(e),w(h()(r.dataFormat(e,{locale:i}),"list",[]))},getContentApi:()=>D.current,fetchApi:A,valueState:[L,R],props:r},children:(0,M.jsx)("div",{ref:j,className:g()(n["input".concat(r.inputContent&&"function"===typeof r.inputContent?"-custom":"")],{"select-input-disabled":!!r.disabled},l),children:(0,M.jsx)(E,{...t,wrapClassName:s,loading:null,setFetchApi:O,getContentRef:e=>{e.current&&(D.current=e.current)},onRequestSuccess:e=>{w(h()(r.dataFormat(e,{locale:i}),"list",[])),t.onRequestSuccess&&t.onRequestSuccess(e)}})})})};V.defaultProps={displayItems:[],extra:null,api:{loader:()=>[]},dataFormat:e=>({list:e}),placement:"bottomLeft",showSelectedTag:!0,allowClear:!0};const W=(0,I.createWithIntl)({importMessages:L.A,moduleName:"Common"})(V);W.useContext=r;const B=W},17342:(e,t,l)=>{l.d(t,{A:()=>s});var n=l(8762),a=l.n(n);l(46733);const s=a()},21485:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(73884),a=l(44418),s=l.n(a),r=l(96418),o=l.n(r),i=l(70579);const c=(0,n.forwardRef)(((e,t)=>{let{children:l,onScroll:a,options:r,onReady:c,...d}=e;const u=(0,n.useRef)(null),p=(0,n.useRef)(null),m=(0,n.useRef)(r),h=o()(c),f=o()(a);return(0,n.useImperativeHandle)(t,(()=>p.current)),(0,n.useEffect)((()=>{const e=new(s())(u.current,m.current);return p.current=e.getScrollElement(),p.current.addEventListener("scroll",f),h(p.current),()=>{p.current.removeEventListener("scroll",f)}}),[f,h,l]),(0,i.jsx)("div",{...d,ref:u,children:l})}))},89319:(e,t,l)=>{l.d(t,{A:()=>u});var n=l(55199),a=l(10986),s=l.n(a),r=l(57469),o=l.n(r),i=l(20492),c=l(58609),d=l(70579);const u=(0,c.createWithIntl)({importMessages:i.A,moduleName:"Common"})((e=>{let{...t}=e;const{formatMessage:l}=(0,c.useIntl)({moduleName:"Common"}),a=new Map([["date",l({id:"customTime"})],["month",l({id:"monthly"})],["week",l({id:"weekly"})]]),[r,i]=s()(t);return(0,d.jsxs)(n.Space.Compact,{children:[(0,d.jsx)(n.Select,{style:{width:"120px"},value:(null===r||void 0===r?void 0:r.type)||"date",onChange:e=>{i((t=>{var l;return{value:null!==t&&void 0!==t&&null!==(l=t.value)&&void 0!==l&&l.length?[o()(t.value[0]).startOf(e||"date"),o()(t.value[1]).endOf(e||"date")]:null,type:e||"date"}}))},options:Array.from(a).map((e=>{let[t,l]=e;return{label:l,value:t}}))}),(0,d.jsx)(n.DatePicker.RangePicker,{...t,picker:(null===r||void 0===r?void 0:r.type)||"date",value:Array.isArray(null===r||void 0===r?void 0:r.value)&&2===r.value.length&&r.value.map((e=>e&&o()(e))),onChange:e=>{i((t=>(console.log(Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]})),Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]}))))}})]})}))},20492:(e,t,l)=>{l.d(t,{A:()=>n});const n=e=>({"en-US":()=>l.e(3086).then(l.bind(l,13086)),"zh-CN":()=>l.e(4308).then(l.bind(l,84308))}[e]())},29574:(e,t,l)=>{l.d(t,{Zi:()=>f,FI:()=>_,AG:()=>g,Ay:()=>y,lN:()=>x});const n="style_input-file__3JGm6__fzO9l",a="style_input-file-input__Fb5iw__fzO9l";var s=l(83136),r=l.n(s),o=l(73884),i=l(55199),c=l(76329),d=l(28987),u=l(80111),p=l.n(u),m=l(70579);const h=e=>t=>{let{className:l,accept:s,multiple:i,onChange:c,children:d,...u}=t;const p=(0,o.useRef)(null);return(0,m.jsxs)(e,{...u,className:r()(l,n),children:[d,!0!==u.disabled&&(0,m.jsx)("input",{ref:p,type:"file",accept:s,multiple:i,className:a,onChange:e=>{const t=[].slice.call(e.target.files,0);0!==t.length&&(p.current.setAttribute("type","text"),p.current.setAttribute("type","file"),c(t))}})]})},f=h(i.Button),_=h((e=>{let{className:t,...l}=e;return(0,m.jsx)(i.Typography.Link,{...l,className:t})})),g=h((e=>{let{className:t,...l}=e;return(0,m.jsx)(i.Typography.Text,{...l,className:r()("ant-btn",t)})})),x=e=>{const{message:t}=i.App.useApp(),{multiple:l,fileSize:n,maxLength:a,value:s,concurrentCount:r,onAdd:u,onError:m,onSave:h,onChange:f,ossUpload:_}=Object.assign({},{concurrentCount:1,value:[]},e),{apis:g}=(0,c.usePreset)(),[x,y]=(0,o.useState)([]),v=(0,o.useRef)(r),C=(0,o.useMemo)((()=>(0,d.A)(v.current)),[]);return{fileList:x,onFileSelected:async e=>{const r=a-s.length;1!==a&&!0===l&&e.length>r?t.error("\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf".concat(a)):await Promise.allSettled(e.map((async e=>{if(e.size>1024*n*1024)return void t.error("\u6587\u4ef6".concat(e.name,"\u4e0d\u80fd\u8d85\u8fc7").concat(n,"MB!"));const s=p()(),r=l=>{const n=l.message||"\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u9519\u8bef").concat(l.message?":"+l.message:"");t.error(n),m&&m({file:e,error:l,errMsg:n}),y((e=>{const t=e.slice(0),l=t.findIndex((e=>e.uuid===s));return l>-1&&t.splice(l,1),t}))};try{y(1===a||!0!==l?[{uuid:s,type:"uploading",filename:e.name}]:t=>{const l=t.slice(0);return l.unshift({uuid:s,type:"uploading",filename:e.name}),l}),u&&await Promise.resolve(u(e));const t=_||g.ossUpload,{data:n}=await C((()=>t({file:e})));if(0!==n.code)return void r(new Error("\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u5f02\u5e38").concat(n.msg?":"+n.msg:"")));const o=h?await Promise.resolve(h(n,e,s)):{filename:n.data.originalName||n.data.filename||e.name,id:n.data.id,ossId:n.data.id,uuid:s};y((e=>{const t=e.slice(0),l=t.findIndex((e=>e.uuid===s));return l>-1&&t.splice(l,1),t})),f(1===a||!0!==l?[o]:e=>{const t=e.slice(0);return t.push(o),t})}catch(o){r(o)}})))}}},y=h},97211:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(87558),a=l.n(n),s=l(76329),r=l(34677),o=l.n(r),i=l(70579);const c=e=>{const t=t=>{let{id:l,url:n,error:r,apis:c,loading:d,...u}=t;const{apis:p}=(0,s.usePreset)(),m=o()({},p,c);if(!l)return null;if(!m.oss)throw new Error("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.oss\u53c2\u6570");const{paramsType:h,paramsName:f,..._}=Object.assign({paramsType:"params",paramsName:"id"},m.oss),g={};return g[h]={[f]:l},(0,i.jsx)(a(),{...Object.assign({},_,g),updateType:"refresh",error:r,loading:d,cache:"oss-file",ttl:6e6,render:t=>{let{data:n}=t;return(0,i.jsx)(e,{...u,id:l,data:n})}})};return t.defaultProps={loading:null},t}},27047:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(83694),a=l(33097),s=l.n(a);const r=()=>{const e=(0,n.useGlobalContext)();return s()(e,"preset",{apis:{}})}},77964:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(73884),a=l(79889),s=l.n(a),r=l(93950),o=l.n(r),i=l(96418),c=l.n(i);const d=(e,t)=>{const l=(0,n.useRef)(null);l.current=Object.assign({},{time:500,isDebounce:!1},t);const a=(0,n.useRef)(null),r=c()(e);return(0,n.useLayoutEffect)((()=>{const e=a.current,t=()=>window.requestAnimationFrame((()=>{e&&r(e)}));t();const n=new ResizeObserver((l.current.isDebounce?o():s())(t,l.current.time));return e&&n.observe(e),()=>{n.disconnect()}}),[r]),a}},81348:(e,t,l)=>{l.d(t,{A:()=>n});const n=(e,t)=>{if(e&&t){const l=Array.isArray(t)?t:t.split(","),n=e.name||"",a=(e.type||"").toLowerCase(),s=a.replace(/\/.*$/,"");return l.some((e=>{const t=e.trim().toLowerCase();return"."===t.charAt(0)?n.toLowerCase().endsWith(t):t.endsWith("/*")?s===t.replace(/\/.*$/,""):a===t}))}return!0}},69484:(e,t,l)=>{l.d(t,{A:()=>a,e:()=>n});const n=1e15,a=e=>{let t,l,a,s=["\u96f6","\u58f9","\u8d30","\u53c1","\u8086","\u4f0d","\u9646","\u67d2","\u634c","\u7396"],r=["","\u62fe","\u4f70","\u4edf"],o=["","\u4e07","\u4ebf","\u5146"],i=["\u89d2","\u5206","\u6beb","\u5398"],c="",d="";if(""===e)return"";if((e=parseFloat(e))>=n)return c="\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57",console.error("\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57"),c;if(0===e)return c=s[0]+"\u5143\u6574",c;if(e<0&&(e=-e,d="\u8d1f "),-1===(e=e.toString()).indexOf(".")?(t=e,l=""):(a=e.split("."),t=a[0],l=a[1].substr(0,4)),parseInt(t,10)>0){let e=0,l=t.length;for(let n=0;n<l;n++){let a=t.substr(n,1),i=l-n-1,d=i/4,u=i%4;"0"===a?e++:(e>0&&(c+=s[0]),e=0,c+=s[parseInt(a)]+r[u]),0===u&&e<4&&(c+=o[d])}c+="\u5143"}if(""!==l){let e=l.length;for(let t=0;t<e;t++){let e=l.substr(t,1);"0"!==e&&(c+=s[Number(e)]+i[t])}}return""===c?c+=s[0]+"\u5143\u6574":""===l&&(c+="\u6574"),c=d+c,c}},74981:(e,t,l)=>{l.d(t,{A:()=>a});var n=l(73884);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.createContext)(e),{Provider:l,Consumer:a}=t;return{context:t,Provider:l,Consumer:a,useContext:()=>(0,n.useContext)(t)}}},28987:(e,t,l)=>{l.d(t,{A:()=>n});const n=e=>{const t=[];let l=0;const n=()=>{if(0!==t.length){if(l<e){const e=t.shift();l+=1,e().finally((()=>{l-=1,n()}))}}else l=0};return e=>new Promise((l=>{t.push((()=>{const t=Promise.resolve().then((()=>e()));return l(t),t})),n()}))}},55490:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(12322),a=l.n(n),s=l(26727),r=l.n(s),o=l(54052),i=l.n(o);const c=e=>{if(a()(e)){const t=r()(e);return t.length>0&&t.some((e=>c(e)))}return i()(e)?e.length>0&&e.some((e=>c(e))):"number"===typeof e?!isNaN(e):!(void 0===e||null===e||""===e||0===e.length)},d=c},91176:(e,t,l)=>{l.d(t,{j:()=>a,v:()=>n});const n=e=>"number"===typeof e?"".concat(e,"px"):e,a=e=>{if(!e)return 0;const t=e.match(/^\d*(\.\d*)?/);return t?Number(t[0]):0}},36:(e,t,l)=>{l.r(t),l.d(t,{AddressEnum:()=>h.qn,AddressInputField:()=>h.TM,AddressSelectField:()=>h.Ay,AdvancedSelectField:()=>f.Ay,CascaderField:()=>_.Ay,FetchButton:()=>i.A,FunctionEnum:()=>g.K,FunctionSelectField:()=>g.A,IndustryEnum:()=>x.W,IndustrySelectField:()=>x.A,InputFileButton:()=>m.Zi,InputFileLink:()=>m.FI,InputFileText:()=>m.AG,ScrollLoader:()=>o.A,SearchInput:()=>u.A,SelectInnerInput:()=>p.A,SimpleBar:()=>d.A,SimpleBarBox:()=>c.A,TableField:()=>f.Bm,TypeDateRangePickerField:()=>y.A,UserField:()=>f.Eo,accept:()=>C.A,changeMoneyToChinese:()=>n.A,createAddressApi:()=>h.LH,createDeferred:()=>j.A,createListField:()=>f.NR,createTreeUtils:()=>_.ON,getContainerBody:()=>a.c,getPopupContainer:()=>s,getScrollEl:()=>a.h,isNotEmpty:()=>b.A,numberToPx:()=>A.v,pxToNumber:()=>A.j,useFileUpload:()=>m.lN,useResize:()=>v.A,withAddressApi:()=>h.DF,withInputFile:()=>m.Ay,withOSSFile:()=>r.A});var n=l(69484),a=l(76801);const s=e=>{const t=e=>{const l=(0,a.h)();if(!e||e===l||!e.parentElement)return l;return[].slice.call(e.classList,0).find((e=>["ant-modal-body","ant-modal-content","ant-popover-content"].indexOf(e)>-1))?e:t(e.parentElement)};return t(e)};var r=l(97211),o=l(26475),i=l(73025),c=l(21485),d=l(17342),u=l(73161),p=l(30509),m=l(29574),h=l(93761),f=l(12392),_=l(45776),g=l(41654),x=l(53392),y=l(89319),v=l(77964),C=l(81348),j=l(28987),b=l(55490),A=l(91176)},40438:(e,t,l)=>{l.r(t),l.d(t,{default:()=>b});var n=l(87558),a=l.n(n),s=l(97211),r=l(64671),o=l(83136),i=l.n(o),c=l(55199),d=l(73884);const u=e=>{let{params:t}=e;const{data:l}=t;return new Promise(((e,t)=>{const n=new window.Image;n.src=l,n.addEventListener("load",(()=>{e(l)})),n.addEventListener("error",(e=>{t(e)}))}))},p="style_img-outer__4QLY5__fzO9l",m="style_img__PSExq__fzO9l",h="style_loading__WCOwA__fzO9l",f="style_error__+ECgZ__fzO9l";var _=l(18411),g=l(70579);const x=e=>{let{data:t,className:l,alt:n,innerLoading:s,loading:r,error:o,innerError:c,children:d,onClick:p}=e;return(0,g.jsx)(a(),{loader:u,params:{data:t},error:c||o,loading:s||r,render:e=>{let{data:t}=e;return"function"===typeof d?d({alt:n,className:i()(l,m),src:t}):(0,g.jsx)("img",{alt:n,className:i()(l,m),src:t,onClick:p})}})},y=(0,s.A)(x),v=e=>{let{loading:t,error:l,src:n,id:a,alt:s,className:r,children:o,apis:i,onClick:c}=e;const u=t&&(0,d.cloneElement)(t,{className:h}),p=l&&(0,d.cloneElement)(l,{className:f});return n?(0,g.jsx)(x,{alt:s,className:r,data:n,loading:u,error:p,onClick:c,children:o}):a?(0,g.jsx)(y,{alt:s,className:r,id:a,loading:u,innerLoading:u,error:p,innerError:p,apis:i,onClick:c,children:o}):p},C=e=>{let{id:t,src:l,alt:n,onClick:a,loading:s,error:r,className:o,apis:c,...d}=e;return(0,g.jsx)("div",{...d,"data-testid":"components-core-image",className:i()(o,p),children:v({loading:s,error:r,src:l,id:t,alt:n,className:o,apis:c,onClick:a})})};C.Avatar=e=>{let{id:t,src:l,alt:n,gender:a,loading:s,error:o,className:d,gap:u,icon:m,children:h,shape:f,size:_,width:x,height:y,defaultAvatar:C,apis:j,...b}=e;const A=(()=>{const e=x&&y?{style:{width:x,height:y}}:{size:_};if(x&&x!==y&&(f="square"),t||l)return v({loading:s,error:o,src:l,defaultAvatar:C,id:t,alt:n,className:d,apis:j,children:t=>(0,g.jsx)(c.Avatar,{...t,gap:u,shape:f,...e})});if(a){const t=a&&["F","female","f"].indexOf(a)>-1?"icon-color-touxiang-nv":"icon-color-touxiang-nan";return(0,g.jsx)(c.Avatar,{...b,src:(0,g.jsx)(r.default,{role:"touxiang",colorful:!0,type:t}),gap:u,shape:f,...e})}return(0,g.jsx)(c.Avatar,{...b,gap:u,icon:m,shape:f,size:_,src:C,...e,children:h})})();return(0,g.jsx)("div",{...b,"data-testid":"components-core-image-avatar",className:i()(d,p),style:{width:x&&y?x:_,height:x&&y?y:_},children:A})};const j={error:(0,g.jsx)(r.default,{role:"error-icon",colorful:!0,type:"icon-color-touxiang-nan"}),loading:(0,g.jsx)(c.Skeleton.Avatar,{shape:"square",active:!0})};C.defaultProps=Object.assign({},j),C.Avatar.defaultProps=Object.assign({},j,{size:100,defaultAvatar:_.A});const b=C},3382:(e,t,l)=>{l.r(t),l.d(t,{ModalButton:()=>P,TabsModal:()=>O,TabsModalButton:()=>z,default:()=>A,useConfirmModal:()=>b,useModal:()=>j,useTabsModal:()=>S});var n=l(73884),a=l(55199),s=l(83136),r=l.n(s);const o={modal:"style_modal__Pm3cF__fzO9l",large:"style_large__iaqVE__fzO9l","modal-body-inner":"style_modal-body-inner__4PhpA__fzO9l","modal-title":"style_modal-title__dswaw__fzO9l","modal-outer":"style_modal-outer__r3SkX__fzO9l","modal-body":"style_modal-body__jQJSI__fzO9l","right-options-modal":"style_right-options-modal__FajDP__fzO9l","right-options-col":"style_right-options-col__3ilee__fzO9l","is-disabled-scroller":"style_is-disabled-scroller__PmHyk__fzO9l","modal-footer":"style_modal-footer__-prbN__fzO9l","modal-close":"style_modal-close__Oa5Kl__fzO9l","confirm-modal-wrap":"style_confirm-modal-wrap__YFImr__fzO9l","is-danger":"style_is-danger__H5110__fzO9l",title:"style_title__orTym__fzO9l",content:"style_content__k6MIF__fzO9l","has-title":"style_has-title__qy0Wp__fzO9l"},i=e=>({"en-US":()=>l.e(4628).then(l.bind(l,74628)),"zh-CN":()=>l.e(7478).then(l.bind(l,87478))}[e]());var c=l(58609),d=l(64671);const u=(e,t)=>"function"===typeof e?e(t):e;var p=l(81014),m=l(17342),h=l(70579);const f="Modal",_=e=>{let{options:t,children:l}=e;return t?(0,h.jsxs)(a.Row,{wrap:!1,children:[(0,h.jsx)(a.Col,{span:18,className:o["right-options-col"],children:l}),(0,h.jsx)(a.Col,{span:6,className:o["right-options-col"],children:t})]}):l},g=e=>{let{footer:t,footerButtons:l,onConfirm:s,onCancel:r,onClose:o,targetProps:d}=e;return(0,h.jsxs)(a.Row,{gutter:10,wrap:!1,children:[(0,h.jsx)(a.Col,{flex:1,children:t}),Array.isArray(l)&&0===l.length?null:(0,h.jsx)(a.Col,{children:(0,h.jsx)(a.Space,{children:(l||[{children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:f,children:(0,h.jsx)(c.FormattedMessage,{id:"Cancel",moduleName:f})}),onClick:r},{type:"primary",children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:f,children:(0,h.jsx)(c.FormattedMessage,{id:"Confirm",moduleName:f})}),onClick:s}]).filter((e=>"function"===typeof(null===e||void 0===e?void 0:e.display)?null===e||void 0===e?void 0:e.display():!1!==(null===e||void 0===e?void 0:e.display))).map(((e,t)=>{let{ButtonComponent:l,onClick:a,autoClose:s=!0,display:r,...i}=e;const c=l||p.default;return(0,n.createElement)(c,{...i,key:t,onClick:async function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const n=await Promise.resolve(a&&a(...t,d));return s&&!1!==n&&o&&o(),n}})}))})})]})},x=e=>{let{title:t,footer:l,disabledScroller:s,footerButtons:i,onClose:c,closable:u,onConfirm:p,onCancel:f,children:_,targetProps:x}=e;const y=(0,n.useRef)(null);return(0,h.jsxs)("div",{className:o["modal-outer"],"data-testid":"components-core-modal",children:[!1===u?null:(0,h.jsx)(a.Button,{"data-testid":"components-core-modal-close-btn",className:o["modal-close"],type:"text",icon:(0,h.jsx)(d.default,{type:"icon-close-thin"}),onClick:e=>{e.stopPropagation(),c&&c()}}),t&&(0,h.jsx)("div",{className:o["modal-title"],children:t}),(0,h.jsx)(m.A,{className:r()(o["modal-body"],{[o["is-disabled-scroller"]]:s},"modal-body"),ref:y,children:(0,h.jsx)("div",{className:r()(o["modal-body-inner"],"modal-body-inner"),children:_})}),null!==l||i?(0,h.jsx)("div",{className:r()(o["modal-footer"],"modal-footer"),children:(0,h.jsx)(g,{footer:l,footerButtons:i,onConfirm:p,onCancel:f,onClose:c,targetProps:x})}):null]})},y=e=>{let{withDecorator:t,footerButtons:l,title:n,closable:a,onClose:s,onConfirm:r,onCancel:o,footer:i,rightOptions:c,disabledScroller:d,childrenRef:p,children:m}=e;const f=e=>(e=Object.assign({},{title:n},e),(0,h.jsx)(x,{title:u(e.title,{...e,childrenRef:p,close:s}),closable:a,onClose:s,onConfirm:r,onCancel:o,footerButtons:u(l,{...e,close:s}),disabledScroller:d,footer:u(i,{...e,childrenRef:p,close:s}),targetProps:Object.assign({},e,{childrenRef:p,close:s}),children:(0,h.jsx)(_,{options:u(c,{...e,childrenRef:p,close:s}),children:u(m,{...e,childrenRef:p,close:s})})}));return"function"===typeof t?t(f):f({})},v=e=>{let{children:t,rightOptions:l,footer:n,footerButtons:a,className:s,size:d,title:u,onClose:p,onConfirm:m,onCancel:f,closable:_,disabledScroller:g,withDecorator:x,childrenRef:v,...C}=e;return{...C,icon:null,centered:!0,title:null,maskClosable:!!C.hasOwnProperty("maskClosable")&&C.maskClosable,destroyOnClose:!0,footer:null,closable:!1,onCancel:p,className:r()(s,o.modal,o[d],{[o["right-options-modal"]]:l}),...(j=d,"large"===j?{width:"".concat(Math.min(window.innerWidth-64,1500),"px")}:"small"===j?{width:"600px"}:{width:"1000px"}),children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:"Modal",children:y({withDecorator:x,title:u,closable:_,onClose:p,onConfirm:m,onCancel:f,footer:n,footerButtons:a,rightOptions:l,disabledScroller:g,children:t,childrenRef:v})})};var j},C=e=>{const t=(0,n.useRef)(null);return(0,h.jsx)(a.Modal,{...v(Object.assign({},e,{childrenRef:t}))})};C.defaultProps={size:"default"};const j=()=>{const{modal:e}=a.App.useApp(),t=(0,n.useRef)(null);return l=>{const n={},{children:a,...s}=v({onClose:()=>n.close(),childrenRef:t,...l}),{destroy:r}=e.info({...s,content:a});return n.close=r,n}},b=()=>{const{modal:e}=a.App.useApp();return t=>{const l={},{type:n,icon:s,title:i,danger:c,wrapClassName:u,message:p,iconSetting:m={},confirmType:f="info",..._}={onClose:()=>l.close(),maskClosable:!1,...t},g=Object.assign({},{info:"icon-xinxi-tianchong",confirm:"icon-tishi-tianchong",warning:"icon-tishi-tianchong",error:"icon-shibai",success:"icon-chenggong"},m);if(e[n]){const{destroy:t}=e[n]({..._,icon:null,wrapClassName:r()(o["confirm-modal-wrap"],u,{[o["is-danger"]]:c}),title:(0,h.jsx)(a.Space,{direction:"vertical",onClick:e=>{e.stopPropagation()},children:i&&(0,h.jsxs)(a.Space,{size:0,align:"start",className:o.title,children:[(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?f:n)),type:s||g["confirm"===n?f:n]}),i]})}),content:(0,h.jsxs)(a.Space,{size:0,align:"start",className:r()(o.content,{[o["has-title"]]:i}),children:[!i&&(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?f:n)),type:s||g["confirm"===n?f:n]}),p]})});l.close=t}return l}},A=C,N=e=>{let{items:t,className:l,activeKey:n,withDecorator:s,defaultActiveKey:o,onChange:i,...c}=e;return{...c,className:r()(l,"tabs-modal"),withDecorator:e=>{const l=l=>(0,h.jsx)(a.Tabs,{items:t.map((t=>{let{withDecorator:n,...a}=t;return Object.assign({},a,{children:"function"===typeof n?n((t=>e(Object.assign({},l,t,{children:a.children})))):e(Object.assign({},l,{children:a.children}))})})),destroyInactiveTabPane:!0,activeKey:n,defaultActiveKey:o,onChange:i});return"function"===typeof s?s(l):l()},children:e=>{let{children:t,...l}=e;return"function"===typeof t?t(l):t}}},O=e=>(0,h.jsx)(A,{...N(e)}),S=()=>{const e=j();return t=>e(N(t))};var w=l(73025);const z=e=>{const t=S();return(0,h.jsx)(w.A,{...e,modalFunc:t})},P=e=>{const t=j();return(0,h.jsx)(w.A,{...e,modalFunc:t})}},25438:(e,t,l)=>{l.d(t,{A:()=>n});const n={"search-input":"common_search-input__P6qLg__fzO9l","is-popup":"common_is-popup__fJq+g__fzO9l",list:"common_list__TKFzS__fzO9l","list-item":"common_list-item__ASse7__fzO9l","is-selected":"common_is-selected__-PU4Y__fzO9l","item-label":"common_item-label__u+qz1__fzO9l","item-des":"common_item-des__no2z0__fzO9l"}}}]);
2
+ //# sourceMappingURL=36.f521ef8e.chunk.js.map