@weitutech/by-components 1.1.206 → 1.1.208
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.
- package/lib/by-components.common.js +210 -51
- package/lib/by-components.umd.js +210 -51
- package/lib/by-components.umd.min.js +1 -1
- package/lib/index.css +1 -1
- package/package.json +1 -1
package/lib/by-components.umd.js
CHANGED
|
@@ -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=
|
|
91074
|
-
var
|
|
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=6782df62
|
|
91074
|
+
var BatchQuerySelectorvue_type_template_id_6782df62_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
|
-
},
|
|
91172
|
-
|
|
91173
|
-
|
|
91174
|
-
|
|
91175
|
-
|
|
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
|
-
|
|
91192
|
-
|
|
91193
|
-
|
|
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.
|
|
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
|
|
91245
|
+
var BatchQuerySelectorvue_type_template_id_6782df62_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
|
-
//
|
|
91693
|
-
|
|
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
|
-
|
|
91778
|
-
|
|
91863
|
+
BatchQuerySelectorvue_type_template_id_6782df62_render,
|
|
91864
|
+
BatchQuerySelectorvue_type_template_id_6782df62_staticRenderFns,
|
|
91779
91865
|
false,
|
|
91780
91866
|
null,
|
|
91781
91867
|
null,
|
|
@@ -97720,8 +97806,8 @@ var ByCardView_component = normalizeComponent(
|
|
|
97720
97806
|
)
|
|
97721
97807
|
|
|
97722
97808
|
/* harmony default export */ var ByCardView = (ByCardView_component.exports);
|
|
97723
|
-
;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=
|
|
97724
|
-
var
|
|
97809
|
+
;// ./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/card-selector/ByCardSelector.vue?vue&type=template&id=43f85144
|
|
97810
|
+
var ByCardSelectorvue_type_template_id_43f85144_render = function render() {
|
|
97725
97811
|
var _vm = this,
|
|
97726
97812
|
_c = _vm._self._c;
|
|
97727
97813
|
return _c('div', {
|
|
@@ -97730,12 +97816,12 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
|
|
|
97730
97816
|
'is-disabled': _vm.disabled,
|
|
97731
97817
|
'by-card-selector--no-check': !_vm.showCheckmark
|
|
97732
97818
|
}],
|
|
97733
|
-
style: _vm.
|
|
97819
|
+
style: _vm.rootStyle,
|
|
97734
97820
|
attrs: {
|
|
97735
97821
|
"role": "listbox",
|
|
97736
97822
|
"aria-multiselectable": _vm.multiple ? 'true' : 'false'
|
|
97737
97823
|
}
|
|
97738
|
-
}, _vm._l(_vm.options, function (item, index) {
|
|
97824
|
+
}, [_vm._l(_vm.options, function (item, index) {
|
|
97739
97825
|
return _c('div', {
|
|
97740
97826
|
key: _vm.optionKey(item, index),
|
|
97741
97827
|
staticClass: "by-card-selector__card",
|
|
@@ -97835,9 +97921,29 @@ var ByCardSelectorvue_type_template_id_0a667b47_render = function render() {
|
|
|
97835
97921
|
}, [_vm.isSelected(item) ? _c('i', {
|
|
97836
97922
|
staticClass: "el-icon-check by-card-selector__check-icon"
|
|
97837
97923
|
}) : _vm._e()]) : _vm._e()])], 2);
|
|
97838
|
-
}),
|
|
97924
|
+
}), _vm.hasGroupTooltip ? _c('div', {
|
|
97925
|
+
staticClass: "by-card-selector__suffix",
|
|
97926
|
+
attrs: {
|
|
97927
|
+
"role": "note"
|
|
97928
|
+
}
|
|
97929
|
+
}, [_c('el-tooltip', {
|
|
97930
|
+
attrs: {
|
|
97931
|
+
"content": _vm.groupTooltipText,
|
|
97932
|
+
"placement": "top",
|
|
97933
|
+
"open-delay": 300
|
|
97934
|
+
}
|
|
97935
|
+
}, [_c('span', {
|
|
97936
|
+
staticClass: "by-card-selector__suffix-trigger",
|
|
97937
|
+
on: {
|
|
97938
|
+
"click": function ($event) {
|
|
97939
|
+
$event.stopPropagation();
|
|
97940
|
+
}
|
|
97941
|
+
}
|
|
97942
|
+
}, [_c('i', {
|
|
97943
|
+
staticClass: "el-icon-question"
|
|
97944
|
+
})])])], 1) : _vm._e()], 2);
|
|
97839
97945
|
};
|
|
97840
|
-
var
|
|
97946
|
+
var ByCardSelectorvue_type_template_id_43f85144_staticRenderFns = [];
|
|
97841
97947
|
|
|
97842
97948
|
;// ./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/card-selector/ByCardSelector.vue?vue&type=script&lang=js
|
|
97843
97949
|
|
|
@@ -97860,6 +97966,9 @@ const DEFAULT_OPTION_PROPS = () => ({
|
|
|
97860
97966
|
* @example
|
|
97861
97967
|
* <by-card-selector v-model="id" :options="list" />
|
|
97862
97968
|
* <by-card-selector v-model="ids" :options="list" multiple />
|
|
97969
|
+
* <by-card-selector v-model="id" :options="list" :card-width="280" />
|
|
97970
|
+
* <by-card-selector v-model="id" :options="list" :show-checkmark="true" />
|
|
97971
|
+
* <by-card-selector v-model="id" :options="list" tooltips="整组说明文案" />
|
|
97863
97972
|
*/
|
|
97864
97973
|
/* harmony default export */ var ByCardSelectorvue_type_script_lang_js = ({
|
|
97865
97974
|
name: 'ByCardSelector',
|
|
@@ -97889,12 +97998,20 @@ const DEFAULT_OPTION_PROPS = () => ({
|
|
|
97889
97998
|
type: String,
|
|
97890
97999
|
default: '320px'
|
|
97891
98000
|
},
|
|
97892
|
-
/**
|
|
98001
|
+
/** 卡片尺寸(内边距、图标与字号等);卡片列宽默认由 size 与样式表决定 */
|
|
97893
98002
|
size: {
|
|
97894
98003
|
type: String,
|
|
97895
98004
|
default: 'default',
|
|
97896
98005
|
validator: v => ['large', 'default', 'small'].includes(v)
|
|
97897
98006
|
},
|
|
98007
|
+
/**
|
|
98008
|
+
* 每张卡片宽度(像素,组件级统一)。未设置时列宽由 size 对应样式决定。
|
|
98009
|
+
* 合法范围 100–600,小于 100 按 100、大于 600 按 600;可传数字或字符串(如 240、"320px")。
|
|
98010
|
+
*/
|
|
98011
|
+
cardWidth: {
|
|
98012
|
+
type: [Number, String],
|
|
98013
|
+
default: null
|
|
98014
|
+
},
|
|
97898
98015
|
/** 整组禁用 */
|
|
97899
98016
|
disabled: {
|
|
97900
98017
|
type: Boolean,
|
|
@@ -97920,10 +98037,18 @@ const DEFAULT_OPTION_PROPS = () => ({
|
|
|
97920
98037
|
type: Number,
|
|
97921
98038
|
default: 3
|
|
97922
98039
|
},
|
|
97923
|
-
/**
|
|
98040
|
+
/**
|
|
98041
|
+
* 组件级说明:有内容时在所有选项之后展示问号,悬停显示提示(与单项内的 tooltip 字段无关)。
|
|
98042
|
+
* 支持字符串或数字;仅空白则整组不展示该问号。
|
|
98043
|
+
*/
|
|
98044
|
+
tooltips: {
|
|
98045
|
+
type: [String, Number],
|
|
98046
|
+
default: ''
|
|
98047
|
+
},
|
|
98048
|
+
/** 是否在卡片右侧展示圆形打钩选中指示,默认不展示 */
|
|
97924
98049
|
showCheckmark: {
|
|
97925
98050
|
type: Boolean,
|
|
97926
|
-
default:
|
|
98051
|
+
default: false
|
|
97927
98052
|
}
|
|
97928
98053
|
},
|
|
97929
98054
|
data() {
|
|
@@ -97941,17 +98066,51 @@ const DEFAULT_OPTION_PROPS = () => ({
|
|
|
97941
98066
|
keyField() {
|
|
97942
98067
|
return this.optionKeyField || this.mergedOptionProps.value;
|
|
97943
98068
|
},
|
|
97944
|
-
|
|
97945
|
-
|
|
97946
|
-
|
|
97947
|
-
|
|
97948
|
-
|
|
98069
|
+
/** 解析后的卡片宽度(px),无效或未传时为 null */
|
|
98070
|
+
resolvedCardWidthPx() {
|
|
98071
|
+
const raw = this.cardWidth;
|
|
98072
|
+
if (raw == null || raw === '') return null;
|
|
98073
|
+
let n;
|
|
98074
|
+
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
98075
|
+
n = raw;
|
|
98076
|
+
} else if (typeof raw === 'string') {
|
|
98077
|
+
const s = String(raw).trim().replace(/px$/i, '');
|
|
98078
|
+
n = parseFloat(s);
|
|
98079
|
+
} else {
|
|
98080
|
+
return null;
|
|
98081
|
+
}
|
|
98082
|
+
if (!Number.isFinite(n)) return null;
|
|
98083
|
+
const MIN = 100;
|
|
98084
|
+
const MAX = 600;
|
|
98085
|
+
return Math.min(MAX, Math.max(MIN, Math.round(n)));
|
|
98086
|
+
},
|
|
98087
|
+
/** 根节点样式:纵向高度 + 可选自定义卡片宽度(CSS 变量) */
|
|
98088
|
+
rootStyle() {
|
|
98089
|
+
const style = {};
|
|
98090
|
+
if (this.direction === 'vertical') {
|
|
98091
|
+
style.maxHeight = this.verticalMaxHeight;
|
|
98092
|
+
}
|
|
98093
|
+
if (this.resolvedCardWidthPx != null) {
|
|
98094
|
+
style['--by-card-selector-min'] = `${this.resolvedCardWidthPx}px`;
|
|
98095
|
+
}
|
|
98096
|
+
return style;
|
|
97949
98097
|
},
|
|
97950
98098
|
hasCardSlot() {
|
|
97951
98099
|
return Boolean(this.$scopedSlots && this.$scopedSlots.card || this.$slots && this.$slots.card);
|
|
97952
98100
|
},
|
|
97953
98101
|
hasIconSlot() {
|
|
97954
98102
|
return Boolean(this.$scopedSlots && this.$scopedSlots.icon || this.$slots && this.$slots.icon);
|
|
98103
|
+
},
|
|
98104
|
+
/** 是否展示组件级尾部问号 */
|
|
98105
|
+
hasGroupTooltip() {
|
|
98106
|
+
const t = this.tooltips;
|
|
98107
|
+
if (t == null || t === '') return false;
|
|
98108
|
+
return String(t).trim().length > 0;
|
|
98109
|
+
},
|
|
98110
|
+
/** 传给 el-tooltip 的纯文本 */
|
|
98111
|
+
groupTooltipText() {
|
|
98112
|
+
if (!this.hasGroupTooltip) return '';
|
|
98113
|
+
return String(this.tooltips).trim();
|
|
97955
98114
|
}
|
|
97956
98115
|
},
|
|
97957
98116
|
watch: {
|
|
@@ -98140,8 +98299,8 @@ const DEFAULT_OPTION_PROPS = () => ({
|
|
|
98140
98299
|
;
|
|
98141
98300
|
var ByCardSelector_component = normalizeComponent(
|
|
98142
98301
|
card_selector_ByCardSelectorvue_type_script_lang_js,
|
|
98143
|
-
|
|
98144
|
-
|
|
98302
|
+
ByCardSelectorvue_type_template_id_43f85144_render,
|
|
98303
|
+
ByCardSelectorvue_type_template_id_43f85144_staticRenderFns,
|
|
98145
98304
|
false,
|
|
98146
98305
|
null,
|
|
98147
98306
|
null,
|