iov-pro-components 0.0.23 → 0.0.25
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/iov-pro-components.min.js +80 -36
- package/package.json +1 -1
|
@@ -8401,8 +8401,7 @@ var script$j = {
|
|
|
8401
8401
|
handler: function handler() {
|
|
8402
8402
|
this.formItems = this.normalizeFormItems(this.items);
|
|
8403
8403
|
},
|
|
8404
|
-
deep: true
|
|
8405
|
-
immediate: true
|
|
8404
|
+
deep: true
|
|
8406
8405
|
},
|
|
8407
8406
|
/**
|
|
8408
8407
|
* 如果表单数据的变化,则v-model双向绑定外部数据
|
|
@@ -8580,6 +8579,8 @@ var script$j = {
|
|
|
8580
8579
|
});
|
|
8581
8580
|
},
|
|
8582
8581
|
mounted: function mounted() {
|
|
8582
|
+
// 规范化表单项
|
|
8583
|
+
this.formItems = this.normalizeFormItems(this.items);
|
|
8583
8584
|
// 触发首次加载的影响
|
|
8584
8585
|
this.triggerEffect();
|
|
8585
8586
|
// 触发loader
|
|
@@ -10932,12 +10933,13 @@ var script$c = {
|
|
|
10932
10933
|
* @time 2024-11-21 20:17:46
|
|
10933
10934
|
*/
|
|
10934
10935
|
onReset: function onReset() {
|
|
10936
|
+
var isEmit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
10935
10937
|
// 先清空数据
|
|
10936
10938
|
this.value = '';
|
|
10937
10939
|
// 标记当前不需要激活状态
|
|
10938
10940
|
this.isActived = false;
|
|
10939
10941
|
// 抛出去重置方法
|
|
10940
|
-
this.$emit('reset');
|
|
10942
|
+
isEmit && this.$emit('reset');
|
|
10941
10943
|
// 关闭popover
|
|
10942
10944
|
this.visible = false;
|
|
10943
10945
|
},
|
|
@@ -11066,12 +11068,13 @@ var script$b = {
|
|
|
11066
11068
|
* @time 2024-11-21 20:17:46
|
|
11067
11069
|
*/
|
|
11068
11070
|
onReset: function onReset() {
|
|
11071
|
+
var isEmit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
11069
11072
|
// 先清空数据
|
|
11070
11073
|
this.value = [];
|
|
11071
11074
|
// 标记当前不需要激活状态
|
|
11072
11075
|
this.isActived = false;
|
|
11073
11076
|
// 抛出去重置方法
|
|
11074
|
-
this.$emit('reset');
|
|
11077
|
+
isEmit && this.$emit('reset');
|
|
11075
11078
|
// 关闭popover
|
|
11076
11079
|
this.visible = false;
|
|
11077
11080
|
},
|
|
@@ -11276,8 +11279,11 @@ var script$a = {
|
|
|
11276
11279
|
* @time 2024-11-22 14:24:09
|
|
11277
11280
|
*/
|
|
11278
11281
|
onReset: function onReset() {
|
|
11282
|
+
var isEmit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
11279
11283
|
// 当前需要排序的顺序
|
|
11280
11284
|
this.sortOrder = null;
|
|
11285
|
+
// 抛出去重置方法
|
|
11286
|
+
isEmit && this.$emit('reset');
|
|
11281
11287
|
}
|
|
11282
11288
|
},
|
|
11283
11289
|
render: function render() {
|
|
@@ -11476,7 +11482,7 @@ var script$9 = {
|
|
|
11476
11482
|
* @time 2024-11-20 11:26:50
|
|
11477
11483
|
*/
|
|
11478
11484
|
dataSource: function dataSource() {
|
|
11479
|
-
this.
|
|
11485
|
+
this.resetPagination();
|
|
11480
11486
|
},
|
|
11481
11487
|
/**
|
|
11482
11488
|
* 监听请求入参变化
|
|
@@ -11514,6 +11520,7 @@ var script$9 = {
|
|
|
11514
11520
|
},
|
|
11515
11521
|
mounted: function mounted() {
|
|
11516
11522
|
this.doLayout(this.columns);
|
|
11523
|
+
this.reset = this.onReset.bind(this);
|
|
11517
11524
|
},
|
|
11518
11525
|
methods: {
|
|
11519
11526
|
/**
|
|
@@ -11628,6 +11635,10 @@ var script$9 = {
|
|
|
11628
11635
|
* @time 2024-11-18 09:44:47
|
|
11629
11636
|
*/
|
|
11630
11637
|
refresh: function refresh() {
|
|
11638
|
+
// 如果正在加载中,则不允许重新请求
|
|
11639
|
+
if (this.$refs.request.loading) {
|
|
11640
|
+
return;
|
|
11641
|
+
}
|
|
11631
11642
|
// 重新刷新数据
|
|
11632
11643
|
this.$refs.request.onReload();
|
|
11633
11644
|
},
|
|
@@ -11636,7 +11647,7 @@ var script$9 = {
|
|
|
11636
11647
|
* @param {Number} pageSize 页码
|
|
11637
11648
|
* @time 2024-11-18 09:46:02
|
|
11638
11649
|
*/
|
|
11639
|
-
|
|
11650
|
+
resetPagination: function resetPagination(pageSize) {
|
|
11640
11651
|
// 如果当前是数字
|
|
11641
11652
|
if (typeof pageSize === 'number') {
|
|
11642
11653
|
this.pageSize = pageSize;
|
|
@@ -11646,6 +11657,28 @@ var script$9 = {
|
|
|
11646
11657
|
// 刷新列表数据
|
|
11647
11658
|
this.$nextTick(this.refresh.bind(this));
|
|
11648
11659
|
},
|
|
11660
|
+
/**
|
|
11661
|
+
* 重置方法
|
|
11662
|
+
* @time 2025-06-23 17:39:56
|
|
11663
|
+
*/
|
|
11664
|
+
onReset: function onReset() {
|
|
11665
|
+
var _this4 = this;
|
|
11666
|
+
// 清空高级筛选的数据
|
|
11667
|
+
this.advanceData = {};
|
|
11668
|
+
// 遍历所有的列,将其他列的排序方式清空
|
|
11669
|
+
this.columns.forEach(function (column) {
|
|
11670
|
+
// 遍历高级功能
|
|
11671
|
+
Object.keys(ADVANCE_FUNCTION).forEach(function (name) {
|
|
11672
|
+
// 如果当前有高级功能
|
|
11673
|
+
if (!isNil$2(column[name])) {
|
|
11674
|
+
// 重置高级功能
|
|
11675
|
+
_this4.$refs["".concat(column.prop, "-").concat(name)] && _this4.$refs["".concat(column.prop, "-").concat(name)].onReset(false);
|
|
11676
|
+
}
|
|
11677
|
+
});
|
|
11678
|
+
});
|
|
11679
|
+
// 重置分页
|
|
11680
|
+
this.resetPagination();
|
|
11681
|
+
},
|
|
11649
11682
|
/**
|
|
11650
11683
|
* 当选择了高级属性
|
|
11651
11684
|
* @param {Object} column 当前列的配置
|
|
@@ -11686,7 +11719,7 @@ var script$9 = {
|
|
|
11686
11719
|
* @time 2024-11-22 11:16:41
|
|
11687
11720
|
*/
|
|
11688
11721
|
onSortAdvance: function onSortAdvance(column, sort) {
|
|
11689
|
-
var
|
|
11722
|
+
var _this5 = this;
|
|
11690
11723
|
// 取出当前prop的值
|
|
11691
11724
|
var prop = column.prop;
|
|
11692
11725
|
// 设置排序方式
|
|
@@ -11695,13 +11728,13 @@ var script$9 = {
|
|
|
11695
11728
|
this.$set(this.advanceData, 'sortBy', isNil$2(sort) ? undefined : sort);
|
|
11696
11729
|
// 如果request不监听params变化,则需要手动刷新
|
|
11697
11730
|
if (!this.requestProps.reloadOnParamsChange) {
|
|
11698
|
-
this.
|
|
11731
|
+
this.resetPagination(this.pageSize);
|
|
11699
11732
|
}
|
|
11700
11733
|
// 遍历所有的列,将其他列的排序方式清空
|
|
11701
11734
|
this.columns.forEach(function (c) {
|
|
11702
11735
|
// 如果循环出来的列是可排序,但是非当前排序字段
|
|
11703
11736
|
if (c !== column && c.sortable) {
|
|
11704
|
-
|
|
11737
|
+
_this5.$refs["".concat(c.prop, "-sortable")] && _this5.$refs["".concat(c.prop, "-sortable")].onReset();
|
|
11705
11738
|
}
|
|
11706
11739
|
});
|
|
11707
11740
|
// 抛出排序改变方法
|
|
@@ -11722,14 +11755,14 @@ var script$9 = {
|
|
|
11722
11755
|
* @time 2024-11-27 18:42:59
|
|
11723
11756
|
*/
|
|
11724
11757
|
doLayout: function doLayout(columns) {
|
|
11725
|
-
var
|
|
11758
|
+
var _this6 = this;
|
|
11726
11759
|
// 记录当前隐藏的列
|
|
11727
11760
|
this.displayColumns = columns.filter(this.vif).map(function (column) {
|
|
11728
11761
|
// 处理后的数据
|
|
11729
11762
|
var columnCopy = {};
|
|
11730
11763
|
// 遍历字段的key
|
|
11731
11764
|
Object.keys(column).forEach(function (fieldKey) {
|
|
11732
|
-
columnCopy[fieldKey] = isEvalFunction(column[fieldKey]) ?
|
|
11765
|
+
columnCopy[fieldKey] = isEvalFunction(column[fieldKey]) ? _this6.functionEval(column[fieldKey]) : column[fieldKey];
|
|
11733
11766
|
});
|
|
11734
11767
|
// 返回处理后的数据
|
|
11735
11768
|
return columnCopy;
|
|
@@ -11761,7 +11794,7 @@ var script$9 = {
|
|
|
11761
11794
|
}
|
|
11762
11795
|
},
|
|
11763
11796
|
render: function render() {
|
|
11764
|
-
var
|
|
11797
|
+
var _this7 = this;
|
|
11765
11798
|
var h = arguments[0];
|
|
11766
11799
|
var _getComponentNames = getComponentNames(['table', 'table-column', 'tag', 'link', 'pagination']),
|
|
11767
11800
|
_getComponentNames2 = _slicedToArray(_getComponentNames, 5),
|
|
@@ -11794,24 +11827,24 @@ var script$9 = {
|
|
|
11794
11827
|
"class": 'iov-pro-table'
|
|
11795
11828
|
}, [h(Table, _mergeJSXProps([{
|
|
11796
11829
|
"ref": 'table',
|
|
11797
|
-
"key":
|
|
11830
|
+
"key": _this7.tableKey
|
|
11798
11831
|
}, {
|
|
11799
11832
|
"props": _objectSpread2({
|
|
11800
|
-
data: data ? lodashGet(data,
|
|
11801
|
-
},
|
|
11833
|
+
data: data ? lodashGet(data, _this7.aliasMap.list) : []
|
|
11834
|
+
}, _this7.tableConfig)
|
|
11802
11835
|
}, {
|
|
11803
11836
|
"class": 'iov-pro-table__table'
|
|
11804
11837
|
}, {
|
|
11805
|
-
"on":
|
|
11838
|
+
"on": _this7.bindEvent(TABLE_EVENTS)
|
|
11806
11839
|
}]), [
|
|
11807
11840
|
// 遍历配置项
|
|
11808
|
-
|
|
11841
|
+
_this7.displayColumns.map(function (column) {
|
|
11809
11842
|
// 当前属性
|
|
11810
|
-
var props =
|
|
11843
|
+
var props = _this7.getTableProps(column);
|
|
11811
11844
|
// slots
|
|
11812
11845
|
var scopedSlots = {};
|
|
11813
11846
|
// 插槽的执行方法
|
|
11814
|
-
var scopedSlotsFunc = column.slotName ?
|
|
11847
|
+
var scopedSlotsFunc = column.slotName ? _this7.$scopedSlots[column.slotName] : _this7.$scopedSlots[column.prop];
|
|
11815
11848
|
// 根据类型去设置props和scopedSlots
|
|
11816
11849
|
switch (column.type) {
|
|
11817
11850
|
case 'enum':
|
|
@@ -11851,7 +11884,7 @@ var script$9 = {
|
|
|
11851
11884
|
return e.value === v;
|
|
11852
11885
|
}) || {};
|
|
11853
11886
|
// 当前展示的tag
|
|
11854
|
-
return h(Tag, _mergeJSXProps([{
|
|
11887
|
+
return columnEnum.label ? h(Tag, _mergeJSXProps([{
|
|
11855
11888
|
"attrs": {
|
|
11856
11889
|
"type": columnEnum.type
|
|
11857
11890
|
}
|
|
@@ -11860,7 +11893,7 @@ var script$9 = {
|
|
|
11860
11893
|
size: 'mini',
|
|
11861
11894
|
hit: true
|
|
11862
11895
|
}, column.config || {})
|
|
11863
|
-
}]), [columnEnum.label]);
|
|
11896
|
+
}]), [columnEnum.label]) : null;
|
|
11864
11897
|
})]);
|
|
11865
11898
|
};
|
|
11866
11899
|
break;
|
|
@@ -11939,17 +11972,17 @@ var script$9 = {
|
|
|
11939
11972
|
"column": column
|
|
11940
11973
|
},
|
|
11941
11974
|
"on": {
|
|
11942
|
-
"sort":
|
|
11975
|
+
"sort": _this7.onSortAdvance.bind(_this7, column),
|
|
11943
11976
|
"confirm": function confirm(val) {
|
|
11944
|
-
return
|
|
11977
|
+
return _this7.onConfirmAdvance(column, val);
|
|
11945
11978
|
},
|
|
11946
|
-
"reset":
|
|
11979
|
+
"reset": _this7.onResetAdvance.bind(_this7, column)
|
|
11947
11980
|
}
|
|
11948
11981
|
}));
|
|
11949
11982
|
}
|
|
11950
11983
|
});
|
|
11951
11984
|
// 表头插槽
|
|
11952
|
-
var scopedSlotsHeader =
|
|
11985
|
+
var scopedSlotsHeader = _this7.$scopedSlots["".concat(column.prop, ":header")];
|
|
11953
11986
|
// 如果当前有搜索,排序等功能
|
|
11954
11987
|
if (tableColumnHeader.length > 0) {
|
|
11955
11988
|
scopedSlots.header = function () {
|
|
@@ -11977,23 +12010,23 @@ var script$9 = {
|
|
|
11977
12010
|
}]));
|
|
11978
12011
|
})]),
|
|
11979
12012
|
// 如果有分页数量才展示
|
|
11980
|
-
data && lodashGet(data,
|
|
11981
|
-
"props": _objectSpread2(_objectSpread2({},
|
|
11982
|
-
currentPage:
|
|
11983
|
-
pageSize:
|
|
11984
|
-
total: lodashGet(data,
|
|
12013
|
+
data && lodashGet(data, _this7.aliasMap.totalCount) > 0 && _this7.config.pagination !== false ? h(Pagination, _mergeJSXProps([{}, {
|
|
12014
|
+
"props": _objectSpread2(_objectSpread2({}, _this7.paginationConfig), {}, {
|
|
12015
|
+
currentPage: _this7.currPage,
|
|
12016
|
+
pageSize: _this7.pageSize,
|
|
12017
|
+
total: lodashGet(data, _this7.aliasMap.totalCount)
|
|
11985
12018
|
})
|
|
11986
12019
|
}, {
|
|
11987
12020
|
"class": 'iov-pro-table__pagination'
|
|
11988
12021
|
}, {
|
|
11989
|
-
"on":
|
|
12022
|
+
"on": _this7.bindEvent(PAGINATION_EVENTS)
|
|
11990
12023
|
}])) : null]);
|
|
11991
12024
|
}
|
|
11992
12025
|
}
|
|
11993
12026
|
}, {
|
|
11994
12027
|
"on": {
|
|
11995
12028
|
loaded: function loaded(respData) {
|
|
11996
|
-
return
|
|
12029
|
+
return _this7.$emit('loaded', respData);
|
|
11997
12030
|
}
|
|
11998
12031
|
}
|
|
11999
12032
|
}]));
|
|
@@ -18913,6 +18946,15 @@ var script$4 = {
|
|
|
18913
18946
|
return _this.onSearch();
|
|
18914
18947
|
});
|
|
18915
18948
|
};
|
|
18949
|
+
// 输入内容被清空后,重新搜索
|
|
18950
|
+
itemCopy.on['clear'] = onSearchByValueChange;
|
|
18951
|
+
// 触发点击事件
|
|
18952
|
+
itemCopy.on['click.native'] = function (e) {
|
|
18953
|
+
// 如果有搜索按钮
|
|
18954
|
+
if (e.target.classList.contains('iov-icon-search')) {
|
|
18955
|
+
onSearchByValueChange();
|
|
18956
|
+
}
|
|
18957
|
+
};
|
|
18916
18958
|
// 如果是输入框
|
|
18917
18959
|
if (toUpperCamelCase(itemType) === 'Input') {
|
|
18918
18960
|
// 绑定回车方法
|
|
@@ -19059,7 +19101,7 @@ var script$4 = {
|
|
|
19059
19101
|
// 深拷贝一份对象
|
|
19060
19102
|
this.queryData = cloneDeep(this.formData);
|
|
19061
19103
|
// 重置表格分页数据
|
|
19062
|
-
this.$refs.table.
|
|
19104
|
+
this.$refs.table.onReset();
|
|
19063
19105
|
},
|
|
19064
19106
|
/**
|
|
19065
19107
|
* 刷新表格数据
|
|
@@ -19082,6 +19124,8 @@ var script$4 = {
|
|
|
19082
19124
|
var _this5 = this;
|
|
19083
19125
|
// 重置表单数据
|
|
19084
19126
|
this.$refs.form.resetFields();
|
|
19127
|
+
// 清空表格高级搜索的内容
|
|
19128
|
+
this.tableAdvanceData = {};
|
|
19085
19129
|
// 接口重新加载数据
|
|
19086
19130
|
this.$nextTick(function () {
|
|
19087
19131
|
// 抛出reset事件
|
|
@@ -19089,7 +19133,7 @@ var script$4 = {
|
|
|
19089
19133
|
// 开始刷新数据
|
|
19090
19134
|
_this5.queryData = cloneDeep(_this5.formData);
|
|
19091
19135
|
// 重置表格分页数据
|
|
19092
|
-
_this5.$refs.table.
|
|
19136
|
+
_this5.$refs.table.onReset();
|
|
19093
19137
|
});
|
|
19094
19138
|
},
|
|
19095
19139
|
/**
|
|
@@ -19466,7 +19510,7 @@ var script$3 = {
|
|
|
19466
19510
|
// 重新赋值表单数据
|
|
19467
19511
|
componentInstance.queryData = cloneDeep(_this2.formData);
|
|
19468
19512
|
// 重置表单分页数据
|
|
19469
|
-
componentInstance.$refs.table.
|
|
19513
|
+
componentInstance.$refs.table.onReset();
|
|
19470
19514
|
}
|
|
19471
19515
|
});
|
|
19472
19516
|
},
|
|
@@ -19946,7 +19990,7 @@ var install = function install(Vue, componentConfig) {
|
|
|
19946
19990
|
};
|
|
19947
19991
|
var index = {
|
|
19948
19992
|
install: install,
|
|
19949
|
-
version: '0.0.
|
|
19993
|
+
version: '0.0.25',
|
|
19950
19994
|
ColumnTooltip: __vue_component__$t,
|
|
19951
19995
|
Description: __vue_component__$q,
|
|
19952
19996
|
DialogSelect: __vue_component__$p,
|