@weitutech/by-components 1.1.207 → 1.1.209

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.
@@ -91060,8 +91060,8 @@ var ByCommonSelector_component = normalizeComponent(
91060
91060
  )
91061
91061
 
91062
91062
  /* harmony default export */ var ByCommonSelector = (ByCommonSelector_component.exports);
91063
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-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/batch-query-selector/BatchQuerySelector.vue?vue&type=template&id=16c8bfda
91064
- var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91063
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-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/batch-query-selector/BatchQuerySelector.vue?vue&type=template&id=240853ac
91064
+ var BatchQuerySelectorvue_type_template_id_240853ac_render = function render() {
91065
91065
  var _vm = this,
91066
91066
  _c = _vm._self._c;
91067
91067
  return _c('div', {
@@ -91101,24 +91101,32 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91101
91101
  return _c('el-option', {
91102
91102
  key: item[_vm.valueKey],
91103
91103
  class: {
91104
- 'option-with-desc': _vm.hasDescContent(item)
91104
+ 'option-with-desc': _vm.hasDescContent(item),
91105
+ 'option-with-alias': _vm.hasAliasContent(item)
91105
91106
  },
91106
91107
  attrs: {
91107
91108
  "label": item[_vm.labelKey],
91108
91109
  "value": item[_vm.valueKey],
91109
91110
  "disabled": _vm.isOptionDisabled(item)
91110
91111
  }
91111
- }, [_vm.hasDescContent(item) ? [_c('span', {
91112
+ }, [_vm.hasDescContent(item) || _vm.hasAliasContent(item) ? [_c('span', {
91113
+ staticClass: "option-label-wrap"
91114
+ }, [_c('span', {
91112
91115
  staticClass: "option-label",
91113
91116
  attrs: {
91114
91117
  "title": String(item[_vm.labelKey])
91115
91118
  }
91116
- }, [_vm._v(_vm._s(item[_vm.labelKey]))]), _c('span', {
91119
+ }, [_vm._v(_vm._s(item[_vm.labelKey]))]), _vm.hasAliasContent(item) ? _c('span', {
91120
+ staticClass: "option-alias",
91121
+ attrs: {
91122
+ "title": String(item[_vm.aliasKey])
91123
+ }
91124
+ }, [_vm._v(_vm._s('(' + item[_vm.aliasKey] + ')'))]) : _vm._e()]), _vm.hasDescContent(item) ? _c('span', {
91117
91125
  staticClass: "option-desc",
91118
91126
  attrs: {
91119
91127
  "title": String(item[_vm.descKey])
91120
91128
  }
91121
- }, [_vm._v(_vm._s(item[_vm.descKey]))])] : _vm._e()], 2);
91129
+ }, [_vm._v(_vm._s(item[_vm.descKey]))]) : _vm._e()] : _vm._e()], 2);
91122
91130
  }), _vm.hasMoreOptions ? _c('el-option', {
91123
91131
  staticClass: "load-more-option",
91124
91132
  attrs: {
@@ -91158,34 +91166,26 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91158
91166
  staticClass: "popover-title"
91159
91167
  }, [_vm._v("批量输入")]), _c('div', {
91160
91168
  staticClass: "input-type-selector"
91161
- }, [_c('el-radio', {
91162
- attrs: {
91163
- "label": 'id'
91164
- },
91165
- model: {
91166
- value: _vm.inputType,
91167
- callback: function ($$v) {
91168
- _vm.inputType = $$v;
91169
- },
91170
- expression: "inputType"
91171
- }
91172
- }, [_vm._v("ID")]), _c('el-radio', {
91173
- attrs: {
91174
- "label": 'name'
91175
- },
91176
- model: {
91177
- value: _vm.inputType,
91178
- callback: function ($$v) {
91179
- _vm.inputType = $$v;
91169
+ }, _vm._l(_vm.effectiveBatchInputOptions, function (opt) {
91170
+ return _c('el-radio', {
91171
+ key: opt.value,
91172
+ attrs: {
91173
+ "label": opt.value
91180
91174
  },
91181
- expression: "inputType"
91182
- }
91183
- }, [_vm._v("名称")])], 1), _c('el-input', {
91175
+ model: {
91176
+ value: _vm.inputType,
91177
+ callback: function ($$v) {
91178
+ _vm.inputType = $$v;
91179
+ },
91180
+ expression: "inputType"
91181
+ }
91182
+ }, [_vm._v(_vm._s(opt.label))]);
91183
+ }), 1), _c('el-input', {
91184
91184
  staticClass: "batch-input-textarea",
91185
91185
  attrs: {
91186
91186
  "type": "textarea",
91187
91187
  "rows": 10,
91188
- "placeholder": _vm.inputType === 'id' ? '请输入ID,多个ID用换行、逗号、分号、空格分隔' : '请输入名称,多个名称用换行、逗号、分号、空格分隔'
91188
+ "placeholder": _vm.batchInputPlaceholder
91189
91189
  },
91190
91190
  model: {
91191
91191
  value: _vm.batchInputContent,
@@ -91232,7 +91232,7 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91232
91232
  }
91233
91233
  })])], 1) : _vm._e()], 1)]);
91234
91234
  };
91235
- var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91235
+ var BatchQuerySelectorvue_type_template_id_240853ac_staticRenderFns = [];
91236
91236
 
91237
91237
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/batch-query-selector/BatchQuerySelector.vue?vue&type=script&lang=js
91238
91238
 
@@ -91247,6 +91247,7 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91247
91247
 
91248
91248
 
91249
91249
 
91250
+
91250
91251
  /* harmony default export */ var BatchQuerySelectorvue_type_script_lang_js = ({
91251
91252
  name: 'BatchQuerySelector',
91252
91253
  props: {
@@ -91281,7 +91282,18 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91281
91282
  default: 'name'
91282
91283
  },
91283
91284
  /**
91284
- * 描述字段名
91285
+ * 别名字段名(拼接在名称后展示)
91286
+ * 配置后,下拉选项会在名称(labelKey)右侧紧邻位置拼接展示该字段对应的内容;
91287
+ * 仅影响下拉项的显示,不会改变 labelKey 字段本身、选中后 tag 的展示文本,
91288
+ * 也不会影响批量输入按"名称"匹配的逻辑(仍以 labelKey 精确匹配);
91289
+ * 该字段默认不参与搜索匹配,如需让别名参与搜索,请将字段名同时加入 extraSearchKeys
91290
+ */
91291
+ aliasKey: {
91292
+ type: String,
91293
+ default: 'alias'
91294
+ },
91295
+ /**
91296
+ * 描述字段名(显示在选项右侧)
91285
91297
  * 配置后,下拉选项会在名称右侧展示该字段对应的描述内容;
91286
91298
  * 该字段默认不参与搜索匹配,如需让描述参与搜索,请将字段名同时加入 extraSearchKeys
91287
91299
  */
@@ -91359,6 +91371,19 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91359
91371
  type: Function,
91360
91372
  default: null
91361
91373
  },
91374
+ /**
91375
+ * 自定义批量输入项配置
91376
+ * 数组结构:[{ label: '邮箱', field: 'email' }, { label: '工号', field: 'jobNumber' }]
91377
+ * - 未配置(或空数组、全部不合法)时,保持默认行为不变:批量输入弹窗展示固定的「ID」「名称」两个选项;
91378
+ * - 配置后,会用配置项替换默认的「ID」「名称」单选按钮,每一项展示 label,按对应 field 进行精确匹配(忽略大小写、忽略首尾空白),
91379
+ * 匹配逻辑与原 ID/名称完全一致,只是参与匹配的字段由用户指定;
91380
+ * - 若同时配置了 customMapFunction,customMapFunction 收到的第二个参数 inputType 将是当前选中项的 field 值;
91381
+ * 默认场景下(未配置本属性)该参数仍为 'id' / 'name',与既有用法完全兼容。
91382
+ */
91383
+ batchInputOptions: {
91384
+ type: Array,
91385
+ default: () => []
91386
+ },
91362
91387
  // 每页加载数量
91363
91388
  pageSize: {
91364
91389
  type: Number,
@@ -91421,6 +91446,46 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91421
91446
  searchFieldKeys() {
91422
91447
  const extras = Array.isArray(this.extraSearchKeys) ? this.extraSearchKeys.filter(k => typeof k === 'string' && k.trim() !== '') : [];
91423
91448
  return [...new Set([this.labelKey, this.valueKey, ...extras])];
91449
+ },
91450
+ /**
91451
+ * 实际生效的批量输入项配置:
91452
+ * - 当 batchInputOptions 提供了合法配置时,使用用户配置(value 即为 field 字段名);
91453
+ * - 否则回退为默认的「ID / 名称」两项,值仍为 'id' / 'name',确保既有行为完全不变。
91454
+ */
91455
+ effectiveBatchInputOptions() {
91456
+ const list = Array.isArray(this.batchInputOptions) ? this.batchInputOptions : [];
91457
+ const normalized = list.filter(o => o && typeof o.field === 'string' && o.field.trim() !== '').map(o => ({
91458
+ label: o.label != null && String(o.label).trim() !== '' ? String(o.label) : o.field,
91459
+ value: o.field,
91460
+ field: o.field
91461
+ }));
91462
+ if (normalized.length > 0) return normalized;
91463
+ return [{
91464
+ label: 'ID',
91465
+ value: 'id',
91466
+ field: this.valueKey
91467
+ }, {
91468
+ label: '名称',
91469
+ value: 'name',
91470
+ field: this.labelKey
91471
+ }];
91472
+ },
91473
+ /** 当前选中的批量输入项对应的真实匹配字段 */
91474
+ currentBatchInputField() {
91475
+ const list = this.effectiveBatchInputOptions;
91476
+ const found = list.find(o => o.value === this.inputType);
91477
+ return found ? found.field : list[0] ? list[0].field : '';
91478
+ },
91479
+ /** 当前选中的批量输入项对应的展示文本(用于 placeholder) */
91480
+ currentBatchInputLabel() {
91481
+ const list = this.effectiveBatchInputOptions;
91482
+ const found = list.find(o => o.value === this.inputType);
91483
+ return found ? found.label : list[0] ? list[0].label : '';
91484
+ },
91485
+ /** 批量输入文本框 placeholder */
91486
+ batchInputPlaceholder() {
91487
+ const label = this.currentBatchInputLabel || '';
91488
+ return `请输入${label},多个${label}用换行、逗号、分号、空格分隔`;
91424
91489
  }
91425
91490
  },
91426
91491
  watch: {
@@ -91451,6 +91516,19 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91451
91516
  } else {
91452
91517
  this.removeScrollListener();
91453
91518
  }
91519
+ },
91520
+ /**
91521
+ * 当批量输入项配置变化(或首次解析完成)时,
91522
+ * 若当前 inputType 已不在可选列表中,则回退到第一项,避免 radio 选中态丢失。
91523
+ */
91524
+ effectiveBatchInputOptions: {
91525
+ handler(list) {
91526
+ if (!Array.isArray(list) || list.length === 0) return;
91527
+ if (!list.some(o => o.value === this.inputType)) {
91528
+ this.inputType = list[0].value;
91529
+ }
91530
+ },
91531
+ immediate: true
91454
91532
  }
91455
91533
  },
91456
91534
  created() {
@@ -91466,6 +91544,12 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91466
91544
  const val = option[this.descKey];
91467
91545
  return val !== undefined && val !== null && String(val).trim() !== '';
91468
91546
  },
91547
+ // 判断选项是否有可展示的别名内容(拼接在名称后)
91548
+ hasAliasContent(option) {
91549
+ if (!this.aliasKey) return false;
91550
+ const val = option[this.aliasKey];
91551
+ return val !== undefined && val !== null && String(val).trim() !== '';
91552
+ },
91469
91553
  // 判断选项是否禁用
91470
91554
  isOptionDisabled(option) {
91471
91555
  // 如果提供了自定义禁用方法,则使用自定义方法判断
@@ -91679,8 +91763,10 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91679
91763
  // 获取匹配的完整选项对象
91680
91764
  matchedItems = this.optionsList.filter(item => matchedValues.includes(item[this.valueKey]));
91681
91765
  } else {
91682
- // 默认映射逻辑:ID 和 名称 均采用精确匹配(忽略大小写、忽略首尾空白)
91683
- const searchKey = this.inputType === 'id' ? this.valueKey : this.labelKey;
91766
+ // 默认映射逻辑:按当前选中的批量输入项对应的字段进行精确匹配(忽略大小写、忽略首尾空白)
91767
+ // - 默认场景下 inputType 'id'/'name',searchKey 解析为 valueKey/labelKey,行为与原先一致;
91768
+ // - 配置了 batchInputOptions 时,searchKey 即为用户指定的 field 字段。
91769
+ const searchKey = this.currentBatchInputField;
91684
91770
 
91685
91771
  // 从完整的 optionsList 中查找精确命中的项
91686
91772
  matchedItems = this.optionsList.filter(item => {
@@ -91764,8 +91850,8 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91764
91850
  ;
91765
91851
  var BatchQuerySelector_component = normalizeComponent(
91766
91852
  batch_query_selector_BatchQuerySelectorvue_type_script_lang_js,
91767
- BatchQuerySelectorvue_type_template_id_16c8bfda_render,
91768
- BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns,
91853
+ BatchQuerySelectorvue_type_template_id_240853ac_render,
91854
+ BatchQuerySelectorvue_type_template_id_240853ac_staticRenderFns,
91769
91855
  false,
91770
91856
  null,
91771
91857
  null,
@@ -91070,8 +91070,8 @@ var ByCommonSelector_component = normalizeComponent(
91070
91070
  )
91071
91071
 
91072
91072
  /* harmony default export */ var ByCommonSelector = (ByCommonSelector_component.exports);
91073
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/batch-query-selector/BatchQuerySelector.vue?vue&type=template&id=16c8bfda
91074
- var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91073
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/batch-query-selector/BatchQuerySelector.vue?vue&type=template&id=240853ac
91074
+ var BatchQuerySelectorvue_type_template_id_240853ac_render = function render() {
91075
91075
  var _vm = this,
91076
91076
  _c = _vm._self._c;
91077
91077
  return _c('div', {
@@ -91111,24 +91111,32 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91111
91111
  return _c('el-option', {
91112
91112
  key: item[_vm.valueKey],
91113
91113
  class: {
91114
- 'option-with-desc': _vm.hasDescContent(item)
91114
+ 'option-with-desc': _vm.hasDescContent(item),
91115
+ 'option-with-alias': _vm.hasAliasContent(item)
91115
91116
  },
91116
91117
  attrs: {
91117
91118
  "label": item[_vm.labelKey],
91118
91119
  "value": item[_vm.valueKey],
91119
91120
  "disabled": _vm.isOptionDisabled(item)
91120
91121
  }
91121
- }, [_vm.hasDescContent(item) ? [_c('span', {
91122
+ }, [_vm.hasDescContent(item) || _vm.hasAliasContent(item) ? [_c('span', {
91123
+ staticClass: "option-label-wrap"
91124
+ }, [_c('span', {
91122
91125
  staticClass: "option-label",
91123
91126
  attrs: {
91124
91127
  "title": String(item[_vm.labelKey])
91125
91128
  }
91126
- }, [_vm._v(_vm._s(item[_vm.labelKey]))]), _c('span', {
91129
+ }, [_vm._v(_vm._s(item[_vm.labelKey]))]), _vm.hasAliasContent(item) ? _c('span', {
91130
+ staticClass: "option-alias",
91131
+ attrs: {
91132
+ "title": String(item[_vm.aliasKey])
91133
+ }
91134
+ }, [_vm._v(_vm._s('(' + item[_vm.aliasKey] + ')'))]) : _vm._e()]), _vm.hasDescContent(item) ? _c('span', {
91127
91135
  staticClass: "option-desc",
91128
91136
  attrs: {
91129
91137
  "title": String(item[_vm.descKey])
91130
91138
  }
91131
- }, [_vm._v(_vm._s(item[_vm.descKey]))])] : _vm._e()], 2);
91139
+ }, [_vm._v(_vm._s(item[_vm.descKey]))]) : _vm._e()] : _vm._e()], 2);
91132
91140
  }), _vm.hasMoreOptions ? _c('el-option', {
91133
91141
  staticClass: "load-more-option",
91134
91142
  attrs: {
@@ -91168,34 +91176,26 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91168
91176
  staticClass: "popover-title"
91169
91177
  }, [_vm._v("批量输入")]), _c('div', {
91170
91178
  staticClass: "input-type-selector"
91171
- }, [_c('el-radio', {
91172
- attrs: {
91173
- "label": 'id'
91174
- },
91175
- model: {
91176
- value: _vm.inputType,
91177
- callback: function ($$v) {
91178
- _vm.inputType = $$v;
91179
- },
91180
- expression: "inputType"
91181
- }
91182
- }, [_vm._v("ID")]), _c('el-radio', {
91183
- attrs: {
91184
- "label": 'name'
91185
- },
91186
- model: {
91187
- value: _vm.inputType,
91188
- callback: function ($$v) {
91189
- _vm.inputType = $$v;
91179
+ }, _vm._l(_vm.effectiveBatchInputOptions, function (opt) {
91180
+ return _c('el-radio', {
91181
+ key: opt.value,
91182
+ attrs: {
91183
+ "label": opt.value
91190
91184
  },
91191
- expression: "inputType"
91192
- }
91193
- }, [_vm._v("名称")])], 1), _c('el-input', {
91185
+ model: {
91186
+ value: _vm.inputType,
91187
+ callback: function ($$v) {
91188
+ _vm.inputType = $$v;
91189
+ },
91190
+ expression: "inputType"
91191
+ }
91192
+ }, [_vm._v(_vm._s(opt.label))]);
91193
+ }), 1), _c('el-input', {
91194
91194
  staticClass: "batch-input-textarea",
91195
91195
  attrs: {
91196
91196
  "type": "textarea",
91197
91197
  "rows": 10,
91198
- "placeholder": _vm.inputType === 'id' ? '请输入ID,多个ID用换行、逗号、分号、空格分隔' : '请输入名称,多个名称用换行、逗号、分号、空格分隔'
91198
+ "placeholder": _vm.batchInputPlaceholder
91199
91199
  },
91200
91200
  model: {
91201
91201
  value: _vm.batchInputContent,
@@ -91242,7 +91242,7 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_render = function render() {
91242
91242
  }
91243
91243
  })])], 1) : _vm._e()], 1)]);
91244
91244
  };
91245
- var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91245
+ var BatchQuerySelectorvue_type_template_id_240853ac_staticRenderFns = [];
91246
91246
 
91247
91247
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/batch-query-selector/BatchQuerySelector.vue?vue&type=script&lang=js
91248
91248
 
@@ -91257,6 +91257,7 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91257
91257
 
91258
91258
 
91259
91259
 
91260
+
91260
91261
  /* harmony default export */ var BatchQuerySelectorvue_type_script_lang_js = ({
91261
91262
  name: 'BatchQuerySelector',
91262
91263
  props: {
@@ -91291,7 +91292,18 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91291
91292
  default: 'name'
91292
91293
  },
91293
91294
  /**
91294
- * 描述字段名
91295
+ * 别名字段名(拼接在名称后展示)
91296
+ * 配置后,下拉选项会在名称(labelKey)右侧紧邻位置拼接展示该字段对应的内容;
91297
+ * 仅影响下拉项的显示,不会改变 labelKey 字段本身、选中后 tag 的展示文本,
91298
+ * 也不会影响批量输入按"名称"匹配的逻辑(仍以 labelKey 精确匹配);
91299
+ * 该字段默认不参与搜索匹配,如需让别名参与搜索,请将字段名同时加入 extraSearchKeys
91300
+ */
91301
+ aliasKey: {
91302
+ type: String,
91303
+ default: 'alias'
91304
+ },
91305
+ /**
91306
+ * 描述字段名(显示在选项右侧)
91295
91307
  * 配置后,下拉选项会在名称右侧展示该字段对应的描述内容;
91296
91308
  * 该字段默认不参与搜索匹配,如需让描述参与搜索,请将字段名同时加入 extraSearchKeys
91297
91309
  */
@@ -91369,6 +91381,19 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91369
91381
  type: Function,
91370
91382
  default: null
91371
91383
  },
91384
+ /**
91385
+ * 自定义批量输入项配置
91386
+ * 数组结构:[{ label: '邮箱', field: 'email' }, { label: '工号', field: 'jobNumber' }]
91387
+ * - 未配置(或空数组、全部不合法)时,保持默认行为不变:批量输入弹窗展示固定的「ID」「名称」两个选项;
91388
+ * - 配置后,会用配置项替换默认的「ID」「名称」单选按钮,每一项展示 label,按对应 field 进行精确匹配(忽略大小写、忽略首尾空白),
91389
+ * 匹配逻辑与原 ID/名称完全一致,只是参与匹配的字段由用户指定;
91390
+ * - 若同时配置了 customMapFunction,customMapFunction 收到的第二个参数 inputType 将是当前选中项的 field 值;
91391
+ * 默认场景下(未配置本属性)该参数仍为 'id' / 'name',与既有用法完全兼容。
91392
+ */
91393
+ batchInputOptions: {
91394
+ type: Array,
91395
+ default: () => []
91396
+ },
91372
91397
  // 每页加载数量
91373
91398
  pageSize: {
91374
91399
  type: Number,
@@ -91431,6 +91456,46 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91431
91456
  searchFieldKeys() {
91432
91457
  const extras = Array.isArray(this.extraSearchKeys) ? this.extraSearchKeys.filter(k => typeof k === 'string' && k.trim() !== '') : [];
91433
91458
  return [...new Set([this.labelKey, this.valueKey, ...extras])];
91459
+ },
91460
+ /**
91461
+ * 实际生效的批量输入项配置:
91462
+ * - 当 batchInputOptions 提供了合法配置时,使用用户配置(value 即为 field 字段名);
91463
+ * - 否则回退为默认的「ID / 名称」两项,值仍为 'id' / 'name',确保既有行为完全不变。
91464
+ */
91465
+ effectiveBatchInputOptions() {
91466
+ const list = Array.isArray(this.batchInputOptions) ? this.batchInputOptions : [];
91467
+ const normalized = list.filter(o => o && typeof o.field === 'string' && o.field.trim() !== '').map(o => ({
91468
+ label: o.label != null && String(o.label).trim() !== '' ? String(o.label) : o.field,
91469
+ value: o.field,
91470
+ field: o.field
91471
+ }));
91472
+ if (normalized.length > 0) return normalized;
91473
+ return [{
91474
+ label: 'ID',
91475
+ value: 'id',
91476
+ field: this.valueKey
91477
+ }, {
91478
+ label: '名称',
91479
+ value: 'name',
91480
+ field: this.labelKey
91481
+ }];
91482
+ },
91483
+ /** 当前选中的批量输入项对应的真实匹配字段 */
91484
+ currentBatchInputField() {
91485
+ const list = this.effectiveBatchInputOptions;
91486
+ const found = list.find(o => o.value === this.inputType);
91487
+ return found ? found.field : list[0] ? list[0].field : '';
91488
+ },
91489
+ /** 当前选中的批量输入项对应的展示文本(用于 placeholder) */
91490
+ currentBatchInputLabel() {
91491
+ const list = this.effectiveBatchInputOptions;
91492
+ const found = list.find(o => o.value === this.inputType);
91493
+ return found ? found.label : list[0] ? list[0].label : '';
91494
+ },
91495
+ /** 批量输入文本框 placeholder */
91496
+ batchInputPlaceholder() {
91497
+ const label = this.currentBatchInputLabel || '';
91498
+ return `请输入${label},多个${label}用换行、逗号、分号、空格分隔`;
91434
91499
  }
91435
91500
  },
91436
91501
  watch: {
@@ -91461,6 +91526,19 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91461
91526
  } else {
91462
91527
  this.removeScrollListener();
91463
91528
  }
91529
+ },
91530
+ /**
91531
+ * 当批量输入项配置变化(或首次解析完成)时,
91532
+ * 若当前 inputType 已不在可选列表中,则回退到第一项,避免 radio 选中态丢失。
91533
+ */
91534
+ effectiveBatchInputOptions: {
91535
+ handler(list) {
91536
+ if (!Array.isArray(list) || list.length === 0) return;
91537
+ if (!list.some(o => o.value === this.inputType)) {
91538
+ this.inputType = list[0].value;
91539
+ }
91540
+ },
91541
+ immediate: true
91464
91542
  }
91465
91543
  },
91466
91544
  created() {
@@ -91476,6 +91554,12 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91476
91554
  const val = option[this.descKey];
91477
91555
  return val !== undefined && val !== null && String(val).trim() !== '';
91478
91556
  },
91557
+ // 判断选项是否有可展示的别名内容(拼接在名称后)
91558
+ hasAliasContent(option) {
91559
+ if (!this.aliasKey) return false;
91560
+ const val = option[this.aliasKey];
91561
+ return val !== undefined && val !== null && String(val).trim() !== '';
91562
+ },
91479
91563
  // 判断选项是否禁用
91480
91564
  isOptionDisabled(option) {
91481
91565
  // 如果提供了自定义禁用方法,则使用自定义方法判断
@@ -91689,8 +91773,10 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91689
91773
  // 获取匹配的完整选项对象
91690
91774
  matchedItems = this.optionsList.filter(item => matchedValues.includes(item[this.valueKey]));
91691
91775
  } else {
91692
- // 默认映射逻辑:ID 和 名称 均采用精确匹配(忽略大小写、忽略首尾空白)
91693
- const searchKey = this.inputType === 'id' ? this.valueKey : this.labelKey;
91776
+ // 默认映射逻辑:按当前选中的批量输入项对应的字段进行精确匹配(忽略大小写、忽略首尾空白)
91777
+ // - 默认场景下 inputType 'id'/'name',searchKey 解析为 valueKey/labelKey,行为与原先一致;
91778
+ // - 配置了 batchInputOptions 时,searchKey 即为用户指定的 field 字段。
91779
+ const searchKey = this.currentBatchInputField;
91694
91780
 
91695
91781
  // 从完整的 optionsList 中查找精确命中的项
91696
91782
  matchedItems = this.optionsList.filter(item => {
@@ -91774,8 +91860,8 @@ var BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns = [];
91774
91860
  ;
91775
91861
  var BatchQuerySelector_component = normalizeComponent(
91776
91862
  batch_query_selector_BatchQuerySelectorvue_type_script_lang_js,
91777
- BatchQuerySelectorvue_type_template_id_16c8bfda_render,
91778
- BatchQuerySelectorvue_type_template_id_16c8bfda_staticRenderFns,
91863
+ BatchQuerySelectorvue_type_template_id_240853ac_render,
91864
+ BatchQuerySelectorvue_type_template_id_240853ac_staticRenderFns,
91779
91865
  false,
91780
91866
  null,
91781
91867
  null,