@panpanzhao/component-ui 0.0.53 → 1.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.
- package/lib/component-ui.common.js +1738 -556
- package/lib/components/crud.js +545 -292
- package/lib/components/dialog.js +44 -13
- package/lib/components/drawer.js +10 -10
- package/lib/components/form-dialog.js +242 -140
- package/lib/components/form-drawer.js +112 -45
- package/lib/components/form-group.js +105 -37
- package/lib/components/form-input.js +804 -94
- package/lib/components/form-item.js +19 -8
- package/lib/components/form-query.js +24 -9
- package/lib/components/form-view-dialog.js +94 -33
- package/lib/components/form-view-group.js +75 -18
- package/lib/components/form-view.js +7 -2
- package/lib/components/form.js +20 -10
- package/lib/components/formula.js +23 -23
- package/lib/components/table-column.js +47 -47
- package/lib/components/table-editable.js +22 -23
- package/lib/components/table-operate.js +354 -191
- package/lib/components/table-search.js +23 -17
- package/lib/components/table.js +22 -23
- package/lib/components/tree-line.js +272 -0
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +2 -2
- package/lib/styles/dialog.css +1 -1
- package/lib/styles/form-item.css +1 -0
- package/lib/styles/form-view.css +1 -1
- package/lib/styles/index.css +2 -2
- package/lib/styles/tree-line.css +1 -0
- package/lib/styles/upload-process.css +1 -0
- package/lib/utils/formula/doc.js +2 -3
- package/lib/utils/formula/evalutor.js +4 -3
- package/lib/utils/formula/filter.js +1 -2
- package/lib/utils/formula/function.js +1 -2
- package/lib/utils/formula/lexer.js +1 -4
- package/lib/utils/helper.js +3 -5
- 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=
|
|
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=
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
653
|
-
this.formModel
|
|
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",
|
|
@@ -759,9 +785,23 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
759
785
|
openedCode: null
|
|
760
786
|
};
|
|
761
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
|
+
},
|
|
762
802
|
computed: {
|
|
763
803
|
actionFormMap: function actionFormMap() {
|
|
764
|
-
var
|
|
804
|
+
var _this2 = this;
|
|
765
805
|
var actionForm = {};
|
|
766
806
|
this.actions.forEach(function (action) {
|
|
767
807
|
if (!action.trigger) {
|
|
@@ -784,15 +824,16 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
784
824
|
if (!targetConfig[formTarget.formCode]) {
|
|
785
825
|
targetConfig[formTarget.formCode] = {};
|
|
786
826
|
}
|
|
787
|
-
targetConfig[formTarget.formCode][formTarget.fieldCode] =
|
|
788
|
-
targetForm[formTarget.formCode] =
|
|
827
|
+
targetConfig[formTarget.formCode][formTarget.fieldCode] = _this2.formLayout[formTarget.formCode][formTarget.fieldCode];
|
|
828
|
+
targetForm[formTarget.formCode] = _this2.formModel[formTarget.formCode];
|
|
789
829
|
});
|
|
790
830
|
config.targetConfig = targetConfig;
|
|
791
831
|
config.targetForm = targetForm;
|
|
832
|
+
config.formModel = _this2.formModel;
|
|
792
833
|
for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
793
834
|
arg[_key - 1] = arguments[_key];
|
|
794
835
|
}
|
|
795
|
-
(_action$exec = action.exec).call.apply(_action$exec, [
|
|
836
|
+
(_action$exec = action.exec).call.apply(_action$exec, [_this2, config].concat(arg));
|
|
796
837
|
}
|
|
797
838
|
});
|
|
798
839
|
});
|
|
@@ -801,7 +842,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
801
842
|
},
|
|
802
843
|
methods: {
|
|
803
844
|
validate: function validate(callback) {
|
|
804
|
-
var
|
|
845
|
+
var _this3 = this;
|
|
805
846
|
var promise;
|
|
806
847
|
// if no callback, return promise
|
|
807
848
|
if (typeof callback !== "function" && Promise) {
|
|
@@ -819,9 +860,9 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
819
860
|
}
|
|
820
861
|
var invalidForms = {};
|
|
821
862
|
this.items.forEach(function (form) {
|
|
822
|
-
var formNode =
|
|
863
|
+
var formNode = _this3.$refs[form.prop];
|
|
823
864
|
if (!formNode) {
|
|
824
|
-
if (typeof callback === "function" && ++count ===
|
|
865
|
+
if (typeof callback === "function" && ++count === _this3.items.length) {
|
|
825
866
|
callback(valid, invalidForms);
|
|
826
867
|
}
|
|
827
868
|
return true;
|
|
@@ -831,7 +872,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
831
872
|
valid = false;
|
|
832
873
|
invalidForms[form.prop] = msgObj;
|
|
833
874
|
}
|
|
834
|
-
if (typeof callback === "function" && ++count ===
|
|
875
|
+
if (typeof callback === "function" && ++count === _this3.items.length) {
|
|
835
876
|
callback(valid, invalidForms);
|
|
836
877
|
}
|
|
837
878
|
});
|
|
@@ -841,9 +882,9 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
841
882
|
}
|
|
842
883
|
},
|
|
843
884
|
reset: function reset() {
|
|
844
|
-
var
|
|
885
|
+
var _this4 = this;
|
|
845
886
|
this.items.forEach(function (form) {
|
|
846
|
-
var formNode =
|
|
887
|
+
var formNode = _this4.$refs[form.prop];
|
|
847
888
|
if (!formNode) {
|
|
848
889
|
return true;
|
|
849
890
|
}
|
|
@@ -854,7 +895,8 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
854
895
|
var h = this.$createElement;
|
|
855
896
|
var formProp = {
|
|
856
897
|
attrs: Object.assign({
|
|
857
|
-
actions: this.actionFormMap[form.prop]
|
|
898
|
+
actions: this.actionFormMap[form.prop],
|
|
899
|
+
formModel: form.prop && this.formModel[form.prop]
|
|
858
900
|
}, form),
|
|
859
901
|
on: form.on
|
|
860
902
|
};
|
|
@@ -868,10 +910,10 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
868
910
|
}, formProp]));
|
|
869
911
|
},
|
|
870
912
|
renderTab: function renderTab(h, filterItems) {
|
|
871
|
-
var
|
|
913
|
+
var _this5 = this;
|
|
872
914
|
var itemNode = filterItems.map(function (item) {
|
|
873
915
|
if (typeof item.render === "function") {
|
|
874
|
-
return item.render(h,
|
|
916
|
+
return item.render(h, _this5.formModel, item);
|
|
875
917
|
}
|
|
876
918
|
return h("el-tab-pane", {
|
|
877
919
|
"key": item.prop,
|
|
@@ -881,7 +923,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
881
923
|
}
|
|
882
924
|
}, [h("template", {
|
|
883
925
|
"slot": "label"
|
|
884
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
926
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this5, h) : item.slots && item.slots.title]), _this5.formNode(item)]);
|
|
885
927
|
});
|
|
886
928
|
var tabsProp = {
|
|
887
929
|
attrs: {
|
|
@@ -890,17 +932,17 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
890
932
|
},
|
|
891
933
|
on: {
|
|
892
934
|
"tab-click": function tabClick(tabNode) {
|
|
893
|
-
|
|
935
|
+
_this5.$emit("openedCode", tabNode.name);
|
|
894
936
|
}
|
|
895
937
|
}
|
|
896
938
|
};
|
|
897
939
|
return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
|
|
898
940
|
},
|
|
899
941
|
renderCollapse: function renderCollapse(h, filterItems) {
|
|
900
|
-
var
|
|
942
|
+
var _this6 = this;
|
|
901
943
|
var itemNode = filterItems.map(function (item) {
|
|
902
944
|
if (typeof item.render === "function") {
|
|
903
|
-
return item.render(h,
|
|
945
|
+
return item.render(h, _this6.formModel, item);
|
|
904
946
|
}
|
|
905
947
|
return h("el-collapse-item", {
|
|
906
948
|
"key": item.prop,
|
|
@@ -910,7 +952,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
910
952
|
}
|
|
911
953
|
}, [h("template", {
|
|
912
954
|
"slot": "title"
|
|
913
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
955
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this6, h) : item.slots && item.slots.title]), _this6.formNode(item)]);
|
|
914
956
|
});
|
|
915
957
|
var collapseProp = {
|
|
916
958
|
attrs: {
|
|
@@ -918,20 +960,46 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
918
960
|
},
|
|
919
961
|
on: {
|
|
920
962
|
change: function change(val) {
|
|
921
|
-
|
|
963
|
+
_this6.$emit("openedCode", val);
|
|
922
964
|
}
|
|
923
965
|
}
|
|
924
966
|
};
|
|
925
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]);
|
|
926
994
|
}
|
|
927
995
|
},
|
|
928
996
|
render: function render(h) {
|
|
929
|
-
var
|
|
997
|
+
var _this8 = this;
|
|
930
998
|
var filterItems = this.items.filter(function (item) {
|
|
931
999
|
if (item.show === false) {
|
|
932
1000
|
return false;
|
|
933
1001
|
}
|
|
934
|
-
if (typeof item.show === "function" && !item.show.call(
|
|
1002
|
+
if (typeof item.show === "function" && !item.show.call(_this8, {
|
|
935
1003
|
config: item
|
|
936
1004
|
})) {
|
|
937
1005
|
return false;
|
|
@@ -942,9 +1010,14 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
942
1010
|
return null;
|
|
943
1011
|
}
|
|
944
1012
|
this.openedCode = filterItems[0] && filterItems[0].prop;
|
|
1013
|
+
var group = {
|
|
1014
|
+
Custom: this.renderCustom,
|
|
1015
|
+
Tab: this.renderTab,
|
|
1016
|
+
Collapse: this.renderCollapse
|
|
1017
|
+
};
|
|
945
1018
|
return h("div", {
|
|
946
|
-
"class": ["form-group", "is-" +
|
|
947
|
-
}, [this.control
|
|
1019
|
+
"class": ["form-group", "is-" + this.control]
|
|
1020
|
+
}, [group[this.control] ? group[this.control](h, filterItems) : null]);
|
|
948
1021
|
}
|
|
949
1022
|
});
|
|
950
1023
|
// CONCATENATED MODULE: ./src/components/form-group/index.js
|
|
@@ -954,12 +1027,6 @@ src.install = function (Vue) {
|
|
|
954
1027
|
};
|
|
955
1028
|
/* harmony default export */ var form_group = __webpack_exports__["default"] = (src);
|
|
956
1029
|
|
|
957
|
-
/***/ }),
|
|
958
|
-
/* 19 */
|
|
959
|
-
/***/ (function(module, exports) {
|
|
960
|
-
|
|
961
|
-
module.exports = require("element-ui/lib/message");
|
|
962
|
-
|
|
963
1030
|
/***/ }),
|
|
964
1031
|
/* 20 */,
|
|
965
1032
|
/* 21 */,
|
|
@@ -986,14 +1053,14 @@ var button_ = __webpack_require__(5);
|
|
|
986
1053
|
var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
987
1054
|
|
|
988
1055
|
// EXTERNAL MODULE: external "element-ui/lib/message"
|
|
989
|
-
var message_ = __webpack_require__(
|
|
1056
|
+
var message_ = __webpack_require__(17);
|
|
990
1057
|
var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
991
1058
|
|
|
992
1059
|
// EXTERNAL MODULE: ./src/components/form/index.js + 5 modules
|
|
993
1060
|
var components_form = __webpack_require__(4);
|
|
994
1061
|
|
|
995
1062
|
// EXTERNAL MODULE: ./src/components/form-group/index.js + 2 modules
|
|
996
|
-
var form_group = __webpack_require__(
|
|
1063
|
+
var form_group = __webpack_require__(19);
|
|
997
1064
|
|
|
998
1065
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/formula"
|
|
999
1066
|
var formula_ = __webpack_require__(3);
|
|
@@ -1001,12 +1068,15 @@ var formula_ = __webpack_require__(3);
|
|
|
1001
1068
|
// EXTERNAL MODULE: external "lodash"
|
|
1002
1069
|
var external_lodash_ = __webpack_require__(2);
|
|
1003
1070
|
|
|
1004
|
-
// 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
|
|
1005
1072
|
|
|
1006
1073
|
|
|
1007
1074
|
|
|
1008
1075
|
|
|
1009
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); }); }; }
|
|
1010
1080
|
|
|
1011
1081
|
|
|
1012
1082
|
|
|
@@ -1014,7 +1084,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1014
1084
|
|
|
1015
1085
|
|
|
1016
1086
|
|
|
1017
|
-
/* harmony default export */ var
|
|
1087
|
+
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
|
1018
1088
|
name: "FormDialog",
|
|
1019
1089
|
componentName: "FormDialog",
|
|
1020
1090
|
components: {
|
|
@@ -1178,93 +1248,119 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1178
1248
|
},
|
|
1179
1249
|
submit: function submit(button) {
|
|
1180
1250
|
var _this3 = this;
|
|
1181
|
-
this.$refs.form.validate(function (
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
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
|
+
}());
|
|
1268
1364
|
},
|
|
1269
1365
|
renderForm: function renderForm(h) {
|
|
1270
1366
|
var param = {
|
|
@@ -1284,13 +1380,19 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1284
1380
|
},
|
|
1285
1381
|
renderTitle: function renderTitle(h) {
|
|
1286
1382
|
if (typeof this.slots.title === "function") {
|
|
1287
|
-
return this.slots.title.call(this,
|
|
1383
|
+
return this.slots.title.call(this, {
|
|
1384
|
+
ref: this,
|
|
1385
|
+
formModel: this.formModel
|
|
1386
|
+
});
|
|
1288
1387
|
}
|
|
1289
1388
|
return this.slots.title || this.dialog.title;
|
|
1290
1389
|
},
|
|
1291
1390
|
renderTools: function renderTools(h) {
|
|
1292
1391
|
if (typeof this.slots.footer === "function") {
|
|
1293
|
-
return this.slots.footer.call(this,
|
|
1392
|
+
return this.slots.footer.call(this, {
|
|
1393
|
+
ref: this,
|
|
1394
|
+
formModel: this.formModel
|
|
1395
|
+
});
|
|
1294
1396
|
}
|
|
1295
1397
|
return h("div", [(this.tools || this.defaultTools).map(function (item) {
|
|
1296
1398
|
var toolParam = {
|
|
@@ -1325,9 +1427,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1325
1427
|
}, [this.renderTools(h)]), this.renderForm(h)]);
|
|
1326
1428
|
}
|
|
1327
1429
|
});
|
|
1328
|
-
// CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue?vue&type=script&lang=js
|
|
1329
|
-
/* harmony default export */ var
|
|
1330
|
-
// 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
|
|
1331
1433
|
var componentNormalizer = __webpack_require__(1);
|
|
1332
1434
|
|
|
1333
1435
|
// CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue
|
|
@@ -1339,7 +1441,7 @@ var src_render, staticRenderFns
|
|
|
1339
1441
|
/* normalize component */
|
|
1340
1442
|
|
|
1341
1443
|
var component = Object(componentNormalizer["a" /* default */])(
|
|
1342
|
-
|
|
1444
|
+
form_dialog_srcvue_type_script_lang_js,
|
|
1343
1445
|
src_render,
|
|
1344
1446
|
staticRenderFns,
|
|
1345
1447
|
false,
|