@panpanzhao/component-ui 0.0.10 → 0.0.12
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 +362 -157
- package/lib/components/crud.js +59 -30
- package/lib/components/form-dialog.js +54 -28
- package/lib/components/form-drawer.js +5 -2
- package/lib/components/form-group.js +5 -2
- package/lib/components/form-input.js +191 -60
- package/lib/components/form-item.js +31 -19
- package/lib/components/form.js +5 -2
- package/lib/components/table-column.js +19 -13
- package/lib/components/table-editable.js +8 -8
- package/lib/components/table-operate.js +54 -28
- package/lib/components/table-search.js +3 -3
- package/lib/components/table.js +17 -7
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +1 -1
- package/lib/styles/form.css +1 -1
- package/lib/styles/index.css +1 -1
- package/lib/styles/table-search.css +1 -1
- package/package.json +2 -2
|
@@ -308,13 +308,13 @@ module.exports = require("element-ui/lib/checkbox-button");
|
|
|
308
308
|
/* 46 */
|
|
309
309
|
/***/ (function(module, exports) {
|
|
310
310
|
|
|
311
|
-
module.exports = require("element-ui/lib/
|
|
311
|
+
module.exports = require("element-ui/lib/cascader");
|
|
312
312
|
|
|
313
313
|
/***/ }),
|
|
314
314
|
/* 47 */
|
|
315
315
|
/***/ (function(module, exports) {
|
|
316
316
|
|
|
317
|
-
module.exports = require("element-ui/lib/
|
|
317
|
+
module.exports = require("element-ui/lib/switch");
|
|
318
318
|
|
|
319
319
|
/***/ }),
|
|
320
320
|
/* 48 */
|
|
@@ -586,8 +586,8 @@ var option_default = /*#__PURE__*/__webpack_require__.n(option_);
|
|
|
586
586
|
var option_group_ = __webpack_require__(40);
|
|
587
587
|
var option_group_default = /*#__PURE__*/__webpack_require__.n(option_group_);
|
|
588
588
|
|
|
589
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=template&id=
|
|
590
|
-
var
|
|
589
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=template&id=b7fb5e4e&
|
|
590
|
+
var SelectTreevue_type_template_id_b7fb5e4e_render = function render() {
|
|
591
591
|
var _vm = this,
|
|
592
592
|
_c = _vm._self._c
|
|
593
593
|
return _c(
|
|
@@ -657,11 +657,11 @@ var SelectTreevue_type_template_id_626a2185_render = function render() {
|
|
|
657
657
|
1
|
|
658
658
|
)
|
|
659
659
|
}
|
|
660
|
-
var
|
|
661
|
-
|
|
660
|
+
var SelectTreevue_type_template_id_b7fb5e4e_staticRenderFns = []
|
|
661
|
+
SelectTreevue_type_template_id_b7fb5e4e_render._withStripped = true
|
|
662
662
|
|
|
663
663
|
|
|
664
|
-
// CONCATENATED MODULE: ./src/components/form/src/item/SelectTree.vue?vue&type=template&id=
|
|
664
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/SelectTree.vue?vue&type=template&id=b7fb5e4e&
|
|
665
665
|
|
|
666
666
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=script&lang=js&
|
|
667
667
|
/* harmony default export */ var SelectTreevue_type_script_lang_js_ = ({
|
|
@@ -718,6 +718,17 @@ SelectTreevue_type_template_id_626a2185_render._withStripped = true
|
|
|
718
718
|
},
|
|
719
719
|
|
|
720
720
|
watch: {
|
|
721
|
+
value: function value(val) {
|
|
722
|
+
if (!val) {
|
|
723
|
+
if (this.$refs.tree) {
|
|
724
|
+
this.$refs.tree.setCurrentKey(null);
|
|
725
|
+
this.$refs.tree.setCheckedKeys([]);
|
|
726
|
+
}
|
|
727
|
+
this.selectedData = null;
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
this.initData();
|
|
731
|
+
},
|
|
721
732
|
options: {
|
|
722
733
|
handler: function handler() {
|
|
723
734
|
var _this = this;
|
|
@@ -830,9 +841,11 @@ SelectTreevue_type_template_id_626a2185_render._withStripped = true
|
|
|
830
841
|
},
|
|
831
842
|
emitChange: function emitChange() {
|
|
832
843
|
if (this.multiple) {
|
|
844
|
+
this.$emit("input", this.checkedKeys, this.checkedData);
|
|
833
845
|
this.$emit("change", this.checkedKeys, this.checkedData);
|
|
834
846
|
return false;
|
|
835
847
|
}
|
|
848
|
+
this.$emit("input", this.checkedData && this.checkedData[this.optionProps.value], this.checkedData);
|
|
836
849
|
this.$emit("change", this.checkedData && this.checkedData[this.optionProps.value], this.checkedData);
|
|
837
850
|
},
|
|
838
851
|
setSingleData: function setSingleData(data) {
|
|
@@ -856,6 +869,11 @@ SelectTreevue_type_template_id_626a2185_render._withStripped = true
|
|
|
856
869
|
if (this.multiple) {
|
|
857
870
|
return false;
|
|
858
871
|
}
|
|
872
|
+
if (data.disabled) {
|
|
873
|
+
this.$refs.tree.setCurrentKey(this.value || null);
|
|
874
|
+
console.warn("该节点数据disabled为true,不能选择");
|
|
875
|
+
return false;
|
|
876
|
+
}
|
|
859
877
|
this.setSingleData(data);
|
|
860
878
|
this.emitChange();
|
|
861
879
|
this.$refs.select.handleClose();
|
|
@@ -897,8 +915,8 @@ SelectTreevue_type_template_id_626a2185_render._withStripped = true
|
|
|
897
915
|
|
|
898
916
|
var SelectTree_component = Object(componentNormalizer["a" /* default */])(
|
|
899
917
|
item_SelectTreevue_type_script_lang_js_,
|
|
900
|
-
|
|
901
|
-
|
|
918
|
+
SelectTreevue_type_template_id_b7fb5e4e_render,
|
|
919
|
+
SelectTreevue_type_template_id_b7fb5e4e_staticRenderFns,
|
|
902
920
|
false,
|
|
903
921
|
null,
|
|
904
922
|
null,
|
|
@@ -932,16 +950,18 @@ var formula_ = __webpack_require__(3);
|
|
|
932
950
|
},
|
|
933
951
|
props: {
|
|
934
952
|
selectMode: String,
|
|
953
|
+
dictCode: String,
|
|
935
954
|
options: {
|
|
936
955
|
type: Array,
|
|
937
956
|
default: function _default() {
|
|
938
957
|
return null;
|
|
939
958
|
}
|
|
940
959
|
},
|
|
960
|
+
optionRender: Function,
|
|
941
961
|
api: {
|
|
942
962
|
type: Object,
|
|
943
963
|
default: function _default() {
|
|
944
|
-
return
|
|
964
|
+
return {};
|
|
945
965
|
}
|
|
946
966
|
},
|
|
947
967
|
apiOpen: {
|
|
@@ -953,11 +973,7 @@ var formula_ = __webpack_require__(3);
|
|
|
953
973
|
optionProps: {
|
|
954
974
|
type: Object,
|
|
955
975
|
default: function _default() {
|
|
956
|
-
return {
|
|
957
|
-
value: "value",
|
|
958
|
-
label: "label",
|
|
959
|
-
children: "children"
|
|
960
|
-
};
|
|
976
|
+
return {};
|
|
961
977
|
}
|
|
962
978
|
}
|
|
963
979
|
},
|
|
@@ -970,8 +986,15 @@ var formula_ = __webpack_require__(3);
|
|
|
970
986
|
attrs: function attrs() {
|
|
971
987
|
return Object.assign({}, this.$attrs);
|
|
972
988
|
},
|
|
989
|
+
dictOption: function dictOption() {
|
|
990
|
+
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
991
|
+
return this.$COMPONENT.dataSource.dict[this.dictCode];
|
|
992
|
+
}
|
|
993
|
+
return [];
|
|
994
|
+
},
|
|
973
995
|
optionData: function optionData() {
|
|
974
|
-
|
|
996
|
+
var options = this.options || this.apiOptions;
|
|
997
|
+
return Array.isArray(options) ? options : this.dictOption;
|
|
975
998
|
},
|
|
976
999
|
_form: function _form() {
|
|
977
1000
|
var parent = this.$parent;
|
|
@@ -984,6 +1007,13 @@ var formula_ = __webpack_require__(3);
|
|
|
984
1007
|
}
|
|
985
1008
|
return false;
|
|
986
1009
|
},
|
|
1010
|
+
_optionProps: function _optionProps() {
|
|
1011
|
+
return Object.assign({
|
|
1012
|
+
value: "value",
|
|
1013
|
+
label: "label",
|
|
1014
|
+
children: "children"
|
|
1015
|
+
}, this.optionProps);
|
|
1016
|
+
},
|
|
987
1017
|
request: function request() {
|
|
988
1018
|
return this.api.request || this._form && this._form.request || (this.$COMPONENT || {}).request;
|
|
989
1019
|
}
|
|
@@ -1003,26 +1033,36 @@ var formula_ = __webpack_require__(3);
|
|
|
1003
1033
|
},
|
|
1004
1034
|
methods: {
|
|
1005
1035
|
transformOption: function transformOption(item) {
|
|
1006
|
-
item.value = item[this.
|
|
1007
|
-
item.label = item[this.
|
|
1008
|
-
if (item[this.
|
|
1009
|
-
item.children = this.transformOption(item[this.
|
|
1036
|
+
item.value = item[this._optionProps.value];
|
|
1037
|
+
item.label = item[this._optionProps.label];
|
|
1038
|
+
if (item[this._optionProps.children]) {
|
|
1039
|
+
item.children = this.transformOption(item[this._optionProps.children]);
|
|
1010
1040
|
}
|
|
1011
1041
|
return item;
|
|
1012
1042
|
},
|
|
1013
1043
|
initApi: function initApi() {
|
|
1014
1044
|
var _this = this;
|
|
1015
|
-
if (!(this.api && this.request)) {
|
|
1045
|
+
if (!(this.api.url && this.request)) {
|
|
1016
1046
|
return false;
|
|
1017
1047
|
}
|
|
1048
|
+
var reqData = Object(external_lodash_["merge"])({}, this.api.data);
|
|
1049
|
+
if (typeof this.api.before === "function") {
|
|
1050
|
+
reqData = this.api.before.call(this, reqData, {
|
|
1051
|
+
form: this._form,
|
|
1052
|
+
formModel: this._form && this._form.formModel
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1018
1055
|
this.request({
|
|
1019
|
-
url: Object(formula_["evaluate"])(this.api.url,
|
|
1056
|
+
url: Object(formula_["evaluate"])(this.api.url, reqData),
|
|
1020
1057
|
method: this.api.method || "GET",
|
|
1021
|
-
|
|
1058
|
+
headers: this.api.headers,
|
|
1059
|
+
data: reqData
|
|
1022
1060
|
}).then(function (res) {
|
|
1023
|
-
if (typeof _this.api.
|
|
1024
|
-
|
|
1025
|
-
|
|
1061
|
+
if (typeof _this.api.after === "function") {
|
|
1062
|
+
res = _this.api.after.call(_this, res, {
|
|
1063
|
+
form: _this._form,
|
|
1064
|
+
formModel: _this._form && _this._form.formModel
|
|
1065
|
+
});
|
|
1026
1066
|
}
|
|
1027
1067
|
_this.apiOptions = _this.api.dataPath ? Object(external_lodash_["get"])(res, _this.api.dataPath, []) : res;
|
|
1028
1068
|
}).catch(function (error) {
|
|
@@ -1033,19 +1073,22 @@ var formula_ = __webpack_require__(3);
|
|
|
1033
1073
|
var _this2 = this;
|
|
1034
1074
|
return this.optionData.map(function (item) {
|
|
1035
1075
|
return h("el-option-group", {
|
|
1036
|
-
"key": item[_this2.
|
|
1076
|
+
"key": item[_this2._optionProps.value],
|
|
1037
1077
|
"attrs": {
|
|
1038
|
-
"label": item[_this2.
|
|
1078
|
+
"label": item[_this2._optionProps.label]
|
|
1039
1079
|
}
|
|
1040
|
-
}, [item[_this2.
|
|
1080
|
+
}, [item[_this2._optionProps.children] && item[_this2._optionProps.children].map(function (itemOpt) {
|
|
1041
1081
|
return h("el-option", {
|
|
1042
|
-
"key": itemOpt[_this2.
|
|
1082
|
+
"key": itemOpt[_this2._optionProps.value],
|
|
1043
1083
|
"attrs": {
|
|
1044
|
-
"value": itemOpt[_this2.
|
|
1045
|
-
"label": itemOpt[_this2.
|
|
1084
|
+
"value": itemOpt[_this2._optionProps.value],
|
|
1085
|
+
"label": itemOpt[_this2._optionProps.label],
|
|
1046
1086
|
"disabled": itemOpt.disabled
|
|
1047
1087
|
}
|
|
1048
|
-
}
|
|
1088
|
+
}, [_this2.optionRender ? _this2.optionRender.call(_this2, h, itemOpt, {
|
|
1089
|
+
form: _this2._form,
|
|
1090
|
+
formModel: _this2._form && _this2._form.formModel
|
|
1091
|
+
}) : null]);
|
|
1049
1092
|
})]);
|
|
1050
1093
|
});
|
|
1051
1094
|
},
|
|
@@ -1053,7 +1096,7 @@ var formula_ = __webpack_require__(3);
|
|
|
1053
1096
|
var param = {
|
|
1054
1097
|
attrs: Object.assign({}, this.$attrs, {
|
|
1055
1098
|
options: this.optionData,
|
|
1056
|
-
optionProps: this.
|
|
1099
|
+
optionProps: this._optionProps
|
|
1057
1100
|
}),
|
|
1058
1101
|
slots: this.$slots,
|
|
1059
1102
|
scopedSlots: this.$slots,
|
|
@@ -1066,14 +1109,17 @@ var formula_ = __webpack_require__(3);
|
|
|
1066
1109
|
if (this.selectMode === "group") {
|
|
1067
1110
|
return this.renderGroup(h, scoped);
|
|
1068
1111
|
}
|
|
1069
|
-
return this.optionData.map(function (
|
|
1112
|
+
return this.optionData.map(function (itemOpt) {
|
|
1070
1113
|
return h("el-option", {
|
|
1071
|
-
"key":
|
|
1114
|
+
"key": itemOpt[_this3._optionProps.value],
|
|
1072
1115
|
"attrs": {
|
|
1073
|
-
"value":
|
|
1074
|
-
"label":
|
|
1116
|
+
"value": itemOpt[_this3._optionProps.value],
|
|
1117
|
+
"label": itemOpt[_this3._optionProps.label]
|
|
1075
1118
|
}
|
|
1076
|
-
}
|
|
1119
|
+
}, [_this3.optionRender ? _this3.optionRender.call(_this3, h, itemOpt, {
|
|
1120
|
+
form: _this3._form,
|
|
1121
|
+
formModel: _this3._form && _this3._form.formModel
|
|
1122
|
+
}) : null]);
|
|
1077
1123
|
});
|
|
1078
1124
|
}
|
|
1079
1125
|
},
|
|
@@ -1148,6 +1194,7 @@ var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
|
1148
1194
|
},
|
|
1149
1195
|
props: {
|
|
1150
1196
|
size: String,
|
|
1197
|
+
dictCode: String,
|
|
1151
1198
|
border: {
|
|
1152
1199
|
type: Boolean,
|
|
1153
1200
|
default: function _default() {
|
|
@@ -1196,8 +1243,14 @@ var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
|
1196
1243
|
border: this.border
|
|
1197
1244
|
});
|
|
1198
1245
|
},
|
|
1246
|
+
dictOption: function dictOption() {
|
|
1247
|
+
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
1248
|
+
return this.$COMPONENT.dataSource.dict[this.dictCode];
|
|
1249
|
+
}
|
|
1250
|
+
return [];
|
|
1251
|
+
},
|
|
1199
1252
|
optionData: function optionData() {
|
|
1200
|
-
return this.options || this.apiOptions ||
|
|
1253
|
+
return this.options || this.apiOptions || this.dictOption;
|
|
1201
1254
|
},
|
|
1202
1255
|
_form: function _form() {
|
|
1203
1256
|
var parent = this.$parent;
|
|
@@ -1343,6 +1396,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1343
1396
|
},
|
|
1344
1397
|
props: {
|
|
1345
1398
|
size: String,
|
|
1399
|
+
dictCode: String,
|
|
1346
1400
|
border: {
|
|
1347
1401
|
type: Boolean,
|
|
1348
1402
|
default: function _default() {
|
|
@@ -1371,11 +1425,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1371
1425
|
optionProps: {
|
|
1372
1426
|
type: Object,
|
|
1373
1427
|
default: function _default() {
|
|
1374
|
-
return {
|
|
1375
|
-
value: "value",
|
|
1376
|
-
label: "label",
|
|
1377
|
-
name: "name"
|
|
1378
|
-
};
|
|
1428
|
+
return {};
|
|
1379
1429
|
}
|
|
1380
1430
|
}
|
|
1381
1431
|
},
|
|
@@ -1391,8 +1441,14 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1391
1441
|
border: this.border
|
|
1392
1442
|
});
|
|
1393
1443
|
},
|
|
1444
|
+
dictOption: function dictOption() {
|
|
1445
|
+
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
1446
|
+
return this.$COMPONENT.dataSource.dict[this.dictCode];
|
|
1447
|
+
}
|
|
1448
|
+
return [];
|
|
1449
|
+
},
|
|
1394
1450
|
optionData: function optionData() {
|
|
1395
|
-
return this.options || this.apiOptions ||
|
|
1451
|
+
return this.options || this.apiOptions || this.dictOption;
|
|
1396
1452
|
},
|
|
1397
1453
|
_form: function _form() {
|
|
1398
1454
|
var parent = this.$parent;
|
|
@@ -1405,6 +1461,13 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1405
1461
|
}
|
|
1406
1462
|
return false;
|
|
1407
1463
|
},
|
|
1464
|
+
_optionProps: function _optionProps() {
|
|
1465
|
+
return Object.assign({
|
|
1466
|
+
value: "value",
|
|
1467
|
+
label: "label",
|
|
1468
|
+
children: "children"
|
|
1469
|
+
}, this.optionProps);
|
|
1470
|
+
},
|
|
1408
1471
|
request: function request() {
|
|
1409
1472
|
return this.api.request || this._form && this._form.request || (this.$COMPONENT || {}).request;
|
|
1410
1473
|
}
|
|
@@ -1446,12 +1509,12 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1446
1509
|
var _this2 = this;
|
|
1447
1510
|
return this.optionData.map(function (item) {
|
|
1448
1511
|
return h("el-checkbox-button", {
|
|
1449
|
-
"key": item[_this2.
|
|
1512
|
+
"key": item[_this2._optionProps.value],
|
|
1450
1513
|
"attrs": {
|
|
1451
|
-
"label": item[_this2.
|
|
1452
|
-
"disabled": item[_this2.
|
|
1514
|
+
"label": item[_this2._optionProps.value],
|
|
1515
|
+
"disabled": item[_this2._optionProps.disabled]
|
|
1453
1516
|
}
|
|
1454
|
-
}, [item[_this2.
|
|
1517
|
+
}, [item[_this2._optionProps.label]]);
|
|
1455
1518
|
});
|
|
1456
1519
|
},
|
|
1457
1520
|
renderOptions: function renderOptions(h, scoped) {
|
|
@@ -1461,15 +1524,15 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1461
1524
|
}
|
|
1462
1525
|
return this.optionData.map(function (item) {
|
|
1463
1526
|
return h("el-checkbox", {
|
|
1464
|
-
"key": item[_this3.
|
|
1527
|
+
"key": item[_this3._optionProps.value],
|
|
1465
1528
|
"attrs": {
|
|
1466
|
-
"value": item[_this3.
|
|
1467
|
-
"label": item[_this3.
|
|
1468
|
-
"disabled": item[_this3.
|
|
1529
|
+
"value": item[_this3._optionProps.value],
|
|
1530
|
+
"label": item[_this3._optionProps.value],
|
|
1531
|
+
"disabled": item[_this3._optionProps.disabled],
|
|
1469
1532
|
"border": _this3.border,
|
|
1470
1533
|
"size": _this3.size
|
|
1471
1534
|
}
|
|
1472
|
-
}, [item[_this3.
|
|
1535
|
+
}, [item[_this3._optionProps.label]]);
|
|
1473
1536
|
});
|
|
1474
1537
|
}
|
|
1475
1538
|
},
|
|
@@ -1565,14 +1628,81 @@ var InputText_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1565
1628
|
)
|
|
1566
1629
|
|
|
1567
1630
|
/* harmony default export */ var InputText = (InputText_component.exports);
|
|
1568
|
-
//
|
|
1569
|
-
var
|
|
1570
|
-
var
|
|
1631
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Cascader.vue?vue&type=template&id=1306b5bf&
|
|
1632
|
+
var Cascadervue_type_template_id_1306b5bf_render = function render() {
|
|
1633
|
+
var _vm = this,
|
|
1634
|
+
_c = _vm._self._c
|
|
1635
|
+
return _c(
|
|
1636
|
+
"el-cascader",
|
|
1637
|
+
_vm._g(
|
|
1638
|
+
_vm._b(
|
|
1639
|
+
{ attrs: { options: _vm.options } },
|
|
1640
|
+
"el-cascader",
|
|
1641
|
+
_vm.attrs,
|
|
1642
|
+
false
|
|
1643
|
+
),
|
|
1644
|
+
_vm.$listeners
|
|
1645
|
+
)
|
|
1646
|
+
)
|
|
1647
|
+
}
|
|
1648
|
+
var Cascadervue_type_template_id_1306b5bf_staticRenderFns = []
|
|
1649
|
+
Cascadervue_type_template_id_1306b5bf_render._withStripped = true
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/Cascader.vue?vue&type=template&id=1306b5bf&
|
|
1571
1653
|
|
|
1572
1654
|
// EXTERNAL MODULE: external "element-ui/lib/cascader"
|
|
1573
|
-
var cascader_ = __webpack_require__(
|
|
1655
|
+
var cascader_ = __webpack_require__(46);
|
|
1574
1656
|
var cascader_default = /*#__PURE__*/__webpack_require__.n(cascader_);
|
|
1575
1657
|
|
|
1658
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Cascader.vue?vue&type=script&lang=js&
|
|
1659
|
+
|
|
1660
|
+
/* harmony default export */ var Cascadervue_type_script_lang_js_ = ({
|
|
1661
|
+
name: "Cascader",
|
|
1662
|
+
components: {
|
|
1663
|
+
elCascader: cascader_default.a
|
|
1664
|
+
},
|
|
1665
|
+
props: {
|
|
1666
|
+
size: String,
|
|
1667
|
+
options: {
|
|
1668
|
+
type: Array,
|
|
1669
|
+
default: function _default() {
|
|
1670
|
+
return null;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
computed: {
|
|
1675
|
+
attrs: function attrs() {
|
|
1676
|
+
return Object.assign({}, this.$attrs);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/Cascader.vue?vue&type=script&lang=js&
|
|
1681
|
+
/* harmony default export */ var item_Cascadervue_type_script_lang_js_ = (Cascadervue_type_script_lang_js_);
|
|
1682
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/Cascader.vue
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
/* normalize component */
|
|
1689
|
+
|
|
1690
|
+
var Cascader_component = Object(componentNormalizer["a" /* default */])(
|
|
1691
|
+
item_Cascadervue_type_script_lang_js_,
|
|
1692
|
+
Cascadervue_type_template_id_1306b5bf_render,
|
|
1693
|
+
Cascadervue_type_template_id_1306b5bf_staticRenderFns,
|
|
1694
|
+
false,
|
|
1695
|
+
null,
|
|
1696
|
+
null,
|
|
1697
|
+
null
|
|
1698
|
+
|
|
1699
|
+
)
|
|
1700
|
+
|
|
1701
|
+
/* harmony default export */ var Cascader = (Cascader_component.exports);
|
|
1702
|
+
// EXTERNAL MODULE: external "element-ui/lib/switch"
|
|
1703
|
+
var switch_ = __webpack_require__(47);
|
|
1704
|
+
var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
|
|
1705
|
+
|
|
1576
1706
|
// EXTERNAL MODULE: external "element-ui/lib/slider"
|
|
1577
1707
|
var slider_ = __webpack_require__(48);
|
|
1578
1708
|
var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
|
|
@@ -1604,6 +1734,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
1604
1734
|
|
|
1605
1735
|
|
|
1606
1736
|
|
|
1737
|
+
// import elCascader from "element-ui/packages/cascader";
|
|
1607
1738
|
|
|
1608
1739
|
|
|
1609
1740
|
|
|
@@ -1613,7 +1744,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
1613
1744
|
name: "FormInput",
|
|
1614
1745
|
inheritAttrs: false,
|
|
1615
1746
|
components: {
|
|
1616
|
-
Cascader:
|
|
1747
|
+
Cascader: Cascader,
|
|
1617
1748
|
Slider: slider_default.a,
|
|
1618
1749
|
Transfer: transfer_default.a,
|
|
1619
1750
|
Switchs: switch_default.a,
|
|
@@ -167,7 +167,11 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
167
167
|
watch: {
|
|
168
168
|
value: function value(val) {
|
|
169
169
|
//监听form的formModel变化,处理config的value变化
|
|
170
|
-
this.config.value
|
|
170
|
+
if (this.config.value === val) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
this.setValue(val);
|
|
174
|
+
this.execEvent("input", val);
|
|
171
175
|
if (this.form && this.form.formModel) {
|
|
172
176
|
this.$emit("formItemChange", {
|
|
173
177
|
itemConfig: this.config,
|
|
@@ -227,8 +231,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
227
231
|
if (this.on && this.on[eventName]) {
|
|
228
232
|
this.$emit.apply(this, [eventName, {
|
|
229
233
|
trigger: this.form,
|
|
234
|
+
triggerConfig: this.form.formItemLayout[this.prop],
|
|
230
235
|
triggerForm: this.form.formModel,
|
|
231
|
-
|
|
236
|
+
triggerFormConfig: this.form.formItemLayout
|
|
232
237
|
}].concat(arg));
|
|
233
238
|
}
|
|
234
239
|
//联动配置事件
|
|
@@ -250,6 +255,16 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
250
255
|
triggerConfig: this.form.formItemLayout[this.prop],
|
|
251
256
|
targetConfig: targetConfig
|
|
252
257
|
}].concat(arg));
|
|
258
|
+
},
|
|
259
|
+
setValue: function setValue(val) {
|
|
260
|
+
if (this.form) {
|
|
261
|
+
if (this.prop && this.prop.indexOf(".") != -1) {
|
|
262
|
+
Object(external_lodash_["set"])(this.form.formModel, this.prop, val);
|
|
263
|
+
} else {
|
|
264
|
+
this.form.formModel[this.prop] = val;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
this.config.value = val;
|
|
253
268
|
}
|
|
254
269
|
},
|
|
255
270
|
render: function render(h) {
|
|
@@ -261,30 +276,27 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
261
276
|
config: this.config
|
|
262
277
|
});
|
|
263
278
|
}
|
|
279
|
+
// disabled用的多,特殊处理下支持函数
|
|
280
|
+
var disabled = this.config.disabled;
|
|
281
|
+
if (typeof this.config.disabled === "function") {
|
|
282
|
+
disabled = this.config.disabled.call(this, {
|
|
283
|
+
form: this.form,
|
|
284
|
+
formModel: this.form.formModel,
|
|
285
|
+
config: this.config
|
|
286
|
+
});
|
|
287
|
+
}
|
|
264
288
|
var itemProp = {
|
|
265
|
-
attrs: Object.assign({}, this.config
|
|
289
|
+
attrs: Object.assign({}, this.config, {
|
|
290
|
+
disabled: disabled
|
|
291
|
+
}),
|
|
266
292
|
on: Object.assign({}, this.eventOn, this.actionEventOn, {
|
|
267
293
|
input: function input(val) {
|
|
294
|
+
_this2.setValue(val);
|
|
268
295
|
_this2.execEvent("input", val);
|
|
269
|
-
if (_this2.form) {
|
|
270
|
-
if (_this2.prop && _this2.prop.indexOf(".") != -1) {
|
|
271
|
-
Object(external_lodash_["set"])(_this2.form.formModel, _this2.prop, val);
|
|
272
|
-
} else {
|
|
273
|
-
_this2.form.formModel[_this2.prop] = val;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
_this2.config.value = val;
|
|
277
296
|
},
|
|
278
297
|
change: function change(val, selectOption) {
|
|
298
|
+
_this2.setValue(val);
|
|
279
299
|
_this2.execEvent("change", val, selectOption);
|
|
280
|
-
if (_this2.form) {
|
|
281
|
-
if (_this2.prop && _this2.prop.indexOf(".") != -1) {
|
|
282
|
-
Object(external_lodash_["set"])(_this2.form.formModel, _this2.prop, val);
|
|
283
|
-
} else {
|
|
284
|
-
_this2.form.formModel[_this2.prop] = val;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
_this2.config.value = val;
|
|
288
300
|
}
|
|
289
301
|
})
|
|
290
302
|
};
|
package/lib/components/form.js
CHANGED
|
@@ -210,7 +210,7 @@ module.exports = require("@panpanzhao/component-ui/lib/utils/formula");
|
|
|
210
210
|
// ESM COMPAT FLAG
|
|
211
211
|
__webpack_require__.r(__webpack_exports__);
|
|
212
212
|
|
|
213
|
-
// 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=
|
|
213
|
+
// 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=dfeb985e&
|
|
214
214
|
var render = function render() {
|
|
215
215
|
var _vm = this,
|
|
216
216
|
_c = _vm._self._c
|
|
@@ -281,7 +281,7 @@ var staticRenderFns = []
|
|
|
281
281
|
render._withStripped = true
|
|
282
282
|
|
|
283
283
|
|
|
284
|
-
// CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=
|
|
284
|
+
// CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=dfeb985e&
|
|
285
285
|
|
|
286
286
|
// EXTERNAL MODULE: external "element-ui/lib/form"
|
|
287
287
|
var form_ = __webpack_require__(12);
|
|
@@ -414,6 +414,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
414
414
|
var _this2 = this;
|
|
415
415
|
this.formItems.forEach(function (item) {
|
|
416
416
|
_this2.formItemLayout[item.prop] = item;
|
|
417
|
+
if (typeof item.value === "function") {
|
|
418
|
+
item.value = item.value.call(_this2);
|
|
419
|
+
}
|
|
417
420
|
_this2.defaultModel[item.prop] = item.value;
|
|
418
421
|
//初始化值处理
|
|
419
422
|
var formVal = Object(external_lodash_["get"])(_this2.formModel, item.prop);
|
|
@@ -942,8 +942,8 @@ var date_component = Object(componentNormalizer["a" /* default */])(
|
|
|
942
942
|
)
|
|
943
943
|
|
|
944
944
|
/* harmony default export */ var date = (date_component.exports);
|
|
945
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/dict.vue?vue&type=template&id=
|
|
946
|
-
var
|
|
945
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/dict.vue?vue&type=template&id=512d00c0&
|
|
946
|
+
var dictvue_type_template_id_512d00c0_render = function render() {
|
|
947
947
|
var _vm = this,
|
|
948
948
|
_c = _vm._self._c
|
|
949
949
|
return _c(
|
|
@@ -981,11 +981,11 @@ var dictvue_type_template_id_1da75cb2_render = function render() {
|
|
|
981
981
|
)
|
|
982
982
|
)
|
|
983
983
|
}
|
|
984
|
-
var
|
|
985
|
-
|
|
984
|
+
var dictvue_type_template_id_512d00c0_staticRenderFns = []
|
|
985
|
+
dictvue_type_template_id_512d00c0_render._withStripped = true
|
|
986
986
|
|
|
987
987
|
|
|
988
|
-
// CONCATENATED MODULE: ./src/components/table/src/column/dict.vue?vue&type=template&id=
|
|
988
|
+
// CONCATENATED MODULE: ./src/components/table/src/column/dict.vue?vue&type=template&id=512d00c0&
|
|
989
989
|
|
|
990
990
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/dict.vue?vue&type=script&lang=js&
|
|
991
991
|
|
|
@@ -995,6 +995,7 @@ dictvue_type_template_id_1da75cb2_render._withStripped = true
|
|
|
995
995
|
elTableColumn: table_column_default.a
|
|
996
996
|
},
|
|
997
997
|
props: {
|
|
998
|
+
dictCode: String,
|
|
998
999
|
options: {
|
|
999
1000
|
type: Array,
|
|
1000
1001
|
required: true
|
|
@@ -1018,11 +1019,18 @@ dictvue_type_template_id_1da75cb2_render._withStripped = true
|
|
|
1018
1019
|
"show-overflow-tooltip": true
|
|
1019
1020
|
}, this.$attrs);
|
|
1020
1021
|
},
|
|
1022
|
+
dictOption: function dictOption() {
|
|
1023
|
+
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
1024
|
+
return this.$COMPONENT.dataSource.dict[this.dictCode];
|
|
1025
|
+
}
|
|
1026
|
+
return [];
|
|
1027
|
+
},
|
|
1021
1028
|
optionMap: function optionMap() {
|
|
1022
1029
|
var _this = this;
|
|
1023
|
-
|
|
1030
|
+
var options = this.options || this.dictOption;
|
|
1031
|
+
if (Array.isArray(options)) {
|
|
1024
1032
|
var map = {};
|
|
1025
|
-
|
|
1033
|
+
options.forEach(function (item) {
|
|
1026
1034
|
var valueKey = item[_this.optionProp.value || "value"];
|
|
1027
1035
|
map[valueKey] = item;
|
|
1028
1036
|
});
|
|
@@ -1056,8 +1064,8 @@ dictvue_type_template_id_1da75cb2_render._withStripped = true
|
|
|
1056
1064
|
|
|
1057
1065
|
var dict_component = Object(componentNormalizer["a" /* default */])(
|
|
1058
1066
|
column_dictvue_type_script_lang_js_,
|
|
1059
|
-
|
|
1060
|
-
|
|
1067
|
+
dictvue_type_template_id_512d00c0_render,
|
|
1068
|
+
dictvue_type_template_id_512d00c0_staticRenderFns,
|
|
1061
1069
|
false,
|
|
1062
1070
|
null,
|
|
1063
1071
|
null,
|
|
@@ -1128,7 +1136,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1128
1136
|
computed: {
|
|
1129
1137
|
attrs: function attrs() {
|
|
1130
1138
|
return Object.assign({
|
|
1131
|
-
"show-overflow-tooltip":
|
|
1139
|
+
"show-overflow-tooltip": false
|
|
1132
1140
|
}, this.$attrs, this.$props);
|
|
1133
1141
|
},
|
|
1134
1142
|
defaultItem: function defaultItem() {
|
|
@@ -1177,9 +1185,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
1177
1185
|
return template;
|
|
1178
1186
|
},
|
|
1179
1187
|
itemVNode: function itemVNode(h, itemRow, scoped) {
|
|
1180
|
-
var cloneItem = Object
|
|
1181
|
-
control: this.defaultItem.control
|
|
1182
|
-
}, itemRow);
|
|
1188
|
+
var cloneItem = Object(external_lodash_["merge"])({}, this.defaultItem, itemRow);
|
|
1183
1189
|
cloneItem.parentData = scoped;
|
|
1184
1190
|
if (typeof cloneItem.render === "function") {
|
|
1185
1191
|
return cloneItem.render.call(this, h, scoped, cloneItem);
|