backend-management-ui 1.5.8 → 1.6.0

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.
@@ -0,0 +1,1293 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
6
+ var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
7
+ var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
8
+ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
9
+ var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
10
+ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
11
+ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
12
+ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
13
+ var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
14
+ var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
15
+ var _Symbol = require('@babel/runtime-corejs3/core-js-stable/symbol');
16
+ var _getIteratorMethod = require('@babel/runtime-corejs3/core-js/get-iterator-method');
17
+ var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
18
+ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/esm/asyncToGenerator');
19
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/esm/defineProperty');
20
+ var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
21
+ var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
22
+ var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
23
+ var _typeof = require('@babel/runtime-corejs3/helpers/esm/typeof');
24
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
25
+ var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
26
+ var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
27
+ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
28
+ var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
29
+
30
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
+
32
+ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_forEachInstanceProperty);
33
+ var _Object$keys__default = /*#__PURE__*/_interopDefaultLegacy(_Object$keys);
34
+ var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefaultLegacy(_Object$getOwnPropertySymbols);
35
+ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_filterInstanceProperty);
36
+ var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefaultLegacy(_Object$getOwnPropertyDescriptor);
37
+ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefaultLegacy(_Object$getOwnPropertyDescriptors);
38
+ var _Object$defineProperties__default = /*#__PURE__*/_interopDefaultLegacy(_Object$defineProperties);
39
+ var _Object$defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_Object$defineProperty);
40
+ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_sliceInstanceProperty);
41
+ var _Array$from__default = /*#__PURE__*/_interopDefaultLegacy(_Array$from);
42
+ var _Symbol__default = /*#__PURE__*/_interopDefaultLegacy(_Symbol);
43
+ var _getIteratorMethod__default = /*#__PURE__*/_interopDefaultLegacy(_getIteratorMethod);
44
+ var _Array$isArray__default = /*#__PURE__*/_interopDefaultLegacy(_Array$isArray);
45
+ var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
46
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
47
+ var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
48
+ var _everyInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_everyInstanceProperty);
49
+ var _includesInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_includesInstanceProperty);
50
+ var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
51
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_mapInstanceProperty);
52
+ var _Object$assign__default = /*#__PURE__*/_interopDefaultLegacy(_Object$assign);
53
+ var _someInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_someInstanceProperty);
54
+ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_startsWithInstanceProperty);
55
+ var _endsWithInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_endsWithInstanceProperty);
56
+
57
+ var _deepcopy = function deepcopy(obj) {
58
+ if (obj === null || _typeof__default["default"](obj) !== "object") return obj;
59
+ if (obj instanceof Date) return new Date(obj);
60
+ if (obj instanceof Array) return _mapInstanceProperty__default["default"](obj).call(obj, function (item) {
61
+ return _deepcopy(item);
62
+ });
63
+ if (obj instanceof Object) {
64
+ var newObj = {};
65
+ for (var key in obj) {
66
+ newObj[key] = _deepcopy(obj[key]);
67
+ }
68
+ return newObj;
69
+ }
70
+ };
71
+
72
+ 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; } } }; }
73
+ function _unsupportedIterableToArray(r, a) { if (r) { var _context8; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty__default["default"](_context8 = {}.toString.call(r)).call(_context8, 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; } }
74
+ 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; }
75
+ 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; }
76
+ function _objectSpread$1(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$1(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$1(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
77
+ /**
78
+ * @desc 表单组件
79
+ * @params formRef ref
80
+ * @params model modelForm
81
+ * @params formConfig
82
+ * @params formConfig
83
+ * @params formConfig
84
+ * @params formConfig
85
+ */
86
+ var componentMap = {
87
+ input: "el-input",
88
+ select: "el-select",
89
+ datePicker: "el-date-picker"
90
+ };
91
+ var script$4 = {
92
+ name: "UiForm",
93
+ props: {
94
+ formRef: {
95
+ type: String,
96
+ "default": "formRef"
97
+ },
98
+ model: {
99
+ type: Object,
100
+ "default": function _default() {
101
+ return {};
102
+ }
103
+ },
104
+ formConfig: {
105
+ type: Array,
106
+ "default": function _default() {
107
+ return [];
108
+ },
109
+ validator: function validator(val) {
110
+ return _everyInstanceProperty__default["default"](val).call(val, function (row) {
111
+ return row.prop || row.key;
112
+ });
113
+ }
114
+ },
115
+ showOperateBtn: {
116
+ type: Boolean,
117
+ "default": true
118
+ },
119
+ defaultBtn: {
120
+ type: Boolean,
121
+ "default": true
122
+ },
123
+ resetBtnText: {
124
+ type: String,
125
+ "default": "重置"
126
+ },
127
+ searchBtnText: {
128
+ type: String,
129
+ "default": "查询"
130
+ },
131
+ apiMapConfig: {
132
+ // { [prop]: [api] } 或 {[prop]: {url: [api], params: [params]}}
133
+ type: Object,
134
+ "default": function _default() {
135
+ return {};
136
+ }
137
+ }
138
+ },
139
+ data: function data() {
140
+ return {
141
+ tempFormConfig: []
142
+ };
143
+ },
144
+ watch: {
145
+ formConfig: {
146
+ immediate: true,
147
+ deep: true,
148
+ handler: function handler(val) {
149
+ this.tempFormConfig = _deepcopy(val);
150
+ this.initOptions();
151
+ }
152
+ }
153
+ },
154
+ methods: {
155
+ getComponentName: function getComponentName(componentName) {
156
+ return componentMap[componentName] || componentName || "el-input";
157
+ },
158
+ handleBindAttrs: function handleBindAttrs(item) {
159
+ var _item$attrs, _context, _context2;
160
+ var style = {
161
+ width: ((_item$attrs = item.attrs) === null || _item$attrs === void 0 ? void 0 : _item$attrs.width) || "220px"
162
+ };
163
+ var placeholder = "";
164
+ var componentName = this.getComponentName(item.component);
165
+ if (_includesInstanceProperty__default["default"](_context = ["el-select", "select", "el-date-picker", "el-virtual-select"]).call(_context, componentName)) {
166
+ placeholder = "\u8BF7\u9009\u62E9".concat(item.label);
167
+ }
168
+ if (_includesInstanceProperty__default["default"](_context2 = ["el-input", "input"]).call(_context2, componentName)) {
169
+ placeholder = "\u8BF7\u8F93\u5165".concat(item.label);
170
+ }
171
+ var baseAttrs = _objectSpread$1({
172
+ style: style,
173
+ placeholder: placeholder,
174
+ clearable: true
175
+ }, item.attrs || {});
176
+ if (componentName === "el-virtual-select") {
177
+ return _objectSpread$1(_objectSpread$1({}, baseAttrs), {}, {
178
+ options: item.options || []
179
+ });
180
+ }
181
+ return baseAttrs;
182
+ },
183
+ isSelectComponent: function isSelectComponent(componentName) {
184
+ var _context3;
185
+ return _includesInstanceProperty__default["default"](_context3 = ["el-select", "select"]).call(_context3, this.getComponentName(componentName));
186
+ },
187
+ isRadioGroupComponent: function isRadioGroupComponent(componentName) {
188
+ return this.getComponentName(componentName) === "el-radio-group";
189
+ },
190
+ isVirtualSelectComponent: function isVirtualSelectComponent(componentName) {
191
+ return this.getComponentName(componentName) === "el-virtual-select";
192
+ },
193
+ initOptions: function initOptions() {
194
+ var _this = this;
195
+ return _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
196
+ var _iterator, _step, _item$options, item, apiConfig, optionsRequired, _ref, url, _ref$params, params, res, options, _t2;
197
+ return _regeneratorRuntime__default["default"].wrap(function (_context4) {
198
+ while (1) switch (_context4.prev = _context4.next) {
199
+ case 0:
200
+ _iterator = _createForOfIteratorHelper(_this.tempFormConfig);
201
+ _context4.prev = 1;
202
+ _iterator.s();
203
+ case 2:
204
+ if ((_step = _iterator.n()).done) {
205
+ _context4.next = 7;
206
+ break;
207
+ }
208
+ item = _step.value;
209
+ // const
210
+ apiConfig = item.api || _this.apiMapConfig[item.prop];
211
+ optionsRequired = _this.isSelectComponent(item.component) || _this.isRadioGroupComponent(item.component) || _this.isVirtualSelectComponent(item.component);
212
+ if (!(optionsRequired && apiConfig && !((_item$options = item.options) !== null && _item$options !== void 0 && _item$options.length))) {
213
+ _context4.next = 6;
214
+ break;
215
+ }
216
+ _context4.prev = 3;
217
+ _ref = typeof apiConfig === "function" ? {
218
+ url: apiConfig
219
+ } : apiConfig, url = _ref.url, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
220
+ _context4.next = 4;
221
+ return url(params);
222
+ case 4:
223
+ res = _context4.sent;
224
+ options = item.format ? item.format(res) : (res === null || res === void 0 ? void 0 : res.data) || [];
225
+ _this.$set(item, "options", options);
226
+ _context4.next = 6;
227
+ break;
228
+ case 5:
229
+ _context4.prev = 5;
230
+ _context4["catch"](3);
231
+ _this.$set(item, "options", []);
232
+ case 6:
233
+ _context4.next = 2;
234
+ break;
235
+ case 7:
236
+ _context4.next = 9;
237
+ break;
238
+ case 8:
239
+ _context4.prev = 8;
240
+ _t2 = _context4["catch"](1);
241
+ _iterator.e(_t2);
242
+ case 9:
243
+ _context4.prev = 9;
244
+ _iterator.f();
245
+ return _context4.finish(9);
246
+ case 10:
247
+ case "end":
248
+ return _context4.stop();
249
+ }
250
+ }, _callee, null, [[1, 8, 9, 10], [3, 5]]);
251
+ }))();
252
+ },
253
+ resetForm: function resetForm() {
254
+ this.$refs[this.formRef].resetFields();
255
+ this.$emit("reset");
256
+ },
257
+ getOptions: function getOptions() {
258
+ var _context5;
259
+ var propOptionsMap = {};
260
+ _forEachInstanceProperty__default["default"](_context5 = this.tempFormConfig).call(_context5, function (row) {
261
+ if (row.options) {
262
+ propOptionsMap[row.prop] = row.options;
263
+ }
264
+ });
265
+ return propOptionsMap;
266
+ }
267
+ }
268
+ };
269
+
270
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
271
+ if (typeof shadowMode !== 'boolean') {
272
+ createInjectorSSR = createInjector;
273
+ createInjector = shadowMode;
274
+ shadowMode = false;
275
+ }
276
+ // Vue.extend constructor export interop.
277
+ const options = typeof script === 'function' ? script.options : script;
278
+ // render functions
279
+ if (template && template.render) {
280
+ options.render = template.render;
281
+ options.staticRenderFns = template.staticRenderFns;
282
+ options._compiled = true;
283
+ // functional template
284
+ if (isFunctionalTemplate) {
285
+ options.functional = true;
286
+ }
287
+ }
288
+ // scopedId
289
+ if (scopeId) {
290
+ options._scopeId = scopeId;
291
+ }
292
+ let hook;
293
+ if (moduleIdentifier) {
294
+ // server build
295
+ hook = function (context) {
296
+ // 2.3 injection
297
+ context =
298
+ context || // cached call
299
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
300
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
301
+ // 2.2 with runInNewContext: true
302
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
303
+ context = __VUE_SSR_CONTEXT__;
304
+ }
305
+ // inject component styles
306
+ if (style) {
307
+ style.call(this, createInjectorSSR(context));
308
+ }
309
+ // register component module identifier for async chunk inference
310
+ if (context && context._registeredComponents) {
311
+ context._registeredComponents.add(moduleIdentifier);
312
+ }
313
+ };
314
+ // used by ssr in case component is cached and beforeCreate
315
+ // never gets called
316
+ options._ssrRegister = hook;
317
+ }
318
+ else if (style) {
319
+ hook = shadowMode
320
+ ? function (context) {
321
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
322
+ }
323
+ : function (context) {
324
+ style.call(this, createInjector(context));
325
+ };
326
+ }
327
+ if (hook) {
328
+ if (options.functional) {
329
+ // register for functional component in vue file
330
+ const originalRender = options.render;
331
+ options.render = function renderWithStyleInjection(h, context) {
332
+ hook.call(context);
333
+ return originalRender(h, context);
334
+ };
335
+ }
336
+ else {
337
+ // inject component registration as beforeCreate hook
338
+ const existing = options.beforeCreate;
339
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
340
+ }
341
+ }
342
+ return script;
343
+ }
344
+
345
+ /* script */
346
+ var __vue_script__$4 = script$4;
347
+
348
+ /* template */
349
+ var __vue_render__$4 = function __vue_render__() {
350
+ var _vm = this;
351
+ var _h = _vm.$createElement;
352
+ var _c = _vm._self._c || _h;
353
+ return _c('el-form', _vm._g(_vm._b({
354
+ ref: _vm.formRef,
355
+ staticClass: "bm-form",
356
+ attrs: {
357
+ "model": _vm.model
358
+ }
359
+ }, 'el-form', _vm.$attrs, false), _vm.$listeners), [_vm._l(_vm.tempFormConfig, function (item, index) {
360
+ return _c('el-form-item', _vm._b({
361
+ key: (item.prop || item.key) + "-" + index,
362
+ attrs: {
363
+ "label": item.label,
364
+ "prop": item.prop
365
+ }
366
+ }, 'el-form-item', item.formItemAttrs, false), [_vm._t("item-" + (item.prop || item.key), function () {
367
+ return [_c(_vm.getComponentName(item.component), _vm._g(_vm._b({
368
+ tag: "component",
369
+ model: {
370
+ value: _vm.model[item.prop],
371
+ callback: function callback($$v) {
372
+ _vm.$set(_vm.model, item.prop, $$v);
373
+ },
374
+ expression: "model[item.prop]"
375
+ }
376
+ }, 'component', _vm.handleBindAttrs(item), false), item.events), [_vm.isSelectComponent(item.component) && item.options ? _vm._l(item.options, function (opt) {
377
+ return _c('el-option', {
378
+ key: item.prop + "-" + opt.value,
379
+ attrs: {
380
+ "label": opt.label,
381
+ "value": opt.value
382
+ }
383
+ });
384
+ }) : _vm._e(), _vm._v(" "), _vm.isRadioGroupComponent(item.component) && item.options ? _vm._l(item.options, function (opt) {
385
+ return _c('el-radio', {
386
+ key: item.prop + "-" + opt.value,
387
+ attrs: {
388
+ "label": opt.value
389
+ }
390
+ }, [_vm._v("\n " + _vm._s(opt.label) + "\n ")]);
391
+ }) : _vm._e()], 2)];
392
+ }, {
393
+ "item": item,
394
+ "model": _vm.model,
395
+ "index": index
396
+ })], 2);
397
+ }), _vm._v(" "), _vm.showOperateBtn ? _c('el-form-item', {
398
+ attrs: {
399
+ "label": ""
400
+ }
401
+ }, [_vm.defaultBtn ? [_c('el-button', {
402
+ on: {
403
+ "click": _vm.resetForm
404
+ }
405
+ }, [_vm._v(_vm._s(_vm.resetBtnText))]), _vm._v(" "), _c('el-button', {
406
+ attrs: {
407
+ "type": "primary"
408
+ },
409
+ on: {
410
+ "click": function click($event) {
411
+ return _vm.$emit('search');
412
+ }
413
+ }
414
+ }, [_vm._v(_vm._s(_vm.searchBtnText))])] : _vm._e(), _vm._v(" "), _vm._t("customBtn")], 2) : _vm._e()], 2);
415
+ };
416
+ var __vue_staticRenderFns__$4 = [];
417
+
418
+ /* style */
419
+ var __vue_inject_styles__$4 = undefined;
420
+ /* scoped */
421
+ var __vue_scope_id__$4 = undefined;
422
+ /* module identifier */
423
+ var __vue_module_identifier__$4 = undefined;
424
+ /* functional template */
425
+ var __vue_is_functional_template__$4 = false;
426
+ /* style inject */
427
+
428
+ /* style inject SSR */
429
+
430
+ /* style inject shadow dom */
431
+
432
+ var __vue_component__$4 = /*#__PURE__*/normalizeComponent({
433
+ render: __vue_render__$4,
434
+ staticRenderFns: __vue_staticRenderFns__$4
435
+ }, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, false, undefined, undefined, undefined);
436
+
437
+ 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; }
438
+ 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; }
439
+ //
440
+ //
441
+ //
442
+ //
443
+ //
444
+ //
445
+ //
446
+ //
447
+ //
448
+ //
449
+ //
450
+ //
451
+ //
452
+ //
453
+ //
454
+ //
455
+ //
456
+ //
457
+ //
458
+ //
459
+ //
460
+ //
461
+ //
462
+ //
463
+ //
464
+ //
465
+ //
466
+ //
467
+ //
468
+ //
469
+ //
470
+ //
471
+ //
472
+ //
473
+ //
474
+ //
475
+ //
476
+ //
477
+ //
478
+ //
479
+ //
480
+ //
481
+ //
482
+ //
483
+ //
484
+ //
485
+ //
486
+ //
487
+ //
488
+ //
489
+ //
490
+ //
491
+ //
492
+ //
493
+ //
494
+ //
495
+ //
496
+ //
497
+ //
498
+ //
499
+
500
+ /**
501
+ * @desc 基础表格: 多选列、序号和操作列分开配置,也可以在tableColumns配置,这时需要插槽
502
+ * @params
503
+ */
504
+ var renderNode = {
505
+ functional: true,
506
+ props: {
507
+ render: {
508
+ type: Function,
509
+ required: true,
510
+ validator: function validator(val) {
511
+ // 新增:props 校验
512
+ return typeof val === 'function';
513
+ }
514
+ },
515
+ params: {
516
+ type: Object,
517
+ "default": function _default() {
518
+ return {};
519
+ },
520
+ validator: function validator(val) {
521
+ return _typeof__default["default"](val) === 'object' && val !== null;
522
+ }
523
+ }
524
+ },
525
+ render: function render(h, ctx) {
526
+ try {
527
+ var render = ctx.render,
528
+ params = ctx.params;
529
+ var vnode = render(params);
530
+ return vnode || h('span', '');
531
+ } catch (error) {
532
+ return h('span', {
533
+ style: {
534
+ color: '#f56c6c'
535
+ }
536
+ }, 'vnode渲染异常');
537
+ }
538
+ }
539
+ };
540
+ var script$3 = {
541
+ name: "UiTable",
542
+ components: {
543
+ renderNode: renderNode
544
+ },
545
+ props: {
546
+ data: {
547
+ type: Array,
548
+ required: true,
549
+ "default": function _default() {
550
+ return [];
551
+ }
552
+ },
553
+ loading: {
554
+ type: Boolean,
555
+ "default": false
556
+ },
557
+ showSelection: {
558
+ type: Boolean,
559
+ "default": false
560
+ },
561
+ showIndex: {
562
+ type: Boolean,
563
+ "default": false
564
+ },
565
+ indexConfig: {
566
+ type: Object,
567
+ "default": function _default() {
568
+ return {
569
+ type: "index",
570
+ label: "序号",
571
+ width: 55,
572
+ fixed: "left",
573
+ align: "center"
574
+ };
575
+ }
576
+ },
577
+ tableColumns: {
578
+ type: Array,
579
+ required: true,
580
+ "default": function _default() {
581
+ return [];
582
+ }
583
+ },
584
+ showOperation: {
585
+ type: Boolean,
586
+ "default": false
587
+ },
588
+ operationConfig: {
589
+ type: Object,
590
+ "default": function _default() {
591
+ return {};
592
+ }
593
+ },
594
+ showPagination: {
595
+ type: Boolean,
596
+ "default": true
597
+ },
598
+ paginationConfig: {
599
+ type: Object,
600
+ "default": function _default() {
601
+ return {
602
+ pageNum: 1,
603
+ pageSize: 10
604
+ };
605
+ }
606
+ },
607
+ total: {
608
+ type: Number,
609
+ "default": 0
610
+ }
611
+ },
612
+ mounted: function mounted() {
613
+ var _context,
614
+ _this = this;
615
+ var bool = _someInstanceProperty__default["default"](_context = this.tableColumns).call(_context, function (row) {
616
+ var hasIndex = row.type === "index" && _this.showIndex;
617
+ var hasSelection = row.type === "selection" && _this.showSelection;
618
+ var hasOperate = (row.label === "操作" || row.prop === "operation") && _this.showOperation;
619
+ return hasIndex || hasSelection || hasOperate;
620
+ });
621
+ if (bool) {
622
+ console.warn("序号列、多选列、操作列的一项或者多项存在重复配置,请检查传入的props和tableColumns");
623
+ }
624
+ },
625
+ computed: {
626
+ mergeOperation: function mergeOperation() {
627
+ var defaultConfig = {
628
+ label: "操作",
629
+ prop: "operation",
630
+ width: 180,
631
+ fixed: "right",
632
+ align: "center"
633
+ };
634
+ return _objectSpread(_objectSpread({}, defaultConfig), this.operationConfig);
635
+ }
636
+ },
637
+ methods: {
638
+ getColumnProps: function getColumnProps(col) {
639
+ var _context2;
640
+ // 可以配置列属性允许白名单,避免污染,这里是抽离自定义的属性
641
+ var obj = {};
642
+ var exclusion = ["headerSlot", "render", "component", "componentProps", "componentEvents", "slot", "clickable", "clickableClass", "onCellClick"];
643
+ _forEachInstanceProperty__default["default"](_context2 = _Object$keys__default["default"](col)).call(_context2, function (key) {
644
+ if (!_includesInstanceProperty__default["default"](exclusion).call(exclusion, key)) {
645
+ obj[key] = col[key];
646
+ }
647
+ });
648
+ return _objectSpread({
649
+ align: "center"
650
+ }, obj);
651
+ },
652
+ getRenderParams: function getRenderParams(scope) {
653
+ return {
654
+ row: scope.row,
655
+ column: scope.column,
656
+ $h: this.$createElement,
657
+ index: scope.$index
658
+ };
659
+ },
660
+ getCellActiveClass: function getCellActiveClass(scope, col) {
661
+ if (typeof col.clickableClass === "function") {
662
+ return col.clickableClass(scope, col);
663
+ }
664
+ if (typeof col.clickableClass === "boolean") return col.clickableClass;
665
+ return false;
666
+ },
667
+ handleCellClick: function handleCellClick(scope, col) {
668
+ var row = scope.row,
669
+ $index = scope.$index;
670
+ var canClick = col.clickable || this.getCellActiveClass(scope, col);
671
+ if (!canClick) return;
672
+ if (typeof col.onCellClick === "function") {
673
+ col.onCellClick({
674
+ row: row,
675
+ column: col,
676
+ index: $index
677
+ });
678
+ }
679
+ },
680
+ getTableColumnValue: function getTableColumnValue(col, scope) {
681
+ var row = scope.row,
682
+ $index = scope.$index;
683
+ if (typeof col.formatter === "function") {
684
+ // formatter重写了,和el-table-column的属性参数有所不同
685
+ return col.formatter(row[col.prop], row, $index);
686
+ }
687
+ return row[col.prop];
688
+ },
689
+ // 对外暴露的表格实例
690
+ getTableEl: function getTableEl() {
691
+ return this.$refs.table;
692
+ },
693
+ handleSizeChange: function handleSizeChange(pageSize) {
694
+ this.$emit("change-size", pageSize);
695
+ this.$emit("change-pagination", _objectSpread(_objectSpread({}, this.paginationConfig), {}, {
696
+ pageSize: pageSize,
697
+ pageNum: 1
698
+ }));
699
+ },
700
+ handleCurrentChange: function handleCurrentChange(pageNum) {
701
+ this.$emit("change-page", pageNum);
702
+ this.$emit("change-pagination", _objectSpread(_objectSpread({}, this.paginationConfig), {}, {
703
+ pageNum: pageNum
704
+ }));
705
+ }
706
+ }
707
+ };
708
+
709
+ const isOldIE = typeof navigator !== 'undefined' &&
710
+ /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
711
+ function createInjector(context) {
712
+ return (id, style) => addStyle(id, style);
713
+ }
714
+ let HEAD;
715
+ const styles = {};
716
+ function addStyle(id, css) {
717
+ const group = isOldIE ? css.media || 'default' : id;
718
+ const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
719
+ if (!style.ids.has(id)) {
720
+ style.ids.add(id);
721
+ let code = css.source;
722
+ if (css.map) {
723
+ // https://developer.chrome.com/devtools/docs/javascript-debugging
724
+ // this makes source maps inside style tags work properly in Chrome
725
+ code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
726
+ // http://stackoverflow.com/a/26603875
727
+ code +=
728
+ '\n/*# sourceMappingURL=data:application/json;base64,' +
729
+ btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
730
+ ' */';
731
+ }
732
+ if (!style.element) {
733
+ style.element = document.createElement('style');
734
+ style.element.type = 'text/css';
735
+ if (css.media)
736
+ style.element.setAttribute('media', css.media);
737
+ if (HEAD === undefined) {
738
+ HEAD = document.head || document.getElementsByTagName('head')[0];
739
+ }
740
+ HEAD.appendChild(style.element);
741
+ }
742
+ if ('styleSheet' in style.element) {
743
+ style.styles.push(code);
744
+ style.element.styleSheet.cssText = style.styles
745
+ .filter(Boolean)
746
+ .join('\n');
747
+ }
748
+ else {
749
+ const index = style.ids.size - 1;
750
+ const textNode = document.createTextNode(code);
751
+ const nodes = style.element.childNodes;
752
+ if (nodes[index])
753
+ style.element.removeChild(nodes[index]);
754
+ if (nodes.length)
755
+ style.element.insertBefore(textNode, nodes[index]);
756
+ else
757
+ style.element.appendChild(textNode);
758
+ }
759
+ }
760
+ }
761
+
762
+ var __vue_script__$3 = script$3;
763
+
764
+ /* template */
765
+ var __vue_render__$3 = function __vue_render__() {
766
+ var _vm = this;
767
+ var _h = _vm.$createElement;
768
+ var _c = _vm._self._c || _h;
769
+ return _c('div', {
770
+ staticClass: "bm-table-container"
771
+ }, [_c('el-table', _vm._g(_vm._b({
772
+ directives: [{
773
+ name: "loading",
774
+ rawName: "v-loading",
775
+ value: _vm.loading,
776
+ expression: "loading"
777
+ }],
778
+ ref: "table",
779
+ staticClass: "bm-table",
780
+ attrs: {
781
+ "data": _vm.data
782
+ }
783
+ }, 'el-table', _Object$assign__default["default"]({}, {
784
+ border: true
785
+ }, _vm.$attrs), false), _vm.$listeners), [_vm.showSelection ? _c('el-table-column', {
786
+ attrs: {
787
+ "type": "selection",
788
+ "width": "55",
789
+ "align": "center",
790
+ "fixed": "left"
791
+ }
792
+ }) : _vm._e(), _vm._v(" "), _vm.showIndex ? _c('el-table-column', _vm._b({}, 'el-table-column', _vm.indexConfig, false)) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableColumns, function (col, index) {
793
+ return _c('el-table-column', _vm._b({
794
+ key: col.prop + "-col-" + index,
795
+ scopedSlots: _vm._u([col.headerSlot ? {
796
+ key: "header",
797
+ fn: function fn(ref) {
798
+ var column = ref.column;
799
+ var $index = ref.$index;
800
+ return [_vm._t("header-" + col.prop, function () {
801
+ return [_vm._v("\n " + _vm._s(column.label) + "\n ")];
802
+ }, {
803
+ "column": column,
804
+ "index": $index
805
+ })];
806
+ }
807
+ } : null, {
808
+ key: "default",
809
+ fn: function fn(scope) {
810
+ return [typeof col.render === 'function' ? [_c('render-node', {
811
+ attrs: {
812
+ "render": col.render,
813
+ "params": _vm.getRenderParams(scope)
814
+ }
815
+ })] : col.component ? [_c(col.component, _vm._g(_vm._b({
816
+ tag: "component",
817
+ attrs: {
818
+ "row": scope.row,
819
+ "column": scope.column,
820
+ "index": scope.$index
821
+ }
822
+ }, 'component', col.componentProps || {}, false), col.componentEvents || {}))] : col.slot ? [_vm._t(col.prop, null, null, scope)] : [_c('div', {
823
+ staticClass: "bm-table-cell",
824
+ "class": {
825
+ 'bm-cell-active': _vm.getCellActiveClass(scope, col)
826
+ },
827
+ on: {
828
+ "click": function click($event) {
829
+ return _vm.handleCellClick(scope, col);
830
+ }
831
+ }
832
+ }, [_vm._v("\n " + _vm._s(_vm.getTableColumnValue(col, scope)) + "\n ")])]];
833
+ }
834
+ }], null, true)
835
+ }, 'el-table-column', _vm.getColumnProps(col), false));
836
+ }), _vm._v(" "), _vm.showOperation ? _c('el-table-column', _vm._b({
837
+ scopedSlots: _vm._u([{
838
+ key: "default",
839
+ fn: function fn(scope) {
840
+ return [_vm._t("operation", null, null, scope)];
841
+ }
842
+ }], null, true)
843
+ }, 'el-table-column', _vm.mergeOperation, false)) : _vm._e()], 2), _vm._v(" "), _vm.showPagination ? _c('el-pagination', {
844
+ staticClass: "bm-pagination",
845
+ attrs: {
846
+ "current-page": _vm.paginationConfig.pageNum,
847
+ "page-sizes": _vm.paginationConfig.pageSizes || [10, 20, 50, 100],
848
+ "page-size": _vm.paginationConfig.pageSize,
849
+ "layout": "total, sizes, prev, pager, next, jumper",
850
+ "total": _vm.total
851
+ },
852
+ on: {
853
+ "size-change": _vm.handleSizeChange,
854
+ "current-change": _vm.handleCurrentChange
855
+ }
856
+ }) : _vm._e()], 1);
857
+ };
858
+ var __vue_staticRenderFns__$3 = [];
859
+
860
+ /* style */
861
+ var __vue_inject_styles__$3 = function __vue_inject_styles__(inject) {
862
+ if (!inject) return;
863
+ inject("data-v-071ee91e_0", {
864
+ 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}",
865
+ map: undefined,
866
+ media: undefined
867
+ });
868
+ };
869
+ /* scoped */
870
+ var __vue_scope_id__$3 = "data-v-071ee91e";
871
+ /* module identifier */
872
+ var __vue_module_identifier__$3 = undefined;
873
+ /* functional template */
874
+ var __vue_is_functional_template__$3 = false;
875
+ /* style inject SSR */
876
+
877
+ /* style inject shadow dom */
878
+
879
+ var __vue_component__$3 = /*#__PURE__*/normalizeComponent({
880
+ render: __vue_render__$3,
881
+ staticRenderFns: __vue_staticRenderFns__$3
882
+ }, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, createInjector, undefined, undefined);
883
+
884
+ //
885
+ //
886
+ //
887
+ //
888
+ //
889
+ //
890
+ //
891
+ //
892
+ //
893
+ //
894
+ //
895
+ //
896
+ //
897
+ //
898
+ //
899
+ //
900
+ //
901
+ //
902
+ //
903
+ //
904
+ //
905
+
906
+ var script$2 = {
907
+ name: 'UiDialog',
908
+ props: {
909
+ visible: {
910
+ type: Boolean,
911
+ "default": false
912
+ },
913
+ width: {
914
+ type: String,
915
+ "default": '50%'
916
+ },
917
+ closeOnClickModal: {
918
+ type: Boolean,
919
+ "default": false
920
+ },
921
+ closeOnPressEscape: {
922
+ type: Boolean,
923
+ "default": false
924
+ },
925
+ title: {
926
+ type: String,
927
+ "default": '弹框标题'
928
+ },
929
+ defaultFooter: {
930
+ type: Boolean,
931
+ "default": true
932
+ },
933
+ showCancel: {
934
+ type: Boolean,
935
+ "default": false
936
+ },
937
+ cancelText: {
938
+ type: String,
939
+ "default": '取消'
940
+ },
941
+ showConfirm: {
942
+ type: Boolean,
943
+ "default": true
944
+ },
945
+ confirmText: {
946
+ type: String,
947
+ "default": '确定'
948
+ },
949
+ customFooter: {
950
+ type: Boolean,
951
+ "default": false
952
+ }
953
+ },
954
+ computed: {
955
+ show: {
956
+ get: function get() {
957
+ return this.visible;
958
+ },
959
+ set: function set(val) {
960
+ this.$emit('update:visible', val);
961
+ if (!val) this.$emit('close');
962
+ }
963
+ }
964
+ },
965
+ methods: {}
966
+ };
967
+
968
+ /* script */
969
+ var __vue_script__$2 = script$2;
970
+
971
+ /* template */
972
+ var __vue_render__$2 = function __vue_render__() {
973
+ var _vm = this;
974
+ var _h = _vm.$createElement;
975
+ var _c = _vm._self._c || _h;
976
+ return _c('el-dialog', _vm._g(_vm._b({
977
+ staticClass: "bm-dialog",
978
+ attrs: {
979
+ "visible": _vm.show,
980
+ "width": _vm.width || _vm.$attrs.width,
981
+ "close-on-click-modal": _vm.closeOnClickModal,
982
+ "close-on-press-escape": _vm.closeOnPressEscape
983
+ },
984
+ on: {
985
+ "update:visible": function updateVisible($event) {
986
+ _vm.show = $event;
987
+ }
988
+ },
989
+ scopedSlots: _vm._u([{
990
+ key: "title",
991
+ fn: function fn() {
992
+ return [_vm._t("headerPrefix"), _vm._v(" "), _c('div', {
993
+ staticClass: "header-title"
994
+ }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _vm._t("headerSuffix")];
995
+ },
996
+ proxy: true
997
+ }, {
998
+ key: "footer",
999
+ fn: function fn() {
1000
+ return [_vm.defaultFooter ? [_vm.showCancel ? _c('el-button', {
1001
+ on: {
1002
+ "click": function click($event) {
1003
+ return _vm.$emit('cancel');
1004
+ }
1005
+ }
1006
+ }, [_vm._v(_vm._s(_vm.cancelText))]) : _vm._e(), _vm._v(" "), _vm.showConfirm ? _c('el-button', {
1007
+ attrs: {
1008
+ "type": "primary"
1009
+ },
1010
+ on: {
1011
+ "click": function click($event) {
1012
+ return _vm.$emit('confirm');
1013
+ }
1014
+ }
1015
+ }, [_vm._v(" " + _vm._s(_vm.confirmText))]) : _vm._e()] : _vm._e(), _vm._v(" "), _vm.customFooter ? void 0 : _vm._e()];
1016
+ },
1017
+ proxy: true
1018
+ }], null, true)
1019
+ }, 'el-dialog', _vm.$attrs, false), _vm.$listeners), [_vm._v(" "), _vm._t("default")], 2);
1020
+ };
1021
+ var __vue_staticRenderFns__$2 = [];
1022
+
1023
+ /* style */
1024
+ var __vue_inject_styles__$2 = undefined;
1025
+ /* scoped */
1026
+ var __vue_scope_id__$2 = undefined;
1027
+ /* module identifier */
1028
+ var __vue_module_identifier__$2 = undefined;
1029
+ /* functional template */
1030
+ var __vue_is_functional_template__$2 = false;
1031
+ /* style inject */
1032
+
1033
+ /* style inject SSR */
1034
+
1035
+ /* style inject shadow dom */
1036
+
1037
+ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
1038
+ render: __vue_render__$2,
1039
+ staticRenderFns: __vue_staticRenderFns__$2
1040
+ }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
1041
+
1042
+ //
1043
+ //
1044
+ //
1045
+ //
1046
+ //
1047
+ //
1048
+ //
1049
+ //
1050
+ //
1051
+
1052
+ // 权限扩展,遇到再考虑
1053
+ /**
1054
+ * @desc 按钮组
1055
+ * @params btns 按钮配置数组,支持按钮的所有属性(通过attrs配置)
1056
+ * @params disabledAll 禁用所有按钮组
1057
+ */
1058
+ var script$1 = {
1059
+ name: "UiBtns",
1060
+ props: {
1061
+ btns: {
1062
+ type: Array,
1063
+ "default": function _default() {
1064
+ return [];
1065
+ }
1066
+ },
1067
+ disabledAll: {
1068
+ type: Boolean,
1069
+ "default": false
1070
+ },
1071
+ context: {
1072
+ // 上下文,
1073
+ type: [Object, Array, String, Number, Boolean],
1074
+ "default": null
1075
+ }
1076
+ },
1077
+ methods: {
1078
+ handleDisabled: function handleDisabled(btn) {
1079
+ if (this.disabledAll) return true;
1080
+ if (typeof btn.disabled === "boolean") return btn.disabled;
1081
+ if (typeof btn.disabled === "function") return btn.disabled(this.context);
1082
+ return false;
1083
+ },
1084
+ handleClick: function handleClick(btn, event) {
1085
+ var actionFn = typeof btn.action === "function";
1086
+ if (actionFn && btn.eventName) {
1087
+ console.warn("\u6309\u94AE\u3010".concat(btn.label, "\u3011\u540C\u65F6\u914D\u7F6E\u4E86action\u548CeventName\uFF0C\u53EF\u80FD\u5BFC\u81F4\u91CD\u590D\u6267\u884C"));
1088
+ }
1089
+ if (actionFn) {
1090
+ btn.action.call(this, {
1091
+ btn: btn,
1092
+ event: event,
1093
+ context: this.context
1094
+ });
1095
+ }
1096
+ if (btn.eventName) {
1097
+ this.$emit(btn.eventName, {
1098
+ btn: btn,
1099
+ event: event,
1100
+ context: this.context
1101
+ });
1102
+ }
1103
+ }
1104
+ }
1105
+ };
1106
+
1107
+ /* script */
1108
+ var __vue_script__$1 = script$1;
1109
+
1110
+ /* template */
1111
+ var __vue_render__$1 = function __vue_render__() {
1112
+ var _vm = this;
1113
+ var _h = _vm.$createElement;
1114
+ var _c = _vm._self._c || _h;
1115
+ return _c('div', {
1116
+ staticClass: "bm-btns"
1117
+ }, _vm._l(_vm.btns, function (btn, index) {
1118
+ return _c('el-button', _vm._b({
1119
+ key: "" + btn.label + index,
1120
+ attrs: {
1121
+ "type": btn.type || 'primary',
1122
+ "disabled": _vm.handleDisabled(btn)
1123
+ },
1124
+ on: {
1125
+ "click": function click($event) {
1126
+ return _vm.handleClick(btn, $event);
1127
+ }
1128
+ }
1129
+ }, 'el-button', btn.attrs, false), [_vm._v("\n " + _vm._s(btn.label) + "\n ")]);
1130
+ }), 1);
1131
+ };
1132
+ var __vue_staticRenderFns__$1 = [];
1133
+
1134
+ /* style */
1135
+ var __vue_inject_styles__$1 = function __vue_inject_styles__(inject) {
1136
+ if (!inject) return;
1137
+ inject("data-v-2608b465_0", {
1138
+ source: ".bm-btns[data-v-2608b465]{display:inline-block}",
1139
+ map: undefined,
1140
+ media: undefined
1141
+ });
1142
+ };
1143
+ /* scoped */
1144
+ var __vue_scope_id__$1 = "data-v-2608b465";
1145
+ /* module identifier */
1146
+ var __vue_module_identifier__$1 = undefined;
1147
+ /* functional template */
1148
+ var __vue_is_functional_template__$1 = false;
1149
+ /* style inject SSR */
1150
+
1151
+ /* style inject shadow dom */
1152
+
1153
+ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
1154
+ render: __vue_render__$1,
1155
+ staticRenderFns: __vue_staticRenderFns__$1
1156
+ }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, createInjector, undefined, undefined);
1157
+
1158
+ //
1159
+ //
1160
+ //
1161
+ //
1162
+ //
1163
+ //
1164
+
1165
+ var defaultEmptyObject = {};
1166
+ var script = {
1167
+ name: "Status",
1168
+ props: {
1169
+ row: {
1170
+ type: Object,
1171
+ "default": function _default() {
1172
+ return defaultEmptyObject;
1173
+ }
1174
+ },
1175
+ // row 有传值时statusName将会当做字段名
1176
+ statusName: {
1177
+ type: String,
1178
+ required: true
1179
+ }
1180
+ },
1181
+ computed: {
1182
+ isDefaultEmptyRow: function isDefaultEmptyRow() {
1183
+ return this.row === defaultEmptyObject;
1184
+ },
1185
+ currentStatusName: function currentStatusName() {
1186
+ // row是默认值的空对象
1187
+ if (this.isDefaultEmptyRow) {
1188
+ return this.statusName;
1189
+ } else {
1190
+ if (!this.statusName) return "";
1191
+ return this.row[this.statusName];
1192
+ }
1193
+ },
1194
+ className: function className() {
1195
+ var _context, _context2, _context3, _context4;
1196
+ if (!this.currentStatusName) return "";
1197
+ var basic = this.currentStatusName ? "bm-status-basic" : "";
1198
+ if (_startsWithInstanceProperty__default["default"](_context = this.currentStatusName).call(_context, "待")) {
1199
+ return "bm-status-tag--info ".concat(basic);
1200
+ }
1201
+ if (_endsWithInstanceProperty__default["default"](_context2 = this.currentStatusName).call(_context2, "中")) {
1202
+ return "bm-status-tag--primary ".concat(basic);
1203
+ }
1204
+ if (_endsWithInstanceProperty__default["default"](_context3 = this.currentStatusName).call(_context3, "成功")) {
1205
+ return "bm-status-tag--success ".concat(basic);
1206
+ }
1207
+ if (_endsWithInstanceProperty__default["default"](_context4 = this.currentStatusName).call(_context4, "失败")) {
1208
+ return "bm-status-tag--error ".concat(basic);
1209
+ }
1210
+ return basic;
1211
+ }
1212
+ }
1213
+ };
1214
+
1215
+ /* script */
1216
+ var __vue_script__ = script;
1217
+
1218
+ /* template */
1219
+ var __vue_render__ = function __vue_render__() {
1220
+ var _vm = this;
1221
+ var _h = _vm.$createElement;
1222
+ var _c = _vm._self._c || _h;
1223
+ return _c('div', {
1224
+ staticClass: "bm-status-tag",
1225
+ "class": _vm.className
1226
+ }, [_vm._v("\n " + _vm._s(_vm.currentStatusName ? _vm.currentStatusName || "未知状态" : "-") + "\n")]);
1227
+ };
1228
+ var __vue_staticRenderFns__ = [];
1229
+
1230
+ /* style */
1231
+ var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
1232
+ if (!inject) return;
1233
+ inject("data-v-0b5907a5_0", {
1234
+ source: ".bm-status-basic[data-v-0b5907a5]{padding:0 8px;line-height:1.5;border:1px solid #dcdfe6;border-radius:4px;background-color:#fff;box-sizing:border-box;vertical-align:middle}.bm-status-tag[data-v-0b5907a5]{display:inline-block;color:#606266;font-size:12px}.bm-status-tag--info[data-v-0b5907a5]{color:#909399;border:1px solid #d3d4d6;background-color:#f4f4f5}.bm-status-tag--primary[data-v-0b5907a5]{color:#409eff;border:1px solid #b3d8ff;background-color:#ecf5ff}.bm-status-tag--success[data-v-0b5907a5]{color:#67c23a;border:1px solid #c2e7b0;background-color:#f0f9eb}.bm-status-tag--error[data-v-0b5907a5]{color:#f56c6c;border:1px solid #fbc4c4;background-color:#fef0f0}",
1235
+ map: undefined,
1236
+ media: undefined
1237
+ });
1238
+ };
1239
+ /* scoped */
1240
+ var __vue_scope_id__ = "data-v-0b5907a5";
1241
+ /* module identifier */
1242
+ var __vue_module_identifier__ = undefined;
1243
+ /* functional template */
1244
+ var __vue_is_functional_template__ = false;
1245
+ /* style inject SSR */
1246
+
1247
+ /* style inject shadow dom */
1248
+
1249
+ var __vue_component__ = /*#__PURE__*/normalizeComponent({
1250
+ render: __vue_render__,
1251
+ staticRenderFns: __vue_staticRenderFns__
1252
+ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, createInjector, undefined, undefined);
1253
+
1254
+ var components = [__vue_component__$4, __vue_component__$3, __vue_component__$2, __vue_component__$1, __vue_component__];
1255
+ var _install = function install(VueInstance) {
1256
+ if (!VueInstance.prototype.$ELEMENT) {
1257
+ console.error("使用BackendManagementUI前请先注册ElementUI");
1258
+ return;
1259
+ }
1260
+ if (!VueInstance || !VueInstance.component) {
1261
+ console.warn("Vue is required");
1262
+ return;
1263
+ }
1264
+ if (_install.installed) return;
1265
+ _forEachInstanceProperty__default["default"](components).call(components, function (component) {
1266
+ var componentName = component.name || component.__name;
1267
+ if (componentName) VueInstance.component(componentName, component);
1268
+ });
1269
+ _install.installed = true;
1270
+ };
1271
+ if (typeof window !== "undefined" && window.Vue) {
1272
+ window.Vue.use({
1273
+ install: _install
1274
+ });
1275
+ }
1276
+
1277
+ // 导出:支持全局导入 + 按需导入
1278
+ var index = {
1279
+ version: "1.0.0",
1280
+ install: _install,
1281
+ UiForm: __vue_component__$4,
1282
+ UiTable: __vue_component__$3,
1283
+ UiDialog: __vue_component__$2,
1284
+ UiBtns: __vue_component__$1,
1285
+ Status: __vue_component__
1286
+ };
1287
+
1288
+ exports.Status = __vue_component__;
1289
+ exports.UiBtns = __vue_component__$1;
1290
+ exports.UiDialog = __vue_component__$2;
1291
+ exports.UiForm = __vue_component__$4;
1292
+ exports.UiTable = __vue_component__$3;
1293
+ exports["default"] = index;