@panpanzhao/component-ui 0.0.47 → 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.
@@ -3073,9 +3073,13 @@ form_query_src_form.install = function (Vue) {
3073
3073
  }
3074
3074
  },
3075
3075
  created: function created() {
3076
- if (this.prop && this._formGroup) {
3077
- this._formGroup.formModel[this.prop] = this.formModel;
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=7ea6d01a&
4618
- var tablevue_type_template_id_7ea6d01a_render = function render() {
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.columns, function (column) {
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 tablevue_type_template_id_7ea6d01a_staticRenderFns = []
4697
- tablevue_type_template_id_7ea6d01a_render._withStripped = true
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=7ea6d01a&
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 _this2 = this;
4927
+ var _this3 = this;
4910
4928
  return Object.assign({}, this.$listeners, this.on, {
4911
4929
  "row-click": function rowClick(row) {
4912
- var selectColumns = _this2.columns.filter(function (item) {
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 || _this2.tableProps.rowKey;
4919
- _this2.rowId = row[key];
4920
- _this2.selection = [row];
4936
+ var key = selectColumn.prop || _this3.tableProps.rowKey;
4937
+ _this3.rowId = row[key];
4938
+ _this3.selection = [row];
4921
4939
  } else {
4922
- _this2.$refs.table.toggleRowSelection(row); // 点击选中
4940
+ _this3.$refs.table.toggleRowSelection(row); // 点击选中
4923
4941
  }
4924
4942
  }
4925
4943
 
4926
- _this2.$emit("row-click", row);
4927
- if (typeof _this2.on["row-click"] === "function") {
4928
- _this2.on["row-click"].call(_this2, row);
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
- _this2.selection = selection;
4933
- _this2.$emit("selection-change", selection);
4934
- if (typeof _this2.on["selection-change"] === "function") {
4935
- _this2.on["selection-change"].call(_this2, row);
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 _this3 = this;
4972
+ var _this4 = this;
4955
4973
  return Object.assign({}, this.pagination.on, {
4956
4974
  "size-change": function sizeChange(pageSize) {
4957
- _this3.$emit("size-change", pageSize);
4958
- _this3.pageSize = pageSize;
4959
- _this3.$emit("pageChange", _this3.paginationProps.currentPage, pageSize);
4960
- _this3.search();
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
- _this3.$emit("current-change", currentPage);
4964
- _this3.currentPage = currentPage;
4965
- _this3.$emit("pageChange", currentPage, _this3.paginationProps.pageSize);
4966
- _this3.search();
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 _this4 = this;
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 _this4.api.after === "function") {
5013
- res = _this4.api.after.call(_this4, res);
5030
+ if (typeof _this5.api.after === "function") {
5031
+ res = _this5.api.after.call(_this5, res);
5014
5032
  }
5015
- _this4.remoteData = _this4.remoteDataProp.data ? Object(external_lodash_["get"])(res, _this4.remoteDataProp.data, []) : res;
5016
- if (_this4.pagination) {
5017
- _this4.total = Object(external_lodash_["get"])(res, _this4.remoteDataProp.total, 0);
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
- _this4.$emit("success", {
5020
- request: _this4.requester,
5037
+ _this5.$emit("success", {
5038
+ request: _this5.requester,
5021
5039
  reqData: reqData,
5022
5040
  resData: res
5023
5041
  });
5024
5042
  }).catch(function (error) {
5025
- _this4.remoteData = [], _this4.total = 0;
5026
- _this4.$emit("error", {
5027
- request: _this4.requester,
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
- tablevue_type_template_id_7ea6d01a_render,
5048
- tablevue_type_template_id_7ea6d01a_staticRenderFns,
5065
+ tablevue_type_template_id_148cbb91_render,
5066
+ tablevue_type_template_id_148cbb91_staticRenderFns,
5049
5067
  false,
5050
5068
  null,
5051
5069
  null,
@@ -8025,8 +8043,8 @@ var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
8025
8043
  });
8026
8044
  // CONCATENATED MODULE: ./src/components/formula/src/plugin.js
8027
8045
 
8028
- /**
8029
- * @file 扩展 codemirror
8046
+ /**
8047
+ * @file 扩展 codemirror
8030
8048
  */
8031
8049
  function replaceStrByIndex(str, idx, key, replaceKey) {
8032
8050
  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.prop && this._formGroup) {
821
- this._formGroup.formModel[this.prop] = this.formModel;
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) {
@@ -648,9 +648,13 @@ var components_form = __webpack_require__(4);
648
648
  }
649
649
  },
650
650
  created: function created() {
651
- if (this.prop && this._formGroup) {
652
- this._formGroup.formModel[this.prop] = this.formModel;
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.prop && this._formGroup) {
288
- this._formGroup.formModel[this.prop] = this.formModel;
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.prop && this._formGroup) {
642
- this._formGroup.formModel[this.prop] = this.formModel;
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.prop && this._formGroup) {
821
- this._formGroup.formModel[this.prop] = this.formModel;
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) {
@@ -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=7ea6d01a&
266
- var tablevue_type_template_id_7ea6d01a_render = function render() {
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.columns, function (column) {
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
- tablevue_type_template_id_7ea6d01a_render._withStripped = true
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=7ea6d01a&
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 _this2 = this;
585
+ var _this3 = this;
572
586
  return Object.assign({}, this.$listeners, this.on, {
573
587
  "row-click": function rowClick(row) {
574
- var selectColumns = _this2.columns.filter(function (item) {
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 || _this2.tableProps.rowKey;
581
- _this2.rowId = row[key];
582
- _this2.selection = [row];
594
+ var key = selectColumn.prop || _this3.tableProps.rowKey;
595
+ _this3.rowId = row[key];
596
+ _this3.selection = [row];
583
597
  } else {
584
- _this2.$refs.table.toggleRowSelection(row); // 点击选中
598
+ _this3.$refs.table.toggleRowSelection(row); // 点击选中
585
599
  }
586
600
  }
587
601
 
588
- _this2.$emit("row-click", row);
589
- if (typeof _this2.on["row-click"] === "function") {
590
- _this2.on["row-click"].call(_this2, row);
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
- _this2.selection = selection;
595
- _this2.$emit("selection-change", selection);
596
- if (typeof _this2.on["selection-change"] === "function") {
597
- _this2.on["selection-change"].call(_this2, row);
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 _this3 = this;
630
+ var _this4 = this;
617
631
  return Object.assign({}, this.pagination.on, {
618
632
  "size-change": function sizeChange(pageSize) {
619
- _this3.$emit("size-change", pageSize);
620
- _this3.pageSize = pageSize;
621
- _this3.$emit("pageChange", _this3.paginationProps.currentPage, pageSize);
622
- _this3.search();
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
- _this3.$emit("current-change", currentPage);
626
- _this3.currentPage = currentPage;
627
- _this3.$emit("pageChange", currentPage, _this3.paginationProps.pageSize);
628
- _this3.search();
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 _this4 = this;
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 _this4.api.after === "function") {
675
- res = _this4.api.after.call(_this4, res);
688
+ if (typeof _this5.api.after === "function") {
689
+ res = _this5.api.after.call(_this5, res);
676
690
  }
677
- _this4.remoteData = _this4.remoteDataProp.data ? Object(external_lodash_["get"])(res, _this4.remoteDataProp.data, []) : res;
678
- if (_this4.pagination) {
679
- _this4.total = Object(external_lodash_["get"])(res, _this4.remoteDataProp.total, 0);
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
- _this4.$emit("success", {
682
- request: _this4.requester,
695
+ _this5.$emit("success", {
696
+ request: _this5.requester,
683
697
  reqData: reqData,
684
698
  resData: res
685
699
  });
686
700
  }).catch(function (error) {
687
- _this4.remoteData = [], _this4.total = 0;
688
- _this4.$emit("error", {
689
- request: _this4.requester,
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
- tablevue_type_template_id_7ea6d01a_render,
726
+ tablevue_type_template_id_148cbb91_render,
713
727
  staticRenderFns,
714
728
  false,
715
729
  null,