@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,284 +1,11 @@
1
- import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
2
- import _regeneratorRuntime from '@babel/runtime/regenerator';
3
- import { ElMessageBox, ElMessage } from 'element-plus';
4
- import { ref, watch, unref, onMounted, nextTick } from 'vue';
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
+ */
5
10
 
6
- var t = function t(v) {
7
- return v;
8
- };
9
- var useTable = function useTable(config) {
10
- var _config$immediate = config.immediate,
11
- immediate = _config$immediate === void 0 ? true : _config$immediate;
12
- var loading = ref(false);
13
- var currentPage = ref(1);
14
- var pageSize = ref(10);
15
- var total = ref(0);
16
- var dataList = ref([]);
17
- watch(function () {
18
- return currentPage.value;
19
- }, function () {
20
- methods.getList();
21
- });
22
- watch(function () {
23
- return pageSize.value;
24
- }, function () {
25
- if (unref(currentPage) === 1) {
26
- methods.getList();
27
- } else {
28
- currentPage.value = 1;
29
- methods.getList();
30
- }
31
- });
32
- onMounted(function () {
33
- if (immediate) {
34
- methods.getList();
35
- }
36
- });
37
- var tableRef = ref();
38
- var elTableRef = ref();
39
- var register = function register(ref, elRef) {
40
- tableRef.value = ref;
41
- elTableRef.value = unref(elRef);
42
- };
43
- var getTable = /*#__PURE__*/function () {
44
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
45
- var table;
46
- return _regeneratorRuntime.wrap(function (_context) {
47
- while (1) switch (_context.prev = _context.next) {
48
- case 0:
49
- _context.next = 1;
50
- return nextTick();
51
- case 1:
52
- table = unref(tableRef);
53
- if (!table) {
54
- console.error('The table is not registered. Please use the register method to register');
55
- }
56
- return _context.abrupt("return", table);
57
- case 2:
58
- case "end":
59
- return _context.stop();
60
- }
61
- }, _callee);
62
- }));
63
- return function getTable() {
64
- return _ref.apply(this, arguments);
65
- };
66
- }();
67
- var methods = {
68
- getList: function () {
69
- var _getList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
70
- var res;
71
- return _regeneratorRuntime.wrap(function (_context2) {
72
- while (1) switch (_context2.prev = _context2.next) {
73
- case 0:
74
- loading.value = true;
75
- _context2.prev = 1;
76
- _context2.next = 2;
77
- return config === null || config === void 0 ? void 0 : config.fetchDataApi();
78
- case 2:
79
- res = _context2.sent;
80
- console.log('fetchDataApi res', res);
81
- if (res) {
82
- dataList.value = res.list;
83
- total.value = res.total || 0;
84
- }
85
- _context2.next = 4;
86
- break;
87
- case 3:
88
- _context2.prev = 3;
89
- _context2["catch"](1);
90
- console.log('fetchDataApi error');
91
- case 4:
92
- _context2.prev = 4;
93
- loading.value = false;
94
- return _context2.finish(4);
95
- case 5:
96
- case "end":
97
- return _context2.stop();
98
- }
99
- }, _callee2, null, [[1, 3, 4, 5]]);
100
- }));
101
- function getList() {
102
- return _getList.apply(this, arguments);
103
- }
104
- return getList;
105
- }(),
106
- setProps: function () {
107
- var _setProps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
108
- var props,
109
- table,
110
- _args3 = arguments;
111
- return _regeneratorRuntime.wrap(function (_context3) {
112
- while (1) switch (_context3.prev = _context3.next) {
113
- case 0:
114
- props = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
115
- _context3.next = 1;
116
- return getTable();
117
- case 1:
118
- table = _context3.sent;
119
- table === null || table === void 0 || table.setProps(props);
120
- case 2:
121
- case "end":
122
- return _context3.stop();
123
- }
124
- }, _callee3);
125
- }));
126
- function setProps() {
127
- return _setProps.apply(this, arguments);
128
- }
129
- return setProps;
130
- }(),
131
- setColumn: function () {
132
- var _setColumn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(columnProps) {
133
- var table;
134
- return _regeneratorRuntime.wrap(function (_context4) {
135
- while (1) switch (_context4.prev = _context4.next) {
136
- case 0:
137
- _context4.next = 1;
138
- return getTable();
139
- case 1:
140
- table = _context4.sent;
141
- table === null || table === void 0 || table.setColumn(columnProps);
142
- case 2:
143
- case "end":
144
- return _context4.stop();
145
- }
146
- }, _callee4);
147
- }));
148
- function setColumn(_x) {
149
- return _setColumn.apply(this, arguments);
150
- }
151
- return setColumn;
152
- }(),
153
- addColumn: function () {
154
- var _addColumn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(tableColumn, index) {
155
- var table;
156
- return _regeneratorRuntime.wrap(function (_context5) {
157
- while (1) switch (_context5.prev = _context5.next) {
158
- case 0:
159
- _context5.next = 1;
160
- return getTable();
161
- case 1:
162
- table = _context5.sent;
163
- table === null || table === void 0 || table.addColumn(tableColumn, index);
164
- case 2:
165
- case "end":
166
- return _context5.stop();
167
- }
168
- }, _callee5);
169
- }));
170
- function addColumn(_x2, _x3) {
171
- return _addColumn.apply(this, arguments);
172
- }
173
- return addColumn;
174
- }(),
175
- delColumn: function () {
176
- var _delColumn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(field) {
177
- var table;
178
- return _regeneratorRuntime.wrap(function (_context6) {
179
- while (1) switch (_context6.prev = _context6.next) {
180
- case 0:
181
- _context6.next = 1;
182
- return getTable();
183
- case 1:
184
- table = _context6.sent;
185
- table === null || table === void 0 || table.delColumn(field);
186
- case 2:
187
- case "end":
188
- return _context6.stop();
189
- }
190
- }, _callee6);
191
- }));
192
- function delColumn(_x4) {
193
- return _delColumn.apply(this, arguments);
194
- }
195
- return delColumn;
196
- }(),
197
- getElTableExpose: function () {
198
- var _getElTableExpose = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
199
- return _regeneratorRuntime.wrap(function (_context7) {
200
- while (1) switch (_context7.prev = _context7.next) {
201
- case 0:
202
- _context7.next = 1;
203
- return getTable();
204
- case 1:
205
- return _context7.abrupt("return", unref(elTableRef));
206
- case 2:
207
- case "end":
208
- return _context7.stop();
209
- }
210
- }, _callee7);
211
- }));
212
- function getElTableExpose() {
213
- return _getElTableExpose.apply(this, arguments);
214
- }
215
- return getElTableExpose;
216
- }(),
217
- refresh: function refresh() {
218
- methods.getList();
219
- },
220
- delList: function () {
221
- var _delList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(idsLength) {
222
- var fetchDelApi;
223
- return _regeneratorRuntime.wrap(function (_context9) {
224
- while (1) switch (_context9.prev = _context9.next) {
225
- case 0:
226
- fetchDelApi = config.fetchDelApi;
227
- if (fetchDelApi) {
228
- _context9.next = 1;
229
- break;
230
- }
231
- console.warn('fetchDelApi is undefined');
232
- return _context9.abrupt("return");
233
- case 1:
234
- ElMessageBox.confirm(t('common.delMessage'), t('common.delWarning'), {
235
- confirmButtonText: t('common.delOk'),
236
- cancelButtonText: t('common.delCancel'),
237
- type: 'warning'
238
- }).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
239
- var res, current;
240
- return _regeneratorRuntime.wrap(function (_context8) {
241
- while (1) switch (_context8.prev = _context8.next) {
242
- case 0:
243
- _context8.next = 1;
244
- return fetchDelApi();
245
- case 1:
246
- res = _context8.sent;
247
- if (res) {
248
- ElMessage.success(t('common.delSuccess'));
249
- current = unref(total) % unref(pageSize) === idsLength || unref(pageSize) === 1 ? unref(currentPage) > 1 ? unref(currentPage) - 1 : unref(currentPage) : unref(currentPage);
250
- currentPage.value = current;
251
- methods.getList();
252
- }
253
- case 2:
254
- case "end":
255
- return _context8.stop();
256
- }
257
- }, _callee8);
258
- })));
259
- case 2:
260
- case "end":
261
- return _context9.stop();
262
- }
263
- }, _callee9);
264
- }));
265
- function delList(_x5) {
266
- return _delList.apply(this, arguments);
267
- }
268
- return delList;
269
- }()
270
- };
271
- return {
272
- tableRegister: register,
273
- tableMethods: methods,
274
- tableState: {
275
- currentPage: currentPage,
276
- pageSize: pageSize,
277
- total: total,
278
- dataList: dataList,
279
- loading: loading
280
- }
281
- };
282
- };
283
-
284
- export { useTable };
11
+ import{asyncToGenerator as n,regenerator as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{ElMessageBox as t,ElMessage as r}from"element-plus";import{ref as u,watch as a,unref as o,onMounted as c,nextTick as i}from"vue";var s=function(n){return n},l=function(l){var f=l.immediate,m=void 0===f||f,p=u(!1),v=u(1),h=u(10),d=u(0),g=u([]);a(function(){return v.value},function(){k.getList()}),a(function(){return h.value},function(){1===o(v)||(v.value=1),k.getList()}),c(function(){m&&k.getList()});var w,b,y,L,T,C,P,x=u(),A=u(),D=function(){var t=n(e().m(function n(){var t;return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,i();case 1:return(t=o(x))||console.error("[useTable] The table is not registered. Please use the register method to register"),n.a(2,t)}},n)}));return function(){return t.apply(this,arguments)}}(),k={getList:(P=n(e().m(function n(){var t,r;return e().w(function(n){for(;;)switch(n.p=n.n){case 0:return p.value=!0,n.p=1,n.n=2,null==l?void 0:l.fetchDataApi();case 2:(t=n.v)&&(g.value=t.list,d.value=t.total||0),n.n=4;break;case 3:n.p=3,r=n.v,console.error("[useTable] fetchDataApi error:",r);case 4:return n.p=4,p.value=!1,n.f(4);case 5:return n.a(2)}},n,null,[[1,3,4,5]])})),function(){return P.apply(this,arguments)}),setProps:(C=n(e().m(function n(){var t,r,u=arguments;return e().w(function(n){for(;;)switch(n.n){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},n.n=1,D();case 1:null==(r=n.v)||r.setProps(t);case 2:return n.a(2)}},n)})),function(){return C.apply(this,arguments)}),setColumn:(T=n(e().m(function n(t){var r;return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,D();case 1:null==(r=n.v)||r.setColumn(t);case 2:return n.a(2)}},n)})),function(n){return T.apply(this,arguments)}),addColumn:(L=n(e().m(function n(t,r){var u;return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,D();case 1:null==(u=n.v)||u.addColumn(t,r);case 2:return n.a(2)}},n)})),function(n,e){return L.apply(this,arguments)}),delColumn:(y=n(e().m(function n(t){var r;return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,D();case 1:null==(r=n.v)||r.delColumn(t);case 2:return n.a(2)}},n)})),function(n){return y.apply(this,arguments)}),getElTableExpose:(b=n(e().m(function n(){return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,D();case 1:return n.a(2,o(A))}},n)})),function(){return b.apply(this,arguments)}),refresh:function(){k.getList()},delList:(w=n(e().m(function u(a){var c;return e().w(function(u){for(;;)switch(u.n){case 0:if(c=l.fetchDelApi){u.n=1;break}return console.warn("[useTable] fetchDelApi is undefined"),u.a(2);case 1:t.confirm(s("common.delMessage"),s("common.delWarning"),{confirmButtonText:s("common.delOk"),cancelButtonText:s("common.delCancel"),type:"warning"}).then(n(e().m(function n(){var t;return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,c();case 1:n.v&&(r.success(s("common.delSuccess")),t=(o(d)%o(h)===a||1===o(h))&&o(v)>1?o(v)-1:o(v),v.value=t,k.getList());case 2:return n.a(2)}},n)})));case 2:return u.a(2)}},u)})),function(n){return w.apply(this,arguments)})};return{tableRegister:function(n,e){x.value=n,A.value=o(e)},tableMethods:k,tableState:{currentPage:v,pageSize:h,total:d,dataList:g,loading:p}}};export{l as useTable};
@@ -1,5 +1,11 @@
1
- import script from './ChartToolbox.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/UnifyChart/src/ChartToolbox.vue";
4
-
5
- export { script as default };
11
+ import{defineComponent as o,ref as i,toRefs as l,openBlock as n,createElementBlock as e,normalizeClass as t,unref as c,createVNode as r,createCommentVNode as a,createBlock as s,renderSlot as u}from"vue";import{toolboxProps as f,EToolbox as d}from"./props.js";import"../../Icon/src/Icon.vue2.js";import{isEmpty as v}from"@dfsj/utils";import{useDownLoad as m}from"./useDownLoad.js";import p from"../../Icon/src/Icon.vue.js";var k={key:0},z={key:1},b={key:2},g="dfsj-chart-toolbox",h=o({__name:"ChartToolbox",props:f,setup:function(o){var f=o,h=i(!1),j=l(f),w=j.iconSize,y=j.toolbox,x=f.toggleStatistic,C=f.toggleTable,I=f.instance;function _(o){h.value=!h.value,C()}function S(o){x()}function T(o){(0,m(I).downloadImg)({backgroundColor:"#000"})}var D=function(o){var i;return null==y||null===(i=y.value)||void 0===i?void 0:i.includes(o)};return function(o,i){return n(),e("div",{class:t("".concat(g," h-full w-full min-h-0 min-w-0 relative"))},[c(v)(c(y))?a("v-if",!0):(n(),e("div",{key:0,class:t("".concat(g,"__tools flex justify-end cursor-pointer gap-10px absolute top-0 right-0"))},[D(c(d).Download)?(n(),e("div",k,[r(c(p),{color:"#f2973d",onClick:T,size:c(w),icon:"mdi:cloud-arrow-down"},null,8,["size"])])):a("v-if",!0),D(c(d).Statistic)?(n(),e("div",z,[r(c(p),{color:"#0885ec",onClick:S,size:c(w),icon:"mdi:chart-arc"},null,8,["size"])])):a("v-if",!0),D(c(d).Table)?(n(),e("div",b,[h.value?(n(),s(c(p),{key:0,color:"#4caf50",onClick:_,size:c(w),icon:"mdi:chart-line"},null,8,["size"])):(n(),s(c(p),{key:1,color:"#4caf50",onClick:_,size:c(w),icon:"mdi:table"},null,8,["size"]))])):a("v-if",!0)],2)),u(o.$slots,"default")],2)}}});export{h as default};
@@ -1,83 +1,11 @@
1
- import { normalizeClass, defineComponent, ref, toRefs, openBlock, createElementBlock, unref, createVNode, createCommentVNode, createBlock, renderSlot } from 'vue';
2
- import { toolboxProps, EToolbox } from './props.js';
3
- import '../../Icon/src/Icon.vue.js';
4
- import '../../Icon/src/SvgIcon.vue.js';
5
- import { isEmpty } from '@dfsj/utils';
6
- import { useDownLoad } from './useDownLoad.js';
7
- 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
+ */
8
10
 
9
- var _hoisted_1 = {
10
- key: 0,
11
- "class": normalizeClass("tools-container absolute top-0 right-0")
12
- };
13
- var _hoisted_2 = {
14
- key: 0
15
- };
16
- var _hoisted_3 = {
17
- key: 1
18
- };
19
- var _hoisted_4 = {
20
- key: 2
21
- };
22
- var prefixCls = 'ec-chart-toolbox-wrap';
23
- var script = defineComponent({
24
- __name: 'ChartToolbox',
25
- props: toolboxProps,
26
- setup: function setup(__props) {
27
- var props = __props;
28
- var isOpenTable = ref(false);
29
- var _toRefs = toRefs(props),
30
- iconSize = _toRefs.iconSize,
31
- toolbox = _toRefs.toolbox;
32
- var toggleStatistic = props.toggleStatistic,
33
- toggleTable = props.toggleTable,
34
- getInstance = props.instance;
35
- function handleTable(ev) {
36
- isOpenTable.value = !isOpenTable.value;
37
- toggleTable();
38
- }
39
- function handleStatistic(ev) {
40
- toggleStatistic();
41
- }
42
- function handleDownload(ev) {
43
- var _useDownLoad = useDownLoad(getInstance),
44
- downloadImg = _useDownLoad.downloadImg;
45
- downloadImg({
46
- backgroundColor: '#000'
47
- });
48
- }
49
- var hasTool = function hasTool(tool) {
50
- var _toolbox$value;
51
- return toolbox === null || toolbox === void 0 || (_toolbox$value = toolbox.value) === null || _toolbox$value === void 0 ? void 0 : _toolbox$value.includes(tool);
52
- };
53
- return function (_ctx, _cache) {
54
- return openBlock(), createElementBlock("div", {
55
- "class": normalizeClass("".concat(prefixCls, " h-full w-full relative"))
56
- }, [!unref(isEmpty)(unref(toolbox)) ? (openBlock(), createElementBlock("div", _hoisted_1, [hasTool(unref(EToolbox).Download) ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(script$1), {
57
- color: '#f2973d',
58
- onClick: handleDownload,
59
- size: unref(iconSize),
60
- icon: 'mdi:cloud-arrow-down'
61
- }, null, 8, ["size"])])) : createCommentVNode("v-if", true), hasTool(unref(EToolbox).Statistic) ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(script$1), {
62
- color: '#0885ec',
63
- onClick: handleStatistic,
64
- size: unref(iconSize),
65
- icon: 'mdi:chart-arc'
66
- }, null, 8, ["size"])])) : createCommentVNode("v-if", true), hasTool(unref(EToolbox).Table) ? (openBlock(), createElementBlock("div", _hoisted_4, [isOpenTable.value ? (openBlock(), createBlock(unref(script$1), {
67
- key: 0,
68
- color: '#4caf50',
69
- onClick: handleTable,
70
- size: unref(iconSize),
71
- icon: 'mdi:chart-line'
72
- }, null, 8, ["size"])) : (openBlock(), createBlock(unref(script$1), {
73
- key: 1,
74
- color: '#4caf50',
75
- onClick: handleTable,
76
- size: unref(iconSize),
77
- icon: 'mdi:table'
78
- }, null, 8, ["size"]))])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 2);
79
- };
80
- }
81
- });
82
-
83
- export { script as default };
11
+ import o from"./ChartToolbox.vue.js";o.__file="src/components/UnifyChart/src/ChartToolbox.vue";export{o as default};
@@ -1,5 +1,11 @@
1
- import script from './UnifyChart.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/UnifyChart/src/UnifyChart.vue";
4
-
5
- export { script as default };
11
+ import r from"./UnifyChart.vue2.js";r.__file="src/components/UnifyChart/src/UnifyChart.vue";export{r as default};
@@ -1,58 +1,11 @@
1
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import { defineComponent, ref, toRefs, computed, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, unref, createElementVNode, normalizeStyle } from 'vue';
3
- import './ChartToolbox.vue.js';
4
- import { useRender } from './hooks/useRender.js';
5
- import { unifyChartProps } from './props.js';
6
- import '../../Stateful/src/Stateful.vue.js';
7
- import script$1 from '../../Stateful/src/Stateful.vue2.js';
8
- import script$2 from './ChartToolbox.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
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- var script = defineComponent({
13
- __name: 'UnifyChart',
14
- props: unifyChartProps,
15
- setup: function setup(__props, _ref) {
16
- var __expose = _ref.expose;
17
- var chartRef = ref(null);
18
- var props = __props;
19
- var _toRefs = toRefs(props),
20
- data = _toRefs.data;
21
- _toRefs.stateful;
22
- var compState = computed(function () {
23
- var _props$stateful;
24
- return (_props$stateful = props.stateful) === null || _props$stateful === void 0 ? void 0 : _props$stateful.stringify;
25
- });
26
- var chartHooks = props.chartHooks,
27
- convert = props.convert;
28
- var _useRender = useRender(_objectSpread(_objectSpread({}, chartHooks(chartRef)), convert), data, props.toolbox),
29
- getBindValue = _useRender.getBindValue;
30
- __expose({
31
- getBindValue: getBindValue
32
- });
33
- return function (_ctx, _cache) {
34
- return openBlock(), createBlock(script$1, {
35
- value: compState.value
36
- }, {
37
- "default": withCtx(function () {
38
- return [createVNode(script$2, normalizeProps(guardReactiveProps(unref(getBindValue))), {
39
- "default": withCtx(function () {
40
- return [createElementVNode("div", {
41
- ref_key: "chartRef",
42
- ref: chartRef,
43
- style: normalizeStyle({
44
- height: props.height,
45
- width: props.width
46
- })
47
- }, null, 4)];
48
- }),
49
- _: 1
50
- }, 16)];
51
- }),
52
- _: 1
53
- }, 8, ["value"]);
54
- };
55
- }
56
- });
57
-
58
- export { script as default };
11
+ import{objectSpread2 as t}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{defineComponent as e,ref as r,toRefs as o,computed as u,openBlock as a,createBlock as l,withCtx as i,createVNode as n,normalizeProps as f,guardReactiveProps as s,unref as p,createElementVNode as v,normalizeStyle as m}from"vue";import"./ChartToolbox.vue2.js";import{useRender as d}from"./hooks/useRender.js";import{unifyChartProps as h}from"./props.js";import"../../Stateful/src/Stateful.vue.js";import c from"../../Stateful/src/Stateful.vue2.js";import j from"./ChartToolbox.vue.js";var _=e({__name:"UnifyChart",props:h,setup:function(e,h){var _=h.expose,g=r(null),b=e,x=o(b),S=x.data;x.stateful;var y=u(function(){var t;return null===(t=b.stateful)||void 0===t?void 0:t.stringify}),k=b.chartHooks,B=b.convert,C=d(t(t({},k(g)),B),S,b.toolbox).getBindValue;return _({getBindValue:C}),function(t,e){return a(),l(c,{value:y.value},{default:i(function(){return[n(j,f(s(p(C))),{default:i(function(){return[v("div",{ref_key:"chartRef",ref:g,style:m({height:b.height,width:b.width})},null,4)]}),_:1},16)]}),_:1},8,["value"])}}});export{_ as default};
@@ -1,93 +1,11 @@
1
- import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
2
- import _regeneratorRuntime from '@babel/runtime/regenerator';
3
- import { ref, getCurrentInstance, watch, onMounted } from 'vue';
4
- import '../../../Stateful/src/props.js';
5
- import State, { StateEnum } from '../../../Stateful/src/State.js';
6
- import '../../../Stateful/src/Stateful.vue.js';
7
- import { isEmpty, isNullOrUnDef } from '@dfsj/utils';
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
- function useLoader(props, _ref) {
10
- var _ref$immediate = _ref.immediate,
11
- immediate = _ref$immediate === void 0 ? true : _ref$immediate,
12
- _ref$condition = _ref.condition,
13
- condition = _ref$condition === void 0 ? {} : _ref$condition,
14
- _ref$watchCondition = _ref.watchCondition,
15
- watchCondition = _ref$watchCondition === void 0 ? true : _ref$watchCondition;
16
- var datasource = ref();
17
- var stateful = new State(datasource.value != null ? StateEnum.FULL : StateEnum.NONE);
18
- var ins = getCurrentInstance();
19
- watch(function () {
20
- return stateful.state;
21
- }, function (value) {
22
- if (ins !== null && ins !== void 0 && ins.emit) {
23
- ins.emit('update:loading', stateful.isLoading);
24
- }
25
- }, {
26
- immediate: true,
27
- deep: true
28
- });
29
- watchCondition && !isEmpty(condition) && watch(function () {
30
- return condition;
31
- }, function () {
32
- fetchData();
33
- }, {
34
- deep: true
35
- });
36
- var fetchData = /*#__PURE__*/function () {
37
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
- var _props$options;
39
- var result, empty;
40
- return _regeneratorRuntime.wrap(function (_context) {
41
- while (1) switch (_context.prev = _context.next) {
42
- case 0:
43
- stateful.loading();
44
- if (!((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.loader)) {
45
- _context.next = 5;
46
- break;
47
- }
48
- _context.prev = 1;
49
- _context.next = 2;
50
- return props.options.loader({
51
- target: props.target,
52
- condition: condition
53
- });
54
- case 2:
55
- result = _context.sent;
56
- if (!isNullOrUnDef(result) && !isEmpty(result)) {
57
- datasource.value = result;
58
- } else {
59
- datasource.value = null;
60
- }
61
- _context.next = 4;
62
- break;
63
- case 3:
64
- _context.prev = 3;
65
- _context["catch"](1);
66
- stateful.error();
67
- datasource.value = null;
68
- case 4:
69
- _context.prev = 4;
70
- empty = isNullOrUnDef(datasource.value) || isEmpty(datasource.value);
71
- stateful.completed(empty);
72
- return _context.finish(4);
73
- case 5:
74
- case "end":
75
- return _context.stop();
76
- }
77
- }, _callee, null, [[1, 3, 4, 5]]);
78
- }));
79
- return function fetchData() {
80
- return _ref2.apply(this, arguments);
81
- };
82
- }();
83
- immediate && onMounted(function () {
84
- fetchData();
85
- });
86
- return {
87
- datasource: datasource,
88
- fetchData: fetchData,
89
- stateful: stateful
90
- };
91
- }
92
-
93
- export { useLoader };
11
+ import{asyncToGenerator as e,regenerator as t}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{ref as n,getCurrentInstance as r,watch as o,onMounted as a}from"vue";import i,{StateEnum as u}from"../../../Stateful/src/State.js";import{isEmpty as l,isNullOrUnDef as c}from"@dfsj/utils";function s(s,f){var d=f.immediate,p=void 0===d||d,v=f.condition,m=void 0===v?{}:v,g=f.watchCondition,h=void 0===g||g,w=n(),b=new i(null!=w.value?u.FULL:u.NONE),j=r();o(function(){return b.state},function(e){null!=j&&j.emit&&j.emit("update:loading",b.isLoading)},{immediate:!0,deep:!0}),h&&!l(m)&&o(function(){return m},function(){L()},{deep:!0});var L=function(){var n=e(t().m(function e(){var n,r,o;return t().w(function(e){for(;;)switch(e.p=e.n){case 0:if(b.loading(),null===(n=s.options)||void 0===n||!n.loader){e.n=5;break}return e.p=1,e.n=2,s.options.loader({target:s.target,condition:m});case 2:r=e.v,c(r)||l(r)?w.value=null:w.value=r,e.n=4;break;case 3:e.p=3,e.v,b.error(),w.value=null;case 4:return e.p=4,o=c(w.value)||l(w.value),b.completed(o),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return n.apply(this,arguments)}}();return p&&a(function(){L()}),{datasource:w,fetchData:L,stateful:b}}export{s as useLoader};
@@ -1,23 +1,18 @@
1
1
  import { Ref } from 'vue';
2
+ import type { IChartHook } from '@dfsj/echarts';
2
3
  import { IToolbox } from '../props';
3
- type EChartsType = object | any;
4
- export interface RenderConfig {
5
- setOptions: Function;
6
- echarts: EChartsType;
7
- createOptions: Function;
8
- getInstance: Function;
9
- assemble: Function;
10
- toggleTable: Function;
11
- transform: Function;
12
- toggleStatistic: Function;
4
+ export interface RenderConfig extends Partial<IChartHook> {
5
+ toggleTable?: (...args: unknown[]) => void;
6
+ transform?: (data: unknown) => unknown;
7
+ toggleStatistic?: (...args: unknown[]) => void;
13
8
  }
14
9
  type Toolbox = Array<IToolbox>;
15
10
  export declare function useRender(config: RenderConfig, datasource: Ref, toolbox: Toolbox): {
16
11
  refreshCharts: (data: any) => void;
17
12
  getBindValue: import("vue").ComputedRef<{
18
- instance: Function;
19
- toggleTable: Function;
20
- toggleStatistic: Function;
13
+ instance: any;
14
+ toggleTable: (...args: unknown[]) => void;
15
+ toggleStatistic: (...args: unknown[]) => void;
21
16
  toolbox: Toolbox;
22
17
  }>;
23
18
  };