@ctzy-web-client/plugin-component-vue 1.0.9 → 1.0.10

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 (272) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/advance-select/advance-operation.mjs +43 -0
  3. package/es/advance-select/advance-option.mjs +125 -0
  4. package/es/advance-select/advance-select.mjs +359 -0
  5. package/es/advance-select/events-helpers.mjs +29 -0
  6. package/es/advance-select/index.mjs +13 -0
  7. package/es/advance-select/use-advance-option.mjs +43 -0
  8. package/es/advance-select/use-advance-select.mjs +117 -0
  9. package/es/application-slot/application-slot.mjs +51 -0
  10. package/es/application-slot/breadcrumb-item.mjs +23 -0
  11. package/es/application-slot/header-tools-item.mjs +23 -0
  12. package/es/application-slot/index.mjs +16 -0
  13. package/es/breadcrumb-select/breadcrumb-select.mjs +155 -0
  14. package/es/breadcrumb-select/index.mjs +6 -0
  15. package/es/components.mjs +22 -0
  16. package/es/contextmenu/contextmenu-item.mjs +21 -0
  17. package/es/contextmenu/contextmenu.mjs +64 -0
  18. package/es/contextmenu/index.mjs +10 -0
  19. package/es/contextmenu/use-contextmenu.mjs +85 -0
  20. package/es/data-form/data-form-item.mjs +53 -0
  21. package/es/data-form/data-form.mjs +175 -0
  22. package/es/data-form/dynamic-component.mjs +23 -0
  23. package/es/data-form/form-components/Blots/AtBlot.mjs +25 -0
  24. package/es/data-form/form-components/bwa-date-picker.mjs +45 -0
  25. package/es/data-form/form-components/bwa-date-time-picker.mjs +50 -0
  26. package/es/data-form/form-components/bwa-input-float.mjs +43 -0
  27. package/es/data-form/form-components/bwa-input-integer.mjs +56 -0
  28. package/es/data-form/form-components/bwa-input.mjs +38 -0
  29. package/es/data-form/form-components/bwa-multi-select.mjs +35 -0
  30. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +234 -0
  31. package/es/data-form/form-components/bwa-rich-text.mjs +325 -0
  32. package/es/data-form/form-components/bwa-select.mjs +76 -0
  33. package/es/data-form/form-components/bwa-textarea.mjs +33 -0
  34. package/es/data-form/form-components/bwa-upload.mjs +159 -0
  35. package/es/data-form/form-components/bwa-user-multi-select.mjs +30 -0
  36. package/es/data-form/form-components/bwa-user-select.mjs +69 -0
  37. package/es/data-form/index.mjs +34 -0
  38. package/es/data-table/data-column-view.mjs +131 -0
  39. package/es/data-table/data-table-card.mjs +118 -0
  40. package/es/data-table/data-table-column.mjs +56 -0
  41. package/es/data-table/data-table.mjs +369 -0
  42. package/es/data-table/dynamic-component.mjs +48 -0
  43. package/es/data-table/index.mjs +13 -0
  44. package/es/data-table/use-datatable-drag.mjs +110 -0
  45. package/es/datatable-settings/datatable-settings.mjs +309 -0
  46. package/es/datatable-settings/index.mjs +6 -0
  47. package/es/date-range/date-picker.mjs +128 -0
  48. package/es/date-range/date-range.mjs +177 -0
  49. package/es/date-range/index.mjs +6 -0
  50. package/es/drag-list/constants.mjs +3 -0
  51. package/es/drag-list/drag-item.mjs +49 -0
  52. package/es/drag-list/drag-list.mjs +56 -0
  53. package/es/drag-list/index.mjs +6 -0
  54. package/es/drag-list/use-drag-list.mjs +154 -0
  55. package/es/dragable/constants.mjs +4 -0
  56. package/es/dragable/dragable-item.mjs +25 -0
  57. package/es/dragable/dragable-operation.mjs +32 -0
  58. package/es/dragable/dragable.mjs +31 -0
  59. package/es/dragable/index.mjs +15 -0
  60. package/es/dragable/use-dragable.mjs +134 -0
  61. package/es/filter-panel/conditions/condition.mjs +30 -0
  62. package/es/filter-panel/conditions/date-range-condition.mjs +46 -0
  63. package/es/filter-panel/conditions/department-condition/department-condition.mjs +81 -0
  64. package/es/filter-panel/conditions/department-condition/department-node.mjs +74 -0
  65. package/es/filter-panel/conditions/index.mjs +21 -0
  66. package/es/filter-panel/conditions/input-condition.mjs +83 -0
  67. package/es/filter-panel/conditions/multi-user-condition.mjs +64 -0
  68. package/es/filter-panel/conditions/multiple-menu-condition.mjs +41 -0
  69. package/es/filter-panel/conditions/single-menu-condition.mjs +68 -0
  70. package/es/filter-panel/conditions/single-user-condition.mjs +64 -0
  71. package/es/filter-panel/filter-panel-item.mjs +47 -0
  72. package/es/filter-panel/filter-panel.mjs +180 -0
  73. package/es/filter-panel/index.mjs +15 -0
  74. package/es/filter-panel/use-filter-panel-item.mjs +52 -0
  75. package/es/filter-panel/use-filter-panel.mjs +135 -0
  76. package/es/hooks/use-data/index.mjs +152 -0
  77. package/es/index.mjs +27 -0
  78. package/es/layout/index.mjs +6 -0
  79. package/es/layout/layout.mjs +86 -0
  80. package/es/make-installer.mjs +34 -0
  81. package/es/math/Rectangle.mjs +25 -0
  82. package/es/menu/index.mjs +6 -0
  83. package/es/menu/menu-item.mjs +75 -0
  84. package/es/menu/menu.mjs +60 -0
  85. package/es/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.mjs +6372 -0
  86. package/es/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.mjs +1517 -0
  87. package/es/panel/index.mjs +6 -0
  88. package/es/panel/panel.mjs +55 -0
  89. package/es/panel-tabs/index.mjs +6 -0
  90. package/es/panel-tabs/panel-tabs.mjs +66 -0
  91. package/es/pct-filter-panel/index.mjs +10 -0
  92. package/es/pct-filter-panel/pct-compents/index.mjs +10 -0
  93. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +71 -0
  94. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +74 -0
  95. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +186 -0
  96. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +147 -0
  97. package/es/pct-filter-panel/pct-filter-panel-item.mjs +48 -0
  98. package/es/pct-filter-panel/pct-filter-panel.mjs +251 -0
  99. package/es/pct-filter-panel/use-filter-panel-item.mjs +56 -0
  100. package/es/pct-filter-panel/use-filter-panel.mjs +127 -0
  101. package/es/plugins.mjs +5 -0
  102. package/es/progress/index.mjs +10 -0
  103. package/es/progress/progress-item.mjs +68 -0
  104. package/es/progress/progress.mjs +74 -0
  105. package/es/progress/use-progress.mjs +46 -0
  106. package/es/utils/db.mjs +9 -0
  107. package/es/utils.mjs +99 -0
  108. package/es/where-filter-panel/index.mjs +1 -0
  109. package/es/where-filter-panel/use-where-filter-panel.mjs +18 -0
  110. package/es/where-filter-panel/where-filter-panel.mjs +17 -0
  111. package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
  112. package/lib/advance-select/advance-operation.js +47 -0
  113. package/lib/advance-select/advance-option.js +129 -0
  114. package/lib/advance-select/advance-select.js +363 -0
  115. package/lib/advance-select/events-helpers.js +33 -0
  116. package/lib/advance-select/index.js +20 -0
  117. package/lib/advance-select/use-advance-option.js +47 -0
  118. package/lib/advance-select/use-advance-select.js +122 -0
  119. package/lib/application-slot/application-slot.js +55 -0
  120. package/lib/application-slot/breadcrumb-item.js +27 -0
  121. package/lib/application-slot/header-tools-item.js +27 -0
  122. package/lib/application-slot/index.js +23 -0
  123. package/lib/breadcrumb-select/breadcrumb-select.js +159 -0
  124. package/lib/breadcrumb-select/index.js +11 -0
  125. package/lib/components.js +26 -0
  126. package/lib/contextmenu/contextmenu-item.js +25 -0
  127. package/lib/contextmenu/contextmenu.js +68 -0
  128. package/lib/contextmenu/index.js +16 -0
  129. package/lib/contextmenu/use-contextmenu.js +89 -0
  130. package/lib/data-form/data-form-item.js +57 -0
  131. package/lib/data-form/data-form.js +179 -0
  132. package/lib/data-form/dynamic-component.js +27 -0
  133. package/lib/data-form/form-components/Blots/AtBlot.js +31 -0
  134. package/lib/data-form/form-components/bwa-date-picker.js +49 -0
  135. package/lib/data-form/form-components/bwa-date-time-picker.js +54 -0
  136. package/lib/data-form/form-components/bwa-input-float.js +47 -0
  137. package/lib/data-form/form-components/bwa-input-integer.js +60 -0
  138. package/lib/data-form/form-components/bwa-input.js +42 -0
  139. package/lib/data-form/form-components/bwa-multi-select.js +39 -0
  140. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +242 -0
  141. package/lib/data-form/form-components/bwa-rich-text.js +333 -0
  142. package/lib/data-form/form-components/bwa-select.js +80 -0
  143. package/lib/data-form/form-components/bwa-textarea.js +37 -0
  144. package/lib/data-form/form-components/bwa-upload.js +163 -0
  145. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -0
  146. package/lib/data-form/form-components/bwa-user-select.js +73 -0
  147. package/lib/data-form/index.js +40 -0
  148. package/lib/data-table/data-column-view.js +135 -0
  149. package/lib/data-table/data-table-card.js +122 -0
  150. package/lib/data-table/data-table-column.js +60 -0
  151. package/lib/data-table/data-table.js +373 -0
  152. package/lib/data-table/dynamic-component.js +56 -0
  153. package/lib/data-table/index.js +20 -0
  154. package/lib/data-table/use-datatable-drag.js +114 -0
  155. package/lib/datatable-settings/datatable-settings.js +313 -0
  156. package/lib/datatable-settings/index.js +11 -0
  157. package/lib/date-range/date-picker.js +136 -0
  158. package/lib/date-range/date-range.js +185 -0
  159. package/lib/date-range/index.js +11 -0
  160. package/lib/drag-list/constants.js +7 -0
  161. package/lib/drag-list/drag-item.js +53 -0
  162. package/lib/drag-list/drag-list.js +60 -0
  163. package/lib/drag-list/index.js +11 -0
  164. package/lib/drag-list/use-drag-list.js +158 -0
  165. package/lib/dragable/constants.js +9 -0
  166. package/lib/dragable/dragable-item.js +29 -0
  167. package/lib/dragable/dragable-operation.js +36 -0
  168. package/lib/dragable/dragable.js +35 -0
  169. package/lib/dragable/index.js +22 -0
  170. package/lib/dragable/use-dragable.js +138 -0
  171. package/lib/filter-panel/conditions/condition.js +34 -0
  172. package/lib/filter-panel/conditions/date-range-condition.js +50 -0
  173. package/lib/filter-panel/conditions/department-condition/department-condition.js +85 -0
  174. package/lib/filter-panel/conditions/department-condition/department-node.js +78 -0
  175. package/lib/filter-panel/conditions/index.js +26 -0
  176. package/lib/filter-panel/conditions/input-condition.js +87 -0
  177. package/lib/filter-panel/conditions/multi-user-condition.js +68 -0
  178. package/lib/filter-panel/conditions/multiple-menu-condition.js +45 -0
  179. package/lib/filter-panel/conditions/single-menu-condition.js +72 -0
  180. package/lib/filter-panel/conditions/single-user-condition.js +68 -0
  181. package/lib/filter-panel/filter-panel-item.js +51 -0
  182. package/lib/filter-panel/filter-panel.js +184 -0
  183. package/lib/filter-panel/index.js +20 -0
  184. package/lib/filter-panel/use-filter-panel-item.js +56 -0
  185. package/lib/filter-panel/use-filter-panel.js +139 -0
  186. package/lib/hooks/use-data/index.js +157 -0
  187. package/lib/index.js +60 -0
  188. package/lib/layout/index.js +11 -0
  189. package/lib/layout/layout.js +90 -0
  190. package/lib/make-installer.js +62 -0
  191. package/lib/math/Rectangle.js +29 -0
  192. package/lib/menu/index.js +11 -0
  193. package/lib/menu/menu-item.js +79 -0
  194. package/lib/menu/menu.js +64 -0
  195. package/lib/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.js +6635 -0
  196. package/lib/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.js +1628 -0
  197. package/lib/panel/index.js +11 -0
  198. package/lib/panel/panel.js +59 -0
  199. package/lib/panel-tabs/index.js +11 -0
  200. package/lib/panel-tabs/panel-tabs.js +70 -0
  201. package/lib/pct-filter-panel/index.js +14 -0
  202. package/lib/pct-filter-panel/pct-compents/index.js +16 -0
  203. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +75 -0
  204. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +78 -0
  205. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +190 -0
  206. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +151 -0
  207. package/lib/pct-filter-panel/pct-filter-panel-item.js +52 -0
  208. package/lib/pct-filter-panel/pct-filter-panel.js +255 -0
  209. package/lib/pct-filter-panel/use-filter-panel-item.js +60 -0
  210. package/lib/pct-filter-panel/use-filter-panel.js +131 -0
  211. package/lib/plugins.js +9 -0
  212. package/lib/progress/index.js +16 -0
  213. package/lib/progress/progress-item.js +72 -0
  214. package/lib/progress/progress.js +78 -0
  215. package/lib/progress/use-progress.js +51 -0
  216. package/lib/utils/db.js +17 -0
  217. package/lib/utils.js +110 -0
  218. package/lib/where-filter-panel/index.js +2 -0
  219. package/lib/where-filter-panel/use-where-filter-panel.js +22 -0
  220. package/lib/where-filter-panel/where-filter-panel.js +21 -0
  221. package/package.json +1 -1
  222. package/style/advance-select.css +1 -0
  223. package/style/breadcrumb-select.css +1 -0
  224. package/style/common.css +1 -0
  225. package/style/contextmenu.css +1 -0
  226. package/style/data-form.css +1 -0
  227. package/style/data-table.css +1 -0
  228. package/style/datatable-settings.css +1 -0
  229. package/style/date-range.css +1 -0
  230. package/style/department-condition.css +1 -0
  231. package/style/drag-list.css +1 -0
  232. package/style/dragable.css +1 -0
  233. package/style/filter-panel.css +1 -0
  234. package/style/index.css +1 -0
  235. package/style/input-condition.css +1 -0
  236. package/style/layout.css +1 -0
  237. package/style/menu.css +1 -0
  238. package/style/panel-tabs.css +1 -0
  239. package/style/panel.css +1 -0
  240. package/style/pct-filter-panel.css +1 -0
  241. package/style/progress.css +1 -0
  242. package/style/rich-text.css +1 -0
  243. package/style/var.css +1 -0
  244. /package/style/{advance-select.scss → src/advance-select.scss} +0 -0
  245. /package/style/{breadcrumb-select.scss → src/breadcrumb-select.scss} +0 -0
  246. /package/style/{common → src/common}/var.scss +0 -0
  247. /package/style/{common.scss → src/common.scss} +0 -0
  248. /package/style/{contextmenu.scss → src/contextmenu.scss} +0 -0
  249. /package/style/{data-form.scss → src/data-form.scss} +0 -0
  250. /package/style/{data-table.scss → src/data-table.scss} +0 -0
  251. /package/style/{datatable-settings.scss → src/datatable-settings.scss} +0 -0
  252. /package/style/{date-range.scss → src/date-range.scss} +0 -0
  253. /package/style/{department-condition.scss → src/department-condition.scss} +0 -0
  254. /package/style/{drag-list.scss → src/drag-list.scss} +0 -0
  255. /package/style/{dragable.scss → src/dragable.scss} +0 -0
  256. /package/style/{filter-panel.scss → src/filter-panel.scss} +0 -0
  257. /package/style/{index.scss → src/index.scss} +0 -0
  258. /package/style/{input-condition.scss → src/input-condition.scss} +0 -0
  259. /package/style/{layout.scss → src/layout.scss} +0 -0
  260. /package/style/{menu.scss → src/menu.scss} +0 -0
  261. /package/style/{mixins → src/mixins}/_var.scss +0 -0
  262. /package/style/{mixins → src/mixins}/config.scss +0 -0
  263. /package/style/{mixins → src/mixins}/function.scss +0 -0
  264. /package/style/{mixins → src/mixins}/mixins.scss +0 -0
  265. /package/style/{panel-tabs.scss → src/panel-tabs.scss} +0 -0
  266. /package/style/{panel.scss → src/panel.scss} +0 -0
  267. /package/style/{pct-filter-panel.scss → src/pct-filter-panel.scss} +0 -0
  268. /package/style/{progress.scss → src/progress.scss} +0 -0
  269. /package/style/{rich-text.scss → src/rich-text.scss} +0 -0
  270. /package/style/{theme → src/theme}/theme.scss +0 -0
  271. /package/style/{theme → src/theme}/var.scss +0 -0
  272. /package/style/{var.scss → src/var.scss} +0 -0
@@ -0,0 +1,309 @@
1
+ import { defineComponent, useAttrs, ref, computed, unref, getCurrentScope, onScopeDispose, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeClass, createTextVNode, createElementBlock, createVNode, createCommentVNode, toDisplayString, withModifiers, Fragment, renderList, renderSlot } from 'vue';
2
+ import { ElTooltip, ElIcon, ElScrollbar, ElSwitch } from 'element-plus';
3
+ import { useNamespace, useValue, useService, useEventDispatcher } from '@ctzy-web-client/web-base-client-vue';
4
+ import { BwaDraglist } from '../drag-list/index.mjs';
5
+ import { map } from 'rxjs';
6
+ import { dataModelDB } from '../utils/db.mjs';
7
+ import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
8
+
9
+ const __default__ = defineComponent({ name: "BwaDataTableSetting" });
10
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
11
+ props: {
12
+ dataTable: {
13
+ type: Object,
14
+ required: true
15
+ }
16
+ },
17
+ setup(__props) {
18
+ const props = __props;
19
+ const attrs = useAttrs();
20
+ const ns = useNamespace("datatable-settings");
21
+ const value = ref(false);
22
+ const appName = useValue("AppName");
23
+ const userService = useService("UserService");
24
+ const userID = computed(() => {
25
+ var _a, _b;
26
+ return ((_b = (_a = unref(userService)) == null ? void 0 : _a.userInfo) == null ? void 0 : _b.id) || "";
27
+ });
28
+ const isShowResetColumn = computed(
29
+ () => !props.dataTable.isDefaultColumnSort()
30
+ );
31
+ const key = computed(
32
+ () => `${unref(appName)}_${props.dataTable.name}_settings`
33
+ );
34
+ const search = ref("");
35
+ const columns = computed(
36
+ () => props.dataTable.getColumns().filter((column) => column.settings.visible).filter((column) => column.settings.visible)
37
+ );
38
+ const initColumns = async () => {
39
+ var _a, _b, _c;
40
+ let persistentColumnInfos = [];
41
+ const result = await dataModelDB.tableHeaderSettings.where("[app+tableName+userID]").equals([unref(appName), props.dataTable.name, unref(userID)]).toArray();
42
+ if (result.length) {
43
+ persistentColumnInfos = (_b = (_a = result[0]) == null ? void 0 : _a.columnInfo) != null ? _b : [];
44
+ }
45
+ if (persistentColumnInfos.some((item) => typeof item === "string")) {
46
+ persistentColumnInfos = persistentColumnInfos.map((columnInfo) => {
47
+ return typeof columnInfo === "object" ? columnInfo : { name: columnInfo, visible: true };
48
+ });
49
+ }
50
+ const _dataTable = props.dataTable;
51
+ let dataTableColumns = _dataTable.getColumns().slice().filter((item) => item.settings.visible);
52
+ persistentColumnInfos = persistentColumnInfos.filter(
53
+ (item) => dataTableColumns.findIndex((column) => column.name === item.name) !== -1
54
+ );
55
+ if (!persistentColumnInfos) {
56
+ return dataTableColumns;
57
+ }
58
+ let sortedColumns = persistentColumnInfos.map(
59
+ (columnInfo) => dataTableColumns.find((column) => column.name === columnInfo.name)
60
+ ).filter(Boolean);
61
+ dataTableColumns = sortedColumns.concat(
62
+ dataTableColumns.filter(
63
+ (column) => !sortedColumns.find((col) => column.name === col.name)
64
+ )
65
+ );
66
+ for (const column of dataTableColumns) {
67
+ const persistentItem = persistentColumnInfos.find(
68
+ (item) => item.name === column.name
69
+ );
70
+ column.visible = (_c = persistentItem == null ? void 0 : persistentItem.visible) != null ? _c : column.visible;
71
+ }
72
+ props.dataTable.setDisplayColumns(
73
+ dataTableColumns.filter((column) => column.visible)
74
+ );
75
+ return dataTableColumns;
76
+ };
77
+ const resetColumns = () => {
78
+ const _dataTable = props.dataTable;
79
+ _dataTable.resetColumnSort();
80
+ };
81
+ const allSearchedColumns = computed(() => {
82
+ const _search = unref(search);
83
+ return unref(columns).filter((column) => column.title.indexOf(_search) > -1);
84
+ });
85
+ const hiddenSearchedColumns = computed(
86
+ () => unref(allSearchedColumns).filter((item) => !item.visible)
87
+ );
88
+ const displaySearchedColumns = computed(() => {
89
+ const _search = unref(search);
90
+ return props.dataTable.getDisplayColumns().filter((column) => column.settings.visible).filter((column) => column.title.indexOf(_search) > -1);
91
+ });
92
+ const handleSortChange = (sort) => {
93
+ const _columns = unref(columns);
94
+ const displayColumns = sort.map(
95
+ (attrName) => {
96
+ var _a;
97
+ return (_a = _columns.find((column) => column.attrName === attrName)) != null ? _a : null;
98
+ }
99
+ ).filter(Boolean);
100
+ props.dataTable.setDisplayColumns(displayColumns);
101
+ };
102
+ const scope = getCurrentScope();
103
+ const handleInitCompleted = async () => {
104
+ const dataTableColumns = await initColumns();
105
+ const subscription = props.dataTable.getDisplayColumnsSubject().pipe(
106
+ map((displayColumns) => {
107
+ const hiddenColumns = dataTableColumns.filter(
108
+ (column) => !displayColumns.find(
109
+ (displayColumn) => displayColumn.attrName === column.attrName
110
+ )
111
+ );
112
+ return [...displayColumns, ...hiddenColumns].map((column) => ({
113
+ name: column.name,
114
+ visible: column.visible
115
+ }));
116
+ })
117
+ ).subscribe({
118
+ next: (columnInfo) => {
119
+ dataModelDB.tableHeaderSettings.put({
120
+ app: unref(appName),
121
+ tableName: props.dataTable.name,
122
+ userID: unref(userID),
123
+ columnInfo
124
+ });
125
+ }
126
+ });
127
+ scope.run(() => {
128
+ onScopeDispose(() => {
129
+ subscription.unsubscribe();
130
+ });
131
+ });
132
+ };
133
+ if (!props.dataTable.inited) {
134
+ useEventDispatcher(props.dataTable, "init-completed", handleInitCompleted);
135
+ } else {
136
+ handleInitCompleted();
137
+ }
138
+ return (_ctx, _cache) => {
139
+ const _component_RefreshRight = resolveComponent("RefreshRight");
140
+ const _component_Close = resolveComponent("Close");
141
+ return openBlock(), createBlock(unref(ElTooltip), mergeProps({
142
+ visible: value.value,
143
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => value.value = $event)
144
+ }, unref(attrs), {
145
+ effect: "light",
146
+ "show-arrow": false,
147
+ trigger: "click",
148
+ "popper-class": unref(ns).b(),
149
+ "gpu-acceleration": false,
150
+ placement: "bottom",
151
+ "append-to": ".bwa-application"
152
+ }), {
153
+ content: withCtx(() => [
154
+ createElementVNode("div", {
155
+ class: normalizeClass(unref(ns).e("content"))
156
+ }, [
157
+ createElementVNode("div", {
158
+ class: normalizeClass(unref(ns).e("header"))
159
+ }, [
160
+ createTextVNode(" \u8868\u5934\u8BBE\u7F6E "),
161
+ createElementVNode("span", {
162
+ class: normalizeClass(unref(ns).e("tools"))
163
+ }, [
164
+ unref(isShowResetColumn) ? (openBlock(), createElementBlock("span", {
165
+ key: 0,
166
+ class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("refresh")]),
167
+ onClick: resetColumns
168
+ }, [
169
+ createVNode(unref(ElTooltip), {
170
+ content: "\u6062\u590D\u9ED8\u8BA4",
171
+ "append-to": ".bwa-application"
172
+ }, {
173
+ default: withCtx(() => [
174
+ createVNode(unref(ElIcon), null, {
175
+ default: withCtx(() => [
176
+ createVNode(_component_RefreshRight)
177
+ ]),
178
+ _: 1
179
+ })
180
+ ]),
181
+ _: 1
182
+ })
183
+ ], 2)) : createCommentVNode("v-if", true),
184
+ createElementVNode("span", {
185
+ class: normalizeClass([unref(ns).e("tools-item"), unref(ns).e("close")]),
186
+ onClick: _cache[0] || (_cache[0] = ($event) => value.value = false)
187
+ }, [
188
+ createVNode(unref(ElTooltip), {
189
+ content: "\u5173\u95ED",
190
+ "append-to": ".bwa-application"
191
+ }, {
192
+ default: withCtx(() => [
193
+ createVNode(unref(ElIcon), null, {
194
+ default: withCtx(() => [
195
+ createVNode(_component_Close)
196
+ ]),
197
+ _: 1
198
+ })
199
+ ]),
200
+ _: 1
201
+ })
202
+ ], 2)
203
+ ], 2)
204
+ ], 2),
205
+ createCommentVNode(` <div :class="ns.e('search')">\r
206
+ <ElInput\r
207
+ v-model="search"\r
208
+ :clearable="true"\r
209
+ prefix-icon="Search"\r
210
+ placeholder="\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"\r
211
+ />\r
212
+ </div> `),
213
+ createVNode(unref(ElScrollbar), { "max-height": "500px" }, {
214
+ default: withCtx(() => [
215
+ createElementVNode("div", {
216
+ class: normalizeClass(unref(ns).e("main"))
217
+ }, [
218
+ unref(displaySearchedColumns).length ? (openBlock(), createElementBlock("div", {
219
+ key: 0,
220
+ class: normalizeClass(unref(ns).b("section"))
221
+ }, [
222
+ createElementVNode("div", {
223
+ class: normalizeClass(unref(ns).be("section", "header"))
224
+ }, "\u663E\u793A\u5B57\u6BB5", 2),
225
+ createVNode(unref(BwaDraglist), {
226
+ data: unref(displaySearchedColumns),
227
+ labelAttr: "title",
228
+ idAttr: "attrName",
229
+ onSortChange: handleSortChange
230
+ }, {
231
+ default: withCtx(({ item }) => [
232
+ createElementVNode("div", {
233
+ class: normalizeClass(unref(ns).be("section", "content"))
234
+ }, [
235
+ createElementVNode("div", {
236
+ class: normalizeClass(unref(ns).e("field-item"))
237
+ }, [
238
+ createElementVNode("span", null, toDisplayString(item.title), 1),
239
+ createVNode(unref(ElSwitch), {
240
+ modelValue: item.visible,
241
+ "onUpdate:modelValue": ($event) => item.visible = $event,
242
+ size: "small",
243
+ disabled: item.settings.disabled,
244
+ onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
245
+ }, ["stop"]))
246
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
247
+ ], 2)
248
+ ], 2)
249
+ ]),
250
+ _: 1
251
+ }, 8, ["data"]),
252
+ createCommentVNode(` <div\r
253
+ v-show="!displaySearchedColumns.length"\r
254
+ :class="ns.be('section', 'empty')"\r
255
+ >\r
256
+ \u6682\u65E0\u5B57\u6BB5\r
257
+ </div> `)
258
+ ], 2)) : createCommentVNode("v-if", true),
259
+ unref(hiddenSearchedColumns).length ? (openBlock(), createElementBlock("div", {
260
+ key: 1,
261
+ class: normalizeClass(unref(ns).b("section"))
262
+ }, [
263
+ createElementVNode("div", {
264
+ class: normalizeClass(unref(ns).be("section", "header"))
265
+ }, "\u672A\u663E\u793A\u5B57\u6BB5", 2),
266
+ createElementVNode("div", {
267
+ class: normalizeClass(unref(ns).be("section", "content"))
268
+ }, [
269
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(hiddenSearchedColumns), (column) => {
270
+ return openBlock(), createElementBlock("div", {
271
+ key: column.attrName,
272
+ class: normalizeClass(unref(ns).e("field-item"))
273
+ }, [
274
+ createElementVNode("span", null, toDisplayString(column.title), 1),
275
+ createVNode(unref(ElSwitch), {
276
+ modelValue: column.visible,
277
+ "onUpdate:modelValue": ($event) => column.visible = $event,
278
+ size: "small",
279
+ disabled: column.settings.disabled
280
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
281
+ ], 2);
282
+ }), 128))
283
+ ], 2),
284
+ createCommentVNode(` <div\r
285
+ v-show="!hiddenSearchedColumns.length"\r
286
+ :class="ns.be('section', 'empty')"\r
287
+ >\r
288
+ \u6682\u65E0\u5B57\u6BB5\r
289
+ </div> `)
290
+ ], 2)) : createCommentVNode("v-if", true)
291
+ ], 2)
292
+ ]),
293
+ _: 1
294
+ })
295
+ ], 2)
296
+ ]),
297
+ default: withCtx(() => [
298
+ createElementVNode("span", null, [
299
+ renderSlot(_ctx.$slots, "default")
300
+ ])
301
+ ]),
302
+ _: 3
303
+ }, 16, ["visible", "popper-class"]);
304
+ };
305
+ }
306
+ });
307
+ var DataTableSettings = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "datatable-settings.vue"]]);
308
+
309
+ export { DataTableSettings as default };
@@ -0,0 +1,6 @@
1
+ import { withInstall } from 'element-plus/es/utils/vue/install';
2
+ import DataTableSettings from './datatable-settings.mjs';
3
+
4
+ const BwaDataTableSetting = withInstall(DataTableSettings);
5
+
6
+ export { BwaDataTableSetting, BwaDataTableSetting as default };
@@ -0,0 +1,128 @@
1
+ import { defineComponent, ref, watch, provide, computed, resolveComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, createElementVNode, normalizeClass, createTextVNode } from 'vue';
2
+ import { ROOT_PICKER_INJECTION_KEY } from 'element-plus/es/components/date-picker/src/constants';
3
+ import ElPanelDatePicker from 'element-plus/es/components/date-picker/src/date-picker-com/panel-date-pick';
4
+ import { parseDate, valueEquals, formatter } from 'element-plus/es/components/time-picker/src/utils';
5
+ import { useLocale } from 'element-plus/es/hooks/index';
6
+ import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
7
+ import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
8
+
9
+ const __default__ = defineComponent({ name: "BwaDatePicker" });
10
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
11
+ props: {
12
+ modelValue: {
13
+ type: [String, Date, Array]
14
+ },
15
+ visible: {
16
+ type: Boolean
17
+ },
18
+ format: {
19
+ type: String,
20
+ default: "YYYY-MM-DD"
21
+ },
22
+ shortcuts: {
23
+ type: Array,
24
+ default: () => []
25
+ }
26
+ },
27
+ emits: ["update:modelValue", "update:visible"],
28
+ setup(__props, { emit }) {
29
+ const props = __props;
30
+ const ns = useNamespace("datepicker");
31
+ const { lang } = useLocale();
32
+ const visible = ref(false);
33
+ watch(visible, () => {
34
+ emit("update:visible", visible.value);
35
+ });
36
+ provide("EP_PICKER_BASE", {
37
+ props
38
+ });
39
+ provide(ROOT_PICKER_INJECTION_KEY, {
40
+ slots: {},
41
+ pickerNs: null
42
+ });
43
+ const parsedValue = computed(() => {
44
+ return parseDate(props.modelValue, props.format, lang);
45
+ });
46
+ const emitInput = (input) => {
47
+ if (valueEquals(props.modelValue, input)) {
48
+ return;
49
+ }
50
+ let formatted;
51
+ if (Array.isArray(input)) {
52
+ formatted = input.map((item) => formatter(item, props.format, lang.value));
53
+ } else {
54
+ formatted = formatter(input, props.format, lang.value);
55
+ }
56
+ emit("update:modelValue", formatted);
57
+ };
58
+ const onPick = (date) => {
59
+ let result;
60
+ if (Array.isArray(date)) {
61
+ result = date.map((_) => _.toDate());
62
+ } else {
63
+ result = date ? date.toDate() : date;
64
+ }
65
+ emitInput(result);
66
+ visible.value = false;
67
+ };
68
+ const onClear = () => {
69
+ emit("update:modelValue", "");
70
+ visible.value = false;
71
+ };
72
+ return (_ctx, _cache) => {
73
+ const _component_ElButton = resolveComponent("ElButton");
74
+ const _component_ElTooltip = resolveComponent("ElTooltip");
75
+ return openBlock(), createBlock(_component_ElTooltip, {
76
+ trigger: "click",
77
+ pure: "",
78
+ teleported: "",
79
+ effect: "light",
80
+ role: "dialog",
81
+ transition: `el-zoom-in-top`,
82
+ "fallback-placements": ["bottom", "top", "right", "left"],
83
+ "gpu-acceleration": false,
84
+ "show-arrow": false,
85
+ "stop-popper-mouse-event": false,
86
+ visible: visible.value,
87
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
88
+ "hide-after": 0,
89
+ "popper-class": unref(ns).b(),
90
+ persistent: "",
91
+ "append-to": ".bwa-application"
92
+ }, {
93
+ default: withCtx(() => [
94
+ renderSlot(_ctx.$slots, "default", { visible: visible.value })
95
+ ]),
96
+ content: withCtx(() => [
97
+ createVNode(unref(ElPanelDatePicker), {
98
+ type: "date",
99
+ "parsed-value": unref(parsedValue),
100
+ onPick,
101
+ teleported: false
102
+ }, {
103
+ sidebar: withCtx(() => [
104
+ createElementVNode("div", {
105
+ class: normalizeClass(unref(ns).e("sidebar"))
106
+ }, [
107
+ createVNode(_component_ElButton, {
108
+ size: "small",
109
+ onClick: onClear
110
+ }, {
111
+ default: withCtx(() => [
112
+ createTextVNode("\u6E05\u7A7A")
113
+ ]),
114
+ _: 1
115
+ })
116
+ ], 2)
117
+ ]),
118
+ _: 1
119
+ }, 8, ["parsed-value"])
120
+ ]),
121
+ _: 3
122
+ }, 8, ["visible", "popper-class"]);
123
+ };
124
+ }
125
+ });
126
+ var datePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-picker.vue"]]);
127
+
128
+ export { datePicker as default };
@@ -0,0 +1,177 @@
1
+ import { defineComponent, ref, inject, computed, useSlots, unref, provide, watch, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createElementVNode, normalizeClass, createElementBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode } from 'vue';
2
+ import { useNamespace, filterPanelItemKey, useGlobalConfig } from '@ctzy-web-client/web-base-client-vue';
3
+ import { timePickerDefaultProps, ROOT_PICKER_INJECTION_KEY, useNamespace as useNamespace$1, dayjs, parseDate, valueEquals, formatter } from 'element-plus';
4
+ import PanelDateRange from 'element-plus/es/components/date-picker/src/date-picker-com/panel-date-range';
5
+ import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
6
+
7
+ const __default__ = defineComponent({ name: "BwaDateRange" });
8
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
9
+ props: {
10
+ ...timePickerDefaultProps,
11
+ modelValue: {
12
+ type: null,
13
+ required: true
14
+ }
15
+ },
16
+ emits: ["update:modelValue"],
17
+ setup(__props, { emit }) {
18
+ const props = __props;
19
+ const ns = useNamespace("daterange");
20
+ const pickerVisivle = ref(false);
21
+ const filterPanelItem = inject(filterPanelItemKey);
22
+ const column = computed(() => {
23
+ var _a;
24
+ return (_a = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a : null;
25
+ });
26
+ const slots = useSlots();
27
+ const locale = useGlobalConfig("locale", "ZH");
28
+ const lang = computed(() => unref(locale).name);
29
+ provide(ROOT_PICKER_INJECTION_KEY, {
30
+ slots,
31
+ pickerNs: useNamespace$1("picker-panel")
32
+ });
33
+ provide("EP_PICKER_BASE", {
34
+ props
35
+ });
36
+ watch(
37
+ computed(() => props.modelValue),
38
+ () => {
39
+ if (!props.modelValue || Array.isArray(props.modelValue) || typeof props.modelValue !== "object") {
40
+ emit("update:modelValue", { start: "", end: "" });
41
+ }
42
+ },
43
+ { immediate: true }
44
+ );
45
+ const formatShowTime = (date) => {
46
+ return date ? dayjs(date).format("YYYY-MM-DD") : "";
47
+ };
48
+ const startTime = computed(() => {
49
+ var _a;
50
+ if (!((_a = props.modelValue) == null ? void 0 : _a.start)) {
51
+ return "";
52
+ }
53
+ return dayjs(props.modelValue.start).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss");
54
+ });
55
+ const endTime = computed(() => {
56
+ var _a;
57
+ if (!((_a = props.modelValue) == null ? void 0 : _a.end)) {
58
+ return "";
59
+ }
60
+ return dayjs(props.modelValue.end).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss");
61
+ });
62
+ const formatStartTime = computed(() => formatShowTime(unref(startTime)));
63
+ const formatEndTime = computed(() => formatShowTime(unref(endTime)));
64
+ const dateRangeValue = computed(() => [unref(startTime), unref(endTime)]);
65
+ const valueIsEmpty = computed(() => {
66
+ const value = unref(dateRangeValue);
67
+ return !value || Array.isArray(value) && !value.filter(Boolean).length;
68
+ });
69
+ const parsedValue = computed(() => {
70
+ const { valueFormat } = props;
71
+ const value = unref(dateRangeValue);
72
+ if (!unref(valueIsEmpty)) {
73
+ return value.map((d) => parseDate(d, valueFormat, unref(lang)));
74
+ }
75
+ return [];
76
+ });
77
+ const emitInput = (input) => {
78
+ if (!valueEquals(unref(dateRangeValue), input)) {
79
+ const formatted = input.map(
80
+ (item) => formatter(item, props.valueFormat, unref(lang))
81
+ );
82
+ emit("update:modelValue", {
83
+ start: formatted[0] ? dayjs(formatted[0]).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss") : "",
84
+ end: formatted[1] ? dayjs(formatted[1]).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss") : ""
85
+ });
86
+ }
87
+ };
88
+ const onPick = (date, visible = false) => {
89
+ pickerVisivle.value = visible;
90
+ emitInput(date.map((item) => item.toDate()));
91
+ };
92
+ return (_ctx, _cache) => {
93
+ const _component_CaretBottom = resolveComponent("CaretBottom");
94
+ const _component_ElIcon = resolveComponent("ElIcon");
95
+ const _component_ElTooltip = resolveComponent("ElTooltip");
96
+ return openBlock(), createBlock(_component_ElTooltip, {
97
+ visible: pickerVisivle.value,
98
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => pickerVisivle.value = $event),
99
+ pure: "",
100
+ teleported: "",
101
+ effect: "light",
102
+ role: "dialog",
103
+ transition: `el-zoom-in-top`,
104
+ "fallback-placements": ["bottom", "top", "right", "left"],
105
+ "gpu-acceleration": false,
106
+ "show-arrow": false,
107
+ "stop-popper-mouse-event": false,
108
+ "hide-after": 0,
109
+ persistent: "",
110
+ trigger: "click",
111
+ "append-to": ".bwa-application"
112
+ }, {
113
+ default: withCtx(() => [
114
+ renderSlot(_ctx.$slots, "pct-default", {
115
+ formatStartTime: unref(formatStartTime),
116
+ formatEndTime: unref(formatEndTime)
117
+ }, () => [
118
+ createElementVNode("div", {
119
+ class: normalizeClass([unref(ns).b(), unref(ns).is("active", pickerVisivle.value)])
120
+ }, [
121
+ renderSlot(_ctx.$slots, "label", {}, () => [
122
+ unref(column) ? (openBlock(), createElementBlock("span", {
123
+ key: 0,
124
+ class: normalizeClass(unref(ns).e("label"))
125
+ }, toDisplayString(unref(column).title), 3)) : createCommentVNode("v-if", true)
126
+ ]),
127
+ createElementVNode("span", {
128
+ class: normalizeClass([unref(ns).e("time"), unref(ns).is("empty", !unref(formatStartTime))])
129
+ }, [
130
+ createElementVNode("span", {
131
+ class: normalizeClass(unref(ns).e("content"))
132
+ }, toDisplayString(unref(formatStartTime) ? unref(formatStartTime) : "\u5F00\u59CB\u65E5\u671F"), 3),
133
+ createVNode(_component_ElIcon, {
134
+ class: normalizeClass(unref(ns).e("caret"))
135
+ }, {
136
+ default: withCtx(() => [
137
+ createVNode(_component_CaretBottom)
138
+ ]),
139
+ _: 1
140
+ }, 8, ["class"])
141
+ ], 2),
142
+ createTextVNode(" \uFFFD? "),
143
+ createElementVNode("span", {
144
+ class: normalizeClass([unref(ns).e("time"), unref(ns).is("empty", !unref(formatEndTime))])
145
+ }, [
146
+ createElementVNode("span", {
147
+ class: normalizeClass(unref(ns).e("content"))
148
+ }, toDisplayString(unref(formatEndTime) ? unref(formatEndTime) : "\u7ED3\u675F\u65E5\u671F"), 3),
149
+ createVNode(_component_ElIcon, {
150
+ class: normalizeClass(unref(ns).e("caret"))
151
+ }, {
152
+ default: withCtx(() => [
153
+ createVNode(_component_CaretBottom)
154
+ ]),
155
+ _: 1
156
+ }, 8, ["class"])
157
+ ], 2)
158
+ ], 2)
159
+ ])
160
+ ]),
161
+ content: withCtx(() => [
162
+ createVNode(unref(PanelDateRange), {
163
+ "parsed-value": unref(parsedValue),
164
+ type: "daterange",
165
+ visible: pickerVisivle.value,
166
+ onPick,
167
+ teleported: false
168
+ }, null, 8, ["parsed-value", "visible"])
169
+ ]),
170
+ _: 3
171
+ }, 8, ["visible"]);
172
+ };
173
+ }
174
+ });
175
+ var DateRange = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-range.vue"]]);
176
+
177
+ export { DateRange as default };
@@ -0,0 +1,6 @@
1
+ import { withInstall } from 'element-plus/es/utils/vue/install';
2
+ import DateRange from './date-range.mjs';
3
+
4
+ const BwaDateRange = withInstall(DateRange);
5
+
6
+ export { BwaDateRange, BwaDateRange as default };
@@ -0,0 +1,3 @@
1
+ const dragListContextKey = "DRAG_LIST_CONTEXT_KEY";
2
+
3
+ export { dragListContextKey };
@@ -0,0 +1,49 @@
1
+ import { defineComponent, inject, getCurrentInstance, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot } from 'vue';
2
+ import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
3
+ import { dragListContextKey } from './constants.mjs';
4
+ import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
5
+
6
+ const __default__ = defineComponent({ name: "BwaDragItem" });
7
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
8
+ setup(__props, { expose }) {
9
+ const ns = useNamespace("dragitem");
10
+ ;
11
+ const dragListContext = inject(dragListContextKey);
12
+ const id = dragListContext.nextID();
13
+ const instance = getCurrentInstance();
14
+ const handleMousedown = (event) => {
15
+ if (event.button !== 0) {
16
+ return;
17
+ }
18
+ dragListContext.startDrag(instance.proxy);
19
+ };
20
+ onMounted(() => {
21
+ dragListContext.handleItemCreate(id, instance.proxy);
22
+ });
23
+ onBeforeUnmount(() => {
24
+ dragListContext.handleItemDestroy(id, instance.proxy);
25
+ });
26
+ expose({
27
+ id
28
+ });
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("div", {
31
+ class: normalizeClass(unref(ns).b()),
32
+ "draggable-context-id": "",
33
+ onMousedown: handleMousedown
34
+ }, [
35
+ createElementVNode("i", {
36
+ class: normalizeClass([unref(ns).e("drag-icon"), "ptp-icon", "ptp-buzhou-yidong"])
37
+ }, null, 2),
38
+ createElementVNode("span", {
39
+ class: normalizeClass(unref(ns).e("content"))
40
+ }, [
41
+ renderSlot(_ctx.$slots, "default")
42
+ ], 2)
43
+ ], 34);
44
+ };
45
+ }
46
+ });
47
+ var DragItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "drag-item.vue"]]);
48
+
49
+ export { DragItem as default };