el-plus 0.0.2

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 (388) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/index.css +1 -0
  3. package/dist/index.full.js +2219 -0
  4. package/dist/index.full.min.js +2 -0
  5. package/dist/index.full.min.js.map +1 -0
  6. package/dist/index.full.min.mjs +2 -0
  7. package/dist/index.full.min.mjs.map +1 -0
  8. package/dist/index.full.mjs +2185 -0
  9. package/env.d.ts +17 -0
  10. package/es/components/base/style/css.d.ts +1 -0
  11. package/es/components/base/style/css.mjs +4 -0
  12. package/es/components/base/style/css.mjs.map +1 -0
  13. package/es/components/base/style/index.d.ts +1 -0
  14. package/es/components/base/style/index.mjs +4 -0
  15. package/es/components/base/style/index.mjs.map +1 -0
  16. package/es/components/buttons/index.d.ts +389 -0
  17. package/es/components/buttons/index.mjs +8 -0
  18. package/es/components/buttons/index.mjs.map +1 -0
  19. package/es/components/buttons/src/buttons-vue.d.ts +161 -0
  20. package/es/components/buttons/src/buttons-vue.mjs +70 -0
  21. package/es/components/buttons/src/buttons-vue.mjs.map +1 -0
  22. package/es/components/buttons/src/buttons.d.ts +66 -0
  23. package/es/components/buttons/src/buttons.mjs +32 -0
  24. package/es/components/buttons/src/buttons.mjs.map +1 -0
  25. package/es/components/buttons/style/css.d.ts +2 -0
  26. package/es/components/buttons/style/css.mjs +5 -0
  27. package/es/components/buttons/style/css.mjs.map +1 -0
  28. package/es/components/buttons/style/index.d.ts +2 -0
  29. package/es/components/buttons/style/index.mjs +5 -0
  30. package/es/components/buttons/style/index.mjs.map +1 -0
  31. package/es/components/form/index.d.ts +291 -0
  32. package/es/components/form/index.mjs +10 -0
  33. package/es/components/form/index.mjs.map +1 -0
  34. package/es/components/form/src/form-item-vue.d.ts +135 -0
  35. package/es/components/form/src/form-item-vue.mjs +40 -0
  36. package/es/components/form/src/form-item-vue.mjs.map +1 -0
  37. package/es/components/form/src/form-item.d.ts +68 -0
  38. package/es/components/form/src/form-item.mjs +33 -0
  39. package/es/components/form/src/form-item.mjs.map +1 -0
  40. package/es/components/form/src/form.d.ts +66 -0
  41. package/es/components/form/src/form.mjs +50 -0
  42. package/es/components/form/src/form.mjs.map +1 -0
  43. package/es/components/form/src/form.vue.d.ts +161 -0
  44. package/es/components/form/src/form.vue.mjs +6 -0
  45. package/es/components/form/src/form.vue.mjs.map +1 -0
  46. package/es/components/form/src/form.vue2.mjs +124 -0
  47. package/es/components/form/src/form.vue2.mjs.map +1 -0
  48. package/es/components/form/src/hooks/use-form-item.d.ts +12 -0
  49. package/es/components/form/src/hooks/use-form-item.mjs +97 -0
  50. package/es/components/form/src/hooks/use-form-item.mjs.map +1 -0
  51. package/es/components/form/src/hooks/use-form.d.ts +25 -0
  52. package/es/components/form/src/hooks/use-form.mjs +53 -0
  53. package/es/components/form/src/hooks/use-form.mjs.map +1 -0
  54. package/es/components/form/style/css.d.ts +2 -0
  55. package/es/components/form/style/css.mjs +5 -0
  56. package/es/components/form/style/css.mjs.map +1 -0
  57. package/es/components/form/style/index.d.ts +2 -0
  58. package/es/components/form/style/index.mjs +5 -0
  59. package/es/components/form/style/index.mjs.map +1 -0
  60. package/es/components/index.d.ts +6 -0
  61. package/es/components/index.mjs +15 -0
  62. package/es/components/index.mjs.map +1 -0
  63. package/es/components/input/index.d.ts +462 -0
  64. package/es/components/input/index.mjs +8 -0
  65. package/es/components/input/index.mjs.map +1 -0
  66. package/es/components/input/src/input.d.ts +122 -0
  67. package/es/components/input/src/input.mjs +28 -0
  68. package/es/components/input/src/input.mjs.map +1 -0
  69. package/es/components/input/src/input.vue.d.ts +268 -0
  70. package/es/components/input/src/input.vue.mjs +6 -0
  71. package/es/components/input/src/input.vue.mjs.map +1 -0
  72. package/es/components/input/src/input.vue2.mjs +144 -0
  73. package/es/components/input/src/input.vue2.mjs.map +1 -0
  74. package/es/components/input/style/css.d.ts +2 -0
  75. package/es/components/input/style/css.mjs +5 -0
  76. package/es/components/input/style/css.mjs.map +1 -0
  77. package/es/components/input/style/index.d.ts +2 -0
  78. package/es/components/input/style/index.mjs +5 -0
  79. package/es/components/input/style/index.mjs.map +1 -0
  80. package/es/components/searchListPage/index.d.ts +8577 -0
  81. package/es/components/searchListPage/index.mjs +8 -0
  82. package/es/components/searchListPage/index.mjs.map +1 -0
  83. package/es/components/searchListPage/src/searchListPage.d.ts +64 -0
  84. package/es/components/searchListPage/src/searchListPage.mjs +61 -0
  85. package/es/components/searchListPage/src/searchListPage.mjs.map +1 -0
  86. package/es/components/searchListPage/src/searchListPage.vue.d.ts +2760 -0
  87. package/es/components/searchListPage/src/searchListPage.vue.mjs +6 -0
  88. package/es/components/searchListPage/src/searchListPage.vue.mjs.map +1 -0
  89. package/es/components/searchListPage/src/searchListPage.vue2.mjs +99 -0
  90. package/es/components/searchListPage/src/searchListPage.vue2.mjs.map +1 -0
  91. package/es/components/searchListPage/src/use-search-list-page.d.ts +2671 -0
  92. package/es/components/searchListPage/src/use-search-list-page.mjs +177 -0
  93. package/es/components/searchListPage/src/use-search-list-page.mjs.map +1 -0
  94. package/es/components/searchListPage/style/css.d.ts +2 -0
  95. package/es/components/searchListPage/style/css.mjs +5 -0
  96. package/es/components/searchListPage/style/css.mjs.map +1 -0
  97. package/es/components/searchListPage/style/index.d.ts +2 -0
  98. package/es/components/searchListPage/style/index.mjs +5 -0
  99. package/es/components/searchListPage/style/index.mjs.map +1 -0
  100. package/es/components/select/index.d.ts +658 -0
  101. package/es/components/select/index.mjs +8 -0
  102. package/es/components/select/index.mjs.map +1 -0
  103. package/es/components/select/src/select.d.ts +283 -0
  104. package/es/components/select/src/select.mjs +47 -0
  105. package/es/components/select/src/select.mjs.map +1 -0
  106. package/es/components/select/src/select.vue.d.ts +384 -0
  107. package/es/components/select/src/select.vue.mjs +6 -0
  108. package/es/components/select/src/select.vue.mjs.map +1 -0
  109. package/es/components/select/src/select.vue2.mjs +113 -0
  110. package/es/components/select/src/select.vue2.mjs.map +1 -0
  111. package/es/components/select/src/use-select.d.ts +12 -0
  112. package/es/components/select/src/use-select.mjs +87 -0
  113. package/es/components/select/src/use-select.mjs.map +1 -0
  114. package/es/components/select/style/css.d.ts +2 -0
  115. package/es/components/select/style/css.mjs +5 -0
  116. package/es/components/select/style/css.mjs.map +1 -0
  117. package/es/components/select/style/index.d.ts +2 -0
  118. package/es/components/select/style/index.mjs +5 -0
  119. package/es/components/select/style/index.mjs.map +1 -0
  120. package/es/components/table/index.d.ts +2970 -0
  121. package/es/components/table/index.mjs +8 -0
  122. package/es/components/table/index.mjs.map +1 -0
  123. package/es/components/table/src/table.d.ts +781 -0
  124. package/es/components/table/src/table.mjs +81 -0
  125. package/es/components/table/src/table.mjs.map +1 -0
  126. package/es/components/table/src/table.vue.d.ts +1708 -0
  127. package/es/components/table/src/table.vue.mjs +6 -0
  128. package/es/components/table/src/table.vue.mjs.map +1 -0
  129. package/es/components/table/src/table.vue2.mjs +204 -0
  130. package/es/components/table/src/table.vue2.mjs.map +1 -0
  131. package/es/components/table/src/use-table.d.ts +241 -0
  132. package/es/components/table/src/use-table.mjs +260 -0
  133. package/es/components/table/src/use-table.mjs.map +1 -0
  134. package/es/components/table/style/css.d.ts +2 -0
  135. package/es/components/table/style/css.mjs +5 -0
  136. package/es/components/table/style/css.mjs.map +1 -0
  137. package/es/components/table/style/index.d.ts +2 -0
  138. package/es/components/table/style/index.mjs +5 -0
  139. package/es/components/table/style/index.mjs.map +1 -0
  140. package/es/components.d.ts +3 -0
  141. package/es/components.mjs +11 -0
  142. package/es/components.mjs.map +1 -0
  143. package/es/directives/index.d.ts +2 -0
  144. package/es/directives/index.mjs +3 -0
  145. package/es/directives/index.mjs.map +1 -0
  146. package/es/directives/permission/index.d.ts +6 -0
  147. package/es/directives/permission/index.mjs +55 -0
  148. package/es/directives/permission/index.mjs.map +1 -0
  149. package/es/directives/repeat-click/index.d.ts +16 -0
  150. package/es/directives/repeat-click/index.mjs +68 -0
  151. package/es/directives/repeat-click/index.mjs.map +1 -0
  152. package/es/directives/vite.config.d.ts +2 -0
  153. package/es/hooks/index.d.ts +1 -0
  154. package/es/hooks/index.mjs +2 -0
  155. package/es/hooks/index.mjs.map +1 -0
  156. package/es/hooks/use-request.d.ts +20 -0
  157. package/es/hooks/use-request.mjs +82 -0
  158. package/es/hooks/use-request.mjs.map +1 -0
  159. package/es/index.d.ts +9 -0
  160. package/es/index.mjs +30 -0
  161. package/es/index.mjs.map +1 -0
  162. package/es/package.json.mjs +4 -0
  163. package/es/package.json.mjs.map +1 -0
  164. package/es/types/env.d.mjs +2 -0
  165. package/es/types/env.d.mjs.map +1 -0
  166. package/es/types/global.d.mjs +2 -0
  167. package/es/types/global.d.mjs.map +1 -0
  168. package/es/types/vue-shim.d.mjs +2 -0
  169. package/es/types/vue-shim.d.mjs.map +1 -0
  170. package/es/utils/bem.d.ts +10 -0
  171. package/es/utils/bem.mjs +31 -0
  172. package/es/utils/bem.mjs.map +1 -0
  173. package/es/utils/cookie.d.ts +7 -0
  174. package/es/utils/cookie.mjs +29 -0
  175. package/es/utils/cookie.mjs.map +1 -0
  176. package/es/utils/env.d.ts +3 -0
  177. package/es/utils/env.mjs +27 -0
  178. package/es/utils/env.mjs.map +1 -0
  179. package/es/utils/props.d.ts +37 -0
  180. package/es/utils/props.mjs +66 -0
  181. package/es/utils/props.mjs.map +1 -0
  182. package/es/utils/request.d.ts +6 -0
  183. package/es/utils/request.mjs +157 -0
  184. package/es/utils/request.mjs.map +1 -0
  185. package/es/utils/type.d.ts +15 -0
  186. package/es/utils/type.mjs +2 -0
  187. package/es/utils/type.mjs.map +1 -0
  188. package/es/utils/with-install.d.ts +4 -0
  189. package/es/utils/with-install.mjs +9 -0
  190. package/es/utils/with-install.mjs.map +1 -0
  191. package/global.d.ts +16 -0
  192. package/lib/components/base/style/css.d.ts +1 -0
  193. package/lib/components/base/style/css.js +6 -0
  194. package/lib/components/base/style/css.js.map +1 -0
  195. package/lib/components/base/style/index.d.ts +1 -0
  196. package/lib/components/base/style/index.js +6 -0
  197. package/lib/components/base/style/index.js.map +1 -0
  198. package/lib/components/buttons/index.d.ts +389 -0
  199. package/lib/components/buttons/index.js +14 -0
  200. package/lib/components/buttons/index.js.map +1 -0
  201. package/lib/components/buttons/src/buttons-vue.d.ts +161 -0
  202. package/lib/components/buttons/src/buttons-vue.js +74 -0
  203. package/lib/components/buttons/src/buttons-vue.js.map +1 -0
  204. package/lib/components/buttons/src/buttons.d.ts +66 -0
  205. package/lib/components/buttons/src/buttons.js +34 -0
  206. package/lib/components/buttons/src/buttons.js.map +1 -0
  207. package/lib/components/buttons/style/css.d.ts +2 -0
  208. package/lib/components/buttons/style/css.js +7 -0
  209. package/lib/components/buttons/style/css.js.map +1 -0
  210. package/lib/components/buttons/style/index.d.ts +2 -0
  211. package/lib/components/buttons/style/index.js +7 -0
  212. package/lib/components/buttons/style/index.js.map +1 -0
  213. package/lib/components/form/index.d.ts +291 -0
  214. package/lib/components/form/index.js +22 -0
  215. package/lib/components/form/index.js.map +1 -0
  216. package/lib/components/form/src/form-item-vue.d.ts +135 -0
  217. package/lib/components/form/src/form-item-vue.js +44 -0
  218. package/lib/components/form/src/form-item-vue.js.map +1 -0
  219. package/lib/components/form/src/form-item.d.ts +68 -0
  220. package/lib/components/form/src/form-item.js +36 -0
  221. package/lib/components/form/src/form-item.js.map +1 -0
  222. package/lib/components/form/src/form.d.ts +66 -0
  223. package/lib/components/form/src/form.js +55 -0
  224. package/lib/components/form/src/form.js.map +1 -0
  225. package/lib/components/form/src/form.vue.d.ts +161 -0
  226. package/lib/components/form/src/form.vue.js +10 -0
  227. package/lib/components/form/src/form.vue.js.map +1 -0
  228. package/lib/components/form/src/form.vue2.js +128 -0
  229. package/lib/components/form/src/form.vue2.js.map +1 -0
  230. package/lib/components/form/src/hooks/use-form-item.d.ts +12 -0
  231. package/lib/components/form/src/hooks/use-form-item.js +101 -0
  232. package/lib/components/form/src/hooks/use-form-item.js.map +1 -0
  233. package/lib/components/form/src/hooks/use-form.d.ts +25 -0
  234. package/lib/components/form/src/hooks/use-form.js +56 -0
  235. package/lib/components/form/src/hooks/use-form.js.map +1 -0
  236. package/lib/components/form/style/css.d.ts +2 -0
  237. package/lib/components/form/style/css.js +7 -0
  238. package/lib/components/form/style/css.js.map +1 -0
  239. package/lib/components/form/style/index.d.ts +2 -0
  240. package/lib/components/form/style/index.js +7 -0
  241. package/lib/components/form/style/index.js.map +1 -0
  242. package/lib/components/index.d.ts +6 -0
  243. package/lib/components/index.js +47 -0
  244. package/lib/components/index.js.map +1 -0
  245. package/lib/components/input/index.d.ts +462 -0
  246. package/lib/components/input/index.js +16 -0
  247. package/lib/components/input/index.js.map +1 -0
  248. package/lib/components/input/src/input.d.ts +122 -0
  249. package/lib/components/input/src/input.js +32 -0
  250. package/lib/components/input/src/input.js.map +1 -0
  251. package/lib/components/input/src/input.vue.d.ts +268 -0
  252. package/lib/components/input/src/input.vue.js +10 -0
  253. package/lib/components/input/src/input.vue.js.map +1 -0
  254. package/lib/components/input/src/input.vue2.js +148 -0
  255. package/lib/components/input/src/input.vue2.js.map +1 -0
  256. package/lib/components/input/style/css.d.ts +2 -0
  257. package/lib/components/input/style/css.js +7 -0
  258. package/lib/components/input/style/css.js.map +1 -0
  259. package/lib/components/input/style/index.d.ts +2 -0
  260. package/lib/components/input/style/index.js +7 -0
  261. package/lib/components/input/style/index.js.map +1 -0
  262. package/lib/components/searchListPage/index.d.ts +8577 -0
  263. package/lib/components/searchListPage/index.js +14 -0
  264. package/lib/components/searchListPage/index.js.map +1 -0
  265. package/lib/components/searchListPage/src/searchListPage.d.ts +64 -0
  266. package/lib/components/searchListPage/src/searchListPage.js +63 -0
  267. package/lib/components/searchListPage/src/searchListPage.js.map +1 -0
  268. package/lib/components/searchListPage/src/searchListPage.vue.d.ts +2760 -0
  269. package/lib/components/searchListPage/src/searchListPage.vue.js +10 -0
  270. package/lib/components/searchListPage/src/searchListPage.vue.js.map +1 -0
  271. package/lib/components/searchListPage/src/searchListPage.vue2.js +103 -0
  272. package/lib/components/searchListPage/src/searchListPage.vue2.js.map +1 -0
  273. package/lib/components/searchListPage/src/use-search-list-page.d.ts +2671 -0
  274. package/lib/components/searchListPage/src/use-search-list-page.js +179 -0
  275. package/lib/components/searchListPage/src/use-search-list-page.js.map +1 -0
  276. package/lib/components/searchListPage/style/css.d.ts +2 -0
  277. package/lib/components/searchListPage/style/css.js +7 -0
  278. package/lib/components/searchListPage/style/css.js.map +1 -0
  279. package/lib/components/searchListPage/style/index.d.ts +2 -0
  280. package/lib/components/searchListPage/style/index.js +7 -0
  281. package/lib/components/searchListPage/style/index.js.map +1 -0
  282. package/lib/components/select/index.d.ts +658 -0
  283. package/lib/components/select/index.js +18 -0
  284. package/lib/components/select/index.js.map +1 -0
  285. package/lib/components/select/src/select.d.ts +283 -0
  286. package/lib/components/select/src/select.js +53 -0
  287. package/lib/components/select/src/select.js.map +1 -0
  288. package/lib/components/select/src/select.vue.d.ts +384 -0
  289. package/lib/components/select/src/select.vue.js +10 -0
  290. package/lib/components/select/src/select.vue.js.map +1 -0
  291. package/lib/components/select/src/select.vue2.js +117 -0
  292. package/lib/components/select/src/select.vue2.js.map +1 -0
  293. package/lib/components/select/src/use-select.d.ts +12 -0
  294. package/lib/components/select/src/use-select.js +89 -0
  295. package/lib/components/select/src/use-select.js.map +1 -0
  296. package/lib/components/select/style/css.d.ts +2 -0
  297. package/lib/components/select/style/css.js +7 -0
  298. package/lib/components/select/style/css.js.map +1 -0
  299. package/lib/components/select/style/index.d.ts +2 -0
  300. package/lib/components/select/style/index.js +7 -0
  301. package/lib/components/select/style/index.js.map +1 -0
  302. package/lib/components/table/index.d.ts +2970 -0
  303. package/lib/components/table/index.js +17 -0
  304. package/lib/components/table/index.js.map +1 -0
  305. package/lib/components/table/src/table.d.ts +781 -0
  306. package/lib/components/table/src/table.js +86 -0
  307. package/lib/components/table/src/table.js.map +1 -0
  308. package/lib/components/table/src/table.vue.d.ts +1708 -0
  309. package/lib/components/table/src/table.vue.js +10 -0
  310. package/lib/components/table/src/table.vue.js.map +1 -0
  311. package/lib/components/table/src/table.vue2.js +208 -0
  312. package/lib/components/table/src/table.vue2.js.map +1 -0
  313. package/lib/components/table/src/use-table.d.ts +241 -0
  314. package/lib/components/table/src/use-table.js +264 -0
  315. package/lib/components/table/src/use-table.js.map +1 -0
  316. package/lib/components/table/style/css.d.ts +2 -0
  317. package/lib/components/table/style/css.js +7 -0
  318. package/lib/components/table/style/css.js.map +1 -0
  319. package/lib/components/table/style/index.d.ts +2 -0
  320. package/lib/components/table/style/index.js +7 -0
  321. package/lib/components/table/style/index.js.map +1 -0
  322. package/lib/components.d.ts +3 -0
  323. package/lib/components.js +15 -0
  324. package/lib/components.js.map +1 -0
  325. package/lib/directives/index.d.ts +2 -0
  326. package/lib/directives/index.js +10 -0
  327. package/lib/directives/index.js.map +1 -0
  328. package/lib/directives/permission/index.d.ts +6 -0
  329. package/lib/directives/permission/index.js +60 -0
  330. package/lib/directives/permission/index.js.map +1 -0
  331. package/lib/directives/repeat-click/index.d.ts +16 -0
  332. package/lib/directives/repeat-click/index.js +72 -0
  333. package/lib/directives/repeat-click/index.js.map +1 -0
  334. package/lib/directives/vite.config.d.ts +2 -0
  335. package/lib/hooks/index.d.ts +1 -0
  336. package/lib/hooks/index.js +8 -0
  337. package/lib/hooks/index.js.map +1 -0
  338. package/lib/hooks/use-request.d.ts +20 -0
  339. package/lib/hooks/use-request.js +84 -0
  340. package/lib/hooks/use-request.js.map +1 -0
  341. package/lib/index.d.ts +9 -0
  342. package/lib/index.js +65 -0
  343. package/lib/index.js.map +1 -0
  344. package/lib/package.json.js +6 -0
  345. package/lib/package.json.js.map +1 -0
  346. package/lib/types/env.d.js +3 -0
  347. package/lib/types/env.d.js.map +1 -0
  348. package/lib/types/global.d.js +3 -0
  349. package/lib/types/global.d.js.map +1 -0
  350. package/lib/types/vue-shim.d.js +3 -0
  351. package/lib/types/vue-shim.d.js.map +1 -0
  352. package/lib/utils/bem.d.ts +10 -0
  353. package/lib/utils/bem.js +33 -0
  354. package/lib/utils/bem.js.map +1 -0
  355. package/lib/utils/cookie.d.ts +7 -0
  356. package/lib/utils/cookie.js +33 -0
  357. package/lib/utils/cookie.js.map +1 -0
  358. package/lib/utils/env.d.ts +3 -0
  359. package/lib/utils/env.js +30 -0
  360. package/lib/utils/env.js.map +1 -0
  361. package/lib/utils/props.d.ts +37 -0
  362. package/lib/utils/props.js +73 -0
  363. package/lib/utils/props.js.map +1 -0
  364. package/lib/utils/request.d.ts +6 -0
  365. package/lib/utils/request.js +162 -0
  366. package/lib/utils/request.js.map +1 -0
  367. package/lib/utils/type.d.ts +15 -0
  368. package/lib/utils/type.js +3 -0
  369. package/lib/utils/type.js.map +1 -0
  370. package/lib/utils/with-install.d.ts +4 -0
  371. package/lib/utils/with-install.js +11 -0
  372. package/lib/utils/with-install.js.map +1 -0
  373. package/package.json +51 -0
  374. package/theme-chalk/base.css +1 -0
  375. package/theme-chalk/buttons.css +1 -0
  376. package/theme-chalk/form.css +1 -0
  377. package/theme-chalk/index.css +1 -0
  378. package/theme-chalk/search-list-page.css +1 -0
  379. package/theme-chalk/src/base.scss +11 -0
  380. package/theme-chalk/src/buttons.scss +18 -0
  381. package/theme-chalk/src/common/var.scss +1 -0
  382. package/theme-chalk/src/form.scss +55 -0
  383. package/theme-chalk/src/index.scss +4 -0
  384. package/theme-chalk/src/mixins/config.scss +4 -0
  385. package/theme-chalk/src/mixins/mixins.scss +38 -0
  386. package/theme-chalk/src/search-list-page.scss +23 -0
  387. package/theme-chalk/src/table.scss +57 -0
  388. package/theme-chalk/table.css +1 -0
@@ -0,0 +1,2219 @@
1
+ /*! ElPlus v0.0.2 */
2
+
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus'), require('axios'), require('element-plus/es/components/message/style/css'), require('element-plus/es/components/loading/style/css'), require('element-plus/es/components/table/src/table/defaults')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus', 'axios', 'element-plus/es/components/message/style/css', 'element-plus/es/components/loading/style/css', 'element-plus/es/components/table/src/table/defaults'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ElPlus = {}, global.Vue, global.ElementPlus, global.axios, null, null, global.elTableProps));
7
+ })(this, (function (exports, vue, elementPlus, axios, css, css$1, elTableProps) { 'use strict';
8
+
9
+ const buttonsProps = {
10
+ ...elementPlus.buttonProps,
11
+ disabled: {
12
+ type: [Boolean, Function]
13
+ },
14
+ list: {
15
+ type: Array,
16
+ default: () => []
17
+ },
18
+ size: {
19
+ ...elementPlus.buttonProps.size,
20
+ default: "small"
21
+ },
22
+ type: {
23
+ ...elementPlus.buttonProps.type,
24
+ default: "default"
25
+ },
26
+ test: {
27
+ type: String,
28
+ required: true
29
+ },
30
+ test1: {
31
+ type: String,
32
+ required: true,
33
+ default: "test1"
34
+ }
35
+ };
36
+
37
+ function _bem(prefix, block, element, modifier) {
38
+ if (block) {
39
+ prefix += "-" + block;
40
+ }
41
+ if (element) {
42
+ prefix += "__" + element;
43
+ }
44
+ if (modifier) {
45
+ prefix += "--" + modifier;
46
+ }
47
+ return prefix;
48
+ }
49
+ function createBEM(prefix) {
50
+ return {
51
+ b: (block = "") => _bem(prefix, block, "", ""),
52
+ e: (element = "") => element ? _bem(prefix, "", element, "") : "",
53
+ m: (modifier = "") => modifier ? _bem(prefix, "", "", modifier) : "",
54
+ be: (block = "", element = "") => block && element ? _bem(prefix, block, element, "") : "",
55
+ bm: (block = "", modifier = "") => block && modifier ? _bem(prefix, block, "", modifier) : "",
56
+ em: (element = "", modifier = "") => element && modifier ? _bem(prefix, "", element, modifier) : "",
57
+ bem: (block = "", element = "", modifier) => block && element && modifier ? _bem(prefix, block, element, modifier) : "",
58
+ is: (name = "", state) => state ? `is-${name}` : ""
59
+ };
60
+ }
61
+ function createNameSpace(name) {
62
+ const prefix = `ep-${name}`;
63
+ return createBEM(prefix);
64
+ }
65
+
66
+ const apiProps = {
67
+ api: {
68
+ type: [String, Function]
69
+ },
70
+ method: {
71
+ type: String
72
+ },
73
+ reqData: {
74
+ type: Object
75
+ },
76
+ reqParams: {
77
+ type: Object
78
+ },
79
+ reqBefore: {
80
+ type: Function
81
+ },
82
+ reqAfter: {
83
+ type: Function
84
+ }
85
+ };
86
+ const visibleProps = {
87
+ show: {
88
+ type: [Boolean, Function]
89
+ },
90
+ hide: {
91
+ type: [Boolean, Function]
92
+ }
93
+ };
94
+ const prepareProps = (props, excludeKeys = []) => {
95
+ return Object.keys(props).reduce((acc, key) => {
96
+ if (!excludeKeys.includes(key)) {
97
+ acc[key] = props[key];
98
+ }
99
+ return acc;
100
+ }, {});
101
+ };
102
+ const prepareEvents = (emit, eventKeys) => {
103
+ return eventKeys.reduce(
104
+ (acc, key) => {
105
+ let eventName;
106
+ if (key.startsWith("on")) {
107
+ eventName = key;
108
+ } else {
109
+ if (key.includes("-")) {
110
+ eventName = "on" + key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
111
+ } else {
112
+ eventName = `on${key.charAt(0).toUpperCase()}${key.slice(1)}`;
113
+ }
114
+ }
115
+ acc[eventName] = (...args) => emit(key, ...args);
116
+ return acc;
117
+ },
118
+ {}
119
+ );
120
+ };
121
+ const prepareClassNames = () => {
122
+ return vue.useAttrs().class || "";
123
+ };
124
+ const prepareStyles = () => {
125
+ return vue.useAttrs().style || {};
126
+ };
127
+
128
+ const SCOPE = "_RepeatClick";
129
+ const vRepeatClick = {
130
+ name: "repeatClick",
131
+ // 在绑定元素的 attribute 前
132
+ // 或事件监听器应用前调用
133
+ // created(el, binding, vnode) {
134
+ // // el.style.display = 'none'
135
+ // // 下面会介绍各个参数的细节
136
+ // console.log('created', el, binding, vnode)
137
+ // },
138
+ // 在元素被插入到 DOM 前调用
139
+ beforeMount(el, binding) {
140
+ const { delay = 300, immediate } = typeof binding.value === "object" ? binding.value : {};
141
+ const handler = typeof binding.value === "object" ? binding.value.handler : binding.value;
142
+ let isPending = false;
143
+ let timer;
144
+ const start = (e) => {
145
+ if (e.button !== 0) return;
146
+ timer && clearTimeout(timer);
147
+ timer = setTimeout(() => {
148
+ if (immediate) {
149
+ isPending = false;
150
+ } else {
151
+ handler?.(e);
152
+ }
153
+ }, delay);
154
+ if (immediate) {
155
+ if (isPending) {
156
+ return;
157
+ }
158
+ isPending = true;
159
+ handler?.(e);
160
+ }
161
+ };
162
+ el[SCOPE] = { start };
163
+ el.addEventListener("click", start);
164
+ },
165
+ // // 在绑定元素的父组件
166
+ // // 及他自己的所有子节点都挂载完成后调用
167
+ // mounted(el, binding, vnode) {
168
+ // console.log('mounted', el, binding, vnode)
169
+ // },
170
+ // // 绑定元素的父组件更新前调用
171
+ // beforeUpdate(el, binding, vnode, prevVnode) {
172
+ // console.log('beforeUpdate', el, binding, vnode, prevVnode)
173
+ // },
174
+ // // 在绑定元素的父组件
175
+ // // 及他自己的所有子节点都更新后调用
176
+ // updated(el, binding, vnode, prevVnode) {
177
+ // console.log('updated', el, binding, vnode, prevVnode)
178
+ // },
179
+ // // 绑定元素的父组件卸载前调用
180
+ // beforeUnmount(el, binding, vnode) {
181
+ // console.log('beforeUnmount', el, binding, vnode)
182
+ // },
183
+ // 绑定元素的父组件卸载后调用
184
+ unmounted(el) {
185
+ if (!el[SCOPE]) return;
186
+ const { start } = el[SCOPE];
187
+ if (start) {
188
+ el.removeEventListener("mousedown", start);
189
+ }
190
+ el[SCOPE] = null;
191
+ }
192
+ };
193
+
194
+ const getEnv = (mark = "hxjf", hostname = window.location.hostname) => {
195
+ const tag = hostname.match(new RegExp(`.*(?=${mark})`));
196
+ if (hostname === "hxdv-ui.hongxinshop.com") {
197
+ return "production";
198
+ }
199
+ if (!tag) {
200
+ return "local";
201
+ }
202
+ return tag[0] ? tag[0].replace("-", "") : "production";
203
+ };
204
+ const getBaseUrl = (env = "sit", isOpenApi) => {
205
+ let url = "";
206
+ if (getEnv() === "local") {
207
+ const query = {};
208
+ query.devProxy = location.search.slice(1).split("=")[1] || location.hash.slice(1).split("=")[1];
209
+ const devProxy = query.devProxy || `${env}-api`;
210
+ url = `${devProxy}${""}`;
211
+ } else {
212
+ url = "/vue-api";
213
+ }
214
+ return url;
215
+ };
216
+
217
+ const getCookie = (name) => {
218
+ const reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
219
+ const arr = document.cookie.match(reg);
220
+ if (arr) {
221
+ return decodeURIComponent(arr[2]);
222
+ }
223
+ return null;
224
+ };
225
+
226
+ const instance = axios.create({
227
+ method: "post",
228
+ timeout: 2e4,
229
+ baseURL: getBaseUrl(),
230
+ headers: {
231
+ "Content-Type": "application/json"
232
+ }
233
+ });
234
+ let reqNum = 0;
235
+ let loading = { close: () => {
236
+ } };
237
+ function startLoading() {
238
+ if (reqNum === 0) {
239
+ loading = elementPlus.ElLoading.service({
240
+ fullscreen: true,
241
+ lock: true,
242
+ text: "\u8BF7\u7A0D\u7B49\uFF0C\u6B63\u5728\u52A0\u8F7D\u4E2D...",
243
+ spinner: "el-icon-loading",
244
+ background: "rgba(0,0,0,0.7)"
245
+ });
246
+ }
247
+ reqNum++;
248
+ }
249
+ function closeLoading() {
250
+ if (reqNum <= 0) {
251
+ return;
252
+ }
253
+ reqNum--;
254
+ if (reqNum === 0) {
255
+ loading.close();
256
+ }
257
+ }
258
+ function endLoading() {
259
+ closeLoading();
260
+ }
261
+ instance.interceptors.request.use(
262
+ async (config) => {
263
+ const token = getCookie("access_token");
264
+ if (token) {
265
+ config.headers["Authorization"] = `Bearer ${token}`;
266
+ }
267
+ if (config.loading) {
268
+ startLoading();
269
+ }
270
+ config.headers = {
271
+ ...config.headers,
272
+ ...window.hx && window.hx.getSignHeaders({
273
+ // 只有openapi接口需要传sign
274
+ sign: config.sign || window.ELPLUSSIGN,
275
+ config
276
+ })
277
+ };
278
+ const cancelRequest = config.cancelRequest;
279
+ config.cancelToken = new axios.CancelToken(function(cancel) {
280
+ cancelRequest && cancelRequest(cancel);
281
+ });
282
+ return config;
283
+ },
284
+ (error) => {
285
+ console.log(error);
286
+ return Promise.reject(error);
287
+ }
288
+ );
289
+ instance.interceptors.response.use(
290
+ (response) => {
291
+ const config = response.config;
292
+ if (config.loading) {
293
+ endLoading();
294
+ }
295
+ const responseCode = response.data.code;
296
+ const { hideToast, hideToastCode = {} } = response.config.headers;
297
+ hideToastCode.length = Object.keys(hideToastCode).length;
298
+ if (responseCode === 200) {
299
+ return Promise.resolve(response.data);
300
+ } else if (hideToast || Array.prototype.slice.call(hideToastCode).indexOf(responseCode) > -1) {
301
+ return Promise.reject(response.data);
302
+ } else {
303
+ setTimeout(() => {
304
+ elementPlus.ElMessage.error({
305
+ message: `<pre>${response.data.msg}</pre>`,
306
+ type: "error",
307
+ duration: 2e3,
308
+ dangerouslyUseHTMLString: true
309
+ });
310
+ }, 300);
311
+ return Promise.reject(response.data);
312
+ }
313
+ },
314
+ (error) => {
315
+ const { config = {}, message } = error;
316
+ const { url } = config;
317
+ if (config.loading) {
318
+ endLoading();
319
+ }
320
+ if (error && error.response) {
321
+ const { status } = error.response;
322
+ switch (status) {
323
+ case 400:
324
+ error.message = error.response.data.message || error.response.data.msg;
325
+ break;
326
+ case 403:
327
+ error.message = "\u62D2\u7EDD\u8BBF\u95EE(403)";
328
+ break;
329
+ case 404:
330
+ error.message = "\u8BF7\u6C42\u51FA\u9519(404)";
331
+ break;
332
+ case 408:
333
+ error.message = "\u8BF7\u6C42\u8D85\u65F6(408)";
334
+ break;
335
+ case 500:
336
+ error.message = "\u670D\u52A1\u5668\u9519\u8BEF(500)";
337
+ break;
338
+ case 501:
339
+ error.message = "\u670D\u52A1\u672A\u5B9E\u73B0(501)";
340
+ break;
341
+ case 502:
342
+ error.message = "\u7F51\u7EDC\u9519\u8BEF(502)";
343
+ break;
344
+ case 503:
345
+ error.message = "\u670D\u52A1\u4E0D\u53EF\u7528(503)";
346
+ break;
347
+ case 504:
348
+ error.message = "\u7F51\u7EDC\u8D85\u65F6(504)";
349
+ break;
350
+ case 505:
351
+ error.message = "HTTP\u7248\u672C\u4E0D\u53D7\u652F\u6301(505)";
352
+ break;
353
+ default:
354
+ error.message = `\u8FDE\u63A5\u51FA\u9519(${error.response.status})!`;
355
+ }
356
+ } else {
357
+ if (error.message.includes("timeout")) {
358
+ error.message = `\u8BF7\u6C42${url ? url : ""}\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u662F\u5426\u8FDE\u63A5\u6B63\u5E38`;
359
+ } else {
360
+ error.message = `\u8BF7\u6C42${url ? url : ""}\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u662F\u5426\u5DF2\u8FDE\u63A5`;
361
+ }
362
+ }
363
+ if (!axios.isCancel(error) || !config.noErrorMsg) {
364
+ elementPlus.ElMessage.error({
365
+ message: error.message,
366
+ type: "error",
367
+ duration: 2e3,
368
+ dangerouslyUseHTMLString: true
369
+ });
370
+ }
371
+ return Promise.reject(error);
372
+ }
373
+ );
374
+ const fetch = instance.request;
375
+
376
+ const vPermisson = {
377
+ name: "permission",
378
+ mounted(el, binding) {
379
+ const { arg, value } = binding.value;
380
+ if (!arg && !value) {
381
+ return;
382
+ }
383
+ el.style.display = "none";
384
+ const permission = `${arg}:${value}`;
385
+ checkPermission(permission, el);
386
+ },
387
+ updated(el, binding) {
388
+ const { arg, value } = binding.value;
389
+ if (!arg && !value) {
390
+ if (el.style.display === "none") {
391
+ el.style.display = "";
392
+ }
393
+ return;
394
+ }
395
+ const permission = `${arg}:${value}`;
396
+ checkPermission(permission, el);
397
+ }
398
+ };
399
+ async function checkPermission(permission, el) {
400
+ const { data: roles = [] } = await queryRoles();
401
+ const hasPermission = roles.indexOf(permission) > -1;
402
+ if (!hasPermission) {
403
+ el && el.parentNode && el.parentNode.removeChild(el);
404
+ } else {
405
+ el.style.display = "";
406
+ }
407
+ return hasPermission;
408
+ }
409
+ let requestPromise = null;
410
+ async function queryRoles() {
411
+ try {
412
+ if (requestPromise) {
413
+ return requestPromise;
414
+ }
415
+ requestPromise = fetch({
416
+ url: "/api-u/api/saas/user/appButtonRoleList",
417
+ loading: true,
418
+ noErrorMsg: true
419
+ });
420
+ return requestPromise;
421
+ } catch (error) {
422
+ console.error(error);
423
+ return { data: [] };
424
+ }
425
+ }
426
+
427
+ const bem$1 = createNameSpace("button");
428
+ var Buttons = /* @__PURE__ */ vue.defineComponent({
429
+ name: "EpButtons",
430
+ directives: {
431
+ [vRepeatClick.name]: vRepeatClick,
432
+ [vPermisson.name]: vPermisson
433
+ },
434
+ inheritAttrs: false,
435
+ props: buttonsProps,
436
+ setup(props, {
437
+ emit
438
+ }) {
439
+ const {
440
+ list,
441
+ ...buttonProps
442
+ } = props;
443
+ const customList = vue.computed(() => {
444
+ return list.filter((button) => {
445
+ if ("show" in button) {
446
+ return typeof button.show === "function" ? button.show(button) : button.show;
447
+ } else if ("hide" in button) {
448
+ return typeof button.hide === "function" ? !button.hide(button) : !button.hide;
449
+ }
450
+ return true;
451
+ });
452
+ });
453
+ const clickFn = async (item) => {
454
+ if (item.confirm) {
455
+ const confirmText = item.confirmText || `\u786E\u5B9A\u8981${item.name}\u5417\uFF1F`;
456
+ await elementPlus.ElMessageBox.confirm(confirmText, "Warning", {
457
+ confirmButtonText: "\u786E\u5B9A",
458
+ cancelButtonText: "\u53D6\u6D88",
459
+ type: "warning"
460
+ });
461
+ }
462
+ item.onClick();
463
+ };
464
+ return () => vue.createVNode(vue.Fragment, null, [customList.value.map((item) => {
465
+ const permissionArr = item.permission?.split(":") || [];
466
+ return vue.withDirectives(vue.createVNode(vue.resolveComponent("el-button"), vue.mergeProps({
467
+ "class": [bem$1.b(), prepareClassNames()],
468
+ "style": prepareStyles(),
469
+ "key": item.prop || item.name
470
+ }, {
471
+ ...prepareProps(buttonProps),
472
+ ...prepareProps(item, ["scopedSlots", "name", "onClick"])
473
+ }), {
474
+ default: () => item.name,
475
+ ...item.scopedSlots
476
+ }), [[vue.resolveDirective("repeat-click"), typeof item.onClick === "function" ? {
477
+ handler: () => clickFn(item),
478
+ immediate: true
479
+ } : () => clickFn(item)], [vue.resolveDirective("permission"), {
480
+ arg: permissionArr[0],
481
+ value: permissionArr[1]
482
+ }]]);
483
+ })]);
484
+ }
485
+ });
486
+
487
+ function withInstall(comp) {
488
+ comp.install = (app) => {
489
+ app.component(comp.name, comp);
490
+ };
491
+ return comp;
492
+ }
493
+
494
+ const EpButtons = withInstall(Buttons);
495
+
496
+ const expandFormProps = {
497
+ // 表单列表
498
+ formItemList: {
499
+ type: Array,
500
+ default: () => []
501
+ },
502
+ // 是否显示折叠
503
+ isShowFold: Boolean,
504
+ // 最大显示的表单数
505
+ showFieldCount: {
506
+ type: Number,
507
+ default: 8
508
+ },
509
+ // 每行的列数
510
+ col: {
511
+ type: Number,
512
+ default: 4
513
+ }
514
+ };
515
+ const formProps = {
516
+ ...elementPlus.formProps,
517
+ ...expandFormProps,
518
+ size: {
519
+ ...elementPlus.formProps.size,
520
+ default: "small"
521
+ },
522
+ // 标签的长度
523
+ labelWidth: {
524
+ ...elementPlus.formProps.labelWidth,
525
+ default: 120
526
+ },
527
+ scrollIntoViewOptions: {
528
+ ...elementPlus.formProps.scrollIntoViewOptions,
529
+ default: () => {
530
+ return { inline: "center" };
531
+ }
532
+ }
533
+ };
534
+ const expandFormPropsKeys = Object.keys(expandFormProps);
535
+ const formEmits = {
536
+ ...elementPlus.formEmits,
537
+ toggleStatus: (status) => true
538
+ // 折叠状态切换时触发
539
+ };
540
+ const formEmitsKeys = Object.keys(formEmits);
541
+
542
+ const useCollapse = ({ isShowFold, showFieldCount, filterFormItemList }, emit) => {
543
+ const open = vue.ref(false);
544
+ const toggleStatus = () => {
545
+ open.value = !open.value;
546
+ emit("toggleStatus", open.value);
547
+ };
548
+ const isShowFoldBtn = vue.computed(() => {
549
+ return isShowFold && filterFormItemList.value.length > showFieldCount;
550
+ });
551
+ const isShowFormItem = (index) => {
552
+ return index < showFieldCount || open.value || !isShowFoldBtn.value;
553
+ };
554
+ return {
555
+ open,
556
+ toggleStatus,
557
+ isShowFoldBtn,
558
+ isShowFormItem
559
+ };
560
+ };
561
+ const useForm$1 = (props) => {
562
+ const elFormRef = vue.useTemplateRef("elFormRef");
563
+ const filterFormItemList = vue.computed(() => {
564
+ return props.formItemList.filter((item) => {
565
+ if ("show" in item) {
566
+ return typeof item.show === "function" ? item.show(item) : item.show;
567
+ } else if ("hide" in item) {
568
+ return typeof item.hide === "function" ? !item.hide(item) : !item.hide;
569
+ }
570
+ return true;
571
+ });
572
+ });
573
+ const validate = () => {
574
+ return elFormRef.value.validate();
575
+ };
576
+ const resetFields = (props2) => {
577
+ return elFormRef.value.resetFields(props2);
578
+ };
579
+ const clearValidate = (props2) => {
580
+ return elFormRef.value.clearValidate(props2);
581
+ };
582
+ return {
583
+ filterFormItemList,
584
+ elFormRef,
585
+ validate,
586
+ resetFields,
587
+ clearValidate
588
+ };
589
+ };
590
+
591
+ const useFormItemSlots = (props) => {
592
+ const attrs = vue.useAttrs();
593
+ const {
594
+ type,
595
+ label,
596
+ render,
597
+ required,
598
+ labelRender
599
+ } = props;
600
+ const prop = props.tableProp || props.prop;
601
+ const {
602
+ scopedSlots: renderScopedSlots,
603
+ ...renderProps
604
+ } = props.props || {};
605
+ const events = {};
606
+ for (const key in attrs) {
607
+ if (key.startsWith("on")) {
608
+ events[key] = attrs[key];
609
+ }
610
+ }
611
+ const formData = attrs["form-data"];
612
+ const scopedSlots = {
613
+ default: () => {
614
+ return type ? vue.h(vue.resolveComponent(type), {
615
+ modelValue: formData[prop],
616
+ "onUpdate:modelValue": (value) => {
617
+ formData[prop] = value;
618
+ },
619
+ ...renderProps,
620
+ ...events
621
+ }, renderScopedSlots) : formData[prop];
622
+ },
623
+ label: () => {
624
+ return vue.createVNode(vue.resolveComponent("el-tooltip"), {
625
+ "placement": "top",
626
+ "effect": "light",
627
+ "content": label,
628
+ "disabled": !props.isShowLabel
629
+ }, {
630
+ default: () => [vue.createVNode("span", null, [!props.hideRequiredAsterisk && required ? vue.createVNode("span", {
631
+ "style": "color: var(--el-color-danger);"
632
+ }, [vue.createTextVNode("*")]) : null, props.isShowLabel ? vue.createVNode("span", null, [label]) : ""])]
633
+ });
634
+ }
635
+ };
636
+ if (labelRender) {
637
+ scopedSlots.label = () => labelRender({
638
+ label
639
+ });
640
+ }
641
+ if (render) {
642
+ scopedSlots.default = render;
643
+ }
644
+ return {
645
+ scopedSlots
646
+ };
647
+ };
648
+ const useFormItemRules = (props) => {
649
+ const {
650
+ required,
651
+ rules,
652
+ label
653
+ } = props;
654
+ let mergeRules = [];
655
+ if (required) {
656
+ const requiredDefault = {
657
+ required: true
658
+ };
659
+ mergeRules.push(requiredDefault);
660
+ }
661
+ if (rules) {
662
+ if (Array.isArray(rules)) {
663
+ mergeRules = mergeRules.concat(rules);
664
+ }
665
+ if (Object.prototype.toString.call(rules) === "[object Object]") {
666
+ mergeRules.push(rules);
667
+ }
668
+ }
669
+ if (mergeRules) {
670
+ mergeRules.forEach((r) => {
671
+ if (r.required && typeof r.message === "undefined") {
672
+ r.message = `${label || ""}\u4E0D\u80FD\u4E3A\u7A7A`;
673
+ }
674
+ });
675
+ }
676
+ return {
677
+ rules: mergeRules
678
+ };
679
+ };
680
+
681
+ const expandFormItemProps = {
682
+ type: {
683
+ type: String
684
+ // default: 'EpInput',
685
+ },
686
+ col: Number,
687
+ render: Function,
688
+ labelRender: Function,
689
+ props: Object,
690
+ ...visibleProps,
691
+ class: String,
692
+ style: {
693
+ type: [String, Object]
694
+ },
695
+ isShowLabel: {
696
+ type: Boolean,
697
+ default: true
698
+ },
699
+ hideRequiredAsterisk: Boolean,
700
+ tableProp: String
701
+ // 用于table里的表单需要绑定的prop
702
+ };
703
+ const formItemProps = {
704
+ ...elementPlus.formItemProps,
705
+ ...expandFormItemProps
706
+ };
707
+ const expandFormItemPropsKeys = Object.keys(expandFormItemProps);
708
+
709
+ const bem = createNameSpace("form-item");
710
+ var EpFormItem = /* @__PURE__ */ vue.defineComponent({
711
+ name: "EpFormItem",
712
+ inheritAttrs: false,
713
+ props: formItemProps,
714
+ setup(props, {
715
+ emit
716
+ }) {
717
+ const attrs = vue.useAttrs();
718
+ const {
719
+ scopedSlots
720
+ } = useFormItemSlots(props);
721
+ const {
722
+ rules
723
+ } = useFormItemRules(props);
724
+ const {
725
+ props: childProps,
726
+ ...formItemProps2
727
+ } = props;
728
+ return () => {
729
+ return vue.createVNode(vue.resolveComponent("el-form-item"), vue.mergeProps({
730
+ "class": [bem.b(), prepareClassNames()],
731
+ "style": prepareStyles()
732
+ }, {
733
+ ...prepareProps(formItemProps2, [...expandFormItemPropsKeys]),
734
+ rules,
735
+ "label-width": attrs["form-label-width"]
736
+ }), scopedSlots);
737
+ };
738
+ }
739
+ });
740
+
741
+ var _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
742
+ ...{
743
+ name: "EpForm",
744
+ inheritAttrs: false
745
+ },
746
+ __name: "form",
747
+ props: /* @__PURE__ */ vue.mergeModels(formProps, {
748
+ "modelValue": { type: Object, ...{
749
+ default: () => vue.reactive({})
750
+ } },
751
+ "modelModifiers": {}
752
+ }),
753
+ emits: /* @__PURE__ */ vue.mergeModels(formEmits, ["update:modelValue"]),
754
+ setup(__props, { expose: __expose, emit: __emit }) {
755
+ const bem = createNameSpace("form");
756
+ const props = __props;
757
+ const emit = __emit;
758
+ const customAttrs = vue.computed(() => {
759
+ return {
760
+ ...prepareProps(props, ["modelValue", "model", ...expandFormPropsKeys]),
761
+ hideRequiredAsterisk: true,
762
+ // 隐藏必填星号, 使用自己的*
763
+ scrollToError: true,
764
+ ...prepareEvents(emit, formEmitsKeys)
765
+ };
766
+ });
767
+ const formData = vue.useModel(__props, "modelValue");
768
+ const { filterFormItemList, elFormRef, validate, resetFields, clearValidate } = useForm$1(props);
769
+ const { open, toggleStatus, isShowFoldBtn, isShowFormItem } = useCollapse(
770
+ {
771
+ filterFormItemList,
772
+ isShowFold: props.isShowFold,
773
+ showFieldCount: props.showFieldCount
774
+ },
775
+ emit
776
+ );
777
+ __expose({
778
+ elFormRef,
779
+ validate,
780
+ resetFields,
781
+ clearValidate
782
+ });
783
+ return (_ctx, _cache) => {
784
+ const _component_el_col = vue.resolveComponent("el-col");
785
+ const _component_el_row = vue.resolveComponent("el-row");
786
+ const _component_el_form = vue.resolveComponent("el-form");
787
+ return vue.openBlock(), vue.createElementBlock(
788
+ "div",
789
+ {
790
+ class: vue.normalizeClass([
791
+ vue.unref(bem).b(),
792
+ vue.unref(prepareClassNames)(),
793
+ vue.unref(bem).is("open", vue.unref(open)),
794
+ vue.unref(bem).is("fold", vue.unref(isShowFoldBtn))
795
+ ]),
796
+ style: vue.normalizeStyle({
797
+ ...vue.unref(prepareStyles)()
798
+ })
799
+ },
800
+ [
801
+ vue.createVNode(_component_el_form, vue.mergeProps({
802
+ ref_key: "elFormRef",
803
+ ref: elFormRef,
804
+ model: formData.value
805
+ }, customAttrs.value), {
806
+ default: vue.withCtx(() => [
807
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
808
+ vue.createVNode(_component_el_row, null, {
809
+ default: vue.withCtx(() => [
810
+ (vue.openBlock(true), vue.createElementBlock(
811
+ vue.Fragment,
812
+ null,
813
+ vue.renderList(vue.unref(filterFormItemList), (item, index) => {
814
+ return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, {
815
+ key: item.prop || index,
816
+ class: vue.normalizeClass(vue.unref(bem).e("col")),
817
+ span: item.col || 24 / _ctx.col
818
+ }, {
819
+ default: vue.withCtx(() => [
820
+ vue.createVNode(vue.unref(EpFormItem), vue.mergeProps({
821
+ "form-data": formData.value,
822
+ "form-label-width": _ctx.labelWidth
823
+ }, { ref_for: true }, item), null, 16, ["form-data", "form-label-width"])
824
+ ]),
825
+ _: 2
826
+ /* DYNAMIC */
827
+ }, 1032, ["class", "span"])), [
828
+ [vue.vShow, vue.unref(isShowFormItem)(index)]
829
+ ]);
830
+ }),
831
+ 128
832
+ /* KEYED_FRAGMENT */
833
+ ))
834
+ ]),
835
+ _: 1
836
+ /* STABLE */
837
+ })
838
+ ])
839
+ ]),
840
+ _: 3
841
+ /* FORWARDED */
842
+ }, 16, ["model"]),
843
+ vue.unref(isShowFoldBtn) ? (vue.openBlock(), vue.createElementBlock("div", {
844
+ key: 0,
845
+ class: vue.normalizeClass(vue.unref(bem).e("fold")),
846
+ onClick: vue.unref(toggleStatus)
847
+ }, vue.toDisplayString(vue.unref(open) ? "\u6536\u8D77" : "\u66F4\u591A"), 11, ["onClick"])) : vue.createCommentVNode("v-if", true)
848
+ ],
849
+ 6
850
+ /* CLASS, STYLE */
851
+ );
852
+ };
853
+ }
854
+ });
855
+
856
+ const EpForm = withInstall(_sfc_main$4);
857
+
858
+ const inputProps = {
859
+ ...elementPlus.inputProps,
860
+ max: Number,
861
+ min: Number,
862
+ radix: Number,
863
+ nonzero: Boolean,
864
+ placeholder: {
865
+ type: String,
866
+ default: "\u8BF7\u8F93\u5165"
867
+ },
868
+ thousand: {
869
+ type: Boolean,
870
+ default: true
871
+ },
872
+ clearable: {
873
+ ...elementPlus.inputProps.clearable,
874
+ default: true
875
+ }
876
+ };
877
+ const inputEmits = {
878
+ ...elementPlus.inputEmits
879
+ };
880
+ const inputEmitsKeys = Object.keys(inputEmits);
881
+
882
+ var _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
883
+ ...{
884
+ name: "EpInput",
885
+ inheritAttrs: false
886
+ },
887
+ __name: "input",
888
+ props: /* @__PURE__ */ vue.mergeModels(inputProps, {
889
+ "modelValue": { type: null },
890
+ "modelModifiers": {}
891
+ }),
892
+ emits: /* @__PURE__ */ vue.mergeModels(inputEmits, ["update:modelValue"]),
893
+ setup(__props, { emit: __emit }) {
894
+ const bem = createNameSpace("input");
895
+ const props = __props;
896
+ const emit = __emit;
897
+ const slots = vue.computed(() => {
898
+ return Object.keys(vue.useSlots());
899
+ });
900
+ let isBluring = false;
901
+ let isFocusing = false;
902
+ const customAttrs = vue.computed(() => {
903
+ return {
904
+ ...prepareProps(props, ["modelValue"]),
905
+ ...prepareEvents(emit, inputEmitsKeys),
906
+ placeholder: props.disabled ? "" : props.placeholder,
907
+ onFocus: (e) => {
908
+ isFocusing = true;
909
+ if (props.thousand) {
910
+ e.target.value = value.value ? String(value.value) : "";
911
+ }
912
+ emit("focus", e);
913
+ },
914
+ onBlur: (e) => {
915
+ if (props.type === "number") {
916
+ let val = value.value;
917
+ if (props.nonzero && +val === 0) {
918
+ val = "";
919
+ }
920
+ if (val && val[val.length - 1] === ".") {
921
+ val = String(val).slice(0, -1);
922
+ }
923
+ if (val && val === "-") {
924
+ val = "";
925
+ }
926
+ value.value = val ? +val : val;
927
+ e.target.value = toThousand(value.value);
928
+ }
929
+ isBluring = true;
930
+ isFocusing = false;
931
+ emit("blur", e);
932
+ }
933
+ };
934
+ });
935
+ const value = vue.useModel(__props, "modelValue");
936
+ const inputRef = vue.ref();
937
+ const toThousand = (val) => {
938
+ if (props.thousand) {
939
+ return val ? window.hx.thousand(val) : val;
940
+ }
941
+ return val;
942
+ };
943
+ vue.watch(
944
+ () => value.value,
945
+ (val) => {
946
+ if (props.type === "number") {
947
+ vue.onMounted(() => {
948
+ inputRef.value.input.value = toThousand(val);
949
+ });
950
+ }
951
+ if (isBluring) {
952
+ isBluring = false;
953
+ return;
954
+ }
955
+ if (!isFocusing) {
956
+ return;
957
+ }
958
+ if (props.type === "number") {
959
+ if (typeof val === "number") {
960
+ val = "" + val;
961
+ }
962
+ if (typeof val === "string") {
963
+ const zeroReg = new RegExp("^[-+]?0[0-9]\\d*");
964
+ if (zeroReg.test(val)) {
965
+ val = val.replace("0", "");
966
+ }
967
+ const reg = new RegExp("^([-+])?\\d*(\\.?\\d*)", "g");
968
+ val = val.match(reg) ? val.match(reg)[0] : "";
969
+ if (props.radix || props.radix === 0) {
970
+ const reg2 = props.radix === 0 ? new RegExp("^([-+])?\\d*", "g") : new RegExp(`^([-+])?\\d*(\\.?\\d{0,${props.radix}})`, "g");
971
+ val = val.match(reg2) ? val.match(reg2)[0] : "";
972
+ }
973
+ if ((props.max || props.max === 0) && +val > props.max) {
974
+ val = props.max;
975
+ }
976
+ if ((props.min || props.min === 0) && (val || val === 0) && +val < props.min) {
977
+ val = props.min;
978
+ }
979
+ }
980
+ } else if (props.type === "text") {
981
+ val = val.trim();
982
+ }
983
+ value.value = val;
984
+ },
985
+ {
986
+ immediate: true
987
+ }
988
+ );
989
+ return (_ctx, _cache) => {
990
+ const _component_el_input = vue.resolveComponent("el-input");
991
+ return vue.openBlock(), vue.createBlock(_component_el_input, vue.mergeProps({
992
+ ref_key: "inputRef",
993
+ ref: inputRef,
994
+ modelValue: value.value,
995
+ "onUpdate:modelValue": ($event) => value.value = $event,
996
+ class: `${vue.unref(bem).b()} ${vue.unref(prepareClassNames)()}`,
997
+ style: {
998
+ ...vue.unref(prepareStyles)()
999
+ }
1000
+ }, customAttrs.value, {
1001
+ type: _ctx.type === "number" ? "text" : _ctx.type
1002
+ }), vue.createSlots({
1003
+ _: 2
1004
+ /* DYNAMIC */
1005
+ }, [
1006
+ vue.renderList(slots.value, (name) => {
1007
+ return {
1008
+ name,
1009
+ fn: vue.withCtx((scope) => [
1010
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(scope)))
1011
+ ])
1012
+ };
1013
+ })
1014
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "class", "style", "type"]);
1015
+ };
1016
+ }
1017
+ });
1018
+
1019
+ const EpInput = withInstall(_sfc_main$3);
1020
+
1021
+ const inheritTableProps = {
1022
+ ...elTableProps,
1023
+ // Table 的尺寸
1024
+ size: {
1025
+ ...elTableProps.size,
1026
+ default: "default"
1027
+ },
1028
+ // 是否带有纵向边框
1029
+ border: {
1030
+ ...elTableProps.border,
1031
+ default: true
1032
+ },
1033
+ // 表头样式
1034
+ headerCellStyle: {
1035
+ ...elTableProps.headerCellStyle,
1036
+ default: () => ({
1037
+ background: "#EEEFF3",
1038
+ // textAlign: 'center',
1039
+ fontSize: "14px",
1040
+ color: "#505050"
1041
+ })
1042
+ }
1043
+ };
1044
+ const expandTableProps = {
1045
+ ...apiProps,
1046
+ columns: {
1047
+ type: Array,
1048
+ default: () => []
1049
+ },
1050
+ // 是否显示勾选列
1051
+ showSelectionCol: Boolean,
1052
+ // 是否显示序号列
1053
+ showIndexCol: {
1054
+ type: Boolean,
1055
+ default: true
1056
+ },
1057
+ // 对齐方式
1058
+ align: {
1059
+ type: String,
1060
+ default: "center"
1061
+ },
1062
+ // 序号列自定义
1063
+ indexFormatter: {
1064
+ type: [Number, Function]
1065
+ },
1066
+ disabled: Boolean,
1067
+ reserveSelection: Boolean,
1068
+ selectable: {
1069
+ type: Function
1070
+ },
1071
+ paginationProps: {
1072
+ type: Object,
1073
+ default: () => ({})
1074
+ },
1075
+ showPagination: Boolean,
1076
+ isFrontPage: Boolean,
1077
+ // 操作列
1078
+ actionButtons: {
1079
+ type: Array,
1080
+ default: () => []
1081
+ },
1082
+ // 链接列
1083
+ linkProps: {
1084
+ type: Array,
1085
+ default: () => []
1086
+ }
1087
+ };
1088
+ const tableProps = {
1089
+ ...inheritTableProps,
1090
+ ...expandTableProps
1091
+ };
1092
+ const expandTablePropsKeys = Object.keys(expandTableProps);
1093
+ const tableEmits = elementPlus.ElTable.emits;
1094
+ const tableEmitsKeys = tableEmits;
1095
+
1096
+ const useRequest = ({
1097
+ api,
1098
+ method,
1099
+ reqData,
1100
+ reqParams,
1101
+ reqBefore,
1102
+ reqAfter,
1103
+ cancelToken,
1104
+ hooks
1105
+ }) => {
1106
+ if (!api) return {};
1107
+ const loading = vue.ref(false);
1108
+ let cancelRequest;
1109
+ let apiFn;
1110
+ if (typeof api === "string") {
1111
+ const config = {
1112
+ url: api,
1113
+ method
1114
+ };
1115
+ if (cancelToken) {
1116
+ config.cancelRequest = (cancel) => {
1117
+ cancelRequest = cancel;
1118
+ };
1119
+ }
1120
+ apiFn = (data = {}, params) => {
1121
+ if (config.method === "get") {
1122
+ config.params = data;
1123
+ } else {
1124
+ config.data = data;
1125
+ config.params = params;
1126
+ }
1127
+ config.data = {
1128
+ ...reqData,
1129
+ ...config.data
1130
+ };
1131
+ config.params = {
1132
+ ...reqParams,
1133
+ ...config.params
1134
+ };
1135
+ if (data.$query) {
1136
+ config.data[data.$query] = data.$searchValue;
1137
+ delete data.$searchValue;
1138
+ }
1139
+ if (reqBefore) {
1140
+ reqBefore(config);
1141
+ }
1142
+ return fetch(config);
1143
+ };
1144
+ } else {
1145
+ apiFn = api;
1146
+ }
1147
+ const requestFn = async (data = {}) => {
1148
+ if (loading.value && !cancelToken) return;
1149
+ loading.value = true;
1150
+ try {
1151
+ cancelRequest && cancelRequest();
1152
+ const res = await apiFn(data);
1153
+ if (reqAfter) {
1154
+ reqAfter(res);
1155
+ }
1156
+ if (hooks?.success) {
1157
+ hooks.success(res.data);
1158
+ }
1159
+ } catch (error) {
1160
+ if (hooks?.fail) {
1161
+ hooks.fail(error);
1162
+ }
1163
+ } finally {
1164
+ loading.value = false;
1165
+ }
1166
+ };
1167
+ return {
1168
+ loading,
1169
+ requestFn
1170
+ };
1171
+ };
1172
+
1173
+ const useTable$1 = (props) => {
1174
+ const elFormRef = vue.useTemplateRef("elFormRef");
1175
+ const elTableRef = vue.useTemplateRef("elTableRef");
1176
+ const customData = vue.ref([]);
1177
+ const {
1178
+ loading,
1179
+ requestFn
1180
+ } = useRequest({
1181
+ api: props.api,
1182
+ method: props.method,
1183
+ reqData: props.reqData,
1184
+ reqParams: props.reqParams,
1185
+ reqBefore: props.reqBefore,
1186
+ reqAfter: props.reqAfter,
1187
+ cancelToken: true,
1188
+ hooks: {
1189
+ success(data) {
1190
+ if (Array.isArray(data)) {
1191
+ customData.value = data;
1192
+ } else if (data && typeof data === "object") {
1193
+ const rawData = data;
1194
+ customData.value = rawData?.list || rawData?.data || [];
1195
+ } else {
1196
+ customData.value = [];
1197
+ }
1198
+ if (props.showPagination) {
1199
+ pagination.total = (props.isFrontPage ? customData.value.length : data.total) || 0;
1200
+ }
1201
+ },
1202
+ fail(error) {
1203
+ console.error(error);
1204
+ }
1205
+ }
1206
+ });
1207
+ const search = (init = false, isPagination = false) => {
1208
+ if (init) {
1209
+ pagination.pageNo = 1;
1210
+ }
1211
+ if (isPagination && props.isFrontPage) {
1212
+ const {
1213
+ pageNo,
1214
+ pageSize
1215
+ } = pagination;
1216
+ const data = customData.value.filter((item, index) => {
1217
+ return index < pageNo * pageSize && index >= (pageNo - 1) * pageSize;
1218
+ });
1219
+ customData.value = data;
1220
+ } else {
1221
+ if (props.api) {
1222
+ requestFn({
1223
+ pageNo: pagination.pageNo,
1224
+ pageSize: pagination.pageSize
1225
+ });
1226
+ } else if (props.data?.length) {
1227
+ customData.value = props.data;
1228
+ }
1229
+ }
1230
+ };
1231
+ const {
1232
+ pagination,
1233
+ paginationProps
1234
+ } = usePagination(props, search);
1235
+ search(true);
1236
+ const validate = () => {
1237
+ return elFormRef.value.validate();
1238
+ };
1239
+ const resetFields = (props2) => {
1240
+ return elFormRef.value.resetFields(props2);
1241
+ };
1242
+ const clearValidate = (props2) => {
1243
+ return elFormRef.value.clearValidate(props2);
1244
+ };
1245
+ const formatActionButtons = (list, scope) => {
1246
+ return list.map((item) => {
1247
+ if (item.onClick) {
1248
+ item.onClick = item.onClick.bind(null, scope);
1249
+ }
1250
+ return item;
1251
+ });
1252
+ };
1253
+ return {
1254
+ loading,
1255
+ data: customData,
1256
+ search,
1257
+ pagination,
1258
+ paginationProps,
1259
+ validate,
1260
+ resetFields,
1261
+ clearValidate,
1262
+ elFormRef,
1263
+ elTableRef,
1264
+ formatActionButtons
1265
+ };
1266
+ };
1267
+ const usePagination = function(props, search) {
1268
+ const pageSizes = [20, 50, 100, 200];
1269
+ const pagination = vue.reactive({
1270
+ total: 0,
1271
+ pageNo: 1,
1272
+ pageSize: pageSizes[0]
1273
+ });
1274
+ const paginationProps = vue.computed(() => {
1275
+ const defaultPaginationProps = props.paginationProps || {};
1276
+ const onSizeChange = defaultPaginationProps.onSizeChange;
1277
+ const onCurrentChange = defaultPaginationProps.onCurrentChange;
1278
+ return {
1279
+ ...defaultPaginationProps,
1280
+ pageSizes,
1281
+ layout: "total, sizes, prev, pager, next, jumper",
1282
+ onSizeChange: (value) => {
1283
+ onSizeChange && onSizeChange(value);
1284
+ search(true, true);
1285
+ },
1286
+ onCurrentChange: (value) => {
1287
+ onCurrentChange && onCurrentChange(value);
1288
+ search(false, true);
1289
+ }
1290
+ };
1291
+ });
1292
+ return {
1293
+ pagination,
1294
+ paginationProps
1295
+ };
1296
+ };
1297
+ const useTableColumn = (props, tableData) => {
1298
+ const columnProps = (column) => {
1299
+ const attrs = {
1300
+ align: column.align || props.align
1301
+ // ...prepareEvents<TableEmits>(emit, tableEmits),
1302
+ };
1303
+ if (!column.renderHeader) {
1304
+ let required = column.required;
1305
+ if (typeof column.required === "function") {
1306
+ required = column.required();
1307
+ }
1308
+ if (required) {
1309
+ attrs["renderHeader"] = (data) => {
1310
+ const {
1311
+ column: column2
1312
+ } = data;
1313
+ return vue.createVNode("span", null, [vue.createVNode("span", {
1314
+ "style": "color:var(--el-color-danger)"
1315
+ }, [vue.createTextVNode(" * ")]), column2.label]);
1316
+ };
1317
+ }
1318
+ }
1319
+ if (column.headerRender) {
1320
+ attrs.renderHeader = column.headerRender;
1321
+ }
1322
+ if (column.filter) {
1323
+ const arr = tableData.value.map((item) => item[column.prop]);
1324
+ attrs.filters = [...new Set(arr)].map((item) => {
1325
+ return {
1326
+ text: item,
1327
+ value: item
1328
+ };
1329
+ });
1330
+ attrs.filterMethod = (value, row) => {
1331
+ return row[column.prop] === value;
1332
+ };
1333
+ }
1334
+ return {
1335
+ ...attrs,
1336
+ ...prepareProps(column)
1337
+ };
1338
+ };
1339
+ const columnList = vue.computed(() => {
1340
+ return props.columns.filter((column) => {
1341
+ if (props.linkProps.length) {
1342
+ const linkColumn = props.linkProps.find((item) => item.prop === column.prop);
1343
+ if (linkColumn) {
1344
+ column.type = "EpButtons";
1345
+ column.className = "table-column-link";
1346
+ column.props = {
1347
+ list: [linkColumn],
1348
+ type: "text",
1349
+ ...column.props
1350
+ };
1351
+ }
1352
+ }
1353
+ if ("show" in column) {
1354
+ return typeof column.show === "function" ? column.show(column) : column.show;
1355
+ } else if ("hide" in column) {
1356
+ return typeof column.hide === "function" ? !column.hide(column) : !column.hide;
1357
+ }
1358
+ return true;
1359
+ });
1360
+ });
1361
+ return {
1362
+ columnProps,
1363
+ columnList
1364
+ };
1365
+ };
1366
+ const useTableFormItem = (props) => {
1367
+ const formItemProps = (scope, item) => {
1368
+ let required = item.required;
1369
+ if (typeof required === "function") {
1370
+ required = required();
1371
+ }
1372
+ if (item.cellRequired) {
1373
+ required = item.cellRequired(scope);
1374
+ }
1375
+ let disabled = props.disabled;
1376
+ if ("disabled" in item) {
1377
+ if (typeof item.disabled === "function") {
1378
+ disabled = item.disabled(scope);
1379
+ } else {
1380
+ disabled = item.disabled || false;
1381
+ }
1382
+ }
1383
+ if (item.type === "EpSelect" && item.props) {
1384
+ if ("options" in item.props && typeof item.props.options === "function") {
1385
+ item.props.options = item.props.options(scope);
1386
+ }
1387
+ if ("disabledOption" in item.props && typeof item.props.disabledOption === "function") {
1388
+ const disabledOption = item.props.disabledOption;
1389
+ item.props.disabledOption = (...args) => disabledOption(...args, scope);
1390
+ }
1391
+ }
1392
+ if (item.type === "EpButtons" && item.props) {
1393
+ item.props.list.forEach((btnItem) => {
1394
+ if (btnItem.prop) {
1395
+ btnItem.name = scope.row[btnItem.prop];
1396
+ }
1397
+ if (btnItem.onClick) {
1398
+ btnItem.onClick = btnItem.onClick.bind(null, scope);
1399
+ }
1400
+ });
1401
+ }
1402
+ for (const key in item) {
1403
+ if (key.startsWith("on") && typeof item[key] === "function") {
1404
+ const fn = item[key];
1405
+ item[key] = (...args) => fn(...args, scope);
1406
+ }
1407
+ }
1408
+ return {
1409
+ ...prepareProps(item),
1410
+ isShowLabel: false,
1411
+ required,
1412
+ hideRequiredAsterisk: "cellRequired" in item ? false : required,
1413
+ prop: `table.${scope.$index}.${item.prop}`,
1414
+ tableProp: item.prop,
1415
+ // table里的表单需要绑定的prop
1416
+ props: {
1417
+ ...item.props,
1418
+ disabled
1419
+ }
1420
+ };
1421
+ };
1422
+ return {
1423
+ formItemProps
1424
+ };
1425
+ };
1426
+
1427
+ var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1428
+ ...{
1429
+ name: "EpTable",
1430
+ inheritAttrs: false
1431
+ },
1432
+ __name: "table",
1433
+ props: tableProps,
1434
+ emits: tableEmits,
1435
+ setup(__props, {
1436
+ expose: __expose,
1437
+ emit: __emit
1438
+ }) {
1439
+ const bem = createNameSpace("table");
1440
+ const props = __props;
1441
+ const emit = __emit;
1442
+ const slots = vue.computed(() => {
1443
+ return Object.keys(vue.useSlots());
1444
+ });
1445
+ const customAttrs = vue.computed(() => {
1446
+ return {
1447
+ ...prepareProps(props, ["modelValue", ...expandTablePropsKeys]),
1448
+ size: "small",
1449
+ data: data.value,
1450
+ ...prepareEvents(emit, tableEmitsKeys)
1451
+ };
1452
+ });
1453
+ const {
1454
+ pagination,
1455
+ paginationProps,
1456
+ data,
1457
+ validate,
1458
+ resetFields,
1459
+ clearValidate,
1460
+ loading,
1461
+ search,
1462
+ elFormRef,
1463
+ elTableRef,
1464
+ formatActionButtons
1465
+ } = useTable$1(props);
1466
+ const {
1467
+ columnProps,
1468
+ columnList
1469
+ } = useTableColumn(props, data);
1470
+ const {
1471
+ formItemProps
1472
+ } = useTableFormItem(props);
1473
+ __expose({
1474
+ elFormRef,
1475
+ elTableRef,
1476
+ validate,
1477
+ resetFields,
1478
+ clearValidate,
1479
+ search
1480
+ });
1481
+ return (_ctx, _cache) => {
1482
+ const _component_el_table_column = vue.resolveComponent("el-table-column");
1483
+ const _component_EpButtons = vue.resolveComponent("EpButtons");
1484
+ const _component_el_table = vue.resolveComponent("el-table");
1485
+ const _component_el_form = vue.resolveComponent("el-form");
1486
+ const _component_el_pagination = vue.resolveComponent("el-pagination");
1487
+ const _directive_loading = vue.resolveDirective("loading");
1488
+ return vue.openBlock(), vue.createElementBlock(
1489
+ "div",
1490
+ {
1491
+ class: vue.normalizeClass(`${vue.unref(bem).b()} ${vue.unref(prepareClassNames)()}`),
1492
+ style: vue.normalizeStyle({
1493
+ ...vue.unref(prepareStyles)()
1494
+ })
1495
+ },
1496
+ [vue.createVNode(_component_el_form, {
1497
+ ref_key: "elFormRef",
1498
+ ref: elFormRef,
1499
+ model: {
1500
+ table: vue.unref(data)
1501
+ },
1502
+ size: "small",
1503
+ "hide-required-asterisk": "",
1504
+ "scroll-to-error": "",
1505
+ "scroll-into-view-options": {
1506
+ inline: "center"
1507
+ },
1508
+ class: "ep-form"
1509
+ }, {
1510
+ default: vue.withCtx(() => [vue.withDirectives((vue.openBlock(), vue.createBlock(
1511
+ _component_el_table,
1512
+ vue.mergeProps({
1513
+ ref_key: "elTableRef",
1514
+ ref: elTableRef
1515
+ }, customAttrs.value),
1516
+ vue.createSlots({
1517
+ default: vue.withCtx(() => [_ctx.showSelectionCol ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
1518
+ key: 0,
1519
+ type: "selection",
1520
+ width: "55",
1521
+ align: _ctx.align,
1522
+ selectable: _ctx.selectable,
1523
+ fixed: ""
1524
+ }, null, 8, ["align", "selectable"])) : vue.createCommentVNode("v-if", true), _ctx.showIndexCol ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
1525
+ key: 1,
1526
+ type: "index",
1527
+ width: "56",
1528
+ align: _ctx.align,
1529
+ label: "\u5E8F\u53F7",
1530
+ fixed: "",
1531
+ index: _ctx.indexFormatter
1532
+ }, null, 8, ["align", "index"])) : vue.createCommentVNode("v-if", true), _ctx.actionButtons.length ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
1533
+ key: 2,
1534
+ label: "\u64CD\u4F5C",
1535
+ align: _ctx.align,
1536
+ fixed: "",
1537
+ width: "200"
1538
+ }, {
1539
+ default: vue.withCtx((scope) => [vue.createElementVNode(
1540
+ "span",
1541
+ {
1542
+ class: vue.normalizeClass(vue.unref(bem).e("action-buttons"))
1543
+ },
1544
+ [vue.createVNode(_component_EpButtons, {
1545
+ list: vue.unref(formatActionButtons)(_ctx.actionButtons, scope),
1546
+ type: "text"
1547
+ }, null, 8, ["list"])],
1548
+ 2
1549
+ /* CLASS */
1550
+ )]),
1551
+ _: 1
1552
+ /* STABLE */
1553
+ }, 8, ["align"])) : vue.createCommentVNode("v-if", true), (vue.openBlock(true), vue.createElementBlock(
1554
+ vue.Fragment,
1555
+ null,
1556
+ vue.renderList(vue.unref(columnList), (item, index) => {
1557
+ return vue.openBlock(), vue.createBlock(
1558
+ _component_el_table_column,
1559
+ vue.mergeProps({
1560
+ key: index
1561
+ }, {
1562
+ ref_for: true
1563
+ }, vue.unref(columnProps)(item)),
1564
+ {
1565
+ default: vue.withCtx((scope) => [item.type ? (vue.openBlock(), vue.createBlock(vue.unref(EpFormItem), vue.mergeProps({
1566
+ key: 0,
1567
+ "form-data": scope.row
1568
+ }, {
1569
+ ref_for: true
1570
+ }, vue.unref(formItemProps)(scope, item)), null, 16, ["form-data"])) : (vue.openBlock(), vue.createElementBlock(
1571
+ vue.Fragment,
1572
+ {
1573
+ key: 1
1574
+ },
1575
+ [vue.createTextVNode(
1576
+ vue.toDisplayString(scope.row[item.prop]),
1577
+ 1
1578
+ /* TEXT */
1579
+ )],
1580
+ 64
1581
+ /* STABLE_FRAGMENT */
1582
+ ))]),
1583
+ _: 2
1584
+ /* DYNAMIC */
1585
+ },
1586
+ 1040
1587
+ /* FULL_PROPS, DYNAMIC_SLOTS */
1588
+ );
1589
+ }),
1590
+ 128
1591
+ /* KEYED_FRAGMENT */
1592
+ ))]),
1593
+ _: 2
1594
+ /* DYNAMIC */
1595
+ }, [vue.renderList(slots.value, (name) => {
1596
+ return {
1597
+ name,
1598
+ fn: vue.withCtx((scope) => [vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(scope)))])
1599
+ };
1600
+ })]),
1601
+ 1040
1602
+ /* FULL_PROPS, DYNAMIC_SLOTS */
1603
+ )), [[_directive_loading, vue.unref(loading)]])]),
1604
+ _: 3
1605
+ /* FORWARDED */
1606
+ }, 8, ["model"]), _ctx.showPagination ? (vue.openBlock(), vue.createBlock(_component_el_pagination, vue.mergeProps({
1607
+ key: 0,
1608
+ "current-page": vue.unref(pagination).pageNo,
1609
+ "onUpdate:currentPage": ($event) => vue.unref(pagination).pageNo = $event,
1610
+ "page-size": vue.unref(pagination).pageSize,
1611
+ "onUpdate:pageSize": ($event) => vue.unref(pagination).pageSize = $event,
1612
+ total: vue.unref(pagination).total
1613
+ }, vue.unref(paginationProps)), null, 16, ["current-page", "onUpdate:currentPage", "page-size", "onUpdate:pageSize", "total"])) : vue.createCommentVNode("v-if", true)],
1614
+ 6
1615
+ /* CLASS, STYLE */
1616
+ );
1617
+ };
1618
+ }
1619
+ });
1620
+
1621
+ const EpTable = withInstall(_sfc_main$2);
1622
+
1623
+ console.log(formProps.formItemList);
1624
+ const searchListPageProps = {
1625
+ ...apiProps,
1626
+ customColumnModule: Number,
1627
+ // 自定义列模块
1628
+ showOperationColumn: Boolean,
1629
+ // 是否显示操作列
1630
+ // 表单列表
1631
+ formItemList: {
1632
+ ...formProps.formItemList
1633
+ },
1634
+ // 左侧按钮
1635
+ leftButtons: {
1636
+ ...buttonsProps.list
1637
+ },
1638
+ // 表格列
1639
+ columns: {
1640
+ ...tableProps.columns
1641
+ },
1642
+ // 操作列
1643
+ actionButtons: {
1644
+ ...tableProps.actionButtons
1645
+ },
1646
+ // 链接列
1647
+ linkProps: {
1648
+ ...tableProps.linkProps
1649
+ },
1650
+ showSelectionCol: Boolean,
1651
+ showIndexCol: {
1652
+ type: Boolean,
1653
+ default: true
1654
+ },
1655
+ add: Function,
1656
+ // 新增
1657
+ templateDownloadApi: String,
1658
+ // 模板下载
1659
+ importApi: String,
1660
+ // 导入
1661
+ exportApi: String,
1662
+ // 导出
1663
+ // 表格额外距离
1664
+ offsetTop: {
1665
+ type: Number,
1666
+ default: 0
1667
+ },
1668
+ formData: {
1669
+ type: Object,
1670
+ default: () => ({})
1671
+ },
1672
+ tableProps: Object,
1673
+ formProps: Object,
1674
+ buttonsProps: Object
1675
+ };
1676
+
1677
+ const useSearchListPage = (props) => {
1678
+ const { calcTableHeight, tableProps, tableRef } = useTable(props);
1679
+ const { formProps, validate, resetFields, formRef } = useForm(props, {
1680
+ calcTableHeight
1681
+ });
1682
+ const { buttonsProps, searchButtons, search, reset } = useButtons(props, {
1683
+ validate,
1684
+ resetFields,
1685
+ tableRef
1686
+ });
1687
+ return {
1688
+ formProps,
1689
+ tableProps,
1690
+ buttonsProps,
1691
+ searchButtons,
1692
+ search,
1693
+ reset,
1694
+ tableRef,
1695
+ formRef
1696
+ };
1697
+ };
1698
+ const useTable = (props) => {
1699
+ const instanceName = "tableRef";
1700
+ const tableRef = vue.useTemplateRef(instanceName);
1701
+ const tableHeight = vue.ref(window.innerHeight);
1702
+ const tableProps = vue.computed(() => {
1703
+ return {
1704
+ ref: instanceName,
1705
+ columns: props.columns,
1706
+ showPagination: true,
1707
+ height: tableHeight.value,
1708
+ showIndexCol: props.showIndexCol,
1709
+ showSelectionCol: props.showSelectionCol,
1710
+ actionButtons: props.actionButtons,
1711
+ linkProps: props.linkProps,
1712
+ api: props.api,
1713
+ reqData: props.formData,
1714
+ ...props.tableProps
1715
+ };
1716
+ });
1717
+ const calcTableHeight = () => {
1718
+ const topHeight = document.getElementById("top").offsetHeight;
1719
+ const middleHeight = document.getElementById("middle").offsetHeight;
1720
+ let paginationHeight = 0;
1721
+ if (tableProps.value.showPagination) {
1722
+ paginationHeight = document.querySelector(".el-pagination").offsetHeight + 12;
1723
+ }
1724
+ const frameDistance = 40;
1725
+ tableHeight.value = window.innerHeight - topHeight - middleHeight - paginationHeight - frameDistance - props.offsetTop;
1726
+ };
1727
+ vue.onMounted(calcTableHeight);
1728
+ return {
1729
+ tableRef,
1730
+ tableProps,
1731
+ calcTableHeight
1732
+ };
1733
+ };
1734
+ const useForm = (props, { calcTableHeight }) => {
1735
+ const instanceName = "formRef";
1736
+ const formRef = vue.useTemplateRef(instanceName);
1737
+ const formProps = vue.computed(() => {
1738
+ return {
1739
+ ref: instanceName,
1740
+ formItemList: props.formItemList,
1741
+ isShowFold: true,
1742
+ modelValue: props.formData,
1743
+ ...props.formProps,
1744
+ onToggleStatus: () => {
1745
+ setTimeout(() => {
1746
+ calcTableHeight();
1747
+ }, 0);
1748
+ }
1749
+ };
1750
+ });
1751
+ const validate = () => {
1752
+ return formRef.value.validate();
1753
+ };
1754
+ const resetFields = (props2) => {
1755
+ return formRef.value.resetFields(props2);
1756
+ };
1757
+ const clearValidate = (props2) => {
1758
+ return formRef.value.clearValidate(props2);
1759
+ };
1760
+ return {
1761
+ formProps,
1762
+ formRef,
1763
+ validate,
1764
+ resetFields,
1765
+ clearValidate
1766
+ };
1767
+ };
1768
+ const useButtons = (props, { validate, resetFields, tableRef }) => {
1769
+ const defaultButtons = [
1770
+ {
1771
+ name: "\u65B0\u589E",
1772
+ prop: "add",
1773
+ show: () => {
1774
+ return !!props.add;
1775
+ },
1776
+ onClick: () => {
1777
+ props.add?.();
1778
+ }
1779
+ },
1780
+ {
1781
+ name: "\u6A21\u7248\u4E0B\u8F7D",
1782
+ prop: "templateDownload",
1783
+ show: !!props.templateDownloadApi
1784
+ },
1785
+ {
1786
+ name: "\u5BFC\u5165",
1787
+ prop: "import",
1788
+ show: !!props.importApi
1789
+ },
1790
+ {
1791
+ name: "\u5BFC\u51FA",
1792
+ prop: "export",
1793
+ show: !!props.exportApi
1794
+ }
1795
+ ];
1796
+ props.leftButtons?.forEach((item) => {
1797
+ const defaultIndex = defaultButtons.findIndex(
1798
+ (item1) => item1.prop === item.prop
1799
+ );
1800
+ if (defaultIndex !== -1) {
1801
+ defaultButtons[defaultIndex] = {
1802
+ ...defaultButtons[defaultIndex],
1803
+ ...item
1804
+ };
1805
+ }
1806
+ });
1807
+ const list = defaultButtons.concat(props.leftButtons);
1808
+ list.forEach((item) => {
1809
+ if (item.onClick) {
1810
+ const clickFn = item.onClick;
1811
+ item.onClick = () => {
1812
+ const rows = tableRef.value.elTableRef.getSelectionRows();
1813
+ clickFn(rows);
1814
+ };
1815
+ }
1816
+ });
1817
+ const buttonsProps = vue.computed(() => {
1818
+ return {
1819
+ list,
1820
+ ...props.buttonsProps
1821
+ };
1822
+ });
1823
+ const search = async () => {
1824
+ await validate();
1825
+ tableRef.value.search(true);
1826
+ };
1827
+ const reset = async () => {
1828
+ resetFields();
1829
+ search();
1830
+ };
1831
+ const searchButtons = [
1832
+ {
1833
+ name: "\u641C\u7D22",
1834
+ type: "primary",
1835
+ onClick: search
1836
+ },
1837
+ {
1838
+ name: "\u6E05\u7A7A",
1839
+ onClick: reset
1840
+ }
1841
+ ];
1842
+ return {
1843
+ buttonsProps,
1844
+ searchButtons,
1845
+ search,
1846
+ reset
1847
+ };
1848
+ };
1849
+
1850
+ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
1851
+ ...{ name: "EpSearchListPage" },
1852
+ __name: "searchListPage",
1853
+ props: searchListPageProps,
1854
+ setup(__props, { expose: __expose }) {
1855
+ const bem = createNameSpace("search-list-page");
1856
+ const props = __props;
1857
+ const {
1858
+ formProps,
1859
+ buttonsProps,
1860
+ searchButtons,
1861
+ search,
1862
+ reset,
1863
+ tableRef,
1864
+ formRef,
1865
+ tableProps
1866
+ } = useSearchListPage(props);
1867
+ __expose({
1868
+ search,
1869
+ reset,
1870
+ tableRef,
1871
+ formRef
1872
+ });
1873
+ return (_ctx, _cache) => {
1874
+ const _component_EpButtons = vue.resolveComponent("EpButtons");
1875
+ return vue.openBlock(), vue.createElementBlock(
1876
+ "div",
1877
+ {
1878
+ class: vue.normalizeClass([vue.unref(bem).b(), vue.unref(prepareClassNames)()]),
1879
+ style: vue.normalizeStyle({
1880
+ ...vue.unref(prepareStyles)()
1881
+ })
1882
+ },
1883
+ [
1884
+ vue.createElementVNode("div", { id: "top" }, [
1885
+ vue.createVNode(
1886
+ vue.unref(EpForm),
1887
+ vue.normalizeProps(vue.guardReactiveProps(vue.unref(formProps))),
1888
+ null,
1889
+ 16
1890
+ /* FULL_PROPS */
1891
+ )
1892
+ ]),
1893
+ vue.createElementVNode("div", { id: "middle" }, [
1894
+ vue.createElementVNode(
1895
+ "div",
1896
+ {
1897
+ class: vue.normalizeClass(vue.unref(bem).e("middle-left"))
1898
+ },
1899
+ [
1900
+ vue.createVNode(
1901
+ _component_EpButtons,
1902
+ vue.normalizeProps(vue.guardReactiveProps(vue.unref(buttonsProps))),
1903
+ null,
1904
+ 16
1905
+ /* FULL_PROPS */
1906
+ )
1907
+ ],
1908
+ 2
1909
+ /* CLASS */
1910
+ ),
1911
+ vue.createElementVNode(
1912
+ "div",
1913
+ {
1914
+ class: vue.normalizeClass(vue.unref(bem).e("middle-right"))
1915
+ },
1916
+ [
1917
+ vue.createVNode(_component_EpButtons, { list: vue.unref(searchButtons) }, null, 8, ["list"])
1918
+ ],
1919
+ 2
1920
+ /* CLASS */
1921
+ )
1922
+ ]),
1923
+ vue.renderSlot(_ctx.$slots, "tableBefore"),
1924
+ vue.createVNode(
1925
+ vue.unref(EpTable),
1926
+ vue.normalizeProps(vue.guardReactiveProps(vue.unref(tableProps))),
1927
+ null,
1928
+ 16
1929
+ /* FULL_PROPS */
1930
+ )
1931
+ ],
1932
+ 6
1933
+ /* CLASS, STYLE */
1934
+ );
1935
+ };
1936
+ }
1937
+ });
1938
+
1939
+ const EpSearchListPage = withInstall(_sfc_main$1);
1940
+
1941
+ const inheritSelectProps = {
1942
+ ...elementPlus.selectProps,
1943
+ clearable: {
1944
+ ...elementPlus.selectProps.clearable,
1945
+ default: true
1946
+ }
1947
+ };
1948
+ const expandSelectProps = {
1949
+ ...apiProps,
1950
+ disabledOption: {
1951
+ type: Function,
1952
+ default: () => false
1953
+ },
1954
+ labelKey: {
1955
+ type: String,
1956
+ default: "label"
1957
+ },
1958
+ valueKey: {
1959
+ type: String,
1960
+ default: "value"
1961
+ },
1962
+ formatLabel: {
1963
+ type: Function
1964
+ },
1965
+ // api模式生效
1966
+ lazy: Boolean,
1967
+ // option是否同时展示code label, 默认值展示label, 传string展示指定字段
1968
+ codeInLabel: {
1969
+ type: [String, Boolean]
1970
+ }
1971
+ };
1972
+ const selectProps = {
1973
+ ...inheritSelectProps,
1974
+ ...expandSelectProps
1975
+ };
1976
+ const expandSelectPropsKeys = Object.keys(expandSelectProps);
1977
+ const selectEmits = {
1978
+ ...elementPlus.selectEmits,
1979
+ change: (value, item) => true
1980
+ };
1981
+ const selectEmitsKeys = Object.keys(selectEmits);
1982
+
1983
+ function useSelect(props, emit) {
1984
+ let hasLoaded = false;
1985
+ const { loading, requestFn } = useRequest({
1986
+ api: props.api,
1987
+ method: props.method,
1988
+ reqData: props.reqData,
1989
+ reqParams: props.reqParams,
1990
+ reqBefore: props.reqBefore,
1991
+ reqAfter: props.reqAfter,
1992
+ cancelToken: props.remote,
1993
+ hooks: {
1994
+ success(data) {
1995
+ if (Array.isArray(data)) {
1996
+ customOptions.value = data;
1997
+ } else if (data && typeof data === "object") {
1998
+ const rawData = data;
1999
+ customOptions.value = rawData?.list || rawData?.data || [];
2000
+ } else {
2001
+ customOptions.value = [];
2002
+ }
2003
+ hasLoaded = true;
2004
+ },
2005
+ fail(error) {
2006
+ console.error(error);
2007
+ }
2008
+ }
2009
+ });
2010
+ const customOptions = vue.ref([]);
2011
+ const loadOptions = (value, desc) => {
2012
+ if ((value || value === 0) && desc) {
2013
+ customOptions.value = [
2014
+ {
2015
+ [props.labelKey]: desc,
2016
+ [props.valueKey]: value
2017
+ }
2018
+ ];
2019
+ }
2020
+ if (props.api) {
2021
+ if (!props.lazy && !props.remote) {
2022
+ requestFn();
2023
+ }
2024
+ } else if (props.options?.length) {
2025
+ customOptions.value = props.options;
2026
+ }
2027
+ };
2028
+ const getSelectItem = (value) => {
2029
+ if (Array.isArray(value)) {
2030
+ if (!props.options) return [];
2031
+ return props.options.filter((item) => {
2032
+ return value.indexOf(item[props.valueKey]) > -1;
2033
+ });
2034
+ }
2035
+ if (!props.options) return {};
2036
+ return props.options.find((item) => {
2037
+ return item[props.valueKey] === value;
2038
+ }) || {};
2039
+ };
2040
+ const expandAttrs = {
2041
+ loading: props.loading || loading?.value,
2042
+ remoteMethod: (query) => {
2043
+ if (!query) return;
2044
+ requestFn({
2045
+ $searchValue: query
2046
+ });
2047
+ },
2048
+ onChange(value) {
2049
+ emit("change", value, getSelectItem(value));
2050
+ },
2051
+ onVisibleChange(visible) {
2052
+ if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {
2053
+ requestFn();
2054
+ }
2055
+ emit("visible-change", visible);
2056
+ }
2057
+ };
2058
+ return {
2059
+ customOptions,
2060
+ loadOptions,
2061
+ expandAttrs
2062
+ };
2063
+ }
2064
+
2065
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
2066
+ ...{
2067
+ name: "EpSelect",
2068
+ inheritAttrs: false
2069
+ },
2070
+ __name: "select",
2071
+ props: /* @__PURE__ */ vue.mergeModels(selectProps, {
2072
+ "modelValue": { type: null },
2073
+ "modelModifiers": {},
2074
+ "desc": { type: String },
2075
+ "descModifiers": {}
2076
+ }),
2077
+ emits: /* @__PURE__ */ vue.mergeModels(selectEmits, ["update:modelValue", "update:desc"]),
2078
+ setup(__props, { emit: __emit }) {
2079
+ const bem = createNameSpace("select");
2080
+ const props = __props;
2081
+ const emit = __emit;
2082
+ const slots = vue.computed(() => {
2083
+ return Object.keys(vue.useSlots());
2084
+ });
2085
+ const { customOptions, loadOptions, expandAttrs } = useSelect(props, emit);
2086
+ const value = vue.useModel(__props, "modelValue");
2087
+ const desc = vue.useModel(__props, "desc");
2088
+ const customAttrs = vue.computed(() => {
2089
+ return {
2090
+ ...prepareProps(props, ["modelValue", "desc", ...expandSelectPropsKeys]),
2091
+ ...prepareEvents(emit, selectEmitsKeys),
2092
+ ...expandAttrs
2093
+ };
2094
+ });
2095
+ loadOptions(value.value, desc.value);
2096
+ return (_ctx, _cache) => {
2097
+ const _component_el_option = vue.resolveComponent("el-option");
2098
+ const _component_el_select = vue.resolveComponent("el-select");
2099
+ return vue.openBlock(), vue.createBlock(_component_el_select, vue.mergeProps({
2100
+ modelValue: value.value,
2101
+ "onUpdate:modelValue": ($event) => value.value = $event,
2102
+ class: `${vue.unref(bem).b()} ${vue.unref(prepareClassNames)()}`
2103
+ }, customAttrs.value, {
2104
+ style: {
2105
+ ...vue.unref(prepareStyles)()
2106
+ }
2107
+ }), vue.createSlots({
2108
+ default: vue.withCtx(() => [
2109
+ (vue.openBlock(true), vue.createElementBlock(
2110
+ vue.Fragment,
2111
+ null,
2112
+ vue.renderList(vue.unref(customOptions), (item) => {
2113
+ return vue.openBlock(), vue.createBlock(_component_el_option, {
2114
+ key: item[_ctx.valueKey],
2115
+ class: vue.normalizeClass(vue.unref(bem).e("option")),
2116
+ label: item.formatLabel ? item.formatLabel(item) : _ctx.formatLabel ? _ctx.formatLabel(item) : item[_ctx.labelKey],
2117
+ value: item[_ctx.valueKey],
2118
+ disabled: _ctx.disabledOption(item)
2119
+ }, {
2120
+ default: vue.withCtx(() => [
2121
+ vue.renderSlot(_ctx.$slots, "option", { item }, () => [
2122
+ _ctx.codeInLabel || _ctx.codeInLabel === "" ? (vue.openBlock(), vue.createElementBlock(
2123
+ vue.Fragment,
2124
+ { key: 0 },
2125
+ [
2126
+ vue.createElementVNode(
2127
+ "span",
2128
+ { style: { "float": "left" } },
2129
+ vue.toDisplayString(item[_ctx.labelKey]),
2130
+ 1
2131
+ /* TEXT */
2132
+ ),
2133
+ vue.createElementVNode(
2134
+ "span",
2135
+ { style: { "float": "right", "color": "var(--el-text-color-secondary)", "font-size": "13px" } },
2136
+ vue.toDisplayString(item[typeof _ctx.codeInLabel === "string" && _ctx.codeInLabel ? _ctx.codeInLabel : _ctx.valueKey]),
2137
+ 1
2138
+ /* TEXT */
2139
+ )
2140
+ ],
2141
+ 64
2142
+ /* STABLE_FRAGMENT */
2143
+ )) : vue.createCommentVNode("v-if", true)
2144
+ ])
2145
+ ]),
2146
+ _: 2
2147
+ /* DYNAMIC */
2148
+ }, 1032, ["class", "label", "value", "disabled"]);
2149
+ }),
2150
+ 128
2151
+ /* KEYED_FRAGMENT */
2152
+ ))
2153
+ ]),
2154
+ _: 2
2155
+ /* DYNAMIC */
2156
+ }, [
2157
+ vue.renderList(slots.value, (name) => {
2158
+ return {
2159
+ name,
2160
+ fn: vue.withCtx((scope) => [
2161
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(scope)))
2162
+ ])
2163
+ };
2164
+ })
2165
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "class", "style"]);
2166
+ };
2167
+ }
2168
+ });
2169
+
2170
+ const EpSelect = withInstall(_sfc_main);
2171
+
2172
+ var components = [EpButtons, EpForm, EpInput, EpSearchListPage, EpSelect, EpTable];
2173
+
2174
+ var version = "0.0.2";
2175
+
2176
+ const install = (app, options) => {
2177
+ components.forEach((c) => app.use(c));
2178
+ };
2179
+ const plugin = {
2180
+ install,
2181
+ version
2182
+ };
2183
+
2184
+ exports.EpButtons = EpButtons;
2185
+ exports.EpForm = EpForm;
2186
+ exports.EpFormItem = EpFormItem;
2187
+ exports.EpInput = EpInput;
2188
+ exports.EpSearchListPage = EpSearchListPage;
2189
+ exports.EpSelect = EpSelect;
2190
+ exports.EpTable = EpTable;
2191
+ exports.buttonsProps = buttonsProps;
2192
+ exports.default = plugin;
2193
+ exports.expandFormItemPropsKeys = expandFormItemPropsKeys;
2194
+ exports.expandFormPropsKeys = expandFormPropsKeys;
2195
+ exports.expandSelectPropsKeys = expandSelectPropsKeys;
2196
+ exports.expandTablePropsKeys = expandTablePropsKeys;
2197
+ exports.formEmits = formEmits;
2198
+ exports.formEmitsKeys = formEmitsKeys;
2199
+ exports.formItemProps = formItemProps;
2200
+ exports.formProps = formProps;
2201
+ exports.inheritSelectProps = inheritSelectProps;
2202
+ exports.inputEmits = inputEmits;
2203
+ exports.inputEmitsKeys = inputEmitsKeys;
2204
+ exports.inputProps = inputProps;
2205
+ exports.install = install;
2206
+ exports.searchListPageProps = searchListPageProps;
2207
+ exports.selectEmits = selectEmits;
2208
+ exports.selectEmitsKeys = selectEmitsKeys;
2209
+ exports.selectProps = selectProps;
2210
+ exports.tableEmits = tableEmits;
2211
+ exports.tableEmitsKeys = tableEmitsKeys;
2212
+ exports.tableProps = tableProps;
2213
+ exports.useRequest = useRequest;
2214
+ exports.vPermission = vPermisson;
2215
+ exports.vRepeatClick = vRepeatClick;
2216
+
2217
+ Object.defineProperty(exports, '__esModule', { value: true });
2218
+
2219
+ }));