@tmagic/table 1.2.0-beta.2 → 1.2.0-beta.21

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.
@@ -1,594 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lodash-es'), require('element-plus'), require('@tmagic/form'), require('@tmagic/utils')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vue', 'lodash-es', 'element-plus', '@tmagic/form', '@tmagic/utils'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicTable = {}, global.Vue, global.lodashEs, global.ElementPlus, global.form, global.utils));
5
- })(this, (function (exports, vue, lodashEs, elementPlus, form, utils) { 'use strict';
6
-
7
- const _hoisted_1$1 = /* @__PURE__ */ vue.createTextVNode("\u4FDD\u5B58");
8
- const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
9
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
10
- __name: "ActionsColumn",
11
- props: {
12
- columns: {
13
- type: Array,
14
- require: true,
15
- default: () => []
16
- },
17
- config: {
18
- type: Object,
19
- require: true,
20
- default: () => {
21
- }
22
- },
23
- rowkeyName: {
24
- type: String,
25
- default: "c_id"
26
- },
27
- editState: {
28
- type: Object,
29
- default: () => {
30
- }
31
- }
32
- },
33
- emits: ["afterAction"],
34
- setup(__props, { emit }) {
35
- const props = __props;
36
- const display = (fuc, row) => {
37
- if (typeof fuc === "function") {
38
- return fuc(row);
39
- }
40
- return true;
41
- };
42
- const success = (msg, action, row) => {
43
- elementPlus.ElMessage.success(msg);
44
- action.after?.(row);
45
- };
46
- const error = (msg) => elementPlus.ElMessage.error(msg);
47
- const deleteAction = async (action, row) => {
48
- await elementPlus.ElMessageBox.confirm(`\u786E\u8BA4\u5220\u9664${row[action.name || "c_name"]}(${row[props.rowkeyName]})?`, "\u63D0\u793A", {
49
- confirmButtonText: "\u786E\u5B9A",
50
- cancelButtonText: "\u53D6\u6D88",
51
- type: "warning"
52
- });
53
- const res = await action.handler?.(row);
54
- if (res.ret === 0) {
55
- success("\u5220\u9664\u6210\u529F!", action, row);
56
- } else {
57
- error(res.msg || "\u5220\u9664\u5931\u8D25");
58
- }
59
- };
60
- const copyHandler = async (action, row) => {
61
- await elementPlus.ElMessageBox.confirm(`\u786E\u5B9A\u590D\u5236${row[action.name || "c_name"]}(${row.c_id})?`, "\u63D0\u793A", {
62
- confirmButtonText: "\u786E\u5B9A",
63
- cancelButtonText: "\u53D6\u6D88",
64
- type: "warning"
65
- });
66
- try {
67
- const res = await action.handler?.(row);
68
- if (res.ret === 0) {
69
- success("\u590D\u5236\u6210\u529F!", action, row);
70
- } else {
71
- error(`\u590D\u5236\u5931\u8D25!${res.msg}`);
72
- }
73
- } catch (e) {
74
- error("\u590D\u5236\u5931\u8D25!");
75
- }
76
- };
77
- const actionHandler = async (action, row, index) => {
78
- await action.before?.(row);
79
- if (action.type === "delete") {
80
- await deleteAction(action, row);
81
- } else if (action.type === "copy") {
82
- await copyHandler(action, row);
83
- } else if (action.type === "edit") {
84
- props.editState[index] = row;
85
- } else {
86
- await action.handler?.(row);
87
- }
88
- action.after?.(row);
89
- };
90
- const save = async (index, config) => {
91
- const action = config.actions?.find((item) => item.type === "edit")?.action;
92
- if (!action)
93
- return;
94
- const data = {};
95
- const row = props.editState[index];
96
- props.columns.filter((item) => item.type).forEach((column) => {
97
- data[column.prop] = row[column.prop];
98
- });
99
- const res = await action({
100
- data
101
- });
102
- if (res) {
103
- if (res.ret === 0) {
104
- elementPlus.ElMessage.success("\u4FDD\u5B58\u6210\u529F");
105
- props.editState[index] = void 0;
106
- emit("afterAction");
107
- } else {
108
- elementPlus.ElMessage.error({
109
- duration: 1e4,
110
- showClose: true,
111
- dangerouslyUseHTMLString: true,
112
- message: res.msg || "\u4FDD\u5B58\u5931\u8D25"
113
- });
114
- }
115
- } else {
116
- props.editState[index] = void 0;
117
- emit("afterAction");
118
- }
119
- };
120
- return (_ctx, _cache) => {
121
- const _component_el_button = vue.resolveComponent("el-button");
122
- const _component_el_table_column = vue.resolveComponent("el-table-column");
123
- return vue.openBlock(), vue.createBlock(_component_el_table_column, {
124
- label: __props.config.label,
125
- width: __props.config.width,
126
- fixed: __props.config.fixed
127
- }, {
128
- default: vue.withCtx((scope) => [
129
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.actions, (action, actionIndex) => {
130
- return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_button, {
131
- innerHTML: action.text,
132
- class: "action-btn",
133
- text: "",
134
- type: "primary",
135
- size: "small",
136
- key: actionIndex,
137
- onClick: ($event) => actionHandler(action, scope.row, scope.$index)
138
- }, null, 8, ["innerHTML", "onClick"])), [
139
- [vue.vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
140
- ]);
141
- }), 128)),
142
- vue.withDirectives(vue.createVNode(_component_el_button, {
143
- class: "action-btn",
144
- text: "",
145
- type: "primary",
146
- size: "small",
147
- onClick: ($event) => save(scope.$index, __props.config)
148
- }, {
149
- default: vue.withCtx(() => [
150
- _hoisted_1$1
151
- ]),
152
- _: 2
153
- }, 1032, ["onClick"]), [
154
- [vue.vShow, __props.editState[scope.$index]]
155
- ]),
156
- vue.withDirectives(vue.createVNode(_component_el_button, {
157
- class: "action-btn",
158
- text: "",
159
- type: "primary",
160
- size: "small",
161
- onClick: ($event) => __props.editState[scope.$index] = void 0
162
- }, {
163
- default: vue.withCtx(() => [
164
- _hoisted_2$1
165
- ]),
166
- _: 2
167
- }, 1032, ["onClick"]), [
168
- [vue.vShow, __props.editState[scope.$index]]
169
- ])
170
- ]),
171
- _: 1
172
- }, 8, ["label", "width", "fixed"]);
173
- };
174
- }
175
- });
176
-
177
- const _sfc_main$3 = vue.defineComponent({
178
- components: { MForm: form.MForm },
179
- props: {
180
- config: {
181
- type: Object,
182
- default: () => ({}),
183
- required: true
184
- }
185
- }
186
- });
187
-
188
- const _export_sfc = (sfc, props) => {
189
- const target = sfc.__vccOpts || sfc;
190
- for (const [key, val] of props) {
191
- target[key] = val;
192
- }
193
- return target;
194
- };
195
-
196
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
197
- const _component_m_table = vue.resolveComponent("m-table");
198
- const _component_m_form = vue.resolveComponent("m-form");
199
- const _component_el_table_column = vue.resolveComponent("el-table-column");
200
- return vue.openBlock(), vue.createBlock(_component_el_table_column, { type: "expand" }, {
201
- default: vue.withCtx((scope) => [
202
- _ctx.config.table ? (vue.openBlock(), vue.createBlock(_component_m_table, {
203
- key: 0,
204
- "show-header": false,
205
- columns: _ctx.config.table,
206
- data: scope.row[_ctx.config.prop]
207
- }, null, 8, ["columns", "data"])) : vue.createCommentVNode("", true),
208
- _ctx.config.form ? (vue.openBlock(), vue.createBlock(_component_m_form, {
209
- key: 1,
210
- config: _ctx.config.form,
211
- "init-values": _ctx.config.values || scope.row[_ctx.config.prop] || {}
212
- }, null, 8, ["config", "init-values"])) : vue.createCommentVNode("", true)
213
- ]),
214
- _: 1
215
- });
216
- }
217
- const ExpandColumn = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
218
-
219
- const formatter = (item, row) => {
220
- if (item.formatter) {
221
- if (item.formatter === "datetime") {
222
- item.formatter = (value) => utils.datetimeFormatter(value);
223
- }
224
- try {
225
- return item.formatter(row[item.prop], row);
226
- } catch (e) {
227
- return row[item.prop];
228
- }
229
- } else {
230
- return row[item.prop];
231
- }
232
- };
233
-
234
- const _sfc_main$2 = vue.defineComponent({
235
- props: {
236
- config: {
237
- type: Object,
238
- default: () => ({}),
239
- required: true
240
- }
241
- },
242
- setup() {
243
- return {
244
- formatter
245
- };
246
- }
247
- });
248
-
249
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
250
- const _component_m_table = vue.resolveComponent("m-table");
251
- const _component_el_button = vue.resolveComponent("el-button");
252
- const _component_el_popover = vue.resolveComponent("el-popover");
253
- const _component_el_table_column = vue.resolveComponent("el-table-column");
254
- return vue.openBlock(), vue.createBlock(_component_el_table_column, {
255
- label: _ctx.config.label,
256
- width: _ctx.config.width,
257
- fixed: _ctx.config.fixed
258
- }, {
259
- default: vue.withCtx((scope) => [
260
- vue.createVNode(_component_el_popover, {
261
- placement: _ctx.config.popover.placement,
262
- width: _ctx.config.popover.width,
263
- trigger: _ctx.config.popover.trigger
264
- }, {
265
- reference: vue.withCtx(() => [
266
- vue.createVNode(_component_el_button, {
267
- text: "",
268
- type: "primary"
269
- }, {
270
- default: vue.withCtx(() => [
271
- vue.createTextVNode(vue.toDisplayString(_ctx.config.text || _ctx.formatter(_ctx.config, scope.row)), 1)
272
- ]),
273
- _: 2
274
- }, 1024)
275
- ]),
276
- default: vue.withCtx(() => [
277
- _ctx.config.popover.tableEmbed ? (vue.openBlock(), vue.createBlock(_component_m_table, {
278
- key: 0,
279
- "show-header": _ctx.config.showHeader,
280
- columns: _ctx.config.table,
281
- data: scope.row[_ctx.config.prop]
282
- }, null, 8, ["show-header", "columns", "data"])) : vue.createCommentVNode("", true)
283
- ]),
284
- _: 2
285
- }, 1032, ["placement", "width", "trigger"])
286
- ]),
287
- _: 1
288
- }, 8, ["label", "width", "fixed"]);
289
- }
290
- const PopoverColumn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
291
-
292
- const _sfc_main$1 = vue.defineComponent({
293
- props: {
294
- config: {
295
- type: Object,
296
- default: () => ({}),
297
- required: true
298
- },
299
- editState: {
300
- type: Object,
301
- default: () => {
302
- }
303
- }
304
- },
305
- setup() {
306
- return {
307
- formatter
308
- };
309
- }
310
- });
311
-
312
- const _hoisted_1 = ["href"];
313
- const _hoisted_2 = ["src"];
314
- const _hoisted_3 = ["href"];
315
- const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("\u6269\u5C55\u914D\u7F6E");
316
- const _hoisted_5 = ["innerHTML"];
317
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
318
- const _component_m_form_container = vue.resolveComponent("m-form-container");
319
- const _component_el_form = vue.resolveComponent("el-form");
320
- const _component_el_button = vue.resolveComponent("el-button");
321
- const _component_el_tooltip = vue.resolveComponent("el-tooltip");
322
- const _component_el_tag = vue.resolveComponent("el-tag");
323
- const _component_el_table_column = vue.resolveComponent("el-table-column");
324
- return vue.openBlock(), vue.createBlock(_component_el_table_column, {
325
- "show-overflow-tooltip": "",
326
- label: _ctx.config.label,
327
- width: _ctx.config.width,
328
- fixed: _ctx.config.fixed,
329
- sortable: _ctx.config.sortable,
330
- prop: _ctx.config.prop
331
- }, {
332
- default: vue.withCtx((scope) => [
333
- _ctx.config.type && _ctx.editState[scope.$index] ? (vue.openBlock(), vue.createBlock(_component_el_form, {
334
- key: 0,
335
- "label-width": "0",
336
- model: _ctx.editState[scope.$index]
337
- }, {
338
- default: vue.withCtx(() => [
339
- vue.createVNode(_component_m_form_container, {
340
- prop: _ctx.config.prop,
341
- rules: _ctx.config.rules,
342
- config: _ctx.config,
343
- name: _ctx.config.prop,
344
- model: _ctx.editState[scope.$index]
345
- }, null, 8, ["prop", "rules", "config", "name", "model"])
346
- ]),
347
- _: 2
348
- }, 1032, ["model"])) : _ctx.config.action === "actionLink" ? (vue.openBlock(), vue.createBlock(_component_el_button, {
349
- key: 1,
350
- text: "",
351
- type: "primary",
352
- onClick: ($event) => _ctx.config.handler(scope.row)
353
- }, {
354
- default: vue.withCtx(() => [
355
- vue.createTextVNode(vue.toDisplayString(_ctx.formatter(_ctx.config, scope.row)), 1)
356
- ]),
357
- _: 2
358
- }, 1032, ["onClick"])) : _ctx.config.action === "img" ? (vue.openBlock(), vue.createElementBlock("a", {
359
- key: 2,
360
- target: "_blank",
361
- href: scope.row[_ctx.config.prop]
362
- }, [
363
- vue.createElementVNode("img", {
364
- src: scope.row[_ctx.config.prop],
365
- height: "50"
366
- }, null, 8, _hoisted_2)
367
- ], 8, _hoisted_1)) : _ctx.config.action === "link" ? (vue.openBlock(), vue.createElementBlock("a", {
368
- key: 3,
369
- target: "_blank",
370
- href: scope.row[_ctx.config.prop],
371
- class: "keep-all"
372
- }, vue.toDisplayString(scope.row[_ctx.config.prop]), 9, _hoisted_3)) : _ctx.config.action === "tip" ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
373
- key: 4,
374
- placement: "left"
375
- }, {
376
- content: vue.withCtx(() => [
377
- vue.createElementVNode("div", null, vue.toDisplayString(_ctx.formatter(_ctx.config, scope.row)), 1)
378
- ]),
379
- default: vue.withCtx(() => [
380
- vue.createVNode(_component_el_button, {
381
- text: "",
382
- type: "primary"
383
- }, {
384
- default: vue.withCtx(() => [
385
- _hoisted_4
386
- ]),
387
- _: 1
388
- })
389
- ]),
390
- _: 2
391
- }, 1024)) : _ctx.config.action === "tag" ? (vue.openBlock(), vue.createBlock(_component_el_tag, {
392
- key: 5,
393
- type: typeof _ctx.config.type === "function" ? _ctx.config.type(scope.row[_ctx.config.prop], scope.row) : _ctx.config.type,
394
- "close-transition": ""
395
- }, {
396
- default: vue.withCtx(() => [
397
- vue.createTextVNode(vue.toDisplayString(_ctx.formatter(_ctx.config, scope.row)), 1)
398
- ]),
399
- _: 2
400
- }, 1032, ["type"])) : (vue.openBlock(), vue.createElementBlock("div", {
401
- key: 6,
402
- innerHTML: _ctx.formatter(_ctx.config, scope.row)
403
- }, null, 8, _hoisted_5))
404
- ]),
405
- _: 1
406
- }, 8, ["label", "width", "fixed", "sortable", "prop"]);
407
- }
408
- const TextColumn = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
409
-
410
- const _sfc_main = vue.defineComponent({
411
- name: "m-table",
412
- components: { ExpandColumn, ActionsColumn: _sfc_main$4, PopoverColumn, TextColumn },
413
- props: {
414
- data: {
415
- type: Array,
416
- require: true
417
- },
418
- columns: {
419
- type: Array,
420
- require: true,
421
- default: () => []
422
- },
423
- spanMethod: {
424
- type: Function
425
- },
426
- loading: {
427
- type: Boolean,
428
- default: false
429
- },
430
- bodyHeight: {
431
- type: [String, Number]
432
- },
433
- showHeader: {
434
- type: Boolean,
435
- default: true
436
- },
437
- emptyText: {
438
- type: String
439
- },
440
- defaultExpandAll: {
441
- type: Boolean,
442
- default: false
443
- },
444
- rowkeyName: {
445
- type: String
446
- },
447
- border: {
448
- type: Boolean,
449
- default: false
450
- }
451
- },
452
- emits: ["sort-change", "afterAction", "select", "select-all", "selection-change"],
453
- data() {
454
- return {
455
- editState: []
456
- };
457
- },
458
- computed: {
459
- tableData() {
460
- if (this.selectionColumn) {
461
- return this.data || [];
462
- }
463
- return lodashEs.cloneDeep(this.data) || [];
464
- },
465
- selectionColumn() {
466
- const column = this.columns.filter((item) => item.selection);
467
- return column.length ? column[0] : null;
468
- },
469
- hasBorder() {
470
- return typeof this.border !== "undefined" ? this.border : true;
471
- }
472
- },
473
- methods: {
474
- sortChange(data) {
475
- this.$emit("sort-change", data);
476
- },
477
- selectHandler(selection, row) {
478
- const column = this.selectionColumn;
479
- if (!column) {
480
- return;
481
- }
482
- if (column.selection === "single") ;
483
- this.$emit("select", selection, row);
484
- },
485
- selectAllHandler(selection) {
486
- this.$emit("select-all", selection);
487
- },
488
- selectionChangeHandler(selection) {
489
- this.$emit("selection-change", selection);
490
- },
491
- toggleRowSelection(row, selected) {
492
- const table = this.$refs.table;
493
- table.toggleRowSelection.bind(table)(row, selected);
494
- },
495
- toggleRowExpansion(row, expanded) {
496
- const table = this.$refs.table;
497
- table.toggleRowExpansion.bind(table)(row, expanded);
498
- },
499
- clearSelection() {
500
- const table = this.$refs.table;
501
- table.clearSelection.bind(table)();
502
- },
503
- objectSpanMethod(data) {
504
- if (typeof this.spanMethod === "function") {
505
- return this.spanMethod(data);
506
- }
507
- return () => ({
508
- rowspan: 0,
509
- colspan: 0
510
- });
511
- }
512
- }
513
- });
514
-
515
- const Table_vue_vue_type_style_index_0_lang = '';
516
-
517
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
518
- const _component_expand_column = vue.resolveComponent("expand-column");
519
- const _component_el_table_column = vue.resolveComponent("el-table-column");
520
- const _component_actions_column = vue.resolveComponent("actions-column");
521
- const _component_popover_column = vue.resolveComponent("popover-column");
522
- const _component_text_column = vue.resolveComponent("text-column");
523
- const _component_el_table = vue.resolveComponent("el-table");
524
- const _directive_loading = vue.resolveDirective("loading");
525
- return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_table, {
526
- "tooltip-effect": "dark",
527
- class: "m-table",
528
- ref: "table",
529
- data: _ctx.tableData,
530
- "show-header": _ctx.showHeader,
531
- "max-height": _ctx.bodyHeight,
532
- "default-expand-all": _ctx.defaultExpandAll,
533
- border: _ctx.hasBorder,
534
- "row-key": _ctx.rowkeyName || "c_id",
535
- "tree-props": { children: "children" },
536
- "empty-text": _ctx.emptyText || "\u6682\u65E0\u6570\u636E",
537
- "span-method": _ctx.objectSpanMethod,
538
- onSortChange: _ctx.sortChange,
539
- onSelect: _ctx.selectHandler,
540
- onSelectAll: _ctx.selectAllHandler,
541
- onSelectionChange: _ctx.selectionChangeHandler
542
- }, {
543
- default: vue.withCtx(() => [
544
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.columns, (item, columnIndex) => {
545
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
546
- item.type === "expand" ? (vue.openBlock(), vue.createBlock(_component_expand_column, {
547
- config: item,
548
- key: columnIndex
549
- }, null, 8, ["config"])) : item.selection ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
550
- type: "selection",
551
- key: columnIndex,
552
- width: "40",
553
- selectable: item.selectable
554
- }, null, 8, ["selectable"])) : item.actions ? (vue.openBlock(), vue.createBlock(_component_actions_column, {
555
- columns: _ctx.columns,
556
- config: item,
557
- "rowkey-name": _ctx.rowkeyName,
558
- "edit-state": _ctx.editState,
559
- key: columnIndex,
560
- onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("afterAction"))
561
- }, null, 8, ["columns", "config", "rowkey-name", "edit-state"])) : item.type === "popover" ? (vue.openBlock(), vue.createBlock(_component_popover_column, {
562
- key: columnIndex,
563
- config: item
564
- }, null, 8, ["config"])) : (vue.openBlock(), vue.createBlock(_component_text_column, {
565
- key: columnIndex,
566
- config: item,
567
- "edit-state": _ctx.editState
568
- }, null, 8, ["config", "edit-state"]))
569
- ], 64);
570
- }), 256))
571
- ]),
572
- _: 1
573
- }, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text", "span-method", "onSortChange", "onSelect", "onSelectAll", "onSelectionChange"])), [
574
- [_directive_loading, _ctx.loading]
575
- ]);
576
- }
577
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
578
-
579
- const components = [Table];
580
- const index = {
581
- install(app) {
582
- components.forEach((component) => {
583
- app.component(component.name, component);
584
- });
585
- }
586
- };
587
-
588
- exports.MagicTable = Table;
589
- exports.default = index;
590
-
591
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
592
-
593
- }));
594
- //# sourceMappingURL=tmagic-table.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tmagic-table.umd.js","sources":["../src/ActionsColumn.vue","../src/ExpandColumn.vue","../src/utils.ts","../src/PopoverColumn.vue","../src/TextColumn.vue","../src/Table.vue","../src/index.ts"],"sourcesContent":["<template>\n <el-table-column :label=\"config.label\" :width=\"config.width\" :fixed=\"config.fixed\">\n <template v-slot=\"scope\">\n <el-button\n v-for=\"(action, actionIndex) in config.actions\"\n v-show=\"display(action.display, scope.row) && !editState[scope.$index]\"\n v-html=\"action.text\"\n class=\"action-btn\"\n text\n type=\"primary\"\n size=\"small\"\n :key=\"actionIndex\"\n @click=\"actionHandler(action, scope.row, scope.$index)\"\n ></el-button>\n <el-button\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"save(scope.$index, config)\"\n >保存</el-button\n >\n <el-button\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"editState[scope.$index] = undefined\"\n >取消</el-button\n >\n </template>\n </el-table-column>\n</template>\n\n<script lang=\"ts\">\nimport { PropType } from 'vue';\nimport { ElMessage, ElMessageBox } from 'element-plus';\n\nimport { ColumnActionConfig, ColumnConfig } from './schema';\n</script>\n\n<script lang=\"ts\" setup>\nconst props = defineProps({\n columns: {\n type: Array as PropType<any[]>,\n require: true,\n default: () => [],\n },\n\n config: {\n type: Object as PropType<ColumnConfig>,\n require: true,\n default: () => {},\n },\n\n rowkeyName: {\n type: String,\n default: 'c_id',\n },\n\n editState: {\n type: Object,\n default: () => {},\n },\n});\n\nconst emit = defineEmits(['afterAction']);\n\nconst display = (fuc: boolean | Function | undefined, row: any) => {\n if (typeof fuc === 'function') {\n return fuc(row);\n }\n return true;\n};\n\nconst success = (msg: string, action: ColumnActionConfig, row: any) => {\n ElMessage.success(msg);\n action.after?.(row);\n};\n\nconst error = (msg: string) => ElMessage.error(msg);\n\nconst deleteAction = async (action: ColumnActionConfig, row: any) => {\n await ElMessageBox.confirm(`确认删除${row[action.name || 'c_name']}(${row[props.rowkeyName]})?`, '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n });\n\n const res = await action.handler?.(row);\n\n if (res.ret === 0) {\n success('删除成功!', action, row);\n } else {\n error(res.msg || '删除失败');\n }\n};\n\nconst copyHandler = async (action: ColumnActionConfig, row: any) => {\n await ElMessageBox.confirm(`确定复制${row[action.name || 'c_name']}(${row.c_id})?`, '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n });\n\n try {\n const res = await action.handler?.(row);\n\n if (res.ret === 0) {\n success('复制成功!', action, row);\n } else {\n error(`复制失败!${res.msg}`);\n }\n } catch (e) {\n error('复制失败!');\n }\n};\n\nconst actionHandler = async (action: ColumnActionConfig, row: any, index: number) => {\n await action.before?.(row);\n if (action.type === 'delete') {\n await deleteAction(action, row);\n } else if (action.type === 'copy') {\n await copyHandler(action, row);\n } else if (action.type === 'edit') {\n props.editState[index] = row;\n } else {\n await action.handler?.(row);\n }\n action.after?.(row);\n};\n\nconst save = async (index: number, config: ColumnConfig) => {\n const action = config.actions?.find((item) => item.type === 'edit')?.action;\n if (!action) return;\n\n const data: any = {};\n const row = props.editState[index];\n props.columns\n .filter((item) => item.type)\n .forEach((column) => {\n data[column.prop] = row[column.prop];\n });\n\n const res: any = await action({\n data,\n });\n\n if (res) {\n if (res.ret === 0) {\n ElMessage.success('保存成功');\n props.editState[index] = undefined;\n emit('afterAction');\n } else {\n ElMessage.error({\n duration: 10000,\n showClose: true,\n dangerouslyUseHTMLString: true,\n message: res.msg || '保存失败',\n });\n }\n } else {\n props.editState[index] = undefined;\n emit('afterAction');\n }\n};\n</script>\n","<template>\n <el-table-column type=\"expand\">\n <template #default=\"scope\">\n <m-table\n v-if=\"config.table\"\n :show-header=\"false\"\n :columns=\"config.table\"\n :data=\"scope.row[config.prop]\"\n ></m-table>\n <m-form\n v-if=\"config.form\"\n :config=\"config.form\"\n :init-values=\"config.values || scope.row[config.prop] || {}\"\n ></m-form>\n </template>\n </el-table-column>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType } from 'vue';\n\nimport { MForm } from '@tmagic/form';\n\nimport { ColumnConfig } from './schema';\n\nexport default defineComponent({\n components: { MForm },\n\n props: {\n config: {\n type: Object as PropType<ColumnConfig>,\n default: () => ({}),\n required: true,\n },\n },\n});\n</script>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { datetimeFormatter } from '@tmagic/utils';\n\nimport { ColumnConfig } from './schema';\n\nexport const formatter = (item: ColumnConfig, row: any) => {\n if (item.formatter) {\n if (item.formatter === 'datetime') {\n // eslint-disable-next-line no-param-reassign\n item.formatter = (value: string) => datetimeFormatter(value);\n }\n try {\n return item.formatter(row[item.prop], row);\n } catch (e) {\n return row[item.prop];\n }\n } else {\n return row[item.prop];\n }\n};\n","<template>\n <el-table-column :label=\"config.label\" :width=\"config.width\" :fixed=\"config.fixed\">\n <template v-slot=\"scope\">\n <el-popover :placement=\"config.popover.placement\" :width=\"config.popover.width\" :trigger=\"config.popover.trigger\">\n <m-table\n v-if=\"config.popover.tableEmbed\"\n :show-header=\"config.showHeader\"\n :columns=\"config.table\"\n :data=\"scope.row[config.prop]\"\n ></m-table>\n <template #reference>\n <el-button text type=\"primary\"> {{ config.text || formatter(config, scope.row) }}</el-button>\n </template>\n </el-popover>\n </template>\n </el-table-column>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType } from 'vue';\n\nimport { ColumnConfig } from './schema';\nimport { formatter } from './utils';\n\nexport default defineComponent({\n props: {\n config: {\n type: Object as PropType<ColumnConfig>,\n default: () => ({}),\n required: true,\n },\n },\n\n setup() {\n return {\n formatter,\n };\n },\n});\n</script>\n","<template>\n <el-table-column\n show-overflow-tooltip\n :label=\"config.label\"\n :width=\"config.width\"\n :fixed=\"config.fixed\"\n :sortable=\"config.sortable\"\n :prop=\"config.prop\"\n >\n <template v-slot=\"scope\">\n <el-form v-if=\"config.type && editState[scope.$index]\" label-width=\"0\" :model=\"editState[scope.$index]\">\n <m-form-container\n :prop=\"config.prop\"\n :rules=\"config.rules\"\n :config=\"config\"\n :name=\"config.prop\"\n :model=\"editState[scope.$index]\"\n ></m-form-container>\n </el-form>\n\n <el-button v-else-if=\"config.action === 'actionLink'\" text type=\"primary\" @click=\"config.handler(scope.row)\">\n {{ formatter(config, scope.row) }}\n </el-button>\n\n <a v-else-if=\"config.action === 'img'\" target=\"_blank\" :href=\"scope.row[config.prop]\"\n ><img :src=\"scope.row[config.prop]\" height=\"50\"\n /></a>\n\n <a v-else-if=\"config.action === 'link'\" target=\"_blank\" :href=\"scope.row[config.prop]\" class=\"keep-all\">{{\n scope.row[config.prop]\n }}</a>\n\n <el-tooltip v-else-if=\"config.action === 'tip'\" placement=\"left\">\n <template #content>\n <div>{{ formatter(config, scope.row) }}</div>\n </template>\n <el-button text type=\"primary\">扩展配置</el-button>\n </el-tooltip>\n\n <el-tag\n v-else-if=\"config.action === 'tag'\"\n :type=\"typeof config.type === 'function' ? config.type(scope.row[config.prop], scope.row) : config.type\"\n close-transition\n >{{ formatter(config, scope.row) }}</el-tag\n >\n <div v-else v-html=\"formatter(config, scope.row)\"></div>\n </template>\n </el-table-column>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType } from 'vue';\n\nimport { ColumnConfig } from './schema';\nimport { formatter } from './utils';\n\nexport default defineComponent({\n props: {\n config: {\n type: Object as PropType<ColumnConfig>,\n default: () => ({}),\n required: true,\n },\n\n editState: {\n type: Object,\n default: () => {},\n },\n },\n\n setup() {\n return {\n formatter,\n };\n },\n});\n</script>\n","<template>\n <el-table\n tooltip-effect=\"dark\"\n class=\"m-table\"\n ref=\"table\"\n v-loading=\"loading\"\n :data=\"tableData\"\n :show-header=\"showHeader\"\n :max-height=\"bodyHeight\"\n :default-expand-all=\"defaultExpandAll\"\n :border=\"hasBorder\"\n :row-key=\"rowkeyName || 'c_id'\"\n :tree-props=\"{ children: 'children' }\"\n :empty-text=\"emptyText || '暂无数据'\"\n :span-method=\"objectSpanMethod\"\n @sort-change=\"sortChange\"\n @select=\"selectHandler\"\n @select-all=\"selectAllHandler\"\n @selection-change=\"selectionChangeHandler\"\n >\n <template v-for=\"(item, columnIndex) in columns\">\n <template v-if=\"item.type === 'expand'\">\n <expand-column :config=\"item\" :key=\"columnIndex\"></expand-column>\n </template>\n\n <template v-else-if=\"item.selection\">\n <el-table-column type=\"selection\" :key=\"columnIndex\" width=\"40\" :selectable=\"item.selectable\"></el-table-column>\n </template>\n\n <template v-else-if=\"item.actions\">\n <actions-column\n :columns=\"columns\"\n :config=\"item\"\n :rowkey-name=\"rowkeyName\"\n :edit-state=\"editState\"\n :key=\"columnIndex\"\n @afterAction=\"$emit('afterAction')\"\n ></actions-column>\n </template>\n\n <template v-else-if=\"item.type === 'popover'\">\n <popover-column :key=\"columnIndex\" :config=\"item\"></popover-column>\n </template>\n\n <template v-else>\n <text-column :key=\"columnIndex\" :config=\"item\" :edit-state=\"editState\"></text-column>\n </template>\n </template>\n </el-table>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType } from 'vue';\nimport { ElTable } from 'element-plus';\nimport { cloneDeep } from 'lodash-es';\n\nimport ActionsColumn from './ActionsColumn.vue';\nimport ExpandColumn from './ExpandColumn.vue';\nimport PopoverColumn from './PopoverColumn.vue';\nimport TextColumn from './TextColumn.vue';\n\nexport default defineComponent({\n name: 'm-table',\n\n components: { ExpandColumn, ActionsColumn, PopoverColumn, TextColumn },\n\n props: {\n data: {\n type: Array,\n require: true,\n },\n\n columns: {\n type: Array as PropType<any[]>,\n require: true,\n default: () => [],\n },\n\n /** 合并行或列的计算方法 */\n spanMethod: {\n type: Function as PropType<\n (data: { row: any; column: any; rowIndex: number; columnIndex: number }) => [number, number]\n >,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n /** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */\n bodyHeight: {\n type: [String, Number],\n },\n\n /** 是否显示表头 */\n showHeader: {\n type: Boolean,\n default: true,\n },\n\n /** 空数据时显示的文本内容 */\n emptyText: {\n type: String,\n },\n\n /** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */\n defaultExpandAll: {\n type: Boolean,\n default: false,\n },\n\n rowkeyName: {\n type: String,\n },\n\n /** 是否带有纵向边框 */\n border: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: ['sort-change', 'afterAction', 'select', 'select-all', 'selection-change'],\n\n data(): {\n editState: any[];\n } {\n return {\n editState: [],\n };\n },\n\n computed: {\n tableData() {\n if (this.selectionColumn) {\n return this.data || [];\n }\n\n return cloneDeep(this.data) || [];\n },\n\n selectionColumn() {\n const column = this.columns.filter((item) => item.selection);\n return column.length ? column[0] : null;\n },\n\n hasBorder() {\n return typeof this.border !== 'undefined' ? this.border : true;\n },\n },\n\n methods: {\n sortChange(data: any) {\n this.$emit('sort-change', data);\n },\n\n selectHandler(selection: any, row: any) {\n const column = this.selectionColumn;\n if (!column) {\n return;\n }\n\n if (column.selection === 'single') {\n // this.clearSelection()\n // this.toggleRowSelection(row, true)\n }\n this.$emit('select', selection, row);\n },\n\n selectAllHandler(selection: any) {\n this.$emit('select-all', selection);\n },\n\n selectionChangeHandler(selection: any) {\n this.$emit('selection-change', selection);\n },\n\n toggleRowSelection(row: any, selected: boolean) {\n const table = this.$refs.table as InstanceType<typeof ElTable>;\n table.toggleRowSelection.bind(table)(row, selected);\n },\n\n toggleRowExpansion(row: any, expanded: boolean) {\n const table = this.$refs.table as InstanceType<typeof ElTable>;\n table.toggleRowExpansion.bind(table)(row, expanded);\n },\n\n clearSelection() {\n const table = this.$refs.table as InstanceType<typeof ElTable>;\n table.clearSelection.bind(table)();\n },\n\n objectSpanMethod(data: any) {\n if (typeof this.spanMethod === 'function') {\n return this.spanMethod(data);\n }\n return () => ({\n rowspan: 0,\n colspan: 0,\n });\n },\n },\n});\n</script>\n\n<style lang=\"scss\">\n.m-table {\n .el-button.action-btn + .el-button.action-btn {\n margin-left: 0;\n }\n .keep-all {\n word-break: keep-all;\n }\n .el-table .cell > div {\n display: inline-block;\n vertical-align: middle;\n }\n .el-table__row.el-table__row--level-1 {\n color: #999;\n }\n}\n</style>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { App } from 'vue';\n\nimport Table from './Table.vue';\n\nexport { default as MagicTable } from './Table.vue';\n\nconst components = [Table];\n\nexport default {\n install(app: App) {\n components.forEach((component) => {\n app.component(component.name, component);\n });\n },\n};\n"],"names":["ElMessage","ElMessageBox","defineComponent","MForm","_resolveComponent","_openBlock","_createBlock","_withCtx","datetimeFormatter","_createVNode","_createElementBlock","_createElementVNode","_toDisplayString","ActionsColumn","cloneDeep","_withDirectives","_Fragment","_renderList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEA,IAAM,MAAA,OAAA,GAAU,CAAC,GAAA,EAAqC,GAAa,KAAA;EACjE,MAAI,IAAA,OAAO,QAAQ,UAAY,EAAA;EAC7B,QAAA,OAAO,IAAI,GAAG,CAAA,CAAA;EAAA,OAChB;EACA,MAAO,OAAA,IAAA,CAAA;EAAA,KACT,CAAA;EAEA,IAAA,MAAM,OAAU,GAAA,CAAC,GAAa,EAAA,MAAA,EAA4B,GAAa,KAAA;EACrE,MAAAA,qBAAA,CAAU,QAAQ,GAAG,CAAA,CAAA;EACrB,MAAA,MAAA,CAAO,QAAQ,GAAG,CAAA,CAAA;EAAA,KACpB,CAAA;EAEA,IAAA,MAAM,KAAQ,GAAA,CAAC,GAAgB,KAAAA,qBAAA,CAAU,MAAM,GAAG,CAAA,CAAA;EAElD,IAAM,MAAA,YAAA,GAAe,OAAO,MAAA,EAA4B,GAAa,KAAA;EACnE,MAAM,MAAAC,wBAAA,CAAa,OAAQ,CAAA,CAAA,wBAAA,EAAO,GAAI,CAAA,MAAA,CAAO,QAAQ,QA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