hy-dispatch-ui-v3 0.2.63 → 0.2.64

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.
@@ -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
- emits: ["search", "select", "select-all", "expand-change"],
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
- const expandedKeys = ref([]);
260
- const expandedMap = computed(() => {
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": expandedKeys.value,
308
- "onUpdate:expandedRowKeys": ($event) => expandedKeys.value = $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": expandedMap.value.has(getRowKey(row)) }]),
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 === "default") {
115
- throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
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
- onExpandChange: __props.onExpandChange
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", "onExpandChange"])
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 (operate.show === null || operate.show === void 0) {
122
- return true;
123
- } else {
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({});
@@ -137,7 +137,12 @@ const useAppTreeWrapper = (hy) => {
137
137
  "on-check-tree",
138
138
  JSON.parse(
139
139
  JSON.stringify(info.checkedBusinessNodes || info.checkedNodes)
140
- )
140
+ ),
141
+ {
142
+ data,
143
+ info,
144
+ checked
145
+ }
141
146
  );
142
147
  }
143
148
  },
@@ -367,6 +372,7 @@ const useAppTreeWrapper = (hy) => {
367
372
  return true;
368
373
  }
369
374
  function setSlot(slotName) {
375
+ console.log(slots, slotName);
370
376
  if (!slotName || !slots[slotName]) return null;
371
377
  return (data, node) => {
372
378
  let container = document.createElement("div");
@@ -409,25 +415,32 @@ const useAppTreeWrapper = (hy) => {
409
415
  function setDeviceStatus(payload) {
410
416
  virtualTree?.updateData([payload]);
411
417
  }
412
- function singleRemovalFn(row) {
413
- if (props2.treeType === "device") {
418
+ function singleRemovalFn(row, isForce = false) {
419
+ if (props2.treeType === "device" || props2.treeType === "channel") {
414
420
  virtualTree.setChecked(row.channelId || row.deviceId, false, true);
415
421
  } else if (props2.treeType) {
416
- virtualTree.setChecked(row.id, false, true);
422
+ virtualTree.setChecked(row.id, false, true, isForce);
417
423
  } else if (!props2.treeType && props2.treeProps) {
418
- virtualTree.setChecked(row[`${props2.treeProps.value}`], false, true);
424
+ virtualTree.setChecked(
425
+ row[`${props2.treeProps.value}`],
426
+ false,
427
+ true,
428
+ isForce
429
+ );
419
430
  }
420
431
  }
421
- function setCheckedKeys(dataList) {
432
+ function setCheckedKeys(dataList, isForce = false) {
422
433
  if (props2.treeType === "device" || props2.treeType === "channel") {
423
434
  virtualTree?.setCheckedKeys(
424
435
  dataList.map((v) => v.channelId || v.deviceId),
425
- true
436
+ true,
437
+ isForce
426
438
  );
427
439
  } else if (props2.treeType) {
428
440
  virtualTree?.setCheckedKeys(
429
441
  dataList.map((v) => v.id),
430
- true
442
+ true,
443
+ isForce
431
444
  );
432
445
  } else if (!props2.treeType && props2.treeProps) {
433
446
  console.log(
@@ -435,7 +448,9 @@ const useAppTreeWrapper = (hy) => {
435
448
  dataList.map((v) => v[`${props2.treeProps.value}`])
436
449
  );
437
450
  virtualTree?.setCheckedKeys(
438
- dataList.map((v) => v[`${props2.treeProps.value}`])
451
+ dataList.map((v) => v[`${props2.treeProps.value}`]),
452
+ false,
453
+ isForce
439
454
  );
440
455
  }
441
456
  if (props2.isBackDefaultSelected) {
@@ -468,8 +483,11 @@ const useAppTreeWrapper = (hy) => {
468
483
  }
469
484
  }
470
485
  }
471
- function getSelectedDataList() {
472
- return virtualTree?.getCheckedBusinessNodes(true) || [];
486
+ function getSelectedDataList(leafOnly = false) {
487
+ if (props2.treeType) {
488
+ return virtualTree?.getCheckedBusinessNodes(leafOnly) || [];
489
+ }
490
+ return virtualTree?.getCheckedNodes(leafOnly) || [];
473
491
  }
474
492
  function setFilterListType(type) {
475
493
  if (props2.selectFilterList?.length) {
@@ -530,6 +548,9 @@ const useAppTreeWrapper = (hy) => {
530
548
  refreshData();
531
549
  }
532
550
  }
551
+ function getNode(id) {
552
+ return virtualTree.getNode(id);
553
+ }
533
554
  return {
534
555
  filterValue,
535
556
  virtualTree,
@@ -549,7 +570,8 @@ const useAppTreeWrapper = (hy) => {
549
570
  selectFilterType,
550
571
  selectedDataList,
551
572
  getSelectedDataList,
552
- loading
573
+ loading,
574
+ getNode
553
575
  };
554
576
  };
555
577
  function filterNodeMethod(data, value, { selectFilterType, treeFilterParam = [] }) {
@@ -218,7 +218,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
218
218
  getInputPlaceholder,
219
219
  onChange,
220
220
  getSelectedDataList,
221
- loading
221
+ loading,
222
+ getNode
222
223
  } = useMixins(
223
224
  {
224
225
  props,
@@ -240,7 +241,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
240
241
  setCheckedKeys,
241
242
  setChecked,
242
243
  getSelectedDataList,
243
- refreshData
244
+ refreshData,
245
+ getNode
244
246
  });
245
247
  return (_ctx, _cache) => {
246
248
  const _directive_loading = resolveDirective("loading");
@@ -0,0 +1,14 @@
1
+ export default {
2
+ id: 'hy-icon-ops-list-lod',
3
+ defs: `<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="hy-icon-ops-list-lod-linearGradient-1">
4
+ <stop stop-color="#FFFFFF" offset="0%"></stop>
5
+ <stop stop-color="#73F6FF" offset="100%"></stop>
6
+ </linearGradient>`,
7
+ symbol: `<symbol id="hy-icon-ops-list-lod" viewBox="0 0 28 7">
8
+ <g id="hy-icon-ops-list-lod-部门管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
9
+ <g id="hy-icon-ops-list-lod-缩小化-自适应说明" transform="translate(-1263, -986)" fill="url(#hy-icon-ops-list-lod-linearGradient-1)" fill-rule="nonzero">
10
+ <path d="M1267.42105,986.85 C1268.23495,986.85 1268.89474,987.535564 1268.89474,988.38125 L1268.89474,991.44375 C1268.89474,992.289436 1268.23495,992.975 1267.42105,992.975 L1264.47368,992.975 C1263.65979,992.975 1263,992.289436 1263,991.44375 L1263,988.38125 C1263,987.535564 1263.65979,986.85 1264.47368,986.85 L1267.42105,986.85 L1267.42105,986.85 Z M1278.47368,986.85 C1279.28758,986.85 1279.94737,987.535564 1279.94737,988.38125 L1279.94737,991.44375 C1279.94737,992.289436 1279.28758,992.975 1278.47368,992.975 L1275.52632,992.975 C1274.71242,992.975 1274.05263,992.289436 1274.05263,991.44375 L1274.05263,988.38125 C1274.05263,987.535564 1274.71242,986.85 1275.52632,986.85 L1278.47368,986.85 L1278.47368,986.85 Z M1289.52632,986.85 C1290.34021,986.85 1291,987.535564 1291,988.38125 L1291,991.44375 C1291,992.289436 1290.34021,992.975 1289.52632,992.975 L1286.57895,992.975 C1285.76505,992.975 1285.10526,992.289436 1285.10526,991.44375 L1285.10526,988.38125 C1285.10526,987.535564 1285.76505,986.85 1286.57895,986.85 L1289.52632,986.85 L1289.52632,986.85 Z" id="hy-icon-ops-list-lod-lod"></path>
11
+ </g>
12
+ </g>
13
+ </symbol>`,
14
+ };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.62";
1
+ const version = "0.2.63";
2
2
 
3
3
  export { version };
@@ -212,6 +212,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
212
212
  },
213
213
  setData: (source) => {
214
214
  batchTableFormRef.value.setData(source);
215
+ },
216
+ setDragLevelIndex: (dragLevel) => {
217
+ HyDialogRef.value.setDragLevelIndex(dragLevel);
215
218
  }
216
219
  });
217
220
  return (_ctx, _cache) => {
@@ -6,8 +6,10 @@ var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  require('../index.js');
8
8
  require('../../hooks/index.js');
9
+ require('../../utils/index.js');
9
10
  var useLocale = require('../../hooks/useLocale.js');
10
11
  var index = require('../hyButton/index.js');
12
+ var is = require('../../utils/is.js');
11
13
  var index$1 = require('../hyIcon/index.js');
12
14
 
13
15
  import "./style/dialog.scss";
@@ -283,7 +285,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
283
285
  vue.Fragment,
284
286
  null,
285
287
  vue.renderList(__props.titleBasicInfoList, (basicInfoItem, index) => {
286
- return vue.openBlock(), vue.createElementBlock("li", {
288
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
287
289
  key: index,
288
290
  class: "flex px-2 py-1 text-xs"
289
291
  }, [
@@ -301,6 +303,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
301
303
  1
302
304
  /* TEXT */
303
305
  )
306
+ ])), [
307
+ [
308
+ vue.vShow,
309
+ vue.unref(is.isFunction)(basicInfoItem.show) ? basicInfoItem.show() : true
310
+ ]
304
311
  ]);
305
312
  }),
306
313
  128
@@ -56,7 +56,7 @@ const _sfc_main = {
56
56
  default: false
57
57
  }
58
58
  },
59
- emits: ["setMapSize"],
59
+ emits: ["setMapSize", "complete"],
60
60
  setup(__props, { expose: __expose, emit: __emit }) {
61
61
  const props = __props;
62
62
  const emits = __emit;
@@ -212,6 +212,7 @@ const _sfc_main = {
212
212
  setMarker(res.latlng);
213
213
  throughCoordinatePosition(latlng.lng, latlng.lat);
214
214
  });
215
+ emits("complete");
215
216
  }
216
217
  function setMarker({ lat, lng }) {
217
218
  if (marker) {
@@ -57,7 +57,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
57
57
  // 'large' | 'default' | 'small'
58
58
  }
59
59
  },
60
- emits: ["on-allMapSelect"],
60
+ emits: ["on-allMapSelect", "complete"],
61
61
  setup(__props, { expose: __expose, emit: __emit }) {
62
62
  const emit = __emit;
63
63
  const props = __props;
@@ -85,6 +85,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
85
85
  allMapSelect.value = !allMapSelect.value;
86
86
  emit("on-allMapSelect", allMapSelect.value);
87
87
  }
88
+ function complete() {
89
+ emit("complete");
90
+ }
88
91
  __expose({
89
92
  validate: async (callback) => {
90
93
  await vue.nextTick();
@@ -135,7 +138,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
135
138
  rules: __props.rules,
136
139
  "label-position": "top",
137
140
  size: __props.size,
138
- class: "px-2",
139
141
  "hide-required-asterisk": ""
140
142
  }, _ctx.$attrs), {
141
143
  default: vue.withCtx(() => [
@@ -277,7 +279,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
277
279
  size: __props.size,
278
280
  style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, column)),
279
281
  allMapSelect: allMapSelect.value,
280
- onSetMapSize: setMapSize
282
+ onSetMapSize: setMapSize,
283
+ onComplete: complete
281
284
  }, null, 8, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style", "allMapSelect"])) : vue.createCommentVNode("v-if", true)
282
285
  ],
283
286
  64
@@ -17,7 +17,7 @@ var index$2 = require('../../hyIcon/index.js');
17
17
 
18
18
  const _sfc_main = {
19
19
  __name: "virtualTable",
20
- props: {
20
+ props: /* @__PURE__ */ vue.mergeModels({
21
21
  rowKey: {
22
22
  type: [String, Number],
23
23
  default: "id"
@@ -66,12 +66,23 @@ const _sfc_main = {
66
66
  type: String,
67
67
  default: "default"
68
68
  // deafult-默认 accordion-手风琴
69
+ },
70
+ expandRowKeyMap: {
71
+ type: Map,
72
+ default: () => /* @__PURE__ */ new Map()
69
73
  }
70
- },
71
- emits: ["search", "select", "select-all", "expand-change"],
74
+ }, {
75
+ "expandedRowKeys": {
76
+ type: Array,
77
+ default: () => []
78
+ },
79
+ "expandedRowKeysModifiers": {}
80
+ }),
81
+ emits: /* @__PURE__ */ vue.mergeModels(["search", "select", "select-all", "expand-click"], ["update:expandedRowKeys"]),
72
82
  setup(__props, { expose: __expose, emit: __emit }) {
73
83
  const props = __props;
74
84
  const emits = __emit;
85
+ const expandedRowKeys = vue.useModel(__props, "expandedRowKeys");
75
86
  const { t } = useLocale.useLocale();
76
87
  const avgWidth = vue.computed(() => {
77
88
  const { total, totalWidth } = props.columns.reduce(
@@ -260,46 +271,12 @@ const _sfc_main = {
260
271
  const { allChecked } = handler(list, checkedNodeMap, indeterminateKeys2);
261
272
  return { checkedNodeMap, indeterminateKeys: indeterminateKeys2, allChecked };
262
273
  }
263
- const expandedKeys = vue.ref([]);
264
- const expandedMap = vue.computed(() => {
265
- return expandedKeys.value.reduce((keyMap, key, index) => {
266
- keyMap.set(key, index);
267
- return keyMap;
268
- }, /* @__PURE__ */ new Map());
269
- });
270
- function toggleRowExpansion(row, expanded) {
271
- const index = expandedMap.value.get(getRowKey(row));
272
- const isExpanded = is.isBoolean(expanded) ? expanded : !is.isNumber(index);
273
- if (isExpanded) {
274
- if (!is.isNumber(index)) {
275
- if (props.expandMode === "accordion" && isExpandTable.value) {
276
- expandedKeys.value = [getRowKey(row)];
277
- } else {
278
- expandedKeys.value.push(getRowKey(row));
279
- }
280
- }
281
- } else {
282
- if (is.isNumber(index)) {
283
- expandedKeys.value.splice(index, 1);
284
- }
285
- }
286
- if (isExpandTable.value) {
287
- const expandedList = expandedKeys.value.reduce((list, key) => {
288
- list.push(dataSourceMap.value.get(key));
289
- return list;
290
- }, []);
291
- emits("expand-change", row, expandedList);
292
- } else {
293
- emits("expand-change", row, isExpanded);
294
- }
295
- }
296
- function onRowExpandSwitch({ row, rowKey }) {
297
- toggleRowExpansion(row, !expandedMap.value.has(rowKey));
274
+ function onRowExpandSwitch({ row, rowKey, ...args }) {
275
+ emits("expand-click", row, !props.expandRowKeyMap.has(rowKey));
298
276
  }
299
277
  __expose({
300
278
  toggleRowSelection,
301
279
  toggleAllSelection,
302
- toggleRowExpansion,
303
280
  clearSelection: () => {
304
281
  isAllChecked.value = false;
305
282
  selectedMap.value.clear();
@@ -308,8 +285,8 @@ const _sfc_main = {
308
285
  });
309
286
  return (_ctx, _cache) => {
310
287
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTableV2), {
311
- "expanded-row-keys": expandedKeys.value,
312
- "onUpdate:expandedRowKeys": ($event) => expandedKeys.value = $event,
288
+ "expanded-row-keys": expandedRowKeys.value,
289
+ "onUpdate:expandedRowKeys": ($event) => expandedRowKeys.value = $event,
313
290
  "row-key": __props.rowKey,
314
291
  data: dataSource.value,
315
292
  columns: tableColumns.value,
@@ -391,7 +368,7 @@ const _sfc_main = {
391
368
  type: "button",
392
369
  "aria-label": "\u5C55\u5F00\u5F53\u524D\u884C",
393
370
  "aria-expanded": "false",
394
- class: vue.normalizeClass(["hy-el-table-v2__expand-icon", { "is-expanded": expandedMap.value.has(getRowKey(row)) }]),
371
+ class: vue.normalizeClass(["hy-el-table-v2__expand-icon", { "is-expanded": __props.expandRowKeyMap.has(getRowKey(row)) }]),
395
372
  onClick: vue.withModifiers(($event) => onRowExpandSwitch({
396
373
  rowData: _ctx.rowData,
397
374
  row,
@@ -6,7 +6,6 @@ require('../../../utils/index.js');
6
6
  require('../../index.js');
7
7
  var is = require('../../../utils/is.js');
8
8
  var useLocale = require('../../../hooks/useLocale.js');
9
- var usePermissionMap = require('../../../hooks/usePermissionMap.js');
10
9
  var index = require('../../hyLoading/index.js');
11
10
 
12
11
  function tableColumnShowHandler(column) {
@@ -155,7 +154,6 @@ const useAppTableWrapper = (hy) => {
155
154
  tableDropdownRef,
156
155
  operatorDropdownRef
157
156
  } = hy;
158
- const { permissionMap } = usePermissionMap.usePermissionMap();
159
157
  const { t } = useLocale.useLocale();
160
158
  const CACHE_COLUMNS_KEY = props.controller || props.url || "CACHE_COLUMNS_KEY";
161
159
  const tableDataSource = vue.ref([]);
@@ -265,6 +263,73 @@ const useAppTableWrapper = (hy) => {
265
263
  operatorDropdownRef.value?.handleClose();
266
264
  }
267
265
  }
266
+ const expandRowKeys = vue.ref([]);
267
+ const expandRowKeyMap = vue.computed(() => {
268
+ return expandRowKeys.value.reduce((keyMap, key, index) => {
269
+ keyMap.set(key, index);
270
+ return keyMap;
271
+ }, /* @__PURE__ */ new Map());
272
+ });
273
+ const isExpandTable = vue.computed(() => {
274
+ if (props.type === "default") {
275
+ return tableColumnsList.value.some((column) => column.type === "expand");
276
+ } else if (props.type === "virtual") {
277
+ return tableColumnsList.value.some(
278
+ (column) => column.type === "expand" && column.expandType === "expand"
279
+ );
280
+ }
281
+ return false;
282
+ });
283
+ const isAccordionMode = vue.computed(() => {
284
+ return isExpandTable.value && props.expandMode === "accordion";
285
+ });
286
+ function setRowExpansion(list = []) {
287
+ const keys = (list || []).map((item) => {
288
+ return is.isString(item) || is.isNumber(item) ? item : getRowKey(item);
289
+ }).filter(Boolean);
290
+ expandRowKeys.value = isAccordionMode.value ? [keys[0]] : keys;
291
+ }
292
+ function toggleRowExpansion(row, expanded) {
293
+ const key = is.isString(row) || is.isNumber(row) ? row : getRowKey(row);
294
+ const index = expandRowKeyMap.value.get(key);
295
+ const isExpanded = is.isBoolean(expanded) ? expanded : !is.isNumber(index);
296
+ if (isAccordionMode.value) {
297
+ if (isExpanded) {
298
+ expandRowKeys.value = [key];
299
+ } else if (index >= 0) {
300
+ expandRowKeys.value = [];
301
+ }
302
+ } else {
303
+ if (isExpanded && !is.isNumber(index)) {
304
+ expandRowKeys.value.push(key);
305
+ } else if (!isExpanded && is.isNumber(index)) {
306
+ expandRowKeys.value.splice(index, 1);
307
+ }
308
+ }
309
+ emits("expand-change", row, isExpanded);
310
+ }
311
+ function onTableRowExpandChangeHandler(row, expandedRows) {
312
+ if (props.type === "virtual") {
313
+ toggleRowExpansion(row, expandedRows);
314
+ } else {
315
+ let isExpanded = false;
316
+ if (!isExpandTable.value) {
317
+ const key = getRowKey(row);
318
+ const index = expandRowKeyMap.value.get(key);
319
+ if (expandedRows && !is.isNumber(index)) {
320
+ expandRowKeys.value.push(key);
321
+ isExpanded = true;
322
+ } else if (!expandedRows && is.isNumber(index)) {
323
+ expandRowKeys.value.splice(index, 1);
324
+ isExpanded = false;
325
+ }
326
+ } else {
327
+ isExpanded = isAccordionMode.value && expandedRows.length > 1 || expandRowKeys.value.length > expandedRows.length;
328
+ expandRowKeys.value = isAccordionMode.value && expandedRows.length > 1 ? [getRowKey(row)] : expandedRows.map((item) => getRowKey(item));
329
+ }
330
+ emits("expand-change", row, isExpanded);
331
+ }
332
+ }
268
333
  const selectedList = vue.ref([]);
269
334
  const selectedMap = vue.computed(() => {
270
335
  return (selectedList.value || []).reduce((map, row, index) => {
@@ -341,22 +406,6 @@ const useAppTableWrapper = (hy) => {
341
406
  }
342
407
  return className.filter(Boolean).join(" ");
343
408
  }
344
- function toggleRowExpansion(row) {
345
- if (tableRef.value && tableColumns.value.some((column) => column.type === "expand")) {
346
- tableRef.value.toggleRowExpansion(row);
347
- }
348
- }
349
- function onTableRowExpandChangeHandler(row, expandedRows) {
350
- if (is.isBoolean(expandedRows) || props.expandMode !== "accordion" || expandedRows.length <= 1) {
351
- props.onExpandChange && props.onExpandChange(row, expandedRows);
352
- return;
353
- } else {
354
- expandedRows.forEach((item) => {
355
- if (getRowKey(row) === getRowKey(item)) return;
356
- toggleRowExpansion(item);
357
- });
358
- }
359
- }
360
409
  const isSearchFocus = vue.ref(false);
361
410
  function onSearchInputHandler() {
362
411
  isSearchFocus.value = true;
@@ -388,10 +437,13 @@ const useAppTableWrapper = (hy) => {
388
437
  getSelectedList,
389
438
  clearSelection,
390
439
  clearSelectedList,
440
+ expandRowKeys,
441
+ expandRowKeyMap,
442
+ setRowExpansion,
391
443
  toggleRowExpansion,
444
+ onTableRowExpandChangeHandler,
392
445
  onTableSelectHandler,
393
446
  onTableRowContextmenuHandler,
394
- onTableRowExpandChangeHandler,
395
447
  onTableRowClickHandler,
396
448
  onTableColumnsSelectHandler,
397
449
  // 搜索选中
@@ -28,7 +28,8 @@ function getColumnDefaultConfig(column) {
28
28
  case "operator":
29
29
  return {
30
30
  label: t("table.operator"),
31
- prop: `operator_prop`
31
+ prop: `operator_prop`,
32
+ fixed: "right"
32
33
  };
33
34
  default:
34
35
  return {};
@@ -113,8 +114,8 @@ const useAppTable = (config = {}) => {
113
114
  try {
114
115
  for (let i = 0; i < columns?.length; i++) {
115
116
  const column = columns[i];
116
- if (is.isEmpty(column.prop) && column.type === "default") {
117
- throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
117
+ if (is.isEmpty(column.prop) && !/^(selection|index|expand|operator)$/.test(column.type)) {
118
+ console.error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
118
119
  }
119
120
  const sort = getColumnSort(column);
120
121
  if (!defaultSortInfo && sort.default) {
@@ -192,10 +192,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
192
192
  type: String,
193
193
  default: "default"
194
194
  // deafult-默认 accordion-手风琴
195
- },
196
- onExpandChange: {
197
- // 展开回调
198
- type: Function
199
195
  }
200
196
  }, {
201
197
  "loading": { type: Boolean, default: false },
@@ -204,6 +200,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
204
200
  emits: /* @__PURE__ */ vue.mergeModels([
205
201
  "row-click",
206
202
  "select-all",
203
+ "expand-change",
207
204
  "on-select-checkbox",
208
205
  "reqSuccess",
209
206
  "search-data"
@@ -234,6 +231,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
234
231
  setTableRowClassName,
235
232
  clearSelection,
236
233
  clearSelectedList,
234
+ expandRowKeys,
235
+ expandRowKeyMap,
236
+ setRowExpansion,
237
237
  toggleRowExpansion,
238
238
  onTableRowClickHandler,
239
239
  onTableRowContextmenuHandler,
@@ -285,6 +285,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
285
285
  getTableDataSource,
286
286
  clearSelection,
287
287
  clearSelectedList,
288
+ setRowExpansion,
288
289
  toggleRowExpansion,
289
290
  showAppTableLoading,
290
291
  closeAppTableLoading
@@ -413,6 +414,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
413
414
  style: {
414
415
  "font-size": `${vue.unref(adaptive.parseRem)(__props.fontSize)}rem`
415
416
  },
417
+ "expand-row-keys": vue.unref(expandRowKeys),
416
418
  onSelect: vue.unref(onTableSelectHandler),
417
419
  onSelectAll: vue.unref(onTableSelectHandler),
418
420
  onRowClick: vue.unref(onTableRowClickHandler),
@@ -665,13 +667,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
665
667
  ]),
666
668
  _: 3
667
669
  /* FORWARDED */
668
- }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : vue.createCommentVNode("v-if", true),
670
+ }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "expand-row-keys", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : vue.createCommentVNode("v-if", true),
669
671
  __props.type === "virtual" ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElAutoResizer), { key: 1 }, {
670
672
  default: vue.withCtx(({ height, width }) => [
671
673
  vue.createVNode(virtualTable.default, vue.mergeProps({
672
674
  ref_key: "tableRef",
673
675
  ref: tableRef
674
676
  }, _ctx.$attrs, {
677
+ expandedRowKeys: vue.unref(expandRowKeys),
678
+ "onUpdate:expandedRowKeys": ($event) => vue.isRef(expandRowKeys) ? expandRowKeys.value = $event : null,
679
+ expandRowKeyMap: vue.unref(expandRowKeyMap),
675
680
  width,
676
681
  height,
677
682
  data: vue.unref(tableDataSource),
@@ -691,7 +696,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
691
696
  onSelectAll: vue.unref(onTableSelectHandler),
692
697
  onRowClick: vue.unref(onTableRowClickHandler),
693
698
  onRowContextmenu: vue.unref(onTableRowContextmenuHandler),
694
- onExpandChange: __props.onExpandChange
699
+ onExpandClick: vue.unref(onTableRowExpandChangeHandler)
695
700
  }), vue.createSlots({
696
701
  empty: vue.withCtx(() => [
697
702
  vue.createElementVNode("div", { class: "w-full h-full flex items-center justify-center border-b border-border" }, [
@@ -717,7 +722,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
717
722
  ])
718
723
  };
719
724
  })
720
- ]), 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", "onExpandChange"])
725
+ ]), 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"])
721
726
  ]),
722
727
  _: 3
723
728
  /* FORWARDED */
@@ -122,11 +122,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
122
122
  return false;
123
123
  }
124
124
  const show = vue.unref(operate.show);
125
- if (operate.show === null || operate.show === void 0) {
126
- return true;
127
- } else {
128
- return !!show;
129
- }
125
+ if (is.isBoolean(show)) return show;
126
+ if (is.isFunction(show)) return show();
127
+ return true;
130
128
  }
131
129
  vue.watch(() => props.operateList, setSelectedData, { deep: true, immediate: true });
132
130
  __expose({});
@@ -139,7 +139,12 @@ const useAppTreeWrapper = (hy) => {
139
139
  "on-check-tree",
140
140
  JSON.parse(
141
141
  JSON.stringify(info.checkedBusinessNodes || info.checkedNodes)
142
- )
142
+ ),
143
+ {
144
+ data,
145
+ info,
146
+ checked
147
+ }
143
148
  );
144
149
  }
145
150
  },
@@ -369,6 +374,7 @@ const useAppTreeWrapper = (hy) => {
369
374
  return true;
370
375
  }
371
376
  function setSlot(slotName) {
377
+ console.log(slots, slotName);
372
378
  if (!slotName || !slots[slotName]) return null;
373
379
  return (data, node) => {
374
380
  let container = document.createElement("div");
@@ -411,25 +417,32 @@ const useAppTreeWrapper = (hy) => {
411
417
  function setDeviceStatus(payload) {
412
418
  virtualTree?.updateData([payload]);
413
419
  }
414
- function singleRemovalFn(row) {
415
- if (props2.treeType === "device") {
420
+ function singleRemovalFn(row, isForce = false) {
421
+ if (props2.treeType === "device" || props2.treeType === "channel") {
416
422
  virtualTree.setChecked(row.channelId || row.deviceId, false, true);
417
423
  } else if (props2.treeType) {
418
- virtualTree.setChecked(row.id, false, true);
424
+ virtualTree.setChecked(row.id, false, true, isForce);
419
425
  } else if (!props2.treeType && props2.treeProps) {
420
- virtualTree.setChecked(row[`${props2.treeProps.value}`], false, true);
426
+ virtualTree.setChecked(
427
+ row[`${props2.treeProps.value}`],
428
+ false,
429
+ true,
430
+ isForce
431
+ );
421
432
  }
422
433
  }
423
- function setCheckedKeys(dataList) {
434
+ function setCheckedKeys(dataList, isForce = false) {
424
435
  if (props2.treeType === "device" || props2.treeType === "channel") {
425
436
  virtualTree?.setCheckedKeys(
426
437
  dataList.map((v) => v.channelId || v.deviceId),
427
- true
438
+ true,
439
+ isForce
428
440
  );
429
441
  } else if (props2.treeType) {
430
442
  virtualTree?.setCheckedKeys(
431
443
  dataList.map((v) => v.id),
432
- true
444
+ true,
445
+ isForce
433
446
  );
434
447
  } else if (!props2.treeType && props2.treeProps) {
435
448
  console.log(
@@ -437,7 +450,9 @@ const useAppTreeWrapper = (hy) => {
437
450
  dataList.map((v) => v[`${props2.treeProps.value}`])
438
451
  );
439
452
  virtualTree?.setCheckedKeys(
440
- dataList.map((v) => v[`${props2.treeProps.value}`])
453
+ dataList.map((v) => v[`${props2.treeProps.value}`]),
454
+ false,
455
+ isForce
441
456
  );
442
457
  }
443
458
  if (props2.isBackDefaultSelected) {
@@ -470,8 +485,11 @@ const useAppTreeWrapper = (hy) => {
470
485
  }
471
486
  }
472
487
  }
473
- function getSelectedDataList() {
474
- return virtualTree?.getCheckedBusinessNodes(true) || [];
488
+ function getSelectedDataList(leafOnly = false) {
489
+ if (props2.treeType) {
490
+ return virtualTree?.getCheckedBusinessNodes(leafOnly) || [];
491
+ }
492
+ return virtualTree?.getCheckedNodes(leafOnly) || [];
475
493
  }
476
494
  function setFilterListType(type) {
477
495
  if (props2.selectFilterList?.length) {
@@ -532,6 +550,9 @@ const useAppTreeWrapper = (hy) => {
532
550
  refreshData();
533
551
  }
534
552
  }
553
+ function getNode(id) {
554
+ return virtualTree.getNode(id);
555
+ }
535
556
  return {
536
557
  filterValue,
537
558
  virtualTree,
@@ -551,7 +572,8 @@ const useAppTreeWrapper = (hy) => {
551
572
  selectFilterType,
552
573
  selectedDataList,
553
574
  getSelectedDataList,
554
- loading
575
+ loading,
576
+ getNode
555
577
  };
556
578
  };
557
579
  function filterNodeMethod(data, value, { selectFilterType, treeFilterParam = [] }) {
@@ -222,7 +222,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
222
222
  getInputPlaceholder,
223
223
  onChange,
224
224
  getSelectedDataList,
225
- loading
225
+ loading,
226
+ getNode
226
227
  } = useMixins.useMixins(
227
228
  {
228
229
  props,
@@ -244,7 +245,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
244
245
  setCheckedKeys,
245
246
  setChecked,
246
247
  getSelectedDataList,
247
- refreshData
248
+ refreshData,
249
+ getNode
248
250
  });
249
251
  return (_ctx, _cache) => {
250
252
  const _directive_loading = vue.resolveDirective("loading");
@@ -0,0 +1,14 @@
1
+ export default {
2
+ id: 'hy-icon-ops-list-lod',
3
+ defs: `<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="hy-icon-ops-list-lod-linearGradient-1">
4
+ <stop stop-color="#FFFFFF" offset="0%"></stop>
5
+ <stop stop-color="#73F6FF" offset="100%"></stop>
6
+ </linearGradient>`,
7
+ symbol: `<symbol id="hy-icon-ops-list-lod" viewBox="0 0 28 7">
8
+ <g id="hy-icon-ops-list-lod-部门管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
9
+ <g id="hy-icon-ops-list-lod-缩小化-自适应说明" transform="translate(-1263, -986)" fill="url(#hy-icon-ops-list-lod-linearGradient-1)" fill-rule="nonzero">
10
+ <path d="M1267.42105,986.85 C1268.23495,986.85 1268.89474,987.535564 1268.89474,988.38125 L1268.89474,991.44375 C1268.89474,992.289436 1268.23495,992.975 1267.42105,992.975 L1264.47368,992.975 C1263.65979,992.975 1263,992.289436 1263,991.44375 L1263,988.38125 C1263,987.535564 1263.65979,986.85 1264.47368,986.85 L1267.42105,986.85 L1267.42105,986.85 Z M1278.47368,986.85 C1279.28758,986.85 1279.94737,987.535564 1279.94737,988.38125 L1279.94737,991.44375 C1279.94737,992.289436 1279.28758,992.975 1278.47368,992.975 L1275.52632,992.975 C1274.71242,992.975 1274.05263,992.289436 1274.05263,991.44375 L1274.05263,988.38125 C1274.05263,987.535564 1274.71242,986.85 1275.52632,986.85 L1278.47368,986.85 L1278.47368,986.85 Z M1289.52632,986.85 C1290.34021,986.85 1291,987.535564 1291,988.38125 L1291,991.44375 C1291,992.289436 1290.34021,992.975 1289.52632,992.975 L1286.57895,992.975 C1285.76505,992.975 1285.10526,992.289436 1285.10526,991.44375 L1285.10526,988.38125 C1285.10526,987.535564 1285.76505,986.85 1286.57895,986.85 L1289.52632,986.85 L1289.52632,986.85 Z" id="hy-icon-ops-list-lod-lod"></path>
11
+ </g>
12
+ </g>
13
+ </symbol>`,
14
+ };
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.62";
3
+ const version = "0.2.63";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.2.63",
3
+ "version": "0.2.64",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {