@ctzy-web-client/plugin-component-vue 1.0.47 → 1.0.48
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/es/components.css +1 -1
- package/es/data-table/data-table.mjs +328 -179
- package/es/pct-filter-panel/pct-filter-panel.mjs +1 -1
- package/lib/components.css +1 -1
- package/lib/data-table/data-table.js +327 -178
- package/lib/pct-filter-panel/pct-filter-panel.js +1 -1
- package/package.json +1 -1
- package/src/data-table/data-table.vue +342 -130
- package/src/pct-filter-panel/pct-filter-panel.vue +1 -1
- package/es/data-table/data-table.vue_vue_type_style_index_0_scoped_75958349_lang.mjs +0 -13
- package/lib/data-table/data-table.vue_vue_type_style_index_0_scoped_75958349_lang.js +0 -17
|
@@ -10,7 +10,6 @@ var dataTableColumn = require('./data-table-column.js');
|
|
|
10
10
|
var useDatatableDrag = require('./use-datatable-drag.js');
|
|
11
11
|
var lodash = require('lodash');
|
|
12
12
|
var rxjs = require('rxjs');
|
|
13
|
-
require('./data-table.vue_vue_type_style_index_0_scoped_75958349_lang.js');
|
|
14
13
|
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
15
14
|
|
|
16
15
|
// Inject __name helper
|
|
@@ -25,19 +24,55 @@ if (typeof __name === 'undefined') {
|
|
|
25
24
|
const __default__ = vue.defineComponent({ name: "BwaDataTable" });
|
|
26
25
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
27
26
|
props: {
|
|
28
|
-
dataTable: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
dataTable: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
autoLoad: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
height: {
|
|
36
|
+
type: [String, Number],
|
|
37
|
+
default: "auto"
|
|
38
|
+
},
|
|
34
39
|
fixedSelection: { type: [Boolean, String], default: false },
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
showIndex: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
indexColumnLabel: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "\u7F16\u53F7"
|
|
47
|
+
},
|
|
48
|
+
selection: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
paginationLayout: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "sizes, prev, pager, next, jumper"
|
|
55
|
+
},
|
|
56
|
+
paginationPageSizes: {
|
|
57
|
+
type: Array,
|
|
58
|
+
default: () => [10, 20, 50, 100, 200]
|
|
59
|
+
},
|
|
60
|
+
showPagination: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
whereParamName: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ""
|
|
67
|
+
},
|
|
68
|
+
showDrag: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
border: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true
|
|
75
|
+
}
|
|
41
76
|
},
|
|
42
77
|
emits: ["drag", "headerWidthChange"],
|
|
43
78
|
setup(__props, { emit: __emit }) {
|
|
@@ -50,101 +85,213 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
50
85
|
const dataTable = props.dataTable;
|
|
51
86
|
dataTable._userService = (_a = userService.value) == null ? void 0 : _a.getUserList;
|
|
52
87
|
const dataTableEl = vue.ref(null);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
const realHeight = vue.computed(() => {
|
|
89
|
+
if (props.height !== "auto") {
|
|
90
|
+
return props.height;
|
|
91
|
+
}
|
|
92
|
+
return tableAutoHeight.value;
|
|
93
|
+
});
|
|
94
|
+
const maxHeight = vue.computed(() => {
|
|
95
|
+
if (props.dataTable.data.length !== 0) {
|
|
96
|
+
return props.dataTable.data.length * 64 + 62;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const tableAutoHeight = vue.ref(300);
|
|
100
|
+
const PAGINATION_HEIGHT = 160;
|
|
101
|
+
function calcTableHeight() {
|
|
102
|
+
vue.nextTick(() => {
|
|
103
|
+
if (!dataTableEl.value)
|
|
104
|
+
return;
|
|
105
|
+
const top = dataTableEl.value.offsetTop;
|
|
106
|
+
const viewHeight = window.innerHeight;
|
|
107
|
+
const height = viewHeight - top - PAGINATION_HEIGHT;
|
|
108
|
+
console.log(height);
|
|
109
|
+
tableAutoHeight.value = Math.max(height, 100);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
let resizeTimer = null;
|
|
113
|
+
function watchResize() {
|
|
114
|
+
clearTimeout(resizeTimer);
|
|
115
|
+
resizeTimer = setTimeout(calcTableHeight, 100);
|
|
116
|
+
}
|
|
117
|
+
vue.onMounted(() => {
|
|
118
|
+
calcTableHeight();
|
|
119
|
+
window.addEventListener("resize", watchResize);
|
|
120
|
+
});
|
|
121
|
+
vue.onBeforeUnmount(() => {
|
|
122
|
+
window.removeEventListener("resize", watchResize);
|
|
123
|
+
clearTimeout(resizeTimer);
|
|
124
|
+
});
|
|
125
|
+
const displayColumns = vue.computed(
|
|
126
|
+
() => vue.unref(dataTable).getDisplayColumns() || []
|
|
127
|
+
);
|
|
128
|
+
vue.watch(
|
|
129
|
+
vue.computed(() => props.whereParamName),
|
|
130
|
+
(whereParamName) => {
|
|
131
|
+
dataTable.setWhereParamName(whereParamName || "");
|
|
132
|
+
},
|
|
133
|
+
{ immediate: true, flush: "sync" }
|
|
134
|
+
);
|
|
57
135
|
const searchParams = vue.computed(() => props.searchParams);
|
|
58
136
|
const emit = __emit;
|
|
59
137
|
const debounceDelay = webBaseClientVue.useGlobalConfig("debounceDelay", 500);
|
|
60
|
-
vue.provide(
|
|
138
|
+
vue.provide(
|
|
139
|
+
webBaseClientVue.dataTableKey,
|
|
140
|
+
vue.reactive({
|
|
141
|
+
dataTable,
|
|
142
|
+
displayColumns
|
|
143
|
+
})
|
|
144
|
+
);
|
|
61
145
|
const ns = webBaseClientVue.useNamespace("datatable");
|
|
62
|
-
const { barRectangle } = useDatatableDrag.useDataTableDrag(
|
|
146
|
+
const { barRectangle } = useDatatableDrag.useDataTableDrag(
|
|
147
|
+
dataTableEl,
|
|
148
|
+
".bwa-datatable__drag",
|
|
149
|
+
".el-table__row",
|
|
150
|
+
{ emit }
|
|
151
|
+
);
|
|
63
152
|
const processing = vue.ref(false);
|
|
64
|
-
const data = vue.computed(() =>
|
|
153
|
+
const data = vue.computed(() => {
|
|
154
|
+
return props.dataTable.data;
|
|
155
|
+
});
|
|
65
156
|
webBaseClientVue.useEventDispatcher(dataTable, "load-successfully", async (res) => {
|
|
66
|
-
if (res.code != 0)
|
|
157
|
+
if (res.code != 0) {
|
|
67
158
|
return;
|
|
159
|
+
}
|
|
68
160
|
const _userService = vue.unref(userService);
|
|
69
|
-
if (!_userService)
|
|
161
|
+
if (!_userService) {
|
|
70
162
|
return;
|
|
163
|
+
}
|
|
71
164
|
let columns = dataTable.getColumns();
|
|
72
165
|
const componentNames = ["BwaUserSelect", "BwaUserMultiSelect"];
|
|
73
|
-
columns = columns.filter((
|
|
74
|
-
if (!columns.length)
|
|
166
|
+
columns = columns.filter((column) => componentNames.includes(column.formComponent)).filter((column) => column.visible).filter((column) => column.isExtend);
|
|
167
|
+
if (!columns.length) {
|
|
75
168
|
return;
|
|
169
|
+
}
|
|
76
170
|
processing.value = true;
|
|
77
171
|
const data2 = res.data;
|
|
78
|
-
let ids = data2.reduce((
|
|
172
|
+
let ids = data2.reduce((result, item) => {
|
|
173
|
+
return result.concat(
|
|
174
|
+
columns.reduce((result2, column) => {
|
|
175
|
+
let value = lodash.get(item, column.fullAttrName);
|
|
176
|
+
value = Array.isArray(value) ? value : value ? [value] : [];
|
|
177
|
+
return result2.concat(value);
|
|
178
|
+
}, [])
|
|
179
|
+
);
|
|
180
|
+
}, []).map((id) => id + "");
|
|
79
181
|
ids = [...new Set(ids)];
|
|
80
182
|
try {
|
|
81
183
|
const userListResult = await _userService.getUserListByIds(ids);
|
|
82
|
-
if (userListResult.code != 0)
|
|
184
|
+
if (userListResult.code != 0) {
|
|
83
185
|
return;
|
|
186
|
+
}
|
|
84
187
|
for (const column of columns) {
|
|
85
188
|
column.componentProps = column.componentProps || {};
|
|
86
|
-
column.componentProps.options = (userListResult.data || []).map(
|
|
189
|
+
column.componentProps.options = (userListResult.data || []).map(
|
|
190
|
+
(item) => ({
|
|
191
|
+
label: item.label,
|
|
192
|
+
value: item.value
|
|
193
|
+
})
|
|
194
|
+
);
|
|
87
195
|
}
|
|
88
196
|
} finally {
|
|
89
197
|
processing.value = false;
|
|
90
198
|
}
|
|
91
199
|
});
|
|
92
|
-
const sortHandle = (column) => {
|
|
200
|
+
const sortHandle = (column, prop, order) => {
|
|
93
201
|
let sortColumn2 = "";
|
|
94
202
|
let sortType = "";
|
|
95
203
|
if (column.order) {
|
|
96
204
|
sortColumn2 = column.prop;
|
|
97
|
-
sortType = column.order
|
|
205
|
+
sortType = column.order == "descending" ? 0 : 1;
|
|
98
206
|
dataTable.setParam("sortColumn", sortColumn2);
|
|
99
207
|
dataTable.setParam("sortType", sortType);
|
|
100
208
|
} else {
|
|
101
|
-
dataTable.setParam("sortColumn",
|
|
102
|
-
dataTable.setParam("sortType",
|
|
209
|
+
dataTable.setParam("sortColumn", sortColumn2);
|
|
210
|
+
dataTable.setParam("sortType", sortType);
|
|
103
211
|
}
|
|
104
212
|
dataTable.load();
|
|
105
213
|
};
|
|
106
214
|
webBaseClientVue.useEventDispatcher(dataTable, "load-successfully", (res) => {
|
|
107
215
|
var _a2, _b;
|
|
108
|
-
if (!elTable.value)
|
|
216
|
+
if (!elTable.value) {
|
|
109
217
|
return;
|
|
110
|
-
|
|
218
|
+
}
|
|
219
|
+
if ((_b = (_a2 = vue.unref(elTable)) == null ? void 0 : _a2.store) == null ? void 0 : _b.updateSelectionByRowKey) {
|
|
111
220
|
vue.unref(elTable).store.updateSelectionByRowKey();
|
|
112
|
-
|
|
221
|
+
}
|
|
222
|
+
if (res.code != 0) {
|
|
113
223
|
ElementPlus.ElMessage.error(res.msg);
|
|
224
|
+
}
|
|
114
225
|
});
|
|
115
226
|
function sortColumn(array) {
|
|
116
227
|
array.forEach((item) => {
|
|
117
228
|
var _a2, _b;
|
|
118
229
|
item.no = (_a2 = item.getColumnIndex) == null ? void 0 : _a2.call(item);
|
|
119
|
-
if ((_b = item.children) == null ? void 0 : _b.length)
|
|
230
|
+
if ((_b = item.children) == null ? void 0 : _b.length) {
|
|
120
231
|
sortColumn(item.children);
|
|
232
|
+
}
|
|
121
233
|
});
|
|
122
234
|
array.sort((cur, pre) => cur.no - pre.no);
|
|
123
235
|
}
|
|
124
236
|
const tableSelectSubject = new rxjs.Subject();
|
|
125
237
|
const selectionChange = tableSelectSubject.next.bind(tableSelectSubject);
|
|
126
238
|
const headerDragend = (newWidth, oldWidth, column) => {
|
|
127
|
-
|
|
239
|
+
let widthObj = {
|
|
240
|
+
newWidth: Math.round(newWidth),
|
|
241
|
+
oldWidth: Math.round(oldWidth),
|
|
242
|
+
column
|
|
243
|
+
};
|
|
244
|
+
emit("headerWidthChange", widthObj);
|
|
128
245
|
};
|
|
129
246
|
const totalPage = vue.computed(() => dataTable.getTotalPage());
|
|
130
247
|
const tableSelectSubscription = tableSelectSubject.pipe(rxjs.debounceTime(debounceDelay)).subscribe(vue.unref(dataTable).setSelection.bind(vue.unref(dataTable)));
|
|
131
|
-
const selectChangeAPIObservable = new rxjs.Observable(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
248
|
+
const selectChangeAPIObservable = new rxjs.Observable(
|
|
249
|
+
(observer) => webBaseClientVue.useEventDispatcher(
|
|
250
|
+
props.dataTable,
|
|
251
|
+
"select-change",
|
|
252
|
+
observer.next.bind(observer)
|
|
253
|
+
)
|
|
254
|
+
).pipe(
|
|
255
|
+
rxjs.filter((selection) => {
|
|
256
|
+
if (!vue.unref(elTable)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
const selectionRows = vue.unref(elTable).getSelectionRows();
|
|
260
|
+
if (selectionRows.length !== selection.length) {
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
const primaryKey = dataTable.primaryKey;
|
|
264
|
+
return !selectionRows.every(
|
|
265
|
+
(item) => selection.find((itm) => item[primaryKey] === item[primaryKey])
|
|
266
|
+
);
|
|
267
|
+
})
|
|
268
|
+
).subscribe((selection) => {
|
|
140
269
|
vue.unref(elTable).clearSelection();
|
|
141
|
-
for (const item of selection)
|
|
270
|
+
for (const item of selection) {
|
|
142
271
|
vue.unref(elTable).toggleRowSelection(item, true);
|
|
272
|
+
}
|
|
143
273
|
});
|
|
144
|
-
if (props.autoLoad)
|
|
274
|
+
if (props.autoLoad) {
|
|
145
275
|
dataTable.load();
|
|
146
|
-
|
|
147
|
-
const
|
|
276
|
+
}
|
|
277
|
+
const searchParamsSubscription = new rxjs.Observable(
|
|
278
|
+
(observer) => webBaseClientVue.useEventDispatcher(
|
|
279
|
+
props.dataTable.filterPanel,
|
|
280
|
+
"params-change",
|
|
281
|
+
observer.next.bind(observer)
|
|
282
|
+
)
|
|
283
|
+
).pipe(
|
|
284
|
+
rxjs.filter(() => props.dataTable.filterPanel.ready),
|
|
285
|
+
rxjs.debounceTime(vue.unref(debounceDelay))
|
|
286
|
+
).subscribe(() => {
|
|
287
|
+
props.dataTable.load();
|
|
288
|
+
});
|
|
289
|
+
const subscription = props.dataTable.getDisplayColumnsSubject().pipe(
|
|
290
|
+
rxjs.map(() => vue.unref(elTable)),
|
|
291
|
+
rxjs.delayWhen(() => rxjs.from(vue.nextTick())),
|
|
292
|
+
rxjs.map((elTable2) => elTable2 == null ? void 0 : elTable2.store),
|
|
293
|
+
rxjs.skipWhile((store) => !store)
|
|
294
|
+
).subscribe((store) => {
|
|
148
295
|
sortColumn(vue.unref(store.states._columns));
|
|
149
296
|
store.updateColumns();
|
|
150
297
|
store.scheduleLayout();
|
|
@@ -156,139 +303,141 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
156
303
|
searchParamsSubscription.unsubscribe();
|
|
157
304
|
});
|
|
158
305
|
return (_ctx, _cache) => {
|
|
159
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
160
|
-
vue.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
306
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
307
|
+
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
308
|
+
ref_key: "dataTableEl",
|
|
309
|
+
ref: dataTableEl,
|
|
310
|
+
style: vue.normalizeStyle({
|
|
311
|
+
display: realHeight.value === "auto" ? "flex" : "block",
|
|
312
|
+
flexDirection: realHeight.value === "auto" ? "column" : "unset"
|
|
313
|
+
})
|
|
314
|
+
}, [
|
|
315
|
+
vue.renderSlot(_ctx.$slots, "default", { dataTable: vue.unref(dataTable) }, () => [
|
|
316
|
+
vue.createVNode(vue.unref(ElementPlus.ElTable), vue.mergeProps({
|
|
317
|
+
class: "content",
|
|
318
|
+
height: realHeight.value,
|
|
319
|
+
"max-height": maxHeight.value,
|
|
320
|
+
ref_key: "elTable",
|
|
321
|
+
ref: elTable,
|
|
322
|
+
data: data.value,
|
|
323
|
+
"row-key": vue.unref(dataTable).primaryKey,
|
|
324
|
+
"show-header": "",
|
|
325
|
+
stripe: ""
|
|
326
|
+
}, vue.unref(attrs), {
|
|
327
|
+
onHeaderDragend: headerDragend,
|
|
328
|
+
onSelectionChange: vue.unref(selectionChange),
|
|
329
|
+
onSortChange: sortHandle,
|
|
330
|
+
border: __props.border
|
|
331
|
+
}), {
|
|
332
|
+
empty: vue.withCtx(() => [
|
|
333
|
+
vue.renderSlot(_ctx.$slots, "empty-table")
|
|
334
|
+
]),
|
|
335
|
+
default: vue.withCtx(() => [
|
|
336
|
+
__props.showDrag ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTableColumn), {
|
|
337
|
+
key: 0,
|
|
338
|
+
width: "40px"
|
|
339
|
+
}, {
|
|
340
|
+
default: vue.withCtx(() => [
|
|
341
|
+
vue.createElementVNode("div", {
|
|
342
|
+
class: vue.normalizeClass(vue.unref(ns).e("drag"))
|
|
343
|
+
}, [
|
|
344
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
345
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "ptp-icon ptp-buzhou-yidong" }, null, -1))
|
|
346
|
+
])
|
|
347
|
+
], 2)
|
|
348
|
+
]),
|
|
349
|
+
_: 3
|
|
350
|
+
})) : vue.createCommentVNode("v-if", true),
|
|
351
|
+
__props.selection ? vue.renderSlot(_ctx.$slots, "selection", { key: 1 }, () => [
|
|
352
|
+
vue.createVNode(vue.unref(ElementPlus.ElTableColumn), {
|
|
353
|
+
type: "selection",
|
|
354
|
+
fixed: __props.fixedSelection,
|
|
355
|
+
align: "center",
|
|
356
|
+
width: "56",
|
|
357
|
+
"reserve-selection": true
|
|
358
|
+
}, null, 8, ["fixed"])
|
|
359
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
360
|
+
__props.showIndex ? vue.renderSlot(_ctx.$slots, "index", { key: 2 }, () => [
|
|
361
|
+
vue.createVNode(vue.unref(ElementPlus.ElTableColumn), {
|
|
362
|
+
type: "index",
|
|
363
|
+
width: "60",
|
|
364
|
+
align: "center",
|
|
365
|
+
label: __props.indexColumnLabel
|
|
366
|
+
}, null, 8, ["label"])
|
|
367
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
368
|
+
vue.renderSlot(_ctx.$slots, "table-columns", { dataTable: vue.unref(dataTable) }, () => [
|
|
369
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayColumns.value, (item) => {
|
|
370
|
+
return vue.openBlock(), vue.createBlock(dataTableColumn["default"], vue.mergeProps({
|
|
371
|
+
"column-key": item.attrName,
|
|
372
|
+
key: item.attrName,
|
|
373
|
+
label: item.title,
|
|
374
|
+
prop: item.fullAttrName,
|
|
375
|
+
"min-width": item.width,
|
|
376
|
+
fixed: item.fixed,
|
|
377
|
+
align: item.align
|
|
378
|
+
}, { ref_for: true }, item.componentProps, {
|
|
379
|
+
sortable: item.sortable == "custom"
|
|
380
|
+
}), {
|
|
381
|
+
header: vue.withCtx(() => [
|
|
382
|
+
vue.renderSlot(_ctx.$slots, `table-header-col-${item.attrName}`, {}, () => [
|
|
383
|
+
vue.createTextVNode(vue.toDisplayString(item.title), 1)
|
|
384
|
+
])
|
|
385
|
+
]),
|
|
386
|
+
default: vue.withCtx(({ row, $index }) => [
|
|
387
|
+
data.value.length ? vue.renderSlot(_ctx.$slots, "table-col-" + item.attrName, {
|
|
388
|
+
key: 0,
|
|
389
|
+
row,
|
|
390
|
+
index: $index,
|
|
391
|
+
column: item,
|
|
392
|
+
dataTable: vue.unref(dataTable)
|
|
393
|
+
}, () => [
|
|
394
|
+
vue.createVNode(vue.unref(dynamicComponent["default"]), {
|
|
241
395
|
column: item,
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
]),
|
|
250
|
-
_: 2
|
|
251
|
-
}, 1040, ["column-key", "label", "prop", "min-width", "align", "fixed", "sortable"]);
|
|
252
|
-
}), 128))
|
|
253
|
-
], true),
|
|
254
|
-
vue.renderSlot(_ctx.$slots, "column-append", {}, void 0, true)
|
|
396
|
+
record: row
|
|
397
|
+
}, null, 8, ["column", "record"])
|
|
398
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
399
|
+
]),
|
|
400
|
+
_: 2
|
|
401
|
+
}, 1040, ["column-key", "label", "prop", "min-width", "fixed", "align", "sortable"]);
|
|
402
|
+
}), 128))
|
|
255
403
|
]),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
vue.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
404
|
+
vue.renderSlot(_ctx.$slots, "column-append")
|
|
405
|
+
]),
|
|
406
|
+
_: 3
|
|
407
|
+
}, 16, ["height", "max-height", "data", "row-key", "onSelectionChange", "border"])
|
|
408
|
+
]),
|
|
409
|
+
__props.showPagination ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
410
|
+
key: 0,
|
|
411
|
+
class: vue.normalizeClass(vue.unref(ns).e("pagination"))
|
|
412
|
+
}, [
|
|
413
|
+
vue.createElementVNode("div", {
|
|
414
|
+
class: vue.normalizeClass(vue.unref(ns).e("pagination-info"))
|
|
415
|
+
}, " \u5171" + vue.toDisplayString(totalPage.value) + "\u9875\uFF0C" + vue.toDisplayString(vue.unref(dataTable).totalRecCount) + "\u6761 ", 3),
|
|
416
|
+
vue.createVNode(vue.unref(ElementPlus.ElPagination), {
|
|
417
|
+
currentPage: vue.unref(dataTable).pageNum,
|
|
418
|
+
"page-sizes": __props.paginationPageSizes,
|
|
419
|
+
"page-size": vue.unref(dataTable).pageSize,
|
|
420
|
+
layout: __props.paginationLayout,
|
|
421
|
+
total: vue.unref(dataTable).totalRecCount,
|
|
422
|
+
onSizeChange: _cache[0] || (_cache[0] = ($event) => vue.unref(dataTable).setPageSize($event)),
|
|
423
|
+
onCurrentChange: _cache[1] || (_cache[1] = ($event) => vue.unref(dataTable).pageTo($event)),
|
|
424
|
+
teleported: false
|
|
425
|
+
}, null, 8, ["currentPage", "page-sizes", "page-size", "layout", "total"])
|
|
426
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
427
|
+
vue.unref(barRectangle) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
428
|
+
key: 1,
|
|
429
|
+
class: vue.normalizeClass(vue.unref(ns).e("dragbar")),
|
|
430
|
+
style: vue.normalizeStyle({
|
|
431
|
+
left: vue.unref(barRectangle).left + "px",
|
|
432
|
+
top: vue.unref(barRectangle).top + "px",
|
|
433
|
+
width: vue.unref(barRectangle).width + "px",
|
|
434
|
+
height: vue.unref(barRectangle).height + "px"
|
|
435
|
+
})
|
|
436
|
+
}, null, 6)) : vue.createCommentVNode("v-if", true)
|
|
437
|
+
], 6);
|
|
289
438
|
};
|
|
290
439
|
}
|
|
291
440
|
});
|
|
292
|
-
var DataTable = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["
|
|
441
|
+
var DataTable = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "data-table.vue"]]);
|
|
293
442
|
|
|
294
443
|
exports["default"] = DataTable;
|
|
@@ -162,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
162
162
|
style: { "padding-right": "8px" }
|
|
163
163
|
}, vue.toDisplayString(__props.searchTitle), 3)) : vue.createCommentVNode("v-if", true),
|
|
164
164
|
vue.createVNode(_component_ElInput, {
|
|
165
|
-
"
|
|
165
|
+
"suffix-icon": "Search",
|
|
166
166
|
clearable: "",
|
|
167
167
|
modelValue: vue.unref(searchValue),
|
|
168
168
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchValue) ? searchValue.value = $event : null),
|