backend-management-ui 1.7.12 → 1.7.14

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.
Files changed (3) hide show
  1. package/README.md +18 -24
  2. package/index.common.js +30 -38
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  - 极简配置化开发:表格 / 表单 / 按钮组等组件通过 JSON 配置快速生成,无需重复写模板
11
11
  - 高频业务场景全覆盖:内置配置化表格、表单、按钮组、虚拟滚动下拉框等核心组件
12
12
  - 轻量无冗余:仅依赖 Vue2 + ElementUI + vue-virtual-scroll-list,无第三方冗余依赖,兼容低版本Node环境
13
- - 基于 ElSelect + vue-virtual-scroll-list 实现海量数据下拉选择,解决大数据渲染卡顿问题
13
+ - 基于 ElSelect + vue-virtual-scroll-list 实现海量数据下拉选择,解决大量数据渲染卡顿问题
14
14
 
15
15
  ## 安装
16
16
 
@@ -42,7 +42,7 @@ import 'element-ui/lib/theme-chalk/index.css'
42
42
  import BackendManagementUI from 'backend-management-ui'
43
43
 
44
44
  Vue.use(ElementUI)
45
- Vue.use(BackendManagementUI) // 全局注册所有组件
45
+ Vue.use(BackendManagementUI) // 全局注册所有组件,放在ElementUI后面
46
46
  ```
47
47
 
48
48
  按需引入
@@ -97,8 +97,8 @@ export default {
97
97
  prop: 'status',
98
98
  component: 'el-select',
99
99
  options: [
100
- {label: '成功', value: 0},
101
- {label: '失败', value: 1}
100
+ { label: '成功', value: 0 },
101
+ { label: '失败', value: 1 }
102
102
  ]
103
103
  }
104
104
  ]
@@ -131,14 +131,8 @@ export default {
131
131
  status: "成功"
132
132
  },
133
133
  formConfig: [
134
- {
135
- label: '订单号',
136
- prop: 'orderNo',
137
- },
138
- {
139
- label: '状态',
140
- prop: 'status',
141
- }
134
+ { label: '订单号', prop: 'orderNo', },
135
+ { label: '状态', prop: 'status', }
142
136
  ]
143
137
  }
144
138
  }
@@ -393,19 +387,19 @@ export default {
393
387
  total: 0,
394
388
  operateBtns: [
395
389
  {
396
- label: "详情",
397
- type: "text",
398
- action: (params) => {
390
+ label: "详情",
391
+ type: "text",
392
+ action: (params) => {
399
393
 
400
- },
394
+ },
401
395
  },
402
396
  {
403
- label: "操作记录",
404
- type: "text",
405
- action: ({ context }) => {
406
- this.currentRow = context;
407
- this.getOperateLogInfo();
408
- },
397
+ label: "操作记录",
398
+ type: "text",
399
+ action: ({ context }) => {
400
+ this.currentRow = context;
401
+ this.getOperateLogInfo();
402
+ },
409
403
  },
410
404
  ],
411
405
  currentRow: null
@@ -560,7 +554,7 @@ export default {
560
554
 
561
555
  -------------------
562
556
 
563
- #### props
557
+ #### props
564
558
 
565
559
  | 参数 | 说明 | 类型 | 可选值 | 默认值 |
566
560
  | -------- | ----------- | -------- | ------ | --------- |
@@ -573,7 +567,7 @@ export default {
573
567
 
574
568
  ### 公共业务组件
575
569
 
576
- #### Status
570
+ #### Status
577
571
 
578
572
  基本用法
579
573
 
package/index.common.js CHANGED
@@ -84,15 +84,6 @@ function _unsupportedIterableToArray(r, a) { if (r) { var _context0; if ("string
84
84
  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; }
85
85
  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; }
86
86
  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; }
87
- /**
88
- * @desc 表单组件
89
- * @params formRef ref
90
- * @params model modelForm
91
- * @params formConfig
92
- * @params formConfig
93
- * @params formConfig
94
- * @params formConfig
95
- */
96
87
  var componentMap = {
97
88
  input: "el-input",
98
89
  select: "el-select",
@@ -186,7 +177,8 @@ var script$6 = {
186
177
  options: item.options || [],
187
178
  fields: item.fields || {
188
179
  label: 'label',
189
- value: 'value'
180
+ value: 'value',
181
+ rightLabel: ''
190
182
  }
191
183
  });
192
184
  }
@@ -219,7 +211,6 @@ var script$6 = {
219
211
  break;
220
212
  }
221
213
  item = _step.value;
222
- // const
223
214
  apiConfig = item.api || _this.apiMapConfig[item.prop];
224
215
  optionsRequired = _this.isSelectComponent(item.component) || _this.isRadioGroupComponent(item.component) || _this.isVirtualSelectComponent(item.component);
225
216
  if (!(optionsRequired && apiConfig && !((_item$options = item.options) !== null && _item$options !== void 0 && _item$options.length))) {
@@ -386,17 +377,17 @@ var __vue_render__$6 = function __vue_render__() {
386
377
  },
387
378
  expression: "model[item.prop]"
388
379
  }
389
- }, 'component', _vm.handleBindAttrs(item), false), item.events), [_vm.isSelectComponent(item.component) && item.options ? _vm._l(item.options, function (opt) {
380
+ }, 'component', _vm.handleBindAttrs(item), false), item.events), [_vm.isSelectComponent(item.component) && item.options ? _vm._l(item.options, function (opt, index) {
390
381
  return _c('el-option', {
391
- key: item.prop + "-" + opt.value,
382
+ key: item.prop + "-" + opt.value + "-" + index,
392
383
  attrs: {
393
384
  "label": opt.label,
394
385
  "value": opt.value
395
386
  }
396
387
  });
397
- }) : _vm._e(), _vm._v(" "), _vm.isRadioGroupComponent(item.component) && item.options ? _vm._l(item.options, function (opt) {
388
+ }) : _vm._e(), _vm._v(" "), _vm.isRadioGroupComponent(item.component) && item.options ? _vm._l(item.options, function (opt, index) {
398
389
  return _c('el-radio', {
399
- key: item.prop + "-" + opt.value,
390
+ key: item.prop + "-" + opt.value + "-" + index,
400
391
  attrs: {
401
392
  "label": opt.value
402
393
  }
@@ -510,10 +501,6 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _
510
501
  //
511
502
  //
512
503
 
513
- /**
514
- * @desc 基础表格: 多选列、序号和操作列分开配置,也可以在tableColumns配置,这时需要插槽
515
- * @params
516
- */
517
504
  var renderNode = {
518
505
  functional: true,
519
506
  props: {
@@ -875,14 +862,14 @@ var __vue_staticRenderFns__$5 = [];
875
862
  /* style */
876
863
  var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
877
864
  if (!inject) return;
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}",
865
+ inject("data-v-516b74f6_0", {
866
+ source: ".bm-table-container[data-v-516b74f6]{box-sizing:border-box}.bm-table-container .bm-pagination[data-v-516b74f6]{display:flex;justify-content:flex-end;margin-top:20px}.bm-table-container .bm-table-cell[data-v-516b74f6]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bm-table-container .bm-cell-active[data-v-516b74f6]{color:#1890ff;cursor:pointer}.bm-table-container[data-v-516b74f6] :deep(.el-tablethead){color:#606266}",
880
867
  map: undefined,
881
868
  media: undefined
882
869
  });
883
870
  };
884
871
  /* scoped */
885
- var __vue_scope_id__$5 = "data-v-089a18c2";
872
+ var __vue_scope_id__$5 = "data-v-516b74f6";
886
873
  /* module identifier */
887
874
  var __vue_module_identifier__$5 = undefined;
888
875
  /* functional template */
@@ -1380,7 +1367,7 @@ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
1380
1367
  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; }
1381
1368
  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; }
1382
1369
  var isEmptyObject = function isEmptyObject(obj) {
1383
- if (!obj || _typeof__default["default"](obj) !== 'object' || _Array$isArray__default["default"](obj)) return false;
1370
+ if (!obj || _typeof__default["default"](obj) !== 'object' || _Array$isArray__default["default"](obj)) return true;
1384
1371
  return _Object$keys__default["default"](obj).length === 0;
1385
1372
  };
1386
1373
  var script = {
@@ -1445,19 +1432,24 @@ var script = {
1445
1432
  },
1446
1433
  computed: {
1447
1434
  computedExtraProps: function computedExtraProps() {
1448
- var emptyObject = isEmptyObject(this.extraProps);
1449
- if (emptyObject) {
1435
+ if (isEmptyObject(this.extraProps)) {
1450
1436
  return this.fields;
1451
- } else {
1452
- var _this$extraProps = this.extraProps,
1453
- label = _this$extraProps.label,
1454
- value = _this$extraProps.value,
1455
- rightLabel = _this$extraProps.rightLabel;
1456
- if (!label || !value || !rightLabel) {
1457
- return this.fields;
1458
- }
1459
- return _objectSpread(_objectSpread({}, this.fields), this.extraProps);
1460
1437
  }
1438
+ var _this$extraProps = this.extraProps,
1439
+ _this$extraProps$labe = _this$extraProps.label,
1440
+ label = _this$extraProps$labe === void 0 ? this.fields.label : _this$extraProps$labe,
1441
+ _this$extraProps$valu = _this$extraProps.value,
1442
+ value = _this$extraProps$valu === void 0 ? this.fields.value : _this$extraProps$valu,
1443
+ _this$extraProps$righ = _this$extraProps.rightLabel,
1444
+ rightLabel = _this$extraProps$righ === void 0 ? this.fields.rightLabel : _this$extraProps$righ;
1445
+ if (label && value) {
1446
+ return _objectSpread(_objectSpread({}, this.fields), {}, {
1447
+ label: label,
1448
+ value: value,
1449
+ rightLabel: rightLabel
1450
+ });
1451
+ }
1452
+ return this.fields;
1461
1453
  }
1462
1454
  },
1463
1455
  watch: {
@@ -1627,7 +1619,7 @@ var __vue_render__ = function __vue_render__() {
1627
1619
  "data-sources": _vm.filteredData,
1628
1620
  "data-component": _vm.itemComponent,
1629
1621
  "keeps": _vm.keeps,
1630
- "extra-props": _vm.computedExtraProps,
1622
+ "extra-props": _vm.computedExtraProps || {},
1631
1623
  "estimate-size": _vm.estimateSize
1632
1624
  },
1633
1625
  on: {
@@ -1640,14 +1632,14 @@ var __vue_staticRenderFns__ = [];
1640
1632
  /* style */
1641
1633
  var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
1642
1634
  if (!inject) return;
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}",
1635
+ inject("data-v-09366db6_0", {
1636
+ source: ".select-wrap[data-v-09366db6]{position:relative}.select-wrap .bm-select[data-v-09366db6]{width:100%}.virtual-select-popper[data-v-09366db6]{padding:0!important;border:1px solid #e4e7ed!important;border-radius:4px!important}.virtual-list[data-v-09366db6]{max-height:245px;overflow-y:auto;overflow-x:hidden!important;scrollbar-width:thin;scrollbar-color:#e4e7ed #f5f7fa}.virtual-list[data-v-09366db6]::-webkit-scrollbar{width:6px!important;display:block!important}.virtual-list[data-v-09366db6]::-webkit-scrollbar-thumb{background-color:#e4e7ed;border-radius:3px}.virtual-list[data-v-09366db6]::-webkit-scrollbar-track{background-color:#f5f7fa}[data-v-09366db6]:deep(.el-scrollbar__bar.is-vertical){display:none!important}",
1645
1637
  map: undefined,
1646
1638
  media: undefined
1647
1639
  });
1648
1640
  };
1649
1641
  /* scoped */
1650
- var __vue_scope_id__ = "data-v-2faf6b1a";
1642
+ var __vue_scope_id__ = "data-v-09366db6";
1651
1643
  /* module identifier */
1652
1644
  var __vue_module_identifier__ = undefined;
1653
1645
  /* functional template */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-management-ui",
3
- "version": "1.7.12",
3
+ "version": "1.7.14",
4
4
  "description": "一个基于Vue+ElementUI封装的后台管理仓库,包含表格、表单、弹窗、按钮组、虚拟下拉框等常用组件",
5
5
  "author": {
6
6
  "name": "adolf3",