@kne-components/components-core 0.2.3 → 0.2.5

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 (186) 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.78de3556.chunk.css +2 -0
  6. package/build/static/css/1151.78de3556.chunk.css.map +1 -0
  7. package/build/static/css/1153.46c04068.chunk.css +2 -0
  8. package/build/static/css/{1153.382d399c.chunk.css.map → 1153.46c04068.chunk.css.map} +1 -1
  9. package/build/static/css/1454.163dd6c6.chunk.css +2 -0
  10. package/build/static/css/{1454.c244b0e0.chunk.css.map → 1454.163dd6c6.chunk.css.map} +1 -1
  11. package/build/static/css/1554.fbe14d4d.chunk.css +2 -0
  12. package/build/static/css/{1554.e3fe8993.chunk.css.map → 1554.fbe14d4d.chunk.css.map} +1 -1
  13. package/build/static/css/{2503.7249c0dc.chunk.css → 2503.1363a954.chunk.css} +2 -2
  14. package/build/static/css/{2503.7249c0dc.chunk.css.map → 2503.1363a954.chunk.css.map} +1 -1
  15. package/build/static/css/2517.e3b5fae5.chunk.css +2 -0
  16. package/build/static/css/2517.e3b5fae5.chunk.css.map +1 -0
  17. package/build/static/css/2716.29eeefda.chunk.css +2 -0
  18. package/build/static/css/{2716.afb6cca1.chunk.css.map → 2716.29eeefda.chunk.css.map} +1 -1
  19. package/build/static/css/{2730.ad6ec746.chunk.css → 2730.cd7d1754.chunk.css} +2 -2
  20. package/build/static/css/{2730.ad6ec746.chunk.css.map → 2730.cd7d1754.chunk.css.map} +1 -1
  21. package/build/static/css/{289.79a8844e.chunk.css → 289.a1567d9e.chunk.css} +2 -2
  22. package/build/static/css/{289.79a8844e.chunk.css.map → 289.a1567d9e.chunk.css.map} +1 -1
  23. package/build/static/css/{3142.e9dd2d0e.chunk.css → 3142.630989c6.chunk.css} +2 -2
  24. package/build/static/css/{3142.e9dd2d0e.chunk.css.map → 3142.630989c6.chunk.css.map} +1 -1
  25. package/build/static/css/3174.7a2a2b3e.chunk.css +2 -0
  26. package/build/static/css/{3174.431f88b1.chunk.css.map → 3174.7a2a2b3e.chunk.css.map} +1 -1
  27. package/build/static/css/3178.1607d974.chunk.css +2 -0
  28. package/build/static/css/3178.1607d974.chunk.css.map +1 -0
  29. package/build/static/css/3333.f401b7e1.chunk.css +2 -0
  30. package/build/static/css/3333.f401b7e1.chunk.css.map +1 -0
  31. package/build/static/css/{3843.8b846111.chunk.css → 3843.69bf4701.chunk.css} +2 -2
  32. package/build/static/css/{3843.8b846111.chunk.css.map → 3843.69bf4701.chunk.css.map} +1 -1
  33. package/build/static/css/398.14e5fb9c.chunk.css +2 -0
  34. package/build/static/css/398.14e5fb9c.chunk.css.map +1 -0
  35. package/build/static/css/4319.446e7b65.chunk.css +2 -0
  36. package/build/static/css/{4319.c63bb012.chunk.css.map → 4319.446e7b65.chunk.css.map} +1 -1
  37. package/build/static/css/4666.b0a0baaf.chunk.css +2 -0
  38. package/build/static/css/{4666.317a4f26.chunk.css.map → 4666.b0a0baaf.chunk.css.map} +1 -1
  39. package/build/static/css/5443.4c62ac8b.chunk.css +2 -0
  40. package/build/static/css/5443.4c62ac8b.chunk.css.map +1 -0
  41. package/build/static/css/5600.825153b1.chunk.css +2 -0
  42. package/build/static/css/5600.825153b1.chunk.css.map +1 -0
  43. package/build/static/css/{5996.f7a01600.chunk.css → 5996.b1d76add.chunk.css} +2 -2
  44. package/build/static/css/{5996.f7a01600.chunk.css.map → 5996.b1d76add.chunk.css.map} +1 -1
  45. package/build/static/css/{6611.3a9fea0b.chunk.css → 6611.c09ad390.chunk.css} +2 -2
  46. package/build/static/css/{6611.3a9fea0b.chunk.css.map → 6611.c09ad390.chunk.css.map} +1 -1
  47. package/build/static/css/6779.87e14881.chunk.css +2 -0
  48. package/build/static/css/6779.87e14881.chunk.css.map +1 -0
  49. package/build/static/css/7121.f8d1f906.chunk.css +2 -0
  50. package/build/static/css/7121.f8d1f906.chunk.css.map +1 -0
  51. package/build/static/css/7227.db039757.chunk.css +2 -0
  52. package/build/static/css/{7227.a5f541be.chunk.css.map → 7227.db039757.chunk.css.map} +1 -1
  53. package/build/static/css/{8725.48ad06f8.chunk.css → 8725.b4337873.chunk.css} +2 -2
  54. package/build/static/css/{8725.48ad06f8.chunk.css.map → 8725.b4337873.chunk.css.map} +1 -1
  55. package/build/static/css/931.37150336.chunk.css +2 -0
  56. package/build/static/css/{931.7d24c94f.chunk.css.map → 931.37150336.chunk.css.map} +1 -1
  57. package/build/static/css/9403.c865ee36.chunk.css +2 -0
  58. package/build/static/css/{9403.49c67ab5.chunk.css.map → 9403.c865ee36.chunk.css.map} +1 -1
  59. package/build/static/css/{9449.6f764a25.chunk.css → 9449.6ae5435f.chunk.css} +2 -2
  60. package/build/static/css/{9449.6f764a25.chunk.css.map → 9449.6ae5435f.chunk.css.map} +1 -1
  61. package/build/static/js/{1153.8e710c6f.chunk.js → 1153.3ad77a2f.chunk.js} +3 -3
  62. package/build/static/js/{1153.8e710c6f.chunk.js.map → 1153.3ad77a2f.chunk.js.map} +1 -1
  63. package/build/static/js/1454.dca4476a.chunk.js +3 -0
  64. package/build/static/js/{1454.352d8776.chunk.js.map → 1454.dca4476a.chunk.js.map} +1 -1
  65. package/build/static/js/1554.9a79f4e3.chunk.js +3 -0
  66. package/build/static/js/{1554.a434303d.chunk.js.map → 1554.9a79f4e3.chunk.js.map} +1 -1
  67. package/build/static/js/2151.04247a28.chunk.js +2 -0
  68. package/build/static/js/2151.04247a28.chunk.js.map +1 -0
  69. package/build/static/js/2503.ab6c104b.chunk.js +2 -0
  70. package/build/static/js/{2503.b5a9b12a.chunk.js.map → 2503.ab6c104b.chunk.js.map} +1 -1
  71. package/build/static/js/2517.f44f4378.chunk.js +2 -0
  72. package/build/static/js/{2517.00bbfa77.chunk.js.map → 2517.f44f4378.chunk.js.map} +1 -1
  73. package/build/static/js/2615.11d5d5eb.chunk.js +2 -0
  74. package/build/static/js/{2615.a70da127.chunk.js.map → 2615.11d5d5eb.chunk.js.map} +1 -1
  75. package/build/static/js/2716.07a624ca.chunk.js +3 -0
  76. package/build/static/js/{2716.49f89bd4.chunk.js.map → 2716.07a624ca.chunk.js.map} +1 -1
  77. package/build/static/js/2730.565ebb8e.chunk.js +2 -0
  78. package/build/static/js/{2730.5f5f593d.chunk.js.map → 2730.565ebb8e.chunk.js.map} +1 -1
  79. package/build/static/js/{289.b5e9f5e8.chunk.js → 289.4693c328.chunk.js} +2 -2
  80. package/build/static/js/{289.b5e9f5e8.chunk.js.map → 289.4693c328.chunk.js.map} +1 -1
  81. package/build/static/js/{3142.f2e5d0e0.chunk.js → 3142.a3e2dee2.chunk.js} +2 -2
  82. package/build/static/js/{3142.f2e5d0e0.chunk.js.map → 3142.a3e2dee2.chunk.js.map} +1 -1
  83. package/build/static/js/{3174.9ed3d7f2.chunk.js → 3174.a31565fc.chunk.js} +2 -2
  84. package/build/static/js/3174.a31565fc.chunk.js.map +1 -0
  85. package/build/static/js/3178.d0b675e9.chunk.js +2 -0
  86. package/build/static/js/{3178.3641f3c4.chunk.js.map → 3178.d0b675e9.chunk.js.map} +1 -1
  87. package/build/static/js/3245.583c02a8.chunk.js +3 -0
  88. package/build/static/js/{3245.988fdecb.chunk.js.LICENSE.txt → 3245.583c02a8.chunk.js.LICENSE.txt} +3 -3
  89. package/build/static/js/3245.583c02a8.chunk.js.map +1 -0
  90. package/build/static/js/{3333.e7b4ad77.chunk.js → 3333.d2be6c49.chunk.js} +2 -2
  91. package/build/static/js/{3333.e7b4ad77.chunk.js.map → 3333.d2be6c49.chunk.js.map} +1 -1
  92. package/build/static/js/36.2fcea14f.chunk.js +2 -0
  93. package/build/static/js/{36.2c076f0a.chunk.js.map → 36.2fcea14f.chunk.js.map} +1 -1
  94. package/build/static/js/{3843.ad7343db.chunk.js → 3843.0b962059.chunk.js} +2 -2
  95. package/build/static/js/{3843.ad7343db.chunk.js.map → 3843.0b962059.chunk.js.map} +1 -1
  96. package/build/static/js/{398.b0284e64.chunk.js → 398.8b834eb2.chunk.js} +2 -2
  97. package/build/static/js/{398.b0284e64.chunk.js.map → 398.8b834eb2.chunk.js.map} +1 -1
  98. package/build/static/js/4319.33772670.chunk.js +2 -0
  99. package/build/static/js/4319.33772670.chunk.js.map +1 -0
  100. package/build/static/js/{4666.1bbd8001.chunk.js → 4666.b3d498a9.chunk.js} +3 -3
  101. package/build/static/js/{4666.1bbd8001.chunk.js.map → 4666.b3d498a9.chunk.js.map} +1 -1
  102. package/build/static/js/5443.757bfbfd.chunk.js +2 -0
  103. package/build/static/js/{5443.af05bfd2.chunk.js.map → 5443.757bfbfd.chunk.js.map} +1 -1
  104. package/build/static/js/5600.e67c5a6b.chunk.js +2 -0
  105. package/build/static/js/{5600.52eae979.chunk.js.map → 5600.e67c5a6b.chunk.js.map} +1 -1
  106. package/build/static/js/{5996.ac6ffa4b.chunk.js → 5996.355c70a4.chunk.js} +2 -2
  107. package/build/static/js/{5996.ac6ffa4b.chunk.js.map → 5996.355c70a4.chunk.js.map} +1 -1
  108. package/build/static/js/6611.cb64b4f0.chunk.js +2 -0
  109. package/build/static/js/{6611.6be3af66.chunk.js.map → 6611.cb64b4f0.chunk.js.map} +1 -1
  110. package/build/static/js/6779.fa32c841.chunk.js +2 -0
  111. package/build/static/js/{6779.227f480e.chunk.js.map → 6779.fa32c841.chunk.js.map} +1 -1
  112. package/build/static/js/7121.d112afb6.chunk.js +2 -0
  113. package/build/static/js/{7121.da979c4b.chunk.js.map → 7121.d112afb6.chunk.js.map} +1 -1
  114. package/build/static/js/7227.b8cdfde1.chunk.js +3 -0
  115. package/build/static/js/{7227.731f9dee.chunk.js.map → 7227.b8cdfde1.chunk.js.map} +1 -1
  116. package/build/static/js/{8725.8d4b95e0.chunk.js → 8725.adf33d56.chunk.js} +2 -2
  117. package/build/static/js/{8725.8d4b95e0.chunk.js.map → 8725.adf33d56.chunk.js.map} +1 -1
  118. package/build/static/js/931.4d169a3c.chunk.js +2 -0
  119. package/build/static/js/{931.ca44f0ac.chunk.js.map → 931.4d169a3c.chunk.js.map} +1 -1
  120. package/build/static/js/9403.e39960cf.chunk.js +2 -0
  121. package/build/static/js/9403.e39960cf.chunk.js.map +1 -0
  122. package/build/static/js/9449.1c75fb7c.chunk.js +2 -0
  123. package/build/static/js/{9449.5c89782f.chunk.js.map → 9449.1c75fb7c.chunk.js.map} +1 -1
  124. package/build/static/js/{main.0231d836.js → main.f576ae1f.js} +2 -2
  125. package/build/static/js/{main.0231d836.js.map → main.f576ae1f.js.map} +1 -1
  126. package/package.json +1 -1
  127. package/build/static/css/1151.841fca05.chunk.css +0 -2
  128. package/build/static/css/1151.841fca05.chunk.css.map +0 -1
  129. package/build/static/css/1153.382d399c.chunk.css +0 -2
  130. package/build/static/css/1454.c244b0e0.chunk.css +0 -2
  131. package/build/static/css/1554.e3fe8993.chunk.css +0 -2
  132. package/build/static/css/2517.8da70e76.chunk.css +0 -2
  133. package/build/static/css/2517.8da70e76.chunk.css.map +0 -1
  134. package/build/static/css/2716.afb6cca1.chunk.css +0 -2
  135. package/build/static/css/3174.431f88b1.chunk.css +0 -2
  136. package/build/static/css/3178.37c24e6a.chunk.css +0 -2
  137. package/build/static/css/3178.37c24e6a.chunk.css.map +0 -1
  138. package/build/static/css/3333.fa2418e7.chunk.css +0 -2
  139. package/build/static/css/3333.fa2418e7.chunk.css.map +0 -1
  140. package/build/static/css/398.81f13fe8.chunk.css +0 -2
  141. package/build/static/css/398.81f13fe8.chunk.css.map +0 -1
  142. package/build/static/css/4319.c63bb012.chunk.css +0 -2
  143. package/build/static/css/4666.317a4f26.chunk.css +0 -2
  144. package/build/static/css/5443.3d68f4a3.chunk.css +0 -2
  145. package/build/static/css/5443.3d68f4a3.chunk.css.map +0 -1
  146. package/build/static/css/5600.2a386b79.chunk.css +0 -2
  147. package/build/static/css/5600.2a386b79.chunk.css.map +0 -1
  148. package/build/static/css/6779.91d67fb3.chunk.css +0 -2
  149. package/build/static/css/6779.91d67fb3.chunk.css.map +0 -1
  150. package/build/static/css/7121.7142f0c6.chunk.css +0 -2
  151. package/build/static/css/7121.7142f0c6.chunk.css.map +0 -1
  152. package/build/static/css/7227.a5f541be.chunk.css +0 -2
  153. package/build/static/css/931.7d24c94f.chunk.css +0 -2
  154. package/build/static/css/9403.49c67ab5.chunk.css +0 -2
  155. package/build/static/js/1454.352d8776.chunk.js +0 -3
  156. package/build/static/js/1554.a434303d.chunk.js +0 -3
  157. package/build/static/js/2503.b5a9b12a.chunk.js +0 -2
  158. package/build/static/js/2517.00bbfa77.chunk.js +0 -2
  159. package/build/static/js/2615.a70da127.chunk.js +0 -2
  160. package/build/static/js/2716.49f89bd4.chunk.js +0 -3
  161. package/build/static/js/2730.5f5f593d.chunk.js +0 -2
  162. package/build/static/js/3174.9ed3d7f2.chunk.js.map +0 -1
  163. package/build/static/js/3178.3641f3c4.chunk.js +0 -2
  164. package/build/static/js/3245.988fdecb.chunk.js +0 -3
  165. package/build/static/js/3245.988fdecb.chunk.js.map +0 -1
  166. package/build/static/js/36.2c076f0a.chunk.js +0 -2
  167. package/build/static/js/4319.ca0361b0.chunk.js +0 -2
  168. package/build/static/js/4319.ca0361b0.chunk.js.map +0 -1
  169. package/build/static/js/5443.af05bfd2.chunk.js +0 -2
  170. package/build/static/js/5600.52eae979.chunk.js +0 -2
  171. package/build/static/js/5698.31a5b536.chunk.js +0 -2
  172. package/build/static/js/5698.31a5b536.chunk.js.map +0 -1
  173. package/build/static/js/6611.6be3af66.chunk.js +0 -2
  174. package/build/static/js/6779.227f480e.chunk.js +0 -2
  175. package/build/static/js/7121.da979c4b.chunk.js +0 -2
  176. package/build/static/js/7227.731f9dee.chunk.js +0 -3
  177. package/build/static/js/931.ca44f0ac.chunk.js +0 -2
  178. package/build/static/js/9403.918493bf.chunk.js +0 -2
  179. package/build/static/js/9403.918493bf.chunk.js.map +0 -1
  180. package/build/static/js/9449.5c89782f.chunk.js +0 -2
  181. /package/build/static/js/{1153.8e710c6f.chunk.js.LICENSE.txt → 1153.3ad77a2f.chunk.js.LICENSE.txt} +0 -0
  182. /package/build/static/js/{1454.352d8776.chunk.js.LICENSE.txt → 1454.dca4476a.chunk.js.LICENSE.txt} +0 -0
  183. /package/build/static/js/{1554.a434303d.chunk.js.LICENSE.txt → 1554.9a79f4e3.chunk.js.LICENSE.txt} +0 -0
  184. /package/build/static/js/{2716.49f89bd4.chunk.js.LICENSE.txt → 2716.07a624ca.chunk.js.LICENSE.txt} +0 -0
  185. /package/build/static/js/{4666.1bbd8001.chunk.js.LICENSE.txt → 4666.b3d498a9.chunk.js.LICENSE.txt} +0 -0
  186. /package/build/static/js/{7227.731f9dee.chunk.js.LICENSE.txt → 7227.b8cdfde1.chunk.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[3333,1151,9034],{10419:(e,t,s)=>{s.r(t),s.d(t,{HtmlPreview:()=>f,ImagePreview:()=>L,OSSFilePreview:()=>C,OfficePreview:()=>g,PdfPreview:()=>S,TextPreview:()=>b,UnknownPreview:()=>F,default:()=>R});var r=s(63114),a=s.n(r),n=s(73884),c=s(13050),o=s(83136),l=s.n(o);const i="style_container__9Fu-3__oxjro",d="style_loading__r3aiE__oxjro",m="style_text-outer__TzhuG__oxjro",u="style_error__wSaxt__oxjro";var h=s(87558),x=s(70579);const p=(0,h.createWithFetch)({transformResponse:e=>{let{data:t}=e;return{data:{code:200,results:t}}}})((e=>{let{data:t}=e;const s=(0,n.useRef)(null);return(0,n.useEffect)((()=>{const e=(new DOMParser).parseFromString(t,"text/html");e.querySelectorAll("script").forEach((e=>{e.parentElement.removeChild(e)}));const r=(0,c.getPublicPath)("components-core")+"/iframeResizer.contentWindow.js",a=document.createElement("script");a.src=r,e.head.appendChild(a);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",e.head.appendChild(n),s.current.srcdoc=e.documentElement.outerHTML}),[t]),(0,n.useEffect)((()=>{a().iframeResize({checkOrigin:!1},s.current)}),[]),(0,x.jsx)("iframe",{title:"\u7b80\u5386\u9884\u89c8",frameBorder:"0",width:"100%",ref:s})})),f=e=>{let{className:t,url:s,maxWidth:r}=e;return(0,x.jsx)("div",{className:l()(t,i),style:{maxWidth:r},children:(0,x.jsx)(p,{url:s})})};var j=s(76329);const v=(0,h.createWithFetch)({cache:"office-preview"})((e=>{let{data:t,className:s,...r}=e;const{data:a}=t;return a.map((e=>{let{url:t}=e;const a=T(t);return(0,n.createElement)(a,{...r,url:t,key:t,className:s})}))})),g=e=>{let{id:t,apis:s,className:r,...a}=e;const{apis:n}=(0,j.usePreset)(),c=Object.assign({},n,s);return(0,x.jsx)(v,{...a,...c.previewOffice,data:{id:t},className:r})};var _=s(55199),N=s(39165),w=(s(71975),s(36));const P=(0,n.memo)((e=>{let{url:t,maxWidth:s,scale:r,rotate:a,className:o}=e;const[m,u]=(0,n.useState)(0);N.pdfjs.GlobalWorkerOptions.workerSrc=(0,c.getPublicPath)("components-core")+"/pdfjs/build/pdf.worker.js";const[h,p]=(0,n.useState)(s),f=(0,w.useResize)((()=>{f.current&&f.current.clientWidth&&p(Math.min(f.current.clientWidth,s))}));return(0,x.jsx)("div",{ref:f,className:l()(o,i),style:{maxWidth:s},children:(0,x.jsx)(N.Document,{file:{url:t},options:{standardFontDataUrl:(0,c.getPublicPath)("components-core")+"/pdfjs/standard_fonts/",cMapUrl:(0,c.getPublicPath)("components-core")+"/pdfjs/cmaps/",cMapPacked:!0},error:"PDF\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",loading:(0,x.jsx)("div",{className:d,children:(0,x.jsx)(_.Spin,{})}),noData:"\u672a\u6307\u5b9aPDF\u6587\u4ef6",onLoadSuccess:e=>{let{numPages:t}=e;u(t),console.log("onLoadSuccess")},onLoadError:e=>{console.log("onLoadError",e)},onSourceError:e=>{console.log("onSourceError",e)},children:(0,x.jsx)(_.Space,{direction:"vertical",children:m>=1&&Array.from(new Array(m),((e,t)=>(0,x.jsx)(N.Page,{className:"preview-item",scale:r/100,rotate:a,pageNumber:t+1,width:h,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:"\u672a\u6307\u5b9a\u9875\u9762"},"page_".concat(t))))})})})}));P.defaultProps={autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200};const S=P;var y=s(91409),E=s.n(y),W=s(89946),k=s.n(W);const b=e=>{let{url:t,className:s,maxWidth:r}=e;const[a,c]=(0,n.useState)(""),[o,h]=(0,n.useState)(!0),[p,f]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{k().get(t).then((e=>{let{data:t}=e;c(t),h(!1)}),(()=>{h(!1),f(!0)}))}),[t]),(0,x.jsxs)("div",{className:l()(s,i),style:{maxWidth:r},children:[o?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(_.Spin,{})}):null,(0,x.jsx)("div",{className:m,children:p?(0,x.jsx)("div",{className:u,children:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)(E(),{text:a})})]})},F=e=>{let{maxWidth:t}=e;return(0,x.jsx)("div",{className:i,style:{maxWidth:t},children:(0,x.jsx)("div",{className:m,children:(0,x.jsx)(_.Result,{status:"500",title:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",subTitle:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8"})})})},L=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[o,m]=(0,n.useState)(!0),[h,p]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=new Image;e.src=t;const s=()=>{m(!1)},r=()=>{m(!1),p(!0)};return e.addEventListener("load",s),e.addEventListener("error",r),()=>{e.removeEventListener("load",s),e.removeEventListener("error",r)}}),[t,s,r]),(0,x.jsxs)("div",{className:l()(a,i),style:{maxWidth:c},children:[o?(0,x.jsx)("div",{className:d,children:(0,x.jsx)(_.Spin,{})}):null,h?(0,x.jsx)("div",{className:u,children:"\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}):(0,x.jsx)("img",{src:t,alt:"\u7b80\u5386\u9884\u89c8"})]})},D=e=>{const t=(e||"").split("?")[0].toLowerCase();return/.txt$/.test(t)?"txt":/.pdf$/.test(t)?"pdf":/.(png|jpg|jpeg)$/.test(t)?"image":/.(html|htm)$/.test(t)?"html":/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(t)?"office":"unknown"},O=D,T=e=>({txt:b,pdf:S,image:L,html:f,office:g,unknown:F}[D(e)]);const C=(0,s(97211).A)((e=>{let{data:t,id:s,className:r,...a}=e;const n=T(t);return"office"===O(t)?(0,x.jsx)(g,{...a,id:s,className:r}):(0,x.jsx)(n,{...a,className:r,url:t})})),R=e=>{let{id:t,originName:s,...r}=e;return"office"===O(s)?(0,x.jsx)(g,{...r,id:t,originName:s}):(0,x.jsx)(C,{...r,id:t,originName:s})}},71975:()=>{}}]);
2
- //# sourceMappingURL=3333.e7b4ad77.chunk.js.map
1
+ "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:()=>U,OfficePreview:()=>g,PdfPreview:()=>E,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__qBEUs",d="style_loading__r3aiE__qBEUs",m="style_text-outer__TzhuG__qBEUs",u="style_error__wSaxt__qBEUs";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 E=P;var S=s(91409),y=s.n(S),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)(y(),{text:a})})]})},F=e=>{let{maxWidth:t}=e;return(0,p.jsx)("div",{className:i,style:{maxWidth:t},children:(0,p.jsx)("div",{className:m,children:(0,p.jsx)(_.Result,{status:"500",title:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",subTitle:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8"})})})},L=e=>{let{url:t,scale:s,rotate:r,className:a,maxWidth:c}=e;const[o,m]=(0,n.useState)(!0),[h,x]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=new Image;e.src=t;const s=()=>{m(!1)},r=()=>{m(!1),x(!0)};return e.addEventListener("load",s),e.addEventListener("error",r),()=>{e.removeEventListener("load",s),e.removeEventListener("error",r)}}),[t,s,r]),(0,p.jsxs)("div",{className:l()(a,i),style:{maxWidth:c},children:[o?(0,p.jsx)("div",{className:d,children:(0,p.jsx)(_.Spin,{})}):null,h?(0,p.jsx)("div",{className:u,children:"\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}):(0,p.jsx)("img",{src:t,alt:"\u7b80\u5386\u9884\u89c8"})]})},D=e=>{const t=(e||"").split("?")[0].toLowerCase();return/.txt$/.test(t)?"txt":/.pdf$/.test(t)?"pdf":/.(png|jpg|jpeg)$/.test(t)?"image":/.(html|htm)$/.test(t)?"html":/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(t)?"office":"unknown"},O=D,T=e=>({txt:b,pdf:E,image:L,html:f,office:g,unknown:F}[D(e)]);const U=(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})})),C=e=>{let{id:t,originName:s,...r}=e;return"office"===O(s)?(0,p.jsx)(g,{...r,id:t,originName:s}):(0,p.jsx)(U,{...r,id:t,originName:s})}},71975:()=>{}}]);
2
+ //# sourceMappingURL=3333.d2be6c49.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/3333.e7b4ad77.chunk.js","mappings":"mYACA,QAA4B,gCAA5B,EAA0K,8BAA1K,EAAie,iCAAje,EAA0gB,4B,0BCM1gB,MAAMA,GAAmBC,EAAAA,EAAAA,iBAAgB,CACvCC,kBAAmBC,IAAe,IAAd,KAAEC,GAAMD,EA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AEL,KACHF,GACChD,EAAAA,EAAAA,KAAA,OAAKK,UAAWb,EAAeiB,SAAC,0CAEhCT,EAAAA,EAAAA,KAAA,OAAKX,IAAKiB,EAAKgF,IAAI,+BAEjB,ECrCJC,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__oxjro\",\"container-html\":\"style_container-html__IsNVq__oxjro\",\"html-inner\":\"style_html-inner__S05cI__oxjro\",\"loading\":\"style_loading__r3aiE__oxjro\",\"control-bar\":\"style_control-bar__kTKau__oxjro\",\"scroller\":\"style_scroller__HOq7b__oxjro\",\"outer\":\"style_outer__ntu--__oxjro\",\"file-name\":\"style_file-name__UPbbe__oxjro\",\"file-options\":\"style_file-options__5TE5l__oxjro\",\"scale-input\":\"style_scale-input__JdF1K__oxjro\",\"text-outer\":\"style_text-outer__TzhuG__oxjro\",\"error\":\"style_error__wSaxt__oxjro\",\"text-inner\":\"style_text-inner__jdi-A__oxjro\",\"image-inner\":\"style_image-inner__zTiFU__oxjro\"};","import iFrameResize from \"iframe-resizer\";\nimport { useEffect, useRef } from \"react\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\nimport style from \"./style.module.scss\";\nimport { createWithFetch } from \"@kne/react-fetch\";\n\nconst HtmlInnerPreview = createWithFetch({\n transformResponse: ({ data }) => {\n return {\n data: {\n code: 200,\n results: data,\n },\n };\n },\n})(({ data }) => {\n const ref = useRef(null);\n useEffect(() => {\n const parser = new DOMParser();\n const domDocument = parser.parseFromString(data, \"text/html\");\n domDocument.querySelectorAll(\"script\").forEach((el) => {\n el.parentElement.removeChild(el);\n });\n const scriptPath =\n getPublicPath(\"components-core\") + \"/iframeResizer.contentWindow.js\";\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n domDocument.head.appendChild(script);\n const style = document.createElement(\"style\");\n style.innerText =\n \"html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}\";\n domDocument.head.appendChild(style);\n ref.current.srcdoc = domDocument.documentElement.outerHTML;\n }, [data]);\n useEffect(() => {\n iFrameResize.iframeResize({ checkOrigin: false }, ref.current);\n }, []);\n return <iframe title=\"简历预览\" frameBorder=\"0\" width=\"100%\" ref={ref} />;\n});\n\nconst HtmlPreview = ({ className, url, maxWidth }) => {\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n <HtmlInnerPreview url={url} />\n {/*<iframe\n title=\"简历预览\"\n src={url}\n frameBorder=\"0\"\n width=\"100%\"\n ref={ref}\n onLoad={() => {\n const scriptPath =\n getPublicPath(\"components-core\") +\n \"/iframeResizer.contentWindow.js\";\n if (!ref.current.contentDocument) {\n console.warn(\n `跨域情况无法开启自动高度计算,请将${scriptPath}脚本加入目标页面`\n );\n return;\n }\n const script = document.createElement(\"script\");\n script.src = scriptPath;\n ref.current.contentDocument.head.appendChild(script);\n ref.current.contentDocument.body.style = \"pointer-events: none;\";\n }}\n />*/}\n </div>\n );\n};\n\nexport default HtmlPreview;\n","import { usePreset } from \"@components/Global\";\nimport { createWithFetch } from \"@kne/react-fetch\";\nimport { typeFormatComponent } from \"./typeFormat\";\n\nconst OfficePreviewInner = createWithFetch({\n cache: \"office-preview\",\n})(({ data, className, ...props }) => {\n const { data: fileList } = data;\n return fileList.map(({ url }) => {\n const PreviewComponent = typeFormatComponent(url);\n return (\n <PreviewComponent {...props} url={url} key={url} className={className} />\n );\n });\n});\n\nconst OfficePreview = ({ id, apis: propsApis, className, ...props }) => {\n const { apis: baseApis } = usePreset();\n const apis = Object.assign({}, baseApis, propsApis);\n return (\n <OfficePreviewInner\n {...props}\n {...apis.previewOffice}\n data={{ id }}\n className={className}\n />\n );\n};\n\nexport default OfficePreview;\n","import { memo, useState } from \"react\";\nimport { Space, Spin } from \"antd\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport \"react-pdf/dist/esm/Page/TextLayer.css\";\nimport style from \"./style.module.scss\";\nimport { useResize } from \"@components/Common\";\nimport { getPublicPath } from \"@kne/remote-loader\";\nimport classnames from \"classnames\";\n\nconst PdfPreview = memo(({ url, maxWidth, scale, rotate, className }) => {\n const [numPages, setNumPages] = useState(0);\n pdfjs.GlobalWorkerOptions.workerSrc =\n getPublicPath(\"components-core\") + \"/pdfjs/build/pdf.worker.js\";\n const [width, setWidth] = useState(maxWidth);\n const ref = useResize(() => {\n if (ref.current && ref.current.clientWidth) {\n setWidth(Math.min(ref.current.clientWidth, maxWidth));\n }\n });\n\n return (\n <div\n ref={ref}\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth: maxWidth,\n }}\n >\n <Document\n file={{ url }}\n options={{\n standardFontDataUrl:\n getPublicPath(\"components-core\") + \"/pdfjs/standard_fonts/\",\n cMapUrl: getPublicPath(\"components-core\") + \"/pdfjs/cmaps/\",\n cMapPacked: true,\n }}\n error=\"PDF文件加载失败\"\n loading={\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n }\n noData=\"未指定PDF文件\"\n onLoadSuccess={({ numPages }) => {\n setNumPages(numPages);\n console.log(\"onLoadSuccess\");\n }}\n onLoadError={(props) => {\n console.log(\"onLoadError\", props);\n }}\n onSourceError={(props) => {\n console.log(\"onSourceError\", props);\n }}\n >\n <Space direction=\"vertical\">\n {numPages >= 1 &&\n Array.from(new Array(numPages), (el, index) => (\n <Page\n key={`page_${index}`}\n className=\"preview-item\"\n scale={scale / 100}\n rotate={rotate}\n pageNumber={index + 1}\n width={width}\n loading={null}\n renderAnnotationLayer={false}\n renderTextLayer={true}\n noData=\"未指定页面\"\n />\n ))}\n </Space>\n </Document>\n </div>\n );\n});\n\nPdfPreview.defaultProps = {\n autoSize: true,\n renderTextLayer: false,\n scale: 100,\n rotate: 0,\n maxWidth: 1200,\n};\n\nexport default PdfPreview;\n","import { useState, useEffect } from \"react\";\nimport TextEscape from \"@kne/react-text-escape\";\nimport axios from \"axios\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst TextPreview = ({ url, className, maxWidth }) => {\n const [text, setText] = useState(\"\");\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n axios.get(url).then(\n ({ data }) => {\n setText(data);\n setLoading(false);\n },\n () => {\n setLoading(false);\n setError(true);\n }\n );\n }, [url]);\n\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n <div className={style[\"text-outer\"]}>\n {error ? (\n <div className={style[\"error\"]}>文件加载失败</div>\n ) : (\n <TextEscape text={text} />\n )}\n </div>\n </div>\n );\n};\n\nexport default TextPreview;\n","import { Result } from \"antd\";\nimport style from \"./style.module.scss\";\n\nconst UnknownPreview = ({ maxWidth }) => {\n return (\n <div\n className={style[\"container\"]}\n style={{\n maxWidth,\n }}\n >\n <div className={style[\"text-outer\"]}>\n <Result\n status=\"500\"\n title=\"不支持的文件类型\"\n subTitle=\"系统不支持该文件类型预览,请下载到本地后进行预览\"\n />\n </div>\n </div>\n );\n};\n\nexport default UnknownPreview;\n","import { useEffect, useState } from \"react\";\nimport style from \"./style.module.scss\";\nimport { Spin } from \"antd\";\nimport classnames from \"classnames\";\n\nconst ImagePreview = ({ url, scale, rotate, className, maxWidth }) => {\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(false);\n useEffect(() => {\n const image = new Image();\n image.src = url;\n const handlerLoad = () => {\n setLoading(false);\n };\n\n const handlerError = () => {\n setLoading(false);\n setError(true);\n };\n\n image.addEventListener(\"load\", handlerLoad);\n image.addEventListener(\"error\", handlerError);\n return () => {\n image.removeEventListener(\"load\", handlerLoad);\n image.removeEventListener(\"error\", handlerError);\n };\n }, [url, scale, rotate]);\n return (\n <div\n className={classnames(className, style[\"container\"])}\n style={{\n maxWidth,\n }}\n >\n {loading ? (\n <div className={style[\"loading\"]}>\n <Spin />\n </div>\n ) : null}\n {error ? (\n <div className={style[\"error\"]}>图片加载失败</div>\n ) : (\n <img src={url} alt=\"简历预览\" />\n )}\n </div>\n );\n};\n\nexport default ImagePreview;\n","import HtmlPreview from \"./HtmlPreview\";\nimport OfficePreview from \"./OfficePreview\";\nimport PdfPreview from \"./PdfPreview\";\nimport TextPreview from \"./TextPreview\";\nimport UnknownPreview from \"./UnknownPreview\";\nimport ImagePreview from \"./ImagePreview\";\n\nconst typeFormat = (url) => {\n const path = (url || \"\").split(\"?\")[0];\n const _path = path.toLowerCase();\n if (/.txt$/.test(_path)) {\n return \"txt\";\n }\n if (/.pdf$/.test(_path)) {\n return \"pdf\";\n }\n if (/.(png|jpg|jpeg)$/.test(_path)) {\n return \"image\";\n }\n if (/.(html|htm)$/.test(_path)) {\n return \"html\";\n }\n if (/.(doc|docx|xls|xlsx|ppt|pptx)$/.test(_path)) {\n return \"office\";\n }\n return \"unknown\";\n};\n\nexport default typeFormat;\n\nexport const typeFormatComponent = (url) => {\n const mapping = {\n txt: TextPreview,\n pdf: PdfPreview,\n image: ImagePreview,\n html: HtmlPreview,\n office: OfficePreview,\n unknown: UnknownPreview,\n };\n\n return mapping[typeFormat(url)];\n};\n","import withOSSFile from \"@common/hocs/withOSSFile\";\nimport typeFormat, { typeFormatComponent } from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\n\nconst OSSFilePreview = withOSSFile(({ data, id, className, ...props }) => {\n const PreviewComponent = typeFormatComponent(data);\n if (typeFormat(data) === \"office\") {\n return <OfficePreview {...props} id={id} className={className} />;\n }\n return <PreviewComponent {...props} className={className} url={data} />;\n});\n\nexport default OSSFilePreview;\n","import typeFormat from \"./typeFormat\";\nimport OfficePreview from \"./OfficePreview\";\nimport OSSFilePreview from \"./OSSFilePreview\";\n\nconst FilePreview = ({ id, originName, ...props }) => {\n if (typeFormat(originName) === \"office\") {\n return <OfficePreview {...props} id={id} originName={originName} />;\n }\n return <OSSFilePreview {...props} id={id} originName={originName} />;\n};\n\nexport default FilePreview;\n"],"names":["HtmlInnerPreview","createWithFetch","transformResponse","_ref","data","code","results","_ref2","ref","useRef","useEffect","domDocument","DOMParser","parseFromString","querySelectorAll","forEach","el","parentElement","removeChild","scriptPath","getPublicPath","script","document","createElement","src","head","appendChild","style","innerText","current","srcdoc","documentElement","outerHTML","iFrameResize","checkOrigin","_jsx","title","frameBorder","width","_ref3","className","url","maxWidth","classnames","children","OfficePreviewInner","cache","props","fileList","map","PreviewComponent","typeFormatComponent","_createElement","key","id","apis","propsApis","baseApis","usePreset","Object","assign","previewOffice","PdfPreview","memo","scale","rotate","numPages","setNumPages","useState","pdfjs","GlobalWorkerOptions","workerSrc","setWidth","useResize","clientWidth","Math","min","Document","file","options","standardFontDataUrl","cMapUrl","cMapPacked","error","loading","Spin","noData","onLoadSuccess","console","log","onLoadError","onSourceError","Space","direction","Array","from","index","Page","pageNumber","renderAnnotationLayer","renderTextLayer","concat","defaultProps","autoSize","text","setText","setLoading","setError","axios","then","_jsxs","TextEscape","Result","status","subTitle","image","Image","handlerLoad","handlerError","addEventListener","removeEventListener","alt","typeFormat","_path","split","toLowerCase","test","txt","TextPreview","pdf","ImagePreview","html","HtmlPreview","office","OfficePreview","unknown","UnknownPreview","withOSSFile","originName","OSSFilePreview"],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/3333.d2be6c49.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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,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__qBEUs\",\"container-html\":\"style_container-html__IsNVq__qBEUs\",\"html-inner\":\"style_html-inner__S05cI__qBEUs\",\"loading\":\"style_loading__r3aiE__qBEUs\",\"control-bar\":\"style_control-bar__kTKau__qBEUs\",\"scroller\":\"style_scroller__HOq7b__qBEUs\",\"outer\":\"style_outer__ntu--__qBEUs\",\"file-name\":\"style_file-name__UPbbe__qBEUs\",\"file-options\":\"style_file-options__5TE5l__qBEUs\",\"scale-input\":\"style_scale-input__JdF1K__qBEUs\",\"text-outer\":\"style_text-outer__TzhuG__qBEUs\",\"error\":\"style_error__wSaxt__qBEUs\",\"text-inner\":\"style_text-inner__jdi-A__qBEUs\",\"image-inner\":\"style_image-inner__zTiFU__qBEUs\"};","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,s)=>{s.d(t,{A:()=>n});s(73884);const n=s.p+"static/media/defaultAvatar.b1f2a8046cc7bee36d9a404ce6a0a1d7.svg"},93761:(e,t,s)=>{s.d(t,{qn:()=>k,TM:()=>G,LH:()=>q,Ay:()=>F,NY:()=>O,DF:()=>M});var n=s(30509),a=s(25438),l=s(55199),r=s(27047),o=s(83136),i=s.n(o),c=s(64671),d=s(73884),u=s(21485),p=s(56434),m=s.n(p),h=s(15797),_=s.n(h),g=s(33097),f=s.n(g);const x="style_address__DIuRX__qBEUs",y="style_is-popup__tqVvp__qBEUs",v="style_title__FAe12__qBEUs",C="style_scroll-box__JWiDl__qBEUs",j="style_scroll-plus-box__lidEW__qBEUs",b="style_content__lAARZ__qBEUs",A="style_col-left__WPfeS__qBEUs",N="style_col-right__z0e9-__qBEUs";var S=s(87558);const w=e=>({"en-US":()=>s.e(3691).then(s.bind(s,83691)),"zh-CN":()=>s.e(2253).then(s.bind(s,32253))}[e]());var E=s(58609),B=s(70579);const U=n.A.useContext,q=e=>{let{city:t,province:s,country:n}=e;const a=_()((()=>{const e=[];return["gangaotai","municipality"].forEach((s=>{e.push(...t.relations[s])})),["provinces","continents"].forEach((s=>{t.relations[s].forEach((s=>{e.push(s),e.push(...t.relations[s])}))})),e.map((e=>t.list[e]))}));return{getCity:_()((e=>{const s=t.list[e];return s?{city:s,parent:s.parentCode?t.list[s.parentCode]:null}:{city:null,parent:null}})),getChinaHotCities:_()((()=>t.relations[2].map((e=>t.list[e])))),getChinaCities:_()((()=>["2",...s.relations.municipality,...s.relations.provinces,"gangaotai"].map((e=>Object.assign({id:e},t.list[e]))))),getCountries:_()((()=>["1",...n.relations.continents].map((e=>Object.assign({id:e},n.list[e]))))),getList:_()(((e,a)=>{const{showChinaQuan:l,showForeignQuan:r}=Object.assign({},a);if("gangaotai"===e)return s.relations.gangaotai.map((e=>t.list[e]));const o=Object.assign({},t.list[e]);if(s.relations.municipality.indexOf(e)>-1)return o.name="".concat(l?"\u5168":"")+o.name,[o];const i=t.relations[e].map((e=>t.list[e]));return s.relations.provinces.indexOf(e)>-1&&l&&(o.name="\u5168"+o.name,i.splice(0,0,o)),n.relations.continents.indexOf(e)>-1&&r&&(o.name="\u5168"+o.name,i.splice(0,0,o)),i})),getNationalityList:_()((e=>{let s=m()(t);return"1"===e&&s.relations[1].unshift("410"),"350"===e&&s.relations[350].unshift("410"),s.relations[e].filter((e=>s.list[e])).map((e=>s.list[e]))})),getCityByName:_()((e=>{const t=a();let s;return[t=>t.name===e,t=>t.name===e.replace(/(\u7701|\u5e02)$/,""),t=>0===e.indexOf(t.name)].find((e=>(s=t.find(e),s))),s})),combineCities:_()(((e,s)=>[...s.filter((s=>t.list[s].parentCode!==e&&t.list[e].parentCode!==s&&e!==s)),e])),searchCities:_()((e=>{if(!e)return[];return a().filter((t=>["pinyin","name","enName","spelling"].some((s=>t[s].toUpperCase().indexOf(e.toUpperCase())>-1)))).map((e=>{const s=e.parentCode?t.list[e.parentCode]:null;return{label:s?"".concat(s.name,"\xb7").concat(e.name):e.name,value:e.code}}))}))}},O=(e,t)=>"en-US"===t?f()(e,"enName"):f()(e,"name"),P={cache:"CITY_DATA",isLocal:!0,ttl:864e5,loader:()=>s.e(7820).then(s.t.bind(s,37820,19)).then((e=>e.__esModule?e.default:e))},I=e=>{let{value:t,setValue:s}=e;const{fetchApi:n,props:o}=U(),[p,m]=(0,d.useState)(""),[h,_]=(0,d.useState)("2"),{formatMessage:g}=(0,E.useIntl)({moduleName:"AddressSelect"}),{locale:f}=(0,r.A)(),{getCity:S,getChinaCities:w,getCountries:P,getList:I,searchCities:L}=(0,d.useMemo)((()=>q(n.data)),[n.data]),k=e=>{if(o.single)return void s([e]);const n=t.slice(0),a=n.indexOf(e);a>-1?n.splice(a,1):n.push(e),s(n)},M=p&&(0,B.jsx)(u.A,{className:j,children:(0,B.jsx)(l.List,{className:a.A.list,size:"small",dataSource:L(p),rowKey:"value",renderItem:e=>(0,B.jsx)(l.List.Item,{className:a.A["list-item"],onClick:()=>{k(e.value),m("")},children:(0,B.jsx)("span",{className:a.A["item-label"],children:e.label})})})});return(0,B.jsxs)("div",{className:i()(x,{[y]:o.isPopup}),children:[(0,B.jsx)(l.Input.Search,{className:i()(a.A["search-input"],{[a.A["is-popup"]]:o.isPopup}),placeholder:o.searchPlaceholder||g({id:"searchCity"}),prefix:(0,B.jsx)(c.default,{type:"icon-sousuo"}),enterButton:(0,B.jsx)(c.default,{type:"icon-sousuo"}),value:p,allowClear:!0,onChange:e=>{const t=e.target.value;m(t)},onSearch:e=>{m(e)}}),(0,B.jsx)("div",{className:b,children:M||(0,B.jsxs)(l.Row,{wrap:!1,children:[(0,B.jsx)(l.Col,{className:A,children:(0,B.jsx)(l.Tabs,{centered:!0,onChange:e=>{_(e)},items:[{key:"2",label:(0,B.jsx)(E.FormattedMessage,{id:"domestic",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5185"}),children:(0,B.jsx)(u.A,{className:C,children:(0,B.jsx)(l.Menu,{selectedKeys:[h],onSelect:e=>{_(e.key)},items:w().map((e=>({label:O(e,f),key:e.id})))})})},{key:"1",label:(0,B.jsx)(E.FormattedMessage,{id:"abroad",moduleName:"AddressSelect",defaultMessage:"\u56fd\u5916"}),children:(0,B.jsx)(u.A,{className:C,children:(0,B.jsx)(l.Menu,{selectedKeys:[h],onSelect:e=>{_(e.key)},items:P().map((e=>({label:O(e,f),key:e.id})))})})}]})}),(0,B.jsxs)(l.Col,{flex:1,className:N,children:[(0,B.jsx)(l.Divider,{className:v,orientation:"left",children:O(S(h).city,f)}),(0,B.jsx)(u.A,{className:C,children:(0,B.jsx)(l.Space,{wrap:!0,children:I(h,{showChinaQuan:o.showChinaQuan,showForeignQuan:o.showForeignQuan}).map((e=>(0,B.jsx)(l.Tag.CheckableTag,{checked:t.indexOf(e.code)>-1,onChange:()=>{k(e.code)},children:O(e,f)},e.code)))})})]})]})})]})},L=e=>(0,B.jsx)(n.A,{...e,children:e=>{let{value:t,setValue:s}=e;return(0,B.jsx)(E.IntlProvider,{moduleName:"AddressSelect",importMessages:w,children:(0,B.jsx)(I,{value:t,setValue:s})})}});L.defaultProps={overlayWidth:"500px",isPopup:!0,api:P,dataFormat:(e,t)=>{let{city:s}=e;const{locale:n}=Object.assign({},t);return{list:Object.values(s.list).map((e=>Object.assign({},e,{value:e.code,label:O(e,n)})))}}};const k=(0,S.withFetch)((e=>{let{name:t,data:s,getAddressApi:n,children:a,...l}=e;const{locale:o}=(0,r.A)(),i=(0,d.useMemo)((()=>q(s)),[s]);return n?a(i):a(i.getCity(t),Object.assign({},l,{locale:o}))}));k.defaultProps={...P,displayParent:!1,children:(e,t)=>{let{city:s,parent:n}=e,{displayParent:a,locale:l}=t;return a&&n?"".concat(O(n,l),"\xb7").concat(O(s,l)):O(s,l)}};const M=e=>{const t=(0,S.withFetch)((t=>{let{data:s,...n}=t;const a=(0,d.useMemo)((()=>q(s)),[s]);return(0,B.jsx)(e,{...n,addressApi:a})}));return t.defaultProps={...P},t};L.AddressEnum=L.Enum=k,L.createAddressApi=q,L.withAddressApi=M,L.getLabelForLocal=O;const F=L;var T=s(10986),R=s.n(T),D=s(78491),z=s.n(D),V=s(20492),W=s(22616),K=s.n(W),H=s(1488),Q=s.n(H);const Z=e=>{const{isPopup:t,size:s,disabled:n,inputPlaceholder:a,onBlur:r,className:o,...i}=e,[c,d]=R()(e),u=["isPopup","searchPlaceholder","placeholder","overlayWidth","api","dataFormat"],{formatMessage:p}=(0,E.useIntl)({moduleName:"Common"}),m=z()((e=>{r&&r(e)}));return(0,B.jsx)("div",{ref:m,children:(0,B.jsxs)(l.Row,{gutter:10,children:[(0,B.jsx)(l.Col,{span:12,children:(0,B.jsx)(F,{...K()(i,u),className:o,disabled:n,single:!0,size:s,value:f()(c,"city"),onChange:e=>{d({city:e,detail:f()(c,"detail")})}})}),(0,B.jsx)(l.Col,{span:12,children:(0,B.jsx)(l.Input,{...Q()(i,u),className:o,placeholder:a||p({id:"pleaseInput"}),disabled:n,size:s,value:f()(c,"detail"),onChange:e=>{d({city:f()(c,"city"),detail:e.target.value})}})})]})})};Z.defaultProps={};const G=(0,E.createWithIntl)({importMessages:V.A,moduleName:"Common"})(Z)},12392:(e,t,s)=>{s.d(t,{Bm:()=>D,Eo:()=>T,NR:()=>A,Ay:()=>z});var n=s(55199),a=s(83136),l=s.n(a),r=s(30509),o=s(25438),i=s(26475),c=s(33097),d=s.n(c),u=s(34677),p=s.n(u);const m="create-list_scroll-loader__zoaS7__qBEUs",h="create-list_is-popup__t3d-G__qBEUs",_="create-list_is-not-full__FXtX1__qBEUs",g="create-list_search-input__tV3vf__qBEUs",f="create-list_left__EXr3i__qBEUs",x="create-list_list-header__3xeJa__qBEUs",y="create-list_is-modal__BMfya__qBEUs";var v=s(73161),C=s(58609),j=s(70579);const b=r.A.useContext,A=e=>{let{renderList:t,defaultProps:s}=e;const a=e=>{let{value:s,setValue:a}=e;const{fetchApi:r,searchText:c,setSearchText:u,props:A,mapping:N}=b(),S=Object.assign({},{paramsType:"data",current:"currentPage",pageSizeName:"perPage",pageSize:20},A.pagination),w=d()(r.requestParams,[S.paramsType,S.current],1),E=d()(r.requestParams,[S.paramsType,S.pageSizeName])||S.pageSize,{formatMessage:B}=(0,C.useIntl)({moduleName:"Common"}),U=A.dataFormat(r.data),{right:q,leftBottom:O,leftSpan:P=24}=A,I=1===s.length&&"all"===s[0];return(0,j.jsxs)(n.Row,{wrap:!1,className:q?l()("is-not-full",_):"",children:[(0,j.jsxs)(n.Col,{span:P,className:l()(f,"advance-select-left"),children:[A.getSearchProps?(0,j.jsx)(v.A,{isPopup:A.isPopup,className:l()(g,o.A["search-input"],{[o.A["is-popup"]]:A.isPopup}),placeholder:A.searchPlaceholder||B({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:l()(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:I?A.allLabel||(0,j.jsx)(C.FormattedMessage,{id:"all",moduleName:"Common"}):"".concat(s.length).concat(A.countUnit||B({id:"items"}))})]}):(0,j.jsx)("div",{}),A.allowSelectAll?(0,j.jsx)("div",{children:(0,j.jsx)(n.Checkbox,{checked:I,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:l()(m,{[h]:A.isPopup}),noMore:!U.total||w*E>=U.total,onLoader:async()=>{console.log("on loader"),await r.loadMore(p()({[S.paramsType]:{[S.pageSizeName]:E,[S.current]:w+1}},A.getSearchProps&&A.getSearchProps(c)),A.mergeList)},children:t({props:A,value:s,setValue:a,list:U.list,itemIsSelected:e=>s.indexOf(e.value)>-1,isSelectedAll:I,onSelect:e=>{if(A.single)return void a([e.value]);const t=s.slice(0),n=t.indexOf(e.value);n>-1?t.splice(n,1):t.push(e.value),a(t)}})}),O&&O({fetchApi:r,value:s,mapping:N})]}),q&&q({value:s,mapping:N,fetchApi:r})]})},c=e=>{let{extra:t,...s}=e;return(0,j.jsx)(r.A,{...s,extra:t,children:e=>{let{value:t,setValue:s}=e;return(0,j.jsx)(a,{value:t,setValue:s})}})};return c.defaultProps=Object.assign({},{isPopup:!0,pagination:{},mergeList:(e,t)=>Object.assign({},t,{pageData:e.pageData.concat(t.pageData)}),dataFormat:e=>({list:e.pageData,total:e.totalCount})},s),c},N="list_list__TGynD__qBEUs",S="list_list-item__WSswf__qBEUs",w="list_is-selected__6Wkgt__qBEUs",E="list_item-label__bYzhe__qBEUs",B="list_item-des__2nsEn__qBEUs",U="list_is-disabled__qxCvO__qBEUs",q="list_is-selected-all__Mp-hG__qBEUs";var O=s(40438),P=s(64671);const I="user_list-inner__V508e__qBEUs",L="user_list-info__y2nWo__qBEUs",k="user_selected-icon__9OQJL__qBEUs",M="user_item-des__o+7UR__qBEUs",F="user_is-selected-all__2q0VZ__qBEUs",T=A({renderList:e=>{let{list:t,onSelect:s,itemIsSelected:a,isSelectedAll:r}=e;return(0,j.jsx)(n.List,{size:"small",className:l()(N,{[q]:r,[F]:r}),dataSource:t,renderItem:e=>{const t=a(e);return(0,j.jsx)(n.List.Item,{className:l()(S,{[w]:t}),onClick:()=>s(e),children:(0,j.jsxs)(n.Row,{wrap:!1,align:"middle",className:I,children:[(0,j.jsx)(n.Col,{children:(0,j.jsx)(O.default.Avatar,{...Object.assign({},e.avatar),size:40,gender:"M"})}),(0,j.jsx)(n.Col,{className:L,flex:1,children:(0,j.jsxs)(n.Space,{direction:"vertical",children:[(0,j.jsx)("span",{className:E,children:e.label}),e.description&&(0,j.jsx)("span",{className:M,children:e.description})]})}),(0,j.jsx)(n.Col,{children:r||t?(0,j.jsx)(P.default,{className:k,type:"icon-gouxuan"}):null})]})})}})}}),R={"is-selected-all":"table_is-selected-all__IwXUY__qBEUs"},D=A({defaultProps:{overlayWidth:"450px"},renderList:e=>{let{props:t,list:s,onSelect:a,value:r,setValue:o,itemIsSelected:i,isSelectedAll:c}=e;return(0,j.jsx)(n.Table,{className:l()(R.list,N,{[q]:c,[R["is-selected-all"]]:c}),size:"small",dataSource:s,columns:t.columns,rowClassName:e=>l()({"ant-table-row-selected":i(e)}),rowKey:t.rowKey||"value",pagination:!1,rowSelection:t.single?null:c?{selectedRowKeys:s.map((e=>{let{value:t}=e;return t})),getCheckboxProps:()=>({disabled:!0})}:{selectedRowKeys:r,onChange:e=>{o(e)}},sticky:!0,onRow:e=>({onClick:()=>a(e)})})}}),z=A({renderList:e=>{let{props:t,list:s,itemIsSelected:a,isSelectedAll:r,onSelect:o}=e;const{listClassName:i="",selectIcon:c=null}=t||{};return(0,j.jsx)(n.List,{className:l()(N,i,{[q]:r}),size:"small",dataSource:s,renderItem:e=>{var s;const i=a(e);return(0,j.jsxs)(n.List.Item,{className:l()(S,{[w]:t.single&&i,[U]: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!==(s=null===e||void 0===e?void 0:e.className)&&void 0!==s?s:"",children:[(0,j.jsx)("span",{className:E,children:e.label}),e.description&&(0,j.jsx)("span",{className:B,children:e.description})]})})]}),i&&c]})}})}})},45776:(e,t,s)=>{s.d(t,{yK:()=>q,ON:()=>h,Ay:()=>k});var n=s(30509),a=s(73884),l=s(96418),r=s.n(l),o=s(55199),i=s(64671),c=s(73161),d=s(33097),u=s.n(d),p=s(79686),m=s.n(p);const h=e=>{const t=Array.from(e.values()),s=t.filter((e=>null===e.parentId)),n=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},a=t=>{const s=[],n=t=>{const a=e.get(t);a&&Array.isArray(a.children)&&a.children.length>0&&(s.push(...a.children),a.children.forEach((e=>{n(e.id)})))};return n(t),s},l=(t,s)=>{const n=t=>{const a=e.get(t);return a?s(a)?a:m()(a.parentId)?null:n(a.parentId):null};return n(t)},r=t=>{const n=e.get(t);if(!n)return[];const a=n.parentId;if(m()(a))return s;return e.get(a).children},o=(()=>{const e=s=>Array.isArray(s)&&s.length>0?s.map((s=>{const n=t.filter((e=>e.parentId===s.id));return Object.assign({},s,{children:e(n)})})):null;return e(s)})();return{mapping:e,getSelectedQueue:t=>{const s=e.get(t);if(!s)return[];const n=e=>{if(e.children&&e.children.length>0)return n(e.children.find((t=>t.children&&e.children.length>0))||u()(e.children,"0"));const t=a(e.parentId).find((e=>e.children&&e.children.length>0));return t?n(t):e},l=function(t){const s=[t,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]],n=e.get(t);return!n||m()(n.parentId)?s:l(n.parentId,s)},r=n(s);return l(u()(r,"id"))},getAllChildren:a,computedCheckboxStatus:function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(l(t,(e=>s.indexOf(e.id)>-1)))return{checked:!0,indeterminate:!1};const n=((t,n)=>{const a=t=>{const n=e.get(t);return n?(l=n,s.indexOf(l.id)>-1?n:Array.isArray(n.children)&&n.children.length>0?n.children.find((e=>!!a(e.id))):void 0):null;var l};return!!a(t)})(t);return n?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1}},getSiblingNode:r,findInParents:l,setNodeChecked:function(t){const s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),l=t=>{const o=e.get(t);if(!o)return;s.push(t),a(t).forEach((e=>{n(s,e.id)}));const i=r(t),c=i.every((e=>s.indexOf(e.id)>-1));o.parentId&&c&&(i.forEach((e=>{n(s,e.id)})),l(o.parentId))};return l(t),s},setNodeUnchecked:function(t){const s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).slice(0),a=t=>{const l=e.get(t);if(!l)return;if(s.indexOf(l.id)>-1)return void n(s,l.id);const o=r(t);l.parentId&&(o.forEach((e=>{t!==e.id&&s.push(e.id)})),a(l.parentId))};return a(t),s},treeData:o,treeMapping:new Map(o.map((e=>[e.id,e])))}};var _=s(74065),g=s.n(_),f=s(19853),x=s.n(f),y=s(17342),v=s(83136),C=s.n(v);const j={content:"style_content__Hxlt9__qBEUs",columns:"style_columns__FmtPF__qBEUs","content-item":"style_content-item__i6HCO__qBEUs","last-level-area":"style_last-level-area__2y7jQ__qBEUs","is-popup":"style_is-popup__+r3Mn__qBEUs",menu:"style_menu__WZUVE__qBEUs","scroll-plus-box":"style_scroll-plus-box__QcTst__qBEUs","menu-label":"style_menu-label__iGt0Z__qBEUs","menu-item":"style_menu-item__hXHfm__qBEUs","checkbox-hidden":"style_checkbox-hidden__Xpx7J__qBEUs",loading:"style_loading__ZwrVe__qBEUs"};var b=s(87558),A=s(58609),N=s(25438),S=s(70579),w=s(27047);const E=new Map,B=(0,b.withFetch)((e=>{let{data:t,name:s,type:n,cache:l,children:r,getLabel:o,...i}=e;const c=(0,a.useMemo)((()=>new Map(t.map((e=>[e.code,{...e,id:e.code,label:o?o(e):e.chName,parentId:e.parentCode||null}])))),[t,o]).get(s);return E.set("".concat(s,"_").concat(n),c),r(c,i)})),U=e=>{const{locale:t}=(0,w.A)(),s="".concat(t,"_").concat(e.name,"_").concat(e.type),n=E.get(s);return n&&!e.force?e.children(n):(0,S.jsx)(B,{...e})};U.defaultProps={children:e=>u()(e,"label","")};const q=U,O=n.A.useContext,P=(0,b.withFetch)((e=>{let{data:t,computedIsChecked:s,onSelect:n}=e;return(0,S.jsx)(y.A,{className:j["scroll-plus-box"],children:(0,S.jsx)(o.List,{className:N.A.list,size:"small",dataSource:t,rowKey:"value",renderItem:e=>{const t=s(e);return(0,S.jsx)(o.List.Item,{className:C()(N.A["list-item"],{[N.A["is-selected"]]:t}),onClick:()=>n(e,t),children:(0,S.jsx)("span",{className:N.A["item-label"],children:e.label})})}})})})),I=e=>{let{value:t,setValue:s,size:n,selectLevel:l}=e;const{fetchApi:d,props:p}=O(),[m,_]=(0,a.useState)(""),f=r()(p.dataFormat),{formatMessage:v}=(0,A.useIntl)({moduleName:"Common"}),b=d.data,w=(0,a.useMemo)((()=>new Map(f(b).list.map((e=>[e.value,e])))),[b,f]),E=(0,a.useMemo)((()=>h(w)),[w]),B=(0,a.useRef)({});B.current={createMergeTree:p.createMergeTree,loadMore:d.loadMore,openLoadData:p.openLoadData,parentIdKey:p.parentIdKey,treeUtils:E};const[U,q]=(0,a.useState)((()=>{const e=t.find((e=>!!w.get(e)));return E.getSelectedQueue(e||u()(d.data.find((e=>e.children&&e.children.length>0)),"id")||u()(d.data,"[0].id"),w)}));(0,a.useEffect)((()=>{const{openLoadData:e,loadMore:t,parentIdKey:s,createMergeTree:n,treeUtils:a}=B.current;if(!e)return;const l=w.get(g()(U));if(!l)return;const r=a.getSelectedQueue(l.id);x()(U,r)?l.hasOwnProperty("children")||t({data:{[s]:l.id}},n(l.id)):q(r)}),[U,w]);const I=(e,a)=>{const l=(()=>{if(p.onlyAllowLastLevel&&e){const e=t.slice(0);return e.push(a),e}if(p.onlyAllowLastLevel){const e=t.slice(0);return e.splice(t.indexOf(a),1),e}return e?E.setNodeChecked(a,t):E.setNodeUnchecked(a,t)})();l.length>n?o.message.error(v({id:"maxSelectedCount"},{count:n})):s(p.single&&l.length>0?[g()(l)]:l)},L=e=>{const t=w.get(e);return!(!p.openLoadData||t.hasOwnProperty("children"))||t.children&&t.children.length>0},k=!p.openLoadData&&"function"===typeof p.onSearch,M=k&&m&&(0,S.jsx)(P,{data:{searchText:m},loader:e=>{let{data:t}=e;return p.onSearch(t.searchText,{mapping:w})},computedIsChecked:e=>t.indexOf(e.id)>-1,onSelect:(e,t)=>{I(!t,e.id),!t&&q(E.getSelectedQueue(e.id,w)),_("")}});return(0,S.jsxs)("div",{className:C()(j.content,{[j["is-popup"]]:p.isPopup,[j["has-search"]]:k}),style:{"--menu-item-width":p.menuItemWidth},children:[k&&(0,S.jsx)(c.A,{isPopup:p.isPopup,className:C()(N.A["search-input"],{[N.A["is-popup"]]:p.isPopup}),placeholder:p.searchPlaceholder||v({id:"search"}),value:m,onSearch:e=>{_(e)}}),M||(0,S.jsx)("div",{children:(0,S.jsx)(y.A,{className:j.scroller,options:{autoHide:!1},children:(0,S.jsxs)("div",{className:j.columns,children:[U.map(((e,s)=>{const n=w.get(e),r=E.getSiblingNode(e),c=!L(null===n||void 0===n?void 0:n.id)&&s>0;return(0,S.jsx)(y.A,{className:C()(j["content-item"],{[j["last-level-area"]]:c}),children:c?(0,S.jsx)(o.Space,{wrap:!0,children:r.map((e=>(0,a.createElement)(o.Checkbox,{...E.computedCheckboxStatus(e.id,t),disabled:l>1&&(t.indexOf(e.parentCode)>-1||t.indexOf(e.code.slice(0,3))>-1),key:e.id,onChange:t=>I(t.target.checked,e.id)},e.label)))}):(0,S.jsx)(o.Menu,{className:C()(j.menu),onSelect:e=>{const s=w.get(e.key);if(s)if(L(s.id))q(E.getSelectedQueue(s.id,w));else{const{checked:e}=E.computedCheckboxStatus(s.id,t);I(!e,s.id)}},selectedKeys:s===U.length-1?[]:U,items:r.map((e=>({key:e.id,label:(0,S.jsxs)(o.Space,{className:C()(j["menu-item"],{[j["checkbox-hidden"]]:p.onlyAllowLastLevel&&L(e.id)}),children:[!p.onlyAllowLastLevel&&(0,S.jsx)(o.Checkbox,{...E.computedCheckboxStatus(e.id,t),disabled:l>1&&t.indexOf(e.parentCode)>-1,onChange:t=>I(t.target.checked,e.id)}),(0,S.jsx)("div",{className:j["menu-label"],children:e.label}),L(e.id)&&(0,S.jsx)(i.default,{className:j["menu-item-icon"],type:"icon-arrow-thin-right",size:12})]})})))})},u()(r,"[0].id",s))})),d.isComplete?null:(0,S.jsx)("div",{className:j.loading,children:(0,S.jsx)(o.Spin,{size:"small"})})]})})})]})},L=e=>{let{maxLength:t,nodeFormat:s,dataFormat:a,...l}=e;return(0,S.jsx)(n.A,{...l,dataFormat:e=>a(e,s),children:e=>{let{value:s,setValue:n}=e;return(0,S.jsx)(I,{...l,size:t,value:s,setValue:n})}})};L.defaultProps={maxLength:Number.MAX_VALUE,size:"middle",isPopup:!0,overlayWidth:"460px",menuItemWidth:"180px",openLoadData:!1,onlyAllowLastLevel:!1,parentIdKey:"id",onSearch:(e,t)=>{let{mapping:s}=t;return Array.from(s.values()).filter((t=>t.label.indexOf(e)>-1))},dataFormat:(e,t)=>{const s=(e,n)=>{const a=[];return a.push(...(e||[]).map((e=>("function"===typeof t&&Object.assign(e,t(e)),e.children&&e.children.length>0&&a.push(...s(e.children,e.id)),Object.assign({},e,{value:e.id,parentId:n}))))),a};return{list:s(e,null)}},createMergeTree:e=>(t,s)=>{const n=t=>t.map((t=>t.id===e?Object.assign({},t,{children:s&&s.map((t=>Object.assign({},t,{parentId:e})))}):Array.isArray(t.children)&&t.children.length>0?Object.assign({},t,{children:n(t.children)}):t));return n(t)}};const k=L},41654:(e,t,s)=>{s.d(t,{A:()=>m,K:()=>p});var n=s(45776),a=s(27047),l=s(33097),r=s.n(l),o=s(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c=()=>s.e(719).then(s.t.bind(s,10719,19)).then((e=>e.__esModule?e.default:e)),d={cache:"FUNCTION_DATA",isLocal:!0,ttl:864e5,loader:c},u=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.Ay,{...s,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:s}=(0,n.ON)(new Map(t.map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return s}},c.functionData)})};u.defaultProps={overlayWidth:"640px",getSearchProps:e=>({data:{searchText:e}})},u.defaultData=c;const p=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),c=Object.assign({},{functionData:d},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.yK,{...s,...c.functionData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};u.FunctionEnum=u.Enum=p;const m=u},53392:(e,t,s)=>{s.d(t,{A:()=>p,W:()=>u});var n=s(45776),a=s(27047),l=s(33097),r=s.n(l),o=s(70579);const i=(e,t)=>"en-US"===t?r()(e,"enName"):r()(e,"chName"),c={cache:"INDUSTRY_DATA",isLocal:!0,ttl:864e5,loader:()=>s.e(7183).then(s.t.bind(s,57183,19)).then((e=>e.__esModule?e.default:e))},d=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.Ay,{...s,api:Object.assign({},{transformData:e=>{let{data:t}=e;const{treeData:s}=(0,n.ON)(new Map(t.filter((e=>"000"!==e.code)).map((e=>[e.code,{...e,id:e.code,label:i(e,r),parentId:e.parentCode||null}]))));return s}},d.industryData)})};d.defaultProps={overlayWidth:"635px"};const u=e=>{let{apis:t,...s}=e;const{apis:l,locale:r}=(0,a.A)(),d=Object.assign({},{industryData:c},null===l||void 0===l?void 0:l.staticData,t);return(0,o.jsx)(n.yK,{...s,...d.industryData,type:"function",getLabel:e=>i(e,r),transformData:e=>{let{data:t}=e;return t}})};d.IndustryEnum=d.Enum=u;const p=d},26475:(e,t,s)=>{s.d(t,{A:()=>_});var n=s(73884),a=s(55199),l=s(96418),r=s.n(l),o=s(21485),i=s(83136),c=s.n(i),d=s(51941);const u="style_scroller-no-more__EH2J+__qBEUs";var p=s(70579);const m=e=>{let{getScrollerRef:t,loadMore:s,maxFullCount:a}=e;const l=r()(s),o=r()(t);return(0,n.useEffect)((()=>{let e=a;const t=o(),s=async()=>{t.clientHeight===t.scrollHeight&&e>0&&(await l().then((()=>new Promise((e=>{setTimeout(e,500)})))),e--,await s())};s()}),[a,l,o]),null},h=(0,n.forwardRef)(((e,t)=>{let{className:s,noMore:l,onLoader:i,isLoading:h,completeTips:_,maxFullCount:g,children:f}=e;const[x,y]=(0,n.useState)(!1),v=(0,n.useRef)(),C=r()(i),j=(0,n.useRef)(!l&&!h);j.current=!l&&!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",s),onReady:()=>{y(!0)},children:[x&&!h&&!l&&(0,p.jsx)(m,{maxFullCount:g,getScrollerRef:()=>v.current,loadMore:C}),(0,p.jsxs)(a.Space,{direction:"vertical",children:[(0,p.jsx)("div",{children:f}),h?(0,p.jsx)("div",{className:u,children:(0,p.jsx)(a.Spin,{size:"small"})}):null,l&&_?(0,p.jsx)("div",{className:u,children:_}):null]})]})}));h.defaultProps={maxFullCount:3,completeTips:"\u52a0\u8f7d\u5b8c\u6210"};const _=h},73161:(e,t,s)=>{s.d(t,{A:()=>m});var n=s(55199),a=s(83136),l=s.n(a);const r="style_search-input__8aH1G__qBEUs",o="style_is-popup__L0973__qBEUs";var i=s(64671),c=s(73884),d=s(51941),u=s(70579);const p=e=>{let{value:t,debounce:s,onSearch:a,isPopup:p,placeholder:m,className:h,..._}=e;const[g,f]=(0,c.useState)(t),x=(0,c.useRef)(t),y=(0,d.useDebouncedCallback)(a,s);return(0,c.useEffect)((()=>{t!==x.current&&(f(t),x.current=t)}),[t]),(0,u.jsx)(n.Input.Search,{..._,allowClear:!0,className:l()(h,r,{[o]:p}),value:g,placeholder:m,prefix:(0,u.jsx)(i.default,{type:"icon-sousuo"}),enterButton:(0,u.jsx)(i.default,{type:"icon-sousuo"}),onChange:e=>{const t=e.target.value;x.current=t,f(t),y(t)},onSearch:e=>{y(e)}})};p.defaultProps={debounce:500};const m=p},30509:(e,t,s)=>{s.d(t,{A:()=>z});const n={"ant-tag":"style_ant-tag__nNp8-__qBEUs",overlay:"style_overlay__La5mO__qBEUs",input:"style_input__SpJTE__qBEUs","is-disabled":"style_is-disabled__joxdl__qBEUs","input-icon":"style_input-icon__vVd8R__qBEUs",large:"style_large__En6mL__qBEUs",small:"style_small__DY0AQ__qBEUs","input-inner":"style_input-inner__PWy27__qBEUs","input-custom":"style_input-custom__ktsWD__qBEUs","display-content":"style_display-content__hIKo+__qBEUs","overlay-footer-extra":"style_overlay-footer-extra__Q+BiR__qBEUs","selected-tag":"style_selected-tag__zXZZO__qBEUs","selected-tag-list":"style_selected-tag-list__xUIms__qBEUs","selected-tag-inner":"style_selected-tag-inner__Z5gPL__qBEUs","text-inner":"style_text-inner__H24hY__qBEUs",placeholder:"style_placeholder__x0ccE__qBEUs","is-modal":"style_is-modal__JU+uq__qBEUs","overlay-content":"style_overlay-content__WKqp+__qBEUs"};var a=s(74981);const{context:l,useContext:r,Provider:o,Consumer:i}=(0,a.A)();var c=s(73884),d=s(10986),u=s.n(d),p=s(87558),m=s(33097),h=s.n(m),_=s(55199),g=s(83136),f=s.n(g),x=s(3382),y=s(64671),v=s(79686),C=s.n(v),j=s(41740),b=s.n(j),A=s(74065),N=s.n(A),S=s(21485),w=s(96418),E=s.n(w),B=s(77964),U=s(91176),q=s(58609),O=s(20492),P=s(27047),I=s(70579);const L=e=>{let{maxLength:t,single:s,setValue:n,value:a,message:l}=e;return e=>n(!s&&Number.isInteger(t)&&t>0&&e.length>t?(l(),a):e)},k=e=>{let{single:t,value:s,mapping:a,allValue:l,allLabel:r,onClose:o}=e;return s&&Array.isArray(s)&&0!==s.length?t?(0,I.jsx)("span",{className:n["text-inner"],children:h()(a.get(s[0]),"label")||s[0]}):1===s.length&&s[0]===(l||"all")?(0,I.jsx)("span",{className:n["text-inner"],children:r||(0,I.jsx)(q.FormattedMessage,{id:"all",moduleName:"Common"})}):s.map((e=>{const t=a.get(e);return(0,I.jsx)(_.Tag,{className:n["display-tag"],closable:!0,onClose:s=>{s.preventDefault(),o(e,t)},children:(0,I.jsx)("span",{className:n["tag-inner"],children:h()(t,"label")||e})},e)})):null},M=(0,c.forwardRef)(((e,t)=>{let{value:s,onChange:a,extra:l,showSelectedTag:r,renderSelectedContent:o,children:i,...d}=e;const[u,p]=(0,c.useState)(s),m=(0,c.useRef)(s),{formatMessage:h}=(0,q.useIntl)({moduleName:"Common"});m.current=s;const[g,f]=(0,c.useState)(!1),y=e=>{var t;f(e),null===(t=d.onOpenChange)||void 0===t||t.call(d,e)},{message:v}=_.App.useApp(),C=L({maxLength:d.maxLength,single:d.single,setValue:p,value:u,message:()=>v.error(h({id:"maxSelectedCount"},{count:d.maxLength}))});return(0,c.useEffect)((()=>{g&&p(m.current)}),[g]),(0,c.useImperativeHandle)(t,(()=>({modalOpen:()=>{y(!0)},close:()=>{y(!1)}}))),(0,I.jsx)(x.default,{...d,open:g,onConfirm:()=>{a(u)},onClose:()=>{y(!1)},footer:(0,I.jsxs)(_.Space,{direction:"vertical",className:n["overlay-footer"],children:[l&&(0,I.jsx)("div",{className:n["overlay-footer-extra"],children:l}),r&&o({value:u,setValue:C})]}),children:"function"===typeof i?i({value:u,setValue:C}):i})})),F=(0,c.forwardRef)(((e,t)=>{let{value:s,setValue:a,children:l,renderSelectedContent:r,showSelectedTag:o,placement:i,inputContent:d,single:u,extra:p,overlayWidth:m,wrapClassName:h,overlayClassName:g,disabled:x,...y}=e;const[v,C]=(0,c.useState)(!1),j=E()((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,I.jsx)("div",{className:n["input-inner"],children:d}):(0,I.jsx)(_.Popover,{...y,open:v,onOpenChange:j,transitionName:"ant-slide-up",overlayClassName:f()(n.overlay,g),arrow:!1,content:(0,I.jsxs)("div",{style:m?{"--overlay-width":m}:{},className:f()(n["overlay-content"],"over-content"),onClick:e=>{e.stopPropagation()},children:[(0,I.jsx)("div",{className:n["overlay-inner"],children:"function"===typeof l?l({value:s,setValue:e=>{(!u||s[0]!==e[0])&&a(e),u&&j(!1)}}):l}),(o||p)&&(0,I.jsxs)("div",{className:n["overlay-footer"],children:[p&&(0,I.jsx)("div",{className:n["overlay-footer-extra"],children:p}),o&&r({value:s,setValue:a})]})]}),trigger:"click",placement:i,children:(0,I.jsx)("div",{className:n["input-inner"],children:d})})})),T=(0,p.withFetch)((e=>{let{setFetchApi:t,wrapClassName:s,getContentRef:a,...l}=e;const[o,i]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useRef)(null),p=r(),{valueState:m,mapping:h,props:g,inputWidth:x}=p,[v,C]=m,{formatMessage:j}=(0,q.useIntl)({moduleName:"Common"}),{single:b,placement:A,getPopupContainer:N,placeholder:w,isPopup:B,disabled:O,showSelectedTag:P,extra:L,inputContent:T,allowClear:R,overlayClassName:D}=g,z=(0,c.useRef)(l);z.current=l;const V=E()(a);(0,c.useEffect)((()=>{V(B?u:d)}),[B,V]),(0,c.useEffect)((()=>{t(Object.assign({},z.current,{data:l.data,isComplete:l.isComplete}))}),[l.data,t,l.isComplete]);const W=k({single:b,value:v,mapping:h,allValue:g.allValue,allLabel:g.allLabel,onClose:e=>{C((t=>{const s=t.slice(0),n=t.indexOf(e);return n>-1&&s.splice(n,1),s}))}}),K=e=>{let{value:t,setValue:s}=e;return(0,I.jsxs)(_.Space,{className:n["selected-tag"],align:"center",wrap:!1,children:[(0,I.jsxs)("div",{children:[(0,I.jsx)(q.FormattedMessage,{id:"selectedTextAdvanced",moduleName:"Common",defaultMessage:"\u5df2\u9009"}),!g.single&&Number.isInteger(g.maxLength)&&g.maxLength>0?"(".concat(t.length,"/").concat(g.maxLength,")"):"",":"]}),(0,I.jsx)(S.A,{className:n["selected-tag-list"],children:(0,I.jsx)("div",{className:n["selected-tag-inner"],children:k({value:t,mapping:h,allValue:g.allValue,allLabel:g.allLabel,onClose:e=>{s((t=>{const s=t.slice(0),n=t.indexOf(e);return n>-1&&s.splice(n,1),s}))}})})})]})},H=T?T(p):(0,I.jsxs)(_.Space,{className:n["display-content"],onMouseOver:()=>{i(!0)},onMouseOut:()=>{i(!1)},children:[(0,I.jsx)("div",{children:W||(0,I.jsx)("span",{className:n.placeholder,children:w||j({id:"pleaseSelect"})})}),o&&v&&v.length>0&&!O&&R?(0,I.jsx)(y.default,{className:f()(n.close,n["input-icon"],"close","input-icon"),type:"icon-shibai",onClick:e=>{e.stopPropagation(),C([])}}):(0,I.jsx)(y.default,{className:f()(n["input-icon"],"input-icon-arrow","input-icon"),type:"icon-arrow-thin-down"})]});return B?(0,I.jsx)(F,{ref:u,overlayWidth:(0,U.v)(Math.max(x,(0,U.j)(g.overlayWidth))),value:v,setValue:C,single:b,disabled:O,inputContent:H,onOpenChange:g.onOpenChange,overlayClassName:D,extra:"function"===typeof L?L({close:()=>u.current.close(),context:p}):L,renderSelectedContent:K,showSelectedTag:P,trigger:"click",placement:A,getPopupContainer:N,children:g.children}):(0,I.jsxs)("div",{className:n["input-inner"],onClick:()=>{O||d.current.modalOpen()},children:[(0,I.jsx)(M,{size:g.modalSize,ref:d,single:g.single,maxLength:g.maxLength,onOpenChange:g.onOpenChange,disabledScroller:!0,wrapClassName:f()(n.overlay,n["is-modal"],s),title:g.placeholder||j({id:"pleaseSelect"}),value:v,onChange:C,extra:"function"===typeof L?L({close:()=>d.current.close(),context:p}):L,showSelectedTag:P,renderSelectedContent:K,children:g.children}),H]})})),R=e=>{let{api:t,className:s,displayItems:a,wrapClassName:l,...r}=e;const{locale:i}=(0,P.A)(),[d,p]=(0,c.useState)(""),[m,g]=(0,c.useState)(new Map(a.map((e=>[e.value,e])))),{formatMessage:x}=(0,q.useIntl)({moduleName:"Common"}),[y,v]=(0,c.useState)(0),j=(0,B.A)((e=>{v(e.clientWidth)})),[A,S]=(0,c.useState)({}),{message:w}=_.App.useApp(),E=e=>{const t=e.filter((e=>m.get(e.value)!==e));0!==t.length&&g((e=>{const s=b()(e);return t.forEach((e=>{s.set(e.value,e)})),s}))},U=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||[],E,r.valueType),[O,k]=u()(Object.assign({},r,{onChange:e=>{const t=((e,t,s)=>"all"!==s?e:e.map((e=>t.get(e))).filter((e=>!!e)))(e,m,r.valueType);r.onChange&&r.onChange(r.single?N()(t):t)}},"value"in r?{value:U(r.value)}:{defaultValue:U(r.defaultValue)})),M=L({maxLength:r.maxLength,single:r.single,setValue:k,value:O,message:()=>w.error(x({id:"maxSelectedCount"},{count:r.maxLength}))}),F=(0,c.useRef)(null);return(0,I.jsx)(o,{value:{inputWidth:y,mapping:m,searchText:d,setSearchText:p,appendMapping:E,setItems:e=>{A.setData(e),E(h()(r.dataFormat(e,{locale:i}),"list",[]))},getContentApi:()=>F.current,fetchApi:A,valueState:[O,M],props:r},children:(0,I.jsx)("div",{ref:j,className:f()(n["input".concat(r.inputContent&&"function"===typeof r.inputContent?"-custom":"")],{"select-input-disabled":!!r.disabled},s),children:(0,I.jsx)(T,{...t,wrapClassName:l,loading:null,setFetchApi:S,getContentRef:e=>{e.current&&(F.current=e.current)},onRequestSuccess:e=>{E(h()(r.dataFormat(e,{locale:i}),"list",[])),t.onRequestSuccess&&t.onRequestSuccess(e)}})})})};R.defaultProps={displayItems:[],extra:null,api:{loader:()=>[]},dataFormat:e=>({list:e}),placement:"bottomLeft",showSelectedTag:!0,allowClear:!0};const D=(0,q.createWithIntl)({importMessages:O.A,moduleName:"Common"})(R);D.useContext=r;const z=D},17342:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(8762),a=s.n(n);s(46733);const l=a()},21485:(e,t,s)=>{s.d(t,{A:()=>c});var n=s(73884),a=s(44418),l=s.n(a),r=s(96418),o=s.n(r),i=s(70579);const c=(0,n.forwardRef)(((e,t)=>{let{children:s,onScroll:a,options:r,onReady:c,...d}=e;const u=(0,n.useRef)(null),p=(0,n.useRef)(null),m=(0,n.useRef)(r),h=o()(c),_=o()(a);return(0,n.useImperativeHandle)(t,(()=>p.current)),(0,n.useEffect)((()=>{const e=new(l())(u.current,m.current);return p.current=e.getScrollElement(),p.current.addEventListener("scroll",_),h(p.current),()=>{p.current.removeEventListener("scroll",_)}}),[_,h,s]),(0,i.jsx)("div",{...d,ref:u,children:s})}))},89319:(e,t,s)=>{s.d(t,{A:()=>u});var n=s(55199),a=s(10986),l=s.n(a),r=s(57469),o=s.n(r),i=s(20492),c=s(58609),d=s(70579);const u=(0,c.createWithIntl)({importMessages:i.A,moduleName:"Common"})((e=>{let{...t}=e;const{formatMessage:s}=(0,c.useIntl)({moduleName:"Common"}),a=new Map([["date",s({id:"customTime"})],["month",s({id:"monthly"})],["week",s({id:"weekly"})]]),[r,i]=l()(t);return(0,d.jsxs)(n.Space.Compact,{children:[(0,d.jsx)(n.Select,{style:{width:"120px"},value:(null===r||void 0===r?void 0:r.type)||"date",onChange:e=>{i((t=>{var s;return{value:null!==t&&void 0!==t&&null!==(s=t.value)&&void 0!==s&&s.length?[o()(t.value[0]).startOf(e||"date"),o()(t.value[1]).endOf(e||"date")]:null,type:e||"date"}}))},options:Array.from(a).map((e=>{let[t,s]=e;return{label:s,value:t}}))}),(0,d.jsx)(n.DatePicker.RangePicker,{...t,picker:(null===r||void 0===r?void 0:r.type)||"date",value:Array.isArray(null===r||void 0===r?void 0:r.value)&&2===r.value.length&&r.value.map((e=>e&&o()(e))),onChange:e=>{i((t=>(console.log(Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]})),Object.assign({type:"date"},t,{value:e&&[e[0]&&new Date(e[0].startOf((null===t||void 0===t?void 0:t.type)||"date").valueOf()),e[1]&&new Date(e[1].endOf((null===t||void 0===t?void 0:t.type)||"date").valueOf())]}))))}})]})}))},20492:(e,t,s)=>{s.d(t,{A:()=>n});const n=e=>({"en-US":()=>s.e(3086).then(s.bind(s,13086)),"zh-CN":()=>s.e(4308).then(s.bind(s,84308))}[e]())},29574:(e,t,s)=>{s.d(t,{Zi:()=>_,FI:()=>g,AG:()=>f,Ay:()=>y,lN:()=>x});const n="style_input-file__3JGm6__qBEUs",a="style_input-file-input__Fb5iw__qBEUs";var l=s(83136),r=s.n(l),o=s(73884),i=s(55199),c=s(76329),d=s(28987),u=s(80111),p=s.n(u),m=s(70579);const h=e=>t=>{let{className:s,accept:l,multiple:i,onChange:c,children:d,...u}=t;const p=(0,o.useRef)(null);return(0,m.jsxs)(e,{...u,className:r()(s,n),children:[d,!0!==u.disabled&&(0,m.jsx)("input",{ref:p,type:"file",accept:l,multiple:i,className:a,onChange:e=>{const t=[].slice.call(e.target.files,0);0!==t.length&&(p.current.setAttribute("type","text"),p.current.setAttribute("type","file"),c(t))}})]})},_=h(i.Button),g=h((e=>{let{className:t,...s}=e;return(0,m.jsx)(i.Typography.Link,{...s,className:t})})),f=h((e=>{let{className:t,...s}=e;return(0,m.jsx)(i.Typography.Text,{...s,className:r()("ant-btn",t)})})),x=e=>{const{message:t}=i.App.useApp(),{multiple:s,fileSize:n,maxLength:a,value:l,concurrentCount:r,onAdd:u,onError:m,onSave:h,onChange:_,ossUpload:g}=Object.assign({},{concurrentCount:1,value:[]},e),{apis:f}=(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-l.length;1!==a&&!0===s&&e.length>r?t.error("\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf".concat(a)):await Promise.allSettled(e.map((async e=>{if(e.size>1024*n*1024)return void t.error("\u6587\u4ef6".concat(e.name,"\u4e0d\u80fd\u8d85\u8fc7").concat(n,"MB!"));const l=p()(),r=s=>{const n=s.message||"\u6587\u4ef6".concat(e.name,"\u4e0a\u4f20\u9519\u8bef").concat(s.message?":"+s.message:"");t.error(n),m&&m({file:e,error:s,errMsg:n}),y((e=>{const t=e.slice(0),s=t.findIndex((e=>e.uuid===l));return s>-1&&t.splice(s,1),t}))};try{y(1===a||!0!==s?[{uuid:l,type:"uploading",filename:e.name}]:t=>{const s=t.slice(0);return s.unshift({uuid:l,type:"uploading",filename:e.name}),s}),u&&await Promise.resolve(u(e));const t=g||f.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,l)):{filename:n.data.originalName||n.data.filename||e.name,id:n.data.id,ossId:n.data.id,uuid:l};y((e=>{const t=e.slice(0),s=t.findIndex((e=>e.uuid===l));return s>-1&&t.splice(s,1),t})),_(1===a||!0!==s?[o]:e=>{const t=e.slice(0);return t.push(o),t})}catch(o){r(o)}})))}}},y=h},97211:(e,t,s)=>{s.d(t,{A:()=>c});var n=s(87558),a=s.n(n),l=s(76329),r=s(34677),o=s.n(r),i=s(70579);const c=e=>{const t=t=>{let{id:s,url:n,error:r,apis:c,loading:d,...u}=t;const{apis:p}=(0,l.usePreset)(),m=o()({},p,c);if(!s)return null;if(!m.oss)throw new Error("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.oss\u53c2\u6570");const{paramsType:h,paramsName:_,...g}=Object.assign({paramsType:"params",paramsName:"id"},m.oss),f={};return f[h]={[_]:s},(0,i.jsx)(a(),{...Object.assign({},g,f),updateType:"refresh",error:r,loading:d,cache:"oss-file",ttl:6e6,render:t=>{let{data:n}=t;return(0,i.jsx)(e,{...u,id:s,data:n})}})};return t.defaultProps={loading:null},t}},27047:(e,t,s)=>{s.d(t,{A:()=>r});var n=s(83694),a=s(33097),l=s.n(a);const r=()=>{const e=(0,n.useGlobalContext)();return l()(e,"preset",{apis:{}})}},77964:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(73884),a=s(79889),l=s.n(a),r=s(93950),o=s.n(r),i=s(96418),c=s.n(i);const d=(e,t)=>{const s=(0,n.useRef)(null);s.current=Object.assign({},{time:500,isDebounce:!1},t);const a=(0,n.useRef)(null),r=c()(e);return(0,n.useLayoutEffect)((()=>{const e=a.current,t=()=>window.requestAnimationFrame((()=>{e&&r(e)}));t();const n=new ResizeObserver((s.current.isDebounce?o():l())(t,s.current.time));return e&&n.observe(e),()=>{n.disconnect()}}),[r]),a}},81348:(e,t,s)=>{s.d(t,{A:()=>n});const n=(e,t)=>{if(e&&t){const s=Array.isArray(t)?t:t.split(","),n=e.name||"",a=(e.type||"").toLowerCase(),l=a.replace(/\/.*$/,"");return s.some((e=>{const t=e.trim().toLowerCase();return"."===t.charAt(0)?n.toLowerCase().endsWith(t):t.endsWith("/*")?l===t.replace(/\/.*$/,""):a===t}))}return!0}},69484:(e,t,s)=>{s.d(t,{A:()=>a,e:()=>n});const n=1e15,a=e=>{let t,s,a,l=["\u96f6","\u58f9","\u8d30","\u53c1","\u8086","\u4f0d","\u9646","\u67d2","\u634c","\u7396"],r=["","\u62fe","\u4f70","\u4edf"],o=["","\u4e07","\u4ebf","\u5146"],i=["\u89d2","\u5206","\u6beb","\u5398"],c="",d="";if(""===e)return"";if((e=parseFloat(e))>=n)return c="\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57",console.error("\u8d85\u51fa\u6700\u5927\u5904\u7406\u6570\u5b57"),c;if(0===e)return c=l[0]+"\u5143\u6574",c;if(e<0&&(e=-e,d="\u8d1f "),-1===(e=e.toString()).indexOf(".")?(t=e,s=""):(a=e.split("."),t=a[0],s=a[1].substr(0,4)),parseInt(t,10)>0){let e=0,s=t.length;for(let n=0;n<s;n++){let a=t.substr(n,1),i=s-n-1,d=i/4,u=i%4;"0"===a?e++:(e>0&&(c+=l[0]),e=0,c+=l[parseInt(a)]+r[u]),0===u&&e<4&&(c+=o[d])}c+="\u5143"}if(""!==s){let e=s.length;for(let t=0;t<e;t++){let e=s.substr(t,1);"0"!==e&&(c+=l[Number(e)]+i[t])}}return""===c?c+=l[0]+"\u5143\u6574":""===s&&(c+="\u6574"),c=d+c,c}},74981:(e,t,s)=>{s.d(t,{A:()=>a});var n=s(73884);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.createContext)(e),{Provider:s,Consumer:a}=t;return{context:t,Provider:s,Consumer:a,useContext:()=>(0,n.useContext)(t)}}},28987:(e,t,s)=>{s.d(t,{A:()=>n});const n=e=>{const t=[];let s=0;const n=()=>{if(0!==t.length){if(s<e){const e=t.shift();s+=1,e().finally((()=>{s-=1,n()}))}}else s=0};return e=>new Promise((s=>{t.push((()=>{const t=Promise.resolve().then((()=>e()));return s(t),t})),n()}))}},55490:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(12322),a=s.n(n),l=s(26727),r=s.n(l),o=s(54052),i=s.n(o);const c=e=>{if(a()(e)){const t=r()(e);return t.length>0&&t.some((e=>c(e)))}return i()(e)?e.length>0&&e.some((e=>c(e))):"number"===typeof e?!isNaN(e):!(void 0===e||null===e||""===e||0===e.length)},d=c},91176:(e,t,s)=>{s.d(t,{j:()=>a,v:()=>n});const n=e=>"number"===typeof e?"".concat(e,"px"):e,a=e=>{if(!e)return 0;const t=e.match(/^\d*(\.\d*)?/);return t?Number(t[0]):0}},36:(e,t,s)=>{s.r(t),s.d(t,{AddressEnum:()=>h.qn,AddressInputField:()=>h.TM,AddressSelectField:()=>h.Ay,AdvancedSelectField:()=>_.Ay,CascaderField:()=>g.Ay,FetchButton:()=>i.A,FunctionEnum:()=>f.K,FunctionSelectField:()=>f.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:()=>_.Bm,TypeDateRangePickerField:()=>y.A,UserField:()=>_.Eo,accept:()=>C.A,changeMoneyToChinese:()=>n.A,createAddressApi:()=>h.LH,createDeferred:()=>j.A,createListField:()=>_.NR,createTreeUtils:()=>g.ON,getContainerBody:()=>a.c,getPopupContainer:()=>l,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=s(69484),a=s(76801);const l=e=>{const t=e=>{const s=(0,a.h)();if(!e||e===s||!e.parentElement)return s;return[].slice.call(e.classList,0).find((e=>["ant-modal-body","ant-modal-content","ant-popover-content"].indexOf(e)>-1))?e:t(e.parentElement)};return t(e)};var r=s(97211),o=s(26475),i=s(73025),c=s(21485),d=s(17342),u=s(73161),p=s(30509),m=s(29574),h=s(93761),_=s(12392),g=s(45776),f=s(41654),x=s(53392),y=s(89319),v=s(77964),C=s(81348),j=s(28987),b=s(55490),A=s(91176)},40438:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var n=s(87558),a=s.n(n),l=s(97211),r=s(64671),o=s(83136),i=s.n(o),c=s(55199),d=s(73884);const u=e=>{let{params:t}=e;const{data:s}=t;return new Promise(((e,t)=>{const n=new window.Image;n.src=s,n.addEventListener("load",(()=>{e(s)})),n.addEventListener("error",(e=>{t(e)}))}))},p="style_img-outer__4QLY5__qBEUs",m="style_img__PSExq__qBEUs",h="style_loading__WCOwA__qBEUs",_="style_error__+ECgZ__qBEUs";var g=s(18411),f=s(70579);const x=e=>{let{data:t,className:s,alt:n,innerLoading:l,loading:r,error:o,innerError:c,children:d,onClick:p}=e;return(0,f.jsx)(a(),{loader:u,params:{data:t},error:c||o,loading:l||r,render:e=>{let{data:t}=e;return"function"===typeof d?d({alt:n,className:i()(s,m),src:t}):(0,f.jsx)("img",{alt:n,className:i()(s,m),src:t,onClick:p})}})},y=(0,l.A)(x),v=e=>{let{loading:t,error:s,src:n,id:a,alt:l,className:r,children:o,apis:i,onClick:c}=e;const u=t&&(0,d.cloneElement)(t,{className:h}),p=s&&(0,d.cloneElement)(s,{className:_});return n?(0,f.jsx)(x,{alt:l,className:r,data:n,loading:u,error:p,onClick:c,children:o}):a?(0,f.jsx)(y,{alt:l,className:r,id:a,loading:u,innerLoading:u,error:p,innerError:p,apis:i,onClick:c,children:o}):p},C=e=>{let{id:t,src:s,alt:n,onClick:a,loading:l,error:r,className:o,apis:c,...d}=e;return(0,f.jsx)("div",{...d,"data-testid":"components-core-image",className:i()(o,p),children:v({loading:l,error:r,src:s,id:t,alt:n,className:o,apis:c,onClick:a})})};C.Avatar=e=>{let{id:t,src:s,alt:n,gender:a,loading:l,error:o,className:d,gap:u,icon:m,children:h,shape:_,size:g,width:x,height:y,defaultAvatar:C,apis:j,...b}=e;const A=(()=>{const e=x&&y?{style:{width:x,height:y}}:{size:g};if(x&&x!==y&&(_="square"),t||s)return v({loading:l,error:o,src:s,defaultAvatar:C,id:t,alt:n,className:d,apis:j,children:t=>(0,f.jsx)(c.Avatar,{...t,gap:u,shape:_,...e})});if(a){const t=a&&["F","female","f"].indexOf(a)>-1?"icon-color-touxiang-nv":"icon-color-touxiang-nan";return(0,f.jsx)(c.Avatar,{...b,src:(0,f.jsx)(r.default,{role:"touxiang",colorful:!0,type:t}),gap:u,shape:_,...e})}return(0,f.jsx)(c.Avatar,{...b,gap:u,icon:m,shape:_,size:g,src:C,...e,children:h})})();return(0,f.jsx)("div",{...b,"data-testid":"components-core-image-avatar",className:i()(d,p),style:{width:x&&y?x:g,height:x&&y?y:g},children:A})};const j={error:(0,f.jsx)(r.default,{role:"error-icon",colorful:!0,type:"icon-color-touxiang-nan"}),loading:(0,f.jsx)(c.Skeleton.Avatar,{shape:"square",active:!0})};C.defaultProps=Object.assign({},j),C.Avatar.defaultProps=Object.assign({},j,{size:100,defaultAvatar:g.A});const b=C},3382:(e,t,s)=>{s.r(t),s.d(t,{ModalButton:()=>O,TabsModal:()=>E,TabsModalButton:()=>q,default:()=>S,useConfirmModal:()=>N,useModal:()=>A,useTabsModal:()=>B});var n=s(73884),a=s(55199),l=s(83136),r=s.n(l);const o={modal:"style_modal__Pm3cF__qBEUs",large:"style_large__iaqVE__qBEUs","modal-body-inner":"style_modal-body-inner__4PhpA__qBEUs","modal-title":"style_modal-title__dswaw__qBEUs","modal-outer":"style_modal-outer__r3SkX__qBEUs","modal-body":"style_modal-body__jQJSI__qBEUs","right-options-modal":"style_right-options-modal__FajDP__qBEUs","right-options-row":"style_right-options-row__-mPb9__qBEUs","right-options-col":"style_right-options-col__3ilee__qBEUs","is-disabled-scroller":"style_is-disabled-scroller__PmHyk__qBEUs",content:"style_content__k6MIF__qBEUs","modal-footer":"style_modal-footer__-prbN__qBEUs","modal-close":"style_modal-close__Oa5Kl__qBEUs","confirm-modal-wrap":"style_confirm-modal-wrap__YFImr__qBEUs","is-danger":"style_is-danger__H5110__qBEUs",title:"style_title__orTym__qBEUs","has-title":"style_has-title__qy0Wp__qBEUs"},i=e=>({"en-US":()=>s.e(4628).then(s.bind(s,74628)),"zh-CN":()=>s.e(7478).then(s.bind(s,87478))}[e]());var c=s(58609),d=s(64671);const u=(e,t)=>"function"===typeof e?e(t):e;var p=s(81014),m=s(17342),h=s(70579);const _="Modal",g=e=>{let{options:t,children:s}=e;return t?(0,h.jsxs)(a.Row,{wrap:!1,className:o["right-options-row"],children:[(0,h.jsx)(a.Col,{span:18,className:o["right-options-col"],children:s}),(0,h.jsx)(a.Col,{span:6,className:o["right-options-col"],children:t})]}):s},f=(e,t)=>"".concat(e-48-(t?58:0),"px"),x=(e,t)=>"large"===e?{width:"".concat(Math.min(window.innerWidth-64,1500),"px"),style:{"--min-modal-height":f(500,t)}}:"small"===e?{width:"600px",style:{"--min-modal-height":f(300,t)}}:{width:"1000px",style:{"--min-modal-height":f(500,t)}},y=e=>{let{footer:t,footerButtons:s,onConfirm:l,onCancel:r,onClose:o,targetProps:d}=e;return(0,h.jsxs)(a.Row,{gutter:10,wrap:!1,children:[(0,h.jsx)(a.Col,{flex:1,children:t}),Array.isArray(s)&&0===s.length?null:(0,h.jsx)(a.Col,{children:(0,h.jsx)(a.Space,{children:(s||[{children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:_,children:(0,h.jsx)(c.FormattedMessage,{id:"Cancel",moduleName:_})}),onClick:r},{type:"primary",children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:_,children:(0,h.jsx)(c.FormattedMessage,{id:"Confirm",moduleName:_})}),onClick:l}]).filter((e=>"function"===typeof(null===e||void 0===e?void 0:e.display)?null===e||void 0===e?void 0:e.display():!1!==(null===e||void 0===e?void 0:e.display))).map(((e,t)=>{let{ButtonComponent:s,onClick:a,autoClose:l=!0,display:r,...i}=e;const c=s||p.default;return(0,n.createElement)(c,{...i,key:t,onClick:async function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];const n=await Promise.resolve(a&&a(...t,d));return l&&!1!==n&&o&&o(),n}})}))})})]})},v=e=>{let{title:t,footer:s,disabledScroller:l,footerButtons:i,onClose:c,closable:u,onConfirm:p,onCancel:_,children:g,targetProps:f}=e;const x=(0,n.useRef)(null);return(0,h.jsxs)("div",{className:o["modal-outer"],"data-testid":"components-core-modal",children:[!1===u?null:(0,h.jsx)(a.Button,{"data-testid":"components-core-modal-close-btn",className:o["modal-close"],type:"text",icon:(0,h.jsx)(d.default,{type:"icon-close-thin"}),onClick:e=>{e.stopPropagation(),c&&c()}}),t&&(0,h.jsx)("div",{className:o["modal-title"],children:t}),(0,h.jsx)(m.A,{className:r()(o["modal-body"],{[o["is-disabled-scroller"]]:l},"modal-body"),ref:x,children:(0,h.jsx)("div",{className:r()(o["modal-body-inner"],"modal-body-inner"),children:g})}),null!==s||i?(0,h.jsx)("div",{className:r()(o["modal-footer"],"modal-footer"),children:(0,h.jsx)(y,{footer:s,footerButtons:i,onConfirm:p,onCancel:_,onClose:c,targetProps:f})}):null]})},C=e=>{let{withDecorator:t,footerButtons:s,title:n,closable:a,onClose:l,onConfirm:r,onCancel:o,footer:i,rightOptions:c,disabledScroller:d,childrenRef:p,children:m}=e;const _=e=>(e=Object.assign({},{title:n},e),(0,h.jsx)(v,{title:u(e.title,{...e,childrenRef:p,close:l}),closable:a,onClose:l,onConfirm:r,onCancel:o,footerButtons:u(s,{...e,close:l}),disabledScroller:d,footer:u(i,{...e,childrenRef:p,close:l}),targetProps:Object.assign({},e,{childrenRef:p,close:l}),children:(0,h.jsx)(g,{options:u(c,{...e,childrenRef:p,close:l}),children:u(m,{...e,childrenRef:p,close:l})})}));return"function"===typeof t?t(_):_({})},j=e=>{let{children:t,rightOptions:s,footer:n,footerButtons:a,className:l,size:d,title:u,onClose:p,onConfirm:m,onCancel:_,closable:g,disabledScroller:f,withDecorator:y,childrenRef:v,...j}=e;return{...j,icon:null,centered:!0,title:null,maskClosable:!!j.hasOwnProperty("maskClosable")&&j.maskClosable,destroyOnClose:!0,footer:null,closable:!1,onCancel:p,className:r()(l,o.modal,o[d],{[o["right-options-modal"]]:s}),...x(d,!(null===n&&!a)),children:(0,h.jsx)(c.IntlProvider,{importMessages:i,moduleName:"Modal",children:C({withDecorator:y,title:u,closable:g,onClose:p,onConfirm:m,onCancel:_,footer:n,footerButtons:a,rightOptions:s,disabledScroller:f,children:t,childrenRef:v})})}},b=e=>{const t=(0,n.useRef)(null);return(0,h.jsx)(a.Modal,{...j(Object.assign({},e,{childrenRef:t}))})};b.defaultProps={size:"default"};const A=()=>{const{modal:e}=a.App.useApp(),t=(0,n.useRef)(null);return s=>{const n={},{children:a,...l}=j({onClose:()=>n.close(),childrenRef:t,...s}),{destroy:r}=e.info({...l,content:a});return n.close=r,n}},N=()=>{const{modal:e}=a.App.useApp();return t=>{const s={},{type:n,icon:l,title:i,danger:c,wrapClassName:u,message:p,iconSetting:m={},confirmType:_="info",...g}={onClose:()=>s.close(),maskClosable:!1,...t},f=Object.assign({},{info:"icon-xinxi-tianchong",confirm:"icon-tishi-tianchong",warning:"icon-tishi-tianchong",error:"icon-shibai",success:"icon-chenggong"},m);if(e[n]){const{destroy:t}=e[n]({...g,icon:null,wrapClassName:r()(o["confirm-modal-wrap"],u,{[o["is-danger"]]:c}),title:(0,h.jsx)(a.Space,{direction:"vertical",onClick:e=>{e.stopPropagation()},children:i&&(0,h.jsxs)(a.Space,{size:0,align:"start",className:o.title,children:[c?(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?_:n)),type:l||f["confirm"===n?_:n]}):null,i]})}),content:(0,h.jsxs)(a.Space,{size:0,align:"start",className:r()(o.content,{[o["has-title"]]:i}),children:[!i&&c?(0,h.jsx)(d.default,{className:r()("title-icon","title-icon-".concat("confirm"===n?_:n)),type:l||f["confirm"===n?_:n]}):null,p]})});s.close=t}return s}},S=b,w=e=>{let{items:t,className:s,activeKey:n,withDecorator:l,defaultActiveKey:o,onChange:i,...c}=e;return{...c,className:r()(s,"tabs-modal"),withDecorator:e=>{const s=s=>(0,h.jsx)(a.Tabs,{items:t.map((t=>{let{withDecorator:n,...a}=t;return Object.assign({},a,{children:"function"===typeof n?n((t=>e(Object.assign({},s,t,{children:a.children})))):e(Object.assign({},s,{children:a.children}))})})),destroyInactiveTabPane:!0,activeKey:n,defaultActiveKey:o,onChange:i});return"function"===typeof l?l(s):s()},children:e=>{let{children:t,...s}=e;return"function"===typeof t?t(s):t}}},E=e=>(0,h.jsx)(S,{...w(e)}),B=()=>{const e=A();return t=>e(w(t))};var U=s(73025);const q=e=>{const t=B();return(0,h.jsx)(U.A,{...e,modalFunc:t})},O=e=>{const t=A();return(0,h.jsx)(U.A,{...e,modalFunc:t})}},25438:(e,t,s)=>{s.d(t,{A:()=>n});const n={"search-input":"common_search-input__P6qLg__qBEUs","is-popup":"common_is-popup__fJq+g__qBEUs",list:"common_list__TKFzS__qBEUs","list-item":"common_list-item__ASse7__qBEUs","is-selected":"common_is-selected__-PU4Y__qBEUs","item-label":"common_item-label__u+qz1__qBEUs","item-des":"common_item-des__no2z0__qBEUs"}}}]);
2
+ //# sourceMappingURL=36.2fcea14f.chunk.js.map