iov-pro-components 0.0.17 → 0.0.19
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 +157 -23
- package/package.json +1 -1
|
@@ -5844,6 +5844,13 @@ var script$p = {
|
|
|
5844
5844
|
return [];
|
|
5845
5845
|
}
|
|
5846
5846
|
},
|
|
5847
|
+
// 已选择的数据过滤字段
|
|
5848
|
+
filterField2: {
|
|
5849
|
+
type: Array,
|
|
5850
|
+
default: function _default() {
|
|
5851
|
+
return [];
|
|
5852
|
+
}
|
|
5853
|
+
},
|
|
5847
5854
|
// 全部列scheme
|
|
5848
5855
|
unselectColumns: {
|
|
5849
5856
|
type: Array,
|
|
@@ -5872,6 +5879,18 @@ var script$p = {
|
|
|
5872
5879
|
visible: {
|
|
5873
5880
|
type: Boolean,
|
|
5874
5881
|
default: false
|
|
5882
|
+
},
|
|
5883
|
+
// 自定义搜索表单项
|
|
5884
|
+
customSearchFormItems: {
|
|
5885
|
+
type: Array,
|
|
5886
|
+
default: function _default() {
|
|
5887
|
+
return [];
|
|
5888
|
+
}
|
|
5889
|
+
},
|
|
5890
|
+
// 自定义搜索请求
|
|
5891
|
+
customSearchRequest: {
|
|
5892
|
+
type: Object,
|
|
5893
|
+
default: null
|
|
5875
5894
|
}
|
|
5876
5895
|
},
|
|
5877
5896
|
data: function data() {
|
|
@@ -5879,6 +5898,7 @@ var script$p = {
|
|
|
5879
5898
|
showDialog: false,
|
|
5880
5899
|
activeName: '0',
|
|
5881
5900
|
filterText: '',
|
|
5901
|
+
filterText2: '',
|
|
5882
5902
|
selectedData: [],
|
|
5883
5903
|
tableHeight: 'auto'
|
|
5884
5904
|
};
|
|
@@ -5909,15 +5929,18 @@ var script$p = {
|
|
|
5909
5929
|
return this.selectedData;
|
|
5910
5930
|
}
|
|
5911
5931
|
// 如果当前没有过滤数据
|
|
5912
|
-
if ([null, undefined, ''].includes(this.
|
|
5932
|
+
if ([null, undefined, ''].includes(this.filterText2) || this.filterField2.length === 0) {
|
|
5913
5933
|
return this.selectedData;
|
|
5914
5934
|
}
|
|
5915
5935
|
// 返回过滤后的数据
|
|
5916
5936
|
return this.selectedData.filter(function (item) {
|
|
5917
|
-
return _this2.
|
|
5918
|
-
return item[name].indexOf(_this2.
|
|
5937
|
+
return _this2.filterField2.some(function (name) {
|
|
5938
|
+
return item[name].indexOf(_this2.filterText2) >= 0;
|
|
5919
5939
|
});
|
|
5920
5940
|
});
|
|
5941
|
+
},
|
|
5942
|
+
isCustomSearch: function isCustomSearch() {
|
|
5943
|
+
return _typeof$1(this.customSearchFormItems) === 'object' && Object.keys(this.customSearchFormItems).length;
|
|
5921
5944
|
}
|
|
5922
5945
|
},
|
|
5923
5946
|
watch: {
|
|
@@ -5927,21 +5950,23 @@ var script$p = {
|
|
|
5927
5950
|
if (val) {
|
|
5928
5951
|
this.$nextTick(function () {
|
|
5929
5952
|
_this3.selectedData = _this3.value;
|
|
5930
|
-
_this3
|
|
5953
|
+
_this3.getElTable().clearSelection();
|
|
5931
5954
|
_this3.selectedData.forEach(function (row) {
|
|
5932
|
-
_this3
|
|
5955
|
+
_this3.getElTable().toggleRowSelection(row);
|
|
5933
5956
|
});
|
|
5934
5957
|
_this3.initHeight();
|
|
5935
5958
|
});
|
|
5936
5959
|
} else {
|
|
5937
5960
|
this.filterText = '';
|
|
5961
|
+
this.filterText2 = '';
|
|
5938
5962
|
this.activeName = '0';
|
|
5939
5963
|
this.selectedData = [];
|
|
5940
|
-
this
|
|
5964
|
+
this.getElTable().clearSelection();
|
|
5941
5965
|
}
|
|
5942
5966
|
},
|
|
5943
5967
|
activeName: function activeName() {
|
|
5944
5968
|
this.filterText = '';
|
|
5969
|
+
this.filterText2 = '';
|
|
5945
5970
|
}
|
|
5946
5971
|
},
|
|
5947
5972
|
methods: {
|
|
@@ -5951,6 +5976,9 @@ var script$p = {
|
|
|
5951
5976
|
*/
|
|
5952
5977
|
initHeight: function initHeight() {
|
|
5953
5978
|
var _this4 = this;
|
|
5979
|
+
if (this.isCustomSearch) {
|
|
5980
|
+
return;
|
|
5981
|
+
}
|
|
5954
5982
|
if (this.timer) {
|
|
5955
5983
|
clearTimeout(this.timer);
|
|
5956
5984
|
}
|
|
@@ -5964,7 +5992,7 @@ var script$p = {
|
|
|
5964
5992
|
_this4.tableHeight = Math.ceil(dialogBodyHeight - tabHeaderHeight - tabFilterHeight) + 'px';
|
|
5965
5993
|
// 固定弹窗内容高度
|
|
5966
5994
|
_this4.$refs.content.style.height = dialogBodyHeight + 'px';
|
|
5967
|
-
_this4
|
|
5995
|
+
_this4.getElTable().doLayout();
|
|
5968
5996
|
_this4.setDialogFooterShadow();
|
|
5969
5997
|
} else {
|
|
5970
5998
|
// 固定弹窗内容高度
|
|
@@ -6030,10 +6058,10 @@ var script$p = {
|
|
|
6030
6058
|
return item[_this5.rowKey] !== row[_this5.rowKey];
|
|
6031
6059
|
});
|
|
6032
6060
|
// 清空表格选择的数据
|
|
6033
|
-
this
|
|
6061
|
+
this.getElTable().clearSelection();
|
|
6034
6062
|
// 重新赋值选择的数据
|
|
6035
6063
|
selectedData.forEach(function (row) {
|
|
6036
|
-
_this5
|
|
6064
|
+
_this5.getElTable().toggleRowSelection(row);
|
|
6037
6065
|
});
|
|
6038
6066
|
},
|
|
6039
6067
|
/**
|
|
@@ -6059,13 +6087,57 @@ var script$p = {
|
|
|
6059
6087
|
}
|
|
6060
6088
|
return item;
|
|
6061
6089
|
});
|
|
6090
|
+
// 如果父组件监听了 confirm 事件,则交由父组件处理(传入数据和关闭方法)
|
|
6091
|
+
if (this.$listeners.confirm) {
|
|
6092
|
+
this.$emit('confirm', selectedData, this.onClose);
|
|
6093
|
+
return;
|
|
6094
|
+
}
|
|
6062
6095
|
this.$emit('input', selectedData);
|
|
6063
6096
|
this.onClose();
|
|
6097
|
+
},
|
|
6098
|
+
/**
|
|
6099
|
+
* 獲取 el-table 實例
|
|
6100
|
+
*/
|
|
6101
|
+
getElTable: function getElTable() {
|
|
6102
|
+
if (this.isCustomSearch) {
|
|
6103
|
+
return this.$refs.unselect.$refs.table.$refs.table;
|
|
6104
|
+
}
|
|
6105
|
+
return this.$refs.unselect.$refs.table;
|
|
6106
|
+
},
|
|
6107
|
+
/**
|
|
6108
|
+
* 计算 search-table 最大高度
|
|
6109
|
+
*/
|
|
6110
|
+
getSearchTableMaxHeight: function getSearchTableMaxHeight() {
|
|
6111
|
+
// 获取 dialog body 最大高
|
|
6112
|
+
var dialogBodyHeight = this.getDialogBodyHeight();
|
|
6113
|
+
// 获取 el-tab header 高
|
|
6114
|
+
var tabHeader = this.$refs.content.querySelector('.el-tabs__header');
|
|
6115
|
+
var tabHeaderStyle = window.getComputedStyle(tabHeader);
|
|
6116
|
+
var tabHeaderHeight = Math.ceil(+tabHeaderStyle.height.replace('px', '')) + Math.ceil(+tabHeaderStyle.marginBottom.replace('px', '') + 1);
|
|
6117
|
+
// 获取分页器高度
|
|
6118
|
+
var elPage = this.$refs.unselect.$el.querySelector('.el-pagination');
|
|
6119
|
+
var elPageHeight = elPage ? Math.ceil(elPage.offsetHeight) : 0;
|
|
6120
|
+
var elTable = this.getElTable();
|
|
6121
|
+
// 表格最大高 = dialog body 最大高 - el-tab header 高 - 分页高 - 表格自身至 el-tab panel body的距离
|
|
6122
|
+
return dialogBodyHeight - tabHeaderHeight - elPageHeight - elTable.$el.offsetTop;
|
|
6123
|
+
},
|
|
6124
|
+
/**
|
|
6125
|
+
* 自定义查询成功后,计算表格最大高度
|
|
6126
|
+
*/
|
|
6127
|
+
onAfterCustomSearchHandle: function onAfterCustomSearchHandle() {
|
|
6128
|
+
var _this7 = this;
|
|
6129
|
+
if (this.timer) {
|
|
6130
|
+
clearTimeout(this.timer);
|
|
6131
|
+
}
|
|
6132
|
+
this.timer = setTimeout(function () {
|
|
6133
|
+
_this7.tableHeight = _this7.getSearchTableMaxHeight() + 'px';
|
|
6134
|
+
_this7.getElTable().doLayout();
|
|
6135
|
+
_this7.setDialogFooterShadow();
|
|
6136
|
+
}, 50);
|
|
6064
6137
|
}
|
|
6065
6138
|
}
|
|
6066
6139
|
};
|
|
6067
6140
|
|
|
6068
|
-
/* script */
|
|
6069
6141
|
var __vue_script__$p = script$p;
|
|
6070
6142
|
|
|
6071
6143
|
/* template */
|
|
@@ -6104,7 +6176,40 @@ var __vue_render__$7 = function __vue_render__() {
|
|
|
6104
6176
|
},
|
|
6105
6177
|
expression: "activeName"
|
|
6106
6178
|
}
|
|
6107
|
-
}, [_c("
|
|
6179
|
+
}, [_c("el-tab-pane", {
|
|
6180
|
+
attrs: {
|
|
6181
|
+
label: "全部",
|
|
6182
|
+
name: "0"
|
|
6183
|
+
}
|
|
6184
|
+
}, [_vm.isCustomSearch ? [_c("iov-pro-search-table", {
|
|
6185
|
+
ref: "unselect",
|
|
6186
|
+
attrs: {
|
|
6187
|
+
request: _vm.customSearchRequest,
|
|
6188
|
+
"form-items": _vm.customSearchFormItems,
|
|
6189
|
+
"table-columns": _vm.unselectColumns,
|
|
6190
|
+
config: {
|
|
6191
|
+
simple: true,
|
|
6192
|
+
table: {
|
|
6193
|
+
rowKey: _vm.rowKey,
|
|
6194
|
+
maxHeight: _vm.tableHeight
|
|
6195
|
+
}
|
|
6196
|
+
}
|
|
6197
|
+
},
|
|
6198
|
+
on: {
|
|
6199
|
+
"after-request": _vm.onAfterCustomSearchHandle,
|
|
6200
|
+
"selection-change": _vm.onChangeSelection
|
|
6201
|
+
},
|
|
6202
|
+
scopedSlots: _vm._u([_vm._l(_vm.unselectColumns.filter(function (column) {
|
|
6203
|
+
return column.type === "slot";
|
|
6204
|
+
}), function (item) {
|
|
6205
|
+
return {
|
|
6206
|
+
key: item.slotName || item.prop,
|
|
6207
|
+
fn: function fn(scope) {
|
|
6208
|
+
return [_vm._t(item.slotName || item.prop, null, null, scope)];
|
|
6209
|
+
}
|
|
6210
|
+
};
|
|
6211
|
+
})], null, true)
|
|
6212
|
+
})] : [_c("div", {
|
|
6108
6213
|
staticClass: "iov-pro-dialog-select__filter"
|
|
6109
6214
|
}, [_c("el-input", {
|
|
6110
6215
|
attrs: {
|
|
@@ -6119,12 +6224,7 @@ var __vue_render__$7 = function __vue_render__() {
|
|
|
6119
6224
|
},
|
|
6120
6225
|
expression: "filterText"
|
|
6121
6226
|
}
|
|
6122
|
-
})], 1), _vm._v(" "), _c("
|
|
6123
|
-
attrs: {
|
|
6124
|
-
label: "全部",
|
|
6125
|
-
name: "0"
|
|
6126
|
-
}
|
|
6127
|
-
}, [_c("IovProTable", {
|
|
6227
|
+
})], 1), _vm._v(" "), _c("IovProTable", {
|
|
6128
6228
|
ref: "unselect",
|
|
6129
6229
|
attrs: {
|
|
6130
6230
|
columns: _vm.unselectColumns,
|
|
@@ -6141,14 +6241,39 @@ var __vue_render__$7 = function __vue_render__() {
|
|
|
6141
6241
|
},
|
|
6142
6242
|
on: {
|
|
6143
6243
|
"selection-change": _vm.onChangeSelection
|
|
6144
|
-
}
|
|
6145
|
-
|
|
6244
|
+
},
|
|
6245
|
+
scopedSlots: _vm._u([_vm._l(_vm.unselectColumns.filter(function (column) {
|
|
6246
|
+
return column.type === "slot";
|
|
6247
|
+
}), function (item) {
|
|
6248
|
+
return {
|
|
6249
|
+
key: item.slotName || item.prop,
|
|
6250
|
+
fn: function fn(scope) {
|
|
6251
|
+
return [_vm._t(item.slotName || item.prop, null, null, scope)];
|
|
6252
|
+
}
|
|
6253
|
+
};
|
|
6254
|
+
})], null, true)
|
|
6255
|
+
})]], 2), _vm._v(" "), _c("el-tab-pane", {
|
|
6146
6256
|
attrs: {
|
|
6147
6257
|
label: "本次已选 (" + _vm.selectedData.length + ")",
|
|
6148
6258
|
type: "card",
|
|
6149
6259
|
name: "1"
|
|
6150
6260
|
}
|
|
6151
|
-
}, [_c("
|
|
6261
|
+
}, [_c("div", {
|
|
6262
|
+
staticClass: "iov-pro-dialog-select__filter"
|
|
6263
|
+
}, [_c("el-input", {
|
|
6264
|
+
attrs: {
|
|
6265
|
+
placeholder: _vm.placeholder,
|
|
6266
|
+
"prefix-icon": "iov-icon-search",
|
|
6267
|
+
size: "small"
|
|
6268
|
+
},
|
|
6269
|
+
model: {
|
|
6270
|
+
value: _vm.filterText2,
|
|
6271
|
+
callback: function callback($$v) {
|
|
6272
|
+
_vm.filterText2 = $$v;
|
|
6273
|
+
},
|
|
6274
|
+
expression: "filterText2"
|
|
6275
|
+
}
|
|
6276
|
+
})], 1), _vm._v(" "), _c("IovProTable", {
|
|
6152
6277
|
ref: "selected",
|
|
6153
6278
|
attrs: {
|
|
6154
6279
|
columns: _vm.selectedColumns,
|
|
@@ -6162,7 +6287,16 @@ var __vue_render__$7 = function __vue_render__() {
|
|
|
6162
6287
|
pagination: false
|
|
6163
6288
|
}
|
|
6164
6289
|
},
|
|
6165
|
-
scopedSlots: _vm._u([{
|
|
6290
|
+
scopedSlots: _vm._u([_vm._l(_vm.selectedColumns.filter(function (column) {
|
|
6291
|
+
return column.type === "slot";
|
|
6292
|
+
}), function (item) {
|
|
6293
|
+
return {
|
|
6294
|
+
key: item.slotName || item.prop,
|
|
6295
|
+
fn: function fn(scope) {
|
|
6296
|
+
return [_vm._t(item.slotName || item.prop, null, null, scope)];
|
|
6297
|
+
}
|
|
6298
|
+
};
|
|
6299
|
+
}), {
|
|
6166
6300
|
key: "operation",
|
|
6167
6301
|
fn: function fn(scope) {
|
|
6168
6302
|
return [_c("el-link", {
|
|
@@ -6176,7 +6310,7 @@ var __vue_render__$7 = function __vue_render__() {
|
|
|
6176
6310
|
}
|
|
6177
6311
|
}, [_vm._v("移除")])];
|
|
6178
6312
|
}
|
|
6179
|
-
}], null,
|
|
6313
|
+
}], null, true)
|
|
6180
6314
|
})], 1)], 1)], 1) : _vm._e(), _vm._v(" "), _c("template", {
|
|
6181
6315
|
slot: "footer"
|
|
6182
6316
|
}, [_c("el-button", {
|
|
@@ -19770,7 +19904,7 @@ var install = function install(Vue, componentConfig) {
|
|
|
19770
19904
|
};
|
|
19771
19905
|
var index = {
|
|
19772
19906
|
install: install,
|
|
19773
|
-
version: '0.0.
|
|
19907
|
+
version: '0.0.19',
|
|
19774
19908
|
ColumnTooltip: __vue_component__$t,
|
|
19775
19909
|
Description: __vue_component__$q,
|
|
19776
19910
|
DialogSelect: __vue_component__$p,
|