@panpanzhao/component-ui 0.0.1

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,2276 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "/dist/";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 62);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, exports) {
91
+
92
+ module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
93
+
94
+ /***/ }),
95
+ /* 1 */
96
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
97
+
98
+ "use strict";
99
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
100
+ /* globals __VUE_SSR_CONTEXT__ */
101
+
102
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
103
+ // This module is a runtime utility for cleaner component module output and will
104
+ // be included in the final webpack user bundle.
105
+
106
+ function normalizeComponent(
107
+ scriptExports,
108
+ render,
109
+ staticRenderFns,
110
+ functionalTemplate,
111
+ injectStyles,
112
+ scopeId,
113
+ moduleIdentifier /* server only */,
114
+ shadowMode /* vue-cli only */
115
+ ) {
116
+ // Vue.extend constructor export interop
117
+ var options =
118
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
119
+
120
+ // render functions
121
+ if (render) {
122
+ options.render = render
123
+ options.staticRenderFns = staticRenderFns
124
+ options._compiled = true
125
+ }
126
+
127
+ // functional template
128
+ if (functionalTemplate) {
129
+ options.functional = true
130
+ }
131
+
132
+ // scopedId
133
+ if (scopeId) {
134
+ options._scopeId = 'data-v-' + scopeId
135
+ }
136
+
137
+ var hook
138
+ if (moduleIdentifier) {
139
+ // server build
140
+ hook = function (context) {
141
+ // 2.3 injection
142
+ context =
143
+ context || // cached call
144
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
145
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
146
+ // 2.2 with runInNewContext: true
147
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
148
+ context = __VUE_SSR_CONTEXT__
149
+ }
150
+ // inject component styles
151
+ if (injectStyles) {
152
+ injectStyles.call(this, context)
153
+ }
154
+ // register component module identifier for async chunk inferrence
155
+ if (context && context._registeredComponents) {
156
+ context._registeredComponents.add(moduleIdentifier)
157
+ }
158
+ }
159
+ // used by ssr in case component is cached and beforeCreate
160
+ // never gets called
161
+ options._ssrRegister = hook
162
+ } else if (injectStyles) {
163
+ hook = shadowMode
164
+ ? function () {
165
+ injectStyles.call(
166
+ this,
167
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
168
+ )
169
+ }
170
+ : injectStyles
171
+ }
172
+
173
+ if (hook) {
174
+ if (options.functional) {
175
+ // for template-only hot-reload because in that case the render fn doesn't
176
+ // go through the normalizer
177
+ options._injectStyles = hook
178
+ // register for functional component in vue file
179
+ var originalRender = options.render
180
+ options.render = function renderWithStyleInjection(h, context) {
181
+ hook.call(context)
182
+ return originalRender(h, context)
183
+ }
184
+ } else {
185
+ // inject component registration as beforeCreate hook
186
+ var existing = options.beforeCreate
187
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
188
+ }
189
+ }
190
+
191
+ return {
192
+ exports: scriptExports,
193
+ options: options
194
+ }
195
+ }
196
+
197
+
198
+ /***/ }),
199
+ /* 2 */
200
+ /***/ (function(module, exports) {
201
+
202
+ module.exports = require("component-ui/lib/utils/formula");
203
+
204
+ /***/ }),
205
+ /* 3 */
206
+ /***/ (function(module, exports) {
207
+
208
+ module.exports = require("lodash");
209
+
210
+ /***/ }),
211
+ /* 4 */
212
+ /***/ (function(module, exports) {
213
+
214
+ module.exports = require("element-ui/lib/button");
215
+
216
+ /***/ }),
217
+ /* 5 */
218
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
219
+
220
+ "use strict";
221
+ // ESM COMPAT FLAG
222
+ __webpack_require__.r(__webpack_exports__);
223
+
224
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=template&id=42f43bc0&
225
+ var render = function render() {
226
+ var _vm = this,
227
+ _c = _vm._self._c
228
+ return _c(
229
+ "div",
230
+ { staticClass: "form" },
231
+ [
232
+ _vm._t("default", function () {
233
+ return [
234
+ _c(
235
+ "el-form",
236
+ _vm._g(
237
+ _vm._b({ ref: "form" }, "el-form", _vm.formProps, false),
238
+ _vm.formListeners
239
+ ),
240
+ [
241
+ _c(
242
+ "el-row",
243
+ _vm._b({}, "el-row", _vm.rowProps, false),
244
+ [
245
+ _vm._l(_vm.filterFormItems, function (item) {
246
+ return [
247
+ _c(
248
+ "el-col",
249
+ { key: item.prop, attrs: { span: item.span } },
250
+ [
251
+ _c(
252
+ "form-item",
253
+ _vm._g(
254
+ _vm._b(
255
+ {
256
+ key: item.prop,
257
+ attrs: {
258
+ config: item,
259
+ actions: _vm.actionItem[item.prop],
260
+ value: _vm.formModel[item.prop],
261
+ },
262
+ on: { formItemChange: _vm.formItemChange },
263
+ },
264
+ "form-item",
265
+ item,
266
+ false
267
+ ),
268
+ item.on
269
+ )
270
+ ),
271
+ ],
272
+ 1
273
+ ),
274
+ ]
275
+ }),
276
+ ],
277
+ 2
278
+ ),
279
+ ],
280
+ 1
281
+ ),
282
+ ]
283
+ }),
284
+ ],
285
+ 2
286
+ )
287
+ }
288
+ var staticRenderFns = []
289
+ render._withStripped = true
290
+
291
+
292
+ // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=42f43bc0&
293
+
294
+ // EXTERNAL MODULE: external "element-ui/lib/form"
295
+ var form_ = __webpack_require__(12);
296
+ var form_default = /*#__PURE__*/__webpack_require__.n(form_);
297
+
298
+ // EXTERNAL MODULE: external "element-ui/lib/row"
299
+ var row_ = __webpack_require__(13);
300
+ var row_default = /*#__PURE__*/__webpack_require__.n(row_);
301
+
302
+ // EXTERNAL MODULE: external "element-ui/lib/col"
303
+ var col_ = __webpack_require__(14);
304
+ var col_default = /*#__PURE__*/__webpack_require__.n(col_);
305
+
306
+ // EXTERNAL MODULE: external "component-ui/lib/components/form-item"
307
+ var form_item_ = __webpack_require__(15);
308
+ var form_item_default = /*#__PURE__*/__webpack_require__.n(form_item_);
309
+
310
+ // EXTERNAL MODULE: external "component-ui/lib/utils/formula"
311
+ var formula_ = __webpack_require__(2);
312
+
313
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=script&lang=js&
314
+
315
+
316
+
317
+
318
+
319
+ /* harmony default export */ var formvue_type_script_lang_js_ = ({
320
+ name: "Form",
321
+ componentName: "Form",
322
+ components: {
323
+ elForm: form_default.a,
324
+ elRow: row_default.a,
325
+ elCol: col_default.a,
326
+ FormItem: form_item_default.a
327
+ },
328
+ provide: function provide() {
329
+ return {
330
+ form: this
331
+ };
332
+ },
333
+ props: {
334
+ prop: String,
335
+ formItems: {
336
+ type: Array,
337
+ default: function _default() {
338
+ return [];
339
+ }
340
+ },
341
+ actions: {
342
+ type: Array,
343
+ default: function _default() {
344
+ return [];
345
+ }
346
+ },
347
+ on: {
348
+ type: Object,
349
+ default: function _default() {
350
+ return {};
351
+ }
352
+ },
353
+ formModel: {
354
+ type: Object,
355
+ default: function _default() {
356
+ return {};
357
+ }
358
+ },
359
+ request: Function
360
+ },
361
+ computed: {
362
+ formProps: function formProps() {
363
+ return Object.assign({}, this.$attrs, {
364
+ model: this.formModel
365
+ });
366
+ },
367
+ formListeners: function formListeners() {
368
+ return Object.assign({}, this.$listeners);
369
+ },
370
+ rowProps: function rowProps() {
371
+ return Object.assign({}, this.$attrs);
372
+ },
373
+ filterFormItems: function filterFormItems() {
374
+ var _this = this;
375
+ return this.formItems.filter(function (item) {
376
+ if (item.show === false) {
377
+ return false;
378
+ }
379
+ if (typeof item.show === "function" && !item.show.call(_this, {
380
+ form: _this,
381
+ config: item
382
+ })) {
383
+ return false;
384
+ }
385
+ if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel)) {
386
+ return false;
387
+ }
388
+ return true;
389
+ });
390
+ },
391
+ actionItem: function actionItem() {
392
+ var relItem = {};
393
+ this.actions.forEach(function (item) {
394
+ if (!relItem[item.trigger]) {
395
+ relItem[item.trigger] = [];
396
+ }
397
+ relItem[item.trigger].push(item);
398
+ });
399
+ return relItem;
400
+ }
401
+ },
402
+ data: function data() {
403
+ return {
404
+ defaultModel: {},
405
+ formItemLayout: {}
406
+ };
407
+ },
408
+ created: function created() {
409
+ var _this2 = this;
410
+ this.formItems.forEach(function (item) {
411
+ _this2.formItemLayout[item.prop] = item;
412
+ _this2.defaultModel[item.prop] = item.value;
413
+ //初始化数据值
414
+ _this2.$set(_this2.formModel, item.prop, item.value || null);
415
+ });
416
+ },
417
+ methods: {
418
+ validate: function validate(callback) {
419
+ return this.$refs.form.validate(callback);
420
+ },
421
+ validateField: function validateField(props, callback) {
422
+ return this.$refs.form.validateField(props, callback);
423
+ },
424
+ resetFields: function resetFields() {
425
+ for (var key in this.defaultModel) {
426
+ if (this.formItemLayout[key]) {
427
+ this.formItemLayout[key].value = this.defaultModel[key];
428
+ }
429
+ }
430
+ this.$refs.form.resetFields();
431
+ },
432
+ clearValidate: function clearValidate(props) {
433
+ return this.$refs.form.clearValidate(props);
434
+ },
435
+ formItemChange: function formItemChange(config) {
436
+ this.$emit("formChange", {
437
+ formProp: this.prop,
438
+ formModel: this.formModel,
439
+ formConfig: this.formItemLayout,
440
+ itemProp: config.itemProp,
441
+ itemModel: config.itemVal,
442
+ itemConfig: config.itemConfig
443
+ });
444
+ }
445
+ }
446
+ });
447
+ // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=script&lang=js&
448
+ /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
449
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
450
+ var componentNormalizer = __webpack_require__(1);
451
+
452
+ // CONCATENATED MODULE: ./src/components/form/src/form.vue
453
+
454
+
455
+
456
+
457
+
458
+ /* normalize component */
459
+
460
+ var component = Object(componentNormalizer["a" /* default */])(
461
+ src_formvue_type_script_lang_js_,
462
+ render,
463
+ staticRenderFns,
464
+ false,
465
+ null,
466
+ null,
467
+ null
468
+
469
+ )
470
+
471
+ /* harmony default export */ var src_form = (component.exports);
472
+ // CONCATENATED MODULE: ./src/components/form/index.js
473
+
474
+ src_form.install = function (Vue) {
475
+ Vue.component(src_form.name, src_form);
476
+ };
477
+ /* harmony default export */ var components_form = __webpack_exports__["default"] = (src_form);
478
+
479
+ /***/ }),
480
+ /* 6 */
481
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
482
+
483
+ "use strict";
484
+ // ESM COMPAT FLAG
485
+ __webpack_require__.r(__webpack_exports__);
486
+
487
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=template&id=82a59c42&
488
+ var render = function render() {
489
+ var _vm = this,
490
+ _c = _vm._self._c
491
+ return _c(
492
+ "div",
493
+ { staticClass: "form-view" },
494
+ [
495
+ _vm._t("default", function () {
496
+ return [
497
+ _c(
498
+ "el-descriptions",
499
+ _vm._g(
500
+ _vm._b({ ref: "form" }, "el-descriptions", _vm.formProps, false),
501
+ _vm.formListeners
502
+ ),
503
+ _vm._l(_vm.filterFormItems, function (item) {
504
+ return _c(
505
+ "el-descriptions-item",
506
+ _vm._g(
507
+ _vm._b(
508
+ { key: item.prop },
509
+ "el-descriptions-item",
510
+ item,
511
+ false
512
+ ),
513
+ item.on
514
+ ),
515
+ [
516
+ _vm._v(
517
+ "\n " + _vm._s(_vm.formModel[item.prop]) + "\n "
518
+ ),
519
+ ]
520
+ )
521
+ }),
522
+ 1
523
+ ),
524
+ ]
525
+ }),
526
+ ],
527
+ 2
528
+ )
529
+ }
530
+ var staticRenderFns = []
531
+ render._withStripped = true
532
+
533
+
534
+ // CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=82a59c42&
535
+
536
+ // EXTERNAL MODULE: external "element-ui/lib/descriptions"
537
+ var descriptions_ = __webpack_require__(16);
538
+ var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
539
+
540
+ // EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
541
+ var descriptions_item_ = __webpack_require__(17);
542
+ var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
543
+
544
+ // EXTERNAL MODULE: external "component-ui/lib/utils/formula"
545
+ var formula_ = __webpack_require__(2);
546
+
547
+ // EXTERNAL MODULE: external "lodash"
548
+ var external_lodash_ = __webpack_require__(3);
549
+
550
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=script&lang=js&
551
+
552
+
553
+
554
+
555
+ /* harmony default export */ var srcvue_type_script_lang_js_ = ({
556
+ name: "FormView",
557
+ componentName: "FormView",
558
+ components: {
559
+ elDescriptions: descriptions_default.a,
560
+ elDescriptionsItem: descriptions_item_default.a
561
+ },
562
+ props: {
563
+ prop: String,
564
+ formItems: {
565
+ type: Array,
566
+ default: function _default() {
567
+ return [];
568
+ }
569
+ },
570
+ formModel: {
571
+ type: Object,
572
+ default: function _default() {
573
+ return {};
574
+ }
575
+ }
576
+ },
577
+ computed: {
578
+ formProps: function formProps() {
579
+ return Object.assign({
580
+ border: true
581
+ }, this.$attrs);
582
+ },
583
+ formListeners: function formListeners() {
584
+ return Object.assign({}, this.$listeners);
585
+ },
586
+ rowProps: function rowProps() {
587
+ return Object.assign({}, this.$attrs);
588
+ },
589
+ filterFormItems: function filterFormItems() {
590
+ var _this = this;
591
+ return this.formItems.filter(function (item) {
592
+ if (item.show === false) {
593
+ return false;
594
+ }
595
+ if (typeof item.show === "function" && !item.show.call(_this, {
596
+ form: _this,
597
+ config: item
598
+ })) {
599
+ return false;
600
+ }
601
+ if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel)) {
602
+ return false;
603
+ }
604
+ return true;
605
+ });
606
+ }
607
+ },
608
+ data: function data() {
609
+ return {
610
+ formItemLayout: {}
611
+ };
612
+ },
613
+ created: function created() {
614
+ var _this2 = this;
615
+ this.formItems.forEach(function (item) {
616
+ _this2.formItemLayout[item.prop] = item;
617
+ //初始化数据值
618
+ _this2.$set(_this2.formModel, item.prop, null);
619
+ });
620
+ },
621
+ methods: {
622
+ setFormModel: function setFormModel(model) {
623
+ Object(external_lodash_["merge"])(this.formModel, model);
624
+ }
625
+ }
626
+ });
627
+ // CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=script&lang=js&
628
+ /* harmony default export */ var form_view_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
629
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
630
+ var componentNormalizer = __webpack_require__(1);
631
+
632
+ // CONCATENATED MODULE: ./src/components/form-view/src/index.vue
633
+
634
+
635
+
636
+
637
+
638
+ /* normalize component */
639
+
640
+ var component = Object(componentNormalizer["a" /* default */])(
641
+ form_view_srcvue_type_script_lang_js_,
642
+ render,
643
+ staticRenderFns,
644
+ false,
645
+ null,
646
+ null,
647
+ null
648
+
649
+ )
650
+
651
+ /* harmony default export */ var src = (component.exports);
652
+ // CONCATENATED MODULE: ./src/components/form-view/index.js
653
+
654
+ src.install = function (Vue) {
655
+ Vue.component(src.name, src);
656
+ };
657
+ /* harmony default export */ var form_view = __webpack_exports__["default"] = (src);
658
+
659
+ /***/ }),
660
+ /* 7 */
661
+ /***/ (function(module, exports) {
662
+
663
+ module.exports = require("element-ui/lib/tabs");
664
+
665
+ /***/ }),
666
+ /* 8 */
667
+ /***/ (function(module, exports) {
668
+
669
+ module.exports = require("element-ui/lib/tab-pane");
670
+
671
+ /***/ }),
672
+ /* 9 */
673
+ /***/ (function(module, exports) {
674
+
675
+ module.exports = require("element-ui/lib/collapse");
676
+
677
+ /***/ }),
678
+ /* 10 */
679
+ /***/ (function(module, exports) {
680
+
681
+ module.exports = require("element-ui/lib/collapse-item");
682
+
683
+ /***/ }),
684
+ /* 11 */,
685
+ /* 12 */
686
+ /***/ (function(module, exports) {
687
+
688
+ module.exports = require("element-ui/lib/form");
689
+
690
+ /***/ }),
691
+ /* 13 */
692
+ /***/ (function(module, exports) {
693
+
694
+ module.exports = require("element-ui/lib/row");
695
+
696
+ /***/ }),
697
+ /* 14 */
698
+ /***/ (function(module, exports) {
699
+
700
+ module.exports = require("element-ui/lib/col");
701
+
702
+ /***/ }),
703
+ /* 15 */
704
+ /***/ (function(module, exports) {
705
+
706
+ module.exports = require("component-ui/lib/components/form-item");
707
+
708
+ /***/ }),
709
+ /* 16 */
710
+ /***/ (function(module, exports) {
711
+
712
+ module.exports = require("element-ui/lib/descriptions");
713
+
714
+ /***/ }),
715
+ /* 17 */
716
+ /***/ (function(module, exports) {
717
+
718
+ module.exports = require("element-ui/lib/descriptions-item");
719
+
720
+ /***/ }),
721
+ /* 18 */
722
+ /***/ (function(module, exports) {
723
+
724
+ module.exports = require("element-ui/lib/dialog");
725
+
726
+ /***/ }),
727
+ /* 19 */
728
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
729
+
730
+ "use strict";
731
+ // ESM COMPAT FLAG
732
+ __webpack_require__.r(__webpack_exports__);
733
+
734
+ // EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
735
+ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
736
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
737
+
738
+ // EXTERNAL MODULE: ./src/components/form/index.js + 5 modules
739
+ var components_form = __webpack_require__(5);
740
+
741
+ // CONCATENATED MODULE: ./src/components/form-group/src/content.js
742
+
743
+
744
+ /* harmony default export */ var content = ({
745
+ name: "Content",
746
+ inheritAttrs: false,
747
+ components: {
748
+ Form: components_form["default"]
749
+ },
750
+ props: {
751
+ control: String,
752
+ prop: String,
753
+ label: String,
754
+ actions: Array,
755
+ formItems: Array,
756
+ on: Object,
757
+ render: Function,
758
+ slots: Object,
759
+ config: Object,
760
+ show: {
761
+ type: [Boolean, Function],
762
+ default: true
763
+ }
764
+ },
765
+ data: function data() {
766
+ return {
767
+ formModel: {}
768
+ };
769
+ },
770
+ computed: {
771
+ _formGroup: function _formGroup() {
772
+ var parent = this.$parent;
773
+ while (parent) {
774
+ if (parent.$options.componentName !== 'FormGroup') {
775
+ parent = parent.$parent;
776
+ } else {
777
+ return parent;
778
+ }
779
+ }
780
+ return false;
781
+ }
782
+ },
783
+ created: function created() {
784
+ if (this.prop && this._formGroup) {
785
+ this._formGroup.formModel[this.prop] = this.formModel;
786
+ }
787
+ },
788
+ mounted: function mounted() {
789
+ if (this.prop && this._formGroup && this.$refs.form) {
790
+ this._formGroup.formLayout[this.prop] = this.$refs.form.formItemLayout;
791
+ }
792
+ },
793
+ methods: {
794
+ validate: function validate(callback) {
795
+ return this.$refs.form.validate(callback);
796
+ },
797
+ resetForm: function resetForm() {
798
+ this.$refs.form.resetFields();
799
+ }
800
+ },
801
+ render: function render(h) {
802
+ if (this.slots.form) {
803
+ var vForm = typeof this.slots.form === "function" ? this.slots.form.call(this, h) : this.slots.form;
804
+ return vForm;
805
+ }
806
+ var formProp = {
807
+ attrs: Object.assign({
808
+ prop: this.prop,
809
+ formModel: this.formModel,
810
+ actions: this.actions,
811
+ formItems: this.formItems
812
+ }, this.$attrs),
813
+ on: this.on
814
+ };
815
+ return h(components_form["default"], babel_helper_vue_jsx_merge_props_default()([{
816
+ "ref": "form"
817
+ }, formProp]));
818
+ }
819
+ });
820
+ // EXTERNAL MODULE: external "element-ui/lib/tabs"
821
+ var tabs_ = __webpack_require__(7);
822
+ var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
823
+
824
+ // EXTERNAL MODULE: external "element-ui/lib/tab-pane"
825
+ var tab_pane_ = __webpack_require__(8);
826
+ var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
827
+
828
+ // EXTERNAL MODULE: external "element-ui/lib/collapse"
829
+ var collapse_ = __webpack_require__(9);
830
+ var collapse_default = /*#__PURE__*/__webpack_require__.n(collapse_);
831
+
832
+ // EXTERNAL MODULE: external "element-ui/lib/collapse-item"
833
+ var collapse_item_ = __webpack_require__(10);
834
+ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
835
+
836
+ // CONCATENATED MODULE: ./src/components/form-group/src/index.js
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+ /* harmony default export */ var src = ({
846
+ name: "FormGroup",
847
+ componentName: "FormGroup",
848
+ components: {
849
+ elTabs: tabs_default.a,
850
+ elTabPane: tab_pane_default.a,
851
+ elCollapse: collapse_default.a,
852
+ elCollapseItem: collapse_item_default.a
853
+ },
854
+ props: {
855
+ request: Function,
856
+ control: {
857
+ type: String,
858
+ default: "Collapse"
859
+ },
860
+ actions: {
861
+ type: Array,
862
+ default: function _default() {
863
+ return [];
864
+ }
865
+ },
866
+ items: {
867
+ type: Array,
868
+ default: function _default() {
869
+ return [];
870
+ }
871
+ },
872
+ formModel: {
873
+ type: Object,
874
+ default: function _default() {
875
+ return {};
876
+ }
877
+ },
878
+ on: {
879
+ type: Object,
880
+ default: function _default() {
881
+ return {};
882
+ }
883
+ }
884
+ },
885
+ data: function data() {
886
+ return {
887
+ formLayout: {},
888
+ openedCode: null
889
+ };
890
+ },
891
+ computed: {
892
+ actionFormMap: function actionFormMap() {
893
+ var _this = this;
894
+ var actionForm = {};
895
+ this.actions.forEach(function (action) {
896
+ if (!action.trigger) {
897
+ return false;
898
+ }
899
+ var formCode = action.trigger.formCode;
900
+ if (!actionForm[formCode]) {
901
+ actionForm[formCode] = [];
902
+ }
903
+ actionForm[formCode].push({
904
+ trigger: action.trigger.fieldCode,
905
+ event: action.event,
906
+ target: null,
907
+ //action.target
908
+ exec: function exec(config) {
909
+ var _action$exec;
910
+ var targetConfig = {};
911
+ var targetForm = {};
912
+ action.target.forEach(function (formTarget) {
913
+ if (!targetConfig[formTarget.formCode]) {
914
+ targetConfig[formTarget.formCode] = {};
915
+ }
916
+ targetConfig[formTarget.formCode][formTarget.fieldCode] = _this.formLayout[formTarget.formCode][formTarget.fieldCode];
917
+ targetForm[formTarget.formCode] = _this.formModel[formTarget.formCode];
918
+ });
919
+ config.targetConfig = targetConfig;
920
+ config.targetForm = targetForm;
921
+ for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
922
+ arg[_key - 1] = arguments[_key];
923
+ }
924
+ (_action$exec = action.exec).call.apply(_action$exec, [_this, config].concat(arg));
925
+ }
926
+ });
927
+ });
928
+ return actionForm;
929
+ }
930
+ },
931
+ methods: {
932
+ validate: function validate(callback) {
933
+ var _this2 = this;
934
+ var promise;
935
+ // if no callback, return promise
936
+ if (typeof callback !== "function" && Promise) {
937
+ promise = new Promise(function (resolve, reject) {
938
+ callback = function callback(valid, invalidForms) {
939
+ valid ? resolve(valid) : reject(invalidForms);
940
+ };
941
+ });
942
+ }
943
+ var valid = true;
944
+ var count = 0;
945
+ // 如果需要验证的表格为空,调用验证时立刻返回callback
946
+ if (this.items.length === 0 && callback) {
947
+ callback(true);
948
+ }
949
+ var invalidForms = {};
950
+ this.items.forEach(function (form) {
951
+ var formNode = _this2.$refs[form.prop];
952
+ if (!formNode) {
953
+ if (typeof callback === "function" && ++count === _this2.items.length) {
954
+ callback(valid, invalidForms);
955
+ }
956
+ return true;
957
+ }
958
+ formNode.validate(function (flag, msgObj) {
959
+ if (!flag) {
960
+ valid = false;
961
+ invalidForms[form.prop] = msgObj;
962
+ }
963
+ if (typeof callback === "function" && ++count === _this2.items.length) {
964
+ callback(valid, invalidForms);
965
+ }
966
+ });
967
+ });
968
+ if (promise) {
969
+ return promise;
970
+ }
971
+ },
972
+ reset: function reset() {
973
+ var _this3 = this;
974
+ this.items.forEach(function (form) {
975
+ var formNode = _this3.$refs[form.prop];
976
+ if (!formNode) {
977
+ return true;
978
+ }
979
+ formNode.resetForm();
980
+ });
981
+ },
982
+ formNode: function formNode(form) {
983
+ var h = this.$createElement;
984
+ var formProp = {
985
+ attrs: Object.assign({
986
+ actions: this.actionFormMap[form.prop]
987
+ }, form),
988
+ on: form.on
989
+ };
990
+ return h(content, babel_helper_vue_jsx_merge_props_default()([{
991
+ "ref": form.prop,
992
+ "key": form.prop,
993
+ "attrs": {
994
+ "config": form,
995
+ "control": this.control
996
+ }
997
+ }, formProp]));
998
+ },
999
+ renderTab: function renderTab(h, filterItems) {
1000
+ var _this4 = this;
1001
+ var itemNode = filterItems.map(function (item) {
1002
+ if (typeof item.render === "function") {
1003
+ return item.render(h, _this4.formModel, item);
1004
+ }
1005
+ return h("el-tab-pane", {
1006
+ "key": item.prop,
1007
+ "attrs": {
1008
+ "name": item.prop,
1009
+ "label": item.label
1010
+ }
1011
+ }, [h("template", {
1012
+ "slot": "label"
1013
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this4, h) : item.slots && item.slots.title]), _this4.formNode(item)]);
1014
+ });
1015
+ var tabsProp = {
1016
+ attrs: {
1017
+ type: "border-card",
1018
+ value: this.openedCode
1019
+ },
1020
+ on: {
1021
+ "tab-click": function tabClick(tabNode) {
1022
+ _this4.$emit("openedCode", tabNode.name);
1023
+ }
1024
+ }
1025
+ };
1026
+ return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
1027
+ },
1028
+ renderCollapse: function renderCollapse(h, filterItems) {
1029
+ var _this5 = this;
1030
+ var itemNode = filterItems.map(function (item) {
1031
+ if (typeof item.render === "function") {
1032
+ return item.render(h, _this5.formModel, item);
1033
+ }
1034
+ return h("el-collapse-item", {
1035
+ "key": item.prop,
1036
+ "attrs": {
1037
+ "name": item.prop,
1038
+ "title": item.label
1039
+ }
1040
+ }, [h("template", {
1041
+ "slot": "title"
1042
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this5, h) : item.slots && item.slots.title]), _this5.formNode(item)]);
1043
+ });
1044
+ var collapseProp = {
1045
+ attrs: {
1046
+ value: this.openedCode
1047
+ },
1048
+ on: {
1049
+ change: function change(val) {
1050
+ _this5.$emit("openedCode", val);
1051
+ }
1052
+ }
1053
+ };
1054
+ return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
1055
+ }
1056
+ },
1057
+ render: function render(h) {
1058
+ var _this6 = this;
1059
+ var filterItems = this.items.filter(function (item) {
1060
+ if (item.show === false) {
1061
+ return false;
1062
+ }
1063
+ if (typeof item.show === "function" && !item.show.call(_this6, {
1064
+ config: item
1065
+ })) {
1066
+ return false;
1067
+ }
1068
+ return true;
1069
+ });
1070
+ if (!filterItems.length > 0) {
1071
+ return null;
1072
+ }
1073
+ this.openedCode = filterItems[0] && filterItems[0].prop;
1074
+ return h("div", {
1075
+ "class": ["form-group", "is-" + (this.control === "Tab" ? "tab" : "collapse")]
1076
+ }, [this.control === "Tab" ? this.renderTab(h, filterItems) : this.renderCollapse(h, filterItems)]);
1077
+ }
1078
+ });
1079
+ // CONCATENATED MODULE: ./src/components/form-group/index.js
1080
+
1081
+ src.install = function (Vue) {
1082
+ Vue.component(src.name, src);
1083
+ };
1084
+ /* harmony default export */ var form_group = __webpack_exports__["default"] = (src);
1085
+
1086
+ /***/ }),
1087
+ /* 20 */
1088
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1089
+
1090
+ "use strict";
1091
+ // ESM COMPAT FLAG
1092
+ __webpack_require__.r(__webpack_exports__);
1093
+
1094
+ // EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
1095
+ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
1096
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
1097
+
1098
+ // EXTERNAL MODULE: ./src/components/form-view/index.js + 5 modules
1099
+ var form_view = __webpack_require__(6);
1100
+
1101
+ // CONCATENATED MODULE: ./src/components/form-view-group/src/content.js
1102
+
1103
+
1104
+ /* harmony default export */ var content = ({
1105
+ name: "Content",
1106
+ inheritAttrs: false,
1107
+ components: {
1108
+ FormView: form_view["default"]
1109
+ },
1110
+ props: {
1111
+ control: String,
1112
+ prop: String,
1113
+ label: String,
1114
+ formItems: Array,
1115
+ on: Object,
1116
+ render: Function,
1117
+ slots: Object,
1118
+ config: Object,
1119
+ show: {
1120
+ type: [Boolean, Function],
1121
+ default: true
1122
+ }
1123
+ },
1124
+ data: function data() {
1125
+ return {
1126
+ formModel: {}
1127
+ };
1128
+ },
1129
+ computed: {
1130
+ _formViewGroup: function _formViewGroup() {
1131
+ var parent = this.$parent;
1132
+ while (parent) {
1133
+ if (parent.$options.componentName !== 'FormViewGroup') {
1134
+ parent = parent.$parent;
1135
+ } else {
1136
+ return parent;
1137
+ }
1138
+ }
1139
+ return false;
1140
+ }
1141
+ },
1142
+ methods: {},
1143
+ render: function render(h) {
1144
+ if (this.slots.form) {
1145
+ var vForm = typeof this.slots.form === "function" ? this.slots.form.call(this, h) : this.slots.form;
1146
+ return vForm;
1147
+ }
1148
+ var formProp = {
1149
+ attrs: Object.assign({
1150
+ prop: this.prop,
1151
+ formModel: this.formModel,
1152
+ formItems: this.formItems
1153
+ }, this.$attrs),
1154
+ on: this.on
1155
+ };
1156
+ return h(form_view["default"], babel_helper_vue_jsx_merge_props_default()([{
1157
+ "ref": "formView"
1158
+ }, formProp]));
1159
+ }
1160
+ });
1161
+ // EXTERNAL MODULE: external "element-ui/lib/tabs"
1162
+ var tabs_ = __webpack_require__(7);
1163
+ var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
1164
+
1165
+ // EXTERNAL MODULE: external "element-ui/lib/tab-pane"
1166
+ var tab_pane_ = __webpack_require__(8);
1167
+ var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
1168
+
1169
+ // EXTERNAL MODULE: external "element-ui/lib/collapse"
1170
+ var collapse_ = __webpack_require__(9);
1171
+ var collapse_default = /*#__PURE__*/__webpack_require__.n(collapse_);
1172
+
1173
+ // EXTERNAL MODULE: external "element-ui/lib/collapse-item"
1174
+ var collapse_item_ = __webpack_require__(10);
1175
+ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
1176
+
1177
+ // EXTERNAL MODULE: external "lodash"
1178
+ var external_lodash_ = __webpack_require__(3);
1179
+
1180
+ // CONCATENATED MODULE: ./src/components/form-view-group/src/index.js
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+ /* harmony default export */ var src = ({
1191
+ name: "FormViewGroup",
1192
+ componentName: "FormViewGroup",
1193
+ components: {
1194
+ elTabs: tabs_default.a,
1195
+ elTabPane: tab_pane_default.a,
1196
+ elCollapse: collapse_default.a,
1197
+ elCollapseItem: collapse_item_default.a
1198
+ },
1199
+ props: {
1200
+ request: Function,
1201
+ control: {
1202
+ type: String,
1203
+ default: "Collapse"
1204
+ },
1205
+ items: {
1206
+ type: Array,
1207
+ default: function _default() {
1208
+ return [];
1209
+ }
1210
+ },
1211
+ formModel: {
1212
+ type: Object,
1213
+ default: function _default() {
1214
+ return {};
1215
+ }
1216
+ },
1217
+ on: {
1218
+ type: Object,
1219
+ default: function _default() {
1220
+ return {};
1221
+ }
1222
+ }
1223
+ },
1224
+ data: function data() {
1225
+ return {
1226
+ formLayout: {},
1227
+ openedCode: null
1228
+ };
1229
+ },
1230
+ computed: {},
1231
+ methods: {
1232
+ setFormModel: function setFormModel(model) {
1233
+ Object(external_lodash_["merge"])(this.formModel, model);
1234
+ },
1235
+ formNode: function formNode(form) {
1236
+ var h = this.$createElement;
1237
+ var formProp = {
1238
+ attrs: Object.assign({}, form),
1239
+ on: form.on
1240
+ };
1241
+ return h(content, babel_helper_vue_jsx_merge_props_default()([{
1242
+ "ref": form.prop,
1243
+ "key": form.prop,
1244
+ "attrs": {
1245
+ "config": form,
1246
+ "control": this.control
1247
+ }
1248
+ }, formProp]));
1249
+ },
1250
+ renderTab: function renderTab(h, filterItems) {
1251
+ var _this = this;
1252
+ var itemNode = filterItems.map(function (item) {
1253
+ if (typeof item.render === "function") {
1254
+ return item.render(h, _this.formModel, item);
1255
+ }
1256
+ return h("el-tab-pane", {
1257
+ "key": item.prop,
1258
+ "attrs": {
1259
+ "name": item.prop,
1260
+ "label": item.label
1261
+ }
1262
+ }, [h("template", {
1263
+ "slot": "label"
1264
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this, h) : item.slots && item.slots.title]), _this.formNode(item)]);
1265
+ });
1266
+ var tabsProp = {
1267
+ attrs: {
1268
+ type: "border-card",
1269
+ value: this.openedCode
1270
+ },
1271
+ on: {
1272
+ "tab-click": function tabClick(tabNode) {
1273
+ _this.$emit("openedCode", tabNode.name);
1274
+ }
1275
+ }
1276
+ };
1277
+ return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
1278
+ },
1279
+ renderCollapse: function renderCollapse(h, filterItems) {
1280
+ var _this2 = this;
1281
+ var itemNode = filterItems.map(function (item) {
1282
+ if (typeof item.render === "function") {
1283
+ return item.render(h, _this2.formModel, item);
1284
+ }
1285
+ return h("el-collapse-item", {
1286
+ "key": item.prop,
1287
+ "attrs": {
1288
+ "name": item.prop,
1289
+ "title": item.label
1290
+ }
1291
+ }, [h("template", {
1292
+ "slot": "title"
1293
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this2, h) : item.slots && item.slots.title]), _this2.formNode(item)]);
1294
+ });
1295
+ var collapseProp = {
1296
+ attrs: {
1297
+ value: this.openedCode
1298
+ },
1299
+ on: {
1300
+ change: function change(val) {
1301
+ _this2.$emit("openedCode", val);
1302
+ }
1303
+ }
1304
+ };
1305
+ return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
1306
+ }
1307
+ },
1308
+ render: function render(h) {
1309
+ var _this3 = this;
1310
+ var filterItems = this.items.filter(function (item) {
1311
+ if (item.show === false) {
1312
+ return false;
1313
+ }
1314
+ if (typeof item.show === "function" && !item.show.call(_this3, {
1315
+ config: item
1316
+ })) {
1317
+ return false;
1318
+ }
1319
+ return true;
1320
+ });
1321
+ if (!filterItems.length > 0) {
1322
+ return null;
1323
+ }
1324
+ this.openedCode = filterItems[0] && filterItems[0].prop;
1325
+ return h("div", {
1326
+ "class": ["form-view-group", "is-" + (this.control === "Tab" ? "tab" : "collapse")]
1327
+ }, [this.control === "Tab" ? this.renderTab(h, filterItems) : this.renderCollapse(h, filterItems)]);
1328
+ }
1329
+ });
1330
+ // CONCATENATED MODULE: ./src/components/form-view-group/index.js
1331
+
1332
+ src.install = function (Vue) {
1333
+ Vue.component(src.name, src);
1334
+ };
1335
+ /* harmony default export */ var form_view_group = __webpack_exports__["default"] = (src);
1336
+
1337
+ /***/ }),
1338
+ /* 21 */,
1339
+ /* 22 */,
1340
+ /* 23 */,
1341
+ /* 24 */,
1342
+ /* 25 */
1343
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1344
+
1345
+ "use strict";
1346
+ // ESM COMPAT FLAG
1347
+ __webpack_require__.r(__webpack_exports__);
1348
+
1349
+ // EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
1350
+ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
1351
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
1352
+
1353
+ // EXTERNAL MODULE: external "element-ui/lib/dialog"
1354
+ var dialog_ = __webpack_require__(18);
1355
+ var dialog_default = /*#__PURE__*/__webpack_require__.n(dialog_);
1356
+
1357
+ // EXTERNAL MODULE: external "element-ui/lib/button"
1358
+ var button_ = __webpack_require__(4);
1359
+ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
1360
+
1361
+ // EXTERNAL MODULE: ./src/components/form/index.js + 5 modules
1362
+ var components_form = __webpack_require__(5);
1363
+
1364
+ // EXTERNAL MODULE: ./src/components/form-group/index.js + 2 modules
1365
+ var form_group = __webpack_require__(19);
1366
+
1367
+ // EXTERNAL MODULE: external "component-ui/lib/utils/formula"
1368
+ var formula_ = __webpack_require__(2);
1369
+
1370
+ // EXTERNAL MODULE: external "lodash"
1371
+ var external_lodash_ = __webpack_require__(3);
1372
+
1373
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-dialog/src/index.vue?vue&type=script&lang=js&
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+ /* harmony default export */ var srcvue_type_script_lang_js_ = ({
1386
+ name: "FormDialog",
1387
+ componentName: "FormDialog",
1388
+ components: {
1389
+ Form: components_form["default"],
1390
+ FormGroup: form_group["default"],
1391
+ elDialog: dialog_default.a,
1392
+ Tool: {
1393
+ components: {
1394
+ elButton: button_default.a
1395
+ },
1396
+ props: {
1397
+ label: String,
1398
+ show: {
1399
+ type: [Boolean, Function],
1400
+ default: true
1401
+ },
1402
+ on: {
1403
+ type: Object,
1404
+ default: function _default() {
1405
+ return {};
1406
+ }
1407
+ },
1408
+ render: Function
1409
+ },
1410
+ computed: {
1411
+ attrs: function attrs() {
1412
+ return Object.assign({
1413
+ size: "mini"
1414
+ }, this.$attrs);
1415
+ }
1416
+ },
1417
+ data: function data() {
1418
+ return {
1419
+ loading: this.$attrs.loading
1420
+ };
1421
+ },
1422
+ render: function render(h) {
1423
+ var _this = this;
1424
+ if (this.show === false) {
1425
+ return null;
1426
+ }
1427
+ if (typeof this.render === "function") {
1428
+ return this.render(h, this);
1429
+ }
1430
+ var param = {
1431
+ attrs: this.attrs,
1432
+ on: {
1433
+ click: function click(event) {
1434
+ if (typeof _this.$listeners.click === "function") {
1435
+ _this.$listeners.click.call(event, _this);
1436
+ }
1437
+ }
1438
+ }
1439
+ };
1440
+ return h("el-button", babel_helper_vue_jsx_merge_props_default()([{}, param, {
1441
+ "attrs": {
1442
+ "loading": this.loading
1443
+ }
1444
+ }]), [this.label]);
1445
+ }
1446
+ }
1447
+ },
1448
+ props: {
1449
+ dialog: {
1450
+ type: Object,
1451
+ default: function _default() {
1452
+ return {
1453
+ confirmButtonText: "确认",
1454
+ confirmButtonType: "Primary",
1455
+ cancelButtonText: "取消",
1456
+ cancelButtonType: "Primary"
1457
+ };
1458
+ }
1459
+ },
1460
+ formMode: String,
1461
+ api: {
1462
+ type: Object,
1463
+ default: function _default() {
1464
+ return {};
1465
+ }
1466
+ },
1467
+ form: {
1468
+ type: Object,
1469
+ default: function _default() {
1470
+ return {};
1471
+ }
1472
+ },
1473
+ tools: Array,
1474
+ on: {
1475
+ type: Object,
1476
+ default: function _default() {
1477
+ return {};
1478
+ }
1479
+ },
1480
+ slots: {
1481
+ type: Object,
1482
+ default: function _default() {
1483
+ return {};
1484
+ }
1485
+ }
1486
+ },
1487
+ data: function data() {
1488
+ return {
1489
+ show: false,
1490
+ formModel: {},
1491
+ defaultTools: [{
1492
+ label: this.dialog.confirmButtonText || "确认",
1493
+ type: this.confirmButtonType || "primary",
1494
+ loading: false,
1495
+ on: {
1496
+ click: this.submit
1497
+ }
1498
+ }, {
1499
+ label: this.dialog.cancelButtonText || "取消",
1500
+ type: this.confirmButtonType,
1501
+ loading: false,
1502
+ on: {
1503
+ click: this.close
1504
+ }
1505
+ }]
1506
+ };
1507
+ },
1508
+ computed: {
1509
+ request: function request() {
1510
+ return this.api.request || (this.$COMPONENT || {}).request;
1511
+ }
1512
+ },
1513
+ methods: {
1514
+ open: function open() {
1515
+ this.show = true;
1516
+ },
1517
+ close: function close() {
1518
+ this.show = false;
1519
+ },
1520
+ setFormModel: function setFormModel(model) {
1521
+ Object(external_lodash_["merge"])(this.formModel, model);
1522
+ },
1523
+ submit: function submit(button) {
1524
+ var _this2 = this;
1525
+ if (!(this.api && this.request)) {
1526
+ return false;
1527
+ }
1528
+ this.$refs.form.validate(function (isValidate, errorMessage) {
1529
+ if (!isValidate) {
1530
+ return false;
1531
+ }
1532
+ button.loading = true;
1533
+ var reqData = Object.assign(_this2.api.data, _this2.formModel);
1534
+ _this2.request({
1535
+ url: Object(formula_["evaluate"])(_this2.api.url, reqData),
1536
+ method: _this2.api.method || "POST",
1537
+ data: reqData
1538
+ }).then(function (res) {
1539
+ button.loading = false;
1540
+ _this2.close();
1541
+ _this2.$emit("success", res);
1542
+ }).catch(function (error) {
1543
+ button.loading = false;
1544
+ _this2.$emit("error", error);
1545
+ });
1546
+ });
1547
+ },
1548
+ renderForm: function renderForm(h) {
1549
+ var param = {
1550
+ attrs: Object.assign({
1551
+ formModel: this.formModel
1552
+ }, this.form)
1553
+ };
1554
+ if (this.formMode === "group") {
1555
+ return h(form_group["default"], babel_helper_vue_jsx_merge_props_default()([{
1556
+ "ref": "form"
1557
+ }, param]));
1558
+ }
1559
+ return h(components_form["default"], babel_helper_vue_jsx_merge_props_default()([{
1560
+ "ref": "form"
1561
+ }, param]));
1562
+ },
1563
+ renderTitle: function renderTitle(h) {
1564
+ if (typeof this.slots.title === "function") {
1565
+ return this.slots.title.call(this, this.formModel);
1566
+ }
1567
+ return this.slots.title || this.dialog.title;
1568
+ },
1569
+ renderTools: function renderTools(h) {
1570
+ if (typeof this.slots.footer === "function") {
1571
+ return this.slots.footer.call(this, this.formModel);
1572
+ }
1573
+ return h("div", [(this.tools || this.defaultTools).map(function (item) {
1574
+ var toolParam = {
1575
+ attrs: Object.assign({}, item),
1576
+ on: item.on
1577
+ };
1578
+ return h("Tool", babel_helper_vue_jsx_merge_props_default()([{}, toolParam]));
1579
+ })]);
1580
+ }
1581
+ },
1582
+ render: function render(h) {
1583
+ var _this3 = this;
1584
+ var param = {
1585
+ attrs: Object.assign({
1586
+ visible: this.show,
1587
+ "customClass": "form-dialog"
1588
+ }, this.dialog),
1589
+ on: Object.assign(this.on, {
1590
+ close: function close() {
1591
+ _this3.close();
1592
+ }
1593
+ })
1594
+ };
1595
+ return h("el-dialog", babel_helper_vue_jsx_merge_props_default()([{}, param]), [h("template", {
1596
+ "slot": "title",
1597
+ "class": "dialog-title"
1598
+ }, [this.renderTitle(h)]), h("template", {
1599
+ "slot": "footer",
1600
+ "class": "dialog-footer"
1601
+ }, [this.renderTools(h)]), this.renderForm(h)]);
1602
+ }
1603
+ });
1604
+ // CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue?vue&type=script&lang=js&
1605
+ /* harmony default export */ var form_dialog_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
1606
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1607
+ var componentNormalizer = __webpack_require__(1);
1608
+
1609
+ // CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue
1610
+ var src_render, staticRenderFns
1611
+
1612
+
1613
+
1614
+
1615
+ /* normalize component */
1616
+
1617
+ var component = Object(componentNormalizer["a" /* default */])(
1618
+ form_dialog_srcvue_type_script_lang_js_,
1619
+ src_render,
1620
+ staticRenderFns,
1621
+ false,
1622
+ null,
1623
+ null,
1624
+ null
1625
+
1626
+ )
1627
+
1628
+ /* harmony default export */ var src = (component.exports);
1629
+ // CONCATENATED MODULE: ./src/components/form-dialog/index.js
1630
+
1631
+ src.install = function (Vue) {
1632
+ Vue.component(src.name, src);
1633
+ };
1634
+ /* harmony default export */ var form_dialog = __webpack_exports__["default"] = (src);
1635
+
1636
+ /***/ }),
1637
+ /* 26 */
1638
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1639
+
1640
+ "use strict";
1641
+ // ESM COMPAT FLAG
1642
+ __webpack_require__.r(__webpack_exports__);
1643
+
1644
+ // EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
1645
+ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
1646
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
1647
+
1648
+ // EXTERNAL MODULE: external "element-ui/lib/dialog"
1649
+ var dialog_ = __webpack_require__(18);
1650
+ var dialog_default = /*#__PURE__*/__webpack_require__.n(dialog_);
1651
+
1652
+ // EXTERNAL MODULE: external "element-ui/lib/button"
1653
+ var button_ = __webpack_require__(4);
1654
+ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
1655
+
1656
+ // EXTERNAL MODULE: ./src/components/form-view/index.js + 5 modules
1657
+ var form_view = __webpack_require__(6);
1658
+
1659
+ // EXTERNAL MODULE: ./src/components/form-view-group/index.js + 2 modules
1660
+ var form_view_group = __webpack_require__(20);
1661
+
1662
+ // EXTERNAL MODULE: external "component-ui/lib/utils/formula"
1663
+ var formula_ = __webpack_require__(2);
1664
+
1665
+ // EXTERNAL MODULE: external "lodash"
1666
+ var external_lodash_ = __webpack_require__(3);
1667
+
1668
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js&
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+
1680
+ /* harmony default export */ var srcvue_type_script_lang_js_ = ({
1681
+ name: "FormViewDialog",
1682
+ componentName: "FormViewDialog",
1683
+ components: {
1684
+ FormView: form_view["default"],
1685
+ FormViewGroup: form_view_group["default"],
1686
+ elDialog: dialog_default.a,
1687
+ Tool: {
1688
+ components: {
1689
+ elButton: button_default.a
1690
+ },
1691
+ props: {
1692
+ label: String,
1693
+ show: {
1694
+ type: [Boolean, Function],
1695
+ default: true
1696
+ },
1697
+ on: {
1698
+ type: Object,
1699
+ default: function _default() {
1700
+ return {};
1701
+ }
1702
+ },
1703
+ render: Function
1704
+ },
1705
+ computed: {
1706
+ attrs: function attrs() {
1707
+ return Object.assign({
1708
+ size: "mini"
1709
+ }, this.$attrs);
1710
+ }
1711
+ },
1712
+ data: function data() {
1713
+ return {
1714
+ loading: this.$attrs.loading
1715
+ };
1716
+ },
1717
+ render: function render(h) {
1718
+ var _this = this;
1719
+ if (this.show === false) {
1720
+ return null;
1721
+ }
1722
+ if (typeof this.render === "function") {
1723
+ return this.render(h, this);
1724
+ }
1725
+ var param = {
1726
+ attrs: this.attrs,
1727
+ on: {
1728
+ click: function click(event) {
1729
+ if (typeof _this.$listeners.click === "function") {
1730
+ _this.$listeners.click.call(event, _this);
1731
+ }
1732
+ }
1733
+ }
1734
+ };
1735
+ return h("el-button", babel_helper_vue_jsx_merge_props_default()([{}, param, {
1736
+ "attrs": {
1737
+ "loading": this.loading
1738
+ }
1739
+ }]), [this.label]);
1740
+ }
1741
+ }
1742
+ },
1743
+ props: {
1744
+ dialog: {
1745
+ type: Object,
1746
+ default: function _default() {
1747
+ return {
1748
+ cancelButtonText: "关闭",
1749
+ cancelButtonType: "Primary"
1750
+ };
1751
+ }
1752
+ },
1753
+ formMode: String,
1754
+ api: {
1755
+ type: Object,
1756
+ default: function _default() {
1757
+ return {};
1758
+ }
1759
+ },
1760
+ form: {
1761
+ type: Object,
1762
+ default: function _default() {
1763
+ return {};
1764
+ }
1765
+ },
1766
+ tools: Array,
1767
+ on: {
1768
+ type: Object,
1769
+ default: function _default() {
1770
+ return {};
1771
+ }
1772
+ },
1773
+ slots: {
1774
+ type: Object,
1775
+ default: function _default() {
1776
+ return {};
1777
+ }
1778
+ }
1779
+ },
1780
+ data: function data() {
1781
+ return {
1782
+ show: false,
1783
+ formModel: {},
1784
+ defaultTools: [{
1785
+ label: this.dialog.cancelButtonText || "关闭",
1786
+ type: this.confirmButtonType,
1787
+ loading: false,
1788
+ on: {
1789
+ click: this.close
1790
+ }
1791
+ }]
1792
+ };
1793
+ },
1794
+ computed: {
1795
+ request: function request() {
1796
+ return this.api.request || (this.$COMPONENT || {}).request;
1797
+ }
1798
+ },
1799
+ methods: {
1800
+ open: function open() {
1801
+ this.show = true;
1802
+ },
1803
+ close: function close() {
1804
+ this.show = false;
1805
+ },
1806
+ setFormModel: function setFormModel(model) {
1807
+ Object(external_lodash_["merge"])(this.formModel, model);
1808
+ },
1809
+ renderForm: function renderForm(h) {
1810
+ var param = {
1811
+ attrs: Object.assign({
1812
+ formModel: this.formModel
1813
+ }, this.form)
1814
+ };
1815
+ if (this.formMode === "group") {
1816
+ return h(form_view_group["default"], babel_helper_vue_jsx_merge_props_default()([{
1817
+ "ref": "form"
1818
+ }, param]));
1819
+ }
1820
+ return h(form_view["default"], babel_helper_vue_jsx_merge_props_default()([{
1821
+ "ref": "form"
1822
+ }, param]));
1823
+ },
1824
+ renderTitle: function renderTitle(h) {
1825
+ if (typeof this.slots.title === "function") {
1826
+ return this.slots.title.call(this, this.formModel);
1827
+ }
1828
+ return this.slots.title || this.dialog.title;
1829
+ },
1830
+ renderTools: function renderTools(h) {
1831
+ if (typeof this.slots.footer === "function") {
1832
+ return this.slots.footer.call(this, this.formModel);
1833
+ }
1834
+ return h("div", [(this.tools || this.defaultTools).map(function (item) {
1835
+ var toolParam = {
1836
+ attrs: Object.assign({}, item),
1837
+ on: item.on
1838
+ };
1839
+ return h("Tool", babel_helper_vue_jsx_merge_props_default()([{}, toolParam]));
1840
+ })]);
1841
+ }
1842
+ },
1843
+ render: function render(h) {
1844
+ var _this2 = this;
1845
+ var param = {
1846
+ attrs: Object.assign({
1847
+ visible: this.show,
1848
+ "customClass": "form-view-dialog"
1849
+ }, this.dialog),
1850
+ on: Object.assign(this.on, {
1851
+ close: function close() {
1852
+ _this2.close();
1853
+ }
1854
+ })
1855
+ };
1856
+ return h("el-dialog", babel_helper_vue_jsx_merge_props_default()([{}, param]), [h("template", {
1857
+ "slot": "title",
1858
+ "class": "dialog-title"
1859
+ }, [this.renderTitle(h)]), h("template", {
1860
+ "slot": "footer",
1861
+ "class": "dialog-footer"
1862
+ }, [this.renderTools(h)]), this.renderForm(h)]);
1863
+ }
1864
+ });
1865
+ // CONCATENATED MODULE: ./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js&
1866
+ /* harmony default export */ var form_view_dialog_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
1867
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1868
+ var componentNormalizer = __webpack_require__(1);
1869
+
1870
+ // CONCATENATED MODULE: ./src/components/form-view-dialog/src/index.vue
1871
+ var src_render, staticRenderFns
1872
+
1873
+
1874
+
1875
+
1876
+ /* normalize component */
1877
+
1878
+ var component = Object(componentNormalizer["a" /* default */])(
1879
+ form_view_dialog_srcvue_type_script_lang_js_,
1880
+ src_render,
1881
+ staticRenderFns,
1882
+ false,
1883
+ null,
1884
+ null,
1885
+ null
1886
+
1887
+ )
1888
+
1889
+ /* harmony default export */ var src = (component.exports);
1890
+ // CONCATENATED MODULE: ./src/components/form-view-dialog/index.js
1891
+
1892
+ src.install = function (Vue) {
1893
+ Vue.component(src.name, src);
1894
+ };
1895
+ /* harmony default export */ var form_view_dialog = __webpack_exports__["default"] = (src);
1896
+
1897
+ /***/ }),
1898
+ /* 27 */,
1899
+ /* 28 */,
1900
+ /* 29 */,
1901
+ /* 30 */,
1902
+ /* 31 */,
1903
+ /* 32 */,
1904
+ /* 33 */,
1905
+ /* 34 */,
1906
+ /* 35 */,
1907
+ /* 36 */,
1908
+ /* 37 */,
1909
+ /* 38 */,
1910
+ /* 39 */,
1911
+ /* 40 */,
1912
+ /* 41 */,
1913
+ /* 42 */,
1914
+ /* 43 */,
1915
+ /* 44 */,
1916
+ /* 45 */,
1917
+ /* 46 */,
1918
+ /* 47 */,
1919
+ /* 48 */,
1920
+ /* 49 */,
1921
+ /* 50 */,
1922
+ /* 51 */,
1923
+ /* 52 */,
1924
+ /* 53 */,
1925
+ /* 54 */,
1926
+ /* 55 */
1927
+ /***/ (function(module, exports) {
1928
+
1929
+ module.exports = require("component-ui/lib/components/table-search");
1930
+
1931
+ /***/ }),
1932
+ /* 56 */
1933
+ /***/ (function(module, exports) {
1934
+
1935
+ module.exports = require("element-ui/lib/message-box");
1936
+
1937
+ /***/ }),
1938
+ /* 57 */,
1939
+ /* 58 */,
1940
+ /* 59 */,
1941
+ /* 60 */,
1942
+ /* 61 */,
1943
+ /* 62 */
1944
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1945
+
1946
+ "use strict";
1947
+ // ESM COMPAT FLAG
1948
+ __webpack_require__.r(__webpack_exports__);
1949
+
1950
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=65e4153e&
1951
+ var render = function render() {
1952
+ var _vm = this,
1953
+ _c = _vm._self._c
1954
+ return _c("div", [
1955
+ _c(
1956
+ "div",
1957
+ [
1958
+ _c(
1959
+ "TableSearch",
1960
+ _vm._b({ ref: "table" }, "TableSearch", _vm.tableProps, false)
1961
+ ),
1962
+ ],
1963
+ 1
1964
+ ),
1965
+ _c(
1966
+ "div",
1967
+ [
1968
+ _vm.create
1969
+ ? _c(
1970
+ "FormDialog",
1971
+ _vm._b(
1972
+ { ref: "createFormDialog" },
1973
+ "FormDialog",
1974
+ _vm.createProps,
1975
+ false
1976
+ )
1977
+ )
1978
+ : _vm._e(),
1979
+ _vm.update
1980
+ ? _c(
1981
+ "FormDialog",
1982
+ _vm._b(
1983
+ { ref: "updateFormDialog" },
1984
+ "FormDialog",
1985
+ _vm.updateProps,
1986
+ false
1987
+ )
1988
+ )
1989
+ : _vm._e(),
1990
+ _vm.view
1991
+ ? _c(
1992
+ "FormViewDialog",
1993
+ _vm._b(
1994
+ { ref: "viewFormDialog" },
1995
+ "FormViewDialog",
1996
+ _vm.viewProps,
1997
+ false
1998
+ )
1999
+ )
2000
+ : _vm._e(),
2001
+ ],
2002
+ 1
2003
+ ),
2004
+ ])
2005
+ }
2006
+ var staticRenderFns = []
2007
+ render._withStripped = true
2008
+
2009
+
2010
+ // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=65e4153e&
2011
+
2012
+ // EXTERNAL MODULE: external "component-ui/lib/components/table-search"
2013
+ var table_search_ = __webpack_require__(55);
2014
+ var table_search_default = /*#__PURE__*/__webpack_require__.n(table_search_);
2015
+
2016
+ // EXTERNAL MODULE: ./src/components/form-dialog/index.js + 3 modules
2017
+ var form_dialog = __webpack_require__(25);
2018
+
2019
+ // EXTERNAL MODULE: ./src/components/form-view-dialog/index.js + 3 modules
2020
+ var form_view_dialog = __webpack_require__(26);
2021
+
2022
+ // EXTERNAL MODULE: external "element-ui/lib/message-box"
2023
+ var message_box_ = __webpack_require__(56);
2024
+ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
2025
+
2026
+ // EXTERNAL MODULE: external "component-ui/lib/utils/formula"
2027
+ var formula_ = __webpack_require__(2);
2028
+
2029
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=script&lang=js&
2030
+
2031
+
2032
+
2033
+
2034
+
2035
+ /* harmony default export */ var srcvue_type_script_lang_js_ = ({
2036
+ name: "CRUD",
2037
+ componentName: "CRUD",
2038
+ components: {
2039
+ TableSearch: table_search_default.a,
2040
+ FormDialog: form_dialog["default"],
2041
+ FormViewDialog: form_view_dialog["default"]
2042
+ },
2043
+ computed: {
2044
+ tableProps: function tableProps() {
2045
+ return {
2046
+ request: this.request,
2047
+ search: this.search,
2048
+ table: this.table
2049
+ };
2050
+ },
2051
+ createProps: function createProps() {
2052
+ return Object.assign({}, this.create);
2053
+ },
2054
+ updateProps: function updateProps() {
2055
+ return Object.assign({}, this.update);
2056
+ },
2057
+ viewProps: function viewProps() {
2058
+ return Object.assign({}, this.view);
2059
+ }
2060
+ },
2061
+ props: {
2062
+ request: Function,
2063
+ search: {
2064
+ type: Object,
2065
+ default: function _default() {
2066
+ return {};
2067
+ }
2068
+ },
2069
+ table: {
2070
+ type: Object,
2071
+ default: function _default() {
2072
+ return {};
2073
+ }
2074
+ },
2075
+ create: {
2076
+ type: Object,
2077
+ default: function _default() {
2078
+ return null;
2079
+ }
2080
+ },
2081
+ update: {
2082
+ type: Object,
2083
+ default: function _default() {
2084
+ return null;
2085
+ }
2086
+ },
2087
+ delete: {
2088
+ type: Object,
2089
+ default: function _default() {
2090
+ return null;
2091
+ }
2092
+ },
2093
+ view: {
2094
+ type: Object,
2095
+ default: function _default() {
2096
+ return null;
2097
+ }
2098
+ },
2099
+ on: {
2100
+ type: Object,
2101
+ default: function _default() {
2102
+ return {};
2103
+ }
2104
+ },
2105
+ slots: {
2106
+ type: Object,
2107
+ default: function _default() {
2108
+ return {};
2109
+ }
2110
+ }
2111
+ },
2112
+ data: function data() {
2113
+ return {};
2114
+ },
2115
+ created: function created() {
2116
+ this.addTools();
2117
+ },
2118
+ methods: {
2119
+ addTools: function addTools() {
2120
+ // 添加按钮处理
2121
+ if (this.create) {
2122
+ var tools = this.table && this.table.tools || [];
2123
+ tools.unshift(Object.assign({
2124
+ label: "添加",
2125
+ loading: false,
2126
+ on: {
2127
+ click: this.handleCreate
2128
+ }
2129
+ }, this.create.tool));
2130
+ this.table.tools = tools;
2131
+ }
2132
+ //修改和删除按钮处理
2133
+ if (!(this.update || this.delete || this.view)) {
2134
+ return false;
2135
+ }
2136
+ var filterColumns = this.table.columns.filter(function (item) {
2137
+ return item.control === "Operate";
2138
+ });
2139
+ var optColumn = filterColumns && filterColumns[0];
2140
+ var items = optColumn && optColumn.items || [];
2141
+ if (this.update) {
2142
+ items.unshift(Object.assign({
2143
+ label: "修改",
2144
+ loading: false,
2145
+ on: {
2146
+ click: this.handleUpdate
2147
+ }
2148
+ }, this.update.tool));
2149
+ }
2150
+ if (this.delete) {
2151
+ items.unshift(Object.assign({
2152
+ label: "删除",
2153
+ loading: false,
2154
+ on: {
2155
+ click: this.handleDelete
2156
+ }
2157
+ }, this.delete.tool));
2158
+ }
2159
+ if (this.view) {
2160
+ items.unshift(Object.assign({
2161
+ label: "查看",
2162
+ loading: false,
2163
+ on: {
2164
+ click: this.handleView
2165
+ }
2166
+ }, this.view.tool));
2167
+ }
2168
+ if (optColumn) {
2169
+ optColumn.items = items;
2170
+ } else {
2171
+ this.table.columns.push({
2172
+ control: "Operate",
2173
+ label: "操作",
2174
+ align: "center",
2175
+ items: items
2176
+ });
2177
+ }
2178
+ },
2179
+ handleCreate: function handleCreate() {
2180
+ this.$refs.createFormDialog.open();
2181
+ },
2182
+ handleUpdate: function handleUpdate(rowProps, that) {
2183
+ var _this = this;
2184
+ var rowData = rowProps.row;
2185
+ this.$refs.updateFormDialog.open();
2186
+ if (this.update.detail) {
2187
+ var request = this.update.detail.request || this.request;
2188
+ request({
2189
+ url: Object(formula_["evaluate"])(this.update.detail.url, rowData),
2190
+ method: this.update.detail.method || "GET",
2191
+ data: rowData
2192
+ }).then(function (res) {
2193
+ _this.$refs.updateFormDialog.setFormModel(res);
2194
+ }).catch(function (error) {});
2195
+ } else {
2196
+ this.$nextTick(function () {
2197
+ _this.$refs.updateFormDialog.setFormModel(rowData);
2198
+ });
2199
+ }
2200
+ },
2201
+ handleDelete: function handleDelete(rowProps, that) {
2202
+ var _this2 = this;
2203
+ message_box_default.a.confirm("是否确定删除", '提示', {
2204
+ confirmButtonText: '确定',
2205
+ cancelButtonText: '取消',
2206
+ type: 'warning'
2207
+ }).then(function () {
2208
+ var request = _this2.delete.api.request || _this2.request;
2209
+ var rowData = rowProps.row;
2210
+ that.loading = true;
2211
+ request({
2212
+ url: Object(formula_["evaluate"])(_this2.delete.api.url, rowData),
2213
+ method: _this2.delete.api.method || "GET",
2214
+ data: rowData
2215
+ }).then(function (res) {
2216
+ that.loading = false;
2217
+ }).catch(function (error) {
2218
+ that.loading = false;
2219
+ });
2220
+ }).catch(function () {});
2221
+ },
2222
+ handleView: function handleView(rowProps, that) {
2223
+ var _this3 = this;
2224
+ var rowData = rowProps.row;
2225
+ this.$refs.viewFormDialog.open();
2226
+ if (this.view.api) {
2227
+ var request = this.view.api.request || this.request;
2228
+ request({
2229
+ url: Object(formula_["evaluate"])(this.view.api.url, rowData),
2230
+ method: this.view.api.method || "GET",
2231
+ data: rowData
2232
+ }).then(function (res) {
2233
+ _this3.$refs.viewFormDialog.setFormModel(res);
2234
+ }).catch(function (error) {});
2235
+ } else {
2236
+ this.$nextTick(function () {
2237
+ _this3.$refs.viewFormDialog.setFormModel(rowData);
2238
+ });
2239
+ }
2240
+ }
2241
+ }
2242
+ });
2243
+ // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=script&lang=js&
2244
+ /* harmony default export */ var crud_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
2245
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2246
+ var componentNormalizer = __webpack_require__(1);
2247
+
2248
+ // CONCATENATED MODULE: ./src/components/crud/src/index.vue
2249
+
2250
+
2251
+
2252
+
2253
+
2254
+ /* normalize component */
2255
+
2256
+ var component = Object(componentNormalizer["a" /* default */])(
2257
+ crud_srcvue_type_script_lang_js_,
2258
+ render,
2259
+ staticRenderFns,
2260
+ false,
2261
+ null,
2262
+ null,
2263
+ null
2264
+
2265
+ )
2266
+
2267
+ /* harmony default export */ var src = (component.exports);
2268
+ // CONCATENATED MODULE: ./src/components/crud/index.js
2269
+
2270
+ src.install = function (Vue) {
2271
+ Vue.component(src.name, src);
2272
+ };
2273
+ /* harmony default export */ var crud = __webpack_exports__["default"] = (src);
2274
+
2275
+ /***/ })
2276
+ /******/ ]);