@dt-frames/ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/README.md +15 -0
  2. package/es/assets/app-antd-dark-theme-style.e3b0c442.css +0 -0
  3. package/es/assets/app-theme-style.e3b0c442.css +0 -0
  4. package/es/assets/data/icon.d.ts +4 -0
  5. package/es/assets/data/icon.ts +69 -0
  6. package/es/assets/data/icon11.ts +69 -0
  7. package/es/assets/data/icons/actions.d.ts +1 -0
  8. package/es/assets/data/icons/actions.ts +427 -0
  9. package/es/assets/data/icons/code.d.ts +1 -0
  10. package/es/assets/data/icons/code.ts +10 -0
  11. package/es/assets/data/icons/commuticate.d.ts +1 -0
  12. package/es/assets/data/icons/commuticate.ts +190 -0
  13. package/es/assets/data/icons/currency.d.ts +1 -0
  14. package/es/assets/data/icons/currency.ts +46 -0
  15. package/es/assets/data/icons/devices.d.ts +1 -0
  16. package/es/assets/data/icons/devices.ts +128 -0
  17. package/es/assets/data/icons/edit.d.ts +1 -0
  18. package/es/assets/data/icons/edit.ts +165 -0
  19. package/es/assets/data/icons/file.d.ts +1 -0
  20. package/es/assets/data/icons/file.ts +104 -0
  21. package/es/assets/data/icons/math.d.ts +1 -0
  22. package/es/assets/data/icons/math.ts +53 -0
  23. package/es/assets/data/icons/message.d.ts +1 -0
  24. package/es/assets/data/icons/message.ts +75 -0
  25. package/es/assets/data/icons/navigate.d.ts +1 -0
  26. package/es/assets/data/icons/navigate.ts +181 -0
  27. package/es/assets/data/icons/other.d.ts +1 -0
  28. package/es/assets/data/icons/other.ts +333 -0
  29. package/es/assets/data/icons.d.ts +4 -0
  30. package/es/assets/data/icons.ts +58 -0
  31. package/es/assets/imgs/logo/logo.png +0 -0
  32. package/es/assets/locales/en_US.json +3 -0
  33. package/es/assets/locales/zh_CN.json +3 -0
  34. package/es/assets/style/index.less +10 -0
  35. package/es/assets/style/reset.less +20 -0
  36. package/es/assets/style/var.less +42 -0
  37. package/es/components/container/index.d.ts +3 -0
  38. package/es/components/container/src/bar.d.ts +14 -0
  39. package/es/components/container/src/scroll-bar.d.ts +93 -0
  40. package/es/components/container/src/scroll-container.d.ts +99 -0
  41. package/es/components/curd/index.d.ts +2 -0
  42. package/es/components/curd/src/components/dialog.d.ts +1494 -0
  43. package/es/components/curd/src/components/props.d.ts +33 -0
  44. package/es/components/curd/src/hooks/useCurd.d.ts +11 -0
  45. package/es/components/curd/src/types/curd.type.d.ts +19 -0
  46. package/es/components/excel/index.d.ts +2 -0
  47. package/es/components/excel/src/export2Excel.d.ts +3 -0
  48. package/es/components/forms/index.d.ts +5 -0
  49. package/es/components/forms/src/componentMap.d.ts +4 -0
  50. package/es/components/forms/src/components/formButton.d.ts +75 -0
  51. package/es/components/forms/src/components/formIcon.d.ts +2845 -0
  52. package/es/components/forms/src/components/formItem.d.ts +59 -0
  53. package/es/components/forms/src/components/radioButton.d.ts +33 -0
  54. package/es/components/forms/src/const/form.const.d.ts +7 -0
  55. package/es/components/forms/src/hooks/helper.d.ts +6 -0
  56. package/es/components/forms/src/hooks/useForm.d.ts +5 -0
  57. package/es/components/forms/src/hooks/useFormActions.d.ts +13 -0
  58. package/es/components/forms/src/hooks/useFormEvents.d.ts +26 -0
  59. package/es/components/forms/src/hooks/useFormValue.d.ts +3 -0
  60. package/es/components/forms/src/hooks/useFormValues.d.ts +14 -0
  61. package/es/components/forms/src/hooks/useLabelWidth.d.ts +35 -0
  62. package/es/components/forms/src/index.d.ts +186 -0
  63. package/es/components/forms/src/prop.d.ts +79 -0
  64. package/es/components/forms/src/types/form.type.d.ts +124 -0
  65. package/es/components/icons/index.d.ts +3 -0
  66. package/es/components/icons/pick-icon.d.ts +529 -0
  67. package/es/components/icons/src/pick-icon.d.ts +432 -0
  68. package/es/components/icons/src/svg-icon.d.ts +44 -0
  69. package/es/components/icons/svg-icon.d.ts +44 -0
  70. package/es/components/iframe/index.d.ts +2 -0
  71. package/es/components/iframe/src/index.d.ts +967 -0
  72. package/es/components/index.d.ts +14 -0
  73. package/es/components/modal/index.d.ts +3 -0
  74. package/es/components/modal/src/components/close-icon.d.ts +344 -0
  75. package/es/components/modal/src/components/modal-wrap.d.ts +236 -0
  76. package/es/components/modal/src/components/modal.d.ts +194 -0
  77. package/es/components/modal/src/components/modalFooter.d.ts +102 -0
  78. package/es/components/modal/src/hooks/useDrag.d.ts +7 -0
  79. package/es/components/modal/src/hooks/useFullScreen.d.ts +12 -0
  80. package/es/components/modal/src/hooks/useModal.d.ts +4 -0
  81. package/es/components/modal/src/index.d.ts +1187 -0
  82. package/es/components/modal/src/props.d.ts +89 -0
  83. package/es/components/modal/src/types/modal.type.d.ts +22 -0
  84. package/es/components/router/base-router.d.ts +2 -0
  85. package/es/components/router/index.d.ts +2 -0
  86. package/es/components/source/index.d.ts +1 -0
  87. package/es/components/source/src/hooks/useFetch.d.ts +5 -0
  88. package/es/components/source/src/hooks/useSource.d.ts +33 -0
  89. package/es/components/source/src/index.d.ts +2 -0
  90. package/es/components/source/src/types/source.type.d.ts +31 -0
  91. package/es/components/source/src/types/table.type.d.ts +7 -0
  92. package/es/components/table/index.d.ts +3 -0
  93. package/es/components/table/src/components/TableActions.d.ts +1279 -0
  94. package/es/components/table/src/components/TableHeader.d.ts +28 -0
  95. package/es/components/table/src/components/TableRender.d.ts +25 -0
  96. package/es/components/table/src/components/setting/Column.d.ts +1349 -0
  97. package/es/components/table/src/components/setting/Download.d.ts +1144 -0
  98. package/es/components/table/src/components/setting/Fullscreen.d.ts +270 -0
  99. package/es/components/table/src/components/setting/Size.d.ts +1145 -0
  100. package/es/components/table/src/components/setting/index.d.ts +26 -0
  101. package/es/components/table/src/const.d.ts +12 -0
  102. package/es/components/table/src/hooks/useColumns.d.ts +12 -0
  103. package/es/components/table/src/hooks/useDataSource.d.ts +16 -0
  104. package/es/components/table/src/hooks/useFormat.d.ts +2 -0
  105. package/es/components/table/src/hooks/useLoading.d.ts +6 -0
  106. package/es/components/table/src/hooks/usePagination.d.ts +122 -0
  107. package/es/components/table/src/hooks/useRowSelection.d.ts +13 -0
  108. package/es/components/table/src/hooks/useRows.d.ts +5 -0
  109. package/es/components/table/src/hooks/useTable.d.ts +5 -0
  110. package/es/components/table/src/hooks/useTableHeader.d.ts +8 -0
  111. package/es/components/table/src/hooks/useTableInstance.d.ts +13 -0
  112. package/es/components/table/src/hooks/useTableScroll.d.ts +12 -0
  113. package/es/components/table/src/hooks/useVirtualScroll.d.ts +5 -0
  114. package/es/components/table/src/index.d.ts +565 -0
  115. package/es/components/table/src/props.d.ts +192 -0
  116. package/es/components/table/src/types/table.type.d.ts +89 -0
  117. package/es/components/table/src/types/tableHeader.type.d.ts +23 -0
  118. package/es/components/table/src/utils/format.d.ts +1 -0
  119. package/es/directives/icon.d.ts +2 -0
  120. package/es/directives/index.d.ts +6 -0
  121. package/es/directives/permission.d.ts +2 -0
  122. package/es/global.d.ts +8 -0
  123. package/es/index.css +1 -0
  124. package/es/index.d.ts +3 -0
  125. package/es/index.js +8867 -0
  126. package/es/style/assets/style/index.less +10 -0
  127. package/es/style/assets/style/reset.less +20 -0
  128. package/es/style/assets/style/var.less +42 -0
  129. package/es/style/components/container/index.less +85 -0
  130. package/es/style/components/forms/src/index.less +82 -0
  131. package/es/style/components/icons/index.less +96 -0
  132. package/es/style/components/icons/src/index.less +96 -0
  133. package/es/style/components/iframe/src/index.less +3 -0
  134. package/es/style/components/modal/src/index.less +60 -0
  135. package/es/style/components/table/src/index.less +162 -0
  136. package/es/style/theme/footer/index.less +16 -0
  137. package/es/style/theme/header/index.less +438 -0
  138. package/es/style/theme/header/set-theme.less +68 -0
  139. package/es/style/theme/sider/index.less +203 -0
  140. package/es/style/theme/tabs/index.less +165 -0
  141. package/es/style/theme/theme.less +66 -0
  142. package/es/style/theme/transition.less +99 -0
  143. package/es/theme/content/index.d.ts +29 -0
  144. package/es/theme/feature/back-top.d.ts +105 -0
  145. package/es/theme/feature/index.d.ts +107 -0
  146. package/es/theme/footer/index.d.ts +30 -0
  147. package/es/theme/header/components/bread-crumb.d.ts +127 -0
  148. package/es/theme/header/components/fullscreen.d.ts +5 -0
  149. package/es/theme/header/components/handler.d.ts +2 -0
  150. package/es/theme/header/components/index.d.ts +10 -0
  151. package/es/theme/header/components/lang-picker.d.ts +290 -0
  152. package/es/theme/header/components/logo.d.ts +40 -0
  153. package/es/theme/header/components/menu-search.d.ts +528 -0
  154. package/es/theme/header/components/notify.d.ts +269 -0
  155. package/es/theme/header/components/setting-theme.d.ts +2550 -0
  156. package/es/theme/header/components/theme-drawer/enum.d.ts +5 -0
  157. package/es/theme/header/components/theme-drawer/feature.d.ts +1096 -0
  158. package/es/theme/header/components/theme-drawer/index.d.ts +3 -0
  159. package/es/theme/header/components/theme-drawer/menu-type.d.ts +273 -0
  160. package/es/theme/header/components/theme-drawer/select-item.d.ts +778 -0
  161. package/es/theme/header/components/theme-drawer/switch-item.d.ts +289 -0
  162. package/es/theme/header/components/trigger.d.ts +14 -0
  163. package/es/theme/header/components/user-info.d.ts +452 -0
  164. package/es/theme/header/const/index.d.ts +20 -0
  165. package/es/theme/header/helper/menu-tree.d.ts +3 -0
  166. package/es/theme/header/index.d.ts +4369 -0
  167. package/es/theme/header/multiple-header.d.ts +2001 -0
  168. package/es/theme/index.d.ts +2 -0
  169. package/es/theme/sider/components/basic-menu/basic-menu-item.d.ts +121 -0
  170. package/es/theme/sider/components/basic-menu/basic-menu.d.ts +752 -0
  171. package/es/theme/sider/components/basic-menu/basic-sub-menu-item.d.ts +250 -0
  172. package/es/theme/sider/components/basic-menu/menu-item-content.d.ts +34 -0
  173. package/es/theme/sider/components/drag-bar.d.ts +14 -0
  174. package/es/theme/sider/components/layout-menu.d.ts +22 -0
  175. package/es/theme/sider/components/props.d.ts +69 -0
  176. package/es/theme/sider/components/sider-trigger.d.ts +68 -0
  177. package/es/theme/sider/helper/sider.d.ts +12 -0
  178. package/es/theme/sider/helper/split-menu.d.ts +10 -0
  179. package/es/theme/sider/hooks/useDragLine.d.ts +2 -0
  180. package/es/theme/sider/hooks/useOpenKeys.d.ts +13 -0
  181. package/es/theme/sider/index.d.ts +152 -0
  182. package/es/theme/styles/hooks/changeTheme.d.ts +1 -0
  183. package/es/theme/styles/hooks/generate.d.ts +13 -0
  184. package/es/theme/styles/index.d.ts +2 -0
  185. package/es/theme/tabs/components/TabContent.d.ts +887 -0
  186. package/es/theme/tabs/components/TabRedo.d.ts +49 -0
  187. package/es/theme/tabs/hooks/useMultifyTabs.d.ts +7 -0
  188. package/es/theme/tabs/hooks/useTabDropdown.d.ts +6 -0
  189. package/es/theme/tabs/index.d.ts +1399 -0
  190. package/es/theme/tabs/types/tabs.type.d.ts +7 -0
  191. package/es/theme/theme/initTheme.d.ts +3 -0
  192. package/es/theme/theme/util.d.ts +5 -0
  193. package/es/theme/theme.d.ts +4911 -0
  194. package/es/themes/generate.ts +74 -0
  195. package/es/themes/index.ts +10 -0
  196. package/es/themes/modifyVars.ts +33 -0
  197. package/es/themes/themePlugiin.ts +74 -0
  198. package/package.json +49 -0
  199. package/src/assets/data/icons/actions.ts +427 -0
  200. package/src/assets/data/icons/code.ts +10 -0
  201. package/src/assets/data/icons/commuticate.ts +190 -0
  202. package/src/assets/data/icons/currency.ts +46 -0
  203. package/src/assets/data/icons/devices.ts +128 -0
  204. package/src/assets/data/icons/edit.ts +165 -0
  205. package/src/assets/data/icons/file.ts +104 -0
  206. package/src/assets/data/icons/math.ts +53 -0
  207. package/src/assets/data/icons/message.ts +75 -0
  208. package/src/assets/data/icons/navigate.ts +181 -0
  209. package/src/assets/data/icons/other.ts +333 -0
  210. package/src/assets/data/icons.ts +58 -0
  211. package/src/assets/imgs/logo/logo.png +0 -0
  212. package/src/assets/locales/en_US.json +3 -0
  213. package/src/assets/locales/zh_CN.json +3 -0
  214. package/src/assets/style/index.less +10 -0
  215. package/src/assets/style/reset.less +20 -0
  216. package/src/components/container/index.less +85 -0
  217. package/src/components/container/index.ts +8 -0
  218. package/src/components/container/src/bar.ts +107 -0
  219. package/src/components/container/src/lazy-container.vue +9 -0
  220. package/src/components/container/src/scroll-bar.vue +117 -0
  221. package/src/components/container/src/scroll-container.vue +61 -0
  222. package/src/components/curd/index.ts +5 -0
  223. package/src/components/curd/src/components/dialog.vue +65 -0
  224. package/src/components/curd/src/components/props.ts +32 -0
  225. package/src/components/curd/src/hooks/useCurd.tsx +72 -0
  226. package/src/components/curd/src/types/curd.type.ts +29 -0
  227. package/src/components/excel/index.ts +6 -0
  228. package/src/components/excel/src/export2Excel.ts +44 -0
  229. package/src/components/forms/index.ts +12 -0
  230. package/src/components/forms/src/componentMap.ts +44 -0
  231. package/src/components/forms/src/components/formButton.vue +150 -0
  232. package/src/components/forms/src/components/formIcon.vue +50 -0
  233. package/src/components/forms/src/components/formItem.vue +407 -0
  234. package/src/components/forms/src/components/radioButton.vue +58 -0
  235. package/src/components/forms/src/const/form.const.ts +7 -0
  236. package/src/components/forms/src/hooks/helper.ts +70 -0
  237. package/src/components/forms/src/hooks/useForm.ts +130 -0
  238. package/src/components/forms/src/hooks/useFormActions.ts +63 -0
  239. package/src/components/forms/src/hooks/useFormEvents.ts +247 -0
  240. package/src/components/forms/src/hooks/useFormValue.ts +49 -0
  241. package/src/components/forms/src/hooks/useFormValues.ts +131 -0
  242. package/src/components/forms/src/hooks/useLabelWidth.ts +57 -0
  243. package/src/components/forms/src/index.less +82 -0
  244. package/src/components/forms/src/index.vue +306 -0
  245. package/src/components/forms/src/prop.ts +80 -0
  246. package/src/components/forms/src/types/form.type.ts +269 -0
  247. package/src/components/icons/index.ts +7 -0
  248. package/src/components/icons/src/index.less +96 -0
  249. package/src/components/icons/src/pick-icon.vue +117 -0
  250. package/src/components/icons/src/svg-icon.vue +117 -0
  251. package/src/components/iframe/index.ts +5 -0
  252. package/src/components/iframe/src/index.less +3 -0
  253. package/src/components/iframe/src/index.vue +38 -0
  254. package/src/components/index.ts +46 -0
  255. package/src/components/modal/index.ts +8 -0
  256. package/src/components/modal/src/components/close-icon.vue +47 -0
  257. package/src/components/modal/src/components/modal-wrap.vue +118 -0
  258. package/src/components/modal/src/components/modal.tsx +30 -0
  259. package/src/components/modal/src/components/modalFooter.vue +38 -0
  260. package/src/components/modal/src/hooks/useDrag.ts +107 -0
  261. package/src/components/modal/src/hooks/useFullScreen.ts +27 -0
  262. package/src/components/modal/src/hooks/useModal.ts +177 -0
  263. package/src/components/modal/src/index.less +60 -0
  264. package/src/components/modal/src/index.vue +173 -0
  265. package/src/components/modal/src/props.ts +43 -0
  266. package/src/components/modal/src/types/modal.type.ts +27 -0
  267. package/src/components/router/base-router.vue +11 -0
  268. package/src/components/router/index.ts +3 -0
  269. package/src/components/source/index.ts +1 -0
  270. package/src/components/source/src/hooks/useFetch.ts +70 -0
  271. package/src/components/source/src/hooks/usePage.ts +3 -0
  272. package/src/components/source/src/hooks/useSource.ts +178 -0
  273. package/src/components/source/src/index.ts +5 -0
  274. package/src/components/source/src/types/source.type.ts +68 -0
  275. package/src/components/source/src/types/table.type.ts +8 -0
  276. package/src/components/table/index.ts +7 -0
  277. package/src/components/table/src/components/TableActions.vue +108 -0
  278. package/src/components/table/src/components/TableHeader.vue +77 -0
  279. package/src/components/table/src/components/TableRender.vue +76 -0
  280. package/src/components/table/src/components/setting/Column.vue +355 -0
  281. package/src/components/table/src/components/setting/Download.vue +55 -0
  282. package/src/components/table/src/components/setting/Fullscreen.vue +43 -0
  283. package/src/components/table/src/components/setting/Size.vue +42 -0
  284. package/src/components/table/src/components/setting/index.vue +64 -0
  285. package/src/components/table/src/const.ts +13 -0
  286. package/src/components/table/src/hooks/useColumns.ts +319 -0
  287. package/src/components/table/src/hooks/useCustomRow.ts +0 -0
  288. package/src/components/table/src/hooks/useDataSource.ts +99 -0
  289. package/src/components/table/src/hooks/useLoading.ts +29 -0
  290. package/src/components/table/src/hooks/usePagination.ts +76 -0
  291. package/src/components/table/src/hooks/useRowSelection.ts +146 -0
  292. package/src/components/table/src/hooks/useRows.ts +30 -0
  293. package/src/components/table/src/hooks/useTable.ts +77 -0
  294. package/src/components/table/src/hooks/useTableHeader.ts +48 -0
  295. package/src/components/table/src/hooks/useTableInstance.ts +29 -0
  296. package/src/components/table/src/hooks/useTableScroll.ts +227 -0
  297. package/src/components/table/src/index.less +162 -0
  298. package/src/components/table/src/index.vue +198 -0
  299. package/src/components/table/src/props.ts +152 -0
  300. package/src/components/table/src/types/table.type.ts +133 -0
  301. package/src/components/table/src/types/tableHeader.type.ts +27 -0
  302. package/src/components/type.ts +0 -0
  303. package/src/directives/icon.ts +36 -0
  304. package/src/directives/index.ts +26 -0
  305. package/src/directives/permission.ts +21 -0
  306. package/src/global.d.ts +8 -0
  307. package/src/index.ts +4 -0
  308. package/src/theme/content/index.vue +37 -0
  309. package/src/theme/feature/back-top.vue +11 -0
  310. package/src/theme/feature/index.vue +7 -0
  311. package/src/theme/footer/index.less +16 -0
  312. package/src/theme/footer/index.vue +24 -0
  313. package/src/theme/header/components/bread-crumb.vue +26 -0
  314. package/src/theme/header/components/fullscreen.vue +14 -0
  315. package/src/theme/header/components/handler.ts +81 -0
  316. package/src/theme/header/components/index.ts +21 -0
  317. package/src/theme/header/components/lang-picker.vue +36 -0
  318. package/src/theme/header/components/logo.vue +33 -0
  319. package/src/theme/header/components/menu-search.vue +62 -0
  320. package/src/theme/header/components/notify.vue +23 -0
  321. package/src/theme/header/components/setting-theme.vue +123 -0
  322. package/src/theme/header/components/theme-drawer/enum.ts +12 -0
  323. package/src/theme/header/components/theme-drawer/feature.vue +75 -0
  324. package/src/theme/header/components/theme-drawer/index.ts +7 -0
  325. package/src/theme/header/components/theme-drawer/menu-type.vue +40 -0
  326. package/src/theme/header/components/theme-drawer/select-item.vue +46 -0
  327. package/src/theme/header/components/theme-drawer/switch-item.vue +39 -0
  328. package/src/theme/header/components/theme-drawer/theme-color.vue +26 -0
  329. package/src/theme/header/components/trigger.vue +14 -0
  330. package/src/theme/header/components/user-info.vue +43 -0
  331. package/src/theme/header/const/index.ts +40 -0
  332. package/src/theme/header/helper/menu-tree.ts +67 -0
  333. package/src/theme/header/index.less +438 -0
  334. package/src/theme/header/index.ts +0 -0
  335. package/src/theme/header/index.vue +96 -0
  336. package/src/theme/header/multiple-header.vue +67 -0
  337. package/src/theme/header/set-theme.less +68 -0
  338. package/src/theme/index.ts +3 -0
  339. package/src/theme/sider/components/basic-menu/basic-menu-item.vue +14 -0
  340. package/src/theme/sider/components/basic-menu/basic-menu.vue +122 -0
  341. package/src/theme/sider/components/basic-menu/basic-sub-menu-item.vue +46 -0
  342. package/src/theme/sider/components/basic-menu/menu-item-content.vue +13 -0
  343. package/src/theme/sider/components/drag-bar.vue +26 -0
  344. package/src/theme/sider/components/layout-menu.vue +132 -0
  345. package/src/theme/sider/components/props.ts +97 -0
  346. package/src/theme/sider/components/sider-trigger.vue +24 -0
  347. package/src/theme/sider/helper/sider.ts +52 -0
  348. package/src/theme/sider/helper/split-menu.ts +147 -0
  349. package/src/theme/sider/hooks/useDragLine.ts +86 -0
  350. package/src/theme/sider/hooks/useOpenKeys.ts +57 -0
  351. package/src/theme/sider/index.less +203 -0
  352. package/src/theme/sider/index.vue +88 -0
  353. package/src/theme/tabs/components/TabContent.vue +37 -0
  354. package/src/theme/tabs/components/TabRedo.vue +18 -0
  355. package/src/theme/tabs/hooks/useMultifyTabs.ts +96 -0
  356. package/src/theme/tabs/hooks/useTabDropdown.ts +89 -0
  357. package/src/theme/tabs/index.less +165 -0
  358. package/src/theme/tabs/index.vue +98 -0
  359. package/src/theme/tabs/types/tabs.type.ts +8 -0
  360. package/src/theme/theme.less +66 -0
  361. package/src/theme/theme.vue +89 -0
  362. package/src/theme/transition.less +99 -0
  363. package/tsconfig.json +28 -0
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <Tooltip placement="top">
3
+ <template #title>
4
+ <span v-if="!isFullscreen">全屏</span>
5
+ </template>
6
+
7
+ <span @click="toggle">
8
+ <span v-if="!isFullscreen" v-icon="'ic:baseline-fullscreen'"></span>
9
+ <span v-else v-icon="'ic:baseline-fullscreen-exit'"></span>
10
+ </span>
11
+ </Tooltip>
12
+ </template>
13
+
14
+ <script lang="ts" setup>
15
+ import { ref, watch } from 'vue'
16
+ import { useFullscreen } from '@vueuse/core';
17
+ import { Tooltip } from 'ant-design-vue'
18
+ import { DtIcon } from '../../../../icons/index'
19
+ import { getTableInstance } from '../../hooks/useTableInstance';
20
+
21
+ const table = getTableInstance()
22
+ const wrapEl = ref(null)
23
+
24
+ const { toggle, isFullscreen } = useFullscreen(wrapEl)
25
+
26
+ watch(
27
+ () => table.tableElRef.value,
28
+ ( v: any ) => {
29
+ const getParent = ( el ) => {
30
+ if( !el || !el.parentNode ) return null
31
+
32
+ // 找到路由的下一层 进行全屏
33
+ if(el.parentNode.className.indexOf('dt-layout-content') !== -1) {
34
+ wrapEl.value = el.parentNode
35
+ } else {
36
+ getParent( el.parentNode )
37
+ }
38
+ }
39
+
40
+ getParent(v.$el)
41
+ }
42
+ )
43
+ </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <Tooltip>
3
+ <template #title>密度</template>
4
+
5
+ <Dropdown
6
+ placement="bottom"
7
+ :trigger="['click']"
8
+ :getPopupContainer="getPopupContainer"
9
+ >
10
+ <span v-icon="'ant-design:column-height-outlined'"></span>
11
+
12
+ <template #overlay>
13
+ <Menu
14
+ @click="handleTitleClick"
15
+ selectable
16
+ v-model:selectedKeys="selectedKeysRef"
17
+ >
18
+ <MenuItem key="default"> <span>默认</span> </MenuItem>
19
+ <MenuItem key="middle"> <span>中等</span> </MenuItem>
20
+ <MenuItem key="small"> <span>紧凑</span> </MenuItem>
21
+ </Menu>
22
+ </template>
23
+ </Dropdown>
24
+ </Tooltip>
25
+ </template>
26
+
27
+ <script lang="ts" setup>
28
+ import { getPopupContainer } from '@dt-frames/core';
29
+ import { Tooltip, Dropdown, Menu, MenuItem } from 'ant-design-vue'
30
+ import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
31
+ import { ref } from 'vue'
32
+ import { getTableInstance } from '../../hooks/useTableInstance';
33
+ import { SizeType } from '../../types/table.type';
34
+
35
+ const table = getTableInstance()
36
+ const selectedKeysRef = ref<SizeType[]>([table.getSize()])
37
+
38
+ function handleTitleClick({ key }: MenuInfo) {
39
+ selectedKeysRef.value = [key as SizeType]
40
+ table.setProps({ size: key as SizeType })
41
+ }
42
+ </script>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <Download></Download>
3
+ <SizeSetting v-if="getSetting.size" />
4
+ <ColumnSetting
5
+ v-if="getSetting.setting"
6
+ @columns-change="handleColumnChange"
7
+ />
8
+
9
+ <FullscreenSetting v-if="getSetting.fullscreen"></FullscreenSetting>
10
+
11
+ </template>
12
+
13
+ <script lang="ts">
14
+ import { computed, defineComponent, unref } from "vue"
15
+ import type { PropType } from 'vue'
16
+ import { TableSetting } from "../../types/table.type"
17
+ import ColumnSetting from './Column.vue'
18
+ import FullscreenSetting from './Fullscreen.vue'
19
+ import SizeSetting from './Size.vue'
20
+ import Download from './Download.vue'
21
+
22
+ type ColumnChangeParam = {
23
+ dataIndex: string;
24
+ fixed: boolean | 'left' | 'right' | undefined;
25
+ visible: boolean;
26
+ }
27
+
28
+ export default defineComponent({
29
+ name: 'table-setting',
30
+ components: {
31
+ ColumnSetting,
32
+ FullscreenSetting,
33
+ SizeSetting,
34
+ Download
35
+ },
36
+ props: {
37
+ setting: {
38
+ type: Object as PropType<TableSetting>,
39
+ default: () => ({}),
40
+ },
41
+ },
42
+ emits: ['columns-change'],
43
+ setup(props, { emit }) {
44
+ const getSetting = computed((): TableSetting => {
45
+ return {
46
+ redo: true,
47
+ size: true,
48
+ setting: true,
49
+ fullscreen: true,
50
+ ...props.setting,
51
+ };
52
+ })
53
+
54
+ function handleColumnChange(data: ColumnChangeParam[]) {
55
+ emit('columns-change', data);
56
+ }
57
+
58
+ return {
59
+ getSetting,
60
+ handleColumnChange
61
+ }
62
+ }
63
+ })
64
+ </script>
@@ -0,0 +1,13 @@
1
+ export const DEFAULT_SORT_FN = (sortInfo) => {
2
+ const { field, order } = sortInfo
3
+
4
+ return field && order
5
+ ? { field, order }
6
+ : { }
7
+ }
8
+
9
+ export const TABLE_SIZE_HEIGHT = {
10
+ default: 56,
11
+ middle: 47,
12
+ small: 32
13
+ }
@@ -0,0 +1,319 @@
1
+ import type { PaginationProps } from 'ant-design-vue/lib/pagination'
2
+ import { computed, ComputedRef, Ref, ref, unref, toRaw, watch, h } from "vue";
3
+ import { cloneDeep, isEqual } from 'lodash-es'
4
+ import { BasicColumn, BasicTableProps, CellFormat } from "../types/table.type";
5
+ import { SetColumnsParams } from '../types/tableHeader.type';
6
+ import { isArray, isBoolean, isFunction, isObject, isString, Recordable, useAppStore, getDictValueByCode } from '@dt-frames/core';
7
+ import TableAction from '../components/TableActions.vue'
8
+
9
+ // 索引列及操作列标识
10
+ const INDEX_FLAG = 'INDEX'
11
+ const ACTION_COLUMN = 'ACTION'
12
+
13
+ // 处理单条数据的ellipsis 对齐方式
14
+ function handleItem(item: BasicColumn, ellipsis: boolean) {
15
+ const { appConf } = useAppStore();
16
+ const { align } = appConf.ui.table
17
+
18
+ const { key, dataIndex, children } = item
19
+ item.align = item.align || align
20
+
21
+ if( ellipsis ) {
22
+ if (!key) item.key = dataIndex && dataIndex.toString()
23
+
24
+ if (!isBoolean(item.ellipsis)) {
25
+ item = Object.assign(item, {
26
+ ellipsis,
27
+ })
28
+ }
29
+ }
30
+
31
+ if (children && children.length) {
32
+ handleChildren(children, !!ellipsis);
33
+ }
34
+ }
35
+
36
+ function handleChildren(children: BasicColumn[] | undefined, ellipsis: boolean) {
37
+ if (!children) return
38
+
39
+ children.forEach((item) => {
40
+ const { children } = item
41
+ handleItem(item, ellipsis)
42
+ handleChildren(children, ellipsis)
43
+ })
44
+ }
45
+
46
+ // 重新排序列
47
+ function sortFixedColumn(columns: BasicColumn[]) {
48
+ const fixedLeftColumn: BasicColumn[] = []
49
+ const fixedRightColumn: BasicColumn[] = []
50
+ const defaultColumn: BasicColumn[] = []
51
+
52
+ for( let column of columns ) {
53
+ if( column.defaultHidden ) continue
54
+
55
+ if( column.fixed === 'left' ) {
56
+ fixedLeftColumn.push( column )
57
+ continue
58
+ }
59
+
60
+ if( column.fixed === 'right' ) {
61
+ fixedRightColumn.push( column )
62
+ continue
63
+ }
64
+
65
+ defaultColumn.push( column )
66
+ }
67
+
68
+ return [
69
+ ...fixedLeftColumn,
70
+ ...defaultColumn,
71
+ ...fixedRightColumn
72
+ ]
73
+ }
74
+
75
+ // 处理序号
76
+ function handleIndexColumn(
77
+ propsRef: ComputedRef<BasicTableProps>,
78
+ getPaginationRef: ComputedRef<boolean | PaginationProps>,
79
+ columns: BasicColumn[]
80
+ ) {
81
+ const { showIndexColumn, indexColumnProps, isTreeTable } = unref(propsRef)
82
+
83
+ let pushIndexColumns = false
84
+ if (unref(isTreeTable)) {
85
+ return;
86
+ }
87
+
88
+ columns.forEach(() => {
89
+ const indIndex = columns.findIndex((column) => column.flag === INDEX_FLAG);
90
+ if (showIndexColumn) {
91
+ pushIndexColumns = indIndex === -1;
92
+ } else if (!showIndexColumn && indIndex !== -1) {
93
+ columns.splice(indIndex, 1);
94
+ }
95
+ })
96
+
97
+ if (!pushIndexColumns) return
98
+
99
+ const isFixedLeft = columns.some((item) => item.fixed === 'left')
100
+
101
+ columns.unshift({
102
+ flag: INDEX_FLAG,
103
+ width: 50,
104
+ title: '序号',
105
+ align: 'center',
106
+ customRender: ( { index } ) => {
107
+ const getPagination = unref(getPaginationRef)
108
+
109
+ const { appConf } = useAppStore()
110
+ const { defaultPageSize } = appConf.ui.table
111
+
112
+ if (isBoolean(getPagination)) {
113
+ return `${index + 1}`;
114
+ }
115
+
116
+ const { current = 1, pageSize = defaultPageSize } = getPagination;
117
+ return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1
118
+ },
119
+ ...(isFixedLeft
120
+ ? {
121
+ fixed: 'left',
122
+ }
123
+ : {}),
124
+ ...indexColumnProps,
125
+ })
126
+ }
127
+
128
+ // 处理操作栏的列
129
+ function handleActionColumn(propsRef: ComputedRef<BasicTableProps>, columns: BasicColumn[]) {
130
+ const { operations } = unref(propsRef)
131
+
132
+ if (
133
+ !operations
134
+ || (isObject( operations ) && !operations?.btns )
135
+ || ( isArray(operations) && !operations )
136
+ ) return
137
+
138
+ const hasIndex = columns.findIndex((column) => column.flag === ACTION_COLUMN)
139
+
140
+ if( hasIndex === -1 ) {
141
+ let column = isObject( operations ) ? operations
142
+ : isArray( operations ) ? { btns: operations } : {}
143
+
144
+ let expand = column.expand ? column.expand : false
145
+ let columnObj = {
146
+ fixed: 'right',
147
+ title: '操作',
148
+ align: 'center',
149
+ expand,
150
+ width: (expand ? (column.btns.length * 30 + 40) : 70) + 'px',
151
+ ...column,
152
+ flag: ACTION_COLUMN,
153
+ }
154
+
155
+ columns.push({
156
+ ...(columnObj as any),
157
+ customRender: ({ record, index}) => {
158
+ return h(
159
+ TableAction as any,
160
+ {
161
+ ...columnObj,
162
+ record,
163
+ align: null,
164
+ index
165
+ }
166
+ )
167
+ }
168
+ })
169
+ }
170
+ }
171
+
172
+
173
+ export function useColumns(
174
+ propsRef: ComputedRef<BasicTableProps>,
175
+ getPaginationRef: ComputedRef<boolean | PaginationProps>,
176
+ ) {
177
+
178
+ const columnsRef = ref(unref(propsRef).columns) as unknown as Ref<BasicColumn[]>
179
+ let cacheColumns = unref(propsRef).columns
180
+
181
+ const getColumnsRef = computed(() => {
182
+ const columns = cloneDeep(unref(columnsRef)) as BasicColumn[]
183
+ if (!columns) return []
184
+
185
+ const { ellipsis, resizable, minWidth = 50, maxWidth = 700 } = unref(propsRef)
186
+
187
+ columns.forEach( (it, index) => {
188
+ const { slots } = it
189
+ it.width = it.width || (index === columns.length - 1 ? 119.9 : 120)
190
+ if( Reflect.has(it, 'resizable') ? !!it.resizable : resizable ) {
191
+ it.resizable = true
192
+ it.minWidth = it.minWidth || minWidth
193
+ it.maxWidth = it.maxWidth || maxWidth
194
+ }
195
+
196
+ handleItem(
197
+ it,
198
+ Reflect.has(it, 'ellipsis') ? !!it.ellipsis : !!ellipsis && !slots
199
+ )
200
+ } )
201
+
202
+ handleIndexColumn(propsRef, getPaginationRef, columns)
203
+ handleActionColumn(propsRef, columns)
204
+
205
+ return columns
206
+ })
207
+
208
+ const getViewColumns = computed(() => {
209
+ const viewColumns = sortFixedColumn(unref(getColumnsRef))
210
+ const columns: BasicColumn[] = cloneDeep(viewColumns)
211
+
212
+ return columns
213
+ .filter( column => isIfShow(column) )
214
+
215
+ })
216
+
217
+ function isIfShow( column: BasicColumn ): boolean {
218
+ const ifShow = column.ifShow
219
+
220
+ return isBoolean(ifShow)
221
+ ? ifShow
222
+ : isFunction(ifShow) ? ifShow(column) : true
223
+
224
+ }
225
+
226
+ watch(
227
+ () => unref(propsRef).columns,
228
+ columns => {
229
+ columnsRef.value = columns
230
+ cacheColumns = columns.filter( it => !it.flag ) ?? []
231
+ }
232
+ )
233
+
234
+
235
+ // 获取列信息
236
+ function getColumns(opt?: SetColumnsParams) {
237
+ const { ignoreIndex, ignoreAction, sort } = opt || {}
238
+
239
+ let columns = toRaw(unref(getColumnsRef))
240
+
241
+ if( ignoreIndex ) {
242
+ columns = columns.filter( it => it.flag !== INDEX_FLAG )
243
+ }
244
+
245
+ if( ignoreAction ) {
246
+ columns = columns.filter( it => it.flag !== ACTION_COLUMN )
247
+ }
248
+
249
+ // 重新排序
250
+ if( sort ) {
251
+ columns = sortFixedColumn( columns )
252
+ }
253
+
254
+ return columns
255
+ }
256
+
257
+
258
+ // 设置列信息
259
+ function setColumns(columnList: Partial<BasicColumn>[] | string[]) {
260
+ const columns = cloneDeep(columnList)
261
+
262
+ if( !isArray( columns ) ) return
263
+
264
+ // 重置所有的列
265
+ if( !columns.length ) {
266
+ columnsRef.value = []
267
+ return
268
+ }
269
+
270
+ const cacheKeys = cacheColumns.map((item) => item.dataIndex)
271
+
272
+ if( !isString( columns[0] ) ) {
273
+ columnsRef.value = columns as BasicColumn[]
274
+ } else {
275
+ const columnKeys = columns as string[]
276
+ const newColumns: BasicColumn[] = []
277
+
278
+ cacheColumns.forEach( it => {
279
+ newColumns.push({
280
+ ...it,
281
+ defaultHidden: !columnKeys.includes((it.dataIndex! || it.key) as string),
282
+ })
283
+ } )
284
+
285
+
286
+ if( !isEqual(cacheKeys, columns) ) {
287
+ newColumns.sort((prev, next) => {
288
+ return columnKeys.indexOf(prev.dataIndex as string) - columnKeys.indexOf(next.dataIndex as string)
289
+ })
290
+ }
291
+
292
+ columnsRef.value = newColumns
293
+ }
294
+ }
295
+
296
+ function setCacheColumnsByField(dataIndex: string | undefined, value: Partial<BasicColumn>) {
297
+ if (!dataIndex || !value) return
298
+
299
+ cacheColumns.forEach((item) => {
300
+ if (item.dataIndex === dataIndex) {
301
+ Object.assign(item, value);
302
+ return;
303
+ }
304
+ })
305
+ }
306
+
307
+ function getCacheColumns() {
308
+ return cacheColumns;
309
+ }
310
+
311
+ return {
312
+ getViewColumns,
313
+ getColumnsRef,
314
+ getColumns,
315
+ setColumns,
316
+ setCacheColumnsByField,
317
+ getCacheColumns
318
+ }
319
+ }
File without changes
@@ -0,0 +1,99 @@
1
+ import { ComputedRef, ref, Ref, unref, toRaw, watch, computed, onMounted } from "vue"
2
+ import type { PaginationProps } from 'ant-design-vue/lib/pagination'
3
+ import { BasicTableProps, SorterResult } from "../types/table.type"
4
+ import { isFunction, Recordable, useAppStore, useTimeoutFn } from "@dt-frames/core"
5
+
6
+ /**
7
+ * 处理表格数据
8
+ */
9
+ type ActionsType = {
10
+ getPaginationInfo: ComputedRef<boolean | PaginationProps>
11
+ setPagination: (info: Partial<PaginationProps>) => void
12
+ clearSelectedRowKeys: () => void
13
+ }
14
+
15
+ export function useDataSource(
16
+ propsRef: ComputedRef<BasicTableProps>,
17
+ {
18
+ getPaginationInfo,
19
+ setPagination,
20
+ clearSelectedRowKeys,
21
+ }: ActionsType,
22
+ emit
23
+ ) {
24
+ // 拷贝一份表格数据 然后再做数据处理
25
+ const dataSourceRef = ref<Recordable[]>([])
26
+
27
+ watch(
28
+ () => unref(propsRef).dataSource,
29
+ (dataSource) => {
30
+ dataSource && (dataSourceRef.value = dataSource)
31
+ },
32
+ {
33
+ immediate: true
34
+ }
35
+ )
36
+
37
+ const getDataSourceRef = computed( () => {
38
+ return unref(dataSourceRef)
39
+ } )
40
+
41
+ // 表单改变事件
42
+ function handleTableChange(
43
+ pagination: PaginationProps,
44
+ filters: Partial<Recordable<string[]>>,
45
+ sorter: SorterResult,
46
+ ) {
47
+ const { sortFn, filterFn, onTableChange } = unref( propsRef )
48
+ const { appConf } = useAppStore()
49
+ const { current = 1, pageSize = appConf.ui.table.defaultPageSize } = pagination
50
+
51
+ // clearSelectedRowKeys()
52
+
53
+ setPagination( pagination )
54
+
55
+ const params: Recordable = {}
56
+
57
+ if( sorter && isFunction(sortFn) ) {
58
+ params.sortInfo = sortFn(sorter)
59
+ }
60
+
61
+ if (filters && isFunction(filterFn)) {
62
+ params.filterInfo = filterFn( filters )
63
+ }
64
+
65
+
66
+ return onTableChange({
67
+ pagination: {
68
+ current,
69
+ pageSize
70
+ },
71
+ sort: unref( params.sortInfo ),
72
+ filter: toRaw(unref( params.filterInfo )),
73
+ showBtnLoading: false
74
+ })
75
+ }
76
+
77
+
78
+ onMounted(() => {
79
+ const { defSort, onTableChange } = unref( propsRef )
80
+ const { appConf } = useAppStore()
81
+
82
+ onTableChange({
83
+ pagination: {
84
+ current: 1,
85
+ pageSize: appConf.ui.table.defaultPageSize
86
+ },
87
+ sort:defSort,
88
+ filter: null,
89
+ showBtnLoading: false
90
+ }, false)
91
+ })
92
+
93
+
94
+ return {
95
+ getDataSourceRef,
96
+ handleTableChange
97
+ }
98
+
99
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 设置表格的loading状态
3
+ * 这里做二次封装 主要原因是暴露一个方法 外面可以调用这个方法 从而改变loading状态
4
+ */
5
+
6
+ import { ComputedRef, ref, unref, watch, computed } from "vue"
7
+ import { BasicTableProps } from "../types/table.type"
8
+
9
+ export function useLoading(props: ComputedRef<BasicTableProps>) {
10
+ const loadingRef = ref( unref(props).loading )
11
+
12
+ watch(
13
+ () => unref(props).loading,
14
+ (v) => {
15
+ loadingRef.value = v
16
+ }
17
+ )
18
+
19
+ const getLoading = computed(() => unref(loadingRef))
20
+
21
+ function setLoading( loading: boolean ) {
22
+ loadingRef.value = loading
23
+ }
24
+
25
+ return {
26
+ getLoading,
27
+ setLoading
28
+ }
29
+ }
@@ -0,0 +1,76 @@
1
+ import { computed, ComputedRef, ref, unref, watch } from "vue"
2
+ import type { PaginationProps } from 'ant-design-vue/lib/pagination'
3
+ import { BasicTableProps } from "../types/table.type"
4
+ import { isBoolean, useAppStore } from "@dt-frames/core"
5
+
6
+
7
+ export function usePagination(props: ComputedRef<BasicTableProps>) {
8
+ const paginationRef = ref<PaginationProps>({})
9
+ const show = ref(true)
10
+
11
+ watch(
12
+ () => unref(props).pagination,
13
+ (pagination) => {
14
+ if( !isBoolean(pagination) && pagination ) {
15
+ paginationRef.value = {
16
+ ...unref(paginationRef),
17
+ ...(pagination ?? {})
18
+ }
19
+ }
20
+ }
21
+ )
22
+
23
+ // 获取分页数据
24
+ const getPaginationInfo = computed((): PaginationProps | boolean => {
25
+ const { pagination } = unref( props )
26
+
27
+ if( !unref(show) || isBoolean( pagination ) && !pagination ) {
28
+ return false
29
+ }
30
+
31
+ const { appConf } = useAppStore()
32
+ const { defaultPageSize, pageSizeOptions, size } = appConf.ui.table
33
+
34
+ return {
35
+ current: 1,
36
+ pageSize: defaultPageSize,
37
+ size: size === 'small' ? 'small' : 'default',
38
+ defaultPageSize,
39
+ showTotal: (total, range) => `总共${ total }页`,
40
+ showSizeChanger: true,
41
+ pageSizeOptions,
42
+ showQuickJumper: true,
43
+ ...(isBoolean(pagination) ? {} : pagination),
44
+ ...unref(paginationRef),
45
+ }
46
+ })
47
+
48
+ function setPagination(info: Partial<PaginationProps>) {
49
+ const paginationInfo = unref( getPaginationInfo )
50
+
51
+ paginationRef.value = {
52
+ ...(!isBoolean(paginationInfo) ? paginationInfo : {}),
53
+ ...info
54
+ }
55
+ }
56
+
57
+ function getPagination() {
58
+ return unref( getPaginationInfo )
59
+ }
60
+
61
+ function getShowPagination() {
62
+ return unref(show);
63
+ }
64
+
65
+ async function setShowPagination(flag: boolean) {
66
+ show.value = flag;
67
+ }
68
+
69
+ return {
70
+ getPaginationInfo,
71
+ setPagination,
72
+ getPagination,
73
+ getShowPagination,
74
+ setShowPagination
75
+ }
76
+ }