@weitutech/by-components 1.1.66 → 1.1.68
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 +484 -11
- package/lib/by-components.css +1 -1
- package/lib/by-components.umd.js +484 -11
- package/lib/by-components.umd.min.js +13 -13
- package/lib/index.css +1 -1
- package/package.json +1 -1
package/lib/by-components.umd.js
CHANGED
|
@@ -60512,6 +60512,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60512
60512
|
|
|
60513
60513
|
// EXPORTS
|
|
60514
60514
|
__webpack_require__.d(__webpack_exports__, {
|
|
60515
|
+
ByBatchQuerySelector: function() { return /* reexport */ BatchQuerySelector; },
|
|
60515
60516
|
ByCommonSelector: function() { return /* reexport */ ByCommonSelector; },
|
|
60516
60517
|
ByCustomDatePicker: function() { return /* reexport */ custom_date_picker; },
|
|
60517
60518
|
ByDatePickerRange: function() { return /* reexport */ date_picker_range; },
|
|
@@ -62402,8 +62403,8 @@ var table_component = normalizeComponent(
|
|
|
62402
62403
|
)
|
|
62403
62404
|
|
|
62404
62405
|
/* harmony default export */ var table = (table_component.exports);
|
|
62405
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7d802f52-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/form/form.vue?vue&type=template&id=
|
|
62406
|
-
var
|
|
62406
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7d802f52-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/form/form.vue?vue&type=template&id=c208c726&scoped=true
|
|
62407
|
+
var formvue_type_template_id_c208c726_scoped_true_render = function render() {
|
|
62407
62408
|
var _vm = this,
|
|
62408
62409
|
_c = _vm._self._c;
|
|
62409
62410
|
return _c('div', {
|
|
@@ -62545,7 +62546,45 @@ var formvue_type_template_id_9bf2745a_scoped_true_render = function render() {
|
|
|
62545
62546
|
return _vm.handleSuffixInputChange($event, item);
|
|
62546
62547
|
}
|
|
62547
62548
|
}
|
|
62548
|
-
}, 'by-common-selector', item.otherOptions || {}, false))] : item.type === '
|
|
62549
|
+
}, 'by-common-selector', item.otherOptions || {}, false))] : item.type === 'batchQuerySelector' ? [_c('by-batch-query-selector', _vm._b({
|
|
62550
|
+
attrs: {
|
|
62551
|
+
"value": _vm.value[`${item.field}`],
|
|
62552
|
+
"config": item,
|
|
62553
|
+
"options": item.options || [],
|
|
62554
|
+
"loadOptions": item.loadOptions,
|
|
62555
|
+
"autoLoad": item.autoLoad !== false,
|
|
62556
|
+
"valueKey": item.valueKey || 'id',
|
|
62557
|
+
"labelKey": item.labelKey || 'name',
|
|
62558
|
+
"disabledKey": item.disabledKey || 'disabled',
|
|
62559
|
+
"disabledMethod": item.disabledMethod,
|
|
62560
|
+
"multiple": item.multiple !== false,
|
|
62561
|
+
"collapseTags": item.collapseTags !== false,
|
|
62562
|
+
"placeholder": item.placeholder || '请选择',
|
|
62563
|
+
"disabled": item.disabled,
|
|
62564
|
+
"clearable": item.clearable !== false,
|
|
62565
|
+
"size": _vm.elSize,
|
|
62566
|
+
"maxWidth": item.maxWidth || '100%',
|
|
62567
|
+
"popoverWidth": item.popoverWidth || 300,
|
|
62568
|
+
"customMapFunction": item.customMapFunction
|
|
62569
|
+
},
|
|
62570
|
+
on: {
|
|
62571
|
+
"input": function ($event) {
|
|
62572
|
+
return _vm.handleValueChange($event, item);
|
|
62573
|
+
},
|
|
62574
|
+
"change": function ($event) {
|
|
62575
|
+
return _vm.handleValueChange($event, item);
|
|
62576
|
+
},
|
|
62577
|
+
"options-loaded": function ($event) {
|
|
62578
|
+
return _vm.handleBatchSelectorOptionsLoaded($event, item);
|
|
62579
|
+
},
|
|
62580
|
+
"options-load-error": function ($event) {
|
|
62581
|
+
return _vm.handleBatchSelectorOptionsLoadError($event, item);
|
|
62582
|
+
},
|
|
62583
|
+
"batch-input-complete": function ($event) {
|
|
62584
|
+
return _vm.handleBatchInputComplete($event, item);
|
|
62585
|
+
}
|
|
62586
|
+
}
|
|
62587
|
+
}, 'by-batch-query-selector', item.otherOptions || {}, false))] : item.type === 'datepicker' ? [_c('el-date-picker', _vm._b({
|
|
62549
62588
|
staticStyle: {
|
|
62550
62589
|
"width": "100%"
|
|
62551
62590
|
},
|
|
@@ -62711,7 +62750,7 @@ var formvue_type_template_id_9bf2745a_scoped_true_render = function render() {
|
|
|
62711
62750
|
staticClass: "footer"
|
|
62712
62751
|
}, [_vm._t("footer")], 2)], 1);
|
|
62713
62752
|
};
|
|
62714
|
-
var
|
|
62753
|
+
var formvue_type_template_id_c208c726_scoped_true_staticRenderFns = [];
|
|
62715
62754
|
|
|
62716
62755
|
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7d802f52-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/form/comps/pair-number-input.vue?vue&type=template&id=604235f6
|
|
62717
62756
|
var pair_number_inputvue_type_template_id_604235f6_render = function render() {
|
|
@@ -74168,6 +74207,414 @@ var ByCommonSelector_component = normalizeComponent(
|
|
|
74168
74207
|
)
|
|
74169
74208
|
|
|
74170
74209
|
/* harmony default export */ var ByCommonSelector = (ByCommonSelector_component.exports);
|
|
74210
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7d802f52-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=62af8083
|
|
74211
|
+
var BatchQuerySelectorvue_type_template_id_62af8083_render = function render() {
|
|
74212
|
+
var _vm = this,
|
|
74213
|
+
_c = _vm._self._c;
|
|
74214
|
+
return _c('div', {
|
|
74215
|
+
staticClass: "by-batch-query-selector",
|
|
74216
|
+
style: _vm.containerStyle
|
|
74217
|
+
}, [_c('div', {
|
|
74218
|
+
staticClass: "selector-container"
|
|
74219
|
+
}, [_c('el-select', {
|
|
74220
|
+
staticClass: "selector-input",
|
|
74221
|
+
attrs: {
|
|
74222
|
+
"placeholder": _vm.placeholder,
|
|
74223
|
+
"disabled": _vm.disabled || _vm.loading,
|
|
74224
|
+
"size": _vm.size,
|
|
74225
|
+
"clearable": _vm.clearable,
|
|
74226
|
+
"multiple": _vm.multiple,
|
|
74227
|
+
"collapse-tags": _vm.collapseTags,
|
|
74228
|
+
"loading": _vm.loading
|
|
74229
|
+
},
|
|
74230
|
+
on: {
|
|
74231
|
+
"change": _vm.handleChange,
|
|
74232
|
+
"focus": _vm.handleFocus
|
|
74233
|
+
},
|
|
74234
|
+
model: {
|
|
74235
|
+
value: _vm.selectedValues,
|
|
74236
|
+
callback: function ($$v) {
|
|
74237
|
+
_vm.selectedValues = $$v;
|
|
74238
|
+
},
|
|
74239
|
+
expression: "selectedValues"
|
|
74240
|
+
}
|
|
74241
|
+
}, _vm._l(_vm.optionsList, function (item) {
|
|
74242
|
+
return _c('el-option', {
|
|
74243
|
+
key: item[_vm.valueKey],
|
|
74244
|
+
attrs: {
|
|
74245
|
+
"label": item[_vm.labelKey],
|
|
74246
|
+
"value": item[_vm.valueKey],
|
|
74247
|
+
"disabled": _vm.isOptionDisabled(item)
|
|
74248
|
+
}
|
|
74249
|
+
});
|
|
74250
|
+
}), 1), _c('el-popover', {
|
|
74251
|
+
attrs: {
|
|
74252
|
+
"placement": "bottom-end",
|
|
74253
|
+
"width": _vm.popoverWidth,
|
|
74254
|
+
"trigger": "click",
|
|
74255
|
+
"popper-class": "batch-input-popover"
|
|
74256
|
+
},
|
|
74257
|
+
model: {
|
|
74258
|
+
value: _vm.popoverVisible,
|
|
74259
|
+
callback: function ($$v) {
|
|
74260
|
+
_vm.popoverVisible = $$v;
|
|
74261
|
+
},
|
|
74262
|
+
expression: "popoverVisible"
|
|
74263
|
+
}
|
|
74264
|
+
}, [_c('div', {
|
|
74265
|
+
staticClass: "batch-input-container"
|
|
74266
|
+
}, [_c('div', {
|
|
74267
|
+
staticClass: "popover-title"
|
|
74268
|
+
}, [_vm._v("批量输入")]), _c('div', {
|
|
74269
|
+
staticClass: "input-type-selector"
|
|
74270
|
+
}, [_c('el-radio', {
|
|
74271
|
+
attrs: {
|
|
74272
|
+
"label": 'id'
|
|
74273
|
+
},
|
|
74274
|
+
model: {
|
|
74275
|
+
value: _vm.inputType,
|
|
74276
|
+
callback: function ($$v) {
|
|
74277
|
+
_vm.inputType = $$v;
|
|
74278
|
+
},
|
|
74279
|
+
expression: "inputType"
|
|
74280
|
+
}
|
|
74281
|
+
}, [_vm._v("ID")]), _c('el-radio', {
|
|
74282
|
+
attrs: {
|
|
74283
|
+
"label": 'name'
|
|
74284
|
+
},
|
|
74285
|
+
model: {
|
|
74286
|
+
value: _vm.inputType,
|
|
74287
|
+
callback: function ($$v) {
|
|
74288
|
+
_vm.inputType = $$v;
|
|
74289
|
+
},
|
|
74290
|
+
expression: "inputType"
|
|
74291
|
+
}
|
|
74292
|
+
}, [_vm._v("名称")])], 1), _c('el-input', {
|
|
74293
|
+
staticClass: "batch-input-textarea",
|
|
74294
|
+
attrs: {
|
|
74295
|
+
"type": "textarea",
|
|
74296
|
+
"rows": 10,
|
|
74297
|
+
"placeholder": _vm.inputType === 'id' ? '请输入ID,多个ID用换行、逗号、分号、空格分隔' : '请输入名称,多个名称用换行、逗号、分号、空格分隔'
|
|
74298
|
+
},
|
|
74299
|
+
model: {
|
|
74300
|
+
value: _vm.batchInputContent,
|
|
74301
|
+
callback: function ($$v) {
|
|
74302
|
+
_vm.batchInputContent = $$v;
|
|
74303
|
+
},
|
|
74304
|
+
expression: "batchInputContent"
|
|
74305
|
+
}
|
|
74306
|
+
}), _c('div', {
|
|
74307
|
+
staticClass: "popover-footer"
|
|
74308
|
+
}, [_c('el-button', {
|
|
74309
|
+
attrs: {
|
|
74310
|
+
"size": "mini"
|
|
74311
|
+
},
|
|
74312
|
+
on: {
|
|
74313
|
+
"click": function ($event) {
|
|
74314
|
+
_vm.popoverVisible = false;
|
|
74315
|
+
}
|
|
74316
|
+
}
|
|
74317
|
+
}, [_vm._v("取消")]), _c('el-button', {
|
|
74318
|
+
attrs: {
|
|
74319
|
+
"size": "mini",
|
|
74320
|
+
"type": "primary"
|
|
74321
|
+
},
|
|
74322
|
+
on: {
|
|
74323
|
+
"click": _vm.handleBatchInput
|
|
74324
|
+
}
|
|
74325
|
+
}, [_vm._v("确定")])], 1)], 1), _c('el-button', {
|
|
74326
|
+
staticClass: "batch-input-btn",
|
|
74327
|
+
attrs: {
|
|
74328
|
+
"slot": "reference",
|
|
74329
|
+
"disabled": _vm.disabled || _vm.loading,
|
|
74330
|
+
"size": _vm.size
|
|
74331
|
+
},
|
|
74332
|
+
slot: "reference"
|
|
74333
|
+
}, [_c('i', {
|
|
74334
|
+
staticClass: "el-icon-edit-outline",
|
|
74335
|
+
staticStyle: {
|
|
74336
|
+
"transform": "scale(2)",
|
|
74337
|
+
"display": "inline-block"
|
|
74338
|
+
}
|
|
74339
|
+
})])], 1)], 1)]);
|
|
74340
|
+
};
|
|
74341
|
+
var BatchQuerySelectorvue_type_template_id_62af8083_staticRenderFns = [];
|
|
74342
|
+
|
|
74343
|
+
;// ./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
|
|
74344
|
+
|
|
74345
|
+
|
|
74346
|
+
|
|
74347
|
+
|
|
74348
|
+
|
|
74349
|
+
|
|
74350
|
+
|
|
74351
|
+
|
|
74352
|
+
|
|
74353
|
+
|
|
74354
|
+
/* harmony default export */ var BatchQuerySelectorvue_type_script_lang_js = ({
|
|
74355
|
+
name: 'BatchQuerySelector',
|
|
74356
|
+
props: {
|
|
74357
|
+
// 绑定值
|
|
74358
|
+
value: {
|
|
74359
|
+
type: [Array, String, Number],
|
|
74360
|
+
default: () => []
|
|
74361
|
+
},
|
|
74362
|
+
// 数据源
|
|
74363
|
+
options: {
|
|
74364
|
+
type: Array,
|
|
74365
|
+
default: () => []
|
|
74366
|
+
},
|
|
74367
|
+
// 异步加载数据源
|
|
74368
|
+
loadOptions: {
|
|
74369
|
+
type: Function,
|
|
74370
|
+
default: null
|
|
74371
|
+
},
|
|
74372
|
+
// 是否自动加载数据(首次获取焦点时)
|
|
74373
|
+
autoLoad: {
|
|
74374
|
+
type: Boolean,
|
|
74375
|
+
default: true
|
|
74376
|
+
},
|
|
74377
|
+
// 值字段名
|
|
74378
|
+
valueKey: {
|
|
74379
|
+
type: String,
|
|
74380
|
+
default: 'id'
|
|
74381
|
+
},
|
|
74382
|
+
// 标签字段名
|
|
74383
|
+
labelKey: {
|
|
74384
|
+
type: String,
|
|
74385
|
+
default: 'name'
|
|
74386
|
+
},
|
|
74387
|
+
// 禁用字段名,用于判断选项是否禁用
|
|
74388
|
+
disabledKey: {
|
|
74389
|
+
type: String,
|
|
74390
|
+
default: 'disabled'
|
|
74391
|
+
},
|
|
74392
|
+
// 禁用条件,自定义函数判断选项是否禁用
|
|
74393
|
+
disabledMethod: {
|
|
74394
|
+
type: Function,
|
|
74395
|
+
default: null
|
|
74396
|
+
},
|
|
74397
|
+
// 是否多选
|
|
74398
|
+
multiple: {
|
|
74399
|
+
type: Boolean,
|
|
74400
|
+
default: true
|
|
74401
|
+
},
|
|
74402
|
+
// 是否折叠标签
|
|
74403
|
+
collapseTags: {
|
|
74404
|
+
type: Boolean,
|
|
74405
|
+
default: true
|
|
74406
|
+
},
|
|
74407
|
+
// 占位符
|
|
74408
|
+
placeholder: {
|
|
74409
|
+
type: String,
|
|
74410
|
+
default: '请选择'
|
|
74411
|
+
},
|
|
74412
|
+
// 是否禁用
|
|
74413
|
+
disabled: {
|
|
74414
|
+
type: Boolean,
|
|
74415
|
+
default: false
|
|
74416
|
+
},
|
|
74417
|
+
// 是否可清空
|
|
74418
|
+
clearable: {
|
|
74419
|
+
type: Boolean,
|
|
74420
|
+
default: true
|
|
74421
|
+
},
|
|
74422
|
+
// 大小
|
|
74423
|
+
size: {
|
|
74424
|
+
type: String,
|
|
74425
|
+
default: 'mini'
|
|
74426
|
+
},
|
|
74427
|
+
// 最大宽度,默认为100%(充满容器宽度)
|
|
74428
|
+
maxWidth: {
|
|
74429
|
+
type: [String, Number],
|
|
74430
|
+
default: '100%'
|
|
74431
|
+
},
|
|
74432
|
+
// 弹窗宽度
|
|
74433
|
+
popoverWidth: {
|
|
74434
|
+
type: [String, Number],
|
|
74435
|
+
default: '300'
|
|
74436
|
+
},
|
|
74437
|
+
// 自定义映射函数,用于处理批量输入后的映射逻辑
|
|
74438
|
+
customMapFunction: {
|
|
74439
|
+
type: Function,
|
|
74440
|
+
default: null
|
|
74441
|
+
}
|
|
74442
|
+
},
|
|
74443
|
+
data() {
|
|
74444
|
+
return {
|
|
74445
|
+
selectedValues: [],
|
|
74446
|
+
popoverVisible: false,
|
|
74447
|
+
inputType: 'id',
|
|
74448
|
+
batchInputContent: '',
|
|
74449
|
+
optionsList: [],
|
|
74450
|
+
loading: false,
|
|
74451
|
+
hasLoaded: false
|
|
74452
|
+
};
|
|
74453
|
+
},
|
|
74454
|
+
computed: {
|
|
74455
|
+
hasInitialValue() {
|
|
74456
|
+
if (this.multiple) {
|
|
74457
|
+
return Array.isArray(this.value) && this.value.length > 0;
|
|
74458
|
+
}
|
|
74459
|
+
return this.value !== null && this.value !== undefined && this.value !== '';
|
|
74460
|
+
},
|
|
74461
|
+
containerStyle() {
|
|
74462
|
+
// 处理maxWidth属性,支持数字(自动添加px)或字符串
|
|
74463
|
+
const width = typeof this.maxWidth === 'number' ? `${this.maxWidth}px` : this.maxWidth;
|
|
74464
|
+
return {
|
|
74465
|
+
maxWidth: width
|
|
74466
|
+
};
|
|
74467
|
+
}
|
|
74468
|
+
},
|
|
74469
|
+
watch: {
|
|
74470
|
+
value: {
|
|
74471
|
+
handler(val) {
|
|
74472
|
+
this.selectedValues = this.multiple ? [...(Array.isArray(val) ? val : [])] : val;
|
|
74473
|
+
},
|
|
74474
|
+
immediate: true
|
|
74475
|
+
},
|
|
74476
|
+
options: {
|
|
74477
|
+
handler(val) {
|
|
74478
|
+
this.optionsList = [...val];
|
|
74479
|
+
},
|
|
74480
|
+
immediate: true
|
|
74481
|
+
}
|
|
74482
|
+
},
|
|
74483
|
+
created() {
|
|
74484
|
+
// 如果有初始值且提供了loadOptions方法,但没有提供options,则自动加载数据
|
|
74485
|
+
if (this.hasInitialValue && this.loadOptions && !this.options.length) {
|
|
74486
|
+
this.fetchOptions();
|
|
74487
|
+
}
|
|
74488
|
+
},
|
|
74489
|
+
methods: {
|
|
74490
|
+
// 判断选项是否禁用
|
|
74491
|
+
isOptionDisabled(option) {
|
|
74492
|
+
// 如果提供了自定义禁用方法,则使用自定义方法判断
|
|
74493
|
+
if (this.disabledMethod) {
|
|
74494
|
+
return this.disabledMethod(option);
|
|
74495
|
+
}
|
|
74496
|
+
|
|
74497
|
+
// 否则根据禁用字段名判断
|
|
74498
|
+
return !!option[this.disabledKey];
|
|
74499
|
+
},
|
|
74500
|
+
// 处理选择变化
|
|
74501
|
+
handleChange(val) {
|
|
74502
|
+
this.$emit('input', val);
|
|
74503
|
+
this.$emit('change', val);
|
|
74504
|
+
},
|
|
74505
|
+
// 处理获取焦点
|
|
74506
|
+
handleFocus() {
|
|
74507
|
+
// 如果配置了自动加载且提供了loadOptions方法,每次获取焦点时都加载数据
|
|
74508
|
+
if (this.autoLoad && this.loadOptions) {
|
|
74509
|
+
this.fetchOptions();
|
|
74510
|
+
}
|
|
74511
|
+
},
|
|
74512
|
+
// 获取选项数据
|
|
74513
|
+
async fetchOptions(params) {
|
|
74514
|
+
if (!this.loadOptions) return;
|
|
74515
|
+
try {
|
|
74516
|
+
this.loading = true;
|
|
74517
|
+
const result = await this.loadOptions(params);
|
|
74518
|
+
if (Array.isArray(result)) {
|
|
74519
|
+
this.optionsList = result;
|
|
74520
|
+
} else {
|
|
74521
|
+
console.warn('【BatchQuerySelector组件】: loadOptions 应该返回一个数组');
|
|
74522
|
+
}
|
|
74523
|
+
this.hasLoaded = true;
|
|
74524
|
+
this.$emit('options-loaded', this.optionsList);
|
|
74525
|
+
} catch (error) {
|
|
74526
|
+
this.$emit('options-load-error', error);
|
|
74527
|
+
} finally {
|
|
74528
|
+
this.loading = false;
|
|
74529
|
+
}
|
|
74530
|
+
},
|
|
74531
|
+
// 手动刷新选项
|
|
74532
|
+
refreshOptions(params) {
|
|
74533
|
+
return this.fetchOptions(params);
|
|
74534
|
+
},
|
|
74535
|
+
// 处理批量输入
|
|
74536
|
+
handleBatchInput() {
|
|
74537
|
+
if (!this.batchInputContent.trim()) {
|
|
74538
|
+
this.popoverVisible = false;
|
|
74539
|
+
return;
|
|
74540
|
+
}
|
|
74541
|
+
|
|
74542
|
+
// 分割输入内容(支持换行、逗号、分号等分隔符)
|
|
74543
|
+
const inputValues = this.batchInputContent.split(/[\n,;,;\s]+/).filter(item => item.trim()).map(item => item.trim());
|
|
74544
|
+
if (inputValues.length === 0) {
|
|
74545
|
+
this.popoverVisible = false;
|
|
74546
|
+
return;
|
|
74547
|
+
}
|
|
74548
|
+
|
|
74549
|
+
// 根据输入类型匹配数据
|
|
74550
|
+
let matchedValues = [];
|
|
74551
|
+
if (this.customMapFunction) {
|
|
74552
|
+
// 使用自定义映射函数
|
|
74553
|
+
matchedValues = this.customMapFunction(inputValues, this.inputType, this.options);
|
|
74554
|
+
} else {
|
|
74555
|
+
// 默认映射逻辑
|
|
74556
|
+
const searchKey = this.inputType === 'id' ? this.valueKey : this.labelKey;
|
|
74557
|
+
const resultKey = this.valueKey;
|
|
74558
|
+
matchedValues = this.optionsList.filter(item => {
|
|
74559
|
+
// 排除禁用的选项
|
|
74560
|
+
if (this.isOptionDisabled(item)) {
|
|
74561
|
+
return false;
|
|
74562
|
+
}
|
|
74563
|
+
return inputValues.includes(String(item[searchKey]));
|
|
74564
|
+
}).map(item => item[resultKey]);
|
|
74565
|
+
}
|
|
74566
|
+
|
|
74567
|
+
// 更新选中值
|
|
74568
|
+
if (this.multiple) {
|
|
74569
|
+
// 多选模式,合并已选和新匹配的值,去重
|
|
74570
|
+
const newValues = [...new Set([...this.selectedValues, ...matchedValues])];
|
|
74571
|
+
this.selectedValues = newValues;
|
|
74572
|
+
this.$emit('input', newValues);
|
|
74573
|
+
this.$emit('change', newValues);
|
|
74574
|
+
} else {
|
|
74575
|
+
// 单选模式,只取第一个匹配值
|
|
74576
|
+
if (matchedValues.length > 0) {
|
|
74577
|
+
this.selectedValues = matchedValues[0];
|
|
74578
|
+
this.$emit('input', matchedValues[0]);
|
|
74579
|
+
this.$emit('change', matchedValues[0]);
|
|
74580
|
+
}
|
|
74581
|
+
}
|
|
74582
|
+
|
|
74583
|
+
// 关闭弹出框
|
|
74584
|
+
this.popoverVisible = false;
|
|
74585
|
+
this.batchInputContent = '';
|
|
74586
|
+
|
|
74587
|
+
// 触发批量输入完成事件
|
|
74588
|
+
this.$emit('batch-input-complete', {
|
|
74589
|
+
inputValues,
|
|
74590
|
+
matchedValues,
|
|
74591
|
+
type: this.inputType
|
|
74592
|
+
});
|
|
74593
|
+
}
|
|
74594
|
+
}
|
|
74595
|
+
});
|
|
74596
|
+
;// ./src/components/batch-query-selector/BatchQuerySelector.vue?vue&type=script&lang=js
|
|
74597
|
+
/* harmony default export */ var batch_query_selector_BatchQuerySelectorvue_type_script_lang_js = (BatchQuerySelectorvue_type_script_lang_js);
|
|
74598
|
+
;// ./src/components/batch-query-selector/BatchQuerySelector.vue
|
|
74599
|
+
|
|
74600
|
+
|
|
74601
|
+
|
|
74602
|
+
|
|
74603
|
+
|
|
74604
|
+
/* normalize component */
|
|
74605
|
+
;
|
|
74606
|
+
var BatchQuerySelector_component = normalizeComponent(
|
|
74607
|
+
batch_query_selector_BatchQuerySelectorvue_type_script_lang_js,
|
|
74608
|
+
BatchQuerySelectorvue_type_template_id_62af8083_render,
|
|
74609
|
+
BatchQuerySelectorvue_type_template_id_62af8083_staticRenderFns,
|
|
74610
|
+
false,
|
|
74611
|
+
null,
|
|
74612
|
+
null,
|
|
74613
|
+
null
|
|
74614
|
+
|
|
74615
|
+
)
|
|
74616
|
+
|
|
74617
|
+
/* harmony default export */ var BatchQuerySelector = (BatchQuerySelector_component.exports);
|
|
74171
74618
|
;// ./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/form/form.vue?vue&type=script&lang=js
|
|
74172
74619
|
|
|
74173
74620
|
|
|
@@ -74175,12 +74622,14 @@ var ByCommonSelector_component = normalizeComponent(
|
|
|
74175
74622
|
|
|
74176
74623
|
|
|
74177
74624
|
|
|
74625
|
+
|
|
74178
74626
|
/* harmony default export */ var formvue_type_script_lang_js = ({
|
|
74179
74627
|
name: 'ByForm',
|
|
74180
74628
|
components: {
|
|
74181
74629
|
PairNumberInput: pair_number_input,
|
|
74182
74630
|
CustomDatePicker: custom_date_picker,
|
|
74183
|
-
ByCommonSelector: ByCommonSelector
|
|
74631
|
+
ByCommonSelector: ByCommonSelector,
|
|
74632
|
+
ByBatchQuerySelector: BatchQuerySelector
|
|
74184
74633
|
},
|
|
74185
74634
|
props: {
|
|
74186
74635
|
value: {
|
|
@@ -74425,15 +74874,37 @@ var ByCommonSelector_component = normalizeComponent(
|
|
|
74425
74874
|
error,
|
|
74426
74875
|
item
|
|
74427
74876
|
});
|
|
74877
|
+
},
|
|
74878
|
+
// 批量查询选择器相关事件处理
|
|
74879
|
+
handleBatchSelectorOptionsLoaded(options, item) {
|
|
74880
|
+
// 批量查询选择器异步加载成功
|
|
74881
|
+
this.$emit('batch-selector-options-loaded', {
|
|
74882
|
+
options,
|
|
74883
|
+
item
|
|
74884
|
+
});
|
|
74885
|
+
},
|
|
74886
|
+
handleBatchSelectorOptionsLoadError(error, item) {
|
|
74887
|
+
// 批量查询选择器异步加载失败
|
|
74888
|
+
this.$emit('batch-selector-options-error', {
|
|
74889
|
+
error,
|
|
74890
|
+
item
|
|
74891
|
+
});
|
|
74892
|
+
},
|
|
74893
|
+
handleBatchInputComplete(data, item) {
|
|
74894
|
+
// 批量输入完成事件
|
|
74895
|
+
this.$emit('batch-input-complete', {
|
|
74896
|
+
...data,
|
|
74897
|
+
item
|
|
74898
|
+
});
|
|
74428
74899
|
}
|
|
74429
74900
|
}
|
|
74430
74901
|
});
|
|
74431
74902
|
;// ./src/components/form/form.vue?vue&type=script&lang=js
|
|
74432
74903
|
/* harmony default export */ var form_formvue_type_script_lang_js = (formvue_type_script_lang_js);
|
|
74433
|
-
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[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/form/form.vue?vue&type=style&index=0&id=
|
|
74904
|
+
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[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/form/form.vue?vue&type=style&index=0&id=c208c726&prod&lang=scss&scoped=true
|
|
74434
74905
|
// extracted by mini-css-extract-plugin
|
|
74435
74906
|
|
|
74436
|
-
;// ./src/components/form/form.vue?vue&type=style&index=0&id=
|
|
74907
|
+
;// ./src/components/form/form.vue?vue&type=style&index=0&id=c208c726&prod&lang=scss&scoped=true
|
|
74437
74908
|
|
|
74438
74909
|
;// ./src/components/form/form.vue
|
|
74439
74910
|
|
|
@@ -74446,11 +74917,11 @@ var ByCommonSelector_component = normalizeComponent(
|
|
|
74446
74917
|
|
|
74447
74918
|
var form_component = normalizeComponent(
|
|
74448
74919
|
form_formvue_type_script_lang_js,
|
|
74449
|
-
|
|
74450
|
-
|
|
74920
|
+
formvue_type_template_id_c208c726_scoped_true_render,
|
|
74921
|
+
formvue_type_template_id_c208c726_scoped_true_staticRenderFns,
|
|
74451
74922
|
false,
|
|
74452
74923
|
null,
|
|
74453
|
-
"
|
|
74924
|
+
"c208c726",
|
|
74454
74925
|
null
|
|
74455
74926
|
|
|
74456
74927
|
)
|
|
@@ -75582,6 +76053,7 @@ updateVar();
|
|
|
75582
76053
|
|
|
75583
76054
|
|
|
75584
76055
|
|
|
76056
|
+
|
|
75585
76057
|
const components = {
|
|
75586
76058
|
ByPager: pager,
|
|
75587
76059
|
ByTable: table,
|
|
@@ -75592,7 +76064,8 @@ const components = {
|
|
|
75592
76064
|
ByDatePickerRange: date_picker_range,
|
|
75593
76065
|
ByCustomDatePicker: custom_date_picker,
|
|
75594
76066
|
ByToolBar: ByToolBar,
|
|
75595
|
-
ByCommonSelector: ByCommonSelector
|
|
76067
|
+
ByCommonSelector: ByCommonSelector,
|
|
76068
|
+
ByBatchQuerySelector: BatchQuerySelector
|
|
75596
76069
|
};
|
|
75597
76070
|
|
|
75598
76071
|
// 设置当前 z-index 起始值
|