iov-pro-components 0.0.58 → 0.0.59

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.
@@ -19385,6 +19385,16 @@ var script$b = {
19385
19385
  checked: _toConsumableArray$1(this.checkedColumns)
19386
19386
  };
19387
19387
  },
19388
+ /**
19389
+ * 重新布局
19390
+ * @time 2025-08-20 16:38:29
19391
+ */
19392
+ doLayout: function doLayout() {
19393
+ var _this = this;
19394
+ this.$nextTick(function () {
19395
+ return _this.initTableColumns();
19396
+ });
19397
+ },
19388
19398
  /**
19389
19399
  * 当复选框选中了
19390
19400
  * @param {Array} val 当前所有值
@@ -19442,7 +19452,7 @@ var script$b = {
19442
19452
  * @time 2024-11-27 18:47:11
19443
19453
  */
19444
19454
  onConfirm: function onConfirm() {
19445
- var _this = this;
19455
+ var _this2 = this;
19446
19456
  // 需要默认选中的列
19447
19457
  var defaultCheckedColumns = this.tableColumns.filter(function (column) {
19448
19458
  return column.disabled;
@@ -19458,7 +19468,7 @@ var script$b = {
19458
19468
  // 遍历数据
19459
19469
  this.tableColumnsForRender.forEach(function (column) {
19460
19470
  // 如果当前是选中的数据
19461
- if (_this.checkedColumns.includes(column.value)) {
19471
+ if (_this2.checkedColumns.includes(column.value)) {
19462
19472
  displayColumns.push(column.target);
19463
19473
  }
19464
19474
  });
@@ -19489,20 +19499,20 @@ var script$b = {
19489
19499
  * @time 2024-11-27 18:49:10
19490
19500
  */
19491
19501
  onCancel: function onCancel() {
19492
- var _this2 = this;
19502
+ var _this3 = this;
19493
19503
  // 关闭弹框
19494
19504
  this.settingVisible = false;
19495
19505
  // 等弹框关闭了再恢复之前的数据
19496
19506
  this.$nextTick(function () {
19497
19507
  // 还原胡乱排序的表头
19498
- _this2.tableColumns = _toConsumableArray$1(_this2.prevState.columns);
19508
+ _this3.tableColumns = _toConsumableArray$1(_this3.prevState.columns);
19499
19509
  // 设置当前选中的值
19500
- _this2.onCheckboxSelected(_toConsumableArray$1(_this2.prevState.checked));
19510
+ _this3.onCheckboxSelected(_toConsumableArray$1(_this3.prevState.checked));
19501
19511
  });
19502
19512
  }
19503
19513
  },
19504
19514
  render: function render() {
19505
- var _this3 = this;
19515
+ var _this4 = this;
19506
19516
  var h = arguments[0];
19507
19517
  var _getComponentNames = getComponentNames(['tooltip', 'popover', 'checkbox', 'link', 'button', 'checkbox-group']),
19508
19518
  _getComponentNames2 = _slicedToArray(_getComponentNames, 6),
@@ -19526,7 +19536,7 @@ var script$b = {
19526
19536
  },
19527
19537
  "on": {
19528
19538
  "input": function input(val) {
19529
- return _this3.settingVisible = val;
19539
+ return _this4.settingVisible = val;
19530
19540
  }
19531
19541
  }
19532
19542
  }, [h(Tooltip, {
@@ -19856,6 +19866,19 @@ var script$8 = {
19856
19866
  };
19857
19867
  },
19858
19868
  methods: {
19869
+ /**
19870
+ * 重新布局
19871
+ * @time 2025-08-20 16:39:12
19872
+ */
19873
+ doLayout: function doLayout() {
19874
+ var _this = this;
19875
+ // 如果有设置,则需要重新布局
19876
+ if (this.$refs.setting) {
19877
+ this.$nextTick(function () {
19878
+ return _this.$refs.setting.doLayout();
19879
+ });
19880
+ }
19881
+ },
19859
19882
  /**
19860
19883
  * 点击工具栏
19861
19884
  * @param {String} type 当前配置类型
@@ -19878,7 +19901,7 @@ var script$8 = {
19878
19901
  },
19879
19902
  render: function render() {
19880
19903
  var _this$config,
19881
- _this = this;
19904
+ _this2 = this;
19882
19905
  var h = arguments[0];
19883
19906
  var _getComponentNames = getComponentNames(['tooltip']),
19884
19907
  _getComponentNames2 = _slicedToArray(_getComponentNames, 1),
@@ -19895,8 +19918,8 @@ var script$8 = {
19895
19918
  if (['style'].includes(item)) {
19896
19919
  return h(__vue_component__$9, {
19897
19920
  "attrs": {
19898
- "placement": _this.placement,
19899
- "table": _this.table
19921
+ "placement": _this2.placement,
19922
+ "table": _this2.table
19900
19923
  }
19901
19924
  });
19902
19925
  }
@@ -19906,12 +19929,12 @@ var script$8 = {
19906
19929
  "attrs": {
19907
19930
  "effect": 'dark',
19908
19931
  "content": CONFIG_NAME[item],
19909
- "placement": _this.placement
19932
+ "placement": _this2.placement
19910
19933
  }
19911
19934
  }, [h("i", {
19912
19935
  "class": 'iov-pro-toolbar__icon iov-icon-refresh',
19913
19936
  "on": {
19914
- "click": _this.reloadTableData
19937
+ "click": _this2.reloadTableData
19915
19938
  }
19916
19939
  })]);
19917
19940
  }
@@ -19919,16 +19942,17 @@ var script$8 = {
19919
19942
  if (['zoom'].includes(item)) {
19920
19943
  return h(__vue_component__$a, {
19921
19944
  "attrs": {
19922
- "placement": _this.placement,
19923
- "table": _this.table
19945
+ "placement": _this2.placement,
19946
+ "table": _this2.table
19924
19947
  }
19925
19948
  });
19926
19949
  } // 如果当前是设置表头字段
19927
19950
  if (['setting'].includes(item)) {
19928
19951
  return h(__vue_component__$b, {
19952
+ "ref": 'setting',
19929
19953
  "attrs": {
19930
- "placement": _this.placement,
19931
- "table": _this.table
19954
+ "placement": _this2.placement,
19955
+ "table": _this2.table
19932
19956
  }
19933
19957
  });
19934
19958
  }
@@ -19940,12 +19964,12 @@ var script$8 = {
19940
19964
  "effect": 'dark',
19941
19965
  "disabled": !item.name,
19942
19966
  "content": item.name,
19943
- "placement": _this.placement
19967
+ "placement": _this2.placement
19944
19968
  }
19945
19969
  }, [h("i", {
19946
19970
  "class": ['iov-pro-toolbar__icon', item.icon].join(' '),
19947
19971
  "on": {
19948
- "click": _this.onClickToolbar.bind(_this, item)
19972
+ "click": _this2.onClickToolbar.bind(_this2, item)
19949
19973
  }
19950
19974
  })]);
19951
19975
  }
@@ -19954,12 +19978,12 @@ var script$8 = {
19954
19978
  "effect": 'dark',
19955
19979
  "disabled": !item.name,
19956
19980
  "content": item.name,
19957
- "placement": _this.placement
19981
+ "placement": _this2.placement
19958
19982
  }
19959
19983
  }, [h("i", {
19960
19984
  "class": 'iov-pro-toolbar__icon',
19961
19985
  "on": {
19962
- "click": _this.onClickToolbar.bind(_this, item)
19986
+ "click": _this2.onClickToolbar.bind(_this2, item)
19963
19987
  }
19964
19988
  }, [h("img", {
19965
19989
  "attrs": {
@@ -20081,7 +20105,9 @@ var script$7 = {
20081
20105
  },
20082
20106
  created: function created() {
20083
20107
  // 初始化
20084
- this.init();
20108
+ this.doLayout();
20109
+ // 标准化表格事件
20110
+ this.normalizeTableEvent();
20085
20111
  },
20086
20112
  mounted: function mounted() {
20087
20113
  var _this = this;
@@ -20103,19 +20129,32 @@ var script$7 = {
20103
20129
  methods: {
20104
20130
  /**
20105
20131
  * 初始化操作
20132
+ * @params {String|Array} layoutKey 需要重新布局的key集合
20106
20133
  * @time 2025-08-13 16:24:11
20107
20134
  */
20108
- init: function init() {
20109
- // 标准化表单配置
20110
- this.normalizeFormItems();
20111
- // 标准化表单配置
20112
- this.normalizeTableColumns();
20113
- // 标准化配置
20114
- this.normalizeConfig();
20115
- // 标准化表格事件
20116
- this.normalizeTableEvent();
20117
- // 标准化表格请求对象
20118
- this.normalizeTableRequest();
20135
+ doLayout: function doLayout(layoutKey) {
20136
+ var _this2 = this;
20137
+ // 当前需要重新布局的key集合
20138
+ var layoutKeys = [null, undefined, ''].includes(layoutKey) ? ['form-items', 'table-columns', 'config', 'request'] : typeof layoutKey === 'string' ? [layoutKey] : layoutKey;
20139
+ // 等数据传入后在处理
20140
+ this.$nextTick(function () {
20141
+ // 标准化表单配置
20142
+ if (layoutKeys.includes('form-items')) {
20143
+ _this2.normalizeFormItems();
20144
+ }
20145
+ // 标准化表单配置
20146
+ if (layoutKeys.includes('table-columns')) {
20147
+ _this2.normalizeTableColumns();
20148
+ }
20149
+ // 标准化配置
20150
+ if (layoutKeys.includes('config')) {
20151
+ _this2.normalizeConfig();
20152
+ }
20153
+ // 标准化表格请求对象
20154
+ if (layoutKeys.includes('request')) {
20155
+ _this2.normalizeTableRequest();
20156
+ }
20157
+ });
20119
20158
  },
20120
20159
  /**
20121
20160
  * 搜索表单
@@ -20145,7 +20184,7 @@ var script$7 = {
20145
20184
  * @time 2024-11-18 09:49:31
20146
20185
  */
20147
20186
  onReset: function onReset() {
20148
- var _this2 = this;
20187
+ var _this3 = this;
20149
20188
  // 重置表单数据
20150
20189
  this.$refs.form.resetFields();
20151
20190
  // 清空表格高级搜索的内容
@@ -20153,11 +20192,11 @@ var script$7 = {
20153
20192
  // 接口重新加载数据
20154
20193
  this.$nextTick(function () {
20155
20194
  // 抛出reset事件
20156
- _this2.$emit('reset');
20195
+ _this3.$emit('reset');
20157
20196
  // 追加请求参数
20158
- _this2.appendRequestParams(_this2.formData);
20197
+ _this3.appendRequestParams(_this3.formData);
20159
20198
  // 重置表格分页数据
20160
- _this2.$refs.table.onReset();
20199
+ _this3.$refs.table.onReset();
20161
20200
  });
20162
20201
  },
20163
20202
  /**
@@ -20165,7 +20204,7 @@ var script$7 = {
20165
20204
  * @time 2024-11-26 20:10:08
20166
20205
  */
20167
20206
  normalizeFormItems: function normalizeFormItems() {
20168
- var _this3 = this;
20207
+ var _this4 = this;
20169
20208
  // 是否使用外部label
20170
20209
  var _this$config = this.config,
20171
20210
  outerLabel = _this$config.outerLabel,
@@ -20201,8 +20240,8 @@ var script$7 = {
20201
20240
  // 当值发生改变时触发校验
20202
20241
  var onSearchByValueChange = function onSearchByValueChange() {
20203
20242
  // 等数据更新后再执行搜索
20204
- _this3.$nextTick(function () {
20205
- return _this3.onSearch();
20243
+ _this4.$nextTick(function () {
20244
+ return _this4.onSearch();
20206
20245
  });
20207
20246
  };
20208
20247
  // 输入内容被清空后,重新搜索
@@ -20260,6 +20299,16 @@ var script$7 = {
20260
20299
  });
20261
20300
  // 开始双向绑定
20262
20301
  this.normalizedTableColumns = normalizedTableColumns;
20302
+ // 如果table已经渲染了,则进行重新布局
20303
+ if (this.$refs.table) {
20304
+ this.$refs.table.doLayout(normalizedTableColumns.filter(function (column) {
20305
+ return !column.hidden;
20306
+ }));
20307
+ }
20308
+ // 如果toolbar已经渲染了,则进行重新布局
20309
+ if (this.$refs.toolbar) {
20310
+ this.$refs.toolbar.doLayout();
20311
+ }
20263
20312
  },
20264
20313
  /**
20265
20314
  * 标准化配置信息
@@ -20295,7 +20344,7 @@ var script$7 = {
20295
20344
  * @time 2025-08-13 16:25:25
20296
20345
  */
20297
20346
  normalizeTableEvent: function normalizeTableEvent() {
20298
- var _this4 = this;
20347
+ var _this5 = this;
20299
20348
  // 当前事件
20300
20349
  var EVENTS = [].concat(_toConsumableArray$1(PAGINATION_EVENTS), _toConsumableArray$1(TABLE_EVENTS));
20301
20350
  // 标准化后的表格事件
@@ -20307,10 +20356,10 @@ var script$7 = {
20307
20356
  }
20308
20357
  // 如果当前是过滤数据
20309
20358
  if (eventKey === 'filter-change') {
20310
- _this4.onFilterChange.apply(_this4, args);
20359
+ _this5.onFilterChange.apply(_this5, args);
20311
20360
  }
20312
20361
  // 抛出事件
20313
- _this4.$emit.apply(_this4, [eventKey].concat(args));
20362
+ _this5.$emit.apply(_this5, [eventKey].concat(args));
20314
20363
  };
20315
20364
  // 返回事件
20316
20365
  return memo;
@@ -20323,7 +20372,7 @@ var script$7 = {
20323
20372
  * @time 2025-08-13 16:31:24
20324
20373
  */
20325
20374
  normalizeTableRequest: function normalizeTableRequest() {
20326
- var _this5 = this;
20375
+ var _this6 = this;
20327
20376
  // 序列化后的表格请求对象
20328
20377
  var normalizedTableRequest = _objectSpread2(_objectSpread2({
20329
20378
  reloadOnParamsChange: true,
@@ -20336,14 +20385,14 @@ var script$7 = {
20336
20385
  while (1) switch (_context.prev = _context.next) {
20337
20386
  case 0:
20338
20387
  // 触发请求前事件
20339
- _this5.$emit('before-request', params);
20388
+ _this6.$emit('before-request', params);
20340
20389
  // 获取接口请求接口
20341
20390
  _context.next = 3;
20342
- return _this5.request.api(params);
20391
+ return _this6.request.api(params);
20343
20392
  case 3:
20344
20393
  respData = _context.sent;
20345
20394
  // 触发请求后事件
20346
- _this5.$emit('after-request', respData);
20395
+ _this6.$emit('after-request', respData);
20347
20396
  return _context.abrupt("return", respData);
20348
20397
  case 6:
20349
20398
  case "end":
@@ -20421,7 +20470,7 @@ var script$7 = {
20421
20470
  }
20422
20471
  },
20423
20472
  render: function render() {
20424
- var _this6 = this;
20473
+ var _this7 = this;
20425
20474
  var h = arguments[0];
20426
20475
  var _getComponentNames = getComponentNames(['col', 'button']),
20427
20476
  _getComponentNames2 = _slicedToArray(_getComponentNames, 2),
@@ -20434,11 +20483,11 @@ var script$7 = {
20434
20483
  toggleStatus = _ref.toggleStatus,
20435
20484
  needCollapse = _ref.needCollapse;
20436
20485
  // 插槽
20437
- var scopedSlots = _this6.config.simple ? {} : {
20486
+ var scopedSlots = _this7.config.simple ? {} : {
20438
20487
  append: function append() {
20439
20488
  return h(Col, {
20440
20489
  "attrs": {
20441
- "span": _this6.normalizedFormConfig.span
20490
+ "span": _this7.normalizedFormConfig.span
20442
20491
  }
20443
20492
  }, [h(__vue_component__$w, {
20444
20493
  "class": 'search-table__append',
@@ -20453,7 +20502,7 @@ var script$7 = {
20453
20502
  "round": true
20454
20503
  },
20455
20504
  "on": {
20456
- "click": _this6.onSearch
20505
+ "click": _this7.onSearch
20457
20506
  }
20458
20507
  }, ["\u67E5\u8BE2"]), h(Button, {
20459
20508
  "attrs": {
@@ -20461,7 +20510,7 @@ var script$7 = {
20461
20510
  "round": true
20462
20511
  },
20463
20512
  "on": {
20464
- "click": _this6.onReset
20513
+ "click": _this7.onReset
20465
20514
  }
20466
20515
  }, ["\u91CD\u7F6E"]), status && needCollapse && h("span", {
20467
20516
  "class": ['search-table__toggle-status', status].join(' '),
@@ -20474,7 +20523,7 @@ var script$7 = {
20474
20523
  }
20475
20524
  };
20476
20525
  // 遍历所有的prefixLabel
20477
- _this6.normalizedFormItems.filter(function (item) {
20526
+ _this7.normalizedFormItems.filter(function (item) {
20478
20527
  return item.slots && item.slots.component && item.slots.component.prefixLabel;
20479
20528
  }).forEach(function (item) {
20480
20529
  // 塞入插槽
@@ -20485,16 +20534,16 @@ var script$7 = {
20485
20534
  return h(__vue_component__$m, {
20486
20535
  "ref": 'form',
20487
20536
  "attrs": {
20488
- "data-source": _this6.dataSource,
20489
- "value": _this6.formData,
20490
- "items": _this6.normalizedFormItems,
20491
- "config": _this6.normalizedFormConfig
20537
+ "data-source": _this7.dataSource,
20538
+ "value": _this7.formData,
20539
+ "items": _this7.normalizedFormItems,
20540
+ "config": _this7.normalizedFormConfig
20492
20541
  },
20493
20542
  "on": {
20494
20543
  "input": function input(val) {
20495
- return _this6.formData = val;
20544
+ return _this7.formData = val;
20496
20545
  },
20497
- "change": _this6.onFormChange
20546
+ "change": _this7.onFormChange
20498
20547
  },
20499
20548
  "scopedSlots": scopedSlots
20500
20549
  });
@@ -20505,29 +20554,29 @@ var script$7 = {
20505
20554
  return h(__vue_component__$c, _mergeJSXProps([{
20506
20555
  "ref": 'table',
20507
20556
  "attrs": {
20508
- "columns": _this6.normalizedTableColumns,
20509
- "request": _this6.normalizedTableRequest,
20510
- "config": _this6.normalizedTableConfig
20557
+ "columns": _this7.normalizedTableColumns,
20558
+ "request": _this7.normalizedTableRequest,
20559
+ "config": _this7.normalizedTableConfig
20511
20560
  },
20512
- "scopedSlots": _this6.$scopedSlots
20561
+ "scopedSlots": _this7.$scopedSlots
20513
20562
  }, {
20514
- "on": _this6.normalizedTableEvent
20563
+ "on": _this7.normalizedTableEvent
20515
20564
  }]));
20516
20565
  };
20517
20566
 
20518
20567
  // 生成actionbar
20519
20568
  var renderActionBar = function renderActionBar() {
20520
- return _this6.$scopedSlots['action-bar'] ? _this6.$scopedSlots['action-bar']({
20521
- data: cloneDeep(_objectSpread2(_objectSpread2({}, _this6.queryData), _this6.tableAdvanceData)),
20569
+ return _this7.$scopedSlots['action-bar'] ? _this7.$scopedSlots['action-bar']({
20570
+ data: cloneDeep(_objectSpread2(_objectSpread2({}, _this7.queryData), _this7.tableAdvanceData)),
20522
20571
  ref: {
20523
20572
  form: function form() {
20524
- return lodashGet(_this6.$refs.form, '$refs.form');
20573
+ return lodashGet(_this7.$refs.form, '$refs.form');
20525
20574
  },
20526
20575
  table: function table() {
20527
- return lodashGet(_this6.$refs.table, '$refs.table');
20576
+ return lodashGet(_this7.$refs.table, '$refs.table');
20528
20577
  }
20529
20578
  }
20530
- }) : _this6.$slots['action-bar'];
20579
+ }) : _this7.$slots['action-bar'];
20531
20580
  };
20532
20581
 
20533
20582
  // 如果内嵌到inner-tabs组件中
@@ -20617,10 +20666,11 @@ var script$7 = {
20617
20666
  }, [renderActionBar()]), h("div", {
20618
20667
  "class": 'search-table__toolbar'
20619
20668
  }, [h(__vue_component__$8, {
20669
+ "ref": 'toolbar',
20620
20670
  "attrs": {
20621
20671
  "config": this.config.toolbar,
20622
20672
  "table": function table() {
20623
- return _this6.$refs.table;
20673
+ return _this7.$refs.table;
20624
20674
  }
20625
20675
  }
20626
20676
  })])]), renderProTable()])]);
@@ -22062,7 +22112,7 @@ var install = function install(Vue, componentConfig) {
22062
22112
  };
22063
22113
  var index = {
22064
22114
  install: install,
22065
- version: '0.0.58',
22115
+ version: '0.0.59',
22066
22116
  ColumnTooltip: __vue_component__$x,
22067
22117
  Description: __vue_component__$u,
22068
22118
  DialogItemsSelect: __vue_component__$t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iov-pro-components",
3
- "version": "0.0.58",
3
+ "version": "0.0.59",
4
4
  "description": "IOV Pro Components for Vue.js",
5
5
  "main": "lib/iov-pro-components.min.js",
6
6
  "files": [