@panpanzhao/component-ui 0.0.46 → 0.0.48
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 +74 -54
- package/lib/components/crud.js +12 -6
- package/lib/components/form-dialog.js +6 -2
- package/lib/components/form-drawer.js +6 -2
- package/lib/components/form-group.js +6 -2
- package/lib/components/formula.js +2 -2
- package/lib/components/table-operate.js +6 -2
- package/lib/components/table.js +53 -39
- package/lib/index.js +1 -1
- package/lib/utils/helper.js +12 -0
- package/lib/utils/index.js +6 -0
- package/package.json +1 -1
|
@@ -3073,9 +3073,13 @@ form_query_src_form.install = function (Vue) {
|
|
|
3073
3073
|
}
|
|
3074
3074
|
},
|
|
3075
3075
|
created: function created() {
|
|
3076
|
-
if (this.
|
|
3077
|
-
this._formGroup.formModel[this.prop]
|
|
3076
|
+
if (this._formGroup) {
|
|
3077
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
3078
|
+
this.formModel = defaultVal || {};
|
|
3078
3079
|
}
|
|
3080
|
+
// if (this.prop && this._formGroup) {
|
|
3081
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
3082
|
+
// }
|
|
3079
3083
|
},
|
|
3080
3084
|
mounted: function mounted() {
|
|
3081
3085
|
if (this.prop && this._formGroup && this.$refs.form) {
|
|
@@ -4614,8 +4618,8 @@ form_view_dialog_src.install = function (Vue) {
|
|
|
4614
4618
|
Vue.component(form_view_dialog_src.name, form_view_dialog_src);
|
|
4615
4619
|
};
|
|
4616
4620
|
/* harmony default export */ var form_view_dialog = (form_view_dialog_src);
|
|
4617
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=
|
|
4618
|
-
var
|
|
4621
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=148cbb91&
|
|
4622
|
+
var tablevue_type_template_id_148cbb91_render = function render() {
|
|
4619
4623
|
var _vm = this,
|
|
4620
4624
|
_c = _vm._self._c
|
|
4621
4625
|
return _c("div", { staticClass: "table" }, [
|
|
@@ -4653,7 +4657,7 @@ var tablevue_type_template_id_7ea6d01a_render = function render() {
|
|
|
4653
4657
|
_vm.tableListeners
|
|
4654
4658
|
),
|
|
4655
4659
|
[
|
|
4656
|
-
_vm._l(_vm.
|
|
4660
|
+
_vm._l(_vm.filterColumns, function (column) {
|
|
4657
4661
|
return [
|
|
4658
4662
|
_c(
|
|
4659
4663
|
"TableColumn",
|
|
@@ -4693,11 +4697,11 @@ var tablevue_type_template_id_7ea6d01a_render = function render() {
|
|
|
4693
4697
|
: _vm._e(),
|
|
4694
4698
|
])
|
|
4695
4699
|
}
|
|
4696
|
-
var
|
|
4697
|
-
|
|
4700
|
+
var tablevue_type_template_id_148cbb91_staticRenderFns = []
|
|
4701
|
+
tablevue_type_template_id_148cbb91_render._withStripped = true
|
|
4698
4702
|
|
|
4699
4703
|
|
|
4700
|
-
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=
|
|
4704
|
+
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=148cbb91&
|
|
4701
4705
|
|
|
4702
4706
|
// EXTERNAL MODULE: external "element-ui/lib/table"
|
|
4703
4707
|
var table_ = __webpack_require__(22);
|
|
@@ -4880,6 +4884,20 @@ var index_ = __webpack_require__(3);
|
|
|
4880
4884
|
}
|
|
4881
4885
|
},
|
|
4882
4886
|
computed: {
|
|
4887
|
+
filterColumns: function filterColumns() {
|
|
4888
|
+
var _this2 = this;
|
|
4889
|
+
return this.columns.filter(function (item) {
|
|
4890
|
+
if (item.show === false) {
|
|
4891
|
+
return false;
|
|
4892
|
+
}
|
|
4893
|
+
if (typeof item.show === "function" && !item.show.call(_this2, {
|
|
4894
|
+
item: item
|
|
4895
|
+
})) {
|
|
4896
|
+
return false;
|
|
4897
|
+
}
|
|
4898
|
+
return true;
|
|
4899
|
+
});
|
|
4900
|
+
},
|
|
4883
4901
|
requester: function requester() {
|
|
4884
4902
|
return this.api.request || this.request || (this.$COMPONENT || {}).request;
|
|
4885
4903
|
},
|
|
@@ -4906,33 +4924,33 @@ var index_ = __webpack_require__(3);
|
|
|
4906
4924
|
});
|
|
4907
4925
|
},
|
|
4908
4926
|
tableListeners: function tableListeners() {
|
|
4909
|
-
var
|
|
4927
|
+
var _this3 = this;
|
|
4910
4928
|
return Object.assign({}, this.$listeners, this.on, {
|
|
4911
4929
|
"row-click": function rowClick(row) {
|
|
4912
|
-
var selectColumns =
|
|
4930
|
+
var selectColumns = _this3.columns.filter(function (item) {
|
|
4913
4931
|
return item.control === "Selection";
|
|
4914
4932
|
});
|
|
4915
4933
|
if (selectColumns && selectColumns.length > 0) {
|
|
4916
4934
|
var selectColumn = selectColumns[0];
|
|
4917
4935
|
if (selectColumn.type === "radio") {
|
|
4918
|
-
var key = selectColumn.prop ||
|
|
4919
|
-
|
|
4920
|
-
|
|
4936
|
+
var key = selectColumn.prop || _this3.tableProps.rowKey;
|
|
4937
|
+
_this3.rowId = row[key];
|
|
4938
|
+
_this3.selection = [row];
|
|
4921
4939
|
} else {
|
|
4922
|
-
|
|
4940
|
+
_this3.$refs.table.toggleRowSelection(row); // 点击选中
|
|
4923
4941
|
}
|
|
4924
4942
|
}
|
|
4925
4943
|
|
|
4926
|
-
|
|
4927
|
-
if (typeof
|
|
4928
|
-
|
|
4944
|
+
_this3.$emit("row-click", row);
|
|
4945
|
+
if (typeof _this3.on["row-click"] === "function") {
|
|
4946
|
+
_this3.on["row-click"].call(_this3, row);
|
|
4929
4947
|
}
|
|
4930
4948
|
},
|
|
4931
4949
|
"selection-change": function selectionChange(selection) {
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
if (typeof
|
|
4935
|
-
|
|
4950
|
+
_this3.selection = selection;
|
|
4951
|
+
_this3.$emit("selection-change", selection);
|
|
4952
|
+
if (typeof _this3.on["selection-change"] === "function") {
|
|
4953
|
+
_this3.on["selection-change"].call(_this3, row);
|
|
4936
4954
|
}
|
|
4937
4955
|
}
|
|
4938
4956
|
});
|
|
@@ -4951,19 +4969,19 @@ var index_ = __webpack_require__(3);
|
|
|
4951
4969
|
});
|
|
4952
4970
|
},
|
|
4953
4971
|
paginationListeners: function paginationListeners() {
|
|
4954
|
-
var
|
|
4972
|
+
var _this4 = this;
|
|
4955
4973
|
return Object.assign({}, this.pagination.on, {
|
|
4956
4974
|
"size-change": function sizeChange(pageSize) {
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4975
|
+
_this4.$emit("size-change", pageSize);
|
|
4976
|
+
_this4.pageSize = pageSize;
|
|
4977
|
+
_this4.$emit("pageChange", _this4.paginationProps.currentPage, pageSize);
|
|
4978
|
+
_this4.search();
|
|
4961
4979
|
},
|
|
4962
4980
|
"current-change": function currentChange(currentPage) {
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4981
|
+
_this4.$emit("current-change", currentPage);
|
|
4982
|
+
_this4.currentPage = currentPage;
|
|
4983
|
+
_this4.$emit("pageChange", currentPage, _this4.paginationProps.pageSize);
|
|
4984
|
+
_this4.search();
|
|
4967
4985
|
}
|
|
4968
4986
|
});
|
|
4969
4987
|
}
|
|
@@ -4987,7 +5005,7 @@ var index_ = __webpack_require__(3);
|
|
|
4987
5005
|
this.search();
|
|
4988
5006
|
},
|
|
4989
5007
|
search: function search() {
|
|
4990
|
-
var
|
|
5008
|
+
var _this5 = this;
|
|
4991
5009
|
if (!(this.requester && this.api.url)) {
|
|
4992
5010
|
return false;
|
|
4993
5011
|
}
|
|
@@ -5009,22 +5027,22 @@ var index_ = __webpack_require__(3);
|
|
|
5009
5027
|
headers: this.api.headers,
|
|
5010
5028
|
data: reqData
|
|
5011
5029
|
}).then(function (res) {
|
|
5012
|
-
if (typeof
|
|
5013
|
-
res =
|
|
5030
|
+
if (typeof _this5.api.after === "function") {
|
|
5031
|
+
res = _this5.api.after.call(_this5, res);
|
|
5014
5032
|
}
|
|
5015
|
-
|
|
5016
|
-
if (
|
|
5017
|
-
|
|
5033
|
+
_this5.remoteData = _this5.remoteDataProp.data ? Object(external_lodash_["get"])(res, _this5.remoteDataProp.data, []) : res;
|
|
5034
|
+
if (_this5.pagination) {
|
|
5035
|
+
_this5.total = Object(external_lodash_["get"])(res, _this5.remoteDataProp.total, 0);
|
|
5018
5036
|
}
|
|
5019
|
-
|
|
5020
|
-
request:
|
|
5037
|
+
_this5.$emit("success", {
|
|
5038
|
+
request: _this5.requester,
|
|
5021
5039
|
reqData: reqData,
|
|
5022
5040
|
resData: res
|
|
5023
5041
|
});
|
|
5024
5042
|
}).catch(function (error) {
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
request:
|
|
5043
|
+
_this5.remoteData = [], _this5.total = 0;
|
|
5044
|
+
_this5.$emit("error", {
|
|
5045
|
+
request: _this5.requester,
|
|
5028
5046
|
reqData: reqData,
|
|
5029
5047
|
resError: error
|
|
5030
5048
|
});
|
|
@@ -5044,8 +5062,8 @@ var index_ = __webpack_require__(3);
|
|
|
5044
5062
|
|
|
5045
5063
|
var table_component = normalizeComponent(
|
|
5046
5064
|
src_tablevue_type_script_lang_js_,
|
|
5047
|
-
|
|
5048
|
-
|
|
5065
|
+
tablevue_type_template_id_148cbb91_render,
|
|
5066
|
+
tablevue_type_template_id_148cbb91_staticRenderFns,
|
|
5049
5067
|
false,
|
|
5050
5068
|
null,
|
|
5051
5069
|
null,
|
|
@@ -7132,8 +7150,8 @@ table_operate_src.install = function (Vue) {
|
|
|
7132
7150
|
Vue.component(table_operate_src.name, table_operate_src);
|
|
7133
7151
|
};
|
|
7134
7152
|
/* harmony default export */ var table_operate = (table_operate_src);
|
|
7135
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=
|
|
7136
|
-
var
|
|
7153
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=09a7f1dc&
|
|
7154
|
+
var srcvue_type_template_id_09a7f1dc_render = function render() {
|
|
7137
7155
|
var _vm = this,
|
|
7138
7156
|
_c = _vm._self._c
|
|
7139
7157
|
return _c("div", { staticClass: "crud" }, [
|
|
@@ -7200,11 +7218,11 @@ var srcvue_type_template_id_8ec3f608_render = function render() {
|
|
|
7200
7218
|
),
|
|
7201
7219
|
])
|
|
7202
7220
|
}
|
|
7203
|
-
var
|
|
7204
|
-
|
|
7221
|
+
var srcvue_type_template_id_09a7f1dc_staticRenderFns = []
|
|
7222
|
+
srcvue_type_template_id_09a7f1dc_render._withStripped = true
|
|
7205
7223
|
|
|
7206
7224
|
|
|
7207
|
-
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=
|
|
7225
|
+
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=09a7f1dc&
|
|
7208
7226
|
|
|
7209
7227
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=script&lang=js&
|
|
7210
7228
|
|
|
@@ -7236,7 +7254,8 @@ srcvue_type_template_id_8ec3f608_render._withStripped = true
|
|
|
7236
7254
|
message: {
|
|
7237
7255
|
success: {
|
|
7238
7256
|
message: '添加成功',
|
|
7239
|
-
type: 'success'
|
|
7257
|
+
type: 'success',
|
|
7258
|
+
showClose: true
|
|
7240
7259
|
}
|
|
7241
7260
|
}
|
|
7242
7261
|
}, this.create);
|
|
@@ -7251,7 +7270,8 @@ srcvue_type_template_id_8ec3f608_render._withStripped = true
|
|
|
7251
7270
|
message: {
|
|
7252
7271
|
success: {
|
|
7253
7272
|
message: '修改成功',
|
|
7254
|
-
type: 'success'
|
|
7273
|
+
type: 'success',
|
|
7274
|
+
showClose: true
|
|
7255
7275
|
}
|
|
7256
7276
|
}
|
|
7257
7277
|
}, this.update);
|
|
@@ -7574,8 +7594,8 @@ srcvue_type_template_id_8ec3f608_render._withStripped = true
|
|
|
7574
7594
|
|
|
7575
7595
|
var crud_src_component = normalizeComponent(
|
|
7576
7596
|
components_crud_srcvue_type_script_lang_js_,
|
|
7577
|
-
|
|
7578
|
-
|
|
7597
|
+
srcvue_type_template_id_09a7f1dc_render,
|
|
7598
|
+
srcvue_type_template_id_09a7f1dc_staticRenderFns,
|
|
7579
7599
|
false,
|
|
7580
7600
|
null,
|
|
7581
7601
|
null,
|
|
@@ -8023,8 +8043,8 @@ var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
|
8023
8043
|
});
|
|
8024
8044
|
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
8025
8045
|
|
|
8026
|
-
/**
|
|
8027
|
-
* @file 扩展 codemirror
|
|
8046
|
+
/**
|
|
8047
|
+
* @file 扩展 codemirror
|
|
8028
8048
|
*/
|
|
8029
8049
|
function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
8030
8050
|
var from = str.slice(0, idx);
|
package/lib/components/crud.js
CHANGED
|
@@ -817,9 +817,13 @@ var components_form = __webpack_require__(4);
|
|
|
817
817
|
}
|
|
818
818
|
},
|
|
819
819
|
created: function created() {
|
|
820
|
-
if (this.
|
|
821
|
-
this._formGroup.formModel[this.prop]
|
|
820
|
+
if (this._formGroup) {
|
|
821
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
822
|
+
this.formModel = defaultVal || {};
|
|
822
823
|
}
|
|
824
|
+
// if (this.prop && this._formGroup) {
|
|
825
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
826
|
+
// }
|
|
823
827
|
},
|
|
824
828
|
mounted: function mounted() {
|
|
825
829
|
if (this.prop && this._formGroup && this.$refs.form) {
|
|
@@ -2106,7 +2110,7 @@ module.exports = require("element-ui/lib/message-box");
|
|
|
2106
2110
|
// ESM COMPAT FLAG
|
|
2107
2111
|
__webpack_require__.r(__webpack_exports__);
|
|
2108
2112
|
|
|
2109
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=
|
|
2113
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=09a7f1dc&
|
|
2110
2114
|
var render = function render() {
|
|
2111
2115
|
var _vm = this,
|
|
2112
2116
|
_c = _vm._self._c
|
|
@@ -2178,7 +2182,7 @@ var staticRenderFns = []
|
|
|
2178
2182
|
render._withStripped = true
|
|
2179
2183
|
|
|
2180
2184
|
|
|
2181
|
-
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=
|
|
2185
|
+
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=09a7f1dc&
|
|
2182
2186
|
|
|
2183
2187
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-search"
|
|
2184
2188
|
var table_search_ = __webpack_require__(29);
|
|
@@ -2234,7 +2238,8 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
2234
2238
|
message: {
|
|
2235
2239
|
success: {
|
|
2236
2240
|
message: '添加成功',
|
|
2237
|
-
type: 'success'
|
|
2241
|
+
type: 'success',
|
|
2242
|
+
showClose: true
|
|
2238
2243
|
}
|
|
2239
2244
|
}
|
|
2240
2245
|
}, this.create);
|
|
@@ -2249,7 +2254,8 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
2249
2254
|
message: {
|
|
2250
2255
|
success: {
|
|
2251
2256
|
message: '修改成功',
|
|
2252
|
-
type: 'success'
|
|
2257
|
+
type: 'success',
|
|
2258
|
+
showClose: true
|
|
2253
2259
|
}
|
|
2254
2260
|
}
|
|
2255
2261
|
}, this.update);
|
|
@@ -648,9 +648,13 @@ var components_form = __webpack_require__(4);
|
|
|
648
648
|
}
|
|
649
649
|
},
|
|
650
650
|
created: function created() {
|
|
651
|
-
if (this.
|
|
652
|
-
this._formGroup.formModel[this.prop]
|
|
651
|
+
if (this._formGroup) {
|
|
652
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
653
|
+
this.formModel = defaultVal || {};
|
|
653
654
|
}
|
|
655
|
+
// if (this.prop && this._formGroup) {
|
|
656
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
657
|
+
// }
|
|
654
658
|
},
|
|
655
659
|
mounted: function mounted() {
|
|
656
660
|
if (this.prop && this._formGroup && this.$refs.form) {
|
|
@@ -284,9 +284,13 @@ var components_form = __webpack_require__(4);
|
|
|
284
284
|
}
|
|
285
285
|
},
|
|
286
286
|
created: function created() {
|
|
287
|
-
if (this.
|
|
288
|
-
this._formGroup.formModel[this.prop]
|
|
287
|
+
if (this._formGroup) {
|
|
288
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
289
|
+
this.formModel = defaultVal || {};
|
|
289
290
|
}
|
|
291
|
+
// if (this.prop && this._formGroup) {
|
|
292
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
293
|
+
// }
|
|
290
294
|
},
|
|
291
295
|
mounted: function mounted() {
|
|
292
296
|
if (this.prop && this._formGroup && this.$refs.form) {
|
|
@@ -638,9 +638,13 @@ var components_form = __webpack_require__(4);
|
|
|
638
638
|
}
|
|
639
639
|
},
|
|
640
640
|
created: function created() {
|
|
641
|
-
if (this.
|
|
642
|
-
this._formGroup.formModel[this.prop]
|
|
641
|
+
if (this._formGroup) {
|
|
642
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
643
|
+
this.formModel = defaultVal || {};
|
|
643
644
|
}
|
|
645
|
+
// if (this.prop && this._formGroup) {
|
|
646
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
647
|
+
// }
|
|
644
648
|
},
|
|
645
649
|
mounted: function mounted() {
|
|
646
650
|
if (this.prop && this._formGroup && this.$refs.form) {
|
|
@@ -652,8 +652,8 @@ var index_ = __webpack_require__(17);
|
|
|
652
652
|
});
|
|
653
653
|
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
654
654
|
|
|
655
|
-
/**
|
|
656
|
-
* @file 扩展 codemirror
|
|
655
|
+
/**
|
|
656
|
+
* @file 扩展 codemirror
|
|
657
657
|
*/
|
|
658
658
|
function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
659
659
|
var from = str.slice(0, idx);
|
|
@@ -817,9 +817,13 @@ var components_form = __webpack_require__(4);
|
|
|
817
817
|
}
|
|
818
818
|
},
|
|
819
819
|
created: function created() {
|
|
820
|
-
if (this.
|
|
821
|
-
this._formGroup.formModel[this.prop]
|
|
820
|
+
if (this._formGroup) {
|
|
821
|
+
var defaultVal = this.prop ? this._formGroup.formModel[this.prop] : this._formGroup.formModel;
|
|
822
|
+
this.formModel = defaultVal || {};
|
|
822
823
|
}
|
|
824
|
+
// if (this.prop && this._formGroup) {
|
|
825
|
+
// this._formGroup.formModel[this.prop] = this.formModel;
|
|
826
|
+
// }
|
|
823
827
|
},
|
|
824
828
|
mounted: function mounted() {
|
|
825
829
|
if (this.prop && this._formGroup && this.$refs.form) {
|
package/lib/components/table.js
CHANGED
|
@@ -262,8 +262,8 @@ module.exports = require("element-ui/lib/pagination");
|
|
|
262
262
|
// ESM COMPAT FLAG
|
|
263
263
|
__webpack_require__.r(__webpack_exports__);
|
|
264
264
|
|
|
265
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=
|
|
266
|
-
var
|
|
265
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=148cbb91&
|
|
266
|
+
var tablevue_type_template_id_148cbb91_render = function render() {
|
|
267
267
|
var _vm = this,
|
|
268
268
|
_c = _vm._self._c
|
|
269
269
|
return _c("div", { staticClass: "table" }, [
|
|
@@ -301,7 +301,7 @@ var tablevue_type_template_id_7ea6d01a_render = function render() {
|
|
|
301
301
|
_vm.tableListeners
|
|
302
302
|
),
|
|
303
303
|
[
|
|
304
|
-
_vm._l(_vm.
|
|
304
|
+
_vm._l(_vm.filterColumns, function (column) {
|
|
305
305
|
return [
|
|
306
306
|
_c(
|
|
307
307
|
"TableColumn",
|
|
@@ -342,10 +342,10 @@ var tablevue_type_template_id_7ea6d01a_render = function render() {
|
|
|
342
342
|
])
|
|
343
343
|
}
|
|
344
344
|
var staticRenderFns = []
|
|
345
|
-
|
|
345
|
+
tablevue_type_template_id_148cbb91_render._withStripped = true
|
|
346
346
|
|
|
347
347
|
|
|
348
|
-
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=
|
|
348
|
+
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=148cbb91&
|
|
349
349
|
|
|
350
350
|
// EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
|
|
351
351
|
var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
|
|
@@ -542,6 +542,20 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
542
542
|
}
|
|
543
543
|
},
|
|
544
544
|
computed: {
|
|
545
|
+
filterColumns: function filterColumns() {
|
|
546
|
+
var _this2 = this;
|
|
547
|
+
return this.columns.filter(function (item) {
|
|
548
|
+
if (item.show === false) {
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
if (typeof item.show === "function" && !item.show.call(_this2, {
|
|
552
|
+
item: item
|
|
553
|
+
})) {
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
556
|
+
return true;
|
|
557
|
+
});
|
|
558
|
+
},
|
|
545
559
|
requester: function requester() {
|
|
546
560
|
return this.api.request || this.request || (this.$COMPONENT || {}).request;
|
|
547
561
|
},
|
|
@@ -568,33 +582,33 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
568
582
|
});
|
|
569
583
|
},
|
|
570
584
|
tableListeners: function tableListeners() {
|
|
571
|
-
var
|
|
585
|
+
var _this3 = this;
|
|
572
586
|
return Object.assign({}, this.$listeners, this.on, {
|
|
573
587
|
"row-click": function rowClick(row) {
|
|
574
|
-
var selectColumns =
|
|
588
|
+
var selectColumns = _this3.columns.filter(function (item) {
|
|
575
589
|
return item.control === "Selection";
|
|
576
590
|
});
|
|
577
591
|
if (selectColumns && selectColumns.length > 0) {
|
|
578
592
|
var selectColumn = selectColumns[0];
|
|
579
593
|
if (selectColumn.type === "radio") {
|
|
580
|
-
var key = selectColumn.prop ||
|
|
581
|
-
|
|
582
|
-
|
|
594
|
+
var key = selectColumn.prop || _this3.tableProps.rowKey;
|
|
595
|
+
_this3.rowId = row[key];
|
|
596
|
+
_this3.selection = [row];
|
|
583
597
|
} else {
|
|
584
|
-
|
|
598
|
+
_this3.$refs.table.toggleRowSelection(row); // 点击选中
|
|
585
599
|
}
|
|
586
600
|
}
|
|
587
601
|
|
|
588
|
-
|
|
589
|
-
if (typeof
|
|
590
|
-
|
|
602
|
+
_this3.$emit("row-click", row);
|
|
603
|
+
if (typeof _this3.on["row-click"] === "function") {
|
|
604
|
+
_this3.on["row-click"].call(_this3, row);
|
|
591
605
|
}
|
|
592
606
|
},
|
|
593
607
|
"selection-change": function selectionChange(selection) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
if (typeof
|
|
597
|
-
|
|
608
|
+
_this3.selection = selection;
|
|
609
|
+
_this3.$emit("selection-change", selection);
|
|
610
|
+
if (typeof _this3.on["selection-change"] === "function") {
|
|
611
|
+
_this3.on["selection-change"].call(_this3, row);
|
|
598
612
|
}
|
|
599
613
|
}
|
|
600
614
|
});
|
|
@@ -613,19 +627,19 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
613
627
|
});
|
|
614
628
|
},
|
|
615
629
|
paginationListeners: function paginationListeners() {
|
|
616
|
-
var
|
|
630
|
+
var _this4 = this;
|
|
617
631
|
return Object.assign({}, this.pagination.on, {
|
|
618
632
|
"size-change": function sizeChange(pageSize) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
633
|
+
_this4.$emit("size-change", pageSize);
|
|
634
|
+
_this4.pageSize = pageSize;
|
|
635
|
+
_this4.$emit("pageChange", _this4.paginationProps.currentPage, pageSize);
|
|
636
|
+
_this4.search();
|
|
623
637
|
},
|
|
624
638
|
"current-change": function currentChange(currentPage) {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
639
|
+
_this4.$emit("current-change", currentPage);
|
|
640
|
+
_this4.currentPage = currentPage;
|
|
641
|
+
_this4.$emit("pageChange", currentPage, _this4.paginationProps.pageSize);
|
|
642
|
+
_this4.search();
|
|
629
643
|
}
|
|
630
644
|
});
|
|
631
645
|
}
|
|
@@ -649,7 +663,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
649
663
|
this.search();
|
|
650
664
|
},
|
|
651
665
|
search: function search() {
|
|
652
|
-
var
|
|
666
|
+
var _this5 = this;
|
|
653
667
|
if (!(this.requester && this.api.url)) {
|
|
654
668
|
return false;
|
|
655
669
|
}
|
|
@@ -671,22 +685,22 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
671
685
|
headers: this.api.headers,
|
|
672
686
|
data: reqData
|
|
673
687
|
}).then(function (res) {
|
|
674
|
-
if (typeof
|
|
675
|
-
res =
|
|
688
|
+
if (typeof _this5.api.after === "function") {
|
|
689
|
+
res = _this5.api.after.call(_this5, res);
|
|
676
690
|
}
|
|
677
|
-
|
|
678
|
-
if (
|
|
679
|
-
|
|
691
|
+
_this5.remoteData = _this5.remoteDataProp.data ? Object(external_lodash_["get"])(res, _this5.remoteDataProp.data, []) : res;
|
|
692
|
+
if (_this5.pagination) {
|
|
693
|
+
_this5.total = Object(external_lodash_["get"])(res, _this5.remoteDataProp.total, 0);
|
|
680
694
|
}
|
|
681
|
-
|
|
682
|
-
request:
|
|
695
|
+
_this5.$emit("success", {
|
|
696
|
+
request: _this5.requester,
|
|
683
697
|
reqData: reqData,
|
|
684
698
|
resData: res
|
|
685
699
|
});
|
|
686
700
|
}).catch(function (error) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
request:
|
|
701
|
+
_this5.remoteData = [], _this5.total = 0;
|
|
702
|
+
_this5.$emit("error", {
|
|
703
|
+
request: _this5.requester,
|
|
690
704
|
reqData: reqData,
|
|
691
705
|
resError: error
|
|
692
706
|
});
|
|
@@ -709,7 +723,7 @@ var componentNormalizer = __webpack_require__(1);
|
|
|
709
723
|
|
|
710
724
|
var component = Object(componentNormalizer["a" /* default */])(
|
|
711
725
|
src_tablevue_type_script_lang_js_,
|
|
712
|
-
|
|
726
|
+
tablevue_type_template_id_148cbb91_render,
|
|
713
727
|
staticRenderFns,
|
|
714
728
|
false,
|
|
715
729
|
null,
|