hfn-components 0.2.5 → 0.2.7
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.
- package/component.ts +13 -0
- package/defaults.ts +5 -0
- package/index.ts +6 -0
- package/make-installer.ts +17 -0
- package/package.json +2 -2
- package/plugin.ts +1 -0
- package/dist/index.css +0 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
- package/es/component.d.ts +0 -3
- package/es/component.mjs +0 -10
- package/es/components/chart/index.d.ts +0 -171
- package/es/components/chart/index.mjs +0 -7
- package/es/components/chart/src/HtChart.d.ts +0 -65
- package/es/components/chart/src/HtChart.mjs +0 -86
- package/es/components/chart/src/HtChart.vue.d.ts +0 -177
- package/es/components/chart/src/HtChart.vue.mjs +0 -91
- package/es/components/chart/src/HtChart.vue2.mjs +0 -104
- package/es/components/chart/src/chartConfig.d.ts +0 -7
- package/es/components/chart/src/chartConfig.mjs +0 -88
- package/es/components/chart/style/index.d.ts +0 -1
- package/es/components/chart/style/index.mjs +0 -1
- package/es/components/elTable/index.d.ts +0 -714
- package/es/components/elTable/index.mjs +0 -7
- package/es/components/elTable/src/columnDeal.vue.d.ts +0 -37
- package/es/components/elTable/src/columnDeal.vue.mjs +0 -35
- package/es/components/elTable/src/columnDeal.vue2.mjs +0 -19
- package/es/components/elTable/src/elTable.d.ts +0 -38
- package/es/components/elTable/src/elTable.mjs +0 -30
- package/es/components/elTable/src/elTable.vue.d.ts +0 -713
- package/es/components/elTable/src/elTable.vue.mjs +0 -56
- package/es/components/elTable/src/elTable.vue2.mjs +0 -29
- package/es/components/index.d.ts +0 -2
- package/es/components/index.mjs +0 -4
- package/es/components/table/HtTable.d.ts +0 -142
- package/es/components/table/HtTable.mjs +0 -136
- package/es/components/table/HtTable.vue.d.ts +0 -1847
- package/es/components/table/HtTable.vue.mjs +0 -449
- package/es/components/table/HtTable.vue2.mjs +0 -124
- package/es/components/table/index.d.ts +0 -1845
- package/es/components/table/index.mjs +0 -7
- package/es/constants/index.d.ts +0 -2
- package/es/constants/index.mjs +0 -2
- package/es/constants/key.d.ts +0 -1
- package/es/constants/key.mjs +0 -3
- package/es/constants/table.d.ts +0 -61
- package/es/constants/table.mjs +0 -73
- package/es/defaults.d.ts +0 -4
- package/es/defaults.mjs +0 -7
- package/es/index.d.ts +0 -5
- package/es/index.mjs +0 -10
- package/es/make-installer.d.ts +0 -4
- package/es/make-installer.mjs +0 -14
- package/es/plugin.d.ts +0 -2
- package/es/plugin.mjs +0 -3
- package/es/utils/chart.d.ts +0 -7
- package/es/utils/chart.mjs +0 -172
- package/es/utils/common.d.ts +0 -3
- package/es/utils/common.mjs +0 -15
- package/es/utils/index.d.ts +0 -4
- package/es/utils/index.mjs +0 -4
- package/es/utils/table.d.ts +0 -2
- package/es/utils/table.mjs +0 -31
- package/es/utils/tool.d.ts +0 -2
- package/es/utils/tool.mjs +0 -42
- package/global.d.ts +0 -14
- package/theme-chalk/ht-chart.css +0 -1
- package/theme-chalk/index.css +0 -1
- package/theme-chalk/src/chart.scss +0 -53
- package/theme-chalk/src/index.scss +0 -1
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import _sfc_main from './HtTable.vue2.mjs';
|
|
2
|
-
import { openBlock, createElementBlock, Fragment, createVNode, normalizeClass, withCtx, createCommentVNode, createBlock, renderList, createElementVNode, toDisplayString, createTextVNode, resolveDynamicComponent } from 'vue';
|
|
3
|
-
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
|
-
|
|
5
|
-
const _hoisted_1 = { href: "javascript:;" };
|
|
6
|
-
const _hoisted_2 = { key: 0 };
|
|
7
|
-
const _hoisted_3 = { key: 0 };
|
|
8
|
-
const _hoisted_4 = ["innerHTML"];
|
|
9
|
-
const _hoisted_5 = { key: 1 };
|
|
10
|
-
const _hoisted_6 = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "action-cell"
|
|
13
|
-
};
|
|
14
|
-
const _hoisted_7 = ["onClick"];
|
|
15
|
-
const _hoisted_8 = { key: 0 };
|
|
16
|
-
const _hoisted_9 = ["innerHTML"];
|
|
17
|
-
const _hoisted_10 = { key: 1 };
|
|
18
|
-
const _hoisted_11 = { key: 1 };
|
|
19
|
-
const _hoisted_12 = {
|
|
20
|
-
key: 1,
|
|
21
|
-
class: "action-item"
|
|
22
|
-
};
|
|
23
|
-
const _hoisted_13 = ["onClick"];
|
|
24
|
-
const _hoisted_14 = { key: 0 };
|
|
25
|
-
const _hoisted_15 = ["innerHTML"];
|
|
26
|
-
const _hoisted_16 = { key: 1 };
|
|
27
|
-
const _hoisted_17 = { key: 1 };
|
|
28
|
-
const _hoisted_18 = {
|
|
29
|
-
key: 2,
|
|
30
|
-
class: "action-item"
|
|
31
|
-
};
|
|
32
|
-
const _hoisted_19 = { key: 0 };
|
|
33
|
-
const _hoisted_20 = ["innerHTML"];
|
|
34
|
-
const _hoisted_21 = { key: 1 };
|
|
35
|
-
const _hoisted_22 = { key: 1 };
|
|
36
|
-
const _hoisted_23 = ["onClick"];
|
|
37
|
-
const _hoisted_24 = { key: 0 };
|
|
38
|
-
const _hoisted_25 = ["innerHTML"];
|
|
39
|
-
const _hoisted_26 = { key: 1 };
|
|
40
|
-
const _hoisted_27 = { key: 1 };
|
|
41
|
-
const _hoisted_28 = {
|
|
42
|
-
key: 0,
|
|
43
|
-
class: "pagination"
|
|
44
|
-
};
|
|
45
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
46
|
-
return openBlock(), createElementBlock(
|
|
47
|
-
Fragment,
|
|
48
|
-
null,
|
|
49
|
-
[
|
|
50
|
-
createVNode($setup["Table"], {
|
|
51
|
-
columns: $setup.tableColumns,
|
|
52
|
-
"data-source": $setup.data,
|
|
53
|
-
loading: $setup.props.loading,
|
|
54
|
-
pagination: $setup.props.showOriginalPagination,
|
|
55
|
-
showSorterTooltip: false,
|
|
56
|
-
scroll: $setup.tableScroll,
|
|
57
|
-
class: normalizeClass({ t44: _ctx.smallHeader, t54: !_ctx.smallHeader }),
|
|
58
|
-
"row-selection": _ctx.selectShow ? {
|
|
59
|
-
selectedRowKeys: $setup.selectedRowKeys,
|
|
60
|
-
onChange: $setup.onSelectChange,
|
|
61
|
-
onSelect: $setup.handleSelect,
|
|
62
|
-
onSelectAll: $setup.handleSelectAll,
|
|
63
|
-
getCheckboxProps: $setup.getCheckboxProps
|
|
64
|
-
} : void 0,
|
|
65
|
-
onResizeColumn: $setup.resizeColumn,
|
|
66
|
-
onChange: $setup.handleTableChange
|
|
67
|
-
}, {
|
|
68
|
-
headerCell: withCtx(({ column }) => [
|
|
69
|
-
createCommentVNode(` <div :class="{ 'cell-line':column.resizable }"></div> `),
|
|
70
|
-
createCommentVNode(" \u8868\u5934\u5E26\u4E0B\u62C9\u9009\u9879 "),
|
|
71
|
-
column.type && column.type === "menu" ? (openBlock(), createBlock(
|
|
72
|
-
$setup["Dropdown"],
|
|
73
|
-
{ key: 0 },
|
|
74
|
-
{
|
|
75
|
-
overlay: withCtx(() => [
|
|
76
|
-
createVNode(
|
|
77
|
-
$setup["Menu"],
|
|
78
|
-
{ class: "nav-title-table" },
|
|
79
|
-
{
|
|
80
|
-
default: withCtx(() => [
|
|
81
|
-
(openBlock(true), createElementBlock(
|
|
82
|
-
Fragment,
|
|
83
|
-
null,
|
|
84
|
-
renderList(column.menu, (item, index) => {
|
|
85
|
-
return openBlock(), createBlock($setup["MenuItem"], {
|
|
86
|
-
key: index,
|
|
87
|
-
onClick: () => item.handler(item.label)
|
|
88
|
-
}, {
|
|
89
|
-
default: withCtx(() => [
|
|
90
|
-
createElementVNode(
|
|
91
|
-
"a",
|
|
92
|
-
_hoisted_1,
|
|
93
|
-
toDisplayString(item.label),
|
|
94
|
-
1
|
|
95
|
-
/* TEXT */
|
|
96
|
-
)
|
|
97
|
-
]),
|
|
98
|
-
_: 2
|
|
99
|
-
/* DYNAMIC */
|
|
100
|
-
}, 1032, ["onClick"]);
|
|
101
|
-
}),
|
|
102
|
-
128
|
|
103
|
-
/* KEYED_FRAGMENT */
|
|
104
|
-
))
|
|
105
|
-
]),
|
|
106
|
-
_: 2
|
|
107
|
-
/* DYNAMIC */
|
|
108
|
-
},
|
|
109
|
-
1024
|
|
110
|
-
/* DYNAMIC_SLOTS */
|
|
111
|
-
)
|
|
112
|
-
]),
|
|
113
|
-
default: withCtx(() => [
|
|
114
|
-
createElementVNode("a", {
|
|
115
|
-
style: { "color": "rgba(0, 0, 0, 0.85)" },
|
|
116
|
-
onClick: _cache[0] || (_cache[0] = (e) => e.preventDefault())
|
|
117
|
-
}, [
|
|
118
|
-
createTextVNode(
|
|
119
|
-
toDisplayString(column.title),
|
|
120
|
-
1
|
|
121
|
-
/* TEXT */
|
|
122
|
-
),
|
|
123
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent("DownOutlined"))))
|
|
124
|
-
])
|
|
125
|
-
]),
|
|
126
|
-
_: 2
|
|
127
|
-
/* DYNAMIC */
|
|
128
|
-
},
|
|
129
|
-
1024
|
|
130
|
-
/* DYNAMIC_SLOTS */
|
|
131
|
-
)) : createCommentVNode("v-if", true),
|
|
132
|
-
createCommentVNode(" \u8868\u5934\u5E26\u56FE\u6807\u79FB\u5165\u63D0\u793A "),
|
|
133
|
-
column.type && column.type === "tooltip" ? (openBlock(), createElementBlock(
|
|
134
|
-
Fragment,
|
|
135
|
-
{ key: 1 },
|
|
136
|
-
[
|
|
137
|
-
createTextVNode(
|
|
138
|
-
toDisplayString(column.title) + "\xA0 ",
|
|
139
|
-
1
|
|
140
|
-
/* TEXT */
|
|
141
|
-
),
|
|
142
|
-
createVNode(
|
|
143
|
-
$setup["Tooltip"],
|
|
144
|
-
{ placement: "top" },
|
|
145
|
-
{
|
|
146
|
-
title: withCtx(() => [
|
|
147
|
-
typeof column.tooltipTitle === "string" ? (openBlock(), createElementBlock(
|
|
148
|
-
"div",
|
|
149
|
-
_hoisted_2,
|
|
150
|
-
toDisplayString(column.tooltipTitle),
|
|
151
|
-
1
|
|
152
|
-
/* TEXT */
|
|
153
|
-
)) : (openBlock(true), createElementBlock(
|
|
154
|
-
Fragment,
|
|
155
|
-
{ key: 1 },
|
|
156
|
-
renderList(column.tooltipTitle, (item, index) => {
|
|
157
|
-
return openBlock(), createElementBlock(
|
|
158
|
-
"div",
|
|
159
|
-
{ key: index },
|
|
160
|
-
toDisplayString(item),
|
|
161
|
-
1
|
|
162
|
-
/* TEXT */
|
|
163
|
-
);
|
|
164
|
-
}),
|
|
165
|
-
128
|
|
166
|
-
/* KEYED_FRAGMENT */
|
|
167
|
-
))
|
|
168
|
-
]),
|
|
169
|
-
default: withCtx(() => [
|
|
170
|
-
!column.iconType ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
171
|
-
column.icon ? (openBlock(), createElementBlock("i", {
|
|
172
|
-
key: 0,
|
|
173
|
-
class: "iconfont",
|
|
174
|
-
innerHTML: column.icon
|
|
175
|
-
}, null, 8, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
176
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_5, [
|
|
177
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent(column.iconType))))
|
|
178
|
-
]))
|
|
179
|
-
]),
|
|
180
|
-
_: 2
|
|
181
|
-
/* DYNAMIC */
|
|
182
|
-
},
|
|
183
|
-
1024
|
|
184
|
-
/* DYNAMIC_SLOTS */
|
|
185
|
-
)
|
|
186
|
-
],
|
|
187
|
-
64
|
|
188
|
-
/* STABLE_FRAGMENT */
|
|
189
|
-
)) : createCommentVNode("v-if", true),
|
|
190
|
-
createCommentVNode(" \u8868\u5934\u6362\u884C "),
|
|
191
|
-
column.type && column.type === "br" ? (openBlock(), createElementBlock(
|
|
192
|
-
Fragment,
|
|
193
|
-
{ key: 2 },
|
|
194
|
-
[
|
|
195
|
-
createElementVNode(
|
|
196
|
-
"div",
|
|
197
|
-
null,
|
|
198
|
-
toDisplayString(column.titles[0]),
|
|
199
|
-
1
|
|
200
|
-
/* TEXT */
|
|
201
|
-
),
|
|
202
|
-
createElementVNode(
|
|
203
|
-
"div",
|
|
204
|
-
null,
|
|
205
|
-
toDisplayString(column.titles[1]),
|
|
206
|
-
1
|
|
207
|
-
/* TEXT */
|
|
208
|
-
)
|
|
209
|
-
],
|
|
210
|
-
64
|
|
211
|
-
/* STABLE_FRAGMENT */
|
|
212
|
-
)) : createCommentVNode("v-if", true)
|
|
213
|
-
]),
|
|
214
|
-
bodyCell: withCtx(({ column, record, text }) => [
|
|
215
|
-
column.key !== "action" ? (openBlock(), createElementBlock(
|
|
216
|
-
Fragment,
|
|
217
|
-
{ key: 0 },
|
|
218
|
-
[
|
|
219
|
-
createCommentVNode(" \u6570\u636E\u5904\u7406 "),
|
|
220
|
-
column.slot ? (openBlock(), createElementBlock(
|
|
221
|
-
"span",
|
|
222
|
-
{
|
|
223
|
-
key: 0,
|
|
224
|
-
class: normalizeClass([column.slot.includes("color") ? parseFloat(text) > 0 ? "red" : parseFloat(text) < 0 ? "green" : "" : ""])
|
|
225
|
-
},
|
|
226
|
-
toDisplayString($setup.handleData(text, column.slot)),
|
|
227
|
-
3
|
|
228
|
-
/* TEXT, CLASS */
|
|
229
|
-
)) : (openBlock(), createElementBlock(
|
|
230
|
-
Fragment,
|
|
231
|
-
{ key: 1 },
|
|
232
|
-
[
|
|
233
|
-
createCommentVNode(" \u6587\u672C\u5904\u7406 "),
|
|
234
|
-
createCommentVNode(" \u6570\u7EC4\u5904\u7406 "),
|
|
235
|
-
createCommentVNode(" \u8DF3\u8F6C\u5904\u7406 "),
|
|
236
|
-
createElementVNode(
|
|
237
|
-
"span",
|
|
238
|
-
null,
|
|
239
|
-
toDisplayString(text),
|
|
240
|
-
1
|
|
241
|
-
/* TEXT */
|
|
242
|
-
)
|
|
243
|
-
],
|
|
244
|
-
2112
|
|
245
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
246
|
-
))
|
|
247
|
-
],
|
|
248
|
-
64
|
|
249
|
-
/* STABLE_FRAGMENT */
|
|
250
|
-
)) : createCommentVNode("v-if", true),
|
|
251
|
-
column.key === "action" ? (openBlock(), createElementBlock(
|
|
252
|
-
Fragment,
|
|
253
|
-
{ key: 1 },
|
|
254
|
-
[
|
|
255
|
-
$setup.props.actions.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
256
|
-
(openBlock(true), createElementBlock(
|
|
257
|
-
Fragment,
|
|
258
|
-
null,
|
|
259
|
-
renderList($setup.props.actions, (action, index) => {
|
|
260
|
-
return openBlock(), createElementBlock("div", { key: index }, [
|
|
261
|
-
createCommentVNode(" \u64CD\u4F5C\u884C\u9ED8\u8BA4 "),
|
|
262
|
-
action.type === "default" && $setup.shouldShowAction(action, record) ? (openBlock(), createElementBlock("span", {
|
|
263
|
-
key: 0,
|
|
264
|
-
class: "action-item",
|
|
265
|
-
onClick: () => action.handler(record)
|
|
266
|
-
}, [
|
|
267
|
-
!action.iconType ? (openBlock(), createElementBlock("span", _hoisted_8, [
|
|
268
|
-
action.icon ? (openBlock(), createElementBlock("i", {
|
|
269
|
-
key: 0,
|
|
270
|
-
class: "iconfont",
|
|
271
|
-
innerHTML: action.icon
|
|
272
|
-
}, null, 8, _hoisted_9)) : (openBlock(), createElementBlock(
|
|
273
|
-
"span",
|
|
274
|
-
_hoisted_10,
|
|
275
|
-
toDisplayString(action.label),
|
|
276
|
-
1
|
|
277
|
-
/* TEXT */
|
|
278
|
-
))
|
|
279
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_11, [
|
|
280
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent(action.iconType))))
|
|
281
|
-
]))
|
|
282
|
-
], 8, _hoisted_7)) : createCommentVNode("v-if", true),
|
|
283
|
-
createCommentVNode(" \u64CD\u4F5C\u884C\u5E26\u63D0\u793A "),
|
|
284
|
-
action.type === "tooltip" && $setup.shouldShowAction(action, record) ? (openBlock(), createElementBlock("span", _hoisted_12, [
|
|
285
|
-
createVNode(
|
|
286
|
-
$setup["Tooltip"],
|
|
287
|
-
{ placement: "bottom" },
|
|
288
|
-
{
|
|
289
|
-
title: withCtx(() => [
|
|
290
|
-
createTextVNode(
|
|
291
|
-
toDisplayString(action.label),
|
|
292
|
-
1
|
|
293
|
-
/* TEXT */
|
|
294
|
-
)
|
|
295
|
-
]),
|
|
296
|
-
default: withCtx(() => [
|
|
297
|
-
createElementVNode("span", {
|
|
298
|
-
onClick: () => action.handler(record)
|
|
299
|
-
}, [
|
|
300
|
-
!action.iconType ? (openBlock(), createElementBlock("span", _hoisted_14, [
|
|
301
|
-
action.icon ? (openBlock(), createElementBlock("i", {
|
|
302
|
-
key: 0,
|
|
303
|
-
class: "iconfont",
|
|
304
|
-
innerHTML: action.icon
|
|
305
|
-
}, null, 8, _hoisted_15)) : (openBlock(), createElementBlock(
|
|
306
|
-
"span",
|
|
307
|
-
_hoisted_16,
|
|
308
|
-
toDisplayString(action.label),
|
|
309
|
-
1
|
|
310
|
-
/* TEXT */
|
|
311
|
-
))
|
|
312
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_17, [
|
|
313
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent(action.iconType))))
|
|
314
|
-
]))
|
|
315
|
-
], 8, _hoisted_13)
|
|
316
|
-
]),
|
|
317
|
-
_: 2
|
|
318
|
-
/* DYNAMIC */
|
|
319
|
-
},
|
|
320
|
-
1024
|
|
321
|
-
/* DYNAMIC_SLOTS */
|
|
322
|
-
)
|
|
323
|
-
])) : createCommentVNode("v-if", true),
|
|
324
|
-
createCommentVNode(" \u64CD\u4F5C\u884C\u5E26\u4E0B\u62C9\u83DC\u5355 "),
|
|
325
|
-
action.type === "menu" && $setup.shouldShowAction(action, record) ? (openBlock(), createElementBlock("span", _hoisted_18, [
|
|
326
|
-
createVNode(
|
|
327
|
-
$setup["Dropdown"],
|
|
328
|
-
null,
|
|
329
|
-
{
|
|
330
|
-
overlay: withCtx(() => [
|
|
331
|
-
createVNode(
|
|
332
|
-
$setup["Menu"],
|
|
333
|
-
null,
|
|
334
|
-
{
|
|
335
|
-
default: withCtx(() => [
|
|
336
|
-
(openBlock(true), createElementBlock(
|
|
337
|
-
Fragment,
|
|
338
|
-
null,
|
|
339
|
-
renderList(action.menu, (menu, menuIndex) => {
|
|
340
|
-
return openBlock(), createBlock(
|
|
341
|
-
$setup["MenuItem"],
|
|
342
|
-
{ key: menuIndex },
|
|
343
|
-
{
|
|
344
|
-
default: withCtx(() => [
|
|
345
|
-
createElementVNode("span", {
|
|
346
|
-
onClick: () => menu.handler(record)
|
|
347
|
-
}, [
|
|
348
|
-
!menu.iconType ? (openBlock(), createElementBlock("span", _hoisted_24, [
|
|
349
|
-
createElementVNode("i", {
|
|
350
|
-
class: "iconfont",
|
|
351
|
-
innerHTML: menu.icon
|
|
352
|
-
}, null, 8, _hoisted_25)
|
|
353
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_26, [
|
|
354
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent(menu.iconType))))
|
|
355
|
-
])),
|
|
356
|
-
createTextVNode(
|
|
357
|
-
" " + toDisplayString(menu.label),
|
|
358
|
-
1
|
|
359
|
-
/* TEXT */
|
|
360
|
-
)
|
|
361
|
-
], 8, _hoisted_23)
|
|
362
|
-
]),
|
|
363
|
-
_: 2
|
|
364
|
-
/* DYNAMIC */
|
|
365
|
-
},
|
|
366
|
-
1024
|
|
367
|
-
/* DYNAMIC_SLOTS */
|
|
368
|
-
);
|
|
369
|
-
}),
|
|
370
|
-
128
|
|
371
|
-
/* KEYED_FRAGMENT */
|
|
372
|
-
))
|
|
373
|
-
]),
|
|
374
|
-
_: 2
|
|
375
|
-
/* DYNAMIC */
|
|
376
|
-
},
|
|
377
|
-
1024
|
|
378
|
-
/* DYNAMIC_SLOTS */
|
|
379
|
-
)
|
|
380
|
-
]),
|
|
381
|
-
default: withCtx(() => [
|
|
382
|
-
!action.iconType ? (openBlock(), createElementBlock("span", _hoisted_19, [
|
|
383
|
-
action.icon ? (openBlock(), createElementBlock("i", {
|
|
384
|
-
key: 0,
|
|
385
|
-
class: "iconfont",
|
|
386
|
-
innerHTML: action.icon
|
|
387
|
-
}, null, 8, _hoisted_20)) : (openBlock(), createElementBlock(
|
|
388
|
-
"span",
|
|
389
|
-
_hoisted_21,
|
|
390
|
-
toDisplayString(action.label),
|
|
391
|
-
1
|
|
392
|
-
/* TEXT */
|
|
393
|
-
))
|
|
394
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_22, [
|
|
395
|
-
(openBlock(), createBlock(resolveDynamicComponent($setup.getIconComponent(action.iconType))))
|
|
396
|
-
]))
|
|
397
|
-
]),
|
|
398
|
-
_: 2
|
|
399
|
-
/* DYNAMIC */
|
|
400
|
-
},
|
|
401
|
-
1024
|
|
402
|
-
/* DYNAMIC_SLOTS */
|
|
403
|
-
)
|
|
404
|
-
])) : createCommentVNode("v-if", true),
|
|
405
|
-
createCommentVNode(" \u64CD\u4F5C\u884C\u5E26\u79FB\u5165\u63D0\u793A\u8DF3\u8F6C "),
|
|
406
|
-
createCommentVNode(` <span class="action-item" v-if="action.type === 'link' && shouldShowAction(action, record)">
|
|
407
|
-
<Tooltip placement="bottom">
|
|
408
|
-
<template #title>{{ action.label }}</template>
|
|
409
|
-
<span @click="() => action.handler(record)">
|
|
410
|
-
<span v-if="!action.iconType">
|
|
411
|
-
<i v-if="action.icon" class="iconfont" v-html="action.icon"></i>
|
|
412
|
-
<span v-else>{{ action.label }}</span>
|
|
413
|
-
</span>
|
|
414
|
-
<span v-else><component :is="getIconComponent(action.iconType)"></component></span>
|
|
415
|
-
</span>
|
|
416
|
-
</Tooltip>
|
|
417
|
-
</span> `)
|
|
418
|
-
]);
|
|
419
|
-
}),
|
|
420
|
-
128
|
|
421
|
-
/* KEYED_FRAGMENT */
|
|
422
|
-
))
|
|
423
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_27, "-"))
|
|
424
|
-
],
|
|
425
|
-
64
|
|
426
|
-
/* STABLE_FRAGMENT */
|
|
427
|
-
)) : createCommentVNode("v-if", true)
|
|
428
|
-
]),
|
|
429
|
-
_: 1
|
|
430
|
-
/* STABLE */
|
|
431
|
-
}, 8, ["columns", "loading", "pagination", "scroll", "class", "row-selection"]),
|
|
432
|
-
$setup.props.isPagination ? (openBlock(), createElementBlock("div", _hoisted_28, [
|
|
433
|
-
createVNode($setup["Pagination"], {
|
|
434
|
-
pageSize: $setup.props.pageSize,
|
|
435
|
-
current: $setup.props.nowPage,
|
|
436
|
-
total: $setup.props.total,
|
|
437
|
-
"show-total": (total) => `\u5171${total}\u6761`,
|
|
438
|
-
showSizeChanger: false,
|
|
439
|
-
onChange: $setup.pageChange
|
|
440
|
-
}, null, 8, ["pageSize", "current", "total", "show-total"])
|
|
441
|
-
])) : createCommentVNode("v-if", true)
|
|
442
|
-
],
|
|
443
|
-
64
|
|
444
|
-
/* STABLE_FRAGMENT */
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
var Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/table/HtTable.vue"]]);
|
|
448
|
-
|
|
449
|
-
export { Table as default };
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onMounted } from 'vue';
|
|
2
|
-
import { Table, Pagination, Tooltip, Dropdown, Menu, MenuItem } from 'ant-design-vue';
|
|
3
|
-
import * as Icons from '@ant-design/icons-vue';
|
|
4
|
-
import { handleData } from '../../utils/table.mjs';
|
|
5
|
-
import { tableProps } from './HtTable.mjs';
|
|
6
|
-
|
|
7
|
-
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
...{
|
|
9
|
-
name: "HtTable"
|
|
10
|
-
},
|
|
11
|
-
__name: "HtTable",
|
|
12
|
-
props: tableProps,
|
|
13
|
-
emits: ["pageChange", "filterChange", "onSelectChange", "handleSelect", "handleSelectAll", "resizeColumn"],
|
|
14
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
15
|
-
__expose();
|
|
16
|
-
const props = __props;
|
|
17
|
-
const emit = __emit;
|
|
18
|
-
const selectedRowKeys = ref(props.selectedKeys);
|
|
19
|
-
const data = [
|
|
20
|
-
{
|
|
21
|
-
key: "1",
|
|
22
|
-
name: "John Brown",
|
|
23
|
-
age: 32.0123470192,
|
|
24
|
-
address: "New York No. 1 Lake Park",
|
|
25
|
-
tags: ["nice", "developer"]
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: "2",
|
|
29
|
-
name: "Jim Green",
|
|
30
|
-
age: 42.523123,
|
|
31
|
-
address: "London No. 1 Lake Park",
|
|
32
|
-
tags: ["loser"]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "3",
|
|
36
|
-
name: "Joe Black",
|
|
37
|
-
age: 32.102731023,
|
|
38
|
-
address: "Sidney No. 1 Lake Park",
|
|
39
|
-
tags: ["cool", "teacher"]
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
const tableScroll = computed(() => {
|
|
43
|
-
if (props.isScroll && props.yIsScroll) {
|
|
44
|
-
return { x: data.length > 0 ? "max-content" : "100%", y: props.yHeight || "440px" };
|
|
45
|
-
} else if (props.isScroll) {
|
|
46
|
-
return { x: data.length > 0 ? "max-content" : "100%" };
|
|
47
|
-
} else if (props.yIsScroll) {
|
|
48
|
-
return { y: props.yHeight || "440px" };
|
|
49
|
-
} else {
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const tableColumns = computed(() => {
|
|
54
|
-
console.log(props.columns);
|
|
55
|
-
if (props.actions?.length > 0) {
|
|
56
|
-
return [
|
|
57
|
-
...props.columns,
|
|
58
|
-
{
|
|
59
|
-
title: "\u64CD\u4F5C",
|
|
60
|
-
dataIndex: "action",
|
|
61
|
-
key: "action",
|
|
62
|
-
align: "center",
|
|
63
|
-
fixed: "right"
|
|
64
|
-
}
|
|
65
|
-
];
|
|
66
|
-
} else return [...props.columns];
|
|
67
|
-
});
|
|
68
|
-
const getIconComponent = (iconType) => {
|
|
69
|
-
const defaultIcon = "ExclamationCircleFilled";
|
|
70
|
-
if (iconType && Icons[iconType]) {
|
|
71
|
-
return Icons[iconType];
|
|
72
|
-
}
|
|
73
|
-
return Icons[defaultIcon];
|
|
74
|
-
};
|
|
75
|
-
const shouldShowAction = (action, record) => {
|
|
76
|
-
return action.showAction ? action.showAction(record) : true;
|
|
77
|
-
};
|
|
78
|
-
const resizeColumn = (w, col) => {
|
|
79
|
-
col.width = w;
|
|
80
|
-
emit("resizeColumn", col, w);
|
|
81
|
-
};
|
|
82
|
-
const pageChange = (val) => {
|
|
83
|
-
emit("pageChange", val);
|
|
84
|
-
console.log(val);
|
|
85
|
-
};
|
|
86
|
-
const handleTableChange = (pagination, filters, sorter) => {
|
|
87
|
-
emit("filterChange", filters, sorter, pagination);
|
|
88
|
-
};
|
|
89
|
-
const onSelectChange = (selectedRowKeys2) => {
|
|
90
|
-
emit("onSelectChange", selectedRowKeys2);
|
|
91
|
-
};
|
|
92
|
-
const handleSelect = (record, selected) => {
|
|
93
|
-
emit("handleSelect", record, selected);
|
|
94
|
-
};
|
|
95
|
-
const handleSelectAll = (selected, selectedRows, changeRows) => {
|
|
96
|
-
emit("handleSelectAll", selected, selectedRows, changeRows);
|
|
97
|
-
};
|
|
98
|
-
const getCheckboxProps = (record) => ({
|
|
99
|
-
disabled: record.select_disabled || record.self_active === 4,
|
|
100
|
-
name: record.fund_name
|
|
101
|
-
});
|
|
102
|
-
onMounted(() => {
|
|
103
|
-
});
|
|
104
|
-
const __returned__ = { props, emit, selectedRowKeys, data, tableScroll, tableColumns, getIconComponent, shouldShowAction, resizeColumn, pageChange, handleTableChange, onSelectChange, handleSelect, handleSelectAll, getCheckboxProps, get Table() {
|
|
105
|
-
return Table;
|
|
106
|
-
}, get Pagination() {
|
|
107
|
-
return Pagination;
|
|
108
|
-
}, get Tooltip() {
|
|
109
|
-
return Tooltip;
|
|
110
|
-
}, get Dropdown() {
|
|
111
|
-
return Dropdown;
|
|
112
|
-
}, get Menu() {
|
|
113
|
-
return Menu;
|
|
114
|
-
}, get MenuItem() {
|
|
115
|
-
return MenuItem;
|
|
116
|
-
}, get handleData() {
|
|
117
|
-
return handleData;
|
|
118
|
-
} };
|
|
119
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
120
|
-
return __returned__;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
export { _sfc_main as default };
|