@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.
@@ -94778,8 +94778,8 @@ ByDialogService.install = function (Vue) {
94778
94778
  Vue.prototype.$byDialog = ByDialogService;
94779
94779
  };
94780
94780
  /* harmony default export */ var by_dialog_ByDialogService = (ByDialogService);
94781
- ;// ./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-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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=727f392c
94782
- var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94781
+ ;// ./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-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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=3691e51e
94782
+ var ByCascaderPanelvue_type_template_id_3691e51e_render = function render() {
94783
94783
  var _vm = this,
94784
94784
  _c = _vm._self._c;
94785
94785
  return _c('div', {
@@ -94798,7 +94798,10 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94798
94798
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
94799
94799
  staticClass: "search-section"
94800
94800
  }, [_c('div', {
94801
- staticClass: "search-container"
94801
+ staticClass: "search-container",
94802
+ class: {
94803
+ 'has-dropdown-filter': _vm.showDropdownFilter
94804
+ }
94802
94805
  }, [_c('div', {
94803
94806
  staticClass: "search-input-wrap",
94804
94807
  class: {
@@ -94897,7 +94900,37 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94897
94900
  slot: "reference"
94898
94901
  }, [_c('i', {
94899
94902
  staticClass: "el-icon-edit-outline"
94900
- })])], 1)], 1) : _vm._e()], 1), _vm.showRefreshBtn ? _c('el-tooltip', {
94903
+ })])], 1)], 1) : _vm._e()], 1), _vm.showDropdownFilter ? _c('div', {
94904
+ staticClass: "dropdown-filter-group"
94905
+ }, [_vm.dropdownFilterTitle ? _c('span', {
94906
+ staticClass: "dropdown-filter-title"
94907
+ }, [_vm._v(_vm._s(_vm.dropdownFilterTitle) + ":")]) : _vm._e(), _c('el-select', {
94908
+ staticClass: "dropdown-filter-select",
94909
+ attrs: {
94910
+ "placeholder": _vm.dropdownFilterPlaceholder,
94911
+ "clearable": "",
94912
+ "size": "mini",
94913
+ "disabled": _vm.panelViewMode
94914
+ },
94915
+ on: {
94916
+ "change": _vm.handleDropdownFilterChange
94917
+ },
94918
+ model: {
94919
+ value: _vm.dropdownFilterValue,
94920
+ callback: function ($$v) {
94921
+ _vm.dropdownFilterValue = $$v;
94922
+ },
94923
+ expression: "dropdownFilterValue"
94924
+ }
94925
+ }, _vm._l(_vm.normalizedDropdownFilterOptions, function (opt) {
94926
+ return _c('el-option', {
94927
+ key: 'df-' + opt.value,
94928
+ attrs: {
94929
+ "label": opt.label,
94930
+ "value": opt.value
94931
+ }
94932
+ });
94933
+ }), 1)], 1) : _vm._e(), _vm.showRefreshBtn ? _c('el-tooltip', {
94901
94934
  attrs: {
94902
94935
  "content": _vm.refreshTooltip,
94903
94936
  "placement": "top",
@@ -94939,8 +94972,8 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94939
94972
  directives: [{
94940
94973
  name: "show",
94941
94974
  rawName: "v-show",
94942
- value: _vm.searchInput === '' || !_vm.isShowSearch,
94943
- expression: "searchInput === '' || !isShowSearch"
94975
+ value: !_vm.isFilterView,
94976
+ expression: "!isFilterView"
94944
94977
  }],
94945
94978
  ref: "cascaderPanel",
94946
94979
  staticClass: "cascader-panel-inner",
@@ -94956,6 +94989,17 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94956
94989
  "expand-change": _vm.handleExpandChange,
94957
94990
  "change": _vm.handleValueChange
94958
94991
  },
94992
+ scopedSlots: _vm._u([{
94993
+ key: "default",
94994
+ fn: function ({
94995
+ node,
94996
+ data
94997
+ }) {
94998
+ return [_vm._v(" " + _vm._s(node.label)), _vm.showDropdownFilter && _vm.getNodeFilterFieldText(data) ? _c('span', {
94999
+ staticClass: "node-filter-field"
95000
+ }, [_vm._v(_vm._s(_vm.getNodeFilterFieldText(data)))]) : _vm._e()];
95001
+ }
95002
+ }], null, false, 181072543),
94959
95003
  model: {
94960
95004
  value: _vm.mainPanelValue,
94961
95005
  callback: function ($$v) {
@@ -94963,12 +95007,12 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94963
95007
  },
94964
95008
  expression: "mainPanelValue"
94965
95009
  }
94966
- }) : _vm._e(), _vm.searchOptions.length > 0 ? _c('el-cascader-panel', {
95010
+ }) : _vm._e(), _vm.viewOptions.length > 0 ? _c('el-cascader-panel', {
94967
95011
  directives: [{
94968
95012
  name: "show",
94969
95013
  rawName: "v-show",
94970
- value: _vm.searchInput !== '' && _vm.isShowSearch,
94971
- expression: "searchInput !== '' && isShowSearch"
95014
+ value: _vm.isFilterView,
95015
+ expression: "isFilterView"
94972
95016
  }],
94973
95017
  ref: "searchCascaderPanel",
94974
95018
  staticClass: "cascader-panel-inner",
@@ -94977,13 +95021,24 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94977
95021
  },
94978
95022
  attrs: {
94979
95023
  "append-to-body": false,
94980
- "options": _vm.searchOptions,
95024
+ "options": _vm.viewOptions,
94981
95025
  "props": _vm.cascaderProps
94982
95026
  },
94983
95027
  on: {
94984
95028
  "expand-change": _vm.handleExpandChange,
94985
95029
  "change": _vm.handleSearchValueChange
94986
95030
  },
95031
+ scopedSlots: _vm._u([{
95032
+ key: "default",
95033
+ fn: function ({
95034
+ node,
95035
+ data
95036
+ }) {
95037
+ return [_vm._v(" " + _vm._s(node.label)), _vm.showDropdownFilter && _vm.getNodeFilterFieldText(data) ? _c('span', {
95038
+ staticClass: "node-filter-field"
95039
+ }, [_vm._v(_vm._s(_vm.getNodeFilterFieldText(data)))]) : _vm._e()];
95040
+ }
95041
+ }], null, false, 181072543),
94987
95042
  model: {
94988
95043
  value: _vm.searchPanelValue,
94989
95044
  callback: function ($$v) {
@@ -94991,13 +95046,7 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
94991
95046
  },
94992
95047
  expression: "searchPanelValue"
94993
95048
  }
94994
- }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
94995
- directives: [{
94996
- name: "show",
94997
- rawName: "v-show",
94998
- value: _vm.searchInput !== '',
94999
- expression: "searchInput !== ''"
95000
- }],
95049
+ }) : _vm._e(), _vm.isFilterView && _vm.viewOptions.length === 0 ? _c('div', {
95001
95050
  staticClass: "empty-search"
95002
95051
  }, [_c('el-empty', {
95003
95052
  attrs: {
@@ -95079,7 +95128,7 @@ var ByCascaderPanelvue_type_template_id_727f392c_render = function render() {
95079
95128
  staticClass: "empty-state"
95080
95129
  }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])]);
95081
95130
  };
95082
- var ByCascaderPanelvue_type_template_id_727f392c_staticRenderFns = [];
95131
+ var ByCascaderPanelvue_type_template_id_3691e51e_staticRenderFns = [];
95083
95132
 
95084
95133
  ;// ./src/utils/cascaderUtils.js
95085
95134
 
@@ -95251,6 +95300,58 @@ class CascaderUtils {
95251
95300
  return result;
95252
95301
  }
95253
95302
 
95303
+ /**
95304
+ * 判断节点指定字段是否匹配下拉筛选值
95305
+ * @param {Object} node
95306
+ * @param {String} field
95307
+ * @param {*} filterValue
95308
+ * @returns {Boolean}
95309
+ */
95310
+ static isFilterFieldMatched(node, field, filterValue) {
95311
+ if (!node || !field || filterValue === null || filterValue === undefined || filterValue === '') {
95312
+ return false;
95313
+ }
95314
+ const raw = node[field];
95315
+ if (raw === null || raw === undefined || raw === '') {
95316
+ return false;
95317
+ }
95318
+ return String(raw).trim() === String(filterValue).trim();
95319
+ }
95320
+
95321
+ /**
95322
+ * 按数据字段过滤树:保留字段匹配的节点及其祖先路径
95323
+ * @param {Array} tree - 树形数据
95324
+ * @param {String} field - 数据中用于筛选的字段名
95325
+ * @param {*} filterValue - 下拉选中值
95326
+ * @param {Object} cascaderProps - 级联配置
95327
+ * @returns {Array} 过滤后的树
95328
+ */
95329
+ static filterTreeByField(tree, field, filterValue, cascaderProps) {
95330
+ if (!Array.isArray(tree) || !field || filterValue === null || filterValue === undefined || filterValue === '') {
95331
+ return tree || [];
95332
+ }
95333
+ const childrenKey = cascaderProps && cascaderProps.children || 'children';
95334
+ const result = [];
95335
+ tree.forEach(node => {
95336
+ const children = node[childrenKey];
95337
+ const hasChildren = Array.isArray(children) && children.length > 0;
95338
+ if (hasChildren) {
95339
+ const matchedChildren = this.filterTreeByField(children, field, filterValue, cascaderProps);
95340
+ if (matchedChildren.length > 0) {
95341
+ result.push({
95342
+ ...node,
95343
+ [childrenKey]: matchedChildren
95344
+ });
95345
+ }
95346
+ } else if (this.isFilterFieldMatched(node, field, filterValue)) {
95347
+ result.push({
95348
+ ...node
95349
+ });
95350
+ }
95351
+ });
95352
+ return result;
95353
+ }
95354
+
95254
95355
  /**
95255
95356
  * 获取叶子节点的值
95256
95357
  * @param {Array} tree - 树形数据
@@ -95702,6 +95803,13 @@ class CascaderUtils {
95702
95803
 
95703
95804
 
95704
95805
 
95806
+
95807
+
95808
+
95809
+
95810
+
95811
+
95812
+
95705
95813
  /* harmony default export */ var ByCascaderPanelvue_type_script_lang_js = ({
95706
95814
  name: 'ByCascaderPanel',
95707
95815
  props: {
@@ -95816,6 +95924,15 @@ class CascaderUtils {
95816
95924
  refreshing: {
95817
95925
  type: Boolean,
95818
95926
  default: false
95927
+ },
95928
+ /**
95929
+ * 下拉筛选配置。外部传入且 enabled 不为 false、并指定 field 时才展示下拉框。
95930
+ * { enabled, title, placeholder, options: [{ label, value }], field }
95931
+ * field 为数据中用于过滤和展示的字段名。
95932
+ */
95933
+ dropdownFilter: {
95934
+ type: Object,
95935
+ default: null
95819
95936
  }
95820
95937
  },
95821
95938
  data() {
@@ -95835,7 +95952,9 @@ class CascaderUtils {
95835
95952
  // 防止循环更新的标志
95836
95953
  batchSearchVisible: false,
95837
95954
  // 批量搜索弹窗显示状态
95838
- batchSearchContent: '' // 批量搜索输入内容
95955
+ batchSearchContent: '',
95956
+ // 批量搜索输入内容
95957
+ dropdownFilterValue: '' // 下拉筛选当前值,未开启时不使用
95839
95958
  };
95840
95959
  },
95841
95960
  computed: {
@@ -95908,6 +96027,61 @@ class CascaderUtils {
95908
96027
  this.searchSelectedValues = value ? [value] : [];
95909
96028
  }
95910
96029
  }
96030
+ },
96031
+ // 是否展示下拉筛选(外部有配置且指定了数据字段才展示)
96032
+ showDropdownFilter() {
96033
+ const cfg = this.dropdownFilter;
96034
+ return !!(cfg && typeof cfg === 'object' && cfg.enabled !== false && cfg.field);
96035
+ },
96036
+ dropdownFilterPlaceholder() {
96037
+ return this.dropdownFilter && this.dropdownFilter.placeholder || '请选择';
96038
+ },
96039
+ dropdownFilterTitle() {
96040
+ const title = this.dropdownFilter && this.dropdownFilter.title;
96041
+ return title != null && String(title).trim() !== '' ? String(title).trim() : '';
96042
+ },
96043
+ dropdownFilterField() {
96044
+ return this.dropdownFilter && this.dropdownFilter.field || '';
96045
+ },
96046
+ normalizedDropdownFilterOptions() {
96047
+ const opts = this.dropdownFilter && this.dropdownFilter.options || [];
96048
+ return opts.map(opt => {
96049
+ if (opt != null && typeof opt === 'object') {
96050
+ return {
96051
+ label: opt.label != null ? opt.label : opt.value,
96052
+ value: opt.value != null ? opt.value : opt.label
96053
+ };
96054
+ }
96055
+ return {
96056
+ label: String(opt),
96057
+ value: opt
96058
+ };
96059
+ });
96060
+ },
96061
+ hasActiveDropdownFilter() {
96062
+ return this.showDropdownFilter && this.dropdownFilterValue !== '' && this.dropdownFilterValue !== null && this.dropdownFilterValue !== undefined;
96063
+ },
96064
+ // 下拉筛选后的展示树;未筛选时等于完整 processed 树,保证原有逻辑不变
96065
+ displayOptions() {
96066
+ if (!this.hasActiveDropdownFilter) {
96067
+ return this.filteredOptions;
96068
+ }
96069
+ return CascaderUtils.filterTreeByField(this.filteredOptions, this.dropdownFilterField, this.dropdownFilterValue, this.cascaderProps);
96070
+ },
96071
+ isFilterView() {
96072
+ if (this.searchInput !== '' && this.isShowSearch) {
96073
+ return true;
96074
+ }
96075
+ return this.hasActiveDropdownFilter;
96076
+ },
96077
+ viewOptions() {
96078
+ if (this.searchInput !== '' && this.isShowSearch) {
96079
+ return this.searchOptions;
96080
+ }
96081
+ if (this.hasActiveDropdownFilter) {
96082
+ return this.displayOptions;
96083
+ }
96084
+ return [];
95911
96085
  }
95912
96086
  },
95913
96087
  watch: {
@@ -95947,6 +96121,9 @@ class CascaderUtils {
95947
96121
  // 普通模式下的全选判断
95948
96122
  this.isAllSelected = this.selectedCount === this.totalCount;
95949
96123
  }
96124
+ if (this.hasActiveDropdownFilter) {
96125
+ this.updateFilterAllSelectedState();
96126
+ }
95950
96127
  } else {
95951
96128
  // 单选模式:最多只能有一个选中项
95952
96129
  if (newVal.length > 1) {
@@ -95963,6 +96140,11 @@ class CascaderUtils {
95963
96140
  if (val) {
95964
96141
  this.batchSearchVisible = false;
95965
96142
  }
96143
+ },
96144
+ showDropdownFilter(val) {
96145
+ if (!val) {
96146
+ this.dropdownFilterValue = '';
96147
+ }
95966
96148
  }
95967
96149
  },
95968
96150
  mounted() {
@@ -96034,6 +96216,11 @@ class CascaderUtils {
96034
96216
  this.filteredOptions = this.processOptions(this.options);
96035
96217
  this.countTotalItems();
96036
96218
  this.updateSelectedItems();
96219
+ if (this.searchInput) {
96220
+ this.handleSearch();
96221
+ } else if (this.hasActiveDropdownFilter) {
96222
+ this.syncFilterViewSelection();
96223
+ }
96037
96224
  },
96038
96225
  // 处理选项数据,添加禁用状态
96039
96226
  processOptions(options) {
@@ -96122,10 +96309,14 @@ class CascaderUtils {
96122
96309
  this.searchInput = this.searchInput.trim();
96123
96310
  if (this.searchInput === '') {
96124
96311
  this.isShowSearch = false;
96312
+ this.searchOptions = [];
96313
+ if (this.hasActiveDropdownFilter) {
96314
+ this.syncFilterViewSelection();
96315
+ }
96125
96316
  return;
96126
96317
  }
96127
96318
  this.isShowSearch = false;
96128
- this.searchOptions = CascaderUtils.searchInTree(this.filteredOptions, this.searchInput, this.cascaderProps);
96319
+ this.searchOptions = CascaderUtils.searchInTree(this.displayOptions, this.searchInput, this.cascaderProps);
96129
96320
 
96130
96321
  // 只设置搜索范围内的选中值
96131
96322
  this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.searchOptions, this.cascaderProps);
@@ -96162,7 +96353,7 @@ class CascaderUtils {
96162
96353
  handleExpandChange(values = []) {
96163
96354
  if (values.length === 1) {
96164
96355
  this.$nextTick(() => {
96165
- const panel = this.$refs.cascaderPanel || this.$refs.searchCascaderPanel;
96356
+ const panel = this.isFilterView ? this.$refs.searchCascaderPanel || this.$refs.cascaderPanel : this.$refs.cascaderPanel || this.$refs.searchCascaderPanel;
96166
96357
  if (panel) {
96167
96358
  const menus = panel.menus;
96168
96359
  const targetNode = menus[0].find(node => node.value == values[0]);
@@ -96202,15 +96393,15 @@ class CascaderUtils {
96202
96393
  this.$emit('input', emitValue);
96203
96394
  });
96204
96395
  },
96205
- // 搜索模式值变化处理
96396
+ // 搜索 / 下拉筛选视图值变化处理
96206
96397
  handleSearchValueChange(value) {
96207
- // 获取搜索面板中所有可能的叶子节点值
96208
- const searchLeafValues = CascaderUtils.getLeafValues(this.searchOptions, this.cascaderProps);
96398
+ // 获取当前筛选/搜索视图中所有可能的叶子节点值
96399
+ const viewLeafValues = CascaderUtils.getLeafValues(this.viewOptions, this.cascaderProps);
96209
96400
  if (this.isMultiple) {
96210
- // 多选模式:从主选择列表中移除搜索范围内的项,然后添加搜索面板中选中的项
96401
+ // 多选模式:从主选择列表中移除视图范围内的项,然后添加视图中选中的项
96211
96402
  this.selectedValues = this.selectedValues.filter(path => {
96212
96403
  const leafValue = path[path.length - 1];
96213
- return !searchLeafValues.includes(leafValue);
96404
+ return !viewLeafValues.includes(leafValue);
96214
96405
  });
96215
96406
  this.selectedValues = [...this.selectedValues, ...this.searchSelectedValues];
96216
96407
  } else {
@@ -96280,15 +96471,26 @@ class CascaderUtils {
96280
96471
  // 单选模式下不支持全选
96281
96472
  return;
96282
96473
  }
96283
- if (this.isAllSelected) {
96474
+ const config = {
96475
+ disabledField: this.disabledField,
96476
+ disabledValue: this.disabledValue,
96477
+ disabledCheck: this.disabledCheck
96478
+ };
96479
+ if (this.hasActiveDropdownFilter) {
96480
+ const viewPaths = CascaderUtils.getAllLeafPaths(this.displayOptions, config, this.cascaderProps);
96481
+ const viewLeafSet = new Set(viewPaths.map(path => path[path.length - 1]));
96482
+ if (this.isAllSelected) {
96483
+ this.selectedValues = this.selectedValues.filter(path => !viewLeafSet.has(path[path.length - 1]));
96484
+ } else {
96485
+ const preserved = this.selectedValues.filter(path => !viewLeafSet.has(path[path.length - 1]));
96486
+ this.selectedValues = [...preserved, ...viewPaths];
96487
+ }
96488
+ this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.viewOptions, this.cascaderProps);
96489
+ this.updateSelectedItems();
96490
+ } else if (this.isAllSelected) {
96284
96491
  this.selectedValues = [];
96285
96492
  this.selectedItems = [];
96286
96493
  } else {
96287
- const config = {
96288
- disabledField: this.disabledField,
96289
- disabledValue: this.disabledValue,
96290
- disabledCheck: this.disabledCheck
96291
- };
96292
96494
  // 无论是普通模式还是聚合模式,全选时都选择所有可选的叶子节点
96293
96495
  this.selectedValues = CascaderUtils.getAllLeafPaths(this.filteredOptions, config, this.cascaderProps);
96294
96496
  this.updateSelectedItems();
@@ -96441,6 +96643,54 @@ class CascaderUtils {
96441
96643
  }
96442
96644
  this.$emit('refresh');
96443
96645
  },
96646
+ getNodeFilterFieldText(data) {
96647
+ if (!this.showDropdownFilter || !this.dropdownFilterField || !data) {
96648
+ return '';
96649
+ }
96650
+ const val = data[this.dropdownFilterField];
96651
+ if (val === null || val === undefined || val === '') {
96652
+ return '';
96653
+ }
96654
+ return `(${val})`;
96655
+ },
96656
+ updateFilterAllSelectedState() {
96657
+ if (!this.hasActiveDropdownFilter) {
96658
+ return;
96659
+ }
96660
+ const config = {
96661
+ disabledField: this.disabledField,
96662
+ disabledValue: this.disabledValue,
96663
+ disabledCheck: this.disabledCheck
96664
+ };
96665
+ const viewPaths = CascaderUtils.getAllLeafPaths(this.displayOptions, config, this.cascaderProps);
96666
+ if (viewPaths.length === 0) {
96667
+ this.isAllSelected = false;
96668
+ return;
96669
+ }
96670
+ const selectedLeafSet = new Set(this.selectedValues.map(path => path[path.length - 1]));
96671
+ this.isAllSelected = viewPaths.every(path => selectedLeafSet.has(path[path.length - 1]));
96672
+ },
96673
+ syncFilterViewSelection() {
96674
+ this.searchSelectedValues = CascaderUtils.getSearchSelectedValues(this.selectedValues, this.viewOptions, this.cascaderProps);
96675
+ this.$nextTick(() => {
96676
+ if (this.viewOptions.length > 0) {
96677
+ this.handleSearchExpand();
96678
+ }
96679
+ });
96680
+ },
96681
+ handleDropdownFilterChange() {
96682
+ if (this.searchInput) {
96683
+ this.handleSearch();
96684
+ return;
96685
+ }
96686
+ this.isShowSearch = false;
96687
+ this.searchOptions = [];
96688
+ if (this.hasActiveDropdownFilter) {
96689
+ this.syncFilterViewSelection();
96690
+ } else {
96691
+ this.searchSelectedValues = [];
96692
+ }
96693
+ },
96444
96694
  // 处理批量搜索
96445
96695
  handleBatchSearch() {
96446
96696
  if (!this.batchSearchContent.trim()) {
@@ -96563,8 +96813,8 @@ class CascaderUtils {
96563
96813
  ;
96564
96814
  var ByCascaderPanel_component = normalizeComponent(
96565
96815
  cascader_panel_ByCascaderPanelvue_type_script_lang_js,
96566
- ByCascaderPanelvue_type_template_id_727f392c_render,
96567
- ByCascaderPanelvue_type_template_id_727f392c_staticRenderFns,
96816
+ ByCascaderPanelvue_type_template_id_3691e51e_render,
96817
+ ByCascaderPanelvue_type_template_id_3691e51e_staticRenderFns,
96568
96818
  false,
96569
96819
  null,
96570
96820
  null,
@@ -96573,8 +96823,8 @@ var ByCascaderPanel_component = normalizeComponent(
96573
96823
  )
96574
96824
 
96575
96825
  /* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
96576
- ;// ./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-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/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=961f637e
96577
- var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96826
+ ;// ./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-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/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=21ca97ff
96827
+ var ByCascaderPanelProvue_type_template_id_21ca97ff_render = function render() {
96578
96828
  var _vm = this,
96579
96829
  _c = _vm._self._c;
96580
96830
  return _c('div', {
@@ -96593,7 +96843,10 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96593
96843
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
96594
96844
  staticClass: "search-section"
96595
96845
  }, [_c('div', {
96596
- staticClass: "search-container"
96846
+ staticClass: "search-container",
96847
+ class: {
96848
+ 'has-dropdown-filter': _vm.showDropdownFilter
96849
+ }
96597
96850
  }, [_c('div', {
96598
96851
  staticClass: "search-input-wrap",
96599
96852
  class: {
@@ -96689,7 +96942,37 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96689
96942
  slot: "reference"
96690
96943
  }, [_c('i', {
96691
96944
  staticClass: "el-icon-edit-outline"
96692
- })])], 1)], 1) : _vm._e()], 1), _vm.showRefreshBtn ? _c('el-tooltip', {
96945
+ })])], 1)], 1) : _vm._e()], 1), _vm.showDropdownFilter ? _c('div', {
96946
+ staticClass: "dropdown-filter-group"
96947
+ }, [_vm.dropdownFilterTitle ? _c('span', {
96948
+ staticClass: "dropdown-filter-title"
96949
+ }, [_vm._v(_vm._s(_vm.dropdownFilterTitle) + ":")]) : _vm._e(), _c('el-select', {
96950
+ staticClass: "dropdown-filter-select",
96951
+ attrs: {
96952
+ "placeholder": _vm.dropdownFilterPlaceholder,
96953
+ "clearable": "",
96954
+ "size": "mini",
96955
+ "disabled": _vm.panelViewMode
96956
+ },
96957
+ on: {
96958
+ "change": _vm.handleDropdownFilterChange
96959
+ },
96960
+ model: {
96961
+ value: _vm.dropdownFilterValue,
96962
+ callback: function ($$v) {
96963
+ _vm.dropdownFilterValue = $$v;
96964
+ },
96965
+ expression: "dropdownFilterValue"
96966
+ }
96967
+ }, _vm._l(_vm.normalizedDropdownFilterOptions, function (opt) {
96968
+ return _c('el-option', {
96969
+ key: 'df-' + opt.value,
96970
+ attrs: {
96971
+ "label": opt.label,
96972
+ "value": opt.value
96973
+ }
96974
+ });
96975
+ }), 1)], 1) : _vm._e(), _vm.showRefreshBtn ? _c('el-tooltip', {
96693
96976
  attrs: {
96694
96977
  "content": _vm.refreshTooltip,
96695
96978
  "placement": "top",
@@ -96730,8 +97013,8 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96730
97013
  directives: [{
96731
97014
  name: "show",
96732
97015
  rawName: "v-show",
96733
- value: _vm.searchInput === '' || !_vm.isShowSearch,
96734
- expression: "searchInput === '' || !isShowSearch"
97016
+ value: !_vm.isFilterView,
97017
+ expression: "!isFilterView"
96735
97018
  }],
96736
97019
  ref: "cascaderPanel",
96737
97020
  staticClass: "cascader-panel-inner",
@@ -96747,44 +97030,41 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96747
97030
  "column-min-width": _vm.columnMinWidth,
96748
97031
  "column-max-width": _vm.columnMaxWidth,
96749
97032
  "disabled-config": _vm.disabledConfig,
96750
- "is-view-mode": _vm.panelViewMode
97033
+ "is-view-mode": _vm.panelViewMode,
97034
+ "filter-field": _vm.showDropdownFilter ? _vm.dropdownFilterField : ''
96751
97035
  },
96752
97036
  on: {
96753
97037
  "input": _vm.onMainPanelInput,
96754
97038
  "change": _vm.handleValueChange,
96755
97039
  "store-ready": _vm.schedulePanelSyncFromExternalValue
96756
97040
  }
96757
- }) : _vm._e(), _vm.searchOptions.length > 0 ? _c('VirtualCascaderPanel', {
97041
+ }) : _vm._e(), _vm.viewOptions.length > 0 ? _c('VirtualCascaderPanel', {
96758
97042
  directives: [{
96759
97043
  name: "show",
96760
97044
  rawName: "v-show",
96761
- value: _vm.searchInput !== '' && _vm.isShowSearch,
96762
- expression: "searchInput !== '' && isShowSearch"
97045
+ value: _vm.isFilterView,
97046
+ expression: "isFilterView"
96763
97047
  }],
96764
97048
  ref: "searchCascaderPanel",
96765
97049
  staticClass: "cascader-panel-inner",
96766
97050
  attrs: {
96767
97051
  "value": _vm.compactSearchPanelValue,
96768
97052
  "sync-value-from-parent": false,
96769
- "options": _vm.searchOptions,
97053
+ "options": _vm.viewOptions,
96770
97054
  "props": _vm.cascaderProps,
96771
97055
  "height": _vm.computedPanelHeight - 20,
96772
97056
  "column-min-width": _vm.columnMinWidth,
96773
97057
  "column-max-width": _vm.columnMaxWidth,
96774
97058
  "disabled-config": _vm.disabledConfig,
96775
- "is-view-mode": _vm.panelViewMode
97059
+ "is-view-mode": _vm.panelViewMode,
97060
+ "filter-field": _vm.showDropdownFilter ? _vm.dropdownFilterField : ''
96776
97061
  },
96777
97062
  on: {
96778
97063
  "input": _vm.onSearchPanelInput,
96779
- "change": _vm.handleSearchValueChange
97064
+ "change": _vm.handleSearchValueChange,
97065
+ "store-ready": _vm.syncSearchPanelSelection
96780
97066
  }
96781
- }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
96782
- directives: [{
96783
- name: "show",
96784
- rawName: "v-show",
96785
- value: _vm.searchInput !== '',
96786
- expression: "searchInput !== ''"
96787
- }],
97067
+ }) : _vm._e(), _vm.isFilterView && _vm.viewOptions.length === 0 ? _c('div', {
96788
97068
  staticClass: "empty-search"
96789
97069
  }, [_c('el-empty', {
96790
97070
  attrs: {
@@ -96855,7 +97135,7 @@ var ByCascaderPanelProvue_type_template_id_961f637e_render = function render() {
96855
97135
  staticClass: "empty-state"
96856
97136
  }, [_vm._v("暂无选中项")])], 1)])])])]);
96857
97137
  };
96858
- var ByCascaderPanelProvue_type_template_id_961f637e_staticRenderFns = [];
97138
+ var ByCascaderPanelProvue_type_template_id_21ca97ff_staticRenderFns = [];
96859
97139
 
96860
97140
  ;// ./src/components/cascader-panel-pro/cascaderStorePro.js
96861
97141
 
@@ -97147,14 +97427,22 @@ class CascaderUtilsPro {
97147
97427
  minWidth = 180,
97148
97428
  maxWidth = 420,
97149
97429
  extraPadding = 56,
97150
- hasCheckbox = true
97430
+ hasCheckbox = true,
97431
+ filterField = ''
97151
97432
  } = options;
97152
97433
  if (!nodes || nodes.length === 0) {
97153
97434
  return minWidth;
97154
97435
  }
97155
97436
  let maxLabelWidth = 0;
97156
97437
  nodes.forEach(node => {
97157
- maxLabelWidth = Math.max(maxLabelWidth, this.measureCascaderLabelWidth(node.label));
97438
+ let text = node.label || '';
97439
+ if (filterField) {
97440
+ const extra = node.raw && node.raw[filterField];
97441
+ if (extra !== null && extra !== undefined && extra !== '') {
97442
+ text += ` (${extra})`;
97443
+ }
97444
+ }
97445
+ maxLabelWidth = Math.max(maxLabelWidth, this.measureCascaderLabelWidth(text));
97158
97446
  });
97159
97447
  const checkboxWidth = hasCheckbox ? 28 : 0;
97160
97448
  const arrowWidth = 24;
@@ -97313,6 +97601,58 @@ class CascaderUtilsPro {
97313
97601
  return result;
97314
97602
  }
97315
97603
 
97604
+ /**
97605
+ * 判断节点指定字段是否匹配下拉筛选值
97606
+ * @param {Object} node
97607
+ * @param {String} field
97608
+ * @param {*} filterValue
97609
+ * @returns {Boolean}
97610
+ */
97611
+ static isFilterFieldMatched(node, field, filterValue) {
97612
+ if (!node || !field || filterValue === null || filterValue === undefined || filterValue === '') {
97613
+ return false;
97614
+ }
97615
+ const raw = node[field];
97616
+ if (raw === null || raw === undefined || raw === '') {
97617
+ return false;
97618
+ }
97619
+ return String(raw).trim() === String(filterValue).trim();
97620
+ }
97621
+
97622
+ /**
97623
+ * 按数据字段过滤树:保留字段匹配的节点及其祖先路径
97624
+ * @param {Array} tree - 树形数据
97625
+ * @param {String} field - 数据中用于筛选的字段名
97626
+ * @param {*} filterValue - 下拉选中值
97627
+ * @param {Object} cascaderProps - 级联配置
97628
+ * @returns {Array} 过滤后的树
97629
+ */
97630
+ static filterTreeByField(tree, field, filterValue, cascaderProps) {
97631
+ if (!Array.isArray(tree) || !field || filterValue === null || filterValue === undefined || filterValue === '') {
97632
+ return tree || [];
97633
+ }
97634
+ const childrenKey = cascaderProps && cascaderProps.children || 'children';
97635
+ const result = [];
97636
+ tree.forEach(node => {
97637
+ const children = node[childrenKey];
97638
+ const hasChildren = Array.isArray(children) && children.length > 0;
97639
+ if (hasChildren) {
97640
+ const matchedChildren = this.filterTreeByField(children, field, filterValue, cascaderProps);
97641
+ if (matchedChildren.length > 0) {
97642
+ result.push({
97643
+ ...node,
97644
+ [childrenKey]: matchedChildren
97645
+ });
97646
+ }
97647
+ } else if (this.isFilterFieldMatched(node, field, filterValue)) {
97648
+ result.push({
97649
+ ...node
97650
+ });
97651
+ }
97652
+ });
97653
+ return result;
97654
+ }
97655
+
97316
97656
  /**
97317
97657
  * 基于扁平 store 快速搜索(父节点命中时直接复用 raw 子树,跳过子级遍历)
97318
97658
  */
@@ -97856,8 +98196,8 @@ class CascaderUtilsPro {
97856
98196
  return paths;
97857
98197
  }
97858
98198
  }
97859
- ;// ./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-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/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=05f77638
97860
- var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render() {
98199
+ ;// ./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-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/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=7d8ff846
98200
+ var VirtualCascaderPanelvue_type_template_id_7d8ff846_render = function render() {
97861
98201
  var _vm = this,
97862
98202
  _c = _vm._self._c;
97863
98203
  return _c('div', {
@@ -97938,7 +98278,9 @@ var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render()
97938
98278
  }
97939
98279
  }, [_c('span')])], 1) : _vm._e(), _c('span', {
97940
98280
  staticClass: "el-cascader-node__label"
97941
- }, [_vm._v(_vm._s(item.label))]), !item.isLeaf ? _c('span', {
98281
+ }, [_vm.filterField ? [_vm._v(" " + _vm._s(item.label)), _vm.getFilterFieldText(item) ? _c('span', {
98282
+ staticClass: "node-filter-field"
98283
+ }, [_vm._v(_vm._s(_vm.getFilterFieldText(item)))]) : _vm._e()] : [_vm._v(_vm._s(item.label))]], 2), !item.isLeaf ? _c('span', {
97942
98284
  staticClass: "el-cascader-node__postfix"
97943
98285
  }, [_c('i', {
97944
98286
  staticClass: "el-icon-arrow-right el-cascader-node__icon-arrow"
@@ -97948,7 +98290,7 @@ var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render()
97948
98290
  })], 1);
97949
98291
  }), 0);
97950
98292
  };
97951
- var VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns = [];
98293
+ var VirtualCascaderPanelvue_type_template_id_7d8ff846_staticRenderFns = [];
97952
98294
 
97953
98295
  ;// ./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-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/cascader-panel-pro/VirtualList.vue?vue&type=template&id=43cb1148
97954
98296
  var VirtualListvue_type_template_id_43cb1148_render = function render() {
@@ -98432,6 +98774,11 @@ class SelectionStatePro {
98432
98774
  syncValueFromParent: {
98433
98775
  type: Boolean,
98434
98776
  default: true
98777
+ },
98778
+ // 下拉筛选字段名:有值时在节点名称后展示该字段内容
98779
+ filterField: {
98780
+ type: String,
98781
+ default: ''
98435
98782
  }
98436
98783
  },
98437
98784
  data() {
@@ -98548,7 +98895,8 @@ class SelectionStatePro {
98548
98895
  const width = CascaderUtilsPro.getCascaderColumnWidth(columnNodes, {
98549
98896
  minWidth: this.columnMinWidth,
98550
98897
  maxWidth: this.columnMaxWidth,
98551
- hasCheckbox: this.multiple || this.checkStrictly
98898
+ hasCheckbox: this.multiple || this.checkStrictly,
98899
+ filterField: this.filterField
98552
98900
  });
98553
98901
  return {
98554
98902
  width: width + 'px',
@@ -98556,6 +98904,17 @@ class SelectionStatePro {
98556
98904
  maxWidth: width + 'px'
98557
98905
  };
98558
98906
  },
98907
+ getFilterFieldText(item) {
98908
+ if (!this.filterField || !item) {
98909
+ return '';
98910
+ }
98911
+ const raw = item.raw || item;
98912
+ const val = raw[this.filterField];
98913
+ if (val === null || val === undefined || val === '') {
98914
+ return '';
98915
+ }
98916
+ return `(${val})`;
98917
+ },
98559
98918
  rebuildStore() {
98560
98919
  this.store = buildCascaderStore(this.options, this.disabledConfig, this.props, CascaderUtilsPro);
98561
98920
  this.selection = new SelectionStatePro(this.store);
@@ -98865,8 +99224,8 @@ class SelectionStatePro {
98865
99224
  ;
98866
99225
  var VirtualCascaderPanel_component = normalizeComponent(
98867
99226
  cascader_panel_pro_VirtualCascaderPanelvue_type_script_lang_js,
98868
- VirtualCascaderPanelvue_type_template_id_05f77638_render,
98869
- VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns,
99227
+ VirtualCascaderPanelvue_type_template_id_7d8ff846_render,
99228
+ VirtualCascaderPanelvue_type_template_id_7d8ff846_staticRenderFns,
98870
99229
  false,
98871
99230
  null,
98872
99231
  null,
@@ -99022,6 +99381,15 @@ var VirtualCascaderPanel_component = normalizeComponent(
99022
99381
  columnMaxWidth: {
99023
99382
  type: Number,
99024
99383
  default: 420
99384
+ },
99385
+ /**
99386
+ * 下拉筛选配置。外部传入且 enabled 不为 false、并指定 field 时才展示下拉框。
99387
+ * { enabled, title, placeholder, options: [{ label, value }], field }
99388
+ * field 为数据中用于过滤和展示的字段名。
99389
+ */
99390
+ dropdownFilter: {
99391
+ type: Object,
99392
+ default: null
99025
99393
  }
99026
99394
  },
99027
99395
  data() {
@@ -99049,7 +99417,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
99049
99417
  searchLeafSetCache: null,
99050
99418
  panelSyncTimer: null,
99051
99419
  // 外部 v-model 回显同步中,避免与用户操作冲突
99052
- isExternalSync: false
99420
+ isExternalSync: false,
99421
+ dropdownFilterValue: ''
99053
99422
  };
99054
99423
  },
99055
99424
  computed: {
@@ -99150,6 +99519,59 @@ var VirtualCascaderPanel_component = normalizeComponent(
99150
99519
  this.searchSelectedValues = value ? [value] : [];
99151
99520
  }
99152
99521
  }
99522
+ },
99523
+ showDropdownFilter() {
99524
+ const cfg = this.dropdownFilter;
99525
+ return !!(cfg && typeof cfg === 'object' && cfg.enabled !== false && cfg.field);
99526
+ },
99527
+ dropdownFilterPlaceholder() {
99528
+ return this.dropdownFilter && this.dropdownFilter.placeholder || '请选择';
99529
+ },
99530
+ dropdownFilterTitle() {
99531
+ const title = this.dropdownFilter && this.dropdownFilter.title;
99532
+ return title != null && String(title).trim() !== '' ? String(title).trim() : '';
99533
+ },
99534
+ dropdownFilterField() {
99535
+ return this.dropdownFilter && this.dropdownFilter.field || '';
99536
+ },
99537
+ normalizedDropdownFilterOptions() {
99538
+ const opts = this.dropdownFilter && this.dropdownFilter.options || [];
99539
+ return opts.map(opt => {
99540
+ if (opt != null && typeof opt === 'object') {
99541
+ return {
99542
+ label: opt.label != null ? opt.label : opt.value,
99543
+ value: opt.value != null ? opt.value : opt.label
99544
+ };
99545
+ }
99546
+ return {
99547
+ label: String(opt),
99548
+ value: opt
99549
+ };
99550
+ });
99551
+ },
99552
+ hasActiveDropdownFilter() {
99553
+ return this.showDropdownFilter && this.dropdownFilterValue !== '' && this.dropdownFilterValue !== null && this.dropdownFilterValue !== undefined;
99554
+ },
99555
+ displayOptions() {
99556
+ if (!this.hasActiveDropdownFilter) {
99557
+ return this.filteredOptions;
99558
+ }
99559
+ return CascaderUtilsPro.filterTreeByField(this.filteredOptions, this.dropdownFilterField, this.dropdownFilterValue, this.cascaderProps);
99560
+ },
99561
+ isFilterView() {
99562
+ if (this.searchInput !== '' && this.isShowSearch) {
99563
+ return true;
99564
+ }
99565
+ return this.hasActiveDropdownFilter;
99566
+ },
99567
+ viewOptions() {
99568
+ if (this.searchInput !== '' && this.isShowSearch) {
99569
+ return this.searchOptions;
99570
+ }
99571
+ if (this.hasActiveDropdownFilter) {
99572
+ return this.displayOptions;
99573
+ }
99574
+ return [];
99153
99575
  }
99154
99576
  },
99155
99577
  watch: {
@@ -99175,6 +99597,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99175
99597
  searchInput(val) {
99176
99598
  if (!val) {
99177
99599
  this.clearSearchState();
99600
+ if (this.hasActiveDropdownFilter) {
99601
+ this.prepareFilterView();
99602
+ }
99178
99603
  return;
99179
99604
  }
99180
99605
  this.scheduleSearch();
@@ -99202,6 +99627,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99202
99627
  } else if (panel && panel.store && panel.selection && this.aggregationMode) {
99203
99628
  this.isAllSelected = panel.selection.size() === panel.store.totalLeafCount && panel.store.totalLeafCount > 0;
99204
99629
  }
99630
+ if (this.hasActiveDropdownFilter) {
99631
+ this.updateFilterAllSelectedState();
99632
+ }
99205
99633
  } else {
99206
99634
  if (newVal.length > 1) {
99207
99635
  this.selectedItems = [newVal[newVal.length - 1]];
@@ -99216,6 +99644,11 @@ var VirtualCascaderPanel_component = normalizeComponent(
99216
99644
  if (val) {
99217
99645
  this.batchSearchVisible = false;
99218
99646
  }
99647
+ },
99648
+ showDropdownFilter(val) {
99649
+ if (!val) {
99650
+ this.dropdownFilterValue = '';
99651
+ }
99219
99652
  }
99220
99653
  },
99221
99654
  mounted() {
@@ -99269,6 +99702,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99269
99702
  this.selectedValues = selection.getCheckedPaths();
99270
99703
  }
99271
99704
  panel.bumpSelectionView();
99705
+ if (this.hasActiveDropdownFilter) {
99706
+ this.updateFilterAllSelectedState();
99707
+ }
99272
99708
  return;
99273
99709
  }
99274
99710
  if (selection.isCompactSelection()) {
@@ -99276,11 +99712,17 @@ var VirtualCascaderPanel_component = normalizeComponent(
99276
99712
  this.selectedCount = selection.size();
99277
99713
  this.isAllSelected = selection.size() === store.totalLeafCount;
99278
99714
  panel.bumpSelectionView();
99715
+ if (this.hasActiveDropdownFilter) {
99716
+ this.updateFilterAllSelectedState();
99717
+ }
99279
99718
  return;
99280
99719
  }
99281
99720
  this.selectedValues = selection.getCheckedPaths();
99282
99721
  this.updateSelectedItems();
99283
99722
  panel.bumpSelectionView();
99723
+ if (this.hasActiveDropdownFilter) {
99724
+ this.updateFilterAllSelectedState();
99725
+ }
99284
99726
  },
99285
99727
  /**
99286
99728
  * 用户操作(勾选/全选/清除/删除)统一提交:更新展示 + emit,标记内部更新防回显覆盖
@@ -99534,6 +99976,11 @@ var VirtualCascaderPanel_component = normalizeComponent(
99534
99976
  } else {
99535
99977
  this.updateSelectedItems();
99536
99978
  }
99979
+ if (this.searchInput) {
99980
+ this.scheduleSearch();
99981
+ } else if (this.hasActiveDropdownFilter) {
99982
+ this.prepareFilterView();
99983
+ }
99537
99984
  },
99538
99985
  // 处理选项数据,添加禁用状态(浅拷贝,避免 JSON 深拷贝大数据卡顿)
99539
99986
  processOptions(options) {
@@ -99619,13 +100066,20 @@ var VirtualCascaderPanel_component = normalizeComponent(
99619
100066
  const keyword = this.searchInput.trim();
99620
100067
  if (!keyword) {
99621
100068
  this.clearSearchState();
100069
+ if (this.hasActiveDropdownFilter) {
100070
+ this.prepareFilterView();
100071
+ }
99622
100072
  return;
99623
100073
  }
99624
- const panel = this.$refs.cascaderPanel;
99625
- if (panel && panel.store) {
99626
- this.searchOptions = CascaderUtilsPro.searchFromStore(panel.store, keyword, this.cascaderProps);
100074
+ if (this.hasActiveDropdownFilter) {
100075
+ this.searchOptions = CascaderUtilsPro.searchInTree(this.displayOptions, keyword, this.cascaderProps);
99627
100076
  } else {
99628
- this.searchOptions = CascaderUtilsPro.searchInTree(this.filteredOptions, keyword, this.cascaderProps);
100077
+ const panel = this.$refs.cascaderPanel;
100078
+ if (panel && panel.store) {
100079
+ this.searchOptions = CascaderUtilsPro.searchFromStore(panel.store, keyword, this.cascaderProps);
100080
+ } else {
100081
+ this.searchOptions = CascaderUtilsPro.searchInTree(this.filteredOptions, keyword, this.cascaderProps);
100082
+ }
99629
100083
  }
99630
100084
  this.searchLeafSetCache = new Set(CascaderUtilsPro.getLeafValues(this.searchOptions, this.cascaderProps));
99631
100085
  this.searchSelectedValues = this.getSearchSelectedPathsFromMain(this.searchLeafSetCache);
@@ -99657,7 +100111,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
99657
100111
  if (this.searchLeafSetCache) {
99658
100112
  return this.searchLeafSetCache;
99659
100113
  }
99660
- return new Set(CascaderUtilsPro.getLeafValues(this.searchOptions, this.cascaderProps));
100114
+ return new Set(CascaderUtilsPro.getLeafValues(this.viewOptions, this.cascaderProps));
99661
100115
  },
99662
100116
  syncSearchPanelSelection() {
99663
100117
  const searchPanel = this.$refs.searchCascaderPanel;
@@ -99677,12 +100131,46 @@ var VirtualCascaderPanel_component = normalizeComponent(
99677
100131
  },
99678
100132
  // 搜索模式下的展开处理
99679
100133
  handleSearchExpand() {
99680
- if (this.$refs.searchCascaderPanel && this.searchOptions.length > 0) {
99681
- const firstOption = this.searchOptions[0];
100134
+ if (this.$refs.searchCascaderPanel && this.viewOptions.length > 0) {
100135
+ const firstOption = this.viewOptions[0];
99682
100136
  const valueKey = this.cascaderProps.value || 'value';
99683
100137
  this.$refs.searchCascaderPanel.expandPathValues([firstOption[valueKey]], true);
99684
100138
  }
99685
100139
  },
100140
+ prepareFilterView() {
100141
+ this.searchLeafSetCache = new Set(CascaderUtilsPro.getLeafValues(this.displayOptions, this.cascaderProps));
100142
+ this.$nextTick(() => {
100143
+ this.syncSearchPanelSelection();
100144
+ this.handleSearchExpand();
100145
+ });
100146
+ },
100147
+ handleDropdownFilterChange() {
100148
+ if (this.searchInput) {
100149
+ this.scheduleSearch();
100150
+ return;
100151
+ }
100152
+ this.clearSearchState();
100153
+ if (this.hasActiveDropdownFilter) {
100154
+ this.prepareFilterView();
100155
+ }
100156
+ },
100157
+ updateFilterAllSelectedState() {
100158
+ if (!this.hasActiveDropdownFilter) {
100159
+ return;
100160
+ }
100161
+ const viewPaths = CascaderUtilsPro.getAllLeafPaths(this.displayOptions, this.disabledConfig, this.cascaderProps);
100162
+ if (viewPaths.length === 0) {
100163
+ this.isAllSelected = false;
100164
+ return;
100165
+ }
100166
+ const panel = this.$refs.cascaderPanel;
100167
+ if (panel && panel.selection && panel.selection.selectedLeafSet) {
100168
+ this.isAllSelected = viewPaths.every(path => panel.selection.selectedLeafSet.has(path[path.length - 1]));
100169
+ return;
100170
+ }
100171
+ const selectedLeafSet = new Set(this.selectedValues.map(path => path[path.length - 1]));
100172
+ this.isAllSelected = viewPaths.every(path => selectedLeafSet.has(path[path.length - 1]));
100173
+ },
99686
100174
  // 值变化处理(面板勾选)
99687
100175
  handleValueChange() {
99688
100176
  this.commitUserSelectionChange();
@@ -99774,6 +100262,26 @@ var VirtualCascaderPanel_component = normalizeComponent(
99774
100262
  }
99775
100263
  const panel = this.$refs.cascaderPanel;
99776
100264
  const searchPanel = this.$refs.searchCascaderPanel;
100265
+ if (this.hasActiveDropdownFilter && panel && panel.selection && panel.store) {
100266
+ const viewPaths = CascaderUtilsPro.getAllLeafPaths(this.displayOptions, this.disabledConfig, this.cascaderProps);
100267
+ const viewLeafSet = new Set(viewPaths.map(path => path[path.length - 1]));
100268
+ if (this.isAllSelected) {
100269
+ viewLeafSet.forEach(leaf => {
100270
+ panel.selection.selectedLeafSet.delete(leaf);
100271
+ });
100272
+ } else {
100273
+ viewLeafSet.forEach(leaf => {
100274
+ panel.selection.selectedLeafSet.add(leaf);
100275
+ });
100276
+ }
100277
+ panel.selection._reconcileAllRoots();
100278
+ panel.bumpSelectionView();
100279
+ if (searchPanel && searchPanel.selection) {
100280
+ this.syncSearchPanelSelection();
100281
+ }
100282
+ this.commitUserSelectionChange();
100283
+ return;
100284
+ }
99777
100285
  if (this.isAllSelected) {
99778
100286
  this.clearPanelSelectionState(panel);
99779
100287
  this.clearPanelSelectionState(searchPanel);
@@ -99899,6 +100407,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
99899
100407
  if (this.panelViewMode) return;
99900
100408
  this.searchInput = '';
99901
100409
  this.clearSearchState();
100410
+ if (this.hasActiveDropdownFilter) {
100411
+ this.prepareFilterView();
100412
+ }
99902
100413
  this.$emit('refresh');
99903
100414
  },
99904
100415
  // 处理批量搜索
@@ -100027,8 +100538,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
100027
100538
  ;
100028
100539
  var ByCascaderPanelPro_component = normalizeComponent(
100029
100540
  cascader_panel_pro_ByCascaderPanelProvue_type_script_lang_js,
100030
- ByCascaderPanelProvue_type_template_id_961f637e_render,
100031
- ByCascaderPanelProvue_type_template_id_961f637e_staticRenderFns,
100541
+ ByCascaderPanelProvue_type_template_id_21ca97ff_render,
100542
+ ByCascaderPanelProvue_type_template_id_21ca97ff_staticRenderFns,
100032
100543
  false,
100033
100544
  null,
100034
100545
  null,