@panpanzhao/component-ui 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/component-ui.common.js +1844 -633
  2. package/lib/components/crud.js +547 -297
  3. package/lib/components/dialog.js +50 -19
  4. package/lib/components/drawer.js +14 -14
  5. package/lib/components/form-dialog.js +245 -146
  6. package/lib/components/form-drawer.js +115 -51
  7. package/lib/components/form-group.js +108 -43
  8. package/lib/components/form-input.js +804 -94
  9. package/lib/components/form-item.js +19 -8
  10. package/lib/components/form-query.js +53 -10
  11. package/lib/components/form-view-dialog.js +94 -33
  12. package/lib/components/form-view-group.js +75 -18
  13. package/lib/components/form-view.js +7 -2
  14. package/lib/components/form.js +20 -10
  15. package/lib/components/formula.js +25 -25
  16. package/lib/components/table-column.js +47 -47
  17. package/lib/components/table-editable.js +22 -23
  18. package/lib/components/table-operate.js +357 -197
  19. package/lib/components/table-search.js +28 -31
  20. package/lib/components/table.js +69 -56
  21. package/lib/components/tree-line.js +271 -0
  22. package/lib/index.js +1 -1
  23. package/lib/styles/component-ui.css +2 -2
  24. package/lib/styles/dialog.css +1 -1
  25. package/lib/styles/form-item.css +1 -0
  26. package/lib/styles/form-view.css +1 -0
  27. package/lib/styles/index.css +2 -2
  28. package/lib/styles/tree-line.css +1 -0
  29. package/lib/styles/upload-process.css +1 -0
  30. package/lib/utils/formula/doc.js +2 -3
  31. package/lib/utils/formula/evalutor.js +4 -3
  32. package/lib/utils/formula/filter.js +1 -2
  33. package/lib/utils/formula/function.js +1 -2
  34. package/lib/utils/formula/lexer.js +1 -4
  35. package/lib/utils/helper.js +3 -5
  36. package/package.json +5 -2
@@ -215,7 +215,7 @@ module.exports = require("@panpanzhao/component-ui/lib/utils/formula");
215
215
  // ESM COMPAT FLAG
216
216
  __webpack_require__.r(__webpack_exports__);
217
217
 
218
- // 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=097bf622&
218
+ // CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=template&id=74ff4c20
219
219
  var render = function render() {
220
220
  var _vm = this,
221
221
  _c = _vm._self._c
@@ -286,7 +286,7 @@ var staticRenderFns = []
286
286
  render._withStripped = true
287
287
 
288
288
 
289
- // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=097bf622&
289
+ // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=74ff4c20
290
290
 
291
291
  // EXTERNAL MODULE: external "element-ui/lib/form"
292
292
  var form_ = __webpack_require__(13);
@@ -310,14 +310,14 @@ var formula_ = __webpack_require__(3);
310
310
  // EXTERNAL MODULE: external "lodash"
311
311
  var external_lodash_ = __webpack_require__(2);
312
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&
313
+ // CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=script&lang=js
314
314
 
315
315
 
316
316
 
317
317
 
318
318
 
319
319
 
320
- /* harmony default export */ var formvue_type_script_lang_js_ = ({
320
+ /* harmony default export */ var formvue_type_script_lang_js = ({
321
321
  name: "Form",
322
322
  componentName: "Form",
323
323
  components: {
@@ -458,9 +458,19 @@ var external_lodash_ = __webpack_require__(2);
458
458
  var _callback = null;
459
459
  if (callback) {
460
460
  _callback = function _callback(flag, message) {
461
- callback.call(_this3, flag, message);
462
461
  if (typeof _this3.verify === "function") {
463
- _this3.verify.call(_this3, flag, message);
462
+ var promiset = _this3.verify.call(_this3, flag, message);
463
+ if (promiset && Object.prototype.toString.call(promiset) == "[object Promise]") {
464
+ promiset.then(function (vFlag, vMessage) {
465
+ callback.call(_this3, flag && vFlag !== false, message, vMessage);
466
+ }).catch(function (error) {
467
+ callback.call(_this3, false, message, error);
468
+ });
469
+ } else {
470
+ callback.call(_this3, flag && promiset !== false, message);
471
+ }
472
+ } else {
473
+ callback.call(_this3, flag, message);
464
474
  }
465
475
  };
466
476
  }
@@ -495,9 +505,9 @@ var external_lodash_ = __webpack_require__(2);
495
505
  }
496
506
  }
497
507
  });
498
- // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=script&lang=js&
499
- /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
500
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
508
+ // CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=script&lang=js
509
+ /* harmony default export */ var src_formvue_type_script_lang_js = (formvue_type_script_lang_js);
510
+ // EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/runtime/componentNormalizer.js
501
511
  var componentNormalizer = __webpack_require__(1);
502
512
 
503
513
  // CONCATENATED MODULE: ./src/components/form/src/form.vue
@@ -509,7 +519,7 @@ var componentNormalizer = __webpack_require__(1);
509
519
  /* normalize component */
510
520
 
511
521
  var component = Object(componentNormalizer["a" /* default */])(
512
- src_formvue_type_script_lang_js_,
522
+ src_formvue_type_script_lang_js,
513
523
  render,
514
524
  staticRenderFns,
515
525
  false,
@@ -590,8 +600,14 @@ module.exports = require("element-ui/lib/col");
590
600
  module.exports = require("@panpanzhao/component-ui/lib/components/form-item");
591
601
 
592
602
  /***/ }),
593
- /* 17 */,
594
- /* 18 */
603
+ /* 17 */
604
+ /***/ (function(module, exports) {
605
+
606
+ module.exports = require("element-ui/lib/message");
607
+
608
+ /***/ }),
609
+ /* 18 */,
610
+ /* 19 */
595
611
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
596
612
 
597
613
  "use strict";
@@ -624,6 +640,12 @@ var components_form = __webpack_require__(4);
624
640
  render: Function,
625
641
  slots: Object,
626
642
  config: Object,
643
+ formModel: {
644
+ type: Object,
645
+ default: function _default() {
646
+ return {};
647
+ }
648
+ },
627
649
  show: {
628
650
  type: [Boolean, Function],
629
651
  default: true
@@ -649,8 +671,11 @@ var components_form = __webpack_require__(4);
649
671
  },
650
672
  created: function created() {
651
673
  if (this._formGroup) {
652
- var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
653
- this.formModel = defaultVal || {};
674
+ // if (!(this.prop&&this._formGroup.formModel[this.prop])) {
675
+ // this._formGroup.formModel[this.prop]={}
676
+ // }
677
+ //const defaultVal= this.prop?this._formGroup.formModel[this.prop]:this._formGroup.formModel
678
+ //this.formModel=defaultVal
654
679
  }
655
680
  // if (this.prop && this._formGroup) {
656
681
  // this._formGroup.formModel[this.prop] = this.formModel;
@@ -713,6 +738,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
713
738
 
714
739
 
715
740
 
741
+
716
742
  /* harmony default export */ var src = ({
717
743
  name: "FormGroup",
718
744
  componentName: "FormGroup",
@@ -734,9 +760,6 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
734
760
  return [];
735
761
  }
736
762
  },
737
- defaultExpandVal: {
738
- type: Array | String
739
- },
740
763
  items: {
741
764
  type: Array,
742
765
  default: function _default() {
@@ -762,9 +785,23 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
762
785
  openedCode: null
763
786
  };
764
787
  },
788
+ created: function created() {
789
+ var _this = this;
790
+ this.items.forEach(function (item) {
791
+ var _item$formItems;
792
+ var formData = item.prop && _this.formModel[item.prop] || {};
793
+ if ((item == null || (_item$formItems = item.formItems) == null ? void 0 : _item$formItems.length) > 0) {
794
+ item == null || item.formItems.forEach(function (itemCh) {
795
+ _this.$set(formData, itemCh.prop, formData[itemCh.prop]);
796
+ });
797
+ }
798
+ //初始化数据值
799
+ _this.$set(_this.formModel, item.prop, formData);
800
+ });
801
+ },
765
802
  computed: {
766
803
  actionFormMap: function actionFormMap() {
767
- var _this = this;
804
+ var _this2 = this;
768
805
  var actionForm = {};
769
806
  this.actions.forEach(function (action) {
770
807
  if (!action.trigger) {
@@ -787,15 +824,16 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
787
824
  if (!targetConfig[formTarget.formCode]) {
788
825
  targetConfig[formTarget.formCode] = {};
789
826
  }
790
- targetConfig[formTarget.formCode][formTarget.fieldCode] = _this.formLayout[formTarget.formCode][formTarget.fieldCode];
791
- targetForm[formTarget.formCode] = _this.formModel[formTarget.formCode];
827
+ targetConfig[formTarget.formCode][formTarget.fieldCode] = _this2.formLayout[formTarget.formCode][formTarget.fieldCode];
828
+ targetForm[formTarget.formCode] = _this2.formModel[formTarget.formCode];
792
829
  });
793
830
  config.targetConfig = targetConfig;
794
831
  config.targetForm = targetForm;
832
+ config.formModel = _this2.formModel;
795
833
  for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
796
834
  arg[_key - 1] = arguments[_key];
797
835
  }
798
- (_action$exec = action.exec).call.apply(_action$exec, [_this, config].concat(arg));
836
+ (_action$exec = action.exec).call.apply(_action$exec, [_this2, config].concat(arg));
799
837
  }
800
838
  });
801
839
  });
@@ -804,7 +842,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
804
842
  },
805
843
  methods: {
806
844
  validate: function validate(callback) {
807
- var _this2 = this;
845
+ var _this3 = this;
808
846
  var promise;
809
847
  // if no callback, return promise
810
848
  if (typeof callback !== "function" && Promise) {
@@ -822,9 +860,9 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
822
860
  }
823
861
  var invalidForms = {};
824
862
  this.items.forEach(function (form) {
825
- var formNode = _this2.$refs[form.prop];
863
+ var formNode = _this3.$refs[form.prop];
826
864
  if (!formNode) {
827
- if (typeof callback === "function" && ++count === _this2.items.length) {
865
+ if (typeof callback === "function" && ++count === _this3.items.length) {
828
866
  callback(valid, invalidForms);
829
867
  }
830
868
  return true;
@@ -834,7 +872,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
834
872
  valid = false;
835
873
  invalidForms[form.prop] = msgObj;
836
874
  }
837
- if (typeof callback === "function" && ++count === _this2.items.length) {
875
+ if (typeof callback === "function" && ++count === _this3.items.length) {
838
876
  callback(valid, invalidForms);
839
877
  }
840
878
  });
@@ -844,9 +882,9 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
844
882
  }
845
883
  },
846
884
  reset: function reset() {
847
- var _this3 = this;
885
+ var _this4 = this;
848
886
  this.items.forEach(function (form) {
849
- var formNode = _this3.$refs[form.prop];
887
+ var formNode = _this4.$refs[form.prop];
850
888
  if (!formNode) {
851
889
  return true;
852
890
  }
@@ -857,7 +895,8 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
857
895
  var h = this.$createElement;
858
896
  var formProp = {
859
897
  attrs: Object.assign({
860
- actions: this.actionFormMap[form.prop]
898
+ actions: this.actionFormMap[form.prop],
899
+ formModel: form.prop && this.formModel[form.prop]
861
900
  }, form),
862
901
  on: form.on
863
902
  };
@@ -871,10 +910,10 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
871
910
  }, formProp]));
872
911
  },
873
912
  renderTab: function renderTab(h, filterItems) {
874
- var _this4 = this;
913
+ var _this5 = this;
875
914
  var itemNode = filterItems.map(function (item) {
876
915
  if (typeof item.render === "function") {
877
- return item.render(h, _this4.formModel, item);
916
+ return item.render(h, _this5.formModel, item);
878
917
  }
879
918
  return h("el-tab-pane", {
880
919
  "key": item.prop,
@@ -884,7 +923,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
884
923
  }
885
924
  }, [h("template", {
886
925
  "slot": "label"
887
- }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this4, h) : item.slots && item.slots.title]), _this4.formNode(item)]);
926
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this5, h) : item.slots && item.slots.title]), _this5.formNode(item)]);
888
927
  });
889
928
  var tabsProp = {
890
929
  attrs: {
@@ -893,27 +932,27 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
893
932
  },
894
933
  on: {
895
934
  "tab-click": function tabClick(tabNode) {
896
- _this4.$emit("openedCode", tabNode.name);
935
+ _this5.$emit("openedCode", tabNode.name);
897
936
  }
898
937
  }
899
938
  };
900
939
  return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
901
940
  },
902
941
  renderCollapse: function renderCollapse(h, filterItems) {
903
- var _this5 = this;
942
+ var _this6 = this;
904
943
  var itemNode = filterItems.map(function (item) {
905
944
  if (typeof item.render === "function") {
906
- return item.render(h, _this5.formModel, item);
945
+ return item.render(h, _this6.formModel, item);
907
946
  }
908
947
  return h("el-collapse-item", {
909
- "key": item.prop || item.label,
948
+ "key": item.prop,
910
949
  "attrs": {
911
- "name": item.prop || item.label,
950
+ "name": item.prop,
912
951
  "title": item.label
913
952
  }
914
953
  }, [h("template", {
915
954
  "slot": "title"
916
- }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this5, h) : item.slots && item.slots.title]), _this5.formNode(item)]);
955
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this6, h) : item.slots && item.slots.title]), _this6.formNode(item)]);
917
956
  });
918
957
  var collapseProp = {
919
958
  attrs: {
@@ -921,20 +960,46 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
921
960
  },
922
961
  on: {
923
962
  change: function change(val) {
924
- _this5.$emit("openedCode", val);
963
+ _this6.$emit("openedCode", val);
925
964
  }
926
965
  }
927
966
  };
928
967
  return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
968
+ },
969
+ renderCustom: function renderCustom(h, filterItems) {
970
+ var _this7 = this;
971
+ var itemNode = filterItems.map(function (item) {
972
+ if (typeof item.render === "function") {
973
+ return item.render(h, _this7.formModel, item);
974
+ }
975
+ return h("div", {
976
+ "key": item.prop,
977
+ "attrs": {
978
+ "name": item.prop,
979
+ "title": item.label
980
+ }
981
+ }, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this7, h) : item.slots && item.slots.title || item.label, _this7.formNode(item)]);
982
+ });
983
+ var collapseProp = {
984
+ attrs: {
985
+ value: this.openedCode
986
+ },
987
+ on: {
988
+ change: function change(val) {
989
+ _this7.$emit("openedCode", val);
990
+ }
991
+ }
992
+ };
993
+ return h("div", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
929
994
  }
930
995
  },
931
996
  render: function render(h) {
932
- var _this6 = this;
997
+ var _this8 = this;
933
998
  var filterItems = this.items.filter(function (item) {
934
999
  if (item.show === false) {
935
1000
  return false;
936
1001
  }
937
- if (typeof item.show === "function" && !item.show.call(_this6, {
1002
+ if (typeof item.show === "function" && !item.show.call(_this8, {
938
1003
  config: item
939
1004
  })) {
940
1005
  return false;
@@ -944,10 +1009,15 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
944
1009
  if (!filterItems.length > 0) {
945
1010
  return null;
946
1011
  }
947
- this.openedCode = this.defaultExpandVal || filterItems[0] && filterItems[0].prop;
1012
+ this.openedCode = filterItems[0] && filterItems[0].prop;
1013
+ var group = {
1014
+ Custom: this.renderCustom,
1015
+ Tab: this.renderTab,
1016
+ Collapse: this.renderCollapse
1017
+ };
948
1018
  return h("div", {
949
- "class": ["form-group", "is-" + (this.control === "Tab" ? "tab" : "collapse")]
950
- }, [this.control === "Tab" ? this.renderTab(h, filterItems) : this.renderCollapse(h, filterItems)]);
1019
+ "class": ["form-group", "is-" + this.control]
1020
+ }, [group[this.control] ? group[this.control](h, filterItems) : null]);
951
1021
  }
952
1022
  });
953
1023
  // CONCATENATED MODULE: ./src/components/form-group/index.js
@@ -957,12 +1027,6 @@ src.install = function (Vue) {
957
1027
  };
958
1028
  /* harmony default export */ var form_group = __webpack_exports__["default"] = (src);
959
1029
 
960
- /***/ }),
961
- /* 19 */
962
- /***/ (function(module, exports) {
963
-
964
- module.exports = require("element-ui/lib/message");
965
-
966
1030
  /***/ }),
967
1031
  /* 20 */,
968
1032
  /* 21 */,
@@ -989,14 +1053,14 @@ var button_ = __webpack_require__(5);
989
1053
  var button_default = /*#__PURE__*/__webpack_require__.n(button_);
990
1054
 
991
1055
  // EXTERNAL MODULE: external "element-ui/lib/message"
992
- var message_ = __webpack_require__(19);
1056
+ var message_ = __webpack_require__(17);
993
1057
  var message_default = /*#__PURE__*/__webpack_require__.n(message_);
994
1058
 
995
1059
  // EXTERNAL MODULE: ./src/components/form/index.js + 5 modules
996
1060
  var components_form = __webpack_require__(4);
997
1061
 
998
1062
  // EXTERNAL MODULE: ./src/components/form-group/index.js + 2 modules
999
- var form_group = __webpack_require__(18);
1063
+ var form_group = __webpack_require__(19);
1000
1064
 
1001
1065
  // EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/formula"
1002
1066
  var formula_ = __webpack_require__(3);
@@ -1004,12 +1068,15 @@ var formula_ = __webpack_require__(3);
1004
1068
  // EXTERNAL MODULE: external "lodash"
1005
1069
  var external_lodash_ = __webpack_require__(2);
1006
1070
 
1007
- // 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&
1071
+ // CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form-dialog/src/index.vue?vue&type=script&lang=js
1008
1072
 
1009
1073
 
1010
1074
 
1011
1075
 
1012
1076
 
1077
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1078
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1079
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1013
1080
 
1014
1081
 
1015
1082
 
@@ -1017,7 +1084,7 @@ var external_lodash_ = __webpack_require__(2);
1017
1084
 
1018
1085
 
1019
1086
 
1020
- /* harmony default export */ var srcvue_type_script_lang_js_ = ({
1087
+ /* harmony default export */ var srcvue_type_script_lang_js = ({
1021
1088
  name: "FormDialog",
1022
1089
  componentName: "FormDialog",
1023
1090
  components: {
@@ -1181,93 +1248,119 @@ var external_lodash_ = __webpack_require__(2);
1181
1248
  },
1182
1249
  submit: function submit(button) {
1183
1250
  var _this3 = this;
1184
- this.$refs.form.validate(function (isValidate, errorMessage) {
1185
- if (!isValidate) {
1186
- return false;
1187
- }
1188
- var reqData = Object(external_lodash_["merge"])(_this3.api.data || {}, _this3.formModel);
1189
- if (typeof _this3.api.before === "function") {
1190
- reqData = _this3.api.before.call(_this3, reqData);
1191
- }
1192
- if (!(_this3.api.url && _this3.requester)) {
1193
- if (_this3.noApiClose) {
1194
- _this3.reset();
1195
- _this3.show = false;
1196
- }
1197
- _this3.$emit("success", {
1198
- request: _this3.requester,
1199
- reqData: reqData,
1200
- expandData: _this3.expandModel
1201
- }, {
1202
- button: button
1203
- });
1204
- if (!_this3.$listeners.success && _this3.on && typeof _this3.on.success === "function") {
1205
- _this3.on.success.call(_this3, {
1206
- request: _this3.requester,
1207
- reqData: reqData,
1208
- expandData: _this3.expandModel
1209
- }, {
1210
- button: button
1211
- });
1212
- }
1213
- return false;
1214
- }
1215
- button.loading = true;
1216
- _this3.requester({
1217
- url: Object(formula_["evaluate"])(_this3.api.url, reqData),
1218
- method: _this3.api.method || "POST",
1219
- headers: _this3.api.headers,
1220
- data: reqData
1221
- }).then(function (res) {
1222
- button.loading = false;
1223
- _this3.reset();
1224
- _this3.show = false;
1225
- _this3.$emit("success", {
1226
- request: _this3.requester,
1227
- reqData: reqData,
1228
- resData: res,
1229
- expandData: _this3.expandModel
1230
- }, {
1231
- button: button
1232
- });
1233
- if (!_this3.$listeners.success && _this3.on && typeof _this3.on.success === "function") {
1234
- _this3.on.success.call(_this3, {
1235
- request: _this3.requester,
1236
- reqData: reqData,
1237
- resData: res,
1238
- expandData: _this3.expandModel
1239
- }, {
1240
- button: button
1241
- });
1242
- }
1243
- if (_this3.message && _this3.message.success) {
1244
- message_default()(_this3.message.success);
1245
- }
1246
- }).catch(function (error) {
1247
- button.loading = false;
1248
- _this3.$emit("error", {
1249
- request: _this3.requester,
1250
- reqData: reqData,
1251
- resError: error,
1252
- expandData: _this3.expandModel
1253
- }, {
1254
- button: button
1255
- });
1256
- if (!_this3.$listeners.error && _this3.on && typeof _this3.on.error === "function") {
1257
- _this3.on.error.call(_this3, {
1258
- request: _this3.requester,
1259
- reqData: reqData,
1260
- resError: error,
1261
- expandData: _this3.expandModel
1262
- }, {
1263
- button: button
1264
- });
1265
- }
1266
- if (_this3.message && _this3.message.error) {
1267
- message_default()(_this3.message.error);
1268
- }
1269
- });
1270
- });
1251
+ this.$refs.form.validate( /*#__PURE__*/function () {
1252
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(isValidate, errorMessage) {
1253
+ var reqData;
1254
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1255
+ while (1) switch (_context.prev = _context.next) {
1256
+ case 0:
1257
+ if (isValidate) {
1258
+ _context.next = 2;
1259
+ break;
1260
+ }
1261
+ return _context.abrupt("return", false);
1262
+ case 2:
1263
+ reqData = Object(external_lodash_["merge"])(_this3.api.data || {}, _this3.formModel);
1264
+ if (!(typeof _this3.api.before === "function")) {
1265
+ _context.next = 7;
1266
+ break;
1267
+ }
1268
+ _context.next = 6;
1269
+ return _this3.api.before.call(_this3, reqData);
1270
+ case 6:
1271
+ reqData = _context.sent;
1272
+ case 7:
1273
+ if (_this3.api.url && _this3.requester) {
1274
+ _context.next = 12;
1275
+ break;
1276
+ }
1277
+ if (_this3.noApiClose) {
1278
+ _this3.reset();
1279
+ _this3.show = false;
1280
+ }
1281
+ _this3.$emit("success", {
1282
+ request: _this3.requester,
1283
+ reqData: reqData,
1284
+ expandData: _this3.expandModel
1285
+ }, {
1286
+ button: button
1287
+ });
1288
+ if (!_this3.$listeners.success && _this3.on && typeof _this3.on.success === "function") {
1289
+ _this3.on.success.call(_this3, {
1290
+ request: _this3.requester,
1291
+ reqData: reqData,
1292
+ expandData: _this3.expandModel
1293
+ }, {
1294
+ button: button
1295
+ });
1296
+ }
1297
+ return _context.abrupt("return", false);
1298
+ case 12:
1299
+ button.loading = true;
1300
+ _this3.requester({
1301
+ url: Object(formula_["evaluate"])(_this3.api.url, reqData),
1302
+ method: _this3.api.method || "POST",
1303
+ headers: _this3.api.headers,
1304
+ data: reqData
1305
+ }).then(function (res) {
1306
+ button.loading = false;
1307
+ _this3.reset();
1308
+ _this3.show = false;
1309
+ _this3.$emit("success", {
1310
+ request: _this3.requester,
1311
+ reqData: reqData,
1312
+ resData: res,
1313
+ expandData: _this3.expandModel
1314
+ }, {
1315
+ button: button
1316
+ });
1317
+ if (!_this3.$listeners.success && _this3.on && typeof _this3.on.success === "function") {
1318
+ _this3.on.success.call(_this3, {
1319
+ request: _this3.requester,
1320
+ reqData: reqData,
1321
+ resData: res,
1322
+ expandData: _this3.expandModel
1323
+ }, {
1324
+ button: button
1325
+ });
1326
+ }
1327
+ if (_this3.message && _this3.message.success) {
1328
+ message_default()(Object.assign({}, _this3.message.success));
1329
+ }
1330
+ }).catch(function (error) {
1331
+ button.loading = false;
1332
+ _this3.$emit("error", {
1333
+ request: _this3.requester,
1334
+ reqData: reqData,
1335
+ resError: error,
1336
+ expandData: _this3.expandModel
1337
+ }, {
1338
+ button: button
1339
+ });
1340
+ if (!_this3.$listeners.error && _this3.on && typeof _this3.on.error === "function") {
1341
+ _this3.on.error.call(_this3, {
1342
+ request: _this3.requester,
1343
+ reqData: reqData,
1344
+ resError: error,
1345
+ expandData: _this3.expandModel
1346
+ }, {
1347
+ button: button
1348
+ });
1349
+ }
1350
+ if (_this3.message && _this3.message.error) {
1351
+ message_default()(Object.assign({}, _this3.message.error));
1352
+ }
1353
+ });
1354
+ case 14:
1355
+ case "end":
1356
+ return _context.stop();
1357
+ }
1358
+ }, _callee);
1359
+ }));
1360
+ return function (_x, _x2) {
1361
+ return _ref.apply(this, arguments);
1362
+ };
1363
+ }());
1271
1364
  },
1272
1365
  renderForm: function renderForm(h) {
1273
1366
  var param = {
@@ -1287,13 +1380,19 @@ var external_lodash_ = __webpack_require__(2);
1287
1380
  },
1288
1381
  renderTitle: function renderTitle(h) {
1289
1382
  if (typeof this.slots.title === "function") {
1290
- return this.slots.title.call(this, this.formModel);
1383
+ return this.slots.title.call(this, {
1384
+ ref: this,
1385
+ formModel: this.formModel
1386
+ });
1291
1387
  }
1292
1388
  return this.slots.title || this.dialog.title;
1293
1389
  },
1294
1390
  renderTools: function renderTools(h) {
1295
1391
  if (typeof this.slots.footer === "function") {
1296
- return this.slots.footer.call(this, this.formModel);
1392
+ return this.slots.footer.call(this, {
1393
+ ref: this,
1394
+ formModel: this.formModel
1395
+ });
1297
1396
  }
1298
1397
  return h("div", [(this.tools || this.defaultTools).map(function (item) {
1299
1398
  var toolParam = {
@@ -1328,9 +1427,9 @@ var external_lodash_ = __webpack_require__(2);
1328
1427
  }, [this.renderTools(h)]), this.renderForm(h)]);
1329
1428
  }
1330
1429
  });
1331
- // CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue?vue&type=script&lang=js&
1332
- /* harmony default export */ var form_dialog_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
1333
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1430
+ // CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue?vue&type=script&lang=js
1431
+ /* harmony default export */ var form_dialog_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
1432
+ // EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/runtime/componentNormalizer.js
1334
1433
  var componentNormalizer = __webpack_require__(1);
1335
1434
 
1336
1435
  // CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue
@@ -1342,7 +1441,7 @@ var src_render, staticRenderFns
1342
1441
  /* normalize component */
1343
1442
 
1344
1443
  var component = Object(componentNormalizer["a" /* default */])(
1345
- form_dialog_srcvue_type_script_lang_js_,
1444
+ form_dialog_srcvue_type_script_lang_js,
1346
1445
  src_render,
1347
1446
  staticRenderFns,
1348
1447
  false,