@tmagic/table 1.6.0-beta.6 → 1.6.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.
- package/dist/tmagic-table.js +98 -90
- package/dist/tmagic-table.umd.cjs +98 -90
- package/package.json +5 -5
- package/types/index.d.ts +2 -1
package/dist/tmagic-table.js
CHANGED
|
@@ -66,15 +66,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
};
|
|
67
67
|
return (_ctx, _cache) => {
|
|
68
68
|
return openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
69
|
-
label:
|
|
70
|
-
width:
|
|
71
|
-
fixed:
|
|
69
|
+
label: __props.config.label,
|
|
70
|
+
width: __props.config.width,
|
|
71
|
+
fixed: __props.config.fixed
|
|
72
72
|
}, {
|
|
73
73
|
default: withCtx((scope) => [
|
|
74
74
|
(openBlock(true), createElementBlock(
|
|
75
75
|
Fragment,
|
|
76
76
|
null,
|
|
77
|
-
renderList(
|
|
77
|
+
renderList(__props.config.actions, (action, actionIndex) => {
|
|
78
78
|
return openBlock(), createBlock(unref(TMagicTooltip), {
|
|
79
79
|
placement: action.tooltipPlacement || "top",
|
|
80
80
|
key: actionIndex,
|
|
@@ -98,7 +98,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
98
98
|
_: 2
|
|
99
99
|
/* DYNAMIC */
|
|
100
100
|
}, 1032, ["type", "icon", "onClick"]), [
|
|
101
|
-
[vShow, display(action.display, scope.row) && !
|
|
101
|
+
[vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
|
|
102
102
|
])
|
|
103
103
|
]),
|
|
104
104
|
_: 2
|
|
@@ -113,30 +113,38 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
link: "",
|
|
114
114
|
type: "primary",
|
|
115
115
|
size: "small",
|
|
116
|
-
onClick: ($event) => save(scope.$index,
|
|
116
|
+
onClick: ($event) => save(scope.$index, __props.config)
|
|
117
117
|
}, {
|
|
118
|
-
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
119
|
-
createTextVNode(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
119
|
+
createTextVNode(
|
|
120
|
+
"保存",
|
|
121
|
+
-1
|
|
122
|
+
/* CACHED */
|
|
123
|
+
)
|
|
124
|
+
])]),
|
|
125
|
+
_: 1
|
|
126
|
+
/* STABLE */
|
|
127
|
+
}, 8, ["onClick"]), [
|
|
128
|
+
[vShow, __props.editState[scope.$index]]
|
|
125
129
|
]),
|
|
126
130
|
withDirectives(createVNode(unref(TMagicButton), {
|
|
127
131
|
class: "action-btn",
|
|
128
132
|
link: "",
|
|
129
133
|
type: "primary",
|
|
130
134
|
size: "small",
|
|
131
|
-
onClick: ($event) =>
|
|
135
|
+
onClick: ($event) => __props.editState[scope.$index] = void 0
|
|
132
136
|
}, {
|
|
133
|
-
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
134
|
-
createTextVNode(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
138
|
+
createTextVNode(
|
|
139
|
+
"取消",
|
|
140
|
+
-1
|
|
141
|
+
/* CACHED */
|
|
142
|
+
)
|
|
143
|
+
])]),
|
|
144
|
+
_: 1
|
|
145
|
+
/* STABLE */
|
|
146
|
+
}, 8, ["onClick"]), [
|
|
147
|
+
[vShow, __props.editState[scope.$index]]
|
|
140
148
|
])
|
|
141
149
|
]),
|
|
142
150
|
_: 1
|
|
@@ -171,15 +179,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
171
179
|
return (_ctx, _cache) => {
|
|
172
180
|
return openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
173
181
|
"show-overflow-tooltip": "",
|
|
174
|
-
label:
|
|
175
|
-
width:
|
|
176
|
-
fixed:
|
|
177
|
-
sortable:
|
|
178
|
-
prop:
|
|
182
|
+
label: __props.config.label,
|
|
183
|
+
width: __props.config.width,
|
|
184
|
+
fixed: __props.config.fixed,
|
|
185
|
+
sortable: __props.config.sortable,
|
|
186
|
+
prop: __props.config.prop
|
|
179
187
|
}, {
|
|
180
188
|
default: withCtx((scope) => [
|
|
181
189
|
(openBlock(), createBlock(
|
|
182
|
-
resolveDynamicComponent(
|
|
190
|
+
resolveDynamicComponent(__props.config.component),
|
|
183
191
|
mergeProps(componentProps(scope.row, scope.$index), toHandlers(componentListeners(scope.row, scope.$index))),
|
|
184
192
|
null,
|
|
185
193
|
16
|
|
@@ -218,27 +226,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
218
226
|
createCommentVNode(" @ts-nocheck "),
|
|
219
227
|
createVNode(unref(TMagicTableColumn), {
|
|
220
228
|
type: "expand",
|
|
221
|
-
width:
|
|
222
|
-
fixed:
|
|
229
|
+
width: __props.config.width,
|
|
230
|
+
fixed: __props.config.fixed
|
|
223
231
|
}, {
|
|
224
232
|
default: withCtx((scope) => [
|
|
225
|
-
|
|
233
|
+
__props.config.table ? (openBlock(), createBlock(_sfc_main, {
|
|
226
234
|
key: 0,
|
|
227
235
|
"show-header": false,
|
|
228
|
-
columns:
|
|
229
|
-
data:
|
|
236
|
+
columns: __props.config.table,
|
|
237
|
+
data: __props.config.prop && scope.row[__props.config.prop] || []
|
|
230
238
|
}, null, 8, ["columns", "data"])) : createCommentVNode("v-if", true),
|
|
231
|
-
|
|
239
|
+
__props.config.form ? (openBlock(), createBlock(unref(MForm), {
|
|
232
240
|
key: 1,
|
|
233
|
-
config:
|
|
234
|
-
"init-values":
|
|
241
|
+
config: __props.config.form,
|
|
242
|
+
"init-values": __props.config.values || __props.config.prop && scope.row[__props.config.prop] || {}
|
|
235
243
|
}, null, 8, ["config", "init-values"])) : createCommentVNode("v-if", true),
|
|
236
|
-
|
|
244
|
+
__props.config.expandContent ? (openBlock(), createElementBlock("div", {
|
|
237
245
|
key: 2,
|
|
238
|
-
innerHTML:
|
|
246
|
+
innerHTML: __props.config.expandContent(scope.row, __props.config.prop)
|
|
239
247
|
}, null, 8, _hoisted_1$1)) : createCommentVNode("v-if", true),
|
|
240
|
-
|
|
241
|
-
resolveDynamicComponent(
|
|
248
|
+
__props.config.component ? (openBlock(), createBlock(
|
|
249
|
+
resolveDynamicComponent(__props.config.component),
|
|
242
250
|
normalizeProps(mergeProps({ key: 3 }, componentProps(scope.row))),
|
|
243
251
|
null,
|
|
244
252
|
16
|
|
@@ -290,17 +298,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
290
298
|
[
|
|
291
299
|
createCommentVNode(" @ts-nocheck "),
|
|
292
300
|
createVNode(unref(TMagicTableColumn), {
|
|
293
|
-
label:
|
|
294
|
-
width:
|
|
295
|
-
fixed:
|
|
301
|
+
label: __props.config.label,
|
|
302
|
+
width: __props.config.width,
|
|
303
|
+
fixed: __props.config.fixed
|
|
296
304
|
}, {
|
|
297
305
|
default: withCtx((scope) => [
|
|
298
|
-
|
|
306
|
+
__props.config.popover ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
299
307
|
key: 0,
|
|
300
|
-
placement:
|
|
301
|
-
width:
|
|
302
|
-
trigger:
|
|
303
|
-
"destroy-on-close":
|
|
308
|
+
placement: __props.config.popover.placement,
|
|
309
|
+
width: __props.config.popover.width,
|
|
310
|
+
trigger: __props.config.popover.trigger,
|
|
311
|
+
"destroy-on-close": __props.config.popover.destroyOnClose ?? true
|
|
304
312
|
}, {
|
|
305
313
|
reference: withCtx(() => [
|
|
306
314
|
createVNode(
|
|
@@ -312,7 +320,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
312
320
|
{
|
|
313
321
|
default: withCtx(() => [
|
|
314
322
|
createTextVNode(
|
|
315
|
-
toDisplayString(
|
|
323
|
+
toDisplayString(__props.config.text || unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
316
324
|
1
|
|
317
325
|
/* TEXT */
|
|
318
326
|
)
|
|
@@ -325,11 +333,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
325
333
|
)
|
|
326
334
|
]),
|
|
327
335
|
default: withCtx(() => [
|
|
328
|
-
|
|
336
|
+
__props.config.popover.tableEmbed ? (openBlock(), createBlock(_sfc_main, {
|
|
329
337
|
key: 0,
|
|
330
|
-
"show-header":
|
|
331
|
-
columns:
|
|
332
|
-
data:
|
|
338
|
+
"show-header": __props.config.showHeader,
|
|
339
|
+
columns: __props.config.table,
|
|
340
|
+
data: __props.config.prop && scope.row[__props.config.prop] || []
|
|
333
341
|
}, null, 8, ["show-header", "columns", "data"])) : createCommentVNode("v-if", true)
|
|
334
342
|
]),
|
|
335
343
|
_: 2
|
|
@@ -368,63 +376,63 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
368
376
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
369
377
|
return openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
370
378
|
"show-overflow-tooltip": "",
|
|
371
|
-
label:
|
|
372
|
-
width:
|
|
373
|
-
fixed:
|
|
374
|
-
sortable:
|
|
375
|
-
prop:
|
|
379
|
+
label: __props.config.label,
|
|
380
|
+
width: __props.config.width,
|
|
381
|
+
fixed: __props.config.fixed,
|
|
382
|
+
sortable: __props.config.sortable,
|
|
383
|
+
prop: __props.config.prop
|
|
376
384
|
}, {
|
|
377
385
|
default: withCtx((scope) => [
|
|
378
|
-
|
|
386
|
+
__props.config.type === "index" ? (openBlock(), createElementBlock(
|
|
379
387
|
"div",
|
|
380
388
|
_hoisted_1,
|
|
381
|
-
toDisplayString(
|
|
389
|
+
toDisplayString(__props.config.pageIndex && __props.config.pageSize ? __props.config.pageIndex * __props.config.pageSize + scope.$index + 1 : scope.$index + 1),
|
|
382
390
|
1
|
|
383
391
|
/* TEXT */
|
|
384
|
-
)) :
|
|
392
|
+
)) : __props.config.type && __props.editState[scope.$index] ? (openBlock(), createBlock(unref(TMagicForm), {
|
|
385
393
|
key: 1,
|
|
386
394
|
"label-width": "0",
|
|
387
|
-
model:
|
|
395
|
+
model: __props.editState[scope.$index]
|
|
388
396
|
}, {
|
|
389
397
|
default: withCtx(() => [
|
|
390
398
|
createVNode(_component_m_form_container, {
|
|
391
|
-
prop:
|
|
392
|
-
rules:
|
|
393
|
-
config:
|
|
394
|
-
name:
|
|
395
|
-
model:
|
|
399
|
+
prop: __props.config.prop,
|
|
400
|
+
rules: __props.config.rules,
|
|
401
|
+
config: __props.config,
|
|
402
|
+
name: __props.config.prop,
|
|
403
|
+
model: __props.editState[scope.$index]
|
|
396
404
|
}, null, 8, ["prop", "rules", "config", "name", "model"])
|
|
397
405
|
]),
|
|
398
406
|
_: 2
|
|
399
407
|
/* DYNAMIC */
|
|
400
|
-
}, 1032, ["model"])) :
|
|
408
|
+
}, 1032, ["model"])) : __props.config.action === "actionLink" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
401
409
|
key: 2,
|
|
402
410
|
link: "",
|
|
403
411
|
type: "primary",
|
|
404
|
-
onClick: ($event) =>
|
|
412
|
+
onClick: ($event) => __props.config.handler?.(scope.row)
|
|
405
413
|
}, {
|
|
406
414
|
default: withCtx(() => [
|
|
407
415
|
createElementVNode("span", {
|
|
408
|
-
innerHTML: unref(formatter)(
|
|
416
|
+
innerHTML: unref(formatter)(__props.config, scope.row, { index: scope.$index })
|
|
409
417
|
}, null, 8, _hoisted_2)
|
|
410
418
|
]),
|
|
411
419
|
_: 2
|
|
412
420
|
/* DYNAMIC */
|
|
413
|
-
}, 1032, ["onClick"])) :
|
|
421
|
+
}, 1032, ["onClick"])) : __props.config.action === "img" && __props.config.prop ? (openBlock(), createElementBlock("a", {
|
|
414
422
|
key: 3,
|
|
415
423
|
target: "_blank",
|
|
416
|
-
href: scope.row[
|
|
424
|
+
href: scope.row[__props.config.prop]
|
|
417
425
|
}, [
|
|
418
426
|
createElementVNode("img", {
|
|
419
|
-
src: scope.row[
|
|
427
|
+
src: scope.row[__props.config.prop],
|
|
420
428
|
height: "50"
|
|
421
429
|
}, null, 8, _hoisted_4)
|
|
422
|
-
], 8, _hoisted_3)) :
|
|
430
|
+
], 8, _hoisted_3)) : __props.config.action === "link" && __props.config.prop ? (openBlock(), createElementBlock("a", {
|
|
423
431
|
key: 4,
|
|
424
432
|
target: "_blank",
|
|
425
|
-
href: scope.row[
|
|
433
|
+
href: scope.row[__props.config.prop],
|
|
426
434
|
class: "keep-all"
|
|
427
|
-
}, toDisplayString(scope.row[
|
|
435
|
+
}, toDisplayString(scope.row[__props.config.prop]), 9, _hoisted_5)) : __props.config.action === "tip" ? (openBlock(), createBlock(
|
|
428
436
|
_component_el_tooltip,
|
|
429
437
|
{
|
|
430
438
|
key: 5,
|
|
@@ -435,7 +443,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
435
443
|
createElementVNode(
|
|
436
444
|
"div",
|
|
437
445
|
null,
|
|
438
|
-
toDisplayString(unref(formatter)(
|
|
446
|
+
toDisplayString(unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
439
447
|
1
|
|
440
448
|
/* TEXT */
|
|
441
449
|
)
|
|
@@ -447,7 +455,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
447
455
|
}, {
|
|
448
456
|
default: withCtx(() => [
|
|
449
457
|
createTextVNode(
|
|
450
|
-
toDisplayString(
|
|
458
|
+
toDisplayString(__props.config.buttonText || "扩展配置"),
|
|
451
459
|
1
|
|
452
460
|
/* TEXT */
|
|
453
461
|
)
|
|
@@ -461,14 +469,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
461
469
|
},
|
|
462
470
|
1024
|
|
463
471
|
/* DYNAMIC_SLOTS */
|
|
464
|
-
)) :
|
|
472
|
+
)) : __props.config.action === "tag" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicTag), {
|
|
465
473
|
key: 6,
|
|
466
|
-
type: typeof
|
|
474
|
+
type: typeof __props.config.type === "function" ? __props.config.type(scope.row[__props.config.prop], scope.row) : __props.config.type,
|
|
467
475
|
"close-transition": ""
|
|
468
476
|
}, {
|
|
469
477
|
default: withCtx(() => [
|
|
470
478
|
createTextVNode(
|
|
471
|
-
toDisplayString(unref(formatter)(
|
|
479
|
+
toDisplayString(unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
472
480
|
1
|
|
473
481
|
/* TEXT */
|
|
474
482
|
)
|
|
@@ -477,7 +485,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
477
485
|
/* DYNAMIC */
|
|
478
486
|
}, 1032, ["type"])) : (openBlock(), createElementBlock("div", {
|
|
479
487
|
key: 7,
|
|
480
|
-
innerHTML: unref(formatter)(
|
|
488
|
+
innerHTML: unref(formatter)(__props.config, scope.row, { index: scope.$index })
|
|
481
489
|
}, null, 8, _hoisted_6))
|
|
482
490
|
]),
|
|
483
491
|
_: 1
|
|
@@ -585,13 +593,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
585
593
|
ref_key: "tMagicTable",
|
|
586
594
|
ref: tMagicTable,
|
|
587
595
|
data: tableData.value,
|
|
588
|
-
"show-header":
|
|
589
|
-
"max-height":
|
|
590
|
-
"default-expand-all":
|
|
596
|
+
"show-header": __props.showHeader,
|
|
597
|
+
"max-height": __props.bodyHeight,
|
|
598
|
+
"default-expand-all": __props.defaultExpandAll,
|
|
591
599
|
border: hasBorder.value,
|
|
592
|
-
"row-key":
|
|
600
|
+
"row-key": __props.rowkeyName || "id",
|
|
593
601
|
"tree-props": { children: "children" },
|
|
594
|
-
"empty-text":
|
|
602
|
+
"empty-text": __props.emptyText || "暂无数据",
|
|
595
603
|
"span-method": objectSpanMethod,
|
|
596
604
|
onSortChange: sortChange,
|
|
597
605
|
onSelect: selectHandler,
|
|
@@ -604,7 +612,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
604
612
|
(openBlock(true), createElementBlock(
|
|
605
613
|
Fragment,
|
|
606
614
|
null,
|
|
607
|
-
renderList(
|
|
615
|
+
renderList(__props.columns, (item, columnIndex) => {
|
|
608
616
|
return openBlock(), createElementBlock(
|
|
609
617
|
Fragment,
|
|
610
618
|
null,
|
|
@@ -621,9 +629,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
621
629
|
key: columnIndex,
|
|
622
630
|
selectable: item.selectable
|
|
623
631
|
}, null, 8, ["selectable"])) : item.actions ? (openBlock(), createBlock(_sfc_main$5, {
|
|
624
|
-
columns:
|
|
632
|
+
columns: __props.columns,
|
|
625
633
|
config: item,
|
|
626
|
-
"rowkey-name":
|
|
634
|
+
"rowkey-name": __props.rowkeyName,
|
|
627
635
|
"edit-state": editState.value,
|
|
628
636
|
key: columnIndex,
|
|
629
637
|
onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("after-action"))
|
|
@@ -647,7 +655,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
647
655
|
_: 1
|
|
648
656
|
/* STABLE */
|
|
649
657
|
}, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text"])), [
|
|
650
|
-
[_directive_loading,
|
|
658
|
+
[_directive_loading, __props.loading]
|
|
651
659
|
]);
|
|
652
660
|
};
|
|
653
661
|
}
|
|
@@ -2091,15 +2091,15 @@
|
|
|
2091
2091
|
};
|
|
2092
2092
|
return (_ctx, _cache) => {
|
|
2093
2093
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
2094
|
-
label:
|
|
2095
|
-
width:
|
|
2096
|
-
fixed:
|
|
2094
|
+
label: __props.config.label,
|
|
2095
|
+
width: __props.config.width,
|
|
2096
|
+
fixed: __props.config.fixed
|
|
2097
2097
|
}, {
|
|
2098
2098
|
default: vue.withCtx((scope) => [
|
|
2099
2099
|
(vue.openBlock(true), vue.createElementBlock(
|
|
2100
2100
|
vue.Fragment,
|
|
2101
2101
|
null,
|
|
2102
|
-
vue.renderList(
|
|
2102
|
+
vue.renderList(__props.config.actions, (action, actionIndex) => {
|
|
2103
2103
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
2104
2104
|
placement: action.tooltipPlacement || "top",
|
|
2105
2105
|
key: actionIndex,
|
|
@@ -2123,7 +2123,7 @@
|
|
|
2123
2123
|
_: 2
|
|
2124
2124
|
/* DYNAMIC */
|
|
2125
2125
|
}, 1032, ["type", "icon", "onClick"]), [
|
|
2126
|
-
[vue.vShow, display(action.display, scope.row) && !
|
|
2126
|
+
[vue.vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
|
|
2127
2127
|
])
|
|
2128
2128
|
]),
|
|
2129
2129
|
_: 2
|
|
@@ -2138,30 +2138,38 @@
|
|
|
2138
2138
|
link: "",
|
|
2139
2139
|
type: "primary",
|
|
2140
2140
|
size: "small",
|
|
2141
|
-
onClick: ($event) => save(scope.$index,
|
|
2141
|
+
onClick: ($event) => save(scope.$index, __props.config)
|
|
2142
2142
|
}, {
|
|
2143
|
-
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
2144
|
-
vue.createTextVNode(
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2143
|
+
default: vue.withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
2144
|
+
vue.createTextVNode(
|
|
2145
|
+
"保存",
|
|
2146
|
+
-1
|
|
2147
|
+
/* CACHED */
|
|
2148
|
+
)
|
|
2149
|
+
])]),
|
|
2150
|
+
_: 1
|
|
2151
|
+
/* STABLE */
|
|
2152
|
+
}, 8, ["onClick"]), [
|
|
2153
|
+
[vue.vShow, __props.editState[scope.$index]]
|
|
2150
2154
|
]),
|
|
2151
2155
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
2152
2156
|
class: "action-btn",
|
|
2153
2157
|
link: "",
|
|
2154
2158
|
type: "primary",
|
|
2155
2159
|
size: "small",
|
|
2156
|
-
onClick: ($event) =>
|
|
2160
|
+
onClick: ($event) => __props.editState[scope.$index] = void 0
|
|
2157
2161
|
}, {
|
|
2158
|
-
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
2159
|
-
vue.createTextVNode(
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2162
|
+
default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
2163
|
+
vue.createTextVNode(
|
|
2164
|
+
"取消",
|
|
2165
|
+
-1
|
|
2166
|
+
/* CACHED */
|
|
2167
|
+
)
|
|
2168
|
+
])]),
|
|
2169
|
+
_: 1
|
|
2170
|
+
/* STABLE */
|
|
2171
|
+
}, 8, ["onClick"]), [
|
|
2172
|
+
[vue.vShow, __props.editState[scope.$index]]
|
|
2165
2173
|
])
|
|
2166
2174
|
]),
|
|
2167
2175
|
_: 1
|
|
@@ -2196,15 +2204,15 @@
|
|
|
2196
2204
|
return (_ctx, _cache) => {
|
|
2197
2205
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
2198
2206
|
"show-overflow-tooltip": "",
|
|
2199
|
-
label:
|
|
2200
|
-
width:
|
|
2201
|
-
fixed:
|
|
2202
|
-
sortable:
|
|
2203
|
-
prop:
|
|
2207
|
+
label: __props.config.label,
|
|
2208
|
+
width: __props.config.width,
|
|
2209
|
+
fixed: __props.config.fixed,
|
|
2210
|
+
sortable: __props.config.sortable,
|
|
2211
|
+
prop: __props.config.prop
|
|
2204
2212
|
}, {
|
|
2205
2213
|
default: vue.withCtx((scope) => [
|
|
2206
2214
|
(vue.openBlock(), vue.createBlock(
|
|
2207
|
-
vue.resolveDynamicComponent(
|
|
2215
|
+
vue.resolveDynamicComponent(__props.config.component),
|
|
2208
2216
|
vue.mergeProps(componentProps(scope.row, scope.$index), vue.toHandlers(componentListeners(scope.row, scope.$index))),
|
|
2209
2217
|
null,
|
|
2210
2218
|
16
|
|
@@ -2243,27 +2251,27 @@
|
|
|
2243
2251
|
vue.createCommentVNode(" @ts-nocheck "),
|
|
2244
2252
|
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
2245
2253
|
type: "expand",
|
|
2246
|
-
width:
|
|
2247
|
-
fixed:
|
|
2254
|
+
width: __props.config.width,
|
|
2255
|
+
fixed: __props.config.fixed
|
|
2248
2256
|
}, {
|
|
2249
2257
|
default: vue.withCtx((scope) => [
|
|
2250
|
-
|
|
2258
|
+
__props.config.table ? (vue.openBlock(), vue.createBlock(_sfc_main, {
|
|
2251
2259
|
key: 0,
|
|
2252
2260
|
"show-header": false,
|
|
2253
|
-
columns:
|
|
2254
|
-
data:
|
|
2261
|
+
columns: __props.config.table,
|
|
2262
|
+
data: __props.config.prop && scope.row[__props.config.prop] || []
|
|
2255
2263
|
}, null, 8, ["columns", "data"])) : vue.createCommentVNode("v-if", true),
|
|
2256
|
-
|
|
2264
|
+
__props.config.form ? (vue.openBlock(), vue.createBlock(vue.unref(form.MForm), {
|
|
2257
2265
|
key: 1,
|
|
2258
|
-
config:
|
|
2259
|
-
"init-values":
|
|
2266
|
+
config: __props.config.form,
|
|
2267
|
+
"init-values": __props.config.values || __props.config.prop && scope.row[__props.config.prop] || {}
|
|
2260
2268
|
}, null, 8, ["config", "init-values"])) : vue.createCommentVNode("v-if", true),
|
|
2261
|
-
|
|
2269
|
+
__props.config.expandContent ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2262
2270
|
key: 2,
|
|
2263
|
-
innerHTML:
|
|
2271
|
+
innerHTML: __props.config.expandContent(scope.row, __props.config.prop)
|
|
2264
2272
|
}, null, 8, _hoisted_1$1)) : vue.createCommentVNode("v-if", true),
|
|
2265
|
-
|
|
2266
|
-
vue.resolveDynamicComponent(
|
|
2273
|
+
__props.config.component ? (vue.openBlock(), vue.createBlock(
|
|
2274
|
+
vue.resolveDynamicComponent(__props.config.component),
|
|
2267
2275
|
vue.normalizeProps(vue.mergeProps({ key: 3 }, componentProps(scope.row))),
|
|
2268
2276
|
null,
|
|
2269
2277
|
16
|
|
@@ -2315,17 +2323,17 @@
|
|
|
2315
2323
|
[
|
|
2316
2324
|
vue.createCommentVNode(" @ts-nocheck "),
|
|
2317
2325
|
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
2318
|
-
label:
|
|
2319
|
-
width:
|
|
2320
|
-
fixed:
|
|
2326
|
+
label: __props.config.label,
|
|
2327
|
+
width: __props.config.width,
|
|
2328
|
+
fixed: __props.config.fixed
|
|
2321
2329
|
}, {
|
|
2322
2330
|
default: vue.withCtx((scope) => [
|
|
2323
|
-
|
|
2331
|
+
__props.config.popover ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
2324
2332
|
key: 0,
|
|
2325
|
-
placement:
|
|
2326
|
-
width:
|
|
2327
|
-
trigger:
|
|
2328
|
-
"destroy-on-close":
|
|
2333
|
+
placement: __props.config.popover.placement,
|
|
2334
|
+
width: __props.config.popover.width,
|
|
2335
|
+
trigger: __props.config.popover.trigger,
|
|
2336
|
+
"destroy-on-close": __props.config.popover.destroyOnClose ?? true
|
|
2329
2337
|
}, {
|
|
2330
2338
|
reference: vue.withCtx(() => [
|
|
2331
2339
|
vue.createVNode(
|
|
@@ -2337,7 +2345,7 @@
|
|
|
2337
2345
|
{
|
|
2338
2346
|
default: vue.withCtx(() => [
|
|
2339
2347
|
vue.createTextVNode(
|
|
2340
|
-
vue.toDisplayString(
|
|
2348
|
+
vue.toDisplayString(__props.config.text || vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
2341
2349
|
1
|
|
2342
2350
|
/* TEXT */
|
|
2343
2351
|
)
|
|
@@ -2350,11 +2358,11 @@
|
|
|
2350
2358
|
)
|
|
2351
2359
|
]),
|
|
2352
2360
|
default: vue.withCtx(() => [
|
|
2353
|
-
|
|
2361
|
+
__props.config.popover.tableEmbed ? (vue.openBlock(), vue.createBlock(_sfc_main, {
|
|
2354
2362
|
key: 0,
|
|
2355
|
-
"show-header":
|
|
2356
|
-
columns:
|
|
2357
|
-
data:
|
|
2363
|
+
"show-header": __props.config.showHeader,
|
|
2364
|
+
columns: __props.config.table,
|
|
2365
|
+
data: __props.config.prop && scope.row[__props.config.prop] || []
|
|
2358
2366
|
}, null, 8, ["show-header", "columns", "data"])) : vue.createCommentVNode("v-if", true)
|
|
2359
2367
|
]),
|
|
2360
2368
|
_: 2
|
|
@@ -2393,63 +2401,63 @@
|
|
|
2393
2401
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
2394
2402
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
2395
2403
|
"show-overflow-tooltip": "",
|
|
2396
|
-
label:
|
|
2397
|
-
width:
|
|
2398
|
-
fixed:
|
|
2399
|
-
sortable:
|
|
2400
|
-
prop:
|
|
2404
|
+
label: __props.config.label,
|
|
2405
|
+
width: __props.config.width,
|
|
2406
|
+
fixed: __props.config.fixed,
|
|
2407
|
+
sortable: __props.config.sortable,
|
|
2408
|
+
prop: __props.config.prop
|
|
2401
2409
|
}, {
|
|
2402
2410
|
default: vue.withCtx((scope) => [
|
|
2403
|
-
|
|
2411
|
+
__props.config.type === "index" ? (vue.openBlock(), vue.createElementBlock(
|
|
2404
2412
|
"div",
|
|
2405
2413
|
_hoisted_1,
|
|
2406
|
-
vue.toDisplayString(
|
|
2414
|
+
vue.toDisplayString(__props.config.pageIndex && __props.config.pageSize ? __props.config.pageIndex * __props.config.pageSize + scope.$index + 1 : scope.$index + 1),
|
|
2407
2415
|
1
|
|
2408
2416
|
/* TEXT */
|
|
2409
|
-
)) :
|
|
2417
|
+
)) : __props.config.type && __props.editState[scope.$index] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicForm), {
|
|
2410
2418
|
key: 1,
|
|
2411
2419
|
"label-width": "0",
|
|
2412
|
-
model:
|
|
2420
|
+
model: __props.editState[scope.$index]
|
|
2413
2421
|
}, {
|
|
2414
2422
|
default: vue.withCtx(() => [
|
|
2415
2423
|
vue.createVNode(_component_m_form_container, {
|
|
2416
|
-
prop:
|
|
2417
|
-
rules:
|
|
2418
|
-
config:
|
|
2419
|
-
name:
|
|
2420
|
-
model:
|
|
2424
|
+
prop: __props.config.prop,
|
|
2425
|
+
rules: __props.config.rules,
|
|
2426
|
+
config: __props.config,
|
|
2427
|
+
name: __props.config.prop,
|
|
2428
|
+
model: __props.editState[scope.$index]
|
|
2421
2429
|
}, null, 8, ["prop", "rules", "config", "name", "model"])
|
|
2422
2430
|
]),
|
|
2423
2431
|
_: 2
|
|
2424
2432
|
/* DYNAMIC */
|
|
2425
|
-
}, 1032, ["model"])) :
|
|
2433
|
+
}, 1032, ["model"])) : __props.config.action === "actionLink" && __props.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
2426
2434
|
key: 2,
|
|
2427
2435
|
link: "",
|
|
2428
2436
|
type: "primary",
|
|
2429
|
-
onClick: ($event) =>
|
|
2437
|
+
onClick: ($event) => __props.config.handler?.(scope.row)
|
|
2430
2438
|
}, {
|
|
2431
2439
|
default: vue.withCtx(() => [
|
|
2432
2440
|
vue.createElementVNode("span", {
|
|
2433
|
-
innerHTML: vue.unref(formatter)(
|
|
2441
|
+
innerHTML: vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })
|
|
2434
2442
|
}, null, 8, _hoisted_2)
|
|
2435
2443
|
]),
|
|
2436
2444
|
_: 2
|
|
2437
2445
|
/* DYNAMIC */
|
|
2438
|
-
}, 1032, ["onClick"])) :
|
|
2446
|
+
}, 1032, ["onClick"])) : __props.config.action === "img" && __props.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
2439
2447
|
key: 3,
|
|
2440
2448
|
target: "_blank",
|
|
2441
|
-
href: scope.row[
|
|
2449
|
+
href: scope.row[__props.config.prop]
|
|
2442
2450
|
}, [
|
|
2443
2451
|
vue.createElementVNode("img", {
|
|
2444
|
-
src: scope.row[
|
|
2452
|
+
src: scope.row[__props.config.prop],
|
|
2445
2453
|
height: "50"
|
|
2446
2454
|
}, null, 8, _hoisted_4)
|
|
2447
|
-
], 8, _hoisted_3)) :
|
|
2455
|
+
], 8, _hoisted_3)) : __props.config.action === "link" && __props.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
2448
2456
|
key: 4,
|
|
2449
2457
|
target: "_blank",
|
|
2450
|
-
href: scope.row[
|
|
2458
|
+
href: scope.row[__props.config.prop],
|
|
2451
2459
|
class: "keep-all"
|
|
2452
|
-
}, vue.toDisplayString(scope.row[
|
|
2460
|
+
}, vue.toDisplayString(scope.row[__props.config.prop]), 9, _hoisted_5)) : __props.config.action === "tip" ? (vue.openBlock(), vue.createBlock(
|
|
2453
2461
|
_component_el_tooltip,
|
|
2454
2462
|
{
|
|
2455
2463
|
key: 5,
|
|
@@ -2460,7 +2468,7 @@
|
|
|
2460
2468
|
vue.createElementVNode(
|
|
2461
2469
|
"div",
|
|
2462
2470
|
null,
|
|
2463
|
-
vue.toDisplayString(vue.unref(formatter)(
|
|
2471
|
+
vue.toDisplayString(vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
2464
2472
|
1
|
|
2465
2473
|
/* TEXT */
|
|
2466
2474
|
)
|
|
@@ -2472,7 +2480,7 @@
|
|
|
2472
2480
|
}, {
|
|
2473
2481
|
default: vue.withCtx(() => [
|
|
2474
2482
|
vue.createTextVNode(
|
|
2475
|
-
vue.toDisplayString(
|
|
2483
|
+
vue.toDisplayString(__props.config.buttonText || "扩展配置"),
|
|
2476
2484
|
1
|
|
2477
2485
|
/* TEXT */
|
|
2478
2486
|
)
|
|
@@ -2486,14 +2494,14 @@
|
|
|
2486
2494
|
},
|
|
2487
2495
|
1024
|
|
2488
2496
|
/* DYNAMIC_SLOTS */
|
|
2489
|
-
)) :
|
|
2497
|
+
)) : __props.config.action === "tag" && __props.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTag), {
|
|
2490
2498
|
key: 6,
|
|
2491
|
-
type: typeof
|
|
2499
|
+
type: typeof __props.config.type === "function" ? __props.config.type(scope.row[__props.config.prop], scope.row) : __props.config.type,
|
|
2492
2500
|
"close-transition": ""
|
|
2493
2501
|
}, {
|
|
2494
2502
|
default: vue.withCtx(() => [
|
|
2495
2503
|
vue.createTextVNode(
|
|
2496
|
-
vue.toDisplayString(vue.unref(formatter)(
|
|
2504
|
+
vue.toDisplayString(vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
|
|
2497
2505
|
1
|
|
2498
2506
|
/* TEXT */
|
|
2499
2507
|
)
|
|
@@ -2502,7 +2510,7 @@
|
|
|
2502
2510
|
/* DYNAMIC */
|
|
2503
2511
|
}, 1032, ["type"])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
2504
2512
|
key: 7,
|
|
2505
|
-
innerHTML: vue.unref(formatter)(
|
|
2513
|
+
innerHTML: vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })
|
|
2506
2514
|
}, null, 8, _hoisted_6))
|
|
2507
2515
|
]),
|
|
2508
2516
|
_: 1
|
|
@@ -2610,13 +2618,13 @@
|
|
|
2610
2618
|
ref_key: "tMagicTable",
|
|
2611
2619
|
ref: tMagicTable,
|
|
2612
2620
|
data: tableData.value,
|
|
2613
|
-
"show-header":
|
|
2614
|
-
"max-height":
|
|
2615
|
-
"default-expand-all":
|
|
2621
|
+
"show-header": __props.showHeader,
|
|
2622
|
+
"max-height": __props.bodyHeight,
|
|
2623
|
+
"default-expand-all": __props.defaultExpandAll,
|
|
2616
2624
|
border: hasBorder.value,
|
|
2617
|
-
"row-key":
|
|
2625
|
+
"row-key": __props.rowkeyName || "id",
|
|
2618
2626
|
"tree-props": { children: "children" },
|
|
2619
|
-
"empty-text":
|
|
2627
|
+
"empty-text": __props.emptyText || "暂无数据",
|
|
2620
2628
|
"span-method": objectSpanMethod,
|
|
2621
2629
|
onSortChange: sortChange,
|
|
2622
2630
|
onSelect: selectHandler,
|
|
@@ -2629,7 +2637,7 @@
|
|
|
2629
2637
|
(vue.openBlock(true), vue.createElementBlock(
|
|
2630
2638
|
vue.Fragment,
|
|
2631
2639
|
null,
|
|
2632
|
-
vue.renderList(
|
|
2640
|
+
vue.renderList(__props.columns, (item, columnIndex) => {
|
|
2633
2641
|
return vue.openBlock(), vue.createElementBlock(
|
|
2634
2642
|
vue.Fragment,
|
|
2635
2643
|
null,
|
|
@@ -2646,9 +2654,9 @@
|
|
|
2646
2654
|
key: columnIndex,
|
|
2647
2655
|
selectable: item.selectable
|
|
2648
2656
|
}, null, 8, ["selectable"])) : item.actions ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
|
|
2649
|
-
columns:
|
|
2657
|
+
columns: __props.columns,
|
|
2650
2658
|
config: item,
|
|
2651
|
-
"rowkey-name":
|
|
2659
|
+
"rowkey-name": __props.rowkeyName,
|
|
2652
2660
|
"edit-state": editState.value,
|
|
2653
2661
|
key: columnIndex,
|
|
2654
2662
|
onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("after-action"))
|
|
@@ -2672,7 +2680,7 @@
|
|
|
2672
2680
|
_: 1
|
|
2673
2681
|
/* STABLE */
|
|
2674
2682
|
}, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text"])), [
|
|
2675
|
-
[_directive_loading,
|
|
2683
|
+
[_directive_loading, __props.loading]
|
|
2676
2684
|
]);
|
|
2677
2685
|
};
|
|
2678
2686
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.6.
|
|
2
|
+
"version": "1.6.1",
|
|
3
3
|
"name": "@tmagic/table",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@types/lodash-es": "^4.17.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"vue": "^3.5.
|
|
46
|
-
"typescript": "^5.
|
|
47
|
-
"@tmagic/design": "1.6.
|
|
48
|
-
"@tmagic/form": "1.6.
|
|
45
|
+
"vue": "^3.5.22",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"@tmagic/design": "1.6.1",
|
|
48
|
+
"@tmagic/form": "1.6.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"typescript": {
|
package/types/index.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ type __VLS_Props = {
|
|
|
84
84
|
/** 是否带有纵向边框 */
|
|
85
85
|
border?: boolean;
|
|
86
86
|
};
|
|
87
|
-
declare const
|
|
87
|
+
declare const __VLS_export: _vue_runtime_core.DefineComponent<__VLS_Props, {
|
|
88
88
|
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
89
89
|
toggleRowExpansion: (row: any, expanded: boolean) => void;
|
|
90
90
|
clearSelection: () => void;
|
|
@@ -111,6 +111,7 @@ declare const _default$1: _vue_runtime_core.DefineComponent<__VLS_Props, {
|
|
|
111
111
|
columns: ColumnConfig[];
|
|
112
112
|
showHeader: boolean;
|
|
113
113
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
114
|
+
declare const _default$1: typeof __VLS_export;
|
|
114
115
|
|
|
115
116
|
declare const formatter: (item: ColumnConfig, row: any, data: {
|
|
116
117
|
index: number;
|