@ctzy-web-client/plugin-component-vue 1.0.35 → 1.0.37
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.
|
@@ -69,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
69
69
|
default: true
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
emits: ["drag"],
|
|
72
|
+
emits: ["drag", "headerWidthChange"],
|
|
73
73
|
setup(__props, { emit: __emit }) {
|
|
74
74
|
var _a;
|
|
75
75
|
;
|
|
@@ -80,6 +80,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
80
80
|
const dataTable = props.dataTable;
|
|
81
81
|
dataTable._userService = (_a = userService.value) == null ? void 0 : _a.getUserList;
|
|
82
82
|
const dataTableEl = ref(null);
|
|
83
|
+
const realHeight = computed(() => props.height);
|
|
83
84
|
const displayColumns = computed(
|
|
84
85
|
() => unref(dataTable).getDisplayColumns() || []
|
|
85
86
|
);
|
|
@@ -193,6 +194,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
193
194
|
}
|
|
194
195
|
const tableSelectSubject = new Subject();
|
|
195
196
|
const selectionChange = tableSelectSubject.next.bind(tableSelectSubject);
|
|
197
|
+
const headerDragend = (newWidth, oldWidth, column) => {
|
|
198
|
+
let widthObj = {
|
|
199
|
+
newWidth: Math.round(newWidth),
|
|
200
|
+
oldWidth: Math.round(oldWidth),
|
|
201
|
+
column
|
|
202
|
+
};
|
|
203
|
+
emit("headerWidthChange", widthObj);
|
|
204
|
+
};
|
|
196
205
|
const totalPage = computed(() => dataTable.getTotalPage());
|
|
197
206
|
const tableSelectSubscription = tableSelectSubject.pipe(debounceTime(debounceDelay)).subscribe(unref(dataTable).setSelection.bind(unref(dataTable)));
|
|
198
207
|
const selectChangeAPIObservable = new Observable(
|
|
@@ -258,14 +267,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
258
267
|
ref_key: "dataTableEl",
|
|
259
268
|
ref: dataTableEl,
|
|
260
269
|
style: normalizeStyle({
|
|
261
|
-
display:
|
|
262
|
-
flexDirection:
|
|
270
|
+
display: realHeight.value === "auto" ? "flex" : "block",
|
|
271
|
+
flexDirection: realHeight.value === "auto" ? "column" : "unset"
|
|
263
272
|
})
|
|
264
273
|
}, [
|
|
265
274
|
renderSlot(_ctx.$slots, "default", { dataTable: unref(dataTable) }, () => [
|
|
266
275
|
createVNode(unref(ElTable), mergeProps({
|
|
267
276
|
class: "content",
|
|
268
|
-
height:
|
|
277
|
+
height: realHeight.value,
|
|
269
278
|
ref_key: "elTable",
|
|
270
279
|
ref: elTable,
|
|
271
280
|
data: data.value,
|
|
@@ -273,6 +282,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
273
282
|
"show-header": "",
|
|
274
283
|
stripe: ""
|
|
275
284
|
}, unref(attrs), {
|
|
285
|
+
onHeaderDragend: headerDragend,
|
|
276
286
|
onSelectionChange: unref(selectionChange),
|
|
277
287
|
onSortChange: sortHandle,
|
|
278
288
|
border: __props.border
|
|
@@ -73,7 +73,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
73
73
|
default: true
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
emits: ["drag"],
|
|
76
|
+
emits: ["drag", "headerWidthChange"],
|
|
77
77
|
setup(__props, { emit: __emit }) {
|
|
78
78
|
var _a;
|
|
79
79
|
;
|
|
@@ -84,6 +84,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
84
84
|
const dataTable = props.dataTable;
|
|
85
85
|
dataTable._userService = (_a = userService.value) == null ? void 0 : _a.getUserList;
|
|
86
86
|
const dataTableEl = vue.ref(null);
|
|
87
|
+
const realHeight = vue.computed(() => props.height);
|
|
87
88
|
const displayColumns = vue.computed(
|
|
88
89
|
() => vue.unref(dataTable).getDisplayColumns() || []
|
|
89
90
|
);
|
|
@@ -197,6 +198,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
197
198
|
}
|
|
198
199
|
const tableSelectSubject = new rxjs.Subject();
|
|
199
200
|
const selectionChange = tableSelectSubject.next.bind(tableSelectSubject);
|
|
201
|
+
const headerDragend = (newWidth, oldWidth, column) => {
|
|
202
|
+
let widthObj = {
|
|
203
|
+
newWidth: Math.round(newWidth),
|
|
204
|
+
oldWidth: Math.round(oldWidth),
|
|
205
|
+
column
|
|
206
|
+
};
|
|
207
|
+
emit("headerWidthChange", widthObj);
|
|
208
|
+
};
|
|
200
209
|
const totalPage = vue.computed(() => dataTable.getTotalPage());
|
|
201
210
|
const tableSelectSubscription = tableSelectSubject.pipe(rxjs.debounceTime(debounceDelay)).subscribe(vue.unref(dataTable).setSelection.bind(vue.unref(dataTable)));
|
|
202
211
|
const selectChangeAPIObservable = new rxjs.Observable(
|
|
@@ -262,14 +271,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
262
271
|
ref_key: "dataTableEl",
|
|
263
272
|
ref: dataTableEl,
|
|
264
273
|
style: vue.normalizeStyle({
|
|
265
|
-
display:
|
|
266
|
-
flexDirection:
|
|
274
|
+
display: realHeight.value === "auto" ? "flex" : "block",
|
|
275
|
+
flexDirection: realHeight.value === "auto" ? "column" : "unset"
|
|
267
276
|
})
|
|
268
277
|
}, [
|
|
269
278
|
vue.renderSlot(_ctx.$slots, "default", { dataTable: vue.unref(dataTable) }, () => [
|
|
270
279
|
vue.createVNode(vue.unref(ElementPlus.ElTable), vue.mergeProps({
|
|
271
280
|
class: "content",
|
|
272
|
-
height:
|
|
281
|
+
height: realHeight.value,
|
|
273
282
|
ref_key: "elTable",
|
|
274
283
|
ref: elTable,
|
|
275
284
|
data: data.value,
|
|
@@ -277,6 +286,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
277
286
|
"show-header": "",
|
|
278
287
|
stripe: ""
|
|
279
288
|
}, vue.unref(attrs), {
|
|
289
|
+
onHeaderDragend: headerDragend,
|
|
280
290
|
onSelectionChange: vue.unref(selectionChange),
|
|
281
291
|
onSortChange: sortHandle,
|
|
282
292
|
border: __props.border
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="ns.b()" ref="dataTableEl" :style="{display:
|
|
3
|
-
flexDirection:
|
|
2
|
+
<div :class="ns.b()" ref="dataTableEl" :style="{display: realHeight === 'auto' ? 'flex' : 'block',
|
|
3
|
+
flexDirection: realHeight === 'auto' ? 'column' : 'unset'}">
|
|
4
4
|
<slot :dataTable="dataTable">
|
|
5
5
|
<ElTable
|
|
6
6
|
class="content"
|
|
7
|
-
:height="
|
|
7
|
+
:height="realHeight"
|
|
8
8
|
|
|
9
9
|
ref="elTable"
|
|
10
10
|
:data="data"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
show-header
|
|
13
13
|
stripe
|
|
14
14
|
v-bind="attrs"
|
|
15
|
+
@header-dragend='headerDragend'
|
|
15
16
|
@selection-change="selectionChange"
|
|
16
17
|
@sort-change="sortHandle"
|
|
17
18
|
:border="border"
|
|
@@ -199,7 +200,7 @@ const dataTable = props.dataTable;
|
|
|
199
200
|
dataTable._userService = userService.value?.getUserList
|
|
200
201
|
|
|
201
202
|
const dataTableEl = ref(null);
|
|
202
|
-
|
|
203
|
+
const realHeight = computed(() => props.height)
|
|
203
204
|
const displayColumns = computed(
|
|
204
205
|
() => unref(dataTable).getDisplayColumns() || []
|
|
205
206
|
);
|
|
@@ -214,7 +215,7 @@ watch(
|
|
|
214
215
|
|
|
215
216
|
const searchParams = computed(() => props.searchParams);
|
|
216
217
|
|
|
217
|
-
const emit = defineEmits(['drag']);
|
|
218
|
+
const emit = defineEmits(['drag','headerWidthChange']);
|
|
218
219
|
|
|
219
220
|
const debounceDelay = useGlobalConfig('debounceDelay', 500);
|
|
220
221
|
|
|
@@ -354,7 +355,16 @@ function sortColumn(array) {
|
|
|
354
355
|
|
|
355
356
|
const tableSelectSubject = new Subject();
|
|
356
357
|
const selectionChange = tableSelectSubject.next.bind(tableSelectSubject);
|
|
358
|
+
const headerDragend = (newWidth,oldWidth,column) =>{
|
|
357
359
|
|
|
360
|
+
|
|
361
|
+
let widthObj = {
|
|
362
|
+
newWidth:Math.round(newWidth),
|
|
363
|
+
oldWidth:Math.round(oldWidth),
|
|
364
|
+
column:column
|
|
365
|
+
}
|
|
366
|
+
emit('headerWidthChange',widthObj)
|
|
367
|
+
}
|
|
358
368
|
const totalPage = computed(() => dataTable.getTotalPage());
|
|
359
369
|
|
|
360
370
|
const tableSelectSubscription = tableSelectSubject
|
|
File without changes
|
|
File without changes
|