@dfsj/components 3.7.2-alpha.6 → 4.0.0-alpha.1

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 (157) hide show
  1. package/CHANGELOG.md +61 -453
  2. package/README.md +101 -24
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +13 -0
  4. package/dist/components/Boards/src/Boards.vue.js +10 -4
  5. package/dist/components/Boards/src/Boards.vue2.js +10 -152
  6. package/dist/components/Boards/src/hooKs/useStyle.d.ts +13 -5
  7. package/dist/components/Boards/src/hooKs/useStyle.js +10 -104
  8. package/dist/components/Boards/src/props.d.ts +5 -23
  9. package/dist/components/Boards/src/props.js +10 -56
  10. package/dist/components/ClickOutSide/src/ClickOutSide.vue.js +10 -4
  11. package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +10 -25
  12. package/dist/components/Descriptions/src/Descriptions.vue.js +10 -4
  13. package/dist/components/Descriptions/src/Descriptions.vue2.js +10 -150
  14. package/dist/components/Editor/src/Editor.vue.js +10 -4
  15. package/dist/components/Editor/src/Editor.vue2.js +10 -137
  16. package/dist/components/Form/src/Form.vue.js +10 -4
  17. package/dist/components/Form/src/Form.vue2.js +10 -394
  18. package/dist/components/Form/src/components/useRenderCheckbox.js +10 -32
  19. package/dist/components/Form/src/components/useRenderRadio.js +10 -32
  20. package/dist/components/Form/src/components/useRenderSelect.js +10 -51
  21. package/dist/components/Form/src/helper/componentMap.js +10 -32
  22. package/dist/components/Form/src/helper/index.js +10 -108
  23. package/dist/components/Form/src/types/index.d.ts +80 -84
  24. package/dist/components/Form/src/types/index.js +10 -30
  25. package/dist/components/Form/src/useForm.js +10 -289
  26. package/dist/components/Highlight/src/Highlight.vue.js +10 -4
  27. package/dist/components/Highlight/src/Highlight.vue2.js +10 -61
  28. package/dist/components/Icon/src/Icon.vue.js +10 -4
  29. package/dist/components/Icon/src/Icon.vue2.js +10 -122
  30. package/dist/components/Icon/src/SvgIcon.vue.js +10 -6
  31. package/dist/components/Icon/src/SvgIcon.vue2.js +10 -44
  32. package/dist/components/Icon/src/SvgIcon.vue3.js +10 -13
  33. package/dist/components/InputPassword/src/InputPassword.vue.js +10 -4
  34. package/dist/components/InputPassword/src/InputPassword.vue2.js +10 -57
  35. package/dist/components/Modal/src/BasicModal.vue.js +10 -4
  36. package/dist/components/Modal/src/BasicModal.vue2.js +10 -154
  37. package/dist/components/Modal/src/components/ModalFooter.vue.js +10 -4
  38. package/dist/components/Modal/src/components/ModalFooter.vue2.js +10 -39
  39. package/dist/components/Modal/src/components/ModalHeader.vue.js +10 -4
  40. package/dist/components/Modal/src/components/ModalHeader.vue2.js +10 -80
  41. package/dist/components/Modal/src/config.d.ts +3 -2
  42. package/dist/components/Modal/src/config.js +10 -28
  43. package/dist/components/Modal/src/hooks/useModalDrag.js +10 -109
  44. package/dist/components/Modal/src/hooks/useTimeout.js +10 -52
  45. package/dist/components/Modal/src/props.d.ts +16 -56
  46. package/dist/components/Modal/src/props.js +10 -130
  47. package/dist/components/Modal/src/utils/index.js +10 -85
  48. package/dist/components/NodeAxis/src/AbstractNodeProvider.js +10 -21
  49. package/dist/components/NodeAxis/src/CanvasNodeRender.d.ts +3 -12
  50. package/dist/components/NodeAxis/src/CanvasNodeRender.js +10 -411
  51. package/dist/components/NodeAxis/src/NodeAxis.vue.js +10 -4
  52. package/dist/components/NodeAxis/src/NodeAxis.vue2.js +10 -68
  53. package/dist/components/NodeAxis/src/NodeModel.js +10 -62
  54. package/dist/components/NodeAxis/src/NodeRender.js +10 -28
  55. package/dist/components/NodeAxis/src/NullLayerProvider.js +10 -86
  56. package/dist/components/NodeAxis/src/NullProvider.js +10 -65
  57. package/dist/components/NodeAxis/src/TimerNodePlayer.js +10 -148
  58. package/dist/components/NodeAxis/src/config/node-axis.options.js +10 -55
  59. package/dist/components/NodeAxis/src/enum/index.js +10 -19
  60. package/dist/components/NodeAxis/src/utils/assign.js +10 -42
  61. package/dist/components/Stateful/src/State.js +10 -78
  62. package/dist/components/Stateful/src/Stateful.vue.js +10 -4
  63. package/dist/components/Stateful/src/Stateful.vue2.js +10 -52
  64. package/dist/components/Stateful/src/props.d.ts +2 -6
  65. package/dist/components/Stateful/src/props.js +10 -28
  66. package/dist/components/Table/index.d.ts +3 -3
  67. package/dist/components/Table/src/Table.vue.js +10 -4
  68. package/dist/components/Table/src/Table.vue2.js +10 -583
  69. package/dist/components/Table/src/components/ColumnSetting.vue.js +10 -4
  70. package/dist/components/Table/src/components/ColumnSetting.vue2.js +10 -263
  71. package/dist/components/Table/src/components/TableActions.vue.js +10 -4
  72. package/dist/components/Table/src/components/TableActions.vue2.js +10 -107
  73. package/dist/components/Table/src/helper/index.js +10 -10
  74. package/dist/components/Table/src/types/index.d.ts +11 -13
  75. package/dist/components/Table/src/useTable.d.ts +36 -1
  76. package/dist/components/Table/src/useTable.js +10 -283
  77. package/dist/components/UnifyChart/src/ChartToolbox.vue.js +10 -4
  78. package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +10 -82
  79. package/dist/components/UnifyChart/src/UnifyChart.vue.js +10 -4
  80. package/dist/components/UnifyChart/src/UnifyChart.vue2.js +10 -57
  81. package/dist/components/UnifyChart/src/hooks/useLoader.js +10 -92
  82. package/dist/components/UnifyChart/src/hooks/useRender.d.ts +8 -13
  83. package/dist/components/UnifyChart/src/hooks/useRender.js +10 -49
  84. package/dist/components/UnifyChart/src/props.d.ts +13 -59
  85. package/dist/components/UnifyChart/src/props.js +10 -32
  86. package/dist/components/UnifyChart/src/useDownLoad.js +10 -26
  87. package/dist/components/Visual/src/BufferLayerPlayer.js +10 -309
  88. package/dist/components/Visual/src/ResolvableLayerProvider.js +10 -252
  89. package/dist/components/Visual/src/config/default.manager.js +10 -6
  90. package/dist/components/Visual/src/config/default.provider.js +10 -17
  91. package/dist/components/Visual/src/mapping.js +10 -6
  92. package/dist/components/Visual/src/resolvers/IntervalResolver.js +10 -168
  93. package/dist/components/Visual/src/resolvers/tools.resolver.js +10 -151
  94. package/dist/components/Visual/src/utils/NodeMath.js +10 -99
  95. package/dist/components/Windows/src/ModalWrap.vue.js +10 -4
  96. package/dist/components/Windows/src/ModalWrap.vue2.js +10 -132
  97. package/dist/components/Windows/src/Windows.vue.js +10 -6
  98. package/dist/components/Windows/src/Windows.vue2.js +10 -55
  99. package/dist/components/Windows/src/Windows.vue3.js +10 -24
  100. package/dist/components/Windows/src/props.js +10 -8
  101. package/dist/directives/clickOutside.js +10 -70
  102. package/dist/directives/repeatClick.js +10 -28
  103. package/dist/directives/resizable.js +10 -195
  104. package/dist/index.d.ts +0 -1
  105. package/dist/index.js +11 -52
  106. package/dist/index.min.css +3 -3
  107. package/dist/themes/index.js +9 -0
  108. package/dist/types/index.d.ts +3 -3
  109. package/dist/utils/index.js +10 -23
  110. package/package.json +54 -25
  111. package/dist/components/Boards/src/Boards.vue.d.ts +0 -104
  112. package/dist/components/ClickOutSide/src/ClickOutSide.vue.d.ts +0 -7
  113. package/dist/components/Descriptions/src/Descriptions.vue.d.ts +0 -97
  114. package/dist/components/Editor/src/Editor.vue.d.ts +0 -51
  115. package/dist/components/Form/src/Form.vue.d.ts +0 -838
  116. package/dist/components/Highlight/src/Highlight.vue.d.ts +0 -41
  117. package/dist/components/Icon/src/Icon.vue.d.ts +0 -49
  118. package/dist/components/Icon/src/SvgIcon.vue.d.ts +0 -45
  119. package/dist/components/InputPassword/src/InputPassword.vue.d.ts +0 -27
  120. package/dist/components/Modal/src/BasicModal.vue.d.ts +0 -419
  121. package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +0 -86
  122. package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +0 -241
  123. package/dist/components/NodeAxis/src/BCanvasNodeRender.d.ts +0 -19
  124. package/dist/components/NodeAxis/src/BCanvasNodeRender.js +0 -344
  125. package/dist/components/NodeAxis/src/NodeAxis.vue.d.ts +0 -17
  126. package/dist/components/Stateful/src/Stateful.vue.d.ts +0 -22
  127. package/dist/components/Table/src/Table.vue.d.ts +0 -1535
  128. package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +0 -30
  129. package/dist/components/Table/src/components/TableActions.vue.d.ts +0 -229
  130. package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +0 -46
  131. package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +0 -95
  132. package/dist/components/Video/index.d.ts +0 -2
  133. package/dist/components/Video/src/VideoPlayer.vue.d.ts +0 -60
  134. package/dist/components/Video/src/VideoPlayer.vue.js +0 -5
  135. package/dist/components/Video/src/VideoPlayer.vue2.js +0 -107
  136. package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +0 -34
  137. package/dist/components/Video/src/VideoPlayerToolbar.vue.js +0 -5
  138. package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +0 -65
  139. package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +0 -7
  140. package/dist/components/Video/src/abstract/Observable.d.ts +0 -6
  141. package/dist/components/Video/src/abstract/Observable.js +0 -89
  142. package/dist/components/Video/src/abstract/VideoControl.d.ts +0 -32
  143. package/dist/components/Video/src/abstract/VideoControl.js +0 -48
  144. package/dist/components/Video/src/control/DaHua.d.ts +0 -12
  145. package/dist/components/Video/src/control/DaHua.js +0 -154
  146. package/dist/components/Video/src/control/Hikvision.d.ts +0 -28
  147. package/dist/components/Video/src/control/Hikvision.js +0 -249
  148. package/dist/components/Video/src/control/VideoFactory.d.ts +0 -3
  149. package/dist/components/Video/src/control/VideoFactory.js +0 -31
  150. package/dist/components/Video/src/enums/CommonEnum.d.ts +0 -26
  151. package/dist/components/Video/src/enums/CommonEnum.js +0 -31
  152. package/dist/components/Windows/src/ModalWrap.vue.d.ts +0 -14
  153. package/dist/components/Windows/src/Windows.vue.d.ts +0 -21
  154. package/dist/helper/lang.d.ts +0 -1
  155. package/dist/helper/lang.js +0 -546
  156. package/dist/node_modules/.pnpm/@vueuse_core@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/core/index.js +0 -393
  157. package/dist/node_modules/.pnpm/@vueuse_shared@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/shared/index.js +0 -53
@@ -1,264 +1,11 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
- import { defineComponent, ref, watch, unref, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, createCommentVNode } from 'vue';
3
- import { ElDrawer, ElCheckbox, ElText, ElCheckboxGroup, ElRadioGroup, ElRadioButton } from 'element-plus';
4
- import { cloneDeep } from 'lodash-es';
5
- import { DEFAULT_FILTER_COLUMN } from '../helper/index.js';
6
- import { VueDraggable } from 'vue-draggable-plus';
7
- import '../../../Icon/src/Icon.vue.js';
8
- import script$1 from '../../../Icon/src/Icon.vue2.js';
1
+ /**
2
+ *
3
+ * @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
4
+ * 版本: v4.0.0-alpha.1
5
+ * 作者:yangbo <1747837358@qq.com>
6
+ * 日期:2026-07-09 10:11:28
7
+ *
8
+ *
9
+ */
9
10
 
10
- var _hoisted_1 = {
11
- "class": "flex items-center justify-between"
12
- };
13
- var _hoisted_2 = {
14
- "class": "flex items-center justify-between"
15
- };
16
- var _hoisted_3 = {
17
- key: 0
18
- };
19
- var _hoisted_4 = {
20
- "class": "flex items-center"
21
- };
22
- var _hoisted_5 = {
23
- "class": "ml-12px cursor-move handle"
24
- };
25
- var script = defineComponent({
26
- __name: 'ColumnSetting',
27
- props: {
28
- columns: {
29
- type: Array,
30
- "default": function _default() {
31
- return [];
32
- }
33
- },
34
- modelValue: {
35
- type: Boolean,
36
- "default": false
37
- }
38
- },
39
- emits: ['confirm', 'update:modelValue'],
40
- setup: function setup(__props, _ref) {
41
- var __emit = _ref.emit;
42
- var visible = ref(false);
43
- var props = __props;
44
- var emit = __emit;
45
- watch(function () {
46
- return props.modelValue;
47
- }, function (val) {
48
- if (val === unref(visible)) return;
49
- visible.value = val;
50
- }, {
51
- immediate: true
52
- });
53
- watch(function () {
54
- return visible.value;
55
- }, function (val) {
56
- emit('update:modelValue', val);
57
- });
58
- var oldColumns = ref();
59
- var settingColumns = ref();
60
- var hiddenColumns = ref([]);
61
- var defaultCheckColumns = ref([]);
62
- var checkColumns = ref([]);
63
- var checkAll = ref(false);
64
- var isIndeterminate = ref(true);
65
- var handleCheckAllChange = function handleCheckAllChange(val) {
66
- checkColumns.value = val ? unref(defaultCheckColumns) : [];
67
- isIndeterminate.value = false;
68
- };
69
- var handleCheckedColumnsChange = function handleCheckedColumnsChange(value) {
70
- var _unref2, _unref3;
71
- var checkedCount = value.length;
72
- checkAll.value = checkedCount === ((_unref2 = unref(defaultCheckColumns)) === null || _unref2 === void 0 ? void 0 : _unref2.length);
73
- isIndeterminate.value = checkedCount > 0 && checkedCount < ((_unref3 = unref(defaultCheckColumns)) === null || _unref3 === void 0 ? void 0 : _unref3.length);
74
- };
75
- var confirm = function confirm() {
76
- var _cloneDeep;
77
- var newColumns = (_cloneDeep = cloneDeep(unref(settingColumns))) === null || _cloneDeep === void 0 ? void 0 : _cloneDeep.map(function (item) {
78
- var _unref4, _unref5;
79
- var fixed = (_unref4 = unref(settingColumns)) === null || _unref4 === void 0 || (_unref4 = _unref4.find(function (col) {
80
- return col.field === item.field;
81
- })) === null || _unref4 === void 0 ? void 0 : _unref4.fixed;
82
- item.hidden = !!!((_unref5 = unref(checkColumns)) !== null && _unref5 !== void 0 && _unref5.includes(item.field));
83
- item.fixed = fixed ? fixed : undefined;
84
- return item;
85
- });
86
- emit('confirm', [].concat(_toConsumableArray(unref(hiddenColumns)), _toConsumableArray(newColumns || [])));
87
- visible.value = false;
88
- };
89
- var restore = function restore() {
90
- initColumns([].concat(_toConsumableArray(unref(hiddenColumns)), _toConsumableArray(unref(oldColumns) || [])), true);
91
- };
92
- var initColumns = function initColumns(columns) {
93
- var _unref6, _unref7, _unref8, _unref9, _unref0;
94
- var isReStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
95
- var newColumns = columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
96
- if (!isReStore) {
97
- item.fixed = item.fixed !== void 0 ? item.fixed : undefined;
98
- }
99
- return item.type && !DEFAULT_FILTER_COLUMN.includes(item.type) || !item.type;
100
- });
101
- if (!((_unref6 = unref(oldColumns)) !== null && _unref6 !== void 0 && _unref6.length)) {
102
- oldColumns.value = cloneDeep(newColumns);
103
- }
104
- settingColumns.value = cloneDeep(newColumns);
105
- hiddenColumns.value = cloneDeep(columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
106
- return item.type && DEFAULT_FILTER_COLUMN.includes(item.type);
107
- }));
108
- defaultCheckColumns.value = ((_unref7 = unref(settingColumns)) === null || _unref7 === void 0 ? void 0 : _unref7.map(function (item) {
109
- return item.field;
110
- })) || [];
111
- checkColumns.value = ((_unref8 = unref(settingColumns)) === null || _unref8 === void 0 || (_unref8 = _unref8.filter(function (item) {
112
- return !item.hidden;
113
- })) === null || _unref8 === void 0 ? void 0 : _unref8.map(function (item) {
114
- return item.field;
115
- })) || [];
116
- if (((_unref9 = unref(checkColumns)) === null || _unref9 === void 0 ? void 0 : _unref9.length) === ((_unref0 = unref(defaultCheckColumns)) === null || _unref0 === void 0 ? void 0 : _unref0.length)) {
117
- checkAll.value = true;
118
- isIndeterminate.value = false;
119
- }
120
- };
121
- watch(function () {
122
- return props.columns;
123
- }, function (columns) {
124
- initColumns(columns);
125
- }, {
126
- immediate: true,
127
- deep: true
128
- });
129
- return function (_ctx, _cache) {
130
- var _component_ElButton = resolveComponent("ElButton");
131
- return openBlock(), createBlock(unref(ElDrawer), {
132
- modelValue: visible.value,
133
- "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
134
- return visible.value = $event;
135
- }),
136
- title: "列设置",
137
- size: "350px"
138
- }, {
139
- footer: withCtx(function () {
140
- return [createElementVNode("div", null, [createVNode(_component_ElButton, {
141
- onClick: restore
142
- }, {
143
- "default": withCtx(function () {
144
- return _toConsumableArray(_cache[5] || (_cache[5] = [createTextVNode("还原", -1)]));
145
- }),
146
- _: 1
147
- }), createVNode(_component_ElButton, {
148
- type: "primary",
149
- onClick: confirm
150
- }, {
151
- "default": withCtx(function () {
152
- return _toConsumableArray(_cache[6] || (_cache[6] = [createTextVNode("确定", -1)]));
153
- }),
154
- _: 1
155
- })])];
156
- }),
157
- "default": withCtx(function () {
158
- var _settingColumns$value2;
159
- return [createElementVNode("div", null, [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(unref(ElCheckbox), {
160
- modelValue: checkAll.value,
161
- "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
162
- return checkAll.value = $event;
163
- }),
164
- indeterminate: isIndeterminate.value,
165
- onChange: handleCheckAllChange
166
- }, null, 8, ["modelValue", "indeterminate"]), createVNode(unref(ElText), {
167
- "class": "ml-8px!"
168
- }, {
169
- "default": withCtx(function () {
170
- var _settingColumns$value;
171
- return [createTextVNode(toDisplayString(checkColumns.value.length) + " / " + toDisplayString((_settingColumns$value = settingColumns.value) === null || _settingColumns$value === void 0 ? void 0 : _settingColumns$value.length), 1)];
172
- }),
173
- _: 1
174
- })]), createVNode(unref(ElText), null, {
175
- "default": withCtx(function () {
176
- return _toConsumableArray(_cache[4] || (_cache[4] = [createTextVNode("固定 / 排序", -1)]));
177
- }),
178
- _: 1
179
- })]), (_settingColumns$value2 = settingColumns.value) !== null && _settingColumns$value2 !== void 0 && _settingColumns$value2.length ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(VueDraggable), {
180
- modelValue: settingColumns.value,
181
- "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
182
- return settingColumns.value = $event;
183
- }),
184
- target: ".el-checkbox-group",
185
- handle: ".handle",
186
- animation: 150
187
- }, {
188
- "default": withCtx(function () {
189
- return [createVNode(unref(ElCheckboxGroup), {
190
- ref: "draggableWrap",
191
- modelValue: checkColumns.value,
192
- "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
193
- return checkColumns.value = $event;
194
- }),
195
- onChange: handleCheckedColumnsChange
196
- }, {
197
- "default": withCtx(function () {
198
- return [(openBlock(true), createElementBlock(Fragment, null, renderList(settingColumns.value, function (item) {
199
- return openBlock(), createElementBlock("div", {
200
- key: item.field,
201
- "class": "flex items-center justify-between mt-12px"
202
- }, [createVNode(unref(ElCheckbox), {
203
- label: item.field
204
- }, {
205
- "default": withCtx(function () {
206
- return [createTextVNode(toDisplayString(item.label), 1)];
207
- }),
208
- _: 2
209
- }, 1032, ["label"]), createElementVNode("div", _hoisted_4, [createVNode(unref(ElRadioGroup), {
210
- size: "small",
211
- modelValue: item.fixed,
212
- "onUpdate:modelValue": function onUpdateModelValue($event) {
213
- return item.fixed = $event;
214
- }
215
- }, {
216
- "default": withCtx(function () {
217
- return [createVNode(unref(ElRadioButton), {
218
- label: "left"
219
- }, {
220
- "default": withCtx(function () {
221
- return [createVNode(script$1, {
222
- icon: "ep:arrow-left"
223
- })];
224
- }),
225
- _: 1
226
- }), createVNode(unref(ElRadioButton), {
227
- label: undefined
228
- }, {
229
- "default": withCtx(function () {
230
- return [createVNode(script$1, {
231
- icon: "ep:close"
232
- })];
233
- }),
234
- _: 1
235
- }), createVNode(unref(ElRadioButton), {
236
- label: "right"
237
- }, {
238
- "default": withCtx(function () {
239
- return [createVNode(script$1, {
240
- icon: "ep:arrow-right"
241
- })];
242
- }),
243
- _: 1
244
- })];
245
- }),
246
- _: 2
247
- }, 1032, ["modelValue", "onUpdate:modelValue"]), createElementVNode("div", _hoisted_5, [createVNode(script$1, {
248
- icon: "ep:rank"
249
- })])])]);
250
- }), 128))];
251
- }),
252
- _: 1
253
- }, 8, ["modelValue"])];
254
- }),
255
- _: 1
256
- }, 8, ["modelValue"])])) : createCommentVNode("v-if", true)])];
257
- }),
258
- _: 1
259
- }, 8, ["modelValue"]);
260
- };
261
- }
262
- });
263
-
264
- export { script as default };
11
+ import{toConsumableArray as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{defineComponent as l,ref as n,watch as u,unref as t,resolveComponent as o,openBlock as i,createBlock as r,withCtx as a,createElementVNode as d,createVNode as f,createTextVNode as v,toDisplayString as c,createElementBlock as m,Fragment as p,renderList as s,createCommentVNode as g}from"vue";import{ElDrawer as h,ElCheckbox as V,ElText as x,ElCheckboxGroup as y,ElRadioGroup as _,ElRadioButton as b}from"element-plus";import{cloneDeep as j}from"lodash-es";import{DEFAULT_FILTER_COLUMN as k}from"../helper/index.js";import{VueDraggable as C}from"vue-draggable-plus";import"../../../Icon/src/Icon.vue2.js";import U from"../../../Icon/src/Icon.vue.js";var w={class:"flex items-center justify-between"},I={class:"flex items-center justify-between"},B={key:0},z={class:"flex items-center"},A={class:"ml-12px cursor-move handle"},E=l({__name:"ColumnSetting",props:{columns:{type:Array,default:function(){return[]}},modelValue:{type:Boolean,default:!1}},emits:["confirm","update:modelValue"],setup:function(l,E){var H=E.emit,P=n(!1),S=l,W=H;u(function(){return S.modelValue},function(e){e!==t(P)&&(P.value=e)},{immediate:!0}),u(function(){return P.value},function(e){W("update:modelValue",e)});var q=n(),D=n(),F=n([]),G=n([]),J=n([]),K=n(!1),L=n(!0),M=function(e){J.value=e?t(G):[],L.value=!1},N=function(e){var l,n,u=e.length;K.value=u===(null===(l=t(G))||void 0===l?void 0:l.length),L.value=u>0&&u<(null===(n=t(G))||void 0===n?void 0:n.length)},O=function(){var l,n=null===(l=j(t(D)))||void 0===l?void 0:l.map(function(e){var l,n,u=null===(l=t(D))||void 0===l||null===(l=l.find(function(l){return l.field===e.field}))||void 0===l?void 0:l.fixed;return e.hidden=!(null!==(n=t(J))&&void 0!==n&&n.includes(e.field)),e.fixed=u||void 0,e});W("confirm",[].concat(e(t(F)),e(n||[]))),P.value=!1},Q=function(){R([].concat(e(t(F)),e(t(q)||[])),!0)},R=function(e){var l,n,u,o,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=null==e?void 0:e.filter(function(e){return r||(e.fixed=void 0!==e.fixed?e.fixed:void 0),e.type&&!k.includes(e.type)||!e.type});null!==(l=t(q))&&void 0!==l&&l.length||(q.value=j(a)),D.value=j(a),F.value=j(null==e?void 0:e.filter(function(e){return e.type&&k.includes(e.type)})),G.value=(null===(n=t(D))||void 0===n?void 0:n.map(function(e){return e.field}))||[],J.value=(null===(u=t(D))||void 0===u||null===(u=u.filter(function(e){return!e.hidden}))||void 0===u?void 0:u.map(function(e){return e.field}))||[],(null===(o=t(J))||void 0===o?void 0:o.length)===(null===(i=t(G))||void 0===i?void 0:i.length)&&(K.value=!0,L.value=!1)};return u(function(){return S.columns},function(e){R(e)},{immediate:!0,deep:!0}),function(l,n){var u=o("ElButton");return i(),r(t(h),{modelValue:P.value,"onUpdate:modelValue":n[3]||(n[3]=function(e){return P.value=e}),title:"列设置",size:"350px"},{footer:a(function(){return[d("div",null,[f(u,{onClick:Q},{default:a(function(){return e(n[5]||(n[5]=[v("还原",-1)]))}),_:1}),f(u,{type:"primary",onClick:O},{default:a(function(){return e(n[6]||(n[6]=[v("确定",-1)]))}),_:1})])]}),default:a(function(){var l;return[d("div",null,[d("div",w,[d("div",I,[f(t(V),{modelValue:K.value,"onUpdate:modelValue":n[0]||(n[0]=function(e){return K.value=e}),indeterminate:L.value,onChange:M},null,8,["modelValue","indeterminate"]),f(t(x),{class:"ml-8px!"},{default:a(function(){var e;return[v(c(J.value.length)+" / "+c(null===(e=D.value)||void 0===e?void 0:e.length),1)]}),_:1})]),f(t(x),null,{default:a(function(){return e(n[4]||(n[4]=[v("固定 / 排序",-1)]))}),_:1})]),null!==(l=D.value)&&void 0!==l&&l.length?(i(),m("div",B,[f(t(C),{modelValue:D.value,"onUpdate:modelValue":n[2]||(n[2]=function(e){return D.value=e}),target:".el-checkbox-group",handle:".handle",animation:150},{default:a(function(){return[f(t(y),{ref:"draggableWrap",modelValue:J.value,"onUpdate:modelValue":n[1]||(n[1]=function(e){return J.value=e}),onChange:N},{default:a(function(){return[(i(!0),m(p,null,s(D.value,function(e){return i(),m("div",{key:e.field,class:"flex items-center justify-between mt-12px"},[f(t(V),{label:e.field},{default:a(function(){return[v(c(e.label),1)]}),_:2},1032,["label"]),d("div",z,[f(t(_),{size:"small",modelValue:e.fixed,"onUpdate:modelValue":function(l){return e.fixed=l}},{default:a(function(){return[f(t(b),{label:"left"},{default:a(function(){return[f(U,{icon:"ep:arrow-left"})]}),_:1}),f(t(b),{label:void 0},{default:a(function(){return[f(U,{icon:"ep:close"})]}),_:1}),f(t(b),{label:"right"},{default:a(function(){return[f(U,{icon:"ep:arrow-right"})]}),_:1})]}),_:1},8,["modelValue","onUpdate:modelValue"]),d("div",A,[f(U,{icon:"ep:rank"})])])])}),128))]}),_:1},8,["modelValue"])]}),_:1},8,["modelValue"])])):g("v-if",!0)])]}),_:1},8,["modelValue"])}}});export{E as default};
@@ -1,5 +1,11 @@
1
- import script from './TableActions.vue2.js';
1
+ /**
2
+ *
3
+ * @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
4
+ * 版本: v4.0.0-alpha.1
5
+ * 作者:yangbo <1747837358@qq.com>
6
+ * 日期:2026-07-09 10:11:28
7
+ *
8
+ *
9
+ */
2
10
 
3
- script.__file = "src/components/Table/src/components/TableActions.vue";
4
-
5
- export { script as default };
11
+ import e from"./TableActions.vue2.js";e.__file="src/components/Table/src/components/TableActions.vue";export{e as default};
@@ -1,108 +1,11 @@
1
- import { defineComponent, ref, createVNode, Fragment, unref } from 'vue';
2
- import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus';
3
- import '../../../Icon/src/Icon.vue.js';
4
- import '../../../Icon/src/SvgIcon.vue.js';
5
- import './ColumnSetting.vue.js';
6
- import script$1 from './ColumnSetting.vue2.js';
7
- import script$2 from '../../../Icon/src/Icon.vue2.js';
1
+ /**
2
+ *
3
+ * @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
4
+ * 版本: v4.0.0-alpha.1
5
+ * 作者:yangbo <1747837358@qq.com>
6
+ * 日期:2026-07-09 10:11:28
7
+ *
8
+ *
9
+ */
8
10
 
9
- var script = defineComponent({
10
- name: 'TableActions',
11
- components: {
12
- ElDropdown: ElDropdown,
13
- ElDropdownMenu: ElDropdownMenu,
14
- ElDropdownItem: ElDropdownItem,
15
- ColumnSetting: script$1
16
- },
17
- props: {
18
- columns: {
19
- type: Array,
20
- "default": function _default() {
21
- return [];
22
- }
23
- }
24
- },
25
- emits: ['refresh', 'changSize', 'confirm'],
26
- setup: function setup(props, _ref) {
27
- var emit = _ref.emit;
28
- var showSetting = ref(false);
29
- var refresh = function refresh() {
30
- emit('refresh');
31
- };
32
- var size = ref(['default', 'large', 'small']);
33
- var sizeMap = {
34
- "default": '默认',
35
- large: '大',
36
- small: '小'
37
- };
38
- var changSize = function changSize(size) {
39
- emit('changSize', size);
40
- };
41
- var confirm = function confirm(columns) {
42
- emit('confirm', columns);
43
- };
44
- var showColumnSetting = function showColumnSetting() {
45
- showSetting.value = true;
46
- };
47
- return function () {
48
- return createVNode(Fragment, null, [createVNode("div", {
49
- "class": "text-right h-28px flex items-center justify-end"
50
- }, [createVNode("div", {
51
- "title": "\u5237\u65B0",
52
- "class": "w-30px h-20px flex items-center justify-end",
53
- "onClick": refresh
54
- }, [createVNode(script$2, {
55
- "icon": "ant-design:sync-outlined",
56
- "class": "cursor-pointer",
57
- "hover-color": "var(--el-color-primary)"
58
- }, null)]), createVNode(ElDropdown, {
59
- "trigger": "click",
60
- "onCommand": changSize
61
- }, {
62
- "default": function _default() {
63
- return createVNode("div", {
64
- "title": "\u5C3A\u5BF8",
65
- "class": "w-30px h-20px flex items-center justify-end"
66
- }, [createVNode(script$2, {
67
- "icon": "ant-design:column-height-outlined",
68
- "class": "cursor-pointer",
69
- "hover-color": "var(--el-color-primary)"
70
- }, null)]);
71
- },
72
- dropdown: function dropdown() {
73
- return createVNode(ElDropdownMenu, null, {
74
- "default": function _default() {
75
- return unref(size).map(function (v) {
76
- return createVNode(ElDropdownItem, {
77
- "key": v,
78
- "command": v
79
- }, {
80
- "default": function _default() {
81
- return [sizeMap === null || sizeMap === void 0 ? void 0 : sizeMap[v]];
82
- }
83
- });
84
- });
85
- }
86
- });
87
- }
88
- }), createVNode("div", {
89
- "title": "\u5217\u8BBE\u7F6E",
90
- "class": "w-30px h-20px flex items-center justify-end",
91
- "onClick": showColumnSetting
92
- }, [createVNode(script$2, {
93
- "icon": "ant-design:setting-outlined",
94
- "class": "cursor-pointer",
95
- "hover-color": "var(--el-color-primary)"
96
- }, null)])]), createVNode(script$1, {
97
- "modelValue": showSetting.value,
98
- "onUpdate:modelValue": function onUpdateModelValue($event) {
99
- return showSetting.value = $event;
100
- },
101
- "columns": props.columns,
102
- "onConfirm": confirm
103
- }, null)]);
104
- };
105
- }
106
- });
107
-
108
- export { script as default };
11
+ import{defineComponent as n,ref as e,createVNode as o,Fragment as t,unref as r}from"vue";import{ElDropdown as l,ElDropdownMenu as i,ElDropdownItem as u}from"element-plus";import"../../../Icon/src/Icon.vue2.js";import"./ColumnSetting.vue.js";import c from"./ColumnSetting.vue2.js";import s from"../../../Icon/src/Icon.vue.js";var a=n({name:"TableActions",components:{ElDropdown:l,ElDropdownMenu:i,ElDropdownItem:u,ColumnSetting:c},props:{columns:{type:Array,default:function(){return[]}}},emits:["refresh","changSize","confirm"],setup:function(n,a){var m=a.emit,f=e(!1),d=function(){m("refresh")},p=e(["default","large","small"]),v={default:"默认",large:"大",small:"小"},g=function(n){m("changSize",n)},h=function(n){m("confirm",n)},x=function(){f.value=!0};return function(){return o(t,null,[o("div",{class:"text-right h-28px flex items-center justify-end"},[o("div",{title:"刷新",class:"w-30px h-20px flex items-center justify-end",onClick:d},[o(s,{icon:"ant-design:sync-outlined",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null)]),o(l,{trigger:"click",onCommand:g},{default:function(){return o("div",{title:"尺寸",class:"w-30px h-20px flex items-center justify-end"},[o(s,{icon:"ant-design:column-height-outlined",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null)])},dropdown:function(){return o(i,null,{default:function(){return r(p).map(function(n){return o(u,{key:n,command:n},{default:function(){return[null==v?void 0:v[n]]}})})}})}}),o("div",{title:"列设置",class:"w-30px h-20px flex items-center justify-end",onClick:x},[o(s,{icon:"ant-design:setting-outlined",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null)])]),o(c,{modelValue:f.value,"onUpdate:modelValue":function(n){return f.value=n},columns:n.columns,onConfirm:h},null)])}}});export{a as default};
@@ -1,11 +1,11 @@
1
- var setIndex = function setIndex(reserveIndex, index, size, current) {
2
- var newIndex = index + 1;
3
- if (reserveIndex) {
4
- return size * (current - 1) + newIndex;
5
- } else {
6
- return newIndex;
7
- }
8
- };
9
- var DEFAULT_FILTER_COLUMN = ['expand', 'selection'];
1
+ /**
2
+ *
3
+ * @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
4
+ * 版本: v4.0.0-alpha.1
5
+ * 作者:yangbo <1747837358@qq.com>
6
+ * 日期:2026-07-09 10:11:28
7
+ *
8
+ *
9
+ */
10
10
 
11
- export { DEFAULT_FILTER_COLUMN, setIndex };
11
+ var e=function(e,n,r,t){var a=n+1;return e?r*(t-1)+a:a},n=["expand","selection"];export{n as DEFAULT_FILTER_COLUMN,e as setIndex};
@@ -7,26 +7,26 @@ export interface TableColumn {
7
7
  hidden?: boolean;
8
8
  children?: TableColumn[];
9
9
  slots?: {
10
- default?: (...args: any[]) => JSX.Element | JSX.Element[] | null;
11
- header?: (...args: any[]) => JSX.Element | null;
10
+ default?: (...args: unknown[]) => JSX.Element | JSX.Element[] | null;
11
+ header?: (...args: unknown[]) => JSX.Element | null;
12
12
  };
13
13
  index?: number | ((index: number) => number);
14
14
  columnKey?: string;
15
15
  width?: string | number;
16
16
  minWidth?: string | number;
17
17
  fixed?: boolean | 'left' | 'right';
18
- renderHeader?: (...args: any[]) => JSX.Element | null;
19
- sortMethod?: (...args: any[]) => number;
20
- sortBy?: string | string[] | ((...args: any[]) => string | string[]);
18
+ renderHeader?: (...args: unknown[]) => JSX.Element | null;
19
+ sortMethod?: (...args: unknown[]) => number;
20
+ sortBy?: string | string[] | ((...args: unknown[]) => string | string[]);
21
21
  sortOrders?: (string | null)[];
22
22
  resizable?: boolean;
23
- formatter?: (...args: any[]) => any;
23
+ formatter?: (...args: unknown[]) => unknown;
24
24
  showOverflowTooltip?: boolean;
25
25
  align?: 'left' | 'center' | 'right';
26
26
  headerAlign?: 'left' | 'center' | 'right';
27
27
  className?: string;
28
28
  labelClassName?: string;
29
- selectable?: (...args: any[]) => boolean;
29
+ selectable?: (...args: unknown[]) => boolean;
30
30
  reserveSelection?: boolean;
31
31
  filters?: Array<{
32
32
  text: string;
@@ -34,15 +34,13 @@ export interface TableColumn {
34
34
  }>;
35
35
  filterPlacement?: string;
36
36
  filterMultiple?: boolean;
37
- filterMethod?: (...args: any[]) => boolean;
37
+ filterMethod?: (...args: unknown[]) => boolean;
38
38
  filteredValue?: string[];
39
- [key: string]: any;
40
39
  }
41
40
  export interface TableSlotDefault {
42
41
  row: Recordable;
43
42
  column: TableColumn;
44
43
  $index: number;
45
- [key: string]: any;
46
44
  }
47
45
  export interface Pagination {
48
46
  small?: boolean;
@@ -65,9 +63,9 @@ export interface Pagination {
65
63
  export interface TableSetProps {
66
64
  field: string;
67
65
  path: string;
68
- value: any;
66
+ value: unknown;
69
67
  }
70
- export interface TableProps extends Omit<Partial<ElTableProps<any[]>>, 'data'> {
68
+ export interface TableProps extends Omit<Partial<ElTableProps<unknown[]>>, 'data'> {
71
69
  pageSize?: number;
72
70
  currentPage?: number;
73
71
  showAction?: boolean;
@@ -83,5 +81,5 @@ export interface TableProps extends Omit<Partial<ElTableProps<any[]>>, 'data'> {
83
81
  imagePreview?: string[];
84
82
  videoPreview?: string[];
85
83
  sortable?: boolean;
86
- data?: Recordable;
84
+ data?: Recordable[];
87
85
  }
@@ -1 +1,36 @@
1
- export declare const useTable: any;
1
+ import { Table, TableColumn, TableExpose, TableProps, TableSetProps } from '../index';
2
+ import { type Ref } from 'vue';
3
+ import { Recordable } from '../../../types';
4
+ interface FetchDataResult<T = Recordable> {
5
+ list: T[];
6
+ total?: number;
7
+ }
8
+ export interface UseTableConfig<T = Recordable> {
9
+ immediate?: boolean;
10
+ fetchDataApi: () => Promise<FetchDataResult<T>>;
11
+ fetchDelApi?: () => Promise<boolean>;
12
+ }
13
+ export interface TableState<T = Recordable> {
14
+ currentPage: Ref<number>;
15
+ pageSize: Ref<number>;
16
+ total: Ref<number>;
17
+ dataList: Ref<T[]>;
18
+ loading: Ref<boolean>;
19
+ }
20
+ export interface TableMethods<T = Recordable> {
21
+ getList: () => Promise<void>;
22
+ setProps: (props: TableProps) => Promise<void>;
23
+ setColumn: (columnProps: TableSetProps[]) => Promise<void>;
24
+ addColumn: (tableColumn: TableColumn, index?: number) => Promise<void>;
25
+ delColumn: (field: string) => Promise<void>;
26
+ getElTableExpose: () => Promise<any | undefined>;
27
+ refresh: () => void;
28
+ delList: (idsLength: number) => Promise<void>;
29
+ }
30
+ export interface UseTableReturn<T = Recordable> {
31
+ tableRegister: (ref: typeof Table & TableExpose, elRef: any) => void;
32
+ tableMethods: TableMethods<T>;
33
+ tableState: TableState<T>;
34
+ }
35
+ export declare const useTable: <T = Recordable>(config: UseTableConfig<T>) => UseTableReturn<T>;
36
+ export {};