@vipl520/dk-ui 1.0.44 → 1.0.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. package/dist/attributes.json +16 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +3041 -1074
  4. package/dist/index.min.js +4 -4
  5. package/dist/index.min.js.map +1 -1
  6. package/dist/index.min.mjs +4 -4
  7. package/dist/index.min.mjs.map +1 -1
  8. package/dist/index.mjs +3038 -1075
  9. package/dist/tags.json +14 -0
  10. package/dist/uniicons.ttf +0 -0
  11. package/dist/web-types.json +69 -1
  12. package/es/animate-select/src/animate-select.vue2.mjs.map +1 -1
  13. package/es/api/attachment.mjs.map +1 -1
  14. package/es/attachment/src/attachment.vue2.mjs +1 -7
  15. package/es/attachment/src/attachment.vue2.mjs.map +1 -1
  16. package/es/audio-list-input/src/audio-list-input.vue2.mjs.map +1 -1
  17. package/es/dialog/src/dialog.vue2.mjs +2 -4
  18. package/es/dialog/src/dialog.vue2.mjs.map +1 -1
  19. package/es/dialog/style/index.css +1 -1
  20. package/es/dialog/style/index.scss +1 -1
  21. package/es/file-input/src/file-input.vue2.mjs.map +1 -1
  22. package/es/file-list-input/src/file-list-input.vue2.mjs.map +1 -1
  23. package/es/form/index.d.ts +3 -15
  24. package/es/form/src/form.vue.d.ts +2 -10
  25. package/es/form/src/form.vue2.mjs +1 -0
  26. package/es/form/src/form.vue2.mjs.map +1 -1
  27. package/es/form/src/props.d.ts +1 -5
  28. package/es/form/src/props.mjs +1 -5
  29. package/es/form/src/props.mjs.map +1 -1
  30. package/es/hot-area-input/src/component/hot-area-content.vue2.mjs.map +1 -1
  31. package/es/hot-area-input/src/hot-area-input.vue2.mjs.map +1 -1
  32. package/es/icon/src/icon.vue2.mjs.map +1 -1
  33. package/es/icon-input/src/icon-content.vue2.mjs +1 -1
  34. package/es/icon-input/src/icon-content.vue2.mjs.map +1 -1
  35. package/es/image-list-input/src/image-list-input.vue2.mjs.map +1 -1
  36. package/es/index.d.ts +2 -0
  37. package/es/index.mjs +8 -2
  38. package/es/index.mjs.map +1 -1
  39. package/es/index.scss +2 -0
  40. package/es/page-diy/src/components/DiyCloud.vue.mjs.map +1 -1
  41. package/es/page-diy/src/components/DragTool.vue.mjs +1 -5
  42. package/es/page-diy/src/components/DragTool.vue.mjs.map +1 -1
  43. package/es/page-diy/src/components/PreviewPhone.vue2.mjs.map +1 -1
  44. package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs +9 -11
  45. package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs.map +1 -1
  46. package/es/page-diy/src/config/base/dkSetting.mjs.map +1 -1
  47. package/es/page-diy/src/config/rule/min/common/DkMinTitle.d.ts +1 -0
  48. package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs +2 -1
  49. package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs.map +1 -1
  50. package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs +1 -3
  51. package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs.map +1 -1
  52. package/es/page-diy/src/config/rule/min/common/index.d.ts +2 -0
  53. package/es/page-diy/src/config/rule/min/common/index.mjs +1 -8
  54. package/es/page-diy/src/config/rule/min/common/index.mjs.map +1 -1
  55. package/es/page-diy/src/config/rule/min/index.d.ts +2 -0
  56. package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs +1 -3
  57. package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs.map +1 -1
  58. package/es/page-diy/src/config/rule/web/common/DkViewBulletChat.mjs.map +1 -1
  59. package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs +3 -9
  60. package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs.map +1 -1
  61. package/es/page-diy/src/utils/eventData.mjs.map +1 -1
  62. package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs +5 -18
  63. package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs.map +1 -1
  64. package/es/page-diy/src/views/min/DkMinSwiperImage.vue.mjs.map +1 -1
  65. package/es/page-diy/src/views/min/DkMinTitle.vue.mjs.map +1 -1
  66. package/es/page-diy/src/views/web/DkViewBulletChat.vue.mjs.map +1 -1
  67. package/es/page-diy/src/views/web/DkViewCell.vue.mjs.map +1 -1
  68. package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs +1 -3
  69. package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs.map +1 -1
  70. package/es/page-diy/src/views/web/DkViewGridCellList.vue.mjs.map +1 -1
  71. package/es/page-diy/src/views/web/DkViewImage.vue.mjs.map +1 -1
  72. package/es/page-diy/src/views/web/DkViewMusic.vue.mjs.map +1 -1
  73. package/es/page-diy/src/views/web/DkViewNoticeBar.vue.mjs.map +1 -1
  74. package/es/page-diy/src/views/web/DkViewSwipe.vue.mjs.map +1 -1
  75. package/es/page-diy/src/views/web/DkViewTitle.vue.mjs.map +1 -1
  76. package/es/poster-input/src/component/poster.vue2.mjs.map +1 -1
  77. package/es/poster-input/src/component/views/DkPosterViewAvatar.vue2.mjs.map +1 -1
  78. package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs +1 -1
  79. package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs.map +1 -1
  80. package/es/poster-input/src/component/views/DkPosterViewName.vue2.mjs.map +1 -1
  81. package/es/poster-input/src/component/views/DkPosterViewQrcode.vue2.mjs.map +1 -1
  82. package/es/poster-input/src/component/views/DkPosterViewText.vue2.mjs.map +1 -1
  83. package/es/poster-input/src/component/views/quick-action.vue2.mjs.map +1 -1
  84. package/es/poster-input/src/poster-input.vue2.mjs.map +1 -1
  85. package/es/poster-input/style/index.scss +2 -4
  86. package/es/select/src/select.vue2.mjs +1 -9
  87. package/es/select/src/select.vue2.mjs.map +1 -1
  88. package/es/style-animation-input/src/props.mjs.map +1 -1
  89. package/es/style-animation-input/src/style-animation-input.vue2.mjs +1 -1
  90. package/es/style-animation-input/src/style-animation-input.vue2.mjs.map +1 -1
  91. package/es/style-font-input/src/style-font-input.vue2.mjs +1 -1
  92. package/es/style-font-input/src/style-font-input.vue2.mjs.map +1 -1
  93. package/es/style-number-input/src/style-number-input.vue2.mjs.map +1 -1
  94. package/es/style-position-input/src/style-position-input.vue2.mjs +1 -4
  95. package/es/style-position-input/src/style-position-input.vue2.mjs.map +1 -1
  96. package/es/table/src/components/ComSearch.vue2.mjs.map +1 -1
  97. package/es/table/src/components/FieldRender.vue2.mjs +1 -1
  98. package/es/table/src/components/FieldRender.vue2.mjs.map +1 -1
  99. package/es/table/src/components/RecycleDialog.vue2.mjs +1 -3
  100. package/es/table/src/components/RecycleDialog.vue2.mjs.map +1 -1
  101. package/es/table/src/components/header.vue2.mjs +3 -17
  102. package/es/table/src/components/header.vue2.mjs.map +1 -1
  103. package/es/table/src/props.mjs +1 -11
  104. package/es/table/src/props.mjs.map +1 -1
  105. package/es/table/src/table.vue2.mjs +3 -13
  106. package/es/table/src/table.vue2.mjs.map +1 -1
  107. package/es/table/utils/dkTable.mjs +8 -31
  108. package/es/table/utils/dkTable.mjs.map +1 -1
  109. package/es/table/utils/dkTableApi.mjs.map +1 -1
  110. package/es/tiny-editor/src/tiny-editor.vue2.mjs +1 -1
  111. package/es/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
  112. package/es/uni-icon/index.d.ts +174 -0
  113. package/es/uni-icon/index.mjs +8 -0
  114. package/es/uni-icon/index.mjs.map +1 -0
  115. package/es/uni-icon/src/props.d.ts +24 -0
  116. package/es/uni-icon/src/props.mjs +25 -0
  117. package/es/uni-icon/src/props.mjs.map +1 -0
  118. package/es/uni-icon/src/uni-icon.vue.d.ts +57 -0
  119. package/es/uni-icon/src/uni-icon.vue.mjs +7 -0
  120. package/es/uni-icon/src/uni-icon.vue.mjs.map +1 -0
  121. package/es/uni-icon/src/uni-icon.vue2.mjs +43 -0
  122. package/es/uni-icon/src/uni-icon.vue2.mjs.map +1 -0
  123. package/es/uni-icon/style/index.css +1 -0
  124. package/es/uni-icon/style/index.scss +17 -0
  125. package/es/uni-icon/style/uniicons.css +1 -0
  126. package/es/uni-icon/style/uniicons.scss +663 -0
  127. package/es/uni-icon/style/uniicons_file_vue.d.ts +4 -0
  128. package/es/uni-icon/style/uniicons_file_vue.mjs +649 -0
  129. package/es/uni-icon/style/uniicons_file_vue.mjs.map +1 -0
  130. package/es/uni-icon-input/index.d.ts +17 -0
  131. package/es/uni-icon-input/index.mjs +8 -0
  132. package/es/uni-icon-input/index.mjs.map +1 -0
  133. package/es/uni-icon-input/src/props.d.ts +11 -0
  134. package/es/uni-icon-input/src/props.mjs +11 -0
  135. package/es/uni-icon-input/src/props.mjs.map +1 -0
  136. package/es/uni-icon-input/src/uni-icon-input.vue.d.ts +16 -0
  137. package/es/uni-icon-input/src/uni-icon-input.vue.mjs +7 -0
  138. package/es/uni-icon-input/src/uni-icon-input.vue.mjs.map +1 -0
  139. package/es/uni-icon-input/src/uni-icon-input.vue2.mjs +112 -0
  140. package/es/uni-icon-input/src/uni-icon-input.vue2.mjs.map +1 -0
  141. package/es/uni-icon-input/style/index.css +1 -0
  142. package/es/uni-icon-input/style/index.scss +13 -0
  143. package/es/video-list-input/src/video-list-input.vue2.mjs.map +1 -1
  144. package/lib/animate-select/src/animate-select.vue2.js.map +1 -1
  145. package/lib/api/attachment.js.map +1 -1
  146. package/lib/attachment/src/attachment.vue2.js +1 -7
  147. package/lib/attachment/src/attachment.vue2.js.map +1 -1
  148. package/lib/audio-list-input/src/audio-list-input.vue2.js.map +1 -1
  149. package/lib/dialog/src/dialog.vue2.js +2 -4
  150. package/lib/dialog/src/dialog.vue2.js.map +1 -1
  151. package/lib/dialog/style/index.css +1 -1
  152. package/lib/dialog/style/index.scss +1 -1
  153. package/lib/file-input/src/file-input.vue2.js.map +1 -1
  154. package/lib/file-list-input/src/file-list-input.vue2.js.map +1 -1
  155. package/lib/form/index.d.ts +3 -15
  156. package/lib/form/src/form.vue.d.ts +2 -10
  157. package/lib/form/src/form.vue2.js +1 -0
  158. package/lib/form/src/form.vue2.js.map +1 -1
  159. package/lib/form/src/props.d.ts +1 -5
  160. package/lib/form/src/props.js +1 -5
  161. package/lib/form/src/props.js.map +1 -1
  162. package/lib/hot-area-input/src/component/hot-area-content.vue2.js.map +1 -1
  163. package/lib/hot-area-input/src/hot-area-input.vue2.js.map +1 -1
  164. package/lib/icon/src/icon.vue2.js.map +1 -1
  165. package/lib/icon-input/src/icon-content.vue2.js +1 -1
  166. package/lib/icon-input/src/icon-content.vue2.js.map +1 -1
  167. package/lib/image-list-input/src/image-list-input.vue2.js.map +1 -1
  168. package/lib/index.d.ts +2 -0
  169. package/lib/index.js +13 -3
  170. package/lib/index.js.map +1 -1
  171. package/lib/index.scss +2 -0
  172. package/lib/page-diy/src/components/DiyCloud.vue.js.map +1 -1
  173. package/lib/page-diy/src/components/DragTool.vue.js +1 -5
  174. package/lib/page-diy/src/components/DragTool.vue.js.map +1 -1
  175. package/lib/page-diy/src/components/PreviewPhone.vue2.js.map +1 -1
  176. package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js +9 -11
  177. package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js.map +1 -1
  178. package/lib/page-diy/src/config/base/dkSetting.js.map +1 -1
  179. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.d.ts +1 -0
  180. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js +2 -1
  181. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js.map +1 -1
  182. package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js +1 -3
  183. package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js.map +1 -1
  184. package/lib/page-diy/src/config/rule/min/common/index.d.ts +2 -0
  185. package/lib/page-diy/src/config/rule/min/common/index.js +1 -8
  186. package/lib/page-diy/src/config/rule/min/common/index.js.map +1 -1
  187. package/lib/page-diy/src/config/rule/min/index.d.ts +2 -0
  188. package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js +1 -3
  189. package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js.map +1 -1
  190. package/lib/page-diy/src/config/rule/web/common/DkViewBulletChat.js.map +1 -1
  191. package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js +3 -9
  192. package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js.map +1 -1
  193. package/lib/page-diy/src/utils/eventData.js.map +1 -1
  194. package/lib/page-diy/src/views/min/DkMinHotArea.vue.js +5 -18
  195. package/lib/page-diy/src/views/min/DkMinHotArea.vue.js.map +1 -1
  196. package/lib/page-diy/src/views/min/DkMinSwiperImage.vue.js.map +1 -1
  197. package/lib/page-diy/src/views/min/DkMinTitle.vue.js.map +1 -1
  198. package/lib/page-diy/src/views/web/DkViewBulletChat.vue.js.map +1 -1
  199. package/lib/page-diy/src/views/web/DkViewCell.vue.js.map +1 -1
  200. package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js +1 -3
  201. package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js.map +1 -1
  202. package/lib/page-diy/src/views/web/DkViewGridCellList.vue.js.map +1 -1
  203. package/lib/page-diy/src/views/web/DkViewImage.vue.js.map +1 -1
  204. package/lib/page-diy/src/views/web/DkViewMusic.vue.js.map +1 -1
  205. package/lib/page-diy/src/views/web/DkViewNoticeBar.vue.js.map +1 -1
  206. package/lib/page-diy/src/views/web/DkViewSwipe.vue.js.map +1 -1
  207. package/lib/page-diy/src/views/web/DkViewTitle.vue.js.map +1 -1
  208. package/lib/poster-input/src/component/poster.vue2.js.map +1 -1
  209. package/lib/poster-input/src/component/views/DkPosterViewAvatar.vue2.js.map +1 -1
  210. package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js +1 -1
  211. package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js.map +1 -1
  212. package/lib/poster-input/src/component/views/DkPosterViewName.vue2.js.map +1 -1
  213. package/lib/poster-input/src/component/views/DkPosterViewQrcode.vue2.js.map +1 -1
  214. package/lib/poster-input/src/component/views/DkPosterViewText.vue2.js.map +1 -1
  215. package/lib/poster-input/src/component/views/quick-action.vue2.js.map +1 -1
  216. package/lib/poster-input/src/poster-input.vue2.js.map +1 -1
  217. package/lib/poster-input/style/index.scss +2 -4
  218. package/lib/select/src/select.vue2.js +1 -9
  219. package/lib/select/src/select.vue2.js.map +1 -1
  220. package/lib/style-animation-input/src/props.js.map +1 -1
  221. package/lib/style-animation-input/src/style-animation-input.vue2.js +1 -1
  222. package/lib/style-animation-input/src/style-animation-input.vue2.js.map +1 -1
  223. package/lib/style-font-input/src/style-font-input.vue2.js +1 -1
  224. package/lib/style-font-input/src/style-font-input.vue2.js.map +1 -1
  225. package/lib/style-number-input/src/style-number-input.vue2.js.map +1 -1
  226. package/lib/style-position-input/src/style-position-input.vue2.js +1 -4
  227. package/lib/style-position-input/src/style-position-input.vue2.js.map +1 -1
  228. package/lib/table/src/components/ComSearch.vue2.js.map +1 -1
  229. package/lib/table/src/components/FieldRender.vue2.js +1 -1
  230. package/lib/table/src/components/FieldRender.vue2.js.map +1 -1
  231. package/lib/table/src/components/RecycleDialog.vue2.js +1 -3
  232. package/lib/table/src/components/RecycleDialog.vue2.js.map +1 -1
  233. package/lib/table/src/components/header.vue2.js +3 -17
  234. package/lib/table/src/components/header.vue2.js.map +1 -1
  235. package/lib/table/src/props.js +1 -11
  236. package/lib/table/src/props.js.map +1 -1
  237. package/lib/table/src/table.vue2.js +3 -13
  238. package/lib/table/src/table.vue2.js.map +1 -1
  239. package/lib/table/utils/dkTable.js +8 -31
  240. package/lib/table/utils/dkTable.js.map +1 -1
  241. package/lib/table/utils/dkTableApi.js.map +1 -1
  242. package/lib/tiny-editor/src/tiny-editor.vue2.js +1 -1
  243. package/lib/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
  244. package/lib/uni-icon/index.d.ts +174 -0
  245. package/lib/uni-icon/index.js +14 -0
  246. package/lib/uni-icon/index.js.map +1 -0
  247. package/lib/uni-icon/src/props.d.ts +24 -0
  248. package/lib/uni-icon/src/props.js +27 -0
  249. package/lib/uni-icon/src/props.js.map +1 -0
  250. package/lib/uni-icon/src/uni-icon.vue.d.ts +57 -0
  251. package/lib/uni-icon/src/uni-icon.vue.js +11 -0
  252. package/lib/uni-icon/src/uni-icon.vue.js.map +1 -0
  253. package/lib/uni-icon/src/uni-icon.vue2.js +47 -0
  254. package/lib/uni-icon/src/uni-icon.vue2.js.map +1 -0
  255. package/lib/uni-icon/style/index.css +1 -0
  256. package/lib/uni-icon/style/index.scss +17 -0
  257. package/lib/uni-icon/style/uniicons.css +1 -0
  258. package/lib/uni-icon/style/uniicons.scss +663 -0
  259. package/lib/uni-icon/style/uniicons_file_vue.d.ts +4 -0
  260. package/lib/uni-icon/style/uniicons_file_vue.js +651 -0
  261. package/lib/uni-icon/style/uniicons_file_vue.js.map +1 -0
  262. package/lib/uni-icon-input/index.d.ts +17 -0
  263. package/lib/uni-icon-input/index.js +14 -0
  264. package/lib/uni-icon-input/index.js.map +1 -0
  265. package/lib/uni-icon-input/src/props.d.ts +11 -0
  266. package/lib/uni-icon-input/src/props.js +13 -0
  267. package/lib/uni-icon-input/src/props.js.map +1 -0
  268. package/lib/uni-icon-input/src/uni-icon-input.vue.d.ts +16 -0
  269. package/lib/uni-icon-input/src/uni-icon-input.vue.js +11 -0
  270. package/lib/uni-icon-input/src/uni-icon-input.vue.js.map +1 -0
  271. package/lib/uni-icon-input/src/uni-icon-input.vue2.js +116 -0
  272. package/lib/uni-icon-input/src/uni-icon-input.vue2.js.map +1 -0
  273. package/lib/uni-icon-input/style/index.css +1 -0
  274. package/lib/uni-icon-input/style/index.scss +13 -0
  275. package/lib/video-list-input/src/video-list-input.vue2.js.map +1 -1
  276. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"style-animation-input.vue2.js","sources":["../../../src/style-animation-input/src/style-animation-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleAnimationInput',\n});\n</script>\n<template>\n <div class=\"dk-style-animation-input\">\n <el-form-item label=\"延迟执行\">\n <el-input-number v-model=\"form.animationDelay\" :step=\"0.1\" :min=\"0\" />\n <p class=\"form-help\">设置动画页面加载完毕多少秒后执行</p>\n </el-form-item>\n <el-form-item label=\"动画时长\">\n <el-input-number v-model=\"form.animationDuration\" :step=\"0.1\" :min=\"0\" />\n <p class=\"form-help\">设置每次动画加载的动画时长</p>\n </el-form-item>\n <el-form-item label=\"循环次数\">\n <el-input-number v-model=\"form.animationIterationCount\" :min=\"0\" />\n <p class=\"form-help\">\n 当循环次数设置为0的时候,表示无限循环,入场动画建议为1\n </p>\n </el-form-item>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleAnimationInputProps } from './props'\nimport { onMounted, reactive, watch } from 'vue'\n\n\n\nconst props = defineProps(styleAnimationInputProps)\n\nconst form: any = reactive({\n animationDelay: 0,\n animationDuration: 1,\n animationIterationCount: 0,\n})\nconst emit = defineEmits(['update:modelValue'])\nwatch(\n form,\n () => {\n const value: any = {}\n value.animationDelay = form.animationDelay + 's'\n value.animationDuration = form.animationDuration + 's'\n value.animationIterationCount =\n form.animationIterationCount == 0\n ? 'infinite'\n : form.animationIterationCount\n emit('update:modelValue', value)\n },\n { deep: true }\n)\nconst init = () => {\n const value = props.modelValue\n form.animationDelay = parseFloat(value.animationDelay || '0s')\n form.animationDuration = parseFloat(value.animationDuration || '1')\n form.animationIterationCount = parseInt(\n (value.animationIterationCount === 'infinite'\n ? 0\n : value.animationIterationCount) || 0\n )\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n // emit('update:modelValue', value)\n }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent","reactive","watch","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,uBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6BD,IAAA,MAAM,OAAYC,YAAS,CAAA;AAAA,MACzB,cAAgB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-animation-input.vue2.js","sources":["../../../src/style-animation-input/src/style-animation-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleAnimationInput',\n});\n</script>\n<template>\n <div class=\"dk-style-animation-input\">\n <el-form-item label=\"延迟执行\">\n <el-input-number v-model=\"form.animationDelay\" :step=\"0.1\" :min=\"0\" />\n <p class=\"form-help\">设置动画页面加载完毕多少秒后执行</p>\n </el-form-item>\n <el-form-item label=\"动画时长\">\n <el-input-number v-model=\"form.animationDuration\" :step=\"0.1\" :min=\"0\" />\n <p class=\"form-help\">设置每次动画加载的动画时长</p>\n </el-form-item>\n <el-form-item label=\"循环次数\">\n <el-input-number v-model=\"form.animationIterationCount\" :min=\"0\" />\n <p class=\"form-help\">当循环次数设置为0的时候,表示无限循环,入场动画建议为1</p>\n </el-form-item>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleAnimationInputProps } from './props'\nimport { onMounted, reactive, watch } from 'vue'\n\n\n\nconst props = defineProps(styleAnimationInputProps)\n\nconst form: any = reactive({\n animationDelay: 0,\n animationDuration: 1,\n animationIterationCount: 0,\n})\nconst emit = defineEmits(['update:modelValue'])\nwatch(\n form,\n () => {\n const value: any = {}\n value.animationDelay = form.animationDelay + 's'\n value.animationDuration = form.animationDuration + 's'\n value.animationIterationCount = form.animationIterationCount == 0 ? 'infinite' : form.animationIterationCount\n emit('update:modelValue', value)\n },\n { deep: true }\n)\nconst init = () => {\n const value = props.modelValue\n form.animationDelay = parseFloat(value.animationDelay || '0s')\n form.animationDuration = parseFloat(value.animationDuration || '1')\n form.animationIterationCount = parseInt(\n (value.animationIterationCount === 'infinite' ? 0 : value.animationIterationCount) || 0\n )\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n // emit('update:modelValue', value)\n }\n)\n\nonM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AA;AAAA,KACF,CAAA;AAEA,IAAAA,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,MAAM;AACJ,QAAK,IAAA,EAAA,CAAA;AAAA,OAEP;AAAA,KACF,CAAA;AAEA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAK,IAAA,EAAA,CAAA;AAAA,KACN,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ var vue = require('vue');
6
6
  var props = require('./props.js');
7
7
 
8
8
  const _hoisted_1 = { class: "dk-style-font-input" };
9
- const _hoisted_2 = { style: { "display": "flex", "flex-flow": "row wrap" } };
9
+ const _hoisted_2 = { style: { "display": "flex", "flex-flow": "wrap", "align-items": "center" } };
10
10
  const _hoisted_3 = { class: "m-b-5px" };
11
11
  const _hoisted_4 = {
12
12
  style: { "width": "100px" },
@@ -1 +1 @@
1
- {"version":3,"file":"style-font-input.vue2.js","sources":["../../../src/style-font-input/src/style-font-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleFontInput',\n});\n</script>\n<template>\n <div class=\"dk-style-font-input\">\n <!-- 颜色、字号、粗细、风格、装饰-->\n <div style=\"display: flex; flex-flow: row wrap\">\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字颜色\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.color === ''\"\n @click=\"clear('color')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-b-5px\">\n <el-color-picker v-model=\"styles.color\"></el-color-picker>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 字号\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontSize === ''\"\n @click=\"clear('fontSize')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div style=\"width: 100px\" class=\"m-b-5px\">\n <el-select\n v-model=\"styles.fontSize\"\n :remote-show-suffix=\"false\"\n placeholder=\"字号\"\n allow-create\n :filterable=\"true\"\n >\n <el-option\n v-for=\"item in ['12px', '14px', '16px', '18px', '20px', '24px', '28px', '32px', '36px', '40px', '48px']\"\n :key=\"item\"\n :label=\"item\"\n :value=\"item\"\n />\n </el-select>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 粗细\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontWeight === ''\"\n @click=\"clear('fontWeight')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div style=\"width: 100px\" class=\"m-r-5px m-b-5px\">\n <el-select\n v-model=\"styles.fontWeight\"\n :remote-show-suffix=\"false\"\n placeholder=\"粗细\"\n allow-create\n :filterable=\"true\"\n >\n <el-option\n v-for=\"item in WeightValues\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n ></el-option>\n </el-select>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字粗细\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontWeight === ''\"\n @click=\"clear('fontWeight')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-r-5px m-b-5px\">\n <el-radio-group v-model=\"styles.fontWeight\">\n <el-radio-button value=\"bold\">\n <dk-icon icon=\"radix-icons:font-bold\" title=\"文字加粗\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"lighter\">\n <dk-icon icon=\"clarity:font-size-line\" title=\"文字默认\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" class=\"m-r-5px\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字风格\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontStyle === ''\"\n @click=\"clear('fontStyle')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-r-5px m-b-5px\">\n <el-radio-group v-model=\"styles.fontStyle\">\n <el-radio-button value=\"italic\">\n <dk-icon icon=\"radix-icons:font-italic\" title=\"文字倾斜\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字装饰\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.textDecoration === ''\"\n @click=\"clear('textDecoration')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-b-5px\">\n <el-radio-group v-model=\"styles.textDecoration\">\n <el-radio-button value=\"underline\">\n <dk-icon icon=\"radix-icons:underline\" title=\"下划线\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"line-through\">\n <dk-icon icon=\"radix-icons:strikethrough\" title=\"删除线\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"wavy underline\">\n <dk-icon icon=\"mdi:format-underline-wavy\" title=\"波浪线\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top\" trigger=\"hover\" content=\"全部重置\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #default>\n <el-button type=\"danger\" plain icon=\"Delete\" class=\"m-l-5px m-b-5px\" @click=\"clear('all')\"></el-button>\n </template>\n </el-tooltip>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleFontInputProps } from './props'\nimport { reactive, watch } from 'vue'\n\n\n\nconst props = defineProps(styleFontInputProps)\n\nconst showAfter = 400\nconst hideAfter = 100\n\nconst styles: any = reactive({\n color: props.modelValue.color || '',\n fontSize: props.modelValue.fontSize || '',\n fontWeight: props.modelValue.fontWeight || '',\n fontStyle: props.modelValue.fontStyle || '',\n textDecoration: props.modelValue.textDecoration || '',\n})\n\nconst emit = defineEmits(['update:modelValue', 'change'])\nwatch(styles, (val) => {\n const _styles = Object.keys(styles).reduce((acc: any, key) => {\n if (styles[key] !== '') {\n acc[key] = styles[key]\n }\n return acc\n }, {})\n emit('update:modelValue', _styles)\n emit('change', _styles)\n})\n\nwatch(\n () => props.modelValue,\n () => {\n // styles.color = props.modelValue.color || ''\n // styles.fontSize = props.modelValue.fontSize || ''\n // styles.fontWeight = props.modelValue.fontWeight || ''\n // styles.fontStyle = props.modelValue.fontStyle || ''\n // styles.textDecoration = props.modelValue.textDecoration || ''\n const propertiesToWatch = ['color', 'fontSize', 'fontWeight', 'fontStyle', 'textDecoration']\n propertiesToWatch.forEach((property) => {\n styles[property] = props.modelValue[property] || ''\n })\n },\n { deep: true }\n)\n\nconst WeightValues = [\n { label: '普通', value: 'normal' },\n { label: '加粗', value: 'bold' },\n { label: '更粗', value: 'bolder' },\n { label: '更细', value: 'lighter' },\n { label: '100', value: '100' },\n { label: '200', value: '200' },\n { label: '300', value: '300' },\n { label: '400', value: '400' },\n { label: '500', value: '500' },\n { label: '600', value: '600' },\n { label: '700', value: '700' },\n { label: '800', value: '800' },\n { label: '900', value: '900' },\n]\n\nconst clear = (type: string) => {\n if (type === 'all') {\n Object.keys(styles).forEach((key) => {\n styles[key] = ''\n })\n } else {\n styles[type] = ''\n }\n}\n</script>\n"],"names":["__MACRO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AA,KAAA,GAAQ,CAAC,IAAiB,KAAA;AAC9B,MAAA,IAAI,SAAS,KAAO,EAAA;AAClB,QAAA,MAAA,CAAO,IAAK,CAAA,MAAM,CAAE,CAAA,OAAA,CAAQ,CAAC,GAAQ,KAAA;AACnC,UAAA,MAAA,CAAO,GAAG,CAAI,GAAA,EAAA,CAAA;AAAA,SACf,CAAA,CAAA;AAAA,OACI,MAAA;AACL,QAAA,MAAA,CAAO,IAAI,CAAI,GAAA,EAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-font-input.vue2.js","sources":["../../../src/style-font-input/src/style-font-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleFontInput',\n});\n</script>\n<template>\n <div class=\"dk-style-font-input\">\n <!-- 颜色、字号、粗细、风格、装饰-->\n <div style=\"display: flex; flex-flow: wrap; align-items: center\">\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字颜色\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.color === ''\"\n @click=\"clear('color')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-b-5px\">\n <el-color-picker v-model=\"styles.color\"></el-color-picker>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 字号\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontSize === ''\"\n @click=\"clear('fontSize')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div style=\"width: 100px\" class=\"m-b-5px\">\n <el-select\n v-model=\"styles.fontSize\"\n :remote-show-suffix=\"false\"\n placeholder=\"字号\"\n allow-create\n :filterable=\"true\"\n >\n <el-option\n v-for=\"item in ['12px', '14px', '16px', '18px', '20px', '24px', '28px', '32px', '36px', '40px', '48px']\"\n :key=\"item\"\n :label=\"item\"\n :value=\"item\"\n />\n </el-select>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 粗细\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontWeight === ''\"\n @click=\"clear('fontWeight')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div style=\"width: 100px\" class=\"m-r-5px m-b-5px\">\n <el-select\n v-model=\"styles.fontWeight\"\n :remote-show-suffix=\"false\"\n placeholder=\"粗细\"\n allow-create\n :filterable=\"true\"\n >\n <el-option\n v-for=\"item in WeightValues\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n ></el-option>\n </el-select>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字粗细\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontWeight === ''\"\n @click=\"clear('fontWeight')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-r-5px m-b-5px\">\n <el-radio-group v-model=\"styles.fontWeight\">\n <el-radio-button value=\"bold\">\n <dk-icon icon=\"radix-icons:font-bold\" title=\"文字加粗\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"lighter\">\n <dk-icon icon=\"clarity:font-size-line\" title=\"文字默认\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" class=\"m-r-5px\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字风格\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.fontStyle === ''\"\n @click=\"clear('fontStyle')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-r-5px m-b-5px\">\n <el-radio-group v-model=\"styles.fontStyle\">\n <el-radio-button value=\"italic\">\n <dk-icon icon=\"radix-icons:font-italic\" title=\"文字倾斜\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top-end\" trigger=\"hover\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #content>\n 文字装饰\n <el-button\n size=\"small\"\n icon=\"Refresh\"\n color=\"var(--el-text-color-primary)\"\n :disabled=\"styles.textDecoration === ''\"\n @click=\"clear('textDecoration')\"\n >重置</el-button\n >\n </template>\n <!-- -->\n <template #default>\n <div class=\"m-b-5px\">\n <el-radio-group v-model=\"styles.textDecoration\">\n <el-radio-button value=\"underline\">\n <dk-icon icon=\"radix-icons:underline\" title=\"下划线\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"line-through\">\n <dk-icon icon=\"radix-icons:strikethrough\" title=\"删除线\"></dk-icon>\n </el-radio-button>\n <el-radio-button value=\"wavy underline\">\n <dk-icon icon=\"mdi:format-underline-wavy\" title=\"波浪线\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </div>\n </template>\n </el-tooltip>\n <el-tooltip placement=\"top\" trigger=\"hover\" content=\"全部重置\" :show-after=\"showAfter\" :hide-after=\"hideAfter\">\n <template #default>\n <el-button type=\"danger\" plain icon=\"Delete\" class=\"m-l-5px m-b-5px\" @click=\"clear('all')\"></el-button>\n </template>\n </el-tooltip>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleFontInputProps } from './props'\nimport { reactive, watch } from 'vue'\n\n\n\nconst props = defineProps(styleFontInputProps)\n\nconst showAfter = 400\nconst hideAfter = 100\n\nconst styles: any = reactive({\n color: props.modelValue.color || '',\n fontSize: props.modelValue.fontSize || '',\n fontWeight: props.modelValue.fontWeight || '',\n fontStyle: props.modelValue.fontStyle || '',\n textDecoration: props.modelValue.textDecoration || '',\n})\n\nconst emit = defineEmits(['update:modelValue', 'change'])\nwatch(styles, (val) => {\n const _styles = Object.keys(styles).reduce((acc: any, key) => {\n if (styles[key] !== '') {\n acc[key] = styles[key]\n }\n return acc\n }, {})\n emit('update:modelValue', _styles)\n emit('change', _styles)\n})\n\nwatch(\n () => props.modelValue,\n () => {\n // styles.color = props.modelValue.color || ''\n // styles.fontSize = props.modelValue.fontSize || ''\n // styles.fontWeight = props.modelValue.fontWeight || ''\n // styles.fontStyle = props.modelValue.fontStyle || ''\n // styles.textDecoration = props.modelValue.textDecoration || ''\n const propertiesToWatch = ['color', 'fontSize', 'fontWeight', 'fontStyle', 'textDecoration']\n propertiesToWatch.forEach((property) => {\n styles[property] = props.modelValue[property] || ''\n })\n },\n { deep: true }\n)\n\nconst WeightValues = [\n { label: '普通', value: 'normal' },\n { label: '加粗', value: 'bold' },\n { label: '更粗', value: 'bolder' },\n { label: '更细', value: 'lighter' },\n { label: '100', value: '100' },\n { label: '200', value: '200' },\n { label: '300', value: '300' },\n { label: '400', value: '400' },\n { label: '500', value: '500' },\n { label: '600', value: '600' },\n { label: '700', value: '700' },\n { label: '800', value: '800' },\n { label: '900', value: '900' },\n]\n\nconst clear = (type: string) => {\n if (type === 'all') {\n Object.keys(styles).forEach((key) => {\n styles[key] = ''\n })\n } else {\n styles[type] = ''\n }\n}\n</script>\n"],"names":["__MACROS_defineComponent","reactive","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,kBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAwLD,IAAA,MAAM,SAAY,GAAA,GAAA,CAAA;AAClB,IAAA,MAAM,SAAY,GAAA,GAAA,CAAA;AAElB,IAAA,MAAM,SAAcC,YAAS,CAAA;AAAA,MAC3B,KAAA,EAAO,KAAM,CAAA,UAAA,CAAW,KAAS,IAAA,EAAA;AAAA,MACjC,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,QAAY,IAAA,EAAA;AAAA,MACvC,UAAA,EAAY,KAAM,CAAA,UAAA,CAAW,UAAc,IAAA,EAAA;AAAA,MAC3C,SAAA,EAAW,KAAM,CAAA,UAAA,CAAW,SAAa,IAAA,EAAA;AAAA,MACzC,cAAA,EAAgB,KAAM,CAAA,UAAA,CAAW,cAAkB,IAAA,EAAA;AAAA,KACpD,CAAA,CAAA;AAGD,IAAMC,SAAA,CAAA,MAAA,EAAQ,CAAC,GAAQ,KAAA;AACrB,MAAM,MAAA,OAAA,GAAU,OAAO,IAAK,CAAA,MAAM,EAAE,MAAO,CAAA,CAAC,KAAU,GAAQ,KAAA;AAC5D,QAAI,IAAA,MAAA,CAAO,GAAG,CAAA,KAAM,EAAI,EAAA;AACtB,UAAI,GAAA,CAAA,GAAG,CAAI,GAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AAAA,SACvB;AACA,QAAO,OAAA,GAAA,CAAA;AAAA,OACT,EAAG,EAAE,CAAA,CAAA;AACL,MAAA,IAAA,CAAK,qBAAqB,OAAO,CAAA,CAAA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AA,EAAO,KAAM,EAAA;AAAA,MAC7B,EAAE,KAAA,EAAO,KAAO,EAAA,KAAA,EAAO,KAAM,EAAA;AAAA,MAC7B,EAAE,KAAA,EAAO,KAAO,EAAA,KAAA,EAAO,KAAM,EAAA;AAAA,KAC/B,CAAA;AAEA,IAAM,MAAA,KAAA,GAAQ,CAAC,IAAiB,KAAA;AAC9B,MAAA,IAAI,SAAS,KAAO,EAAA;AAClB,QAAA,MAAA,CAAO,IAAK,CAAA,MAAM,CAAE,CAAA,OAAA,CAAQ,CAAC,GAAQ,KAAA;AACnC,UAAA,MAAA,CAAO,GAAG,CAAI,GAAA,EAAA,CAAA;AAAA,SACf,CAAA,CAAA;AAAA,OACI,MAAA;AACL,QAAA,MAAA,CAAO,IAAI,CAAI,GAAA,EAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"style-number-input.vue2.js","sources":["../../../src/style-number-input/src/style-number-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleNumberInput',\n});\n</script>\n<template>\n <div :class=\"['dk-style-number-input', props.direction]\">\n <el-input\n v-model=\"form.number\"\n type=\"text\"\n :controls=\"false\"\n @input=\"emit('input', $event)\"\n >\n <template #prefix>\n <span\n class=\"w-resize\"\n :class=\"[`${props.direction}-resize`]\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :disabled=\"!props.tooltipContent\"\n :content=\"props.tooltipContent\"\n placement=\"top\"\n :open-delay=\"500\"\n >\n <dk-icon :icon=\"props.icon || 'Rank'\"></dk-icon>\n </el-tooltip>\n </span>\n </template>\n <template v-if=\"showUnit\" #append>\n <el-select v-model=\"form.unit\" style=\"width: 40px\" suffix-icon=\"\">\n <el-option\n v-for=\"(item, index) in units\"\n :key=\"index\"\n :label=\"item\"\n :value=\"item\"\n />\n </el-select>\n </template>\n </el-input>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { styleNumberInputProps } from './props'\nimport { reactive, ref, watch } from 'vue'\nimport { splitUnit } from '@vipl520/utils'\n\n\nconst props = defineProps(styleNumberInputProps)\nconst values = splitUnit(props.modelValue, props.units)\nconst form: any = reactive({\n number: values.number,\n unit: values.unit || 'px',\n})\n\nconst isDragging = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst startY = ref(0) // 开始的Y坐标\nconst startX = ref(0) // 开始的X坐标\nconst handleMouseDown = (event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n startY.value = event.clientY\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n let increment\n if (props.direction === 'horizontal') {\n const dx = event.clientX - startX.value\n increment = Math.floor(dx / 10)\n startX.value += increment * 10\n } else if (props.direction === 'vertical') {\n const dy = event.clientY - startY.value\n increment = Math.floor(dy / 10)\n startY.value += increment * 10\n }\n form.number = parseInt(form.number + increment)\n }\n}\n\nconst handleMouseUp = () => {\n console.log('up')\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n}\nconst emit = defineEmits(['input', 'update:modelValue'])\n\nwatch(\n () => form,\n () => {\n if (form.number === '') {\n emit('update:modelValue', '')\n } else {\n emit('update:modelValue', form.number + form.unit)\n }\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n const values = splitUnit(props.modelValue, props.units)\n form.number = values.number\n form.unit = values.unit || 'px'\n }\n)\n</script>\n"],"names":["__MACROS_defineComponent","splitUnit","reactive","ref","watch","values"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAmDD,IAAA,MAAM,MAAS,GAAAC,eAAA,CAAU,KAAM,CAAA,UAAA,EAAY,MAAM,KAAK,CAAA,CAAA;AACtD,IAAA,MAAM,OAAYC,YAAS,CAAA;AAAA,MACzB,QAAQ,MAAO,CAAA,MAAA;AAAA,MACf,IAAA,EAAM,OAAO,IAAQ,IAAA,IAAA;AAAA,KACtB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAaC,QAAI,KAAK,CAAA,CAAA;AAC5B,IAAM,MAAA,eAAA,GAAuBA,QAAI,IAAI,CAAA,CAAA;AACrC,IAAM,MAAA,eAAA,GAAuBA,QAAI,IAAI,CAAA,CAAA;AACrC,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,eAAA,GAAkB,CAAC,KAAe,KAAA;AACtC,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AACnB,MAAA,MAAA,CAAO,QAAQ,KAAM,CAAA,OAAA,CAAA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../../src/style-number-input/src/style-number-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleNumberInput',\n});\n</script>\n<template>\n <div :class=\"['dk-style-number-input', props.direction]\">\n <el-input v-model=\"form.number\" type=\"text\" :controls=\"false\" @input=\"emit('input', $event)\">\n <template #prefix>\n <span\n class=\"w-resize\"\n :class=\"[`${props.direction}-resize`]\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :disabled=\"!props.tooltipContent\"\n :content=\"props.tooltipContent\"\n placement=\"top\"\n :open-delay=\"500\"\n >\n <dk-icon :icon=\"props.icon || 'Rank'\"></dk-icon>\n </el-tooltip>\n </span>\n </template>\n <template v-if=\"showUnit\" #append>\n <el-select v-model=\"form.unit\" style=\"width: 40px\" suffix-icon=\"\">\n <el-option v-for=\"(item, index) in units\" :key=\"index\" :label=\"item\" :value=\"item\" />\n </el-select>\n </template>\n </el-input>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { styleNumberInputProps } from './props'\nimport { reactive, ref, watch } from 'vue'\nimport { splitUnit } from '@vipl520/utils'\n\n\nconst props = defineProps(styleNumberInputProps)\nconst values = splitUnit(props.modelValue, props.units)\nconst form: any = reactive({\n number: values.number,\n unit: values.unit || 'px',\n})\n\nconst isDragging = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst startY = ref(0) // 开始的Y坐标\nconst startX = ref(0) // 开始的X坐标\nconst handleMouseDown = (event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n startY.value = event.clientY\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n let increment\n if (props.direction === 'horizontal') {\n const dx = event.clientX - startX.value\n increment = Math.floor(dx / 10)\n startX.value += increment * 10\n } else if (props.direction === 'vertical') {\n const dy = event.clientY - startY.value\n increment = Math.floor(dy / 10)\n startY.value += increment * 10\n }\n form.number = parseInt(form.number + increment)\n }\n}\n\nconst handleMouseUp = () => {\n console.log('up')\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n}\nconst emit = defineEmits(['input', 'update:modelValue'])\n\nwatch(\n () => form,\n () => {\n if (form.number === '') {\n emit('update:modelValue', '')\n } else {\n emit('update:modelValue', form.number + form.unit)\n }\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n const values = splitUnit(props.modelValue, props.units)\n form.number = values.number\n form.unit = values.unit || 'px'\n }\n)\n</script>\n"],"names":["__MACROS_defineComponent","splitUnit","reactive","ref","watch","values"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAyCD,IAAA,MAAM,MAAS,GAAAC,eAAA,CAAU,KAAM,CAAA,UAAA,EAAY,MAAM,KAAK,CAAA,CAAA;AACtD,IAAA,MAAM,OAAYC,YAAS,CAAA;AAAA,MACzB,QAAQ,MAAO,CAAA,MAAA;AAAA,MACf,IAAA,EAAM,OAAO,IAAQ,IAAA,IAAA;AAAA,KACtB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAaC,QAAI,KAAK,CAAA,CAAA;AAC5B,IAAM,MAAA,eAAA,GAAuBA,QAAI,IAAI,CAAA,CAAA;AACrC,IAAM,MAAA,eAAA,GAAuBA,QAAI,IAAI,CAAA,CAAA;AACrC,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAA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,IAAA,CAAA;AAAA,OAC7B;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -185,10 +185,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
185
185
  }, {
186
186
  default: vue.withCtx(() => [
187
187
  vue.createElementVNode("span", {
188
- style: vue.normalizeStyle([
189
- { "cursor": "pointer" },
190
- form.value[item.value] ? "color:var(--el-color-primary)" : ""
191
- ]),
188
+ style: vue.normalizeStyle([{ "cursor": "pointer" }, form.value[item.value] ? "color:var(--el-color-primary)" : ""]),
192
189
  onClick: ($event) => form.value[item.value] = ""
193
190
  }, vue.toDisplayString(item.label) + "\uFF1A", 13, _hoisted_2)
194
191
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"style-position-input.vue2.js","sources":["../../../src/style-position-input/src/style-position-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button\n v-for=\"(item, key) in positions\"\n :key=\"key\"\n :label=\"item.value\"\n >\n {{ item.label }}\n </el-radio-button>\n </el-radio-group>\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col\n v-for=\"(item, key) in custom\"\n :key=\"key\"\n :span=\"span\"\n class=\"m-b-5px\"\n >\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :content=\"item.tip\"\n placement=\"top\"\n >\n <span\n style=\"cursor: pointer\"\n :style=\"\n form[item.value] ? 'color:var(--el-color-primary)' : ''\n \"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input\n v-model=\"form[item.value]\"\n @input=\"change = false\"\n ></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n { label: '下居中', value: 'down-center' },\n { label: '上居中', value: 'up-center' },\n]\nconst emit = defineEmits(['update:modelValue'])\n\nconst change = ref(false)\n\nconst positionChange = (value: string) => {\n change.value = true\n switch (value) {\n case 'left-top':\n form.value = { left: '1px', top: '1px', right: '', bottom: '' }\n break\n case 'left-down':\n form.value = { left: '1px', bottom: '1px', right: '', up: '' }\n break\n case 'right-top':\n form.value = { top: '1px', right: '1px', left: '', bottom: '' }\n break\n case 'right-down':\n form.value = { right: '1px', bottom: '1px', left: '', up: '' }\n break\n case 'down-center':\n form.value = { left: '1px', right: '1px', bottom: '1px', up: '' }\n break\n case 'up-center':\n form.value = { left: '1px', top: '1px', right: '1px', bottom: '' }\n break\n }\n // emitValue()\n}\nconst emitValue = () => {\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n // 当 change.value 存在时检查是否不等于 '0px',否则只检查当前 key 是否不等于 'position'\n if (\n (change.value && form.value[cur] != '0px') ||\n (!change.value && cur !== 'position')\n ) {\n if (form.value[cur]) {\n prev[cur] = form.value[cur]\n }\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\n prev[cur] = props.modelValue[cur]\n }\n return prev\n }, form.value)\n },\n { deep: true }\n)\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","computed","watch"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,sBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA8DD,IAAM,MAAA,EAAA,GAAUC,QAAI,IAAI,CAAA,CAAA;AACxB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AAEnC,IAAM,MAAA,IAAA,GAAOC,aAAS,MAAM;AAC1B,MAAI,IAAA,KAAA,CAAM,SAAS,GAAK,EAAA;AACtB,QAAO,OAAA,EAAA,CAAA;AAAA,OACT,MAAA,IAAW,KAAM,CAAA,KAAA,GAAQ,GAAK,EAAA;AAC5B,QAAO,OAAA,EAAA,CAAA;AAAA,OACF,MAAA;AACL,QAAO,OAAA,CAAA,CAAA;AAAA,OACT;AAAA,KACD,CAAA,CAAA;AAMD,IAAA,MAAM,OAAYF,OAAI,CAAA;AAAA,MACpB,IAAA,EAAM,KAAM,CAAA,UAAA,CAAW,IAAQ,IAAA,EAAA;AAAA,MAC/B,GAAA,EAAK,KAAM,CAAA,UAAA,CAAW,GAAO,IAAA,EAAA;AAAA,MAC7B,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.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button v-for=\"(item, key) in positions\" :key=\"key\" :label=\"item.value\">\n {{ item.label }}\n </el-radio-button>\n </el-radio-group>\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col v-for=\"(item, key) in custom\" :key=\"key\" :span=\"span\" class=\"m-b-5px\">\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip class=\"item\" effect=\"dark\" :content=\"item.tip\" placement=\"top\">\n <span\n style=\"cursor: pointer\"\n :style=\"form[item.value] ? 'color:var(--el-color-primary)' : ''\"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input v-model=\"form[item.value]\" @input=\"change = false\"></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n { label: '下居中', value: 'down-center' },\n { label: '上居中', value: 'up-center' },\n]\nconst emit = defineEmits(['update:modelValue'])\n\nconst change = ref(false)\n\nconst positionChange = (value: string) => {\n change.value = true\n switch (value) {\n case 'left-top':\n form.value = { left: '1px', top: '1px', right: '', bottom: '' }\n break\n case 'left-down':\n form.value = { left: '1px', bottom: '1px', right: '', up: '' }\n break\n case 'right-top':\n form.value = { top: '1px', right: '1px', left: '', bottom: '' }\n break\n case 'right-down':\n form.value = { right: '1px', bottom: '1px', left: '', up: '' }\n break\n case 'down-center':\n form.value = { left: '1px', right: '1px', bottom: '1px', up: '' }\n break\n case 'up-center':\n form.value = { left: '1px', top: '1px', right: '1px', bottom: '' }\n break\n }\n // emitValue()\n}\nconst emitValue = () => {\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n // 当 change.value 存在时检查是否不等于 '0px',否则只检查当前 key 是否不等于 'position'\n if ((change.value && form.value[cur] != '0px') || (!change.value && cur !== 'position')) {\n if (form.value[cur]) {\n prev[cur] = form.value[cur]\n }\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\n prev[cur] = props.modelValue[cur]\n }\n return prev\n }, form.value)\n },\n { deep: true }\n)\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","computed","watch"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,sBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA2CD,IAAM,MAAA,EAAA,GAAUC,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AM;AACJ,QAAA,MAAA,CAAO,KAAK,KAAM,CAAA,UAAU,EAAE,MAAO,CAAA,CAAC,MAAW,GAAQ,KAAA;AACvD,UAAA,IAAI,QAAQ,UAAY,EAAA;AACtB,YAAA,IAAA,CAAK,GAAG,CAAA,GAAI,KAAM,CAAA,UAAA,CAAW,GAAG,CAAA,CAAA;AAAA,WAClC;AACA,UAAO,OAAA,IAAA,CAAA;AAAA,SACT,EAAG,KAAK,KAAK,CAAA,CAAA;AAAA,OACf;AAAA,MACA,EAAE,MAAM,IAAK,EAAA;AAAA,KACf,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComSearch.vue2.js","sources":["../../../../src/table/src/components/ComSearch.vue"],"sourcesContent":["<template>\n <div ref=\"el\" class=\"table-com-search\">\n <el-form\n label-position=\"top\"\n :model=\"DkTable.comSearch.form\"\n @submit.prevent=\"\"\n @keyup.enter=\"onComSearch\"\n >\n <el-row>\n <template v-for=\"(item, idx) in DkTable.table.column\" :key=\"idx\">\n <template v-if=\"item.operator !== false\">\n <!-- 自定义渲染 component、slot -->\n <el-col\n v-if=\"\n item.comSearchRender == 'customRender' ||\n item.comSearchRender == 'slot'\n \"\n :span=\"spans.common\"\n >\n <!-- 外部可以使用 :deep() 选择器修改css样式 -->\n <div class=\"com-search-col\">\n <div\n v-if=\"item.comSearchShowLabel !== false\"\n class=\"com-search-col-label\"\n >\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input\">\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"item.comSearchComponent\"\n v-if=\"item.comSearchRender == 'customRender'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n v-bind=\"item.comSearchProps\"\n :placeholder=\"item.operatorPlaceholder\"\n ></component>\n\n <!-- 自定义渲染-slot -->\n <slot\n v-else-if=\"item.comSearchRender == 'slot'\"\n :name=\"item.comSearchSlotName\"\n ></slot>\n </div>\n </div>\n </el-col>\n\n <!-- 时间范围 -->\n <el-col\n v-else-if=\"\n item.render == 'datetime' &&\n (item.operator == 'RANGE' || item.operator == 'NOT RANGE')\n \"\n :span=\"spans.datetime\"\n >\n <div class=\"com-search-col\">\n <div\n v-if=\"item.comSearchShowLabel !== false\"\n class=\"com-search-col-label\"\n >\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input-range\">\n <el-date-picker\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n :default-value=\"\n DkTable.comSearch.form[item.prop! + '-default']\n ? DkTable.comSearch.form[item.prop! + '-default']\n : [new Date(), new Date()]\n \"\n :type=\"\n item.comSearchRender == 'date'\n ? 'daterange'\n : 'datetimerange'\n \"\n range-separator=\"到\"\n start-placeholder=\"开始日期\"\n end-placeholder=\"结束日期\"\n :value-format=\"\n item.comSearchRender == 'date'\n ? 'YYYY-MM-DD'\n : 'YYYY-MM-DD HH:mm:ss'\n \"\n :teleported=\"false\"\n />\n </div>\n </div>\n </el-col>\n <!--时间范围-->\n <el-col\n v-else-if=\"\n item.render == 'time' &&\n (item.operator == 'RANGE' || item.operator == 'NOT RANGE')\n \"\n :span=\"spans.datetime\"\n >\n <div class=\"com-search-col\">\n <div\n v-if=\"item.comSearchShowLabel !== false\"\n class=\"com-search-col-label\"\n >\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input-range\">\n <el-time-picker\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n is-range\n range-separator=\"到\"\n format=\"HH:mm:ss\"\n value-format=\"HH:mm:ss\"\n start-placeholder=\"开始时间\"\n end-placeholder=\"结束时间\"\n ></el-time-picker>\n </div>\n </div>\n </el-col>\n <el-col v-else :span=\"spans.common\">\n <div class=\"com-search-col\">\n <div\n v-if=\"item.comSearchShowLabel !== false\"\n class=\"com-search-col-label\"\n >\n {{ item.label }}\n </div>\n <!-- 数字范围 -->\n <div\n v-if=\"\n item.operator == 'RANGE' || item.operator == 'NOT RANGE'\n \"\n class=\"com-search-col-input-range\"\n >\n <el-input\n v-model=\"DkTable.comSearch.form[item.prop! + '-start']\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n <div class=\"range-separator\">到</div>\n <el-input\n v-model=\"DkTable.comSearch.form[item.prop! + '-end']\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n </div>\n <!-- 是否 [NOT] NULL -->\n <div\n v-else-if=\"\n item.operator == 'NULL' || item.operator == 'NOT NULL'\n \"\n class=\"com-search-col-input\"\n >\n <el-checkbox\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :label=\"item.operator\"\n size=\"large\"\n ></el-checkbox>\n </div>\n <div v-else-if=\"item.operator\" class=\"com-search-col-input\">\n <!-- 时间筛选 -->\n <el-date-picker\n v-if=\"\n item.render == 'datetime' ||\n item.comSearchRender == 'date'\n \"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n :type=\"item.comSearchRender == 'date' ? 'date' : 'datetime'\"\n :value-format=\"\n item.comSearchRender == 'date'\n ? 'YYYY-MM-DD'\n : 'YYYY-MM-DD HH:mm:ss'\n \"\n :placeholder=\"item.operatorPlaceholder\"\n :default-value=\"\n DkTable.comSearch.form[item.prop! + '-default']\n ? DkTable.comSearch.form[item.prop! + '-default']\n : new Date()\n \"\n :teleported=\"false\"\n />\n <!-- 年筛选 -->\n <el-date-picker\n v-if=\"item.render == 'year'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n type=\"year\"\n value-format=\"YYYY\"\n style=\"width: 100%\"\n :placeholder=\"item.operatorPlaceholder\"\n />\n <!-- tag、tags、select -->\n <el-select\n v-else-if=\"\n (item.render == 'tag' ||\n item.render == 'tags' ||\n item.comSearchRender == 'select') &&\n item.replaceValue\n \"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n :clearable=\"true\"\n >\n <el-option\n v-for=\"(opt, okey) in item.replaceValue\"\n :key=\"item.prop! + okey\"\n :label=\"opt\"\n :value=\"okey\"\n />\n </el-select>\n\n <!-- 远程 select -->\n <dk-select\n v-else-if=\"item.comSearchRender == 'remoteSelect'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n filterable\n :placeholder=\"item.operatorPlaceholder\"\n :remote-url=\"item.remoteUrl\"\n ></dk-select>\n\n <!-- 开关 -->\n <el-select\n v-else-if=\"item.render == 'switch'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n :clearable=\"true\"\n >\n <template v-if=\"!isEmpty(item.replaceValue)\">\n <el-option\n v-for=\"(opt, okey) in item.replaceValue\"\n :key=\"item.prop! + okey\"\n :label=\"opt\"\n :value=\"okey\"\n />\n </template>\n <template v-else>\n <el-option label=\"开\" value=\"1\" />\n <el-option label=\"关\" value=\"0\" />\n </template>\n </el-select>\n\n <!-- 字符串 -->\n <el-input\n v-else\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n </div>\n </div>\n </el-col>\n </template>\n </template>\n <el-col :xs=\"24\" :sm=\"6\">\n <div class=\"com-search-col pl-20\">\n <el-button v-blur type=\"primary\" @click=\"onComSearch\">\n 搜索</el-button\n >\n <el-button @click=\"onResetForm()\">重置</el-button>\n </div>\n </el-col>\n </el-row>\n </el-form>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, ref, computed } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { useElementSize } from '@vueuse/core'\nimport DkTableClass from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as DkTableClass\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\nconst spans = computed(() => {\n if (width.value < 768) {\n return {\n common: 24,\n datetime: 24,\n }\n }\n if (width.value < 900) {\n return {\n common: 12,\n datetime: 24,\n }\n }\n if (width.value < 1200) {\n return {\n common: 8,\n datetime: 16,\n }\n }\n return {\n common: 6,\n datetime: 12,\n }\n})\nconst onComSearch = () => {\n const comSearchData: comSearchData[] = []\n for (const key in DkTable.comSearch.form) {\n if (!DkTable.comSearch.fieldData.has(key)) {\n continue\n }\n let val = ''\n const fieldDataTemp = DkTable.comSearch.fieldData.get(key)\n if (\n fieldDataTemp.render == 'datetime' &&\n (fieldDataTemp.operator == 'RANGE' ||\n fieldDataTemp.operator == 'NOT RANGE')\n ) {\n // 时间范围组件返回的是时间数组\n if (\n DkTable.comSearch.form[key] &&\n DkTable.comSearch.form[key].length >= 2\n ) {\n // 数组转字符串,以实现通过url参数传递预设搜索值\n if (fieldDataTemp.comSearchRender == 'date') {\n val =\n DkTable.comSearch.form[key][0] +\n ' 00:00:00' +\n ',' +\n DkTable.comSearch.form[key][1] +\n ' 23:59:59'\n } else {\n val =\n DkTable.comSearch.form[key][0] +\n ',' +\n DkTable.comSearch.form[key][1]\n }\n }\n } else if (\n fieldDataTemp.render == 'time' &&\n (fieldDataTemp.operator == 'RANGE' ||\n fieldDataTemp.operator == 'NOT RANGE')\n ) {\n // 时间范围组件返回的是时间数组\n if (\n DkTable.comSearch.form[key] &&\n DkTable.comSearch.form[key].length >= 2\n ) {\n // 数组转字符串,以实现通过url参数传递预设搜索值\n // if (fieldDataTemp.comSearchRender == 'date') {\n // val = DkTable.comSearch.form[key][0] + ' 00:00:00' + ',' + DkTable.comSearch.form[key][1] + ' 23:59:59'\n // } else {\n val =\n DkTable.comSearch.form[key][0] + ',' + DkTable.comSearch.form[key][1]\n // console.log('val', val, DkTable.comSearch.form[key])\n // }\n }\n } else if (\n fieldDataTemp.operator == 'RANGE' ||\n fieldDataTemp.operator == 'NOT RANGE'\n ) {\n // 普通的范围筛选,DkTable在初始化时已准备好start和end字段\n if (\n !DkTable.comSearch.form[key + '-start'] &&\n !DkTable.comSearch.form[key + '-end']\n ) {\n continue\n }\n val =\n DkTable.comSearch.form[key + '-start'] +\n ',' +\n DkTable.comSearch.form[key + '-end']\n } else if (DkTable.comSearch.form[key]) {\n val = DkTable.comSearch.form[key]\n }\n\n if (val) {\n comSearchData.push({\n field: key,\n val,\n operator: fieldDataTemp.operator,\n render: fieldDataTemp.render,\n })\n }\n }\n\n // console.log('comSearchData', comSearchData)\n DkTable.onTableAction('com-search', comSearchData)\n}\n\nconst onResetForm = () => {\n // 封装好的onResetForm在此处不能使用\n for (const key in DkTable.comSearch.form) {\n DkTable.comSearch.form[key] = ''\n }\n onComSearch()\n}\n</script>\n"],"names":["inject","ref","useElementSize","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiRA,IAAM,MAAA,OAAA,GAAUA,WAAO,SAAS,CAAA,CAAA;AAChC,IAAM,MAAA,EAAA,GAAUC,QAAI,IAAI,CAAA,CAAA;AACxB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AACnC,IAAM,MAAA,KAAA,GAAQC,aAAS,MAAM;AAC3B,MAAI,IAAA,KAAA,CAAM,QAAQ,GAAK,EAAA;AACrB,QAAO,OAAA;AAAA,UACL,MAAQ,EAAA,EAAA;AAAA,UACR,QAAU,EAAA,EAAA;AAAA,SACZ,CAAA;AAAA,OACF;AACA,MAAI,IAAA,KAAA,CAAM,QAAQ,GAAK,EAAA;AACrB,QAAO,OAAA;AAAA,UACL,MAAQ,EAAA,EAAA;AAAA,UACR,QAAU,EAAA,EAAA;AAAA,SACZ,CAAA;AAAA,OACF;AACA,MAAI,IAAA,KAAA,CAAM,QAAQ,IAAM,EAAA;AACtB,QAAO,OAAA;AAAA,UACL,MAAQ,EAAA,CAAA;AAAA,UACR,QAAU,EAAA,EAAA;AAAA,SACZ,CAAA;AAAA,OACF;A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AA,YACxB,QAAQ,aAAc,CAAA,MAAA;AAAA,WACvB,CAAA,CAAA;AAAA,SACH;AAAA,OACF;AAGA,MAAQ,OAAA,CAAA,aAAA,CAAc,cAAc,aAAa,CAAA,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,MAAM,cAAc,MAAM;AAExB,MAAW,KAAA,MAAA,GAAA,IAAO,OAAQ,CAAA,SAAA,CAAU,IAAM,EAAA;AACxC,QAAQ,OAAA,CAAA,SAAA,CAAU,IAAK,CAAA,GAAG,CAAI,GAAA,EAAA,CAAA;AAAA,OAChC;AACA,MAAY,WAAA,EAAA,CAAA;AAAA,KACd,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ComSearch.vue2.js","sources":["../../../../src/table/src/components/ComSearch.vue"],"sourcesContent":["<template>\n <div ref=\"el\" class=\"table-com-search\">\n <el-form label-position=\"top\" :model=\"DkTable.comSearch.form\" @submit.prevent=\"\" @keyup.enter=\"onComSearch\">\n <el-row>\n <template v-for=\"(item, idx) in DkTable.table.column\" :key=\"idx\">\n <template v-if=\"item.operator !== false\">\n <!-- 自定义渲染 component、slot -->\n <el-col\n v-if=\"item.comSearchRender == 'customRender' || item.comSearchRender == 'slot'\"\n :span=\"spans.common\"\n >\n <!-- 外部可以使用 :deep() 选择器修改css样式 -->\n <div class=\"com-search-col\">\n <div v-if=\"item.comSearchShowLabel !== false\" class=\"com-search-col-label\">\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input\">\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"item.comSearchComponent\"\n v-if=\"item.comSearchRender == 'customRender'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n v-bind=\"item.comSearchProps\"\n :placeholder=\"item.operatorPlaceholder\"\n ></component>\n\n <!-- 自定义渲染-slot -->\n <slot v-else-if=\"item.comSearchRender == 'slot'\" :name=\"item.comSearchSlotName\"></slot>\n </div>\n </div>\n </el-col>\n\n <!-- 时间范围 -->\n <el-col\n v-else-if=\"item.render == 'datetime' && (item.operator == 'RANGE' || item.operator == 'NOT RANGE')\"\n :span=\"spans.datetime\"\n >\n <div class=\"com-search-col\">\n <div v-if=\"item.comSearchShowLabel !== false\" class=\"com-search-col-label\">\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input-range\">\n <el-date-picker\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n :default-value=\"\n DkTable.comSearch.form[item.prop! + '-default']\n ? DkTable.comSearch.form[item.prop! + '-default']\n : [new Date(), new Date()]\n \"\n :type=\"item.comSearchRender == 'date' ? 'daterange' : 'datetimerange'\"\n range-separator=\"到\"\n start-placeholder=\"开始日期\"\n end-placeholder=\"结束日期\"\n :value-format=\"item.comSearchRender == 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'\"\n :teleported=\"false\"\n />\n </div>\n </div>\n </el-col>\n <!--时间范围-->\n <el-col\n v-else-if=\"item.render == 'time' && (item.operator == 'RANGE' || item.operator == 'NOT RANGE')\"\n :span=\"spans.datetime\"\n >\n <div class=\"com-search-col\">\n <div v-if=\"item.comSearchShowLabel !== false\" class=\"com-search-col-label\">\n {{ item.label }}\n </div>\n <div class=\"com-search-col-input-range\">\n <el-time-picker\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n is-range\n range-separator=\"到\"\n format=\"HH:mm:ss\"\n value-format=\"HH:mm:ss\"\n start-placeholder=\"开始时间\"\n end-placeholder=\"结束时间\"\n ></el-time-picker>\n </div>\n </div>\n </el-col>\n <el-col v-else :span=\"spans.common\">\n <div class=\"com-search-col\">\n <div v-if=\"item.comSearchShowLabel !== false\" class=\"com-search-col-label\">\n {{ item.label }}\n </div>\n <!-- 数字范围 -->\n <div v-if=\"item.operator == 'RANGE' || item.operator == 'NOT RANGE'\" class=\"com-search-col-input-range\">\n <el-input\n v-model=\"DkTable.comSearch.form[item.prop! + '-start']\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n <div class=\"range-separator\">到</div>\n <el-input\n v-model=\"DkTable.comSearch.form[item.prop! + '-end']\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n </div>\n <!-- 是否 [NOT] NULL -->\n <div v-else-if=\"item.operator == 'NULL' || item.operator == 'NOT NULL'\" class=\"com-search-col-input\">\n <el-checkbox\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :label=\"item.operator\"\n size=\"large\"\n ></el-checkbox>\n </div>\n <div v-else-if=\"item.operator\" class=\"com-search-col-input\">\n <!-- 时间筛选 -->\n <el-date-picker\n v-if=\"item.render == 'datetime' || item.comSearchRender == 'date'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n :type=\"item.comSearchRender == 'date' ? 'date' : 'datetime'\"\n :value-format=\"item.comSearchRender == 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'\"\n :placeholder=\"item.operatorPlaceholder\"\n :default-value=\"\n DkTable.comSearch.form[item.prop! + '-default']\n ? DkTable.comSearch.form[item.prop! + '-default']\n : new Date()\n \"\n :teleported=\"false\"\n />\n <!-- 年筛选 -->\n <el-date-picker\n v-if=\"item.render == 'year'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n class=\"datetime-picker\"\n type=\"year\"\n value-format=\"YYYY\"\n style=\"width: 100%\"\n :placeholder=\"item.operatorPlaceholder\"\n />\n <!-- tag、tags、select -->\n <el-select\n v-else-if=\"\n (item.render == 'tag' || item.render == 'tags' || item.comSearchRender == 'select') &&\n item.replaceValue\n \"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n :clearable=\"true\"\n >\n <el-option\n v-for=\"(opt, okey) in item.replaceValue\"\n :key=\"item.prop! + okey\"\n :label=\"opt\"\n :value=\"okey\"\n />\n </el-select>\n\n <!-- 远程 select -->\n <dk-select\n v-else-if=\"item.comSearchRender == 'remoteSelect'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n filterable\n :placeholder=\"item.operatorPlaceholder\"\n :remote-url=\"item.remoteUrl\"\n ></dk-select>\n\n <!-- 开关 -->\n <el-select\n v-else-if=\"item.render == 'switch'\"\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n :clearable=\"true\"\n >\n <template v-if=\"!isEmpty(item.replaceValue)\">\n <el-option\n v-for=\"(opt, okey) in item.replaceValue\"\n :key=\"item.prop! + okey\"\n :label=\"opt\"\n :value=\"okey\"\n />\n </template>\n <template v-else>\n <el-option label=\"开\" value=\"1\" />\n <el-option label=\"关\" value=\"0\" />\n </template>\n </el-select>\n\n <!-- 字符串 -->\n <el-input\n v-else\n v-model=\"DkTable.comSearch.form[item.prop!]\"\n :placeholder=\"item.operatorPlaceholder\"\n type=\"string\"\n :clearable=\"true\"\n ></el-input>\n </div>\n </div>\n </el-col>\n </template>\n </template>\n <el-col :xs=\"24\" :sm=\"6\">\n <div class=\"com-search-col pl-20\">\n <el-button v-blur type=\"primary\" @click=\"onComSearch\"> 搜索</el-button>\n <el-button @click=\"onResetForm()\">重置</el-button>\n </div>\n </el-col>\n </el-row>\n </el-form>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, ref, computed } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { useElementSize } from '@vueuse/core'\nimport DkTableClass from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as DkTableClass\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\nconst spans = computed(() => {\n if (width.value < 768) {\n return {\n common: 24,\n datetime: 24,\n }\n }\n if (width.value < 900) {\n return {\n common: 12,\n datetime: 24,\n }\n }\n if (width.value < 1200) {\n return {\n common: 8,\n datetime: 16,\n }\n }\n return {\n common: 6,\n datetime: 12,\n }\n})\nconst onComSearch = () => {\n const comSearchData: comSearchData[] = []\n for (const key in DkTable.comSearch.form) {\n if (!DkTable.comSearch.fieldData.has(key)) {\n continue\n }\n let val = ''\n const fieldDataTemp = DkTable.comSearch.fieldData.get(key)\n if (\n fieldDataTemp.render == 'datetime' &&\n (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE')\n ) {\n // 时间范围组件返回的是时间数组\n if (DkTable.comSearch.form[key] && DkTable.comSearch.form[key].length >= 2) {\n // 数组转字符串,以实现通过url参数传递预设搜索值\n if (fieldDataTemp.comSearchRender == 'date') {\n val = DkTable.comSearch.form[key][0] + ' 00:00:00' + ',' + DkTable.comSearch.form[key][1] + ' 23:59:59'\n } else {\n val = DkTable.comSearch.form[key][0] + ',' + DkTable.comSearch.form[key][1]\n }\n }\n } else if (\n fieldDataTemp.render == 'time' &&\n (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE')\n ) {\n // 时间范围组件返回的是时间数组\n if (DkTable.comSearch.form[key] && DkTable.comSearch.form[key].length >= 2) {\n // 数组转字符串,以实现通过url参数传递预设搜索值\n // if (fieldDataTemp.comSearchRender == 'date') {\n // val = DkTable.comSearch.form[key][0] + ' 00:00:00' + ',' + DkTable.comSearch.form[key][1] + ' 23:59:59'\n // } else {\n val = DkTable.comSearch.form[key][0] + ',' + DkTable.comSearch.form[key][1]\n // console.log('val', val, DkTable.comSearch.form[key])\n // }\n }\n } else if (fieldDataTemp.operator == 'RANGE' || fieldDataTemp.operator == 'NOT RANGE') {\n // 普通的范围筛选,DkTable在初始化时已准备好start和end字段\n if (!DkTable.comSearch.form[key + '-start'] && !DkTable.comSearch.form[key + '-end']) {\n continue\n }\n val = DkTable.comSearch.form[key + '-start'] + ',' + DkTable.comSearch.form[key + '-end']\n } else if (DkTable.comSearch.form[key]) {\n val = DkTable.comSearch.form[key]\n }\n\n if (val) {\n comSearchData.push({\n field: key,\n val,\n operator: fieldDataTemp.operator,\n render: fieldDataTemp.render,\n })\n }\n }\n\n // console.log('comSearchData', comSearchData)\n DkTable.onTableAction('com-search', comSearchData)\n}\n\nconst onResetForm = () => {\n // 封装好的onResetForm在此处不能使用\n for (const key in DkTable.comSearch.form) {\n DkTable.comSearch.form[key] = ''\n }\n onComSearch()\n}\n</script>\n"],"names":["inject","ref","useElementSize","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuNA,IAAM,MAAA,OAAA,GAAUA,WAAO,SAAS,CAAA,CAAA;AAChC,IAAM,MAAA,EAAA,GAAUC,QAAI,IAAI,CAAA,CAAA;AACxB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AACnC,IAAM,MAAA,KAAA,GAAQC,aAAS,MAAM;AAC3B,MAAI,IAAA,KAAA,CAAM,QAAQ,GAAK,EAAA;AACrB,QAAO,OAAA;AAAA,UACL,MAAQ,EAAA,EAAA;AAAA,UACR,QAAU,EAAA,EAAA;AAAA,SACZ,CAAA;AAAA,OACF;AACA,MAAI,IAAA,KAAA,CAAM,QAAQ,GAAK,EAAA;AACrB,QAAO,OAAA;AAAA,UACL,MAAQ,EAAA,EAAA;AAAA,UACR,QAAU,EAAA,EAAA;AAAA,SACZ,CAAA;AAAA,OACF;AACA,MAAI,IAAA,KAAA,CAAM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I,GAAK,EAAA;AACP,UAAA,aAAA,CAAc,IAAK,CAAA;AAAA,YACjB,KAAO,EAAA,GAAA;AAAA,YACP,GAAA;AAAA,YACA,UAAU,aAAc,CAAA,QAAA;AAAA,YACxB,QAAQ,aAAc,CAAA,MAAA;AAAA,WACvB,CAAA,CAAA;AAAA,SACH;AAAA,OACF;AAGA,MAAQ,OAAA,CAAA,aAAA,CAAc,cAAc,aAAa,CAAA,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,MAAM,cAAc,MAAM;AAExB,MAAW,KAAA,MAAA,GAAA,IAAO,OAAQ,CAAA,SAAA,CAAU,IAAM,EAAA;AACxC,QAAQ,OAAA,CAAA,SAAA,CAAU,IAAK,CAAA,GAAG,CAAI,GAAA,EAAA,CAAA;AAAA,OAChC;AACA,MAAY,WAAA,EAAA,CAAA;AAAA,KACd,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -65,7 +65,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
65
65
  fieldValue.value = val.value;
66
66
  }
67
67
  const getTagType = (value, custom) => {
68
- return custom && custom[value] ? custom[value] : "";
68
+ return custom && custom[value] ? custom[value] : "primary";
69
69
  };
70
70
  const onChangeField = (value) => {
71
71
  DkTable.onTableAction("field-change", {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldRender.vue2.js","sources":["../../../../src/table/src/components/FieldRender.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFieldRender',\n});\n</script>\n<template>\n <!--图标-->\n <div v-if=\"field.render == 'icon'\">\n <dk-icon\n v-if=\"fieldValue || field.default\"\n :icon=\"fieldValue ? fieldValue : field.default\"\n />\n <span v-else>-</span>\n </div>\n\n <!--开关-->\n <el-switch\n v-if=\"field.render == 'switch' && fieldValue !== ''\"\n :model-value=\"fieldValue.toString()\"\n :loading=\"row.loading\"\n inactive-value=\"0\"\n active-value=\"1\"\n size=\"small\"\n @change=\"onChangeField\"\n ></el-switch>\n\n <!-- 单图 -->\n <div v-if=\"field.render == 'image' && fieldValue\" class=\"ba-render-image\">\n <el-image\n :hide-on-click-modal=\"true\"\n :preview-teleported=\"true\"\n :preview-src-list=\"[fieldValue]\"\n :src=\"fieldValue\"\n fit=\"cover\"\n style=\"width: 50px; height: 50px\"\n ></el-image>\n </div>\n\n <!--多图片-->\n <div v-if=\"field.render == 'images'\" class=\"ba-render-image\">\n <template v-if=\"Array.isArray(fieldValue) && fieldValue.length\">\n <el-image\n v-for=\"(item, idx) in fieldValue\"\n :key=\"idx\"\n :initial-index=\"idx\"\n :preview-teleported=\"true\"\n :preview-src-list=\"fieldValue\"\n class=\"images-item\"\n :src=\"item\"\n style=\"width: 50px; height: 50px\"\n :hide-on-click-modal=\"true\"\n ></el-image>\n </template>\n </div>\n\n <div v-if=\"field.render == 'tag' && fieldValue !== ''\">\n <el-tag\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}\n </el-tag>\n </div>\n\n <!-- tags -->\n <div v-if=\"field.render == 'tags'\">\n <template v-if=\"Array.isArray(fieldValue)\">\n <template v-for=\"(tag, idx) in fieldValue\" :key=\"idx\">\n <el-tag\n v-if=\"tag !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(tag, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{\n field.replaceValue ? field.replaceValue[tag] ?? tag : tag\n }}</el-tag\n >\n </template>\n </template>\n <template v-else>\n <el-tag\n v-if=\"fieldValue !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{\n field.replaceValue\n ? field.replaceValue[fieldValue] ?? fieldValue\n : fieldValue\n }}\n </el-tag>\n </template>\n </div>\n\n <!-- url -->\n <div v-if=\"field.render == 'url' && fieldValue\">\n <el-input :model-value=\"fieldValue\" placeholder=\"链接地址\">\n <template #append>\n <el-button\n @click=\"\n typeof field.click == 'function'\n ? field.click(row, field, fieldValue, column, index)\n : openUrl(fieldValue, field.target)\n \"\n >\n <dk-icon :color=\"'#606266'\" icon=\"Position\" />\n </el-button>\n </template>\n </el-input>\n </div>\n\n <!-- datetime -->\n <div v-if=\"field.render == 'datetime'\">\n {{\n !fieldValue ? '-' : timeFormat(fieldValue, field.timeFormat ?? undefined)\n }}\n </div>\n\n <div v-if=\"field.render == 'time'\">\n {{ fieldValue }}\n </div>\n <div v-if=\"field.render == 'year'\">\n {{ fieldValue }}\n </div>\n <!-- color -->\n <div v-if=\"field.render == 'color'\">\n <div :style=\"{ background: fieldValue }\" class=\"dk-render-color\"></div>\n </div>\n\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"field.customRender\"\n v-if=\"field.render == 'customRender'\"\n :render-row=\"row\"\n :render-field=\"field\"\n :render-value=\"fieldValue\"\n :render-column=\"column\"\n :render-index=\"index\"\n />\n\n <!-- 按钮组 -->\n <!-- 只对默认的编辑、删除、排序按钮进行鉴权,其他按钮请通过 display 属性控制按钮是否显示 -->\n <div v-if=\"field.render == 'buttons' && field.buttons\">\n <template v-for=\"(btn, idx) in field.buttons\" :key=\"idx\">\n <template v-if=\"btn.display ? btn.display(row, field) : true\">\n <!-- 常规按钮 未使用-->\n <el-button\n v-if=\"btn.render == 'basicButton'\"\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n\n <!-- 带提示信息的按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'tipButton' &&\n ((btn.name == 'edit' && DkTable.auth('edit')) || btn.name != 'edit')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n :hide-after=\"0\"\n :show-after=\"100\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n\n <!-- 带确认框的按钮 -->\n <el-popconfirm\n v-if=\"\n btn.render == 'confirmButton' &&\n ((btn.name == 'delete' && DkTable.auth('del')) ||\n btn.name != 'delete')\n \"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.popconfirm\"\n :hide-after=\"0\"\n :show-after=\"100\"\n @confirm=\"onButtonClick(btn)\"\n >\n <template #reference>\n <div class=\"dk-tooltip-button\">\n <el-tooltip\n :disabled=\"!btn.title\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">\n {{ btn.text }}\n </div>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n\n <!-- 带提示的可拖拽按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'moveButton' &&\n ((btn.name == 'weigh-sort' && DkTable.auth('sortable')) ||\n btn.name != 'weigh-sort')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n :hide-after=\"0\"\n :show-after=\"100\"\n placement=\"top\"\n >\n <el-button\n :class=\"btn.class\"\n class=\"table-operate move-button\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n size=\"small\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n </template>\n </template>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\nimport type { TableColumnCtx, TagProps } from 'element-plus'\nimport { openUrl, timeFormat } from '@vipl520/utils'\nimport type dkTable from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as dkTable\n\ninterface Props {\n row: TableRow\n field: TableColumn\n column: TableColumnCtx<TableRow>\n index: number\n}\nconst props = defineProps<Props>()\n\nconst fieldName: any = ref(props.field.prop)\nconst fieldValue = ref(props.row[fieldName.value] ?? '')\n\nif (fieldName.value && fieldName.value.indexOf('.') > -1) {\n const fieldNameArr = fieldName.value.split('.')\n const val: any = ref(props.row[fieldNameArr[0]])\n for (let index = 1; index < fieldNameArr.length; index++) {\n val.value = val.value ? val.value[fieldNameArr[index]] ?? '' : ''\n }\n fieldValue.value = val.value\n}\n\nconst getTagType = (value: string, custom: any): TagProps['type'] => {\n return custom && custom[value] ? custom[value] : ''\n}\n\nconst onChangeField = (value: any) => {\n DkTable.onTableAction('field-change', {\n ...props,\n value,\n })\n}\n\nconst onButtonClick = (btn: OptButton) => {\n if (typeof btn.click === 'function') {\n btn.click(props.row, props.field)\n return\n }\n DkTable.onTableAction(btn.name, props)\n}\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent","inject","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;AAqQD,IAAM,MAAA,OAAA,GAAUC,WAAO,SAAS,CAAA,CAAA;AAUhC,IAAA,MAAM,SAAiB,GAAAC,OAAA,CAAI,KAAM,CAAA,KAAA,CAAM,IAAI,CAAA,CAAA;AAC3C,IAAA,MAAM,aAAaA,OAAI,CAAA,KAAA,CAAM,IAAI,SAAU,CAAA,KAAK,KAAK,EAAE,CAAA,CAAA;AAEvD,IAAA,IAAI,UAAU,KAAS,IAAA,SAAA,CAAU,MAAM,OAAQ,CAAA,GAAG,IAAI,CAAI,CAAA,EAAA;AACxD,MAAA,MAAM,YAAe,GAAA,SAAA,CAAU,KAAM,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AAC9C,MAAA,MAAM,MAAWA,OAAI,CAAA,KAAA,CAAM,IAAI,YAAa,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;AAC/C,MAAA,KAAA,IAAS,KAAQ,GAAA,CAAA,EAAG,KAAQ,GAAA,YAAA,CAAa,QAAQ,KAAS,EAAA,EAAA;AACxD,QAAI,GAAA,CAAA,KAAA,GAAQ,IAAI,KAAQ,GAAA,GAAA,CAAI,MAAM,YAAa,CAAA,KAAK,CAAC,CAAA,IAAK,EAAK,GAAA,EAAA,CAAA;AAAA,OACjE;AACA,MAAA,UAAA,CAAW,QAAQ,GAAI,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAM,MAAA,UAAA,GAAa,CAAC,KAAA,EAAe,MAAkC,KAAA;AACnE,MAAA,OAAO,UAAU,MAAO,CAAA,KAAK,CAAI,GAAA,MAAA,CAAO,KAAK,CAAI,GAAA,EAAA,CAAA;AAAA,KACnD,CAAA;AAEA,IAAM,MAAA,aAAA,GAAgB,CAAC,KAAe,KAAA;AACpC,MAAA,OAAA,CAAQ,cAAc,cAAgB,EAAA;AAAA,QACpC,GAAG,KAAA;AAAA,QACH,KAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAM,MAAA,aAAA,GAAgB,CAAC,GAAmB,KAAA;AACxC,MAAI,IAAA,OAAO,GAAI,CAAA,KAAA,KAAU,UAAY,EAAA;AACnC,QAAA,GAAA,CAAI,KAAM,CAAA,KAAA,CAAM,GAAK,EAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAChC,QAAA,OAAA;AAAA,OACF;AACA,MAAQ,OAAA,CAAA,aAAA,CAAc,GAAI,CAAA,IAAA,EAAM,KAAK,CAAA,CAAA;AAAA,KACvC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FieldRender.vue2.js","sources":["../../../../src/table/src/components/FieldRender.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFieldRender',\n});\n</script>\n<template>\n <!--图标-->\n <div v-if=\"field.render == 'icon'\">\n <dk-icon v-if=\"fieldValue || field.default\" :icon=\"fieldValue ? fieldValue : field.default\" />\n <span v-else>-</span>\n </div>\n\n <!--开关-->\n <el-switch\n v-if=\"field.render == 'switch' && fieldValue !== ''\"\n :model-value=\"fieldValue.toString()\"\n :loading=\"row.loading\"\n inactive-value=\"0\"\n active-value=\"1\"\n size=\"small\"\n @change=\"onChangeField\"\n ></el-switch>\n\n <!-- 单图 -->\n <div v-if=\"field.render == 'image' && fieldValue\" class=\"ba-render-image\">\n <el-image\n :hide-on-click-modal=\"true\"\n :preview-teleported=\"true\"\n :preview-src-list=\"[fieldValue]\"\n :src=\"fieldValue\"\n fit=\"cover\"\n style=\"width: 50px; height: 50px\"\n ></el-image>\n </div>\n\n <!--多图片-->\n <div v-if=\"field.render == 'images'\" class=\"ba-render-image\">\n <template v-if=\"Array.isArray(fieldValue) && fieldValue.length\">\n <el-image\n v-for=\"(item, idx) in fieldValue\"\n :key=\"idx\"\n :initial-index=\"idx\"\n :preview-teleported=\"true\"\n :preview-src-list=\"fieldValue\"\n class=\"images-item\"\n :src=\"item\"\n style=\"width: 50px; height: 50px\"\n :hide-on-click-modal=\"true\"\n ></el-image>\n </template>\n </div>\n\n <div v-if=\"field.render == 'tag' && fieldValue !== ''\">\n <el-tag\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}\n </el-tag>\n </div>\n\n <!-- tags -->\n <div v-if=\"field.render == 'tags'\">\n <template v-if=\"Array.isArray(fieldValue)\">\n <template v-for=\"(tag, idx) in fieldValue\" :key=\"idx\">\n <el-tag\n v-if=\"tag !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(tag, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[tag] ?? tag : tag }}</el-tag\n >\n </template>\n </template>\n <template v-else>\n <el-tag\n v-if=\"fieldValue !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] ?? fieldValue : fieldValue }}\n </el-tag>\n </template>\n </div>\n\n <!-- url -->\n <div v-if=\"field.render == 'url' && fieldValue\">\n <el-input :model-value=\"fieldValue\" placeholder=\"链接地址\">\n <template #append>\n <el-button\n @click=\"\n typeof field.click == 'function'\n ? field.click(row, field, fieldValue, column, index)\n : openUrl(fieldValue, field.target)\n \"\n >\n <dk-icon :color=\"'#606266'\" icon=\"Position\" />\n </el-button>\n </template>\n </el-input>\n </div>\n\n <!-- datetime -->\n <div v-if=\"field.render == 'datetime'\">\n {{ !fieldValue ? '-' : timeFormat(fieldValue, field.timeFormat ?? undefined) }}\n </div>\n\n <div v-if=\"field.render == 'time'\">\n {{ fieldValue }}\n </div>\n <div v-if=\"field.render == 'year'\">\n {{ fieldValue }}\n </div>\n <!-- color -->\n <div v-if=\"field.render == 'color'\">\n <div :style=\"{ background: fieldValue }\" class=\"dk-render-color\"></div>\n </div>\n\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"field.customRender\"\n v-if=\"field.render == 'customRender'\"\n :render-row=\"row\"\n :render-field=\"field\"\n :render-value=\"fieldValue\"\n :render-column=\"column\"\n :render-index=\"index\"\n />\n\n <!-- 按钮组 -->\n <!-- 只对默认的编辑、删除、排序按钮进行鉴权,其他按钮请通过 display 属性控制按钮是否显示 -->\n <div v-if=\"field.render == 'buttons' && field.buttons\">\n <template v-for=\"(btn, idx) in field.buttons\" :key=\"idx\">\n <template v-if=\"btn.display ? btn.display(row, field) : true\">\n <!-- 常规按钮 未使用-->\n <el-button\n v-if=\"btn.render == 'basicButton'\"\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n\n <!-- 带提示信息的按钮 -->\n <el-tooltip\n v-if=\"btn.render == 'tipButton' && ((btn.name == 'edit' && DkTable.auth('edit')) || btn.name != 'edit')\"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n :hide-after=\"0\"\n :show-after=\"100\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n\n <!-- 带确认框的按钮 -->\n <el-popconfirm\n v-if=\"\n btn.render == 'confirmButton' && ((btn.name == 'delete' && DkTable.auth('del')) || btn.name != 'delete')\n \"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.popconfirm\"\n :hide-after=\"0\"\n :show-after=\"100\"\n @confirm=\"onButtonClick(btn)\"\n >\n <template #reference>\n <div class=\"dk-tooltip-button\">\n <el-tooltip :disabled=\"!btn.title\" :content=\"btn.title ?? ''\" placement=\"top\">\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">\n {{ btn.text }}\n </div>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n\n <!-- 带提示的可拖拽按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'moveButton' &&\n ((btn.name == 'weigh-sort' && DkTable.auth('sortable')) || btn.name != 'weigh-sort')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n :hide-after=\"0\"\n :show-after=\"100\"\n placement=\"top\"\n >\n <el-button\n :class=\"btn.class\"\n class=\"table-operate move-button\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n size=\"small\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n </template>\n </template>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\nimport type { TableColumnCtx, TagProps } from 'element-plus'\nimport { openUrl, timeFormat } from '@vipl520/utils'\nimport type dkTable from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as dkTable\n\ninterface Props {\n row: TableRow\n field: TableColumn\n column: TableColumnCtx<TableRow>\n index: number\n}\nconst props = defineProps<Props>()\n\nconst fieldName: any = ref(props.field.prop)\nconst fieldValue = ref(props.row[fieldName.value] ?? '')\n\nif (fieldName.value && fieldName.value.indexOf('.') > -1) {\n const fieldNameArr = fieldName.value.split('.')\n const val: any = ref(props.row[fieldNameArr[0]])\n for (let index = 1; index < fieldNameArr.length; index++) {\n val.value = val.value ? val.value[fieldNameArr[index]] ?? '' : ''\n }\n fieldValue.value = val.value\n}\n\nconst getTagType = (value: string, custom: any): TagProps['type'] => {\n return custom && custom[value] ? custom[value] : 'primary'\n}\n\nconst onChangeField = (value: any) => {\n DkTable.onTableAction('field-change', {\n ...props,\n value,\n })\n}\n\nconst onButtonClick = (btn: OptButton) => {\n if (typeof btn.click === 'function') {\n btn.click(props.row, props.field)\n return\n }\n DkTable.onTableAction(btn.name, props)\n}\n</script>\n<style scoped></style>\n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CAAC,KAAe,KAAA;AACpC,MAAA,OAAA,CAAQ,cAAc,cAAgB,EAAA;AAAA,QACpC,GAAG,KAAA;AAAA,QACH,KAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAM,MAAA,aAAA,GAAgB,CAAC,GAAmB,KAAA;AACxC,MAAI,IAAA,OAAO,GAAI,CAAA,KAAA,KAAU,UAAY,EAAA;AACnC,QAAA,GAAA,CAAI,KAAM,CAAA,KAAA,CAAM,GAAK,EAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAChC,QAAA,OAAA;AAAA,OACF;AACA,MAAQ,OAAA,CAAA,aAAA,CAAc,GAAI,CAAA,IAAA,EAAM,KAAK,CAAA,CAAA;AAAA,KACvC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -75,9 +75,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
75
75
  const destroySelect = () => {
76
76
  destroy(getSelectionIds());
77
77
  };
78
- const enableBatchOpt = vue.computed(
79
- () => DkTable.recycleTable.selection.length > 0
80
- );
78
+ const enableBatchOpt = vue.computed(() => DkTable.recycleTable.selection.length > 0);
81
79
  return (_ctx, _cache) => {
82
80
  const _component_dk_icon = vue.resolveComponent("dk-icon");
83
81
  const _component_el_button = vue.resolveComponent("el-button");
@@ -1 +1 @@
1
- {"version":3,"file":"RecycleDialog.vue2.js","sources":["../../../../src/table/src/components/RecycleDialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'RecycleDialog',\n});\n</script>\n<template>\n <dk-dialog\n v-model=\"DkTable.recycleTable.showDialog\"\n title=\"回收站\"\n width=\"1000px\"\n class=\"dk-table\"\n >\n <div class=\"dk-table-header\">\n <el-button\n class=\"table-header-operate\"\n type=\"info\"\n @click=\"DkTable.onTableHeaderAction('refreshRecycle')\"\n >\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n <el-button\n class=\"table-header-operate\"\n type=\"primary\"\n :disabled=\"!enableBatchOpt\"\n @click=\"restoreSelect()\"\n >\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原</span>\n </el-button>\n <el-button\n class=\"table-header-operate\"\n type=\"danger\"\n :disabled=\"!enableBatchOpt\"\n @click=\"destroySelect()\"\n >\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">销毁</span>\n </el-button>\n <el-popconfirm\n confirm-button-text=\"还原\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要还原全部?\"\n @confirm=\"restore(null)\"\n >\n <template #reference>\n <div class=\"m-l-6px\">\n <el-button class=\"table-header-operate\" type=\"success\">\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <el-popconfirm\n confirm-button-text=\"清空\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要清空全部?\"\n @confirm=\"destroy(null)\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-button class=\"table-header-operate\" type=\"danger\">\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">清空全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <div class=\"table-search\">\n <el-input\n v-model=\"DkTable.recycleTable.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n </div>\n <!--表格s-->\n <el-table\n v-loading=\"DkTable.recycleTable.loading\"\n :data=\"DkTable.recycleTable.data\"\n class=\"dk-data-table\"\n @selection-change=\"onSelectionChange\"\n >\n <el-table-column\n v-for=\"(item, key) in DkTable.recycleTable.column\"\n v-bind=\"{ ...item }\"\n :key=\"key\"\n ></el-table-column>\n <!-- </template>-->\n <el-table-column label=\"操作\" align=\"right\">\n <template #default=\"{ row }\">\n <el-button\n icon=\"RefreshLeft\"\n type=\"primary\"\n size=\"small\"\n @click=\"restore([row.id])\"\n >\n 还原\n </el-button>\n <el-button\n icon=\"CloseBold\"\n type=\"danger\"\n size=\"small\"\n @click=\"destroy([row.id])\"\n >\n 销毁\n </el-button>\n </template>\n </el-table-column>\n </el-table>\n <!--表格e-->\n </dk-dialog>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport { debounce } from '@vipl520/utils'\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-recycle-search', {\n keyword: DkTable.recycleTable.filter!.quickSearch,\n })\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-recycle-change', selection)\n}\n\n/**\n * 销毁\n */\nconst destroy = (ids: any) => {\n DkTable.api.destroy(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\n/**\n * 还原\n */\nconst restore = (ids: any) => {\n DkTable.api.restore(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\nconst getSelectionIds = () => {\n const ids: string[] = []\n DkTable.recycleTable.selection?.forEach((item) => {\n ids.push(item[DkTable.recycleTable.pk!])\n })\n return ids\n}\n\nconst restoreSelect = () => {\n restore(getSelectionIds())\n}\n\nconst destroySelect = () => {\n destroy(getSelectionIds())\n}\n\nconst enableBatchOpt = computed(\n () => DkTable.recycleTable.selection!.length > 0\n)\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent","inject","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;AAuHD,IAAM,MAAA,OAAA,GAAUC,WAAO,SAAS,CAAA,CAAA;AAEhC,IAAA,MAAM,gBAAgB,MAAM;AAC1B,MAAA,OAAA,CAAQ,oBAAoB,sBAAwB,EAAA;AAAA,QAClD,OAAA,EAAS,OAAQ,CAAA,YAAA,CAAa,MAAQ,CAAA,WAAA;AAAA,OACvC,CAAA,CAAA;AAAA,KACH,CAAA;AAKA,IAAM,MAAA,iBAAA,GAAoB,CAAC,SAA0B,KAAA;AACnD,MAAQ,OAAA,CAAA,aAAA,CAAc,4BAA4B,SAAS,CAAA,CAAA;AAAA,KAC7D,CAAA;AAKA,IAAM,MAAA,OAAA,GAAU,CAAC,GAAa,KAAA;AAC5B,MAAA,OAAA,CAAQ,IAAI,OAAQ,CAAA,GAAG,CAAE,CAAA,IAAA,CAAK,CAAC,GAAQ,KAAA;AACrC,QAAA,OAAA,CAAQ,oBAAoB,gBAAgB,CAAA,CAAA;AAAA,OAC7C,CAAA,CAAA;AAAA,KACH,CAAA;AAKA,IAAM,MAAA,OAAA,GAAU,CAAC,GAAa,KAAA;AAC5B,MAAA,OAAA,CAAQ,IAAI,OAAQ,CAAA,GAAG,CAAE,CAAA,IAAA,CAAK,CAAC,GAAQ,KAAA;AACrC,QAAA,OAAA,CAAQ,oBAAoB,gBAAgB,CAAA,CAAA;AAAA,OAC7C,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAA,MAAM,kBAAkB,MAAM;AAC5B,MAAA,MAAM,MAAgB,EAAC,CAAA;AACvB,MAAA,OAAA,CAAQ,YAAa,CAAA,SAAA,EAAW,OAAQ,CAAA,CAAC,IAAS,KAAA;AAChD,QAAA,GAAA,CAAI,IAAK,CAAA,IAAA,CAAK,OAAQ,CAAA,YAAA,CAAa,EAAG,CAAC,CAAA,CAAA;AAAA,OACxC,CAAA,CAAA;AACD,MAAO,OAAA,GAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAA,MAAM,gBAAgB,MAAM;AAC1B,MAAA,OAAA,CAAQ,iBAAiB,CAAA,CAAA;AAAA,KAC3B,CAAA;AAEA,IAAA,MAAM,gBAAgB,MAAM;AAC1B,MAAA,OAAA,CAAQ,iBAAiB,CAAA,CAAA;AAAA,KAC3B,CAAA;AAEA,IAAA,MAAM,cAAiB,GAAAC,YAAA;AAAA,MACrB,MAAM,OAAA,CAAQ,YAAa,CAAA,SAAA,CAAW,MAAS,GAAA,CAAA;AAAA,KACjD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RecycleDialog.vue2.js","sources":["../../../../src/table/src/components/RecycleDialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'RecycleDialog',\n});\n</script>\n<template>\n <dk-dialog v-model=\"DkTable.recycleTable.showDialog\" title=\"回收站\" width=\"1000px\" class=\"dk-table\">\n <div class=\"dk-table-header\">\n <el-button class=\"table-header-operate\" type=\"info\" @click=\"DkTable.onTableHeaderAction('refreshRecycle')\">\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n <el-button class=\"table-header-operate\" type=\"primary\" :disabled=\"!enableBatchOpt\" @click=\"restoreSelect()\">\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原</span>\n </el-button>\n <el-button class=\"table-header-operate\" type=\"danger\" :disabled=\"!enableBatchOpt\" @click=\"destroySelect()\">\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">销毁</span>\n </el-button>\n <el-popconfirm\n confirm-button-text=\"还原\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要还原全部?\"\n @confirm=\"restore(null)\"\n >\n <template #reference>\n <div class=\"m-l-6px\">\n <el-button class=\"table-header-operate\" type=\"success\">\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <el-popconfirm\n confirm-button-text=\"清空\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要清空全部?\"\n @confirm=\"destroy(null)\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-button class=\"table-header-operate\" type=\"danger\">\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">清空全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <div class=\"table-search\">\n <el-input\n v-model=\"DkTable.recycleTable.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n </div>\n <!--表格s-->\n <el-table\n v-loading=\"DkTable.recycleTable.loading\"\n :data=\"DkTable.recycleTable.data\"\n class=\"dk-data-table\"\n @selection-change=\"onSelectionChange\"\n >\n <el-table-column\n v-for=\"(item, key) in DkTable.recycleTable.column\"\n v-bind=\"{ ...item }\"\n :key=\"key\"\n ></el-table-column>\n <!-- </template>-->\n <el-table-column label=\"操作\" align=\"right\">\n <template #default=\"{ row }\">\n <el-button icon=\"RefreshLeft\" type=\"primary\" size=\"small\" @click=\"restore([row.id])\"> 还原 </el-button>\n <el-button icon=\"CloseBold\" type=\"danger\" size=\"small\" @click=\"destroy([row.id])\"> 销毁 </el-button>\n </template>\n </el-table-column>\n </el-table>\n <!--表格e-->\n </dk-dialog>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport { debounce } from '@vipl520/utils'\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-recycle-search', {\n keyword: DkTable.recycleTable.filter!.quickSearch,\n })\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-recycle-change', selection)\n}\n\n/**\n * 销毁\n */\nconst destroy = (ids: any) => {\n DkTable.api.destroy(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\n/**\n * 还原\n */\nconst restore = (ids: any) => {\n DkTable.api.restore(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\nconst getSelectionIds = () => {\n const ids: string[] = []\n DkTable.recycleTable.selection?.forEach((item) => {\n ids.push(item[DkTable.recycleTable.pk!])\n })\n return ids\n}\n\nconst restoreSelect = () => {\n restore(getSelectionIds())\n}\n\nconst destroySelect = () => {\n destroy(getSelectionIds())\n}\n\nconst enableBatchOpt = computed(() => DkTable.recycleTable.selection!.length > 0)\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent","inject","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;AAsFD,IAAM,MAAA,OAAA,GAAUC,WAAO,SAAS,CAAA,CAAA;AAEhC,IAAA,MAAM,gBAAgB,M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B,MAAA,OAAA,CAAQ,iBAAiB,CAAA,CAAA;AAAA,KAC3B,CAAA;AAEA,IAAA,MAAM,iBAAiBC,YAAS,CAAA,MAAM,QAAQ,YAAa,CAAA,SAAA,CAAW,SAAS,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -59,16 +59,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
59
59
  },
60
60
  buttons: {
61
61
  default: () => {
62
- return [
63
- "refresh",
64
- "add",
65
- "export_csv",
66
- "edit",
67
- "delete",
68
- "comSearch",
69
- "quickSearch",
70
- "columnDisplay"
71
- ];
62
+ return ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"];
72
63
  },
73
64
  type: Array
74
65
  },
@@ -84,9 +75,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
84
75
  const columnDisplayArr = [];
85
76
  let cachedTableData = {};
86
77
  if (DkTable.url) {
87
- cachedTableData = JSON.parse(
88
- utils.storage.get(DkTable.url + "show_column") || "{}"
89
- );
78
+ cachedTableData = JSON.parse(utils.storage.get(DkTable.url + "show_column") || "{}");
90
79
  }
91
80
  for (const item of DkTable.table.column) {
92
81
  if (cachedTableData[item.prop] !== void 0) {
@@ -148,10 +137,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
148
137
  1536
149
138
  /* NEED_PATCH, DYNAMIC_SLOTS */
150
139
  ), [
151
- [
152
- vue.vShow,
153
- props.buttons.includes("comSearch") && vue.unref(DkTable).table.showComSearch
154
- ]
140
+ [vue.vShow, props.buttons.includes("comSearch") && vue.unref(DkTable).table.showComSearch]
155
141
  ])
156
142
  ]),
157
143
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"header.vue2.js","sources":["../../../../src/table/src/components/header.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableHeader',\n});\n</script>\n<template>\n <el-collapse-transition>\n <ComSearch\n v-show=\"\n props.buttons.includes('comSearch') && DkTable.table.showComSearch\n \"\n >\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </ComSearch>\n </el-collapse-transition>\n <div class=\"dk-table-header\">\n <slot name=\"refreshPrepend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('refresh')\"\n content=\"刷新\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n type=\"info\"\n @click=\"onAction('refresh', { loading: true })\"\n >\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n </el-tooltip>\n <slot name=\"refreshAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('add') && DkTable.auth('add')\"\n content=\"新增\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('add')\"\n >\n <dk-icon icon=\"typcn:plus\"></dk-icon>\n <span class=\"m-l-5px\">新增</span>\n </el-button>\n </el-tooltip>\n <slot name=\"AddButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('export_csv') && DkTable.auth('export_csv')\"\n content=\"导出选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('export_csv')\"\n >\n <dk-icon icon=\"typcn:download\"></dk-icon>\n <span class=\"m-l-5px\">导出</span>\n </el-button>\n </el-tooltip>\n <slot name=\"ExportButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('edit') && DkTable.auth('edit')\"\n content=\"编辑选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('edit')\"\n >\n <dk-icon icon=\"typcn:edit\"></dk-icon>\n <span class=\"m-l-5px\">编辑</span>\n </el-button>\n </el-tooltip>\n <slot name=\"EditButtonAppend\"></slot>\n <el-popconfirm\n v-if=\"props.buttons.includes('delete') && DkTable.auth('del')\"\n confirm-button-text=\"删除\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要删除所选记录吗?\"\n :disabled=\"!enableBatchOpt\"\n @confirm=\"onAction('delete')\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-tooltip content=\"删除所选行\" placement=\"top\">\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"danger\"\n >\n <!-- <Icon name=\"fa fa-trash\" />-->\n <dk-icon icon=\"typcn:trash\"></dk-icon>\n <span class=\"m-l-5px\">删除</span>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n <slot name=\"DeleteButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('unfold')\"\n :content=\"(DkTable.table.expandAll ? '收缩' : '展开') + '所有子菜单'\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n :type=\"DkTable.table.expandAll ? 'danger' : 'warning'\"\n @click=\"\n DkTable.onTableHeaderAction('unfold', {\n unfold: !DkTable.table.expandAll,\n })\n \"\n >\n <span class=\"table-header-operate-text\">\n {{ DkTable.table.expandAll ? '收缩所有' : '展开所有' }}\n </span>\n </el-button>\n </el-tooltip>\n <slot name=\"UnfoldButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('recycle') && DkTable.auth('recycle')\"\n content=\"打开回收站\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate m-l-5px\"\n type=\"warning\"\n :loading=\"DkTable.recycleTable.showDialogLoading\"\n @click=\"onAction('recycle')\"\n >\n <span class=\"table-header-operate-text\"> 回收站 </span>\n </el-button>\n </el-tooltip>\n <slot name=\"RecycleButtonAppend\"></slot>\n <div class=\"table-search\">\n <div class=\"mr-1\">\n <el-input\n v-model=\"DkTable.table.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n :size=\"size\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n <div class=\"table-search-button-group\">\n <el-dropdown\n v-if=\"props.buttons.includes('columnDisplay')\"\n :max-height=\"380\"\n :hide-on-click=\"false\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n :class=\"props.buttons.includes('comSearch') ? 'right-border' : ''\"\n >\n <dk-icon icon=\"Grid\"></dk-icon>\n </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item v-for=\"(item, idx) in columnDisplay\" :key=\"idx\">\n <el-checkbox\n v-if=\"item.prop\"\n :checked=\"!item.show\"\n :model-value=\"item.show\"\n :size=\"size\"\n :label=\"item.label\"\n @change=\"onChangeShowColumn($event, item.prop!)\"\n />\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <div>\n <el-tooltip\n v-if=\"props.buttons.includes('comSearch')\"\n :disabled=\"DkTable.table.showComSearch\"\n content=\"展开常规搜索\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n @click=\"\n DkTable.table.showComSearch = !DkTable.table.showComSearch\n \"\n >\n <dk-icon icon=\"Search\"></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, computed } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport ComSearch from './ComSearch.vue'\nimport { debounce, storage } from '@vipl520/utils'\n\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst props = defineProps({\n size: {\n default: 'small',\n type: String,\n },\n buttons: {\n default: () => {\n return [\n 'refresh',\n 'add',\n 'export_csv',\n 'edit',\n 'delete',\n 'comSearch',\n 'quickSearch',\n 'columnDisplay',\n ]\n },\n type: Array,\n },\n quickSearchPlaceholder: {\n default: '快捷搜索',\n type: String,\n },\n})\n\nconst columnDisplay = computed(() => {\n const columnDisplayArr = []\n let cachedTableData: any = {}\n if (DkTable.url) {\n cachedTableData = JSON.parse(\n storage.get(DkTable.url + 'show_column') || '{}'\n )\n }\n for (const item of DkTable.table.column) {\n if (cachedTableData[item.prop] !== undefined) {\n item.show = cachedTableData[item.prop]\n }\n // eslint-disable-next-line no-unused-expressions\n item.type === 'selection' ||\n item.render === 'buttons' ||\n item.enableColumnDisplayControl === false\n ? ''\n : columnDisplayArr.push(item)\n }\n return columnDisplayArr\n})\n\nconst enableBatchOpt = computed(() => DkTable.table.selection!.length > 0)\n\nconst onAction = (event: string, data: anyObj = {}) => {\n DkTable.onTableHeaderAction(event, data)\n}\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-search', {\n keyword: DkTable.table.filter!.quickSearch,\n })\n}\n\nconst onChangeShowColumn = (\n value: string | number | boolean,\n field: string\n) => {\n DkTable.onTableHeaderAction('change-show-column', {\n field,\n value,\n })\n}\n</script>\n"],"names":["__MACROS_defineComponent","inject","computed","storage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuND,IAAM,MAAA,OAAA,GAAUC,WAAO,SAAS,CAAA,CAAA;AA4BhC,IAAM,MAAA,aAAA,GAAgBC,aAAS,MAAM;AACnC,MAAA,MAAM,mBAAmB,EAAC,CAAA;AAC1B,MAAA,IAAI,kBAAuB,EAAC,CAAA;AAC5B,MAAA,IAAI,QAAQ,GAAK,EAAA;AACf,QAAA,eA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D,CAAA,CAAA;AAAA,KACH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"header.vue2.js","sources":["../../../../src/table/src/components/header.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableHeader',\n});\n</script>\n<template>\n <el-collapse-transition>\n <ComSearch v-show=\"props.buttons.includes('comSearch') && DkTable.table.showComSearch\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </ComSearch>\n </el-collapse-transition>\n <div class=\"dk-table-header\">\n <slot name=\"refreshPrepend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('refresh')\" content=\"刷新\" placement=\"top\">\n <el-button v-blur class=\"table-header-operate\" type=\"info\" @click=\"onAction('refresh', { loading: true })\">\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n </el-tooltip>\n <slot name=\"refreshAppend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('add') && DkTable.auth('add')\" content=\"新增\" placement=\"top\">\n <el-button v-blur class=\"table-header-operate\" type=\"primary\" @click=\"onAction('add')\">\n <dk-icon icon=\"typcn:plus\"></dk-icon>\n <span class=\"m-l-5px\">新增</span>\n </el-button>\n </el-tooltip>\n <slot name=\"AddButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('export_csv') && DkTable.auth('export_csv')\"\n content=\"导出选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('export_csv')\"\n >\n <dk-icon icon=\"typcn:download\"></dk-icon>\n <span class=\"m-l-5px\">导出</span>\n </el-button>\n </el-tooltip>\n <slot name=\"ExportButtonAppend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('edit') && DkTable.auth('edit')\" content=\"编辑选中行\" placement=\"top\">\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('edit')\"\n >\n <dk-icon icon=\"typcn:edit\"></dk-icon>\n <span class=\"m-l-5px\">编辑</span>\n </el-button>\n </el-tooltip>\n <slot name=\"EditButtonAppend\"></slot>\n <el-popconfirm\n v-if=\"props.buttons.includes('delete') && DkTable.auth('del')\"\n confirm-button-text=\"删除\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要删除所选记录吗?\"\n :disabled=\"!enableBatchOpt\"\n @confirm=\"onAction('delete')\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-tooltip content=\"删除所选行\" placement=\"top\">\n <el-button v-blur :disabled=\"!enableBatchOpt\" class=\"table-header-operate\" type=\"danger\">\n <!-- <Icon name=\"fa fa-trash\" />-->\n <dk-icon icon=\"typcn:trash\"></dk-icon>\n <span class=\"m-l-5px\">删除</span>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n <slot name=\"DeleteButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('unfold')\"\n :content=\"(DkTable.table.expandAll ? '收缩' : '展开') + '所有子菜单'\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n :type=\"DkTable.table.expandAll ? 'danger' : 'warning'\"\n @click=\"\n DkTable.onTableHeaderAction('unfold', {\n unfold: !DkTable.table.expandAll,\n })\n \"\n >\n <span class=\"table-header-operate-text\">\n {{ DkTable.table.expandAll ? '收缩所有' : '展开所有' }}\n </span>\n </el-button>\n </el-tooltip>\n <slot name=\"UnfoldButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('recycle') && DkTable.auth('recycle')\"\n content=\"打开回收站\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate m-l-5px\"\n type=\"warning\"\n :loading=\"DkTable.recycleTable.showDialogLoading\"\n @click=\"onAction('recycle')\"\n >\n <span class=\"table-header-operate-text\"> 回收站 </span>\n </el-button>\n </el-tooltip>\n <slot name=\"RecycleButtonAppend\"></slot>\n <div class=\"table-search\">\n <div class=\"mr-1\">\n <el-input\n v-model=\"DkTable.table.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n :size=\"size\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n <div class=\"table-search-button-group\">\n <el-dropdown v-if=\"props.buttons.includes('columnDisplay')\" :max-height=\"380\" :hide-on-click=\"false\">\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n :class=\"props.buttons.includes('comSearch') ? 'right-border' : ''\"\n >\n <dk-icon icon=\"Grid\"></dk-icon>\n </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item v-for=\"(item, idx) in columnDisplay\" :key=\"idx\">\n <el-checkbox\n v-if=\"item.prop\"\n :checked=\"!item.show\"\n :model-value=\"item.show\"\n :size=\"size\"\n :label=\"item.label\"\n @change=\"onChangeShowColumn($event, item.prop!)\"\n />\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <div>\n <el-tooltip\n v-if=\"props.buttons.includes('comSearch')\"\n :disabled=\"DkTable.table.showComSearch\"\n content=\"展开常规搜索\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n @click=\"DkTable.table.showComSearch = !DkTable.table.showComSearch\"\n >\n <dk-icon icon=\"Search\"></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, computed } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport ComSearch from './ComSearch.vue'\nimport { debounce, storage } from '@vipl520/utils'\n\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst props = defineProps({\n size: {\n default: 'small',\n type: String,\n },\n buttons: {\n default: () => {\n return ['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay']\n },\n type: Array,\n },\n quickSearchPlaceholder: {\n default: '快捷搜索',\n type: String,\n },\n})\n\nconst columnDisplay = computed(() => {\n const columnDisplayArr = []\n let cachedTableData: any = {}\n if (DkTable.url) {\n cachedTableData = JSON.parse(storage.get(DkTable.url + 'show_column') || '{}')\n }\n for (const item of DkTable.table.column) {\n if (cachedTableData[item.prop] !== undefined) {\n item.show = cachedTableData[item.prop]\n }\n // eslint-disable-next-line no-unused-expressions\n item.type === 'selection' || item.render === 'buttons' || item.enableColumnDisplayControl === false\n ? ''\n : columnDisplayArr.push(item)\n }\n return columnDisplayArr\n})\n\nconst enableBatchOpt = computed(() => DkTable.table.selection!.length > 0)\n\nconst onAction = (event: string, data: anyObj = {}) => {\n DkTable.onTableHeaderAction(event, data)\n}\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-search', {\n keyword: DkTable.table.filter!.quickSearch,\n })\n}\n\nconst onChangeShowColumn = (value: string | number | boolean, field: string) => {\n DkTable.onTableHeaderAction('change-show-column', {\n field,\n value,\n })\n}\n</script>\n"],"names":["__MACROS_defineComponent","inject","computed","storage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eA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A,QAC1C,OAAA,EAAS,OAAQ,CAAA,KAAA,CAAM,MAAQ,CAAA,WAAA;AAAA,OAChC,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAM,MAAA,kBAAA,GAAqB,CAAC,KAAA,EAAkC,KAAkB,KAAA;AAC9E,MAAA,OAAA,CAAQ,oBAAoB,oBAAsB,EAAA;AAAA,QAChD,KAAA;AAAA,QACA,KAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -23,17 +23,7 @@ const tableProps = {
23
23
  },
24
24
  buttons: {
25
25
  default: () => {
26
- return [
27
- "refresh",
28
- "add",
29
- "export_csv",
30
- "edit",
31
- "delete",
32
- "comSearch",
33
- "quickSearch",
34
- "columnDisplay",
35
- "recycle"
36
- ];
26
+ return ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay", "recycle"];
37
27
  },
38
28
  type: Array
39
29
  },
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return [\n 'refresh',\n 'add',\n 'export_csv',\n 'edit',\n 'delete',\n 'comSearch',\n 'quickSearch',\n 'columnDisplay',\n 'recycle',\n ]\n },\n type: Array,\n },\n hideButtons: {\n default: () => {\n return []\n },\n type: Array,\n },\n}\n\nexport type TableProps = ExtractPropTypes<typeof tableProps>\n"],"names":[],"mappings":";;AAGO,MAAM,UAAa,GAAA;AAAA,EACxB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,OAAS,EAAA;AAAA,IACP,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,SAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAA;AAAA,QACA,MAAA;AAAA,QACA,QAAA;AAAA,QACA,WAAA;AAAA,QACA,aAAA;AAAA,QACA,eAAA;AAAA,QACA,SAAA;AAAA,OACF,CAAA;AAAA,KACF;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AACF;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return ['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay', 'recycle']\n },\n type: Array,\n },\n hideButtons: {\n default: () => {\n return []\n },\n type: Array,\n },\n}\n\nexport type TableProps = ExtractPropTypes<typeof tableProps>\n"],"names":[],"mappings":";;AAGO,MAAM,UAAa,GAAA;AAAA,EACxB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,OAAS,EAAA;AAAA,IACP,SAAS,MAAM;AACb,MAAO,OAAA,CAAC,WAAW,KAAO,EAAA,YAAA,EAAc,QAAQ,QAAU,EAAA,WAAA,EAAa,aAAe,EAAA,eAAA,EAAiB,SAAS,CAAA,CAAA;AAAA,KAClH;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AACF;;;;"}