backend-management-ui 1.7.11 → 1.7.12

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 CHANGED
@@ -378,7 +378,7 @@ export default {
378
378
  label: "测试5-可点击的单元格", // 默认active样式
379
379
  prop: "test5",
380
380
  width: 100,
381
- clickable: true, // 一直可点击
381
+ clickable: true, // 一直可点击 render形式、组件形式和插槽形式时不生效
382
382
 
383
383
  {/* 或者使用条件判断
384
384
  clickableClass: ({row}, col) => row[col.prop] > 0 */}
package/index.common.js CHANGED
@@ -28,7 +28,6 @@ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable
28
28
  var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
29
29
  var _toConsumableArray = require('@babel/runtime-corejs3/helpers/esm/toConsumableArray');
30
30
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
31
- var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
32
31
  var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
33
32
  var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
34
33
  var VueVirtualScrollList = require('vue-virtual-scroll-list');
@@ -61,7 +60,6 @@ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_s
61
60
  var _endsWithInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_endsWithInstanceProperty);
62
61
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
63
62
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_concatInstanceProperty);
64
- var _JSON$stringify__default = /*#__PURE__*/_interopDefaultLegacy(_JSON$stringify);
65
63
  var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_findIndexInstanceProperty);
66
64
  var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_spliceInstanceProperty);
67
65
  var VueVirtualScrollList__default = /*#__PURE__*/_interopDefaultLegacy(VueVirtualScrollList);
@@ -539,8 +537,9 @@ var renderNode = {
539
537
  },
540
538
  render: function render(h, ctx) {
541
539
  try {
542
- var render = ctx.render,
543
- params = ctx.params;
540
+ var _ctx$props = ctx.props,
541
+ render = _ctx$props.render,
542
+ params = _ctx$props.params;
544
543
  var vnode = render(params);
545
544
  return vnode || h('span', '');
546
545
  } catch (error) {
@@ -666,13 +665,14 @@ var script$5 = {
666
665
  },
667
666
  getRenderParams: function getRenderParams(scope) {
668
667
  return {
669
- row: scope.row,
668
+ row: scope.row || {},
670
669
  column: scope.column,
671
670
  $h: this.$createElement,
672
- index: scope.$index
671
+ index: scope.$index || 0
673
672
  };
674
673
  },
675
674
  getCellActiveClass: function getCellActiveClass(scope, col) {
675
+ if (col.clickable) return true;
676
676
  if (typeof col.clickableClass === "function") {
677
677
  return col.clickableClass(scope, col);
678
678
  }
@@ -875,14 +875,14 @@ var __vue_staticRenderFns__$5 = [];
875
875
  /* style */
876
876
  var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
877
877
  if (!inject) return;
878
- inject("data-v-071ee91e_0", {
879
- source: ".bm-table-container[data-v-071ee91e]{box-sizing:border-box}.bm-table-container .bm-pagination[data-v-071ee91e]{display:flex;justify-content:flex-end;margin-top:20px}.bm-table-container .bm-table-cell[data-v-071ee91e]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bm-table-container .bm-cell-active[data-v-071ee91e]{color:#02a7f0;cursor:pointer}.bm-table-container[data-v-071ee91e] :deep(.el-tablethead){color:#606266}",
878
+ inject("data-v-089a18c2_0", {
879
+ source: ".bm-table-container[data-v-089a18c2]{box-sizing:border-box}.bm-table-container .bm-pagination[data-v-089a18c2]{display:flex;justify-content:flex-end;margin-top:20px}.bm-table-container .bm-table-cell[data-v-089a18c2]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bm-table-container .bm-cell-active[data-v-089a18c2]{color:#02a7f0;cursor:pointer}.bm-table-container[data-v-089a18c2] :deep(.el-tablethead){color:#606266}",
880
880
  map: undefined,
881
881
  media: undefined
882
882
  });
883
883
  };
884
884
  /* scoped */
885
- var __vue_scope_id__$5 = "data-v-071ee91e";
885
+ var __vue_scope_id__$5 = "data-v-089a18c2";
886
886
  /* module identifier */
887
887
  var __vue_module_identifier__$5 = undefined;
888
888
  /* functional template */
@@ -1273,6 +1273,11 @@ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
1273
1273
  //
1274
1274
  //
1275
1275
  //
1276
+ //
1277
+ //
1278
+ //
1279
+ //
1280
+ //
1276
1281
 
1277
1282
  var script$1 = {
1278
1283
  name: 'UiVirtualSelectItem',
@@ -1281,6 +1286,9 @@ var script$1 = {
1281
1286
  type: Object,
1282
1287
  "default": function _default() {
1283
1288
  return {};
1289
+ },
1290
+ validator: function validator(val) {
1291
+ return _typeof__default["default"](val) === 'object' && val !== null && !_Array$isArray__default["default"](val);
1284
1292
  }
1285
1293
  },
1286
1294
  label: {
@@ -1296,11 +1304,17 @@ var script$1 = {
1296
1304
  "default": ''
1297
1305
  }
1298
1306
  },
1307
+ computed: {
1308
+ // 判断 source 是否有效(非空+包含必要属性)
1309
+ isValidSource: function isValidSource() {
1310
+ if (!this.source) return false;
1311
+ return this.label in this.source && this.value in this.source;
1312
+ }
1313
+ },
1299
1314
  methods: {
1300
- // 核心:点击选项时,向上传递选中值
1301
1315
  handleItemClick: function handleItemClick() {
1302
- var selectedValue = this.source[this.value];
1303
- // 触发自定义事件,将选中值传递给父组件
1316
+ if (!this.isValidSource) return;
1317
+ var selectedValue = this.source[this.value] || '';
1304
1318
  this.$emit('item-click', selectedValue);
1305
1319
  }
1306
1320
  }
@@ -1314,34 +1328,42 @@ var __vue_render__$1 = function __vue_render__() {
1314
1328
  var _vm = this;
1315
1329
  var _h = _vm.$createElement;
1316
1330
  var _c = _vm._self._c || _h;
1317
- return _c('el-option', {
1331
+ return _c('div', {
1332
+ staticClass: "virtual-select-item-wrap"
1333
+ }, [_vm.isValidSource ? _c('el-option', {
1318
1334
  staticClass: "item",
1319
1335
  attrs: {
1320
- "label": _vm.source[_vm.label],
1321
- "value": _vm.source[_vm.value]
1336
+ "label": _vm.source[_vm.label] || '',
1337
+ "value": _vm.source[_vm.value] || ''
1322
1338
  },
1323
1339
  on: {
1324
1340
  "click": _vm.handleItemClick
1325
1341
  }
1326
1342
  }, [_c('span', {
1327
1343
  staticClass: "left-text"
1328
- }, [_vm._v(_vm._s(_vm.source[_vm.label]))]), _vm._v(" "), _vm.rightLabel ? _c('span', {
1344
+ }, [_vm._v(_vm._s(_vm.source[_vm.label] || ''))]), _vm._v(" "), _vm.rightLabel && _vm.source[_vm.rightLabel] ? _c('span', {
1329
1345
  staticClass: "right-text"
1330
- }, [_vm._v(_vm._s(_vm.source[_vm.rightLabel]))]) : _vm._e()]);
1346
+ }, [_vm._v(_vm._s(_vm.source[_vm.rightLabel] || ''))]) : _vm._e()]) : _c('el-option', {
1347
+ staticClass: "item empty-item",
1348
+ attrs: {
1349
+ "label": "",
1350
+ "value": ""
1351
+ }
1352
+ })], 1);
1331
1353
  };
1332
1354
  var __vue_staticRenderFns__$1 = [];
1333
1355
 
1334
1356
  /* style */
1335
1357
  var __vue_inject_styles__$1 = function __vue_inject_styles__(inject) {
1336
1358
  if (!inject) return;
1337
- inject("data-v-d0b52dea_0", {
1338
- source: ".left-text[data-v-d0b52dea]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.right-text[data-v-d0b52dea]{margin-left:10px;color:#939393;white-space:nowrap}",
1359
+ inject("data-v-fa4fd644_0", {
1360
+ source: ".virtual-select-item-wrap[data-v-fa4fd644]{display:inline-block;width:100%;height:100%;box-sizing:border-box}.left-text[data-v-fa4fd644]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.right-text[data-v-fa4fd644]{margin-left:10px;color:#939393;white-space:nowrap}.empty-item[data-v-fa4fd644]{height:34px;line-height:34px}",
1339
1361
  map: undefined,
1340
1362
  media: undefined
1341
1363
  });
1342
1364
  };
1343
1365
  /* scoped */
1344
- var __vue_scope_id__$1 = "data-v-d0b52dea";
1366
+ var __vue_scope_id__$1 = "data-v-fa4fd644";
1345
1367
  /* module identifier */
1346
1368
  var __vue_module_identifier__$1 = undefined;
1347
1369
  /* functional template */
@@ -1356,7 +1378,7 @@ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
1356
1378
  }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, createInjector, undefined, undefined);
1357
1379
 
1358
1380
  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; }
1381
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t), !0)).call(_context4, 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"](_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1360
1382
  var isEmptyObject = function isEmptyObject(obj) {
1361
1383
  if (!obj || _typeof__default["default"](obj) !== 'object' || _Array$isArray__default["default"](obj)) return false;
1362
1384
  return _Object$keys__default["default"](obj).length === 0;
@@ -1381,6 +1403,9 @@ var script = {
1381
1403
  value: 'value',
1382
1404
  rightLabel: ''
1383
1405
  };
1406
+ },
1407
+ validator: function validator(val) {
1408
+ return _typeof__default["default"](val) === 'object' && val !== null && 'label' in val && 'value' in val;
1384
1409
  }
1385
1410
  },
1386
1411
  keeps: {
@@ -1412,7 +1437,7 @@ var script = {
1412
1437
  },
1413
1438
  data: function data() {
1414
1439
  return {
1415
- filteredData: _toConsumableArray__default["default"](this.options),
1440
+ filteredData: [],
1416
1441
  maxItemWidth: 0,
1417
1442
  itemComponent: __vue_component__$1,
1418
1443
  innerValue: this.initInnerValue() // 内部维护选中值,避免直接修改props
@@ -1448,7 +1473,8 @@ var script = {
1448
1473
  deep: true,
1449
1474
  immediate: true,
1450
1475
  handler: function handler(val) {
1451
- this.filteredData = _toConsumableArray__default["default"](val);
1476
+ var validOptions = _Array$isArray__default["default"](val) ? val : [];
1477
+ this.filteredData = _toConsumableArray__default["default"](validOptions);
1452
1478
  this.calcMaxItemWidth();
1453
1479
  }
1454
1480
  }
@@ -1475,18 +1501,18 @@ var script = {
1475
1501
  return val === undefined ? null : val;
1476
1502
  },
1477
1503
  calcMaxItemWidth: function calcMaxItemWidth() {
1478
- var _context,
1479
- _this = this;
1480
- if (!this.options.length) return;
1504
+ var _this = this;
1505
+ var validOptions = _Array$isArray__default["default"](this.options) ? this.options : [];
1506
+ if (!validOptions.length) return;
1481
1507
  var temp = document.createElement('div');
1482
1508
  temp.style.cssText = "\n position: absolute;\n top: -9999px;\n left: -9999px;\n white-space: nowrap;\n padding: 0 20px;\n font-size: 14px;\n box-sizing: border-box;\n ";
1483
1509
  document.body.appendChild(temp);
1484
1510
  var maxWidth = 0;
1485
- _forEachInstanceProperty__default["default"](_context = this.options).call(_context, function (item) {
1486
- var _context2;
1487
- var label = item[_this.fields.label] || '';
1511
+ _forEachInstanceProperty__default["default"](validOptions).call(validOptions, function (item) {
1512
+ var _context;
1513
+ var label = (item === null || item === void 0 ? void 0 : item[_this.fields.label]) || '';
1488
1514
  var rightLabel = item[_this.fields.rightLabel] || '';
1489
- temp.innerHTML = _concatInstanceProperty__default["default"](_context2 = "<span>".concat(label, "</span><span style=\"margin-left:10px;color:#939393\">")).call(_context2, rightLabel, "</span>");
1515
+ temp.innerHTML = _concatInstanceProperty__default["default"](_context = "<span>".concat(label, "</span><span style=\"margin-left:10px;color:#939393\">")).call(_context, rightLabel, "</span>");
1490
1516
  maxWidth = Math.max(maxWidth, temp.offsetWidth);
1491
1517
  });
1492
1518
  this.maxItemWidth = maxWidth + 6;
@@ -1507,14 +1533,15 @@ var script = {
1507
1533
  });
1508
1534
  },
1509
1535
  filterMethod: function filterMethod(query) {
1510
- var _context3,
1511
- _this3 = this;
1536
+ var _this3 = this;
1537
+ var validOptions = _Array$isArray__default["default"](this.options) ? this.options : [];
1512
1538
  var lowerQuery = (query === null || query === void 0 ? void 0 : query.toLowerCase()) || '';
1513
- this.filteredData = lowerQuery ? _filterInstanceProperty__default["default"](_context3 = this.options).call(_context3, function (item) {
1539
+ this.filteredData = lowerQuery ? _filterInstanceProperty__default["default"](validOptions).call(validOptions, function (item) {
1540
+ if (!item) return false;
1514
1541
  var label = (item[_this3.fields.label] || '').toLowerCase();
1515
1542
  var rightLabel = _this3.fields.rightLabel ? (item[_this3.fields.rightLabel] || '').toLowerCase() : '';
1516
1543
  return _includesInstanceProperty__default["default"](label).call(label, lowerQuery) || _includesInstanceProperty__default["default"](rightLabel).call(rightLabel, lowerQuery);
1517
- }) : JSON.parse(_JSON$stringify__default["default"](this.options)); // 深拷贝避免引用污染
1544
+ }) : _toConsumableArray__default["default"](validOptions); // 深拷贝避免引用污染
1518
1545
  this.$nextTick(function () {
1519
1546
  var _this3$$refs$virtualL;
1520
1547
  return (_this3$$refs$virtualL = _this3.$refs.virtualList) === null || _this3$$refs$virtualL === void 0 ? void 0 : _this3$$refs$virtualL.scrollToIndex(0);
@@ -1537,14 +1564,14 @@ var script = {
1537
1564
  var isMultiple = (_this$$attrs2 = this.$attrs) === null || _this$$attrs2 === void 0 ? void 0 : _this$$attrs2.multiple; // 判断是否为多选模式
1538
1565
  var normalizedValue = this.normalizeValue(selectedValue);
1539
1566
  if (isMultiple) {
1540
- var _context4;
1567
+ var _context2;
1541
1568
  // 多选:切换选中状态(存在则移除,不存在则添加)
1542
- var valueIndex = _findIndexInstanceProperty__default["default"](_context4 = this.innerValue).call(_context4, function (val) {
1569
+ var valueIndex = _findIndexInstanceProperty__default["default"](_context2 = this.innerValue).call(_context2, function (val) {
1543
1570
  return val === selectedValue;
1544
1571
  });
1545
1572
  if (valueIndex > -1) {
1546
- var _context5;
1547
- _spliceInstanceProperty__default["default"](_context5 = this.innerValue).call(_context5, valueIndex, 1);
1573
+ var _context3;
1574
+ _spliceInstanceProperty__default["default"](_context3 = this.innerValue).call(_context3, valueIndex, 1);
1548
1575
  } else {
1549
1576
  this.innerValue.push(selectedValue);
1550
1577
  }
@@ -1613,14 +1640,14 @@ var __vue_staticRenderFns__ = [];
1613
1640
  /* style */
1614
1641
  var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
1615
1642
  if (!inject) return;
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}",
1643
+ inject("data-v-2faf6b1a_0", {
1644
+ source: ".select-wrap[data-v-2faf6b1a]{position:relative}.select-wrap .bm-select[data-v-2faf6b1a]{width:100%}.virtual-select-popper[data-v-2faf6b1a]{padding:0!important;border:1px solid #e4e7ed!important;border-radius:4px!important}.virtual-list[data-v-2faf6b1a]{max-height:245px;overflow-y:auto;overflow-x:hidden!important;scrollbar-width:thin;scrollbar-color:#e4e7ed #f5f7fa}.virtual-list[data-v-2faf6b1a]::-webkit-scrollbar{width:6px!important;display:block!important}.virtual-list[data-v-2faf6b1a]::-webkit-scrollbar-thumb{background-color:#e4e7ed;border-radius:3px}.virtual-list[data-v-2faf6b1a]::-webkit-scrollbar-track{background-color:#f5f7fa}[data-v-2faf6b1a]:deep(.el-scrollbar__bar.is-vertical){display:none!important}",
1618
1645
  map: undefined,
1619
1646
  media: undefined
1620
1647
  });
1621
1648
  };
1622
1649
  /* scoped */
1623
- var __vue_scope_id__ = "data-v-4ce656fa";
1650
+ var __vue_scope_id__ = "data-v-2faf6b1a";
1624
1651
  /* module identifier */
1625
1652
  var __vue_module_identifier__ = undefined;
1626
1653
  /* functional template */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-management-ui",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "description": "一个基于Vue+ElementUI封装的后台管理仓库,包含表格、表单、弹窗、按钮组、虚拟下拉框等常用组件",
5
5
  "author": {
6
6
  "name": "adolf3",