backend-management-ui 1.7.8 → 1.7.10
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/README.md +54 -20
- package/index.common.js +82 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
一个基于 ElementUI 封装的 Vue2 后台管理组件库,简化后台开发中表格、表单、弹窗、按钮组、虚拟下拉框等高频组件的使用。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
现有组件:ui-form、ui-table、ui-btns、ui-dialog、ui-virtual-select、status
|
|
6
6
|
|
|
7
7
|
## 特性
|
|
8
8
|
- 基于ElementUI的二次封装,完全兼容ElementUI原有API与功能,无需额外适配
|
|
@@ -465,28 +465,11 @@ import { statusApi } from "@/api/status"
|
|
|
465
465
|
|
|
466
466
|
-------------------------------
|
|
467
467
|
|
|
468
|
-
### Status
|
|
469
|
-
|
|
470
|
-
基本用法
|
|
471
|
-
|
|
472
|
-
```js
|
|
473
|
-
<Status status-name="待提交" />
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
#### props
|
|
477
|
-
|
|
478
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
479
|
-
| -------- | ----------- | -------- | ------ | --------- |
|
|
480
|
-
| row | 传进来的整条数据 | object | - | {} |
|
|
481
|
-
| statusName | 状态值,当row有传值时这个字段会被当做字段名 | string | 必传 | -|
|
|
482
|
-
|
|
483
|
-
-------------------------------
|
|
484
|
-
|
|
485
468
|
### ui-dialog
|
|
486
469
|
|
|
487
470
|
使用el-dialog进行的二次封装
|
|
488
471
|
|
|
489
|
-
基本用法
|
|
472
|
+
#### 基本用法
|
|
490
473
|
|
|
491
474
|
```js
|
|
492
475
|
<ui-dialog
|
|
@@ -546,6 +529,57 @@ import { statusApi } from "@/api/status"
|
|
|
546
529
|
|
|
547
530
|
-----------------------------------
|
|
548
531
|
|
|
532
|
+
### ui-virtual-select
|
|
533
|
+
使用 el-select + vue-virtual-scroll-list 进行的二次封装
|
|
534
|
+
|
|
535
|
+
#### 基本用法
|
|
536
|
+
|
|
537
|
+
```js
|
|
538
|
+
<ui-virtual-select v-model="select" multiple filterable :options="options"/>
|
|
539
|
+
|
|
540
|
+
<script>
|
|
541
|
+
export default {
|
|
542
|
+
data() {
|
|
543
|
+
return {
|
|
544
|
+
select: []
|
|
545
|
+
options: Array.from({ length: 1000 }, (_, index) => ({ label: `${index + 1}虚拟滚动数据`, value: index + 1 }))
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
</script>
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
#### props
|
|
553
|
+
|
|
554
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
555
|
+
| -------- | ----------- | -------- | ------ | --------- |
|
|
556
|
+
| value | 绑定的值 | string/number/array | - | - |
|
|
557
|
+
| keeps | 下拉默认展示的个数 | number | - | 20 |
|
|
558
|
+
| estimateSize | 下拉每项的高度 | number | - | 34 |
|
|
559
|
+
| options | 下拉的数据 | array | - | 默认label/value类型的二维数组 |
|
|
560
|
+
| 其他参数同el-select | - | - | - | - |
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
### 公共业务组件
|
|
564
|
+
|
|
565
|
+
#### Status
|
|
566
|
+
|
|
567
|
+
基本用法
|
|
568
|
+
|
|
569
|
+
```js
|
|
570
|
+
<Status status-name="待提交" />
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
##### props
|
|
574
|
+
|
|
575
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
576
|
+
| -------- | ----------- | -------- | ------ | --------- |
|
|
577
|
+
| row | 传进来的整条数据 | object | - | {} |
|
|
578
|
+
| statusName | 状态值,当row有传值时这个字段会被当做字段名 | string | 必传 | -|
|
|
579
|
+
|
|
580
|
+
-------------------------------
|
|
581
|
+
|
|
582
|
+
|
|
549
583
|
## 使用时可能存在的项目不支持可选链和空值合并运算符的报错问题
|
|
550
584
|
|
|
551
585
|
安装必要的依赖
|
|
@@ -571,4 +605,4 @@ module.exports = {
|
|
|
571
605
|
..., // 原有配置
|
|
572
606
|
transpileDependencies: ["backend-management-ui"]
|
|
573
607
|
}
|
|
574
|
-
```
|
|
608
|
+
```
|
package/index.common.js
CHANGED
|
@@ -82,10 +82,10 @@ var _deepcopy = function deepcopy(obj) {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol__default["default"] && _getIteratorMethod__default["default"](r) || r["@@iterator"]; if (!t) { if (_Array$isArray__default["default"](r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
85
|
-
function _unsupportedIterableToArray(r, a) { if (r) { var
|
|
85
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context0; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty__default["default"](_context0 = {}.toString.call(r)).call(_context0, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from__default["default"](r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
86
86
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
87
|
-
function ownKeys$
|
|
88
|
-
function _objectSpread$
|
|
87
|
+
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
88
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$2(Object(t), !0)).call(_context8, function (r) { _defineProperty__default["default"](e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$2(Object(t))).call(_context9, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
89
89
|
/**
|
|
90
90
|
* @desc 表单组件
|
|
91
91
|
* @params formRef ref
|
|
@@ -98,7 +98,8 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _
|
|
|
98
98
|
var componentMap = {
|
|
99
99
|
input: "el-input",
|
|
100
100
|
select: "el-select",
|
|
101
|
-
|
|
101
|
+
'date-picker': "el-date-picker",
|
|
102
|
+
'virtual-select': "ui-virtual-select"
|
|
102
103
|
};
|
|
103
104
|
var script$6 = {
|
|
104
105
|
name: "UiForm",
|
|
@@ -168,22 +169,22 @@ var script$6 = {
|
|
|
168
169
|
return componentMap[componentName] || componentName || "el-input";
|
|
169
170
|
},
|
|
170
171
|
handleBindAttrs: function handleBindAttrs(item) {
|
|
171
|
-
var _item$attrs, _context, _context2;
|
|
172
|
+
var _item$attrs, _context, _context2, _context3;
|
|
172
173
|
var style = {
|
|
173
174
|
width: ((_item$attrs = item.attrs) === null || _item$attrs === void 0 ? void 0 : _item$attrs.width) || "220px"
|
|
174
175
|
};
|
|
175
176
|
var placeholder = "";
|
|
176
177
|
var componentName = this.getComponentName(item.component);
|
|
177
|
-
var isSelectLike = _includesInstanceProperty__default["default"](_context = ["el-select", "select", "el-date-picker", "ui-virtual-select"]).call(_context, componentName);
|
|
178
|
+
var isSelectLike = _includesInstanceProperty__default["default"](_context = ["el-select", "select", "el-date-picker", "ui-virtual-select", "virtual-select"]).call(_context, componentName);
|
|
178
179
|
var isInputLike = _includesInstanceProperty__default["default"](_context2 = ["el-input", "input"]).call(_context2, componentName);
|
|
179
180
|
placeholder = isSelectLike ? "\u8BF7\u9009\u62E9".concat(item.label) : isInputLike ? "\u8BF7\u8F93\u5165".concat(item.label) : "";
|
|
180
|
-
var baseAttrs = _objectSpread$
|
|
181
|
+
var baseAttrs = _objectSpread$2({
|
|
181
182
|
style: style,
|
|
182
183
|
placeholder: placeholder,
|
|
183
184
|
clearable: true
|
|
184
185
|
}, item.attrs || {});
|
|
185
|
-
if (
|
|
186
|
-
return _objectSpread$
|
|
186
|
+
if (_includesInstanceProperty__default["default"](_context3 = ["ui-virtual-select", "virtual-select"]).call(_context3, componentName)) {
|
|
187
|
+
return _objectSpread$2(_objectSpread$2({}, baseAttrs), {}, {
|
|
187
188
|
options: item.options || [],
|
|
188
189
|
fields: item.fields || {
|
|
189
190
|
label: 'label',
|
|
@@ -194,28 +195,29 @@ var script$6 = {
|
|
|
194
195
|
return baseAttrs;
|
|
195
196
|
},
|
|
196
197
|
isSelectComponent: function isSelectComponent(componentName) {
|
|
197
|
-
var
|
|
198
|
-
return _includesInstanceProperty__default["default"](
|
|
198
|
+
var _context4;
|
|
199
|
+
return _includesInstanceProperty__default["default"](_context4 = ["el-select", "select"]).call(_context4, this.getComponentName(componentName));
|
|
199
200
|
},
|
|
200
201
|
isRadioGroupComponent: function isRadioGroupComponent(componentName) {
|
|
201
202
|
return this.getComponentName(componentName) === "el-radio-group";
|
|
202
203
|
},
|
|
203
204
|
isVirtualSelectComponent: function isVirtualSelectComponent(componentName) {
|
|
204
|
-
|
|
205
|
+
var _context5;
|
|
206
|
+
return _includesInstanceProperty__default["default"](_context5 = ["ui-virtual-select", "virtual-select"]).call(_context5, componentName);
|
|
205
207
|
},
|
|
206
208
|
initOptions: function initOptions() {
|
|
207
209
|
var _this = this;
|
|
208
210
|
return _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
209
211
|
var _iterator, _step, _item$options, item, apiConfig, optionsRequired, _ref, url, _ref$params, params, res, options, _t2;
|
|
210
|
-
return _regeneratorRuntime__default["default"].wrap(function (
|
|
211
|
-
while (1) switch (
|
|
212
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context6) {
|
|
213
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
212
214
|
case 0:
|
|
213
215
|
_iterator = _createForOfIteratorHelper(_this.tempFormConfig);
|
|
214
|
-
|
|
216
|
+
_context6.prev = 1;
|
|
215
217
|
_iterator.s();
|
|
216
218
|
case 2:
|
|
217
219
|
if ((_step = _iterator.n()).done) {
|
|
218
|
-
|
|
220
|
+
_context6.next = 7;
|
|
219
221
|
break;
|
|
220
222
|
}
|
|
221
223
|
item = _step.value;
|
|
@@ -223,42 +225,42 @@ var script$6 = {
|
|
|
223
225
|
apiConfig = item.api || _this.apiMapConfig[item.prop];
|
|
224
226
|
optionsRequired = _this.isSelectComponent(item.component) || _this.isRadioGroupComponent(item.component) || _this.isVirtualSelectComponent(item.component);
|
|
225
227
|
if (!(optionsRequired && apiConfig && !((_item$options = item.options) !== null && _item$options !== void 0 && _item$options.length))) {
|
|
226
|
-
|
|
228
|
+
_context6.next = 6;
|
|
227
229
|
break;
|
|
228
230
|
}
|
|
229
|
-
|
|
231
|
+
_context6.prev = 3;
|
|
230
232
|
_ref = typeof apiConfig === "function" ? {
|
|
231
233
|
url: apiConfig
|
|
232
234
|
} : apiConfig, url = _ref.url, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
|
|
233
|
-
|
|
235
|
+
_context6.next = 4;
|
|
234
236
|
return url(params);
|
|
235
237
|
case 4:
|
|
236
|
-
res =
|
|
238
|
+
res = _context6.sent;
|
|
237
239
|
options = item.format ? item.format(res) : (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
238
240
|
_this.$set(item, "options", options);
|
|
239
|
-
|
|
241
|
+
_context6.next = 6;
|
|
240
242
|
break;
|
|
241
243
|
case 5:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
_context6.prev = 5;
|
|
245
|
+
_context6["catch"](3);
|
|
244
246
|
_this.$set(item, "options", []);
|
|
245
247
|
case 6:
|
|
246
|
-
|
|
248
|
+
_context6.next = 2;
|
|
247
249
|
break;
|
|
248
250
|
case 7:
|
|
249
|
-
|
|
251
|
+
_context6.next = 9;
|
|
250
252
|
break;
|
|
251
253
|
case 8:
|
|
252
|
-
|
|
253
|
-
_t2 =
|
|
254
|
+
_context6.prev = 8;
|
|
255
|
+
_t2 = _context6["catch"](1);
|
|
254
256
|
_iterator.e(_t2);
|
|
255
257
|
case 9:
|
|
256
|
-
|
|
258
|
+
_context6.prev = 9;
|
|
257
259
|
_iterator.f();
|
|
258
|
-
return
|
|
260
|
+
return _context6.finish(9);
|
|
259
261
|
case 10:
|
|
260
262
|
case "end":
|
|
261
|
-
return
|
|
263
|
+
return _context6.stop();
|
|
262
264
|
}
|
|
263
265
|
}, _callee, null, [[1, 8, 9, 10], [3, 5]]);
|
|
264
266
|
}))();
|
|
@@ -268,9 +270,9 @@ var script$6 = {
|
|
|
268
270
|
this.$emit("reset");
|
|
269
271
|
},
|
|
270
272
|
getOptions: function getOptions() {
|
|
271
|
-
var
|
|
273
|
+
var _context7;
|
|
272
274
|
var propOptionsMap = {};
|
|
273
|
-
_forEachInstanceProperty__default["default"](
|
|
275
|
+
_forEachInstanceProperty__default["default"](_context7 = this.tempFormConfig).call(_context7, function (row) {
|
|
274
276
|
if (row.options) {
|
|
275
277
|
propOptionsMap[row.prop] = row.options;
|
|
276
278
|
}
|
|
@@ -447,8 +449,8 @@ var __vue_component__$6 = /*#__PURE__*/normalizeComponent({
|
|
|
447
449
|
staticRenderFns: __vue_staticRenderFns__$6
|
|
448
450
|
}, __vue_inject_styles__$6, __vue_script__$6, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, false, undefined, undefined, undefined);
|
|
449
451
|
|
|
450
|
-
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
451
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty__default["default"](e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
452
|
+
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
453
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(t), !0)).call(_context3, function (r) { _defineProperty__default["default"](e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
452
454
|
//
|
|
453
455
|
//
|
|
454
456
|
//
|
|
@@ -644,7 +646,7 @@ var script$5 = {
|
|
|
644
646
|
fixed: "right",
|
|
645
647
|
align: "center"
|
|
646
648
|
};
|
|
647
|
-
return _objectSpread(_objectSpread({}, defaultConfig), this.operationConfig);
|
|
649
|
+
return _objectSpread$1(_objectSpread$1({}, defaultConfig), this.operationConfig);
|
|
648
650
|
}
|
|
649
651
|
},
|
|
650
652
|
methods: {
|
|
@@ -658,7 +660,7 @@ var script$5 = {
|
|
|
658
660
|
obj[key] = col[key];
|
|
659
661
|
}
|
|
660
662
|
});
|
|
661
|
-
return _objectSpread({
|
|
663
|
+
return _objectSpread$1({
|
|
662
664
|
align: "center"
|
|
663
665
|
}, obj);
|
|
664
666
|
},
|
|
@@ -705,14 +707,14 @@ var script$5 = {
|
|
|
705
707
|
},
|
|
706
708
|
handleSizeChange: function handleSizeChange(pageSize) {
|
|
707
709
|
this.$emit("change-size", pageSize);
|
|
708
|
-
this.$emit("change-pagination", _objectSpread(_objectSpread({}, this.paginationConfig), {}, {
|
|
710
|
+
this.$emit("change-pagination", _objectSpread$1(_objectSpread$1({}, this.paginationConfig), {}, {
|
|
709
711
|
pageSize: pageSize,
|
|
710
712
|
pageNum: 1
|
|
711
713
|
}));
|
|
712
714
|
},
|
|
713
715
|
handleCurrentChange: function handleCurrentChange(pageNum) {
|
|
714
716
|
this.$emit("change-page", pageNum);
|
|
715
|
-
this.$emit("change-pagination", _objectSpread(_objectSpread({}, this.paginationConfig), {}, {
|
|
717
|
+
this.$emit("change-pagination", _objectSpread$1(_objectSpread$1({}, this.paginationConfig), {}, {
|
|
716
718
|
pageNum: pageNum
|
|
717
719
|
}));
|
|
718
720
|
}
|
|
@@ -1353,6 +1355,12 @@ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
|
1353
1355
|
staticRenderFns: __vue_staticRenderFns__$1
|
|
1354
1356
|
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, createInjector, undefined, undefined);
|
|
1355
1357
|
|
|
1358
|
+
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1359
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t), !0)).call(_context6, function (r) { _defineProperty__default["default"](e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1360
|
+
var isEmptyObject = function isEmptyObject(obj) {
|
|
1361
|
+
if (!obj || _typeof__default["default"](obj) !== 'object' || _Array$isArray__default["default"](obj)) return false;
|
|
1362
|
+
return _Object$keys__default["default"](obj).length === 0;
|
|
1363
|
+
};
|
|
1356
1364
|
var script = {
|
|
1357
1365
|
name: 'UiVirtualSelect',
|
|
1358
1366
|
components: {
|
|
@@ -1370,10 +1378,22 @@ var script = {
|
|
|
1370
1378
|
"default": function _default() {
|
|
1371
1379
|
return {
|
|
1372
1380
|
label: 'label',
|
|
1373
|
-
value: 'value'
|
|
1381
|
+
value: 'value',
|
|
1382
|
+
rightLabel: ''
|
|
1374
1383
|
};
|
|
1375
1384
|
}
|
|
1376
1385
|
},
|
|
1386
|
+
keeps: {
|
|
1387
|
+
type: Number,
|
|
1388
|
+
"default": 20 // 默认展示的item个数
|
|
1389
|
+
},
|
|
1390
|
+
estimateSize: {
|
|
1391
|
+
type: Number,
|
|
1392
|
+
"default": 34 // 每个item的高度
|
|
1393
|
+
},
|
|
1394
|
+
extraProps: {
|
|
1395
|
+
type: Object
|
|
1396
|
+
},
|
|
1377
1397
|
value: {
|
|
1378
1398
|
type: [String, Number, Array],
|
|
1379
1399
|
"default": function _default() {
|
|
@@ -1398,6 +1418,23 @@ var script = {
|
|
|
1398
1418
|
innerValue: this.initInnerValue() // 内部维护选中值,避免直接修改props
|
|
1399
1419
|
};
|
|
1400
1420
|
},
|
|
1421
|
+
computed: {
|
|
1422
|
+
computedExtraProps: function computedExtraProps() {
|
|
1423
|
+
var emptyObject = isEmptyObject(this.extraProps);
|
|
1424
|
+
if (emptyObject) {
|
|
1425
|
+
return this.fields;
|
|
1426
|
+
} else {
|
|
1427
|
+
var _this$extraProps = this.extraProps,
|
|
1428
|
+
label = _this$extraProps.label,
|
|
1429
|
+
value = _this$extraProps.value,
|
|
1430
|
+
rightLabel = _this$extraProps.rightLabel;
|
|
1431
|
+
if (!label || !value || !rightLabel) {
|
|
1432
|
+
return this.fields;
|
|
1433
|
+
}
|
|
1434
|
+
return _objectSpread(_objectSpread({}, this.fields), this.extraProps);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1401
1438
|
watch: {
|
|
1402
1439
|
// 监听父组件v-model值变化,同步更新内部选中值
|
|
1403
1440
|
value: {
|
|
@@ -1562,13 +1599,9 @@ var __vue_render__ = function __vue_render__() {
|
|
|
1562
1599
|
"data-key": _vm.fields.value,
|
|
1563
1600
|
"data-sources": _vm.filteredData,
|
|
1564
1601
|
"data-component": _vm.itemComponent,
|
|
1565
|
-
"keeps":
|
|
1566
|
-
"extra-props":
|
|
1567
|
-
|
|
1568
|
-
value: _vm.fields.value,
|
|
1569
|
-
rightLabel: _vm.fields.rightLabel
|
|
1570
|
-
},
|
|
1571
|
-
"estimate-size": 34
|
|
1602
|
+
"keeps": _vm.keeps,
|
|
1603
|
+
"extra-props": _vm.computedExtraProps,
|
|
1604
|
+
"estimate-size": _vm.estimateSize
|
|
1572
1605
|
},
|
|
1573
1606
|
on: {
|
|
1574
1607
|
"item-click": _vm.handleItemClick
|
|
@@ -1580,14 +1613,14 @@ var __vue_staticRenderFns__ = [];
|
|
|
1580
1613
|
/* style */
|
|
1581
1614
|
var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
|
|
1582
1615
|
if (!inject) return;
|
|
1583
|
-
inject("data-v-
|
|
1584
|
-
source: ".select-wrap[data-v-
|
|
1616
|
+
inject("data-v-4ce656fa_0", {
|
|
1617
|
+
source: ".select-wrap[data-v-4ce656fa]{position:relative}.select-wrap .bm-select[data-v-4ce656fa]{width:100%}.virtual-select-popper[data-v-4ce656fa]{padding:0!important;border:1px solid #e4e7ed!important;border-radius:4px!important}.virtual-list[data-v-4ce656fa]{max-height:245px;overflow-y:auto;overflow-x:hidden!important;scrollbar-width:thin;scrollbar-color:#e4e7ed #f5f7fa}.virtual-list[data-v-4ce656fa]::-webkit-scrollbar{width:6px!important;display:block!important}.virtual-list[data-v-4ce656fa]::-webkit-scrollbar-thumb{background-color:#e4e7ed;border-radius:3px}.virtual-list[data-v-4ce656fa]::-webkit-scrollbar-track{background-color:#f5f7fa}[data-v-4ce656fa]:deep(.el-scrollbar__bar.is-vertical){display:none!important}",
|
|
1585
1618
|
map: undefined,
|
|
1586
1619
|
media: undefined
|
|
1587
1620
|
});
|
|
1588
1621
|
};
|
|
1589
1622
|
/* scoped */
|
|
1590
|
-
var __vue_scope_id__ = "data-v-
|
|
1623
|
+
var __vue_scope_id__ = "data-v-4ce656fa";
|
|
1591
1624
|
/* module identifier */
|
|
1592
1625
|
var __vue_module_identifier__ = undefined;
|
|
1593
1626
|
/* functional template */
|