@ctzy-web-client/plugin-component-vue 1.0.47 → 1.0.49

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