hy-dispatch-ui-v3 0.2.63 → 0.2.65
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/hyBatchUploadDialog/batchUploadDialog.vue.mjs +3 -0
- package/es/components/hyDialog/dialog.vue.mjs +9 -2
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +2 -1
- package/es/components/hyForm/form.vue.mjs +6 -3
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +20 -43
- package/es/components/hyTable/js/index.mjs +71 -19
- package/es/components/hyTable/js/useAppTable.mjs +4 -3
- package/es/components/hyTable/table.vue.mjs +13 -8
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +4 -6
- package/es/components/hyTree/js/index.mjs +95 -70
- package/es/components/hyTree/tree.vue.mjs +5 -3
- package/es/static/hy-svg-icons/hy-icon-ops-list-lod.js +14 -0
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +3 -0
- package/lib/components/hyDialog/dialog.vue.js +8 -1
- package/lib/components/hyForm/cpns/locationSelect.vue.js +2 -1
- package/lib/components/hyForm/form.vue.js +6 -3
- package/lib/components/hyTable/cpns/virtualTable.vue.js +19 -42
- package/lib/components/hyTable/js/index.js +71 -19
- package/lib/components/hyTable/js/useAppTable.js +4 -3
- package/lib/components/hyTable/table.vue.js +12 -7
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +3 -5
- package/lib/components/hyTree/js/index.js +95 -70
- package/lib/components/hyTree/tree.vue.js +5 -3
- package/lib/static/hy-svg-icons/hy-icon-ops-list-lod.js +14 -0
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -208,6 +208,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
208
208
|
},
|
|
209
209
|
setData: (source) => {
|
|
210
210
|
batchTableFormRef.value.setData(source);
|
|
211
|
+
},
|
|
212
|
+
setDragLevelIndex: (dragLevel) => {
|
|
213
|
+
HyDialogRef.value.setDragLevelIndex(dragLevel);
|
|
211
214
|
}
|
|
212
215
|
});
|
|
213
216
|
return (_ctx, _cache) => {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useModel, computed, ref, resolveDirective, openBlock, createElementBlock, Fragment, createCommentVNode, createVNode, unref, mergeProps, withCtx, withDirectives, renderSlot, createElementVNode, normalizeClass, createBlock, withModifiers, createTextVNode, toDisplayString, renderList, mergeModels } from 'vue';
|
|
1
|
+
import { defineComponent, useModel, computed, ref, resolveDirective, openBlock, createElementBlock, Fragment, createCommentVNode, createVNode, unref, mergeProps, withCtx, withDirectives, renderSlot, createElementVNode, normalizeClass, createBlock, withModifiers, createTextVNode, toDisplayString, renderList, vShow, mergeModels } from 'vue';
|
|
2
2
|
import { ElDialog, ElPopover } from 'element-plus';
|
|
3
3
|
import '../index.mjs';
|
|
4
4
|
import '../../hooks/index.mjs';
|
|
5
|
+
import '../../utils/index.mjs';
|
|
5
6
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
6
7
|
import { HyButton } from '../hyButton/index.mjs';
|
|
8
|
+
import { isFunction } from '../../utils/is.mjs';
|
|
7
9
|
import { HyIcon } from '../hyIcon/index.mjs';
|
|
8
10
|
|
|
9
11
|
import "./style/dialog.scss";
|
|
@@ -279,7 +281,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
279
281
|
Fragment,
|
|
280
282
|
null,
|
|
281
283
|
renderList(__props.titleBasicInfoList, (basicInfoItem, index) => {
|
|
282
|
-
return openBlock(), createElementBlock("li", {
|
|
284
|
+
return withDirectives((openBlock(), createElementBlock("li", {
|
|
283
285
|
key: index,
|
|
284
286
|
class: "flex px-2 py-1 text-xs"
|
|
285
287
|
}, [
|
|
@@ -297,6 +299,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
297
299
|
1
|
|
298
300
|
/* TEXT */
|
|
299
301
|
)
|
|
302
|
+
])), [
|
|
303
|
+
[
|
|
304
|
+
vShow,
|
|
305
|
+
unref(isFunction)(basicInfoItem.show) ? basicInfoItem.show() : true
|
|
306
|
+
]
|
|
300
307
|
]);
|
|
301
308
|
}),
|
|
302
309
|
128
|
|
@@ -52,7 +52,7 @@ const _sfc_main = {
|
|
|
52
52
|
default: false
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
emits: ["setMapSize"],
|
|
55
|
+
emits: ["setMapSize", "complete"],
|
|
56
56
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
57
57
|
const props = __props;
|
|
58
58
|
const emits = __emit;
|
|
@@ -208,6 +208,7 @@ const _sfc_main = {
|
|
|
208
208
|
setMarker(res.latlng);
|
|
209
209
|
throughCoordinatePosition(latlng.lng, latlng.lat);
|
|
210
210
|
});
|
|
211
|
+
emits("complete");
|
|
211
212
|
}
|
|
212
213
|
function setMarker({ lat, lng }) {
|
|
213
214
|
if (marker) {
|
|
@@ -53,7 +53,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
53
53
|
// 'large' | 'default' | 'small'
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
emits: ["on-allMapSelect"],
|
|
56
|
+
emits: ["on-allMapSelect", "complete"],
|
|
57
57
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
58
58
|
const emit = __emit;
|
|
59
59
|
const props = __props;
|
|
@@ -81,6 +81,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
81
81
|
allMapSelect.value = !allMapSelect.value;
|
|
82
82
|
emit("on-allMapSelect", allMapSelect.value);
|
|
83
83
|
}
|
|
84
|
+
function complete() {
|
|
85
|
+
emit("complete");
|
|
86
|
+
}
|
|
84
87
|
__expose({
|
|
85
88
|
validate: async (callback) => {
|
|
86
89
|
await nextTick();
|
|
@@ -131,7 +134,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
131
134
|
rules: __props.rules,
|
|
132
135
|
"label-position": "top",
|
|
133
136
|
size: __props.size,
|
|
134
|
-
class: "px-2",
|
|
135
137
|
"hide-required-asterisk": ""
|
|
136
138
|
}, _ctx.$attrs), {
|
|
137
139
|
default: withCtx(() => [
|
|
@@ -273,7 +275,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
273
275
|
size: __props.size,
|
|
274
276
|
style: normalizeStyle(unref(columnItemStyle)(props, column)),
|
|
275
277
|
allMapSelect: allMapSelect.value,
|
|
276
|
-
onSetMapSize: setMapSize
|
|
278
|
+
onSetMapSize: setMapSize,
|
|
279
|
+
onComplete: complete
|
|
277
280
|
}, null, 8, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style", "allMapSelect"])) : createCommentVNode("v-if", true)
|
|
278
281
|
],
|
|
279
282
|
64
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, openBlock, createBlock, unref, withCtx, renderSlot, createCommentVNode, createElementBlock, Fragment, renderList, normalizeStyle, withModifiers, normalizeClass, createVNode, mergeProps, createTextVNode, toDisplayString, createElementVNode, normalizeProps, guardReactiveProps } from 'vue';
|
|
1
|
+
import { useModel, computed, ref, openBlock, createBlock, unref, withCtx, renderSlot, createCommentVNode, createElementBlock, Fragment, renderList, normalizeStyle, withModifiers, normalizeClass, createVNode, mergeProps, createTextVNode, toDisplayString, createElementVNode, normalizeProps, guardReactiveProps, mergeModels } from 'vue';
|
|
2
2
|
import { ElTableV2, ElIcon, ElCheckbox, ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus';
|
|
3
3
|
import { ArrowRight, MoreFilled } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../index.mjs';
|
|
@@ -13,7 +13,7 @@ import { HyIcon } from '../../hyIcon/index.mjs';
|
|
|
13
13
|
|
|
14
14
|
const _sfc_main = {
|
|
15
15
|
__name: "virtualTable",
|
|
16
|
-
props: {
|
|
16
|
+
props: /* @__PURE__ */ mergeModels({
|
|
17
17
|
rowKey: {
|
|
18
18
|
type: [String, Number],
|
|
19
19
|
default: "id"
|
|
@@ -62,12 +62,23 @@ const _sfc_main = {
|
|
|
62
62
|
type: String,
|
|
63
63
|
default: "default"
|
|
64
64
|
// deafult-默认 accordion-手风琴
|
|
65
|
+
},
|
|
66
|
+
expandRowKeyMap: {
|
|
67
|
+
type: Map,
|
|
68
|
+
default: () => /* @__PURE__ */ new Map()
|
|
65
69
|
}
|
|
66
|
-
},
|
|
67
|
-
|
|
70
|
+
}, {
|
|
71
|
+
"expandedRowKeys": {
|
|
72
|
+
type: Array,
|
|
73
|
+
default: () => []
|
|
74
|
+
},
|
|
75
|
+
"expandedRowKeysModifiers": {}
|
|
76
|
+
}),
|
|
77
|
+
emits: /* @__PURE__ */ mergeModels(["search", "select", "select-all", "expand-click"], ["update:expandedRowKeys"]),
|
|
68
78
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
69
79
|
const props = __props;
|
|
70
80
|
const emits = __emit;
|
|
81
|
+
const expandedRowKeys = useModel(__props, "expandedRowKeys");
|
|
71
82
|
const { t } = useLocale();
|
|
72
83
|
const avgWidth = computed(() => {
|
|
73
84
|
const { total, totalWidth } = props.columns.reduce(
|
|
@@ -256,46 +267,12 @@ const _sfc_main = {
|
|
|
256
267
|
const { allChecked } = handler(list, checkedNodeMap, indeterminateKeys2);
|
|
257
268
|
return { checkedNodeMap, indeterminateKeys: indeterminateKeys2, allChecked };
|
|
258
269
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return expandedKeys.value.reduce((keyMap, key, index) => {
|
|
262
|
-
keyMap.set(key, index);
|
|
263
|
-
return keyMap;
|
|
264
|
-
}, /* @__PURE__ */ new Map());
|
|
265
|
-
});
|
|
266
|
-
function toggleRowExpansion(row, expanded) {
|
|
267
|
-
const index = expandedMap.value.get(getRowKey(row));
|
|
268
|
-
const isExpanded = isBoolean(expanded) ? expanded : !isNumber(index);
|
|
269
|
-
if (isExpanded) {
|
|
270
|
-
if (!isNumber(index)) {
|
|
271
|
-
if (props.expandMode === "accordion" && isExpandTable.value) {
|
|
272
|
-
expandedKeys.value = [getRowKey(row)];
|
|
273
|
-
} else {
|
|
274
|
-
expandedKeys.value.push(getRowKey(row));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
} else {
|
|
278
|
-
if (isNumber(index)) {
|
|
279
|
-
expandedKeys.value.splice(index, 1);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (isExpandTable.value) {
|
|
283
|
-
const expandedList = expandedKeys.value.reduce((list, key) => {
|
|
284
|
-
list.push(dataSourceMap.value.get(key));
|
|
285
|
-
return list;
|
|
286
|
-
}, []);
|
|
287
|
-
emits("expand-change", row, expandedList);
|
|
288
|
-
} else {
|
|
289
|
-
emits("expand-change", row, isExpanded);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function onRowExpandSwitch({ row, rowKey }) {
|
|
293
|
-
toggleRowExpansion(row, !expandedMap.value.has(rowKey));
|
|
270
|
+
function onRowExpandSwitch({ row, rowKey, ...args }) {
|
|
271
|
+
emits("expand-click", row, !props.expandRowKeyMap.has(rowKey));
|
|
294
272
|
}
|
|
295
273
|
__expose({
|
|
296
274
|
toggleRowSelection,
|
|
297
275
|
toggleAllSelection,
|
|
298
|
-
toggleRowExpansion,
|
|
299
276
|
clearSelection: () => {
|
|
300
277
|
isAllChecked.value = false;
|
|
301
278
|
selectedMap.value.clear();
|
|
@@ -304,8 +281,8 @@ const _sfc_main = {
|
|
|
304
281
|
});
|
|
305
282
|
return (_ctx, _cache) => {
|
|
306
283
|
return openBlock(), createBlock(unref(ElTableV2), {
|
|
307
|
-
"expanded-row-keys":
|
|
308
|
-
"onUpdate:expandedRowKeys": ($event) =>
|
|
284
|
+
"expanded-row-keys": expandedRowKeys.value,
|
|
285
|
+
"onUpdate:expandedRowKeys": ($event) => expandedRowKeys.value = $event,
|
|
309
286
|
"row-key": __props.rowKey,
|
|
310
287
|
data: dataSource.value,
|
|
311
288
|
columns: tableColumns.value,
|
|
@@ -387,7 +364,7 @@ const _sfc_main = {
|
|
|
387
364
|
type: "button",
|
|
388
365
|
"aria-label": "\u5C55\u5F00\u5F53\u524D\u884C",
|
|
389
366
|
"aria-expanded": "false",
|
|
390
|
-
class: normalizeClass(["hy-el-table-v2__expand-icon", { "is-expanded":
|
|
367
|
+
class: normalizeClass(["hy-el-table-v2__expand-icon", { "is-expanded": __props.expandRowKeyMap.has(getRowKey(row)) }]),
|
|
391
368
|
onClick: withModifiers(($event) => onRowExpandSwitch({
|
|
392
369
|
rowData: _ctx.rowData,
|
|
393
370
|
row,
|
|
@@ -4,7 +4,6 @@ import '../../../utils/index.mjs';
|
|
|
4
4
|
import '../../index.mjs';
|
|
5
5
|
import { isPermission, isBoolean, isFunction, isNumber, isString, isArray } from '../../../utils/is.mjs';
|
|
6
6
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
7
|
-
import { usePermissionMap } from '../../../hooks/usePermissionMap.mjs';
|
|
8
7
|
import { ElLoading as HyLoading } from '../../hyLoading/index.mjs';
|
|
9
8
|
|
|
10
9
|
function tableColumnShowHandler(column) {
|
|
@@ -153,7 +152,6 @@ const useAppTableWrapper = (hy) => {
|
|
|
153
152
|
tableDropdownRef,
|
|
154
153
|
operatorDropdownRef
|
|
155
154
|
} = hy;
|
|
156
|
-
const { permissionMap } = usePermissionMap();
|
|
157
155
|
const { t } = useLocale();
|
|
158
156
|
const CACHE_COLUMNS_KEY = props.controller || props.url || "CACHE_COLUMNS_KEY";
|
|
159
157
|
const tableDataSource = ref([]);
|
|
@@ -263,6 +261,73 @@ const useAppTableWrapper = (hy) => {
|
|
|
263
261
|
operatorDropdownRef.value?.handleClose();
|
|
264
262
|
}
|
|
265
263
|
}
|
|
264
|
+
const expandRowKeys = ref([]);
|
|
265
|
+
const expandRowKeyMap = computed(() => {
|
|
266
|
+
return expandRowKeys.value.reduce((keyMap, key, index) => {
|
|
267
|
+
keyMap.set(key, index);
|
|
268
|
+
return keyMap;
|
|
269
|
+
}, /* @__PURE__ */ new Map());
|
|
270
|
+
});
|
|
271
|
+
const isExpandTable = computed(() => {
|
|
272
|
+
if (props.type === "default") {
|
|
273
|
+
return tableColumnsList.value.some((column) => column.type === "expand");
|
|
274
|
+
} else if (props.type === "virtual") {
|
|
275
|
+
return tableColumnsList.value.some(
|
|
276
|
+
(column) => column.type === "expand" && column.expandType === "expand"
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
return false;
|
|
280
|
+
});
|
|
281
|
+
const isAccordionMode = computed(() => {
|
|
282
|
+
return isExpandTable.value && props.expandMode === "accordion";
|
|
283
|
+
});
|
|
284
|
+
function setRowExpansion(list = []) {
|
|
285
|
+
const keys = (list || []).map((item) => {
|
|
286
|
+
return isString(item) || isNumber(item) ? item : getRowKey(item);
|
|
287
|
+
}).filter(Boolean);
|
|
288
|
+
expandRowKeys.value = isAccordionMode.value ? [keys[0]] : keys;
|
|
289
|
+
}
|
|
290
|
+
function toggleRowExpansion(row, expanded) {
|
|
291
|
+
const key = isString(row) || isNumber(row) ? row : getRowKey(row);
|
|
292
|
+
const index = expandRowKeyMap.value.get(key);
|
|
293
|
+
const isExpanded = isBoolean(expanded) ? expanded : !isNumber(index);
|
|
294
|
+
if (isAccordionMode.value) {
|
|
295
|
+
if (isExpanded) {
|
|
296
|
+
expandRowKeys.value = [key];
|
|
297
|
+
} else if (index >= 0) {
|
|
298
|
+
expandRowKeys.value = [];
|
|
299
|
+
}
|
|
300
|
+
} else {
|
|
301
|
+
if (isExpanded && !isNumber(index)) {
|
|
302
|
+
expandRowKeys.value.push(key);
|
|
303
|
+
} else if (!isExpanded && isNumber(index)) {
|
|
304
|
+
expandRowKeys.value.splice(index, 1);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
emits("expand-change", row, isExpanded);
|
|
308
|
+
}
|
|
309
|
+
function onTableRowExpandChangeHandler(row, expandedRows) {
|
|
310
|
+
if (props.type === "virtual") {
|
|
311
|
+
toggleRowExpansion(row, expandedRows);
|
|
312
|
+
} else {
|
|
313
|
+
let isExpanded = false;
|
|
314
|
+
if (!isExpandTable.value) {
|
|
315
|
+
const key = getRowKey(row);
|
|
316
|
+
const index = expandRowKeyMap.value.get(key);
|
|
317
|
+
if (expandedRows && !isNumber(index)) {
|
|
318
|
+
expandRowKeys.value.push(key);
|
|
319
|
+
isExpanded = true;
|
|
320
|
+
} else if (!expandedRows && isNumber(index)) {
|
|
321
|
+
expandRowKeys.value.splice(index, 1);
|
|
322
|
+
isExpanded = false;
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
isExpanded = isAccordionMode.value && expandedRows.length > 1 || expandRowKeys.value.length > expandedRows.length;
|
|
326
|
+
expandRowKeys.value = isAccordionMode.value && expandedRows.length > 1 ? [getRowKey(row)] : expandedRows.map((item) => getRowKey(item));
|
|
327
|
+
}
|
|
328
|
+
emits("expand-change", row, isExpanded);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
266
331
|
const selectedList = ref([]);
|
|
267
332
|
const selectedMap = computed(() => {
|
|
268
333
|
return (selectedList.value || []).reduce((map, row, index) => {
|
|
@@ -339,22 +404,6 @@ const useAppTableWrapper = (hy) => {
|
|
|
339
404
|
}
|
|
340
405
|
return className.filter(Boolean).join(" ");
|
|
341
406
|
}
|
|
342
|
-
function toggleRowExpansion(row) {
|
|
343
|
-
if (tableRef.value && tableColumns.value.some((column) => column.type === "expand")) {
|
|
344
|
-
tableRef.value.toggleRowExpansion(row);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function onTableRowExpandChangeHandler(row, expandedRows) {
|
|
348
|
-
if (isBoolean(expandedRows) || props.expandMode !== "accordion" || expandedRows.length <= 1) {
|
|
349
|
-
props.onExpandChange && props.onExpandChange(row, expandedRows);
|
|
350
|
-
return;
|
|
351
|
-
} else {
|
|
352
|
-
expandedRows.forEach((item) => {
|
|
353
|
-
if (getRowKey(row) === getRowKey(item)) return;
|
|
354
|
-
toggleRowExpansion(item);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
407
|
const isSearchFocus = ref(false);
|
|
359
408
|
function onSearchInputHandler() {
|
|
360
409
|
isSearchFocus.value = true;
|
|
@@ -386,10 +435,13 @@ const useAppTableWrapper = (hy) => {
|
|
|
386
435
|
getSelectedList,
|
|
387
436
|
clearSelection,
|
|
388
437
|
clearSelectedList,
|
|
438
|
+
expandRowKeys,
|
|
439
|
+
expandRowKeyMap,
|
|
440
|
+
setRowExpansion,
|
|
389
441
|
toggleRowExpansion,
|
|
442
|
+
onTableRowExpandChangeHandler,
|
|
390
443
|
onTableSelectHandler,
|
|
391
444
|
onTableRowContextmenuHandler,
|
|
392
|
-
onTableRowExpandChangeHandler,
|
|
393
445
|
onTableRowClickHandler,
|
|
394
446
|
onTableColumnsSelectHandler,
|
|
395
447
|
// 搜索选中
|
|
@@ -26,7 +26,8 @@ function getColumnDefaultConfig(column) {
|
|
|
26
26
|
case "operator":
|
|
27
27
|
return {
|
|
28
28
|
label: t("table.operator"),
|
|
29
|
-
prop: `operator_prop
|
|
29
|
+
prop: `operator_prop`,
|
|
30
|
+
fixed: "right"
|
|
30
31
|
};
|
|
31
32
|
default:
|
|
32
33
|
return {};
|
|
@@ -111,8 +112,8 @@ const useAppTable = (config = {}) => {
|
|
|
111
112
|
try {
|
|
112
113
|
for (let i = 0; i < columns?.length; i++) {
|
|
113
114
|
const column = columns[i];
|
|
114
|
-
if (isEmpty(column.prop) && column.type
|
|
115
|
-
|
|
115
|
+
if (isEmpty(column.prop) && !/^(selection|index|expand|operator)$/.test(column.type)) {
|
|
116
|
+
console.error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
|
|
116
117
|
}
|
|
117
118
|
const sort = getColumnSort(column);
|
|
118
119
|
if (!defaultSortInfo && sort.default) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useModel, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, toDisplayString, withCtx, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers, mergeModels } from 'vue';
|
|
1
|
+
import { defineComponent, useModel, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, toDisplayString, withCtx, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers, isRef, mergeModels } from 'vue';
|
|
2
2
|
import { ElTable, ElTableColumn, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElAutoResizer, ElPagination } from 'element-plus';
|
|
3
3
|
import { MoreFilled } from '@element-plus/icons-vue';
|
|
4
4
|
import '../index.mjs';
|
|
@@ -188,10 +188,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
188
188
|
type: String,
|
|
189
189
|
default: "default"
|
|
190
190
|
// deafult-默认 accordion-手风琴
|
|
191
|
-
},
|
|
192
|
-
onExpandChange: {
|
|
193
|
-
// 展开回调
|
|
194
|
-
type: Function
|
|
195
191
|
}
|
|
196
192
|
}, {
|
|
197
193
|
"loading": { type: Boolean, default: false },
|
|
@@ -200,6 +196,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
200
196
|
emits: /* @__PURE__ */ mergeModels([
|
|
201
197
|
"row-click",
|
|
202
198
|
"select-all",
|
|
199
|
+
"expand-change",
|
|
203
200
|
"on-select-checkbox",
|
|
204
201
|
"reqSuccess",
|
|
205
202
|
"search-data"
|
|
@@ -230,6 +227,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
230
227
|
setTableRowClassName,
|
|
231
228
|
clearSelection,
|
|
232
229
|
clearSelectedList,
|
|
230
|
+
expandRowKeys,
|
|
231
|
+
expandRowKeyMap,
|
|
232
|
+
setRowExpansion,
|
|
233
233
|
toggleRowExpansion,
|
|
234
234
|
onTableRowClickHandler,
|
|
235
235
|
onTableRowContextmenuHandler,
|
|
@@ -281,6 +281,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
281
281
|
getTableDataSource,
|
|
282
282
|
clearSelection,
|
|
283
283
|
clearSelectedList,
|
|
284
|
+
setRowExpansion,
|
|
284
285
|
toggleRowExpansion,
|
|
285
286
|
showAppTableLoading,
|
|
286
287
|
closeAppTableLoading
|
|
@@ -409,6 +410,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
409
410
|
style: {
|
|
410
411
|
"font-size": `${unref(parseRem)(__props.fontSize)}rem`
|
|
411
412
|
},
|
|
413
|
+
"expand-row-keys": unref(expandRowKeys),
|
|
412
414
|
onSelect: unref(onTableSelectHandler),
|
|
413
415
|
onSelectAll: unref(onTableSelectHandler),
|
|
414
416
|
onRowClick: unref(onTableRowClickHandler),
|
|
@@ -661,13 +663,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
661
663
|
]),
|
|
662
664
|
_: 3
|
|
663
665
|
/* FORWARDED */
|
|
664
|
-
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : createCommentVNode("v-if", true),
|
|
666
|
+
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "expand-row-keys", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : createCommentVNode("v-if", true),
|
|
665
667
|
__props.type === "virtual" ? (openBlock(), createBlock(unref(ElAutoResizer), { key: 1 }, {
|
|
666
668
|
default: withCtx(({ height, width }) => [
|
|
667
669
|
createVNode(_sfc_main$3, mergeProps({
|
|
668
670
|
ref_key: "tableRef",
|
|
669
671
|
ref: tableRef
|
|
670
672
|
}, _ctx.$attrs, {
|
|
673
|
+
expandedRowKeys: unref(expandRowKeys),
|
|
674
|
+
"onUpdate:expandedRowKeys": ($event) => isRef(expandRowKeys) ? expandRowKeys.value = $event : null,
|
|
675
|
+
expandRowKeyMap: unref(expandRowKeyMap),
|
|
671
676
|
width,
|
|
672
677
|
height,
|
|
673
678
|
data: unref(tableDataSource),
|
|
@@ -687,7 +692,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
687
692
|
onSelectAll: unref(onTableSelectHandler),
|
|
688
693
|
onRowClick: unref(onTableRowClickHandler),
|
|
689
694
|
onRowContextmenu: unref(onTableRowContextmenuHandler),
|
|
690
|
-
|
|
695
|
+
onExpandClick: unref(onTableRowExpandChangeHandler)
|
|
691
696
|
}), createSlots({
|
|
692
697
|
empty: withCtx(() => [
|
|
693
698
|
createElementVNode("div", { class: "w-full h-full flex items-center justify-center border-b border-border" }, [
|
|
@@ -713,7 +718,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
713
718
|
])
|
|
714
719
|
};
|
|
715
720
|
})
|
|
716
|
-
]), 1040, ["width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "expandMode", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "
|
|
721
|
+
]), 1040, ["expandedRowKeys", "onUpdate:expandedRowKeys", "expandRowKeyMap", "width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "expandMode", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandClick"])
|
|
717
722
|
]),
|
|
718
723
|
_: 3
|
|
719
724
|
/* FORWARDED */
|
|
@@ -5,7 +5,7 @@ import '../../hooks/index.mjs';
|
|
|
5
5
|
import '../../utils/index.mjs';
|
|
6
6
|
import '../index.mjs';
|
|
7
7
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
8
|
-
import { isPermission } from '../../utils/is.mjs';
|
|
8
|
+
import { isPermission, isBoolean, isFunction } from '../../utils/is.mjs';
|
|
9
9
|
import { HyTooltip } from '../hyTooltip/index.mjs';
|
|
10
10
|
import { HyButton } from '../hyButton/index.mjs';
|
|
11
11
|
import { HyIcon } from '../hyIcon/index.mjs';
|
|
@@ -118,11 +118,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
120
120
|
const show = unref(operate.show);
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return !!show;
|
|
125
|
-
}
|
|
121
|
+
if (isBoolean(show)) return show;
|
|
122
|
+
if (isFunction(show)) return show();
|
|
123
|
+
return true;
|
|
126
124
|
}
|
|
127
125
|
watch(() => props.operateList, setSelectedData, { deep: true, immediate: true });
|
|
128
126
|
__expose({});
|