@weitutech/by-components 1.2.32 → 1.2.33

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.
@@ -94768,8 +94768,8 @@ ByDialogService.install = function (Vue) {
94768
94768
  Vue.prototype.$byDialog = ByDialogService;
94769
94769
  };
94770
94770
  /* harmony default export */ var by_dialog_ByDialogService = (ByDialogService);
94771
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=727f392c
94772
- var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94771
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=3691e51e
94772
+ var ByCascaderPanelvue_type_template_id_3691e51e_render = function render() {
94773
94773
  var _vm = this,
94774
94774
  _c = _vm._self._c;
94775
94775
  return _c('div', {
@@ -94788,7 +94788,10 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94788
94788
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
94789
94789
  staticClass: "search-section"
94790
94790
  }, [_c('div', {
94791
- staticClass: "search-container"
94791
+ staticClass: "search-container",
94792
+ class: {
94793
+ 'has-dropdown-filter': _vm.showDropdownFilter
94794
+ }
94792
94795
  }, [_c('div', {
94793
94796
  staticClass: "search-input-wrap",
94794
94797
  class: {
@@ -94887,7 +94890,37 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94887
94890
  slot: "reference"
94888
94891
  }, [_c('i', {
94889
94892
  staticClass: "el-icon-edit-outline"
94890
- })])], 1)], 1) : _vm._e()], 1), _vm.showRefreshBtn ? _c('el-tooltip', {
94893
+ })])], 1)], 1) : _vm._e()], 1), _vm.showDropdownFilter ? _c('div', {
94894
+ staticClass: "dropdown-filter-group"
94895
+ }, [_vm.dropdownFilterTitle ? _c('span', {
94896
+ staticClass: "dropdown-filter-title"
94897
+ }, [_vm._v(_vm._s(_vm.dropdownFilterTitle) + ":")]) : _vm._e(), _c('el-select', {
94898
+ staticClass: "dropdown-filter-select",
94899
+ attrs: {
94900
+ "placeholder": _vm.dropdownFilterPlaceholder,
94901
+ "clearable": "",
94902
+ "size": "mini",
94903
+ "disabled": _vm.panelViewMode
94904
+ },
94905
+ on: {
94906
+ "change": _vm.handleDropdownFilterChange
94907
+ },
94908
+ model: {
94909
+ value: _vm.dropdownFilterValue,
94910
+ callback: function ($$v) {
94911
+ _vm.dropdownFilterValue = $$v;
94912
+ },
94913
+ expression: "dropdownFilterValue"
94914
+ }
94915
+ }, _vm._l(_vm.normalizedDropdownFilterOptions, function (opt) {
94916
+ return _c('el-option', {
94917
+ key: 'df-' + opt.value,
94918
+ attrs: {
94919
+ "label": opt.label,
94920
+ "value": opt.value
94921
+ }
94922
+ });
94923
+ }), 1)], 1) : _vm._e(), _vm.showRefreshBtn ? _c('el-tooltip', {
94891
94924
  attrs: {
94892
94925
  "content": _vm.refreshTooltip,
94893
94926
  "placement": "top",
@@ -94929,8 +94962,8 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94929
94962
  directives: [{
94930
94963
  name: "show",
94931
94964
  rawName: "v-show",
94932
- value: _vm.searchInput === '' || !_vm.isShowSearch,
94933
- expression: "searchInput === '' || !isShowSearch"
94965
+ value: !_vm.isFilterView,
94966
+ expression: "!isFilterView"
94934
94967
  }],
94935
94968
  ref: "cascaderPanel",
94936
94969
  staticClass: "cascader-panel-inner",
@@ -94946,6 +94979,17 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94946
94979
  "expand-change": _vm.handleExpandChange,
94947
94980
  "change": _vm.handleValueChange
94948
94981
  },
94982
+ scopedSlots: _vm._u([{
94983
+ key: "default",
94984
+ fn: function ({
94985
+ node,
94986
+ data
94987
+ }) {
94988
+ return [_vm._v(" " + _vm._s(node.label)), _vm.showDropdownFilter && _vm.getNodeFilterFieldText(data) ? _c('span', {
94989
+ staticClass: "node-filter-field"
94990
+ }, [_vm._v(_vm._s(_vm.getNodeFilterFieldText(data)))]) : _vm._e()];
94991
+ }
94992
+ }], null, false, 181072543),
94949
94993
  model: {
94950
94994
  value: _vm.mainPanelValue,
94951
94995
  callback: function ($$v) {
@@ -94953,12 +94997,12 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94953
94997
  },
94954
94998
  expression: "mainPanelValue"
94955
94999
  }
94956
- }) : _vm._e(), _vm.searchOptions.length > 0 ? _c('el-cascader-panel', {
95000
+ }) : _vm._e(), _vm.viewOptions.length > 0 ? _c('el-cascader-panel', {
94957
95001
  directives: [{
94958
95002
  name: "show",
94959
95003
  rawName: "v-show",
94960
- value: _vm.searchInput !== '' && _vm.isShowSearch,
94961
- expression: "searchInput !== '' && isShowSearch"
95004
+ value: _vm.isFilterView,
95005
+ expression: "isFilterView"
94962
95006
  }],
94963
95007
  ref: "searchCascaderPanel",
94964
95008
  staticClass: "cascader-panel-inner",
@@ -94967,13 +95011,24 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94967
95011
  },
94968
95012
  attrs: {
94969
95013
  "append-to-body": false,
94970
- "options": _vm.searchOptions,
95014
+ "options": _vm.viewOptions,
94971
95015
  "props": _vm.cascaderProps
94972
95016
  },
94973
95017
  on: {
94974
95018
  "expand-change": _vm.handleExpandChange,
94975
95019
  "change": _vm.handleSearchValueChange
94976
95020
  },
95021
+ scopedSlots: _vm._u([{
95022
+ key: "default",
95023
+ fn: function ({
95024
+ node,
95025
+ data
95026
+ }) {
95027
+ return [_vm._v(" " + _vm._s(node.label)), _vm.showDropdownFilter && _vm.getNodeFilterFieldText(data) ? _c('span', {
95028
+ staticClass: "node-filter-field"
95029
+ }, [_vm._v(_vm._s(_vm.getNodeFilterFieldText(data)))]) : _vm._e()];
95030
+ }
95031
+ }], null, false, 181072543),
94977
95032
  model: {
94978
95033
  value: _vm.searchPanelValue,
94979
95034
  callback: function ($$v) {
@@ -94981,13 +95036,7 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94981
95036
  },
94982
95037
  expression: "searchPanelValue"
94983
95038
  }
94984
- }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
94985
- directives: [{
94986
- name: "show",
94987
- rawName: "v-show",
94988
- value: _vm.searchInput !== '',
94989
- expression: "searchInput !== ''"
94990
- }],
95039
+ }) : _vm._e(), _vm.isFilterView && _vm.viewOptions.length === 0 ? _c('div', {
94991
95040
  staticClass: "empty-search"
94992
95041
  }, [_c('el-empty', {
94993
95042
  attrs: {
@@ -95069,7 +95118,7 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
95069
95118
  staticClass: "empty-state"
95070
95119
  }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])]);
95071
95120
  };
95072
- var ByCascaderPanelvue_type_template_id_727f392c_staticRenderFns = [];
95121
+ var ByCascaderPanelvue_type_template_id_3691e51e_staticRenderFns = [];
95073
95122
 
95074
95123
  ;// ./src/utils/cascaderUtils.js
95075
95124
 
@@ -95241,6 +95290,58 @@ class CascaderUtils {
95241
95290
  return result;
95242
95291
  }
95243
95292
 
95293
+ /**
95294
+ * 判断节点指定字段是否匹配下拉筛选值
95295
+ * @param {Object} node
95296
+ * @param {String} field
95297
+ * @param {*} filterValue
95298
+ * @returns {Boolean}
95299
+ */
95300
+ static isFilterFieldMatched(node, field, filterValue) {
95301
+ if (!node || !field || filterValue === null || filterValue === undefined || filterValue === '') {
95302
+ return false;
95303
+ }
95304
+ const raw = node[field];
95305
+ if (raw === null || raw === undefined || raw === '') {
95306
+ return false;
95307
+ }
95308
+ return String(raw).trim() === String(filterValue).trim();
95309
+ }
95310
+
95311
+ /**
95312
+ * 按数据字段过滤树:保留字段匹配的节点及其祖先路径
95313
+ * @param {Array} tree - 树形数据
95314
+ * @param {String} field - 数据中用于筛选的字段名
95315
+ * @param {*} filterValue - 下拉选中值
95316
+ * @param {Object} cascaderProps - 级联配置
95317
+ * @returns {Array} 过滤后的树
95318
+ */
95319
+ static filterTreeByField(tree, field, filterValue, cascaderProps) {
95320
+ if (!Array.isArray(tree) || !field || filterValue === null || filterValue === undefined || filterValue === '') {
95321
+ return tree || [];
95322
+ }
95323
+ const childrenKey = cascaderProps && cascaderProps.children || 'children';
95324
+ const result = [];
95325
+ tree.forEach(node => {
95326
+ const children = node[childrenKey];
95327
+ const hasChildren = Array.isArray(children) && children.length > 0;
95328
+ if (hasChildren) {
95329
+ const matchedChildren = this.filterTreeByField(children, field, filterValue, cascaderProps);
95330
+ if (matchedChildren.length > 0) {
95331
+ result.push({
95332
+ ...node,
95333
+ [childrenKey]: matchedChildren
95334
+ });
95335
+ }
95336
+ } else if (this.isFilterFieldMatched(node, field, filterValue)) {
95337
+ result.push({
95338
+ ...node
95339
+ });
95340
+ }
95341
+ });
95342
+ return result;
95343
+ }
95344
+
95244
95345
  /**
95245
95346
  * 获取叶子节点的值
95246
95347
  * @param {Array} tree - 树形数据
@@ -95692,6 +95793,13 @@ class CascaderUtils {
95692
95793
 
95693
95794
 
95694
95795
 
95796
+
95797
+
95798
+
95799
+
95800
+
95801
+
95802
+
95695
95803
  /* harmony default export */ var ByCascaderPanelvue_type_script_lang_js = ({
95696
95804
  name: 'ByCascaderPanel',
95697
95805
  props: {
@@ -95806,6 +95914,15 @@ class CascaderUtils {
95806
95914
  refreshing: {
95807
95915
  type: Boolean,
95808
95916
  default: false
95917
+ },
95918
+ /**
95919
+ * 下拉筛选配置。外部传入且 enabled 不为 false、并指定 field 时才展示下拉框。
95920
+ * { enabled, title, placeholder, options: [{ label, value }], field }
95921
+ * field 为数据中用于过滤和展示的字段名。
95922
+ */
95923
+ dropdownFilter: {
95924
+ type: Object,
95925
+ default: null
95809
95926
  }
95810
95927
  },
95811
95928
  data() {
@@ -95825,7 +95942,9 @@ class CascaderUtils {
95825
95942
  // 防止循环更新的标志
95826
95943
  batchSearchVisible: false,
95827
95944
  // 批量搜索弹窗显示状态
95828
- batchSearchContent: '' // 批量搜索输入内容
95945
+ batchSearchContent: '',
95946
+ // 批量搜索输入内容
95947
+ dropdownFilterValue: '' // 下拉筛选当前值,未开启时不使用
95829
95948
  };
95830
95949
  },
95831
95950
  computed: {
@@ -95898,6 +96017,61 @@ class CascaderUtils {
95898
96017
  this.searchSelectedValues = value ? [value] : [];
95899
96018
  }
95900
96019
  }
96020
+ },
96021
+ // 是否展示下拉筛选(外部有配置且指定了数据字段才展示)
96022
+ showDropdownFilter() {
96023
+ const cfg = this.dropdownFilter;
96024
+ return !!(cfg && typeof cfg === 'object' && cfg.enabled !== false && cfg.field);
96025
+ },
96026
+ dropdownFilterPlaceholder() {
96027
+ return this.dropdownFilter && this.dropdownFilter.placeholder || '请选择';
96028
+ },
96029
+ dropdownFilterTitle() {
96030
+ const title = this.dropdownFilter && this.dropdownFilter.title;
96031
+ return title != null && String(title).trim() !== '' ? String(title).trim() : '';
96032
+ },
96033
+ dropdownFilterField() {
96034
+ return this.dropdownFilter && this.dropdownFilter.field || '';
96035
+ },
96036
+ normalizedDropdownFilterOptions() {
96037
+ const opts = this.dropdownFilter && this.dropdownFilter.options || [];
96038
+ return opts.map(opt => {
96039
+ if (opt != null && typeof opt === 'object') {
96040
+ return {
96041
+ label: opt.label != null ? opt.label : opt.value,
96042
+ value: opt.value != null ? opt.value : opt.label
96043
+ };
96044
+ }
96045
+ return {
96046
+ label: String(opt),
96047
+ value: opt
96048
+ };
96049
+ });
96050
+ },
96051
+ hasActiveDropdownFilter() {
96052
+ return this.showDropdownFilter && this.dropdownFilterValue !== '' && this.dropdownFilterValue !== null && this.dropdownFilterValue !== undefined;
96053
+ },
96054
+ // 下拉筛选后的展示树;未筛选时等于完整 processed 树,保证原有逻辑不变
96055
+ displayOptions() {
96056
+ if (!this.hasActiveDropdownFilter) {
96057
+ return this.filteredOptions;
96058
+ }
96059
+ return CascaderUtils.filterTreeByField(this.filteredOptions, this.dropdownFilterField, this.dropdownFilterValue, this.cascaderProps);
96060
+ },
96061
+ isFilterView() {
96062
+ if (this.searchInput !== '' && this.isShowSearch) {
96063
+ return true;
96064
+ }
96065
+ return this.hasActiveDropdownFilter;
96066
+ },
96067
+ viewOptions() {
96068
+ if (this.searchInput !== '' && this.isShowSearch) {
96069
+ return this.searchOptions;
96070
+ }
96071
+ if (this.hasActiveDropdownFilter) {
96072
+ return this.displayOptions;
96073
+ }
96074
+ return [];
95901
96075
  }
95902
96076
  },
95903
96077
  watch: {
@@ -95937,6 +96111,9 @@ class CascaderUtils {
95937
96111
  // 普通模式下的全选判断
95938
96112
  this.isAllSelected = this.selectedCount === this.totalCount;
95939
96113
  }
96114
+ if (this.hasActiveDropdownFilter) {
96115
+ this.updateFilterAllSelectedState();
96116
+ }
95940
96117
  } else {
95941
96118
  // 单选模式:最多只能有一个选中项
95942
96119
  if (newVal.length > 1) {
@@ -95953,6 +96130,11 @@ class CascaderUtils {
95953
96130
  if (val) {
95954
96131
  this.batchSearchVisible = false;
95955
96132
  }
96133
+ },
96134
+ showDropdownFilter(val) {
96135
+ if (!val) {
96136
+ this.dropdownFilterValue = '';
96137
+ }
95956
96138
  }
95957
96139
  },
95958
96140
  mounted() {
@@ -96024,6 +96206,11 @@ class CascaderUtils {
96024
96206
  this.filteredOptions = this.processOptions(this.options);
96025
96207
  this.countTotalItems();
96026
96208
  this.updateSelectedItems();
96209
+ if (this.searchInput) {
96210
+ this.handleSearch();
96211
+ } else if (this.hasActiveDropdownFilter) {
96212
+ this.syncFilterViewSelection();
96213
+ }
96027
96214
  },
96028
96215
  // 处理选项数据,添加禁用状态
96029
96216
  processOptions(options) {
@@ -96112,10 +96299,14 @@ class CascaderUtils {
96112
96299
  this.searchInput = this.searchInput.trim();
96113
96300
  if (this.searchInput === '') {
96114
96301
  this.isShowSearch = false;
96302
+ this.searchOptions = [];
96303
+ if (this.hasActiveDropdownFilter) {
96304
+ this.syncFilterViewSelection();
96305
+ }
96115
96306
  return;
96116
96307
  }
96117
96308
  this.isShowSearch = false;
96118
- this.searchOptions = CascaderUtils.searchInTree(this.filteredOptions, this.searchInput, this.cascaderProps);
96309
+ this.searchOptions = CascaderUtils.searchInTree(this.displayOptions, this.searchInput, this.cascaderProps);
96119
96310
 
96120
96311
  // 只设置搜索范围内的选中值
96121
96312
  this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.searchOptions, this.cascaderProps);
@@ -96152,7 +96343,7 @@ class CascaderUtils {
96152
96343
  handleExpandChange(values = []) {
96153
96344
  if (values.length === 1) {
96154
96345
  this.$nextTick(() => {
96155
- const panel = this.$refs.cascaderPanel || this.$refs.searchCascaderPanel;
96346
+ const panel = this.isFilterView ? this.$refs.searchCascaderPanel || this.$refs.cascaderPanel : this.$refs.cascaderPanel || this.$refs.searchCascaderPanel;
96156
96347
  if (panel) {
96157
96348
  const menus = panel.menus;
96158
96349
  const targetNode = menus[0].find(node => node.value == values[0]);
@@ -96192,15 +96383,15 @@ class CascaderUtils {
96192
96383
  this.$emit('input', emitValue);
96193
96384
  });
96194
96385
  },
96195
- // 搜索模式值变化处理
96386
+ // 搜索 / 下拉筛选视图值变化处理
96196
96387
  handleSearchValueChange(value) {
96197
- // 获取搜索面板中所有可能的叶子节点值
96198
- const searchLeafValues = CascaderUtils.getLeafValues(this.searchOptions, this.cascaderProps);
96388
+ // 获取当前筛选/搜索视图中所有可能的叶子节点值
96389
+ const viewLeafValues = CascaderUtils.getLeafValues(this.viewOptions, this.cascaderProps);
96199
96390
  if (this.isMultiple) {
96200
- // 多选模式:从主选择列表中移除搜索范围内的项,然后添加搜索面板中选中的项
96391
+ // 多选模式:从主选择列表中移除视图范围内的项,然后添加视图中选中的项
96201
96392
  this.selectedValues = this.selectedValues.filter(path => {
96202
96393
  const leafValue = path[path.length - 1];
96203
- return !searchLeafValues.includes(leafValue);
96394
+ return !viewLeafValues.includes(leafValue);
96204
96395
  });
96205
96396
  this.selectedValues = [...this.selectedValues, ...this.searchSelectedValues];
96206
96397
  } else {
@@ -96270,15 +96461,26 @@ class CascaderUtils {
96270
96461
  // 单选模式下不支持全选
96271
96462
  return;
96272
96463
  }
96273
- if (this.isAllSelected) {
96464
+ const config = {
96465
+ disabledField: this.disabledField,
96466
+ disabledValue: this.disabledValue,
96467
+ disabledCheck: this.disabledCheck
96468
+ };
96469
+ if (this.hasActiveDropdownFilter) {
96470
+ const viewPaths = CascaderUtils.getAllLeafPaths(this.displayOptions, config, this.cascaderProps);
96471
+ const viewLeafSet = new Set(viewPaths.map(path => path[path.length - 1]));
96472
+ if (this.isAllSelected) {
96473
+ this.selectedValues = this.selectedValues.filter(path => !viewLeafSet.has(path[path.length - 1]));
96474
+ } else {
96475
+ const preserved = this.selectedValues.filter(path => !viewLeafSet.has(path[path.length - 1]));
96476
+ this.selectedValues = [...preserved, ...viewPaths];
96477
+ }
96478
+ this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.viewOptions, this.cascaderProps);
96479
+ this.updateSelectedItems();
96480
+ } else if (this.isAllSelected) {
96274
96481
  this.selectedValues = [];
96275
96482
  this.selectedItems = [];
96276
96483
  } else {
96277
- const config = {
96278
- disabledField: this.disabledField,
96279
- disabledValue: this.disabledValue,
96280
- disabledCheck: this.disabledCheck
96281
- };
96282
96484
  // 无论是普通模式还是聚合模式,全选时都选择所有可选的叶子节点
96283
96485
  this.selectedValues = CascaderUtils.getAllLeafPaths(this.filteredOptions, config, this.cascaderProps);
96284
96486
  this.updateSelectedItems();
@@ -96431,6 +96633,54 @@ class CascaderUtils {
96431
96633
  }
96432
96634
  this.$emit('refresh');
96433
96635
  },
96636
+ getNodeFilterFieldText(data) {
96637
+ if (!this.showDropdownFilter || !this.dropdownFilterField || !data) {
96638
+ return '';
96639
+ }
96640
+ const val = data[this.dropdownFilterField];
96641
+ if (val === null || val === undefined || val === '') {
96642
+ return '';
96643
+ }
96644
+ return `(${val})`;
96645
+ },
96646
+ updateFilterAllSelectedState() {
96647
+ if (!this.hasActiveDropdownFilter) {
96648
+ return;
96649
+ }
96650
+ const config = {
96651
+ disabledField: this.disabledField,
96652
+ disabledValue: this.disabledValue,
96653
+ disabledCheck: this.disabledCheck
96654
+ };
96655
+ const viewPaths = CascaderUtils.getAllLeafPaths(this.displayOptions, config, this.cascaderProps);
96656
+ if (viewPaths.length === 0) {
96657
+ this.isAllSelected = false;
96658
+ return;
96659
+ }
96660
+ const selectedLeafSet = new Set(this.selectedValues.map(path => path[path.length - 1]));
96661
+ this.isAllSelected = viewPaths.every(path => selectedLeafSet.has(path[path.length - 1]));
96662
+ },
96663
+ syncFilterViewSelection() {
96664
+ this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.viewOptions, this.cascaderProps);
96665
+ this.$nextTick(() => {
96666
+ if (this.viewOptions.length > 0) {
96667
+ this.handleSearchExpand();
96668
+ }
96669
+ });
96670
+ },
96671
+ handleDropdownFilterChange() {
96672
+ if (this.searchInput) {
96673
+ this.handleSearch();
96674
+ return;
96675
+ }
96676
+ this.isShowSearch = false;
96677
+ this.searchOptions = [];
96678
+ if (this.hasActiveDropdownFilter) {
96679
+ this.syncFilterViewSelection();
96680
+ } else {
96681
+ this.searchSelectedValues = [];
96682
+ }
96683
+ },
96434
96684
  // 处理批量搜索
96435
96685
  handleBatchSearch() {
96436
96686
  if (!this.batchSearchContent.trim()) {
@@ -96553,8 +96803,8 @@ class CascaderUtils {
96553
96803
  ;
96554
96804
  var ByCascaderPanel_component = normalizeComponent(
96555
96805
  cascader_panel_ByCascaderPanelvue_type_script_lang_js,
96556
- ByCascaderPanelvue_type_template_id_727f392c_render,
96557
- ByCascaderPanelvue_type_template_id_727f392c_staticRenderFns,
96806
+ ByCascaderPanelvue_type_template_id_3691e51e_render,
96807
+ ByCascaderPanelvue_type_template_id_3691e51e_staticRenderFns,
96558
96808
  false,
96559
96809
  null,
96560
96810
  null,
@@ -96563,8 +96813,8 @@ var ByCascaderPanel_component = normalizeComponent(
96563
96813
  )
96564
96814
 
96565
96815
  /* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
96566
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=961f637e
96567
- var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96816
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=21ca97ff
96817
+ var ByCascaderPanelProvue_type_template_id_21ca97ff_render = function render() {
96568
96818
  var _vm = this,
96569
96819
  _c = _vm._self._c;
96570
96820
  return _c('div', {
@@ -96583,7 +96833,10 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96583
96833
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
96584
96834
  staticClass: "search-section"
96585
96835
  }, [_c('div', {
96586
- staticClass: "search-container"
96836
+ staticClass: "search-container",
96837
+ class: {
96838
+ 'has-dropdown-filter': _vm.showDropdownFilter
96839
+ }
96587
96840
  }, [_c('div', {
96588
96841
  staticClass: "search-input-wrap",
96589
96842
  class: {
@@ -96679,7 +96932,37 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96679
96932
  slot: "reference"
96680
96933
  }, [_c('i', {
96681
96934
  staticClass: "el-icon-edit-outline"
96682
- })])], 1)], 1) : _vm._e()], 1), _vm.showRefreshBtn ? _c('el-tooltip', {
96935
+ })])], 1)], 1) : _vm._e()], 1), _vm.showDropdownFilter ? _c('div', {
96936
+ staticClass: "dropdown-filter-group"
96937
+ }, [_vm.dropdownFilterTitle ? _c('span', {
96938
+ staticClass: "dropdown-filter-title"
96939
+ }, [_vm._v(_vm._s(_vm.dropdownFilterTitle) + ":")]) : _vm._e(), _c('el-select', {
96940
+ staticClass: "dropdown-filter-select",
96941
+ attrs: {
96942
+ "placeholder": _vm.dropdownFilterPlaceholder,
96943
+ "clearable": "",
96944
+ "size": "mini",
96945
+ "disabled": _vm.panelViewMode
96946
+ },
96947
+ on: {
96948
+ "change": _vm.handleDropdownFilterChange
96949
+ },
96950
+ model: {
96951
+ value: _vm.dropdownFilterValue,
96952
+ callback: function ($$v) {
96953
+ _vm.dropdownFilterValue = $$v;
96954
+ },
96955
+ expression: "dropdownFilterValue"
96956
+ }
96957
+ }, _vm._l(_vm.normalizedDropdownFilterOptions, function (opt) {
96958
+ return _c('el-option', {
96959
+ key: 'df-' + opt.value,
96960
+ attrs: {
96961
+ "label": opt.label,
96962
+ "value": opt.value
96963
+ }
96964
+ });
96965
+ }), 1)], 1) : _vm._e(), _vm.showRefreshBtn ? _c('el-tooltip', {
96683
96966
  attrs: {
96684
96967
  "content": _vm.refreshTooltip,
96685
96968
  "placement": "top",
@@ -96720,8 +97003,8 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96720
97003
  directives: [{
96721
97004
  name: "show",
96722
97005
  rawName: "v-show",
96723
- value: _vm.searchInput === '' || !_vm.isShowSearch,
96724
- expression: "searchInput === '' || !isShowSearch"
97006
+ value: !_vm.isFilterView,
97007
+ expression: "!isFilterView"
96725
97008
  }],
96726
97009
  ref: "cascaderPanel",
96727
97010
  staticClass: "cascader-panel-inner",
@@ -96737,44 +97020,41 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96737
97020
  "column-min-width": _vm.columnMinWidth,
96738
97021
  "column-max-width": _vm.columnMaxWidth,
96739
97022
  "disabled-config": _vm.disabledConfig,
96740
- "is-view-mode": _vm.panelViewMode
97023
+ "is-view-mode": _vm.panelViewMode,
97024
+ "filter-field": _vm.showDropdownFilter ? _vm.dropdownFilterField : ''
96741
97025
  },
96742
97026
  on: {
96743
97027
  "input": _vm.onMainPanelInput,
96744
97028
  "change": _vm.handleValueChange,
96745
97029
  "store-ready": _vm.schedulePanelSyncFromExternalValue
96746
97030
  }
96747
- }) : _vm._e(), _vm.searchOptions.length > 0 ? _c('VirtualCascaderPanel', {
97031
+ }) : _vm._e(), _vm.viewOptions.length > 0 ? _c('VirtualCascaderPanel', {
96748
97032
  directives: [{
96749
97033
  name: "show",
96750
97034
  rawName: "v-show",
96751
- value: _vm.searchInput !== '' && _vm.isShowSearch,
96752
- expression: "searchInput !== '' && isShowSearch"
97035
+ value: _vm.isFilterView,
97036
+ expression: "isFilterView"
96753
97037
  }],
96754
97038
  ref: "searchCascaderPanel",
96755
97039
  staticClass: "cascader-panel-inner",
96756
97040
  attrs: {
96757
97041
  "value": _vm.compactSearchPanelValue,
96758
97042
  "sync-value-from-parent": false,
96759
- "options": _vm.searchOptions,
97043
+ "options": _vm.viewOptions,
96760
97044
  "props": _vm.cascaderProps,
96761
97045
  "height": _vm.computedPanelHeight - 20,
96762
97046
  "column-min-width": _vm.columnMinWidth,
96763
97047
  "column-max-width": _vm.columnMaxWidth,
96764
97048
  "disabled-config": _vm.disabledConfig,
96765
- "is-view-mode": _vm.panelViewMode
97049
+ "is-view-mode": _vm.panelViewMode,
97050
+ "filter-field": _vm.showDropdownFilter ? _vm.dropdownFilterField : ''
96766
97051
  },
96767
97052
  on: {
96768
97053
  "input": _vm.onSearchPanelInput,
96769
- "change": _vm.handleSearchValueChange
97054
+ "change": _vm.handleSearchValueChange,
97055
+ "store-ready": _vm.syncSearchPanelSelection
96770
97056
  }
96771
- }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
96772
- directives: [{
96773
- name: "show",
96774
- rawName: "v-show",
96775
- value: _vm.searchInput !== '',
96776
- expression: "searchInput !== ''"
96777
- }],
97057
+ }) : _vm._e(), _vm.isFilterView && _vm.viewOptions.length === 0 ? _c('div', {
96778
97058
  staticClass: "empty-search"
96779
97059
  }, [_c('el-empty', {
96780
97060
  attrs: {
@@ -96845,7 +97125,7 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96845
97125
  staticClass: "empty-state"
96846
97126
  }, [_vm._v("暂无选中项")])], 1)])])])]);
96847
97127
  };
96848
- var ByCascaderPanelProvue_type_template_id_961f637e_staticRenderFns = [];
97128
+ var ByCascaderPanelProvue_type_template_id_21ca97ff_staticRenderFns = [];
96849
97129
 
96850
97130
  ;// ./src/components/cascader-panel-pro/cascaderStorePro.js
96851
97131
 
@@ -97137,14 +97417,22 @@ class CascaderUtilsPro {
97137
97417
  minWidth = 180,
97138
97418
  maxWidth = 420,
97139
97419
  extraPadding = 56,
97140
- hasCheckbox = true
97420
+ hasCheckbox = true,
97421
+ filterField = ''
97141
97422
  } = options;
97142
97423
  if (!nodes || nodes.length === 0) {
97143
97424
  return minWidth;
97144
97425
  }
97145
97426
  let maxLabelWidth = 0;
97146
97427
  nodes.forEach(node => {
97147
- maxLabelWidth = Math.max(maxLabelWidth, this.measureCascaderLabelWidth(node.label));
97428
+ let text = node.label || '';
97429
+ if (filterField) {
97430
+ const extra = node.raw && node.raw[filterField];
97431
+ if (extra !== null && extra !== undefined && extra !== '') {
97432
+ text += ` (${extra})`;
97433
+ }
97434
+ }
97435
+ maxLabelWidth = Math.max(maxLabelWidth, this.measureCascaderLabelWidth(text));
97148
97436
  });
97149
97437
  const checkboxWidth = hasCheckbox ? 28 : 0;
97150
97438
  const arrowWidth = 24;
@@ -97303,6 +97591,58 @@ class CascaderUtilsPro {
97303
97591
  return result;
97304
97592
  }
97305
97593
 
97594
+ /**
97595
+ * 判断节点指定字段是否匹配下拉筛选值
97596
+ * @param {Object} node
97597
+ * @param {String} field
97598
+ * @param {*} filterValue
97599
+ * @returns {Boolean}
97600
+ */
97601
+ static isFilterFieldMatched(node, field, filterValue) {
97602
+ if (!node || !field || filterValue === null || filterValue === undefined || filterValue === '') {
97603
+ return false;
97604
+ }
97605
+ const raw = node[field];
97606
+ if (raw === null || raw === undefined || raw === '') {
97607
+ return false;
97608
+ }
97609
+ return String(raw).trim() === String(filterValue).trim();
97610
+ }
97611
+
97612
+ /**
97613
+ * 按数据字段过滤树:保留字段匹配的节点及其祖先路径
97614
+ * @param {Array} tree - 树形数据
97615
+ * @param {String} field - 数据中用于筛选的字段名
97616
+ * @param {*} filterValue - 下拉选中值
97617
+ * @param {Object} cascaderProps - 级联配置
97618
+ * @returns {Array} 过滤后的树
97619
+ */
97620
+ static filterTreeByField(tree, field, filterValue, cascaderProps) {
97621
+ if (!Array.isArray(tree) || !field || filterValue === null || filterValue === undefined || filterValue === '') {
97622
+ return tree || [];
97623
+ }
97624
+ const childrenKey = cascaderProps && cascaderProps.children || 'children';
97625
+ const result = [];
97626
+ tree.forEach(node => {
97627
+ const children = node[childrenKey];
97628
+ const hasChildren = Array.isArray(children) && children.length > 0;
97629
+ if (hasChildren) {
97630
+ const matchedChildren = this.filterTreeByField(children, field, filterValue, cascaderProps);
97631
+ if (matchedChildren.length > 0) {
97632
+ result.push({
97633
+ ...node,
97634
+ [childrenKey]: matchedChildren
97635
+ });
97636
+ }
97637
+ } else if (this.isFilterFieldMatched(node, field, filterValue)) {
97638
+ result.push({
97639
+ ...node
97640
+ });
97641
+ }
97642
+ });
97643
+ return result;
97644
+ }
97645
+
97306
97646
  /**
97307
97647
  * 基于扁平 store 快速搜索(父节点命中时直接复用 raw 子树,跳过子级遍历)
97308
97648
  */
@@ -97846,8 +98186,8 @@ class CascaderUtilsPro {
97846
98186
  return paths;
97847
98187
  }
97848
98188
  }
97849
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=05f77638
97850
- var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render() {
98189
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=7d8ff846
98190
+ var VirtualCascaderPanelvue_type_template_id_7d8ff846_render = function render() {
97851
98191
  var _vm = this,
97852
98192
  _c = _vm._self._c;
97853
98193
  return _c('div', {
@@ -97928,7 +98268,9 @@ var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render()
97928
98268
  }
97929
98269
  }, [_c('span')])], 1) : _vm._e(), _c('span', {
97930
98270
  staticClass: "el-cascader-node__label"
97931
- }, [_vm._v(_vm._s(item.label))]), !item.isLeaf ? _c('span', {
98271
+ }, [_vm.filterField ? [_vm._v(" " + _vm._s(item.label)), _vm.getFilterFieldText(item) ? _c('span', {
98272
+ staticClass: "node-filter-field"
98273
+ }, [_vm._v(_vm._s(_vm.getFilterFieldText(item)))]) : _vm._e()] : [_vm._v(_vm._s(item.label))]], 2), !item.isLeaf ? _c('span', {
97932
98274
  staticClass: "el-cascader-node__postfix"
97933
98275
  }, [_c('i', {
97934
98276
  staticClass: "el-icon-arrow-right el-cascader-node__icon-arrow"
@@ -97938,7 +98280,7 @@ var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render()
97938
98280
  })], 1);
97939
98281
  }), 0);
97940
98282
  };
97941
- var VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns = [];
98283
+ var VirtualCascaderPanelvue_type_template_id_7d8ff846_staticRenderFns = [];
97942
98284
 
97943
98285
  ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"185687ec-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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/cascader-panel-pro/VirtualList.vue?vue&type=template&id=43cb1148
97944
98286
  var VirtualListvue_type_template_id_43cb1148_render = function render() {
@@ -98422,6 +98764,11 @@ class SelectionStatePro {
98422
98764
  syncValueFromParent: {
98423
98765
  type: Boolean,
98424
98766
  default: true
98767
+ },
98768
+ // 下拉筛选字段名:有值时在节点名称后展示该字段内容
98769
+ filterField: {
98770
+ type: String,
98771
+ default: ''
98425
98772
  }
98426
98773
  },
98427
98774
  data() {
@@ -98538,7 +98885,8 @@ class SelectionStatePro {
98538
98885
  const width = CascaderUtilsPro.getCascaderColumnWidth(columnNodes, {
98539
98886
  minWidth: this.columnMinWidth,
98540
98887
  maxWidth: this.columnMaxWidth,
98541
- hasCheckbox: this.multiple || this.checkStrictly
98888
+ hasCheckbox: this.multiple || this.checkStrictly,
98889
+ filterField: this.filterField
98542
98890
  });
98543
98891
  return {
98544
98892
  width: width + 'px',
@@ -98546,6 +98894,17 @@ class SelectionStatePro {
98546
98894
  maxWidth: width + 'px'
98547
98895
  };
98548
98896
  },
98897
+ getFilterFieldText(item) {
98898
+ if (!this.filterField || !item) {
98899
+ return '';
98900
+ }
98901
+ const raw = item.raw || item;
98902
+ const val = raw[this.filterField];
98903
+ if (val === null || val === undefined || val === '') {
98904
+ return '';
98905
+ }
98906
+ return `(${val})`;
98907
+ },
98549
98908
  rebuildStore() {
98550
98909
  this.store = buildCascaderStore(this.options, this.disabledConfig, this.props, CascaderUtilsPro);
98551
98910
  this.selection = new SelectionStatePro(this.store);
@@ -98855,8 +99214,8 @@ class SelectionStatePro {
98855
99214
  ;
98856
99215
  var VirtualCascaderPanel_component = normalizeComponent(
98857
99216
  cascader_panel_pro_VirtualCascaderPanelvue_type_script_lang_js,
98858
- VirtualCascaderPanelvue_type_template_id_05f77638_render,
98859
- VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns,
99217
+ VirtualCascaderPanelvue_type_template_id_7d8ff846_render,
99218
+ VirtualCascaderPanelvue_type_template_id_7d8ff846_staticRenderFns,
98860
99219
  false,
98861
99220
  null,
98862
99221
  null,
@@ -99012,6 +99371,15 @@ var VirtualCascaderPanel_component = normalizeComponent(
99012
99371
  columnMaxWidth: {
99013
99372
  type: Number,
99014
99373
  default: 420
99374
+ },
99375
+ /**
99376
+ * 下拉筛选配置。外部传入且 enabled 不为 false、并指定 field 时才展示下拉框。
99377
+ * { enabled, title, placeholder, options: [{ label, value }], field }
99378
+ * field 为数据中用于过滤和展示的字段名。
99379
+ */
99380
+ dropdownFilter: {
99381
+ type: Object,
99382
+ default: null
99015
99383
  }
99016
99384
  },
99017
99385
  data() {
@@ -99039,7 +99407,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
99039
99407
  searchLeafSetCache: null,
99040
99408
  panelSyncTimer: null,
99041
99409
  // 外部 v-model 回显同步中,避免与用户操作冲突
99042
- isExternalSync: false
99410
+ isExternalSync: false,
99411
+ dropdownFilterValue: ''
99043
99412
  };
99044
99413
  },
99045
99414
  computed: {
@@ -99140,6 +99509,59 @@ var VirtualCascaderPanel_component = normalizeComponent(
99140
99509
  this.searchSelectedValues = value ? [value] : [];
99141
99510
  }
99142
99511
  }
99512
+ },
99513
+ showDropdownFilter() {
99514
+ const cfg = this.dropdownFilter;
99515
+ return !!(cfg && typeof cfg === 'object' && cfg.enabled !== false && cfg.field);
99516
+ },
99517
+ dropdownFilterPlaceholder() {
99518
+ return this.dropdownFilter && this.dropdownFilter.placeholder || '请选择';
99519
+ },
99520
+ dropdownFilterTitle() {
99521
+ const title = this.dropdownFilter && this.dropdownFilter.title;
99522
+ return title != null && String(title).trim() !== '' ? String(title).trim() : '';
99523
+ },
99524
+ dropdownFilterField() {
99525
+ return this.dropdownFilter && this.dropdownFilter.field || '';
99526
+ },
99527
+ normalizedDropdownFilterOptions() {
99528
+ const opts = this.dropdownFilter && this.dropdownFilter.options || [];
99529
+ return opts.map(opt => {
99530
+ if (opt != null && typeof opt === 'object') {
99531
+ return {
99532
+ label: opt.label != null ? opt.label : opt.value,
99533
+ value: opt.value != null ? opt.value : opt.label
99534
+ };
99535
+ }
99536
+ return {
99537
+ label: String(opt),
99538
+ value: opt
99539
+ };
99540
+ });
99541
+ },
99542
+ hasActiveDropdownFilter() {
99543
+ return this.showDropdownFilter && this.dropdownFilterValue !== '' && this.dropdownFilterValue !== null && this.dropdownFilterValue !== undefined;
99544
+ },
99545
+ displayOptions() {
99546
+ if (!this.hasActiveDropdownFilter) {
99547
+ return this.filteredOptions;
99548
+ }
99549
+ return CascaderUtilsPro.filterTreeByField(this.filteredOptions, this.dropdownFilterField, this.dropdownFilterValue, this.cascaderProps);
99550
+ },
99551
+ isFilterView() {
99552
+ if (this.searchInput !== '' && this.isShowSearch) {
99553
+ return true;
99554
+ }
99555
+ return this.hasActiveDropdownFilter;
99556
+ },
99557
+ viewOptions() {
99558
+ if (this.searchInput !== '' && this.isShowSearch) {
99559
+ return this.searchOptions;
99560
+ }
99561
+ if (this.hasActiveDropdownFilter) {
99562
+ return this.displayOptions;
99563
+ }
99564
+ return [];
99143
99565
  }
99144
99566
  },
99145
99567
  watch: {
@@ -99165,6 +99587,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99165
99587
  searchInput(val) {
99166
99588
  if (!val) {
99167
99589
  this.clearSearchState();
99590
+ if (this.hasActiveDropdownFilter) {
99591
+ this.prepareFilterView();
99592
+ }
99168
99593
  return;
99169
99594
  }
99170
99595
  this.scheduleSearch();
@@ -99192,6 +99617,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99192
99617
  } else if (panel && panel.store && panel.selection && this.aggregationMode) {
99193
99618
  this.isAllSelected = panel.selection.size() === panel.store.totalLeafCount && panel.store.totalLeafCount > 0;
99194
99619
  }
99620
+ if (this.hasActiveDropdownFilter) {
99621
+ this.updateFilterAllSelectedState();
99622
+ }
99195
99623
  } else {
99196
99624
  if (newVal.length > 1) {
99197
99625
  this.selectedItems = [newVal[newVal.length - 1]];
@@ -99206,6 +99634,11 @@ var VirtualCascaderPanel_component = normalizeComponent(
99206
99634
  if (val) {
99207
99635
  this.batchSearchVisible = false;
99208
99636
  }
99637
+ },
99638
+ showDropdownFilter(val) {
99639
+ if (!val) {
99640
+ this.dropdownFilterValue = '';
99641
+ }
99209
99642
  }
99210
99643
  },
99211
99644
  mounted() {
@@ -99259,6 +99692,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99259
99692
  this.selectedValues = selection.getCheckedPaths();
99260
99693
  }
99261
99694
  panel.bumpSelectionView();
99695
+ if (this.hasActiveDropdownFilter) {
99696
+ this.updateFilterAllSelectedState();
99697
+ }
99262
99698
  return;
99263
99699
  }
99264
99700
  if (selection.isCompactSelection()) {
@@ -99266,11 +99702,17 @@ var VirtualCascaderPanel_component = normalizeComponent(
99266
99702
  this.selectedCount = selection.size();
99267
99703
  this.isAllSelected = selection.size() === store.totalLeafCount;
99268
99704
  panel.bumpSelectionView();
99705
+ if (this.hasActiveDropdownFilter) {
99706
+ this.updateFilterAllSelectedState();
99707
+ }
99269
99708
  return;
99270
99709
  }
99271
99710
  this.selectedValues = selection.getCheckedPaths();
99272
99711
  this.updateSelectedItems();
99273
99712
  panel.bumpSelectionView();
99713
+ if (this.hasActiveDropdownFilter) {
99714
+ this.updateFilterAllSelectedState();
99715
+ }
99274
99716
  },
99275
99717
  /**
99276
99718
  * 用户操作(勾选/全选/清除/删除)统一提交:更新展示 + emit,标记内部更新防回显覆盖
@@ -99524,6 +99966,11 @@ var VirtualCascaderPanel_component = normalizeComponent(
99524
99966
  } else {
99525
99967
  this.updateSelectedItems();
99526
99968
  }
99969
+ if (this.searchInput) {
99970
+ this.scheduleSearch();
99971
+ } else if (this.hasActiveDropdownFilter) {
99972
+ this.prepareFilterView();
99973
+ }
99527
99974
  },
99528
99975
  // 处理选项数据,添加禁用状态(浅拷贝,避免 JSON 深拷贝大数据卡顿)
99529
99976
  processOptions(options) {
@@ -99609,13 +100056,20 @@ var VirtualCascaderPanel_component = normalizeComponent(
99609
100056
  const keyword = this.searchInput.trim();
99610
100057
  if (!keyword) {
99611
100058
  this.clearSearchState();
100059
+ if (this.hasActiveDropdownFilter) {
100060
+ this.prepareFilterView();
100061
+ }
99612
100062
  return;
99613
100063
  }
99614
- const panel = this.$refs.cascaderPanel;
99615
- if (panel && panel.store) {
99616
- this.searchOptions = CascaderUtilsPro.searchFromStore(panel.store, keyword, this.cascaderProps);
100064
+ if (this.hasActiveDropdownFilter) {
100065
+ this.searchOptions = CascaderUtilsPro.searchInTree(this.displayOptions, keyword, this.cascaderProps);
99617
100066
  } else {
99618
- this.searchOptions = CascaderUtilsPro.searchInTree(this.filteredOptions, keyword, this.cascaderProps);
100067
+ const panel = this.$refs.cascaderPanel;
100068
+ if (panel && panel.store) {
100069
+ this.searchOptions = CascaderUtilsPro.searchFromStore(panel.store, keyword, this.cascaderProps);
100070
+ } else {
100071
+ this.searchOptions = CascaderUtilsPro.searchInTree(this.filteredOptions, keyword, this.cascaderProps);
100072
+ }
99619
100073
  }
99620
100074
  this.searchLeafSetCache = new Set(CascaderUtilsPro.getLeafValues(this.searchOptions, this.cascaderProps));
99621
100075
  this.searchSelectedValues = this.getSearchSelectedPathsFromMain(this.searchLeafSetCache);
@@ -99647,7 +100101,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
99647
100101
  if (this.searchLeafSetCache) {
99648
100102
  return this.searchLeafSetCache;
99649
100103
  }
99650
- return new Set(CascaderUtilsPro.getLeafValues(this.searchOptions, this.cascaderProps));
100104
+ return new Set(CascaderUtilsPro.getLeafValues(this.viewOptions, this.cascaderProps));
99651
100105
  },
99652
100106
  syncSearchPanelSelection() {
99653
100107
  const searchPanel = this.$refs.searchCascaderPanel;
@@ -99667,12 +100121,46 @@ var VirtualCascaderPanel_component = normalizeComponent(
99667
100121
  },
99668
100122
  // 搜索模式下的展开处理
99669
100123
  handleSearchExpand() {
99670
- if (this.$refs.searchCascaderPanel && this.searchOptions.length > 0) {
99671
- const firstOption = this.searchOptions[0];
100124
+ if (this.$refs.searchCascaderPanel && this.viewOptions.length > 0) {
100125
+ const firstOption = this.viewOptions[0];
99672
100126
  const valueKey = this.cascaderProps.value || 'value';
99673
100127
  this.$refs.searchCascaderPanel.expandPathValues([firstOption[valueKey]], true);
99674
100128
  }
99675
100129
  },
100130
+ prepareFilterView() {
100131
+ this.searchLeafSetCache = new Set(CascaderUtilsPro.getLeafValues(this.displayOptions, this.cascaderProps));
100132
+ this.$nextTick(() => {
100133
+ this.syncSearchPanelSelection();
100134
+ this.handleSearchExpand();
100135
+ });
100136
+ },
100137
+ handleDropdownFilterChange() {
100138
+ if (this.searchInput) {
100139
+ this.scheduleSearch();
100140
+ return;
100141
+ }
100142
+ this.clearSearchState();
100143
+ if (this.hasActiveDropdownFilter) {
100144
+ this.prepareFilterView();
100145
+ }
100146
+ },
100147
+ updateFilterAllSelectedState() {
100148
+ if (!this.hasActiveDropdownFilter) {
100149
+ return;
100150
+ }
100151
+ const viewPaths = CascaderUtilsPro.getAllLeafPaths(this.displayOptions, this.disabledConfig, this.cascaderProps);
100152
+ if (viewPaths.length === 0) {
100153
+ this.isAllSelected = false;
100154
+ return;
100155
+ }
100156
+ const panel = this.$refs.cascaderPanel;
100157
+ if (panel && panel.selection && panel.selection.selectedLeafSet) {
100158
+ this.isAllSelected = viewPaths.every(path => panel.selection.selectedLeafSet.has(path[path.length - 1]));
100159
+ return;
100160
+ }
100161
+ const selectedLeafSet = new Set(this.selectedValues.map(path => path[path.length - 1]));
100162
+ this.isAllSelected = viewPaths.every(path => selectedLeafSet.has(path[path.length - 1]));
100163
+ },
99676
100164
  // 值变化处理(面板勾选)
99677
100165
  handleValueChange() {
99678
100166
  this.commitUserSelectionChange();
@@ -99764,6 +100252,26 @@ var VirtualCascaderPanel_component = normalizeComponent(
99764
100252
  }
99765
100253
  const panel = this.$refs.cascaderPanel;
99766
100254
  const searchPanel = this.$refs.searchCascaderPanel;
100255
+ if (this.hasActiveDropdownFilter && panel && panel.selection && panel.store) {
100256
+ const viewPaths = CascaderUtilsPro.getAllLeafPaths(this.displayOptions, this.disabledConfig, this.cascaderProps);
100257
+ const viewLeafSet = new Set(viewPaths.map(path => path[path.length - 1]));
100258
+ if (this.isAllSelected) {
100259
+ viewLeafSet.forEach(leaf => {
100260
+ panel.selection.selectedLeafSet.delete(leaf);
100261
+ });
100262
+ } else {
100263
+ viewLeafSet.forEach(leaf => {
100264
+ panel.selection.selectedLeafSet.add(leaf);
100265
+ });
100266
+ }
100267
+ panel.selection._reconcileAllRoots();
100268
+ panel.bumpSelectionView();
100269
+ if (searchPanel && searchPanel.selection) {
100270
+ this.syncSearchPanelSelection();
100271
+ }
100272
+ this.commitUserSelectionChange();
100273
+ return;
100274
+ }
99767
100275
  if (this.isAllSelected) {
99768
100276
  this.clearPanelSelectionState(panel);
99769
100277
  this.clearPanelSelectionState(searchPanel);
@@ -99889,6 +100397,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99889
100397
  if (this.panelViewMode) return;
99890
100398
  this.searchInput = '';
99891
100399
  this.clearSearchState();
100400
+ if (this.hasActiveDropdownFilter) {
100401
+ this.prepareFilterView();
100402
+ }
99892
100403
  this.$emit('refresh');
99893
100404
  },
99894
100405
  // 处理批量搜索
@@ -100017,8 +100528,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
100017
100528
  ;
100018
100529
  var ByCascaderPanelPro_component = normalizeComponent(
100019
100530
  cascader_panel_pro_ByCascaderPanelProvue_type_script_lang_js,
100020
- ByCascaderPanelProvue_type_template_id_961f637e_render,
100021
- ByCascaderPanelProvue_type_template_id_961f637e_staticRenderFns,
100531
+ ByCascaderPanelProvue_type_template_id_21ca97ff_render,
100532
+ ByCascaderPanelProvue_type_template_id_21ca97ff_staticRenderFns,
100022
100533
  false,
100023
100534
  null,
100024
100535
  null,