@weitutech/by-components 1.1.219 → 1.1.221

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.
@@ -74303,6 +74303,7 @@ __webpack_require__.d(__webpack_exports__, {
74303
74303
  ByTable: function() { return /* reexport */ table; },
74304
74304
  ByTag: function() { return /* reexport */ ByTag; },
74305
74305
  ByToolBar: function() { return /* reexport */ ByToolBar; },
74306
+ ByTreePanel: function() { return /* reexport */ ByTreePanel; },
74306
74307
  ByTreeSearch: function() { return /* reexport */ ByTreeSearch; },
74307
74308
  GridItem: function() { return /* reexport */ vue_grid_layout_common.GridItem; },
74308
74309
  ToolBarItemType: function() { return /* reexport */ ToolBarItemType; },
@@ -96024,6 +96025,706 @@ var ByCascaderPanel_component = normalizeComponent(
96024
96025
  )
96025
96026
 
96026
96027
  /* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
96028
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/tree-panel/ByTreePanel.vue?vue&type=template&id=af06ba0a
96029
+ var ByTreePanelvue_type_template_id_af06ba0a_render = function render() {
96030
+ var _vm = this,
96031
+ _c = _vm._self._c;
96032
+ return _c('div', {
96033
+ staticClass: "tree-panel"
96034
+ }, [_c('div', {
96035
+ staticClass: "panel-container"
96036
+ }, [_c('div', {
96037
+ staticClass: "left-panel"
96038
+ }, [_c('div', {
96039
+ staticClass: "panel-header"
96040
+ }, [!_vm.aggregationMode ? _c('div', {
96041
+ staticClass: "panel-title"
96042
+ }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
96043
+ staticClass: "search-section"
96044
+ }, [_c('div', {
96045
+ staticClass: "search-container"
96046
+ }, [_c('el-input', {
96047
+ staticClass: "search-input",
96048
+ attrs: {
96049
+ "placeholder": _vm.searchPlaceholder,
96050
+ "clearable": "",
96051
+ "size": "mini",
96052
+ "disabled": _vm.isViewMode
96053
+ },
96054
+ on: {
96055
+ "input": _vm.handleSearch
96056
+ },
96057
+ model: {
96058
+ value: _vm.searchInput,
96059
+ callback: function ($$v) {
96060
+ _vm.searchInput = $$v;
96061
+ },
96062
+ expression: "searchInput"
96063
+ }
96064
+ }), _vm.isMultiple && !_vm.isViewMode ? _c('el-popover', {
96065
+ attrs: {
96066
+ "placement": "bottom-start",
96067
+ "width": 300,
96068
+ "trigger": "click",
96069
+ "popper-class": "batch-search-popover"
96070
+ },
96071
+ on: {
96072
+ "show": _vm.handleBatchSearchShow
96073
+ },
96074
+ model: {
96075
+ value: _vm.batchSearchVisible,
96076
+ callback: function ($$v) {
96077
+ _vm.batchSearchVisible = $$v;
96078
+ },
96079
+ expression: "batchSearchVisible"
96080
+ }
96081
+ }, [_c('div', {
96082
+ staticClass: "batch-search-container"
96083
+ }, [_c('div', {
96084
+ staticClass: "popover-title"
96085
+ }, [_vm._v("批量输入")]), _c('el-input', {
96086
+ staticClass: "batch-search-textarea",
96087
+ attrs: {
96088
+ "type": "textarea",
96089
+ "rows": 12,
96090
+ "placeholder": "请输入名称,多个名称用换行、逗号、分号、空格分隔"
96091
+ },
96092
+ model: {
96093
+ value: _vm.batchSearchContent,
96094
+ callback: function ($$v) {
96095
+ _vm.batchSearchContent = $$v;
96096
+ },
96097
+ expression: "batchSearchContent"
96098
+ }
96099
+ }), _c('div', {
96100
+ staticClass: "popover-footer"
96101
+ }, [_c('el-button', {
96102
+ attrs: {
96103
+ "size": "mini"
96104
+ },
96105
+ on: {
96106
+ "click": function ($event) {
96107
+ _vm.batchSearchVisible = false;
96108
+ }
96109
+ }
96110
+ }, [_vm._v("取消")]), _c('el-button', {
96111
+ attrs: {
96112
+ "size": "mini",
96113
+ "type": "primary"
96114
+ },
96115
+ on: {
96116
+ "click": _vm.handleBatchSearch
96117
+ }
96118
+ }, [_vm._v("确定")])], 1)], 1), _c('el-button', {
96119
+ staticClass: "batch-search-btn",
96120
+ attrs: {
96121
+ "slot": "reference",
96122
+ "size": "mini",
96123
+ "type": "text"
96124
+ },
96125
+ slot: "reference"
96126
+ }, [_c('i', {
96127
+ staticClass: "el-icon-edit-outline"
96128
+ })])], 1) : _vm._e()], 1)]), _c('div', {
96129
+ staticClass: "action-buttons"
96130
+ }, [_vm.searchInput === '' && _vm.isMultiple && _vm.showSelectAll && !_vm.isViewMode ? _c('div', {
96131
+ staticClass: "all-select",
96132
+ on: {
96133
+ "click": _vm.handleSelectAll
96134
+ }
96135
+ }, [_vm._v(" " + _vm._s(_vm.isAllSelected ? '取消全选' : '全选') + " ")]) : _vm._e()])]), _c('div', {
96136
+ staticClass: "panel-content",
96137
+ style: {
96138
+ height: _vm.computedPanelHeight + 'px'
96139
+ }
96140
+ }, [_c('div', {
96141
+ staticClass: "tree-content-wrapper"
96142
+ }, [_vm.displayOptions.length > 0 ? _c('el-tree', {
96143
+ ref: "tree",
96144
+ staticClass: "tree-panel-inner",
96145
+ attrs: {
96146
+ "data": _vm.displayOptions,
96147
+ "props": _vm.treeFieldProps,
96148
+ "node-key": _vm.nodeKey,
96149
+ "show-checkbox": _vm.isMultiple && !_vm.isViewMode,
96150
+ "check-strictly": false,
96151
+ "highlight-current": !_vm.isMultiple,
96152
+ "expand-on-click-node": !_vm.isMultiple,
96153
+ "default-expand-all": false,
96154
+ "filter-node-method": _vm.filterNodeMethod
96155
+ },
96156
+ on: {
96157
+ "check": _vm.handleTreeCheck,
96158
+ "node-click": _vm.handleNodeClick
96159
+ }
96160
+ }) : _vm.searchInput ? _c('div', {
96161
+ staticClass: "empty-search"
96162
+ }, [_c('el-empty', {
96163
+ attrs: {
96164
+ "image-size": 100
96165
+ }
96166
+ })], 1) : _vm._e()], 1)])]), _c('div', {
96167
+ staticClass: "right-panel"
96168
+ }, [_c('div', {
96169
+ staticClass: "panel-header"
96170
+ }, [_c('div', {
96171
+ staticClass: "panel-title"
96172
+ }, [_vm._v("已选(" + _vm._s(_vm.selectedItems.length) + ")")]), _c('div', {
96173
+ staticClass: "action-buttons"
96174
+ }, [_vm.selectedItems.length > 0 && !_vm.isViewMode ? _c('div', {
96175
+ staticClass: "clear-btn",
96176
+ on: {
96177
+ "click": _vm.clearSelection
96178
+ }
96179
+ }, [_vm._v("清除")]) : _vm._e()])]), _c('div', {
96180
+ staticClass: "panel-content",
96181
+ style: {
96182
+ height: _vm.computedPanelHeight - 5 + 'px'
96183
+ }
96184
+ }, [_c('div', {
96185
+ staticClass: "selected-list"
96186
+ }, [_vm._l(_vm.selectedItems, function (item, index) {
96187
+ return _c('div', {
96188
+ key: _vm.getSelectedItemKey(item, index),
96189
+ staticClass: "selected-item"
96190
+ }, [_c('div', {
96191
+ staticClass: "item-content"
96192
+ }, [_c('div', {
96193
+ staticClass: "item-label"
96194
+ }, [_vm._v(_vm._s(item.label || ''))]), _vm.showSubtitle && _vm.subtitleField && item[_vm.subtitleField] ? _c('div', {
96195
+ staticClass: "item-subtitle"
96196
+ }, [_vm._v(" " + _vm._s(item[_vm.subtitleField]) + " ")]) : _vm._e()]), !_vm.isViewMode ? _c('div', {
96197
+ staticClass: "remove-btn",
96198
+ on: {
96199
+ "click": function ($event) {
96200
+ return _vm.removeItem(item, index);
96201
+ }
96202
+ }
96203
+ }, [_c('i', {
96204
+ staticClass: "el-icon-close"
96205
+ })]) : _vm._e()]);
96206
+ }), _vm.selectedItems.length === 0 ? _c('div', {
96207
+ staticClass: "empty-state"
96208
+ }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])]);
96209
+ };
96210
+ var ByTreePanelvue_type_template_id_af06ba0a_staticRenderFns = [];
96211
+
96212
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/tree-panel/ByTreePanel.vue?vue&type=script&lang=js
96213
+
96214
+
96215
+
96216
+
96217
+
96218
+
96219
+
96220
+
96221
+ /* harmony default export */ var ByTreePanelvue_type_script_lang_js = ({
96222
+ name: 'ByTreePanel',
96223
+ props: {
96224
+ options: {
96225
+ type: Array,
96226
+ default: () => []
96227
+ },
96228
+ value: {
96229
+ type: [Array, Number, String],
96230
+ default: () => []
96231
+ },
96232
+ cascaderProps: {
96233
+ type: Object,
96234
+ default: () => ({
96235
+ multiple: true,
96236
+ label: 'label',
96237
+ value: 'value',
96238
+ children: 'children'
96239
+ })
96240
+ },
96241
+ panelHeight: {
96242
+ type: [String, Number],
96243
+ default: 300
96244
+ },
96245
+ searchPlaceholder: {
96246
+ type: String,
96247
+ default: '请输入名称搜索'
96248
+ },
96249
+ disabledField: {
96250
+ type: String,
96251
+ default: 'disabled'
96252
+ },
96253
+ disabledValue: {
96254
+ type: [String, Number, Boolean],
96255
+ default: true
96256
+ },
96257
+ disabledCheck: {
96258
+ type: Function,
96259
+ default: null
96260
+ },
96261
+ showSelectAll: {
96262
+ type: Boolean,
96263
+ default: true
96264
+ },
96265
+ aggregationMode: {
96266
+ type: Boolean,
96267
+ default: false
96268
+ },
96269
+ parentNodePrefix: {
96270
+ type: String,
96271
+ default: '__parent__'
96272
+ },
96273
+ isViewMode: {
96274
+ type: Boolean,
96275
+ default: false
96276
+ },
96277
+ showSubtitle: {
96278
+ type: Boolean,
96279
+ default: false
96280
+ },
96281
+ subtitleField: {
96282
+ type: String,
96283
+ default: ''
96284
+ }
96285
+ },
96286
+ data() {
96287
+ return {
96288
+ selectedValues: [],
96289
+ filteredOptions: [],
96290
+ displayOptions: [],
96291
+ selectedItems: [],
96292
+ searchInput: '',
96293
+ totalCount: 0,
96294
+ selectedCount: 0,
96295
+ isAllSelected: false,
96296
+ isInternalUpdate: false,
96297
+ batchSearchVisible: false,
96298
+ batchSearchContent: '',
96299
+ searchDebounceTimer: null,
96300
+ isSyncingTree: false
96301
+ };
96302
+ },
96303
+ computed: {
96304
+ computedPanelHeight() {
96305
+ const height = Number(this.panelHeight);
96306
+ if (isNaN(height)) return 300;
96307
+ return Math.max(200, Math.min(800, height));
96308
+ },
96309
+ isMultiple() {
96310
+ return this.cascaderProps.multiple !== false;
96311
+ },
96312
+ valueKey() {
96313
+ return this.cascaderProps.value || 'value';
96314
+ },
96315
+ labelKey() {
96316
+ return this.cascaderProps.label || 'label';
96317
+ },
96318
+ childrenKey() {
96319
+ return this.cascaderProps.children || 'children';
96320
+ },
96321
+ nodeKey() {
96322
+ return this.valueKey;
96323
+ },
96324
+ treeFieldProps() {
96325
+ return {
96326
+ label: this.labelKey,
96327
+ children: this.childrenKey,
96328
+ disabled: 'disabled'
96329
+ };
96330
+ },
96331
+ disabledConfig() {
96332
+ return {
96333
+ disabledField: this.disabledField,
96334
+ disabledValue: this.disabledValue,
96335
+ disabledCheck: this.disabledCheck
96336
+ };
96337
+ },
96338
+ currentValue() {
96339
+ if (this.isMultiple) {
96340
+ return this.selectedItems.map(item => item.value);
96341
+ }
96342
+ return this.selectedItems.length > 0 ? this.selectedItems[0].value : null;
96343
+ }
96344
+ },
96345
+ watch: {
96346
+ options: {
96347
+ handler() {
96348
+ this.initOptions();
96349
+ },
96350
+ immediate: true
96351
+ },
96352
+ value: {
96353
+ handler() {
96354
+ if (this.isInternalUpdate) {
96355
+ this.isInternalUpdate = false;
96356
+ return;
96357
+ }
96358
+ if (!this.filteredOptions.length) return;
96359
+ this.processValue();
96360
+ },
96361
+ deep: true
96362
+ },
96363
+ selectedValues: {
96364
+ handler() {
96365
+ this.updateSelectAllState();
96366
+ },
96367
+ deep: true
96368
+ }
96369
+ },
96370
+ mounted() {
96371
+ this.$nextTick(() => {
96372
+ this.updateSelectedItems();
96373
+ this.syncTreeCheckedState();
96374
+ });
96375
+ },
96376
+ beforeDestroy() {
96377
+ if (this.searchDebounceTimer) {
96378
+ clearTimeout(this.searchDebounceTimer);
96379
+ }
96380
+ },
96381
+ methods: {
96382
+ initOptions() {
96383
+ this.filteredOptions = this.processOptions(this.options);
96384
+ this.displayOptions = this.filteredOptions;
96385
+ this.countTotalItems();
96386
+ this.processValue();
96387
+ },
96388
+ processOptions(options) {
96389
+ const processedOptions = this.cloneTree(options);
96390
+ if (this.isViewMode) {
96391
+ const disabledKey = this.cascaderProps && this.cascaderProps.disabled || 'disabled';
96392
+ const dfs = items => {
96393
+ items.forEach(item => {
96394
+ item[disabledKey] = true;
96395
+ if (item[this.childrenKey] && item[this.childrenKey].length > 0) {
96396
+ dfs(item[this.childrenKey]);
96397
+ }
96398
+ });
96399
+ };
96400
+ dfs(processedOptions);
96401
+ return processedOptions;
96402
+ }
96403
+ CascaderUtils.setDisabledItems(processedOptions, this.disabledConfig, this.cascaderProps);
96404
+ return processedOptions;
96405
+ },
96406
+ cloneTree(options) {
96407
+ if (!Array.isArray(options)) return [];
96408
+ return options.map(item => {
96409
+ const cloned = {
96410
+ ...item
96411
+ };
96412
+ if (item[this.childrenKey] && item[this.childrenKey].length > 0) {
96413
+ cloned[this.childrenKey] = this.cloneTree(item[this.childrenKey]);
96414
+ }
96415
+ return cloned;
96416
+ });
96417
+ },
96418
+ countTotalItems() {
96419
+ this.totalCount = CascaderUtils.countTotalItems(this.filteredOptions, this.disabledConfig, this.cascaderProps);
96420
+ },
96421
+ processValue() {
96422
+ if (!this.filteredOptions.length) return;
96423
+ if (this.isMultiple) {
96424
+ if (Array.isArray(this.value) && this.value.length > 0) {
96425
+ if (typeof this.value[0] === 'string' || typeof this.value[0] === 'number') {
96426
+ if (this.aggregationMode) {
96427
+ this.selectedValues = CascaderUtils.processValuesWithParentNodes(this.value, this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96428
+ } else {
96429
+ this.selectedValues = CascaderUtils.findPathsByValues(this.value, this.filteredOptions, this.cascaderProps);
96430
+ }
96431
+ } else {
96432
+ this.selectedValues = [...this.value];
96433
+ }
96434
+ } else {
96435
+ this.selectedValues = [];
96436
+ }
96437
+ } else if (this.value !== null && this.value !== undefined && this.value !== '') {
96438
+ if (Array.isArray(this.value)) {
96439
+ this.selectedValues = [...this.value];
96440
+ } else if (this.aggregationMode) {
96441
+ this.selectedValues = CascaderUtils.processValuesWithParentNodes([this.value], this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96442
+ } else {
96443
+ this.selectedValues = CascaderUtils.findPathsByValues([this.value], this.filteredOptions, this.cascaderProps);
96444
+ }
96445
+ } else {
96446
+ this.selectedValues = [];
96447
+ }
96448
+ this.updateSelectedItems();
96449
+ this.syncTreeCheckedState();
96450
+ },
96451
+ updateSelectedItems() {
96452
+ if (this.aggregationMode) {
96453
+ this.selectedItems = CascaderUtils.getAggregatedSelectedItems(this.selectedValues, this.filteredOptions, this.cascaderProps);
96454
+ } else {
96455
+ this.selectedItems = CascaderUtils.buildSelectedItemsFromValues(this.selectedValues, this.filteredOptions, this.cascaderProps);
96456
+ }
96457
+ this.selectedCount = this.selectedItems.length;
96458
+ this.$emit('change', this.getSelectedData());
96459
+ },
96460
+ updateSelectAllState() {
96461
+ if (!this.isMultiple) return;
96462
+ if (this.aggregationMode) {
96463
+ this.isAllSelected = CascaderUtils.isAggregatedAllSelected(this.selectedValues, this.filteredOptions, this.disabledConfig, this.cascaderProps);
96464
+ } else {
96465
+ this.isAllSelected = this.selectedCount === this.totalCount && this.totalCount > 0;
96466
+ }
96467
+ },
96468
+ getNodePath(node) {
96469
+ const tree = this.$refs.tree;
96470
+ let treeNode = node;
96471
+
96472
+ // getCheckedNodes 返回的是 data 对象,需转为内部 Node 才能取路径
96473
+ if (tree && treeNode && typeof treeNode.level !== 'number') {
96474
+ treeNode = tree.getNode(treeNode);
96475
+ }
96476
+ const path = [];
96477
+ let current = treeNode;
96478
+ while (current && current.level > 0) {
96479
+ path.unshift(current.data[this.valueKey]);
96480
+ current = current.parent;
96481
+ }
96482
+ return path;
96483
+ },
96484
+ syncTreeCheckedState() {
96485
+ this.$nextTick(() => {
96486
+ const tree = this.$refs.tree;
96487
+ if (!tree) return;
96488
+ this.isSyncingTree = true;
96489
+ if (this.isMultiple) {
96490
+ const leafKeys = this.selectedValues.map(path => path[path.length - 1]);
96491
+ tree.setCheckedKeys(leafKeys);
96492
+ } else if (this.selectedValues.length > 0) {
96493
+ const leafKey = this.selectedValues[0][this.selectedValues[0].length - 1];
96494
+ tree.setCurrentKey(leafKey);
96495
+ } else {
96496
+ tree.setCurrentKey(null);
96497
+ }
96498
+ this.$nextTick(() => {
96499
+ this.isSyncingTree = false;
96500
+ });
96501
+ });
96502
+ },
96503
+ handleTreeCheck() {
96504
+ if (this.isSyncingTree) return;
96505
+ const tree = this.$refs.tree;
96506
+ if (!tree) return;
96507
+ const leafKeys = tree.getCheckedKeys(true);
96508
+ this.selectedValues = CascaderUtils.findPathsByValues(leafKeys, this.filteredOptions, this.cascaderProps);
96509
+ this.updateSelectedItems();
96510
+ this.emitInput();
96511
+ },
96512
+ handleNodeClick(data, node) {
96513
+ if (this.isMultiple || this.isViewMode) return;
96514
+ const hasChildren = data[this.childrenKey] && data[this.childrenKey].length > 0;
96515
+ if (hasChildren) return;
96516
+ if (CascaderUtils.isItemDisabled(data, this.disabledConfig)) return;
96517
+ this.selectedValues = [this.getNodePath(node)];
96518
+ this.updateSelectedItems();
96519
+ this.emitInput();
96520
+ },
96521
+ handleSearch() {
96522
+ if (this.searchDebounceTimer) {
96523
+ clearTimeout(this.searchDebounceTimer);
96524
+ }
96525
+ this.searchDebounceTimer = setTimeout(() => {
96526
+ const keyword = this.searchInput.trim();
96527
+ if (!keyword) {
96528
+ this.displayOptions = this.filteredOptions;
96529
+ this.$nextTick(() => this.syncTreeCheckedState());
96530
+ return;
96531
+ }
96532
+ this.displayOptions = CascaderUtils.searchInTree(this.filteredOptions, keyword, this.cascaderProps);
96533
+ this.$nextTick(() => {
96534
+ this.syncTreeCheckedState();
96535
+ this.expandAllNodes();
96536
+ });
96537
+ }, 300);
96538
+ },
96539
+ expandAllNodes() {
96540
+ const tree = this.$refs.tree;
96541
+ if (!tree || !tree.store) return;
96542
+ const expandNode = node => {
96543
+ node.expanded = true;
96544
+ if (node.childNodes) {
96545
+ node.childNodes.forEach(expandNode);
96546
+ }
96547
+ };
96548
+ tree.store.root.childNodes.forEach(expandNode);
96549
+ },
96550
+ filterNodeMethod() {
96551
+ return true;
96552
+ },
96553
+ handleSelectAll() {
96554
+ if (!this.isMultiple) return;
96555
+ if (this.isAllSelected) {
96556
+ this.selectedValues = [];
96557
+ } else {
96558
+ this.selectedValues = CascaderUtils.getAllLeafPaths(this.filteredOptions, this.disabledConfig, this.cascaderProps);
96559
+ }
96560
+ this.updateSelectedItems();
96561
+ this.syncTreeCheckedState();
96562
+ this.emitInput();
96563
+ },
96564
+ removeItem(item) {
96565
+ const valueToRemove = item.value;
96566
+ this.selectedValues = this.selectedValues.filter(path => path[path.length - 1] !== valueToRemove);
96567
+ const tree = this.$refs.tree;
96568
+ if (tree) {
96569
+ tree.setChecked(valueToRemove, false, true);
96570
+ if (!this.isMultiple) {
96571
+ tree.setCurrentKey(null);
96572
+ }
96573
+ }
96574
+ this.updateSelectedItems();
96575
+ this.emitInput();
96576
+ },
96577
+ clearSelection() {
96578
+ this.selectedValues = [];
96579
+ this.updateSelectedItems();
96580
+ this.syncTreeCheckedState();
96581
+ this.emitInput();
96582
+ },
96583
+ emitInput() {
96584
+ this.$nextTick(() => {
96585
+ this.isInternalUpdate = true;
96586
+ let emitValue = this.currentValue;
96587
+ if (this.aggregationMode) {
96588
+ emitValue = CascaderUtils.getAggregatedSelectedValues(this.selectedValues, this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96589
+ if (!this.isMultiple && emitValue.length > 0) {
96590
+ emitValue = emitValue[0];
96591
+ }
96592
+ }
96593
+ this.$emit('input', emitValue);
96594
+ });
96595
+ },
96596
+ getSelectedData() {
96597
+ let values = this.currentValue;
96598
+ let valuesPath = this.selectedValues;
96599
+ if (this.aggregationMode) {
96600
+ values = CascaderUtils.getAggregatedSelectedValues(this.selectedValues, this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96601
+ valuesPath = CascaderUtils.getAggregatedSelectedPaths(this.selectedValues, this.filteredOptions, this.cascaderProps);
96602
+ if (!this.isMultiple && values.length > 0) {
96603
+ values = values[0];
96604
+ }
96605
+ }
96606
+ return {
96607
+ valuesPath,
96608
+ values,
96609
+ items: this.selectedItems,
96610
+ count: this.selectedItems.length
96611
+ };
96612
+ },
96613
+ setValue(values) {
96614
+ if (this.isMultiple) {
96615
+ if (Array.isArray(values) && values.length > 0) {
96616
+ if (typeof values[0] === 'string' || typeof values[0] === 'number') {
96617
+ if (this.aggregationMode) {
96618
+ this.selectedValues = CascaderUtils.processValuesWithParentNodes(values, this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96619
+ } else {
96620
+ this.selectedValues = CascaderUtils.findPathsByValues(values, this.filteredOptions, this.cascaderProps);
96621
+ }
96622
+ } else {
96623
+ this.selectedValues = [...values];
96624
+ }
96625
+ } else {
96626
+ this.selectedValues = [];
96627
+ }
96628
+ } else if (values !== null && values !== undefined && values !== '') {
96629
+ if (Array.isArray(values)) {
96630
+ this.selectedValues = [...values];
96631
+ } else if (this.aggregationMode) {
96632
+ this.selectedValues = CascaderUtils.processValuesWithParentNodes([values], this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
96633
+ } else {
96634
+ this.selectedValues = CascaderUtils.findPathsByValues([values], this.filteredOptions, this.cascaderProps);
96635
+ }
96636
+ } else {
96637
+ this.selectedValues = [];
96638
+ }
96639
+ this.syncTreeCheckedState();
96640
+ this.updateSelectedItems();
96641
+ },
96642
+ handleBatchSearchShow() {
96643
+ if (this.searchInput) {
96644
+ this.searchInput = '';
96645
+ this.displayOptions = this.filteredOptions;
96646
+ }
96647
+ },
96648
+ handleBatchSearch() {
96649
+ if (!this.batchSearchContent.trim()) {
96650
+ this.batchSearchVisible = false;
96651
+ return;
96652
+ }
96653
+ const inputNames = this.batchSearchContent.split(/[\n,;,;\s]+/).filter(item => item.trim()).map(item => item.trim());
96654
+ if (inputNames.length === 0) {
96655
+ this.batchSearchVisible = false;
96656
+ return;
96657
+ }
96658
+ const matchedPaths = this.searchNamesInTree(inputNames);
96659
+ if (matchedPaths.length > 0) {
96660
+ const newSelectedValues = [...this.selectedValues];
96661
+ matchedPaths.forEach(path => {
96662
+ const exists = newSelectedValues.some(existingPath => existingPath.length === path.length && existingPath.every((value, index) => value === path[index]));
96663
+ if (!exists) {
96664
+ newSelectedValues.push(path);
96665
+ }
96666
+ });
96667
+ this.selectedValues = newSelectedValues;
96668
+ this.updateSelectedItems();
96669
+ this.syncTreeCheckedState();
96670
+ this.emitInput();
96671
+ }
96672
+ this.batchSearchVisible = false;
96673
+ this.batchSearchContent = '';
96674
+ },
96675
+ searchNamesInTree(names) {
96676
+ const matchedPaths = [];
96677
+ const searchInOptions = (options, currentPath = []) => {
96678
+ for (const option of options) {
96679
+ const newPath = [...currentPath, option[this.valueKey]];
96680
+ const optionLabel = String(option[this.labelKey] || '').replace(/\s+/g, '');
96681
+ const isMatched = names.some(name => {
96682
+ const cleanName = name.replace(/\s+/g, '');
96683
+ return optionLabel.toLowerCase() === cleanName.toLowerCase();
96684
+ });
96685
+ const isLeafNode = !option[this.childrenKey] || option[this.childrenKey].length === 0;
96686
+ const isNotDisabled = !CascaderUtils.isItemDisabled(option, this.disabledConfig);
96687
+ if (isMatched && isLeafNode && isNotDisabled) {
96688
+ matchedPaths.push(newPath);
96689
+ }
96690
+ if (option[this.childrenKey] && option[this.childrenKey].length > 0) {
96691
+ searchInOptions(option[this.childrenKey], newPath);
96692
+ }
96693
+ }
96694
+ };
96695
+ searchInOptions(this.filteredOptions);
96696
+ return matchedPaths;
96697
+ },
96698
+ getSelectedItemKey(item, index) {
96699
+ if (item.path && item.path.length) {
96700
+ return item.path.join('__');
96701
+ }
96702
+ return `${item.value}_${index}`;
96703
+ }
96704
+ }
96705
+ });
96706
+ ;// ./src/components/tree-panel/ByTreePanel.vue?vue&type=script&lang=js
96707
+ /* harmony default export */ var tree_panel_ByTreePanelvue_type_script_lang_js = (ByTreePanelvue_type_script_lang_js);
96708
+ ;// ./src/components/tree-panel/ByTreePanel.vue
96709
+
96710
+
96711
+
96712
+
96713
+
96714
+ /* normalize component */
96715
+ ;
96716
+ var ByTreePanel_component = normalizeComponent(
96717
+ tree_panel_ByTreePanelvue_type_script_lang_js,
96718
+ ByTreePanelvue_type_template_id_af06ba0a_render,
96719
+ ByTreePanelvue_type_template_id_af06ba0a_staticRenderFns,
96720
+ false,
96721
+ null,
96722
+ null,
96723
+ null
96724
+
96725
+ )
96726
+
96727
+ /* harmony default export */ var ByTreePanel = (ByTreePanel_component.exports);
96027
96728
  ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=template&id=04723f13
96028
96729
  var ByFloatingMenuvue_type_template_id_04723f13_render = function render() {
96029
96730
  var _vm = this,
@@ -98719,6 +99420,7 @@ var ByCardSelector_component = normalizeComponent(
98719
99420
 
98720
99421
 
98721
99422
 
99423
+
98722
99424
 
98723
99425
 
98724
99426
  const components = {
@@ -98736,6 +99438,7 @@ const components = {
98736
99438
  ByTreeSearch: ByTreeSearch,
98737
99439
  ByDialog: ByDialog,
98738
99440
  ByCascaderPanel: ByCascaderPanel,
99441
+ ByTreePanel: ByTreePanel,
98739
99442
  ByFloatingMenu: ByFloatingMenu,
98740
99443
  ByPopoverSelector: ByPopoverSelector,
98741
99444
  ByGridLayout: ByGridLayout,