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