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