doway-coms 1.6.2 → 1.6.4
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/package.json +1 -1
- package/packages/BaseGrid/src/index.vue +6 -1
- package/packages/BasePulldown/src/index.vue +150 -4
- package/dist/css/chunk-vendors.7f83d8f9.css +0 -8
- package/dist/css/index.7946d50b.css +0 -1
- package/dist/favicon.ico +0 -0
- package/dist/js/chunk-vendors.28fda91d.js +0 -340
- package/dist/js/index.49bc6add.js +0 -2
- package/lib/doway-coms.common.js +0 -120397
- package/lib/doway-coms.css +0 -1
- package/lib/doway-coms.umd.js +0 -120407
- package/lib/doway-coms.umd.min.js +0 -328
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
:height="'auto'"
|
|
66
66
|
:show-footer="showFooter"
|
|
67
67
|
@scroll="bodyScroll"
|
|
68
|
+
:row-class-name="gridRowStyle"
|
|
68
69
|
>
|
|
69
70
|
<template v-for="item in internalColumns" #[item.field]>
|
|
70
71
|
<div :key="item.field">
|
|
@@ -2273,7 +2274,11 @@ export default {
|
|
|
2273
2274
|
let row = fullData.find((x) => x.id == id);
|
|
2274
2275
|
this.$refs.baseGrid.setCurrentRow(row);
|
|
2275
2276
|
},
|
|
2276
|
-
gridRowStyle(scope) {
|
|
2277
|
+
gridRowStyle(scope) {
|
|
2278
|
+
if (scope.row.sysRepeat === true) {
|
|
2279
|
+
return "row--pending";
|
|
2280
|
+
}
|
|
2281
|
+
},
|
|
2277
2282
|
bodyScroll(scrollInfo) {
|
|
2278
2283
|
this.$emit("scroll", scrollInfo);
|
|
2279
2284
|
// if (scrollInfo.isX === true) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="d-control-container">
|
|
3
3
|
<div
|
|
4
4
|
class="d-control-label"
|
|
@@ -62,9 +62,13 @@
|
|
|
62
62
|
ref="pupupGridView"
|
|
63
63
|
:data="searchRows"
|
|
64
64
|
@cell-click="gridCellClick"
|
|
65
|
+
@filter-visible="filterVisible"
|
|
65
66
|
:columns="internalColumns"
|
|
66
67
|
:checkbox-config="{ checkMethod: checkMethod }"
|
|
67
68
|
@sort-change="sortChange"
|
|
69
|
+
:filter-config="{
|
|
70
|
+
remote: true,
|
|
71
|
+
}"
|
|
68
72
|
:sort-config="{
|
|
69
73
|
multiple: true,
|
|
70
74
|
remote: true,
|
|
@@ -84,6 +88,40 @@
|
|
|
84
88
|
</div>
|
|
85
89
|
</div>
|
|
86
90
|
</template>
|
|
91
|
+
<!-- <template #checkbox_filter="scope">-->
|
|
92
|
+
<!-- <div class="interceptor-class">-->
|
|
93
|
+
<!-- <a-checkbox-group-->
|
|
94
|
+
<!-- v-model="scope.column.filters[0].data.displayValues"-->
|
|
95
|
+
<!-- @keyup.enter.native="filterConfirm(scope.column)"-->
|
|
96
|
+
<!-- >-->
|
|
97
|
+
<!-- <div style="max-height:200px;overflow-y:scroll">-->
|
|
98
|
+
<!-- <div style="text-align:left;" v-for="loopSource in scope.column.params.dataSource" :key="loopSource.value">-->
|
|
99
|
+
<!-- <a-checkbox-->
|
|
100
|
+
<!-- v-show="loopSource.caption.indexOf(scope.column.filters[0].data.displayValueSearchText)>-1"-->
|
|
101
|
+
<!-- :value="loopSource.value"-->
|
|
102
|
+
<!-- style="margin: 5px 0;"-->
|
|
103
|
+
<!-- >{{ loopSource.caption }}-->
|
|
104
|
+
<!-- </a-checkbox>-->
|
|
105
|
+
<!-- </div>-->
|
|
106
|
+
<!-- </div>-->
|
|
107
|
+
<!-- </a-checkbox-group>-->
|
|
108
|
+
<!-- <br>-->
|
|
109
|
+
<!-- <a-button @click="filterConfirm(scope.column)">确认</a-button>-->
|
|
110
|
+
<!-- </div>-->
|
|
111
|
+
<!-- </template>-->
|
|
112
|
+
<!-- 普通输入框的过滤筛选-->
|
|
113
|
+
<template #text_filter="{ column }">
|
|
114
|
+
<div class="interceptor-class">
|
|
115
|
+
<div
|
|
116
|
+
v-for="(item, $index) in column.filters"
|
|
117
|
+
:key="$index"
|
|
118
|
+
>
|
|
119
|
+
<a-input allowClear v-model="item.data" @keyup.enter.native="filterConfirm(column)" style="margin-bottom: 5px;" />
|
|
120
|
+
</div>
|
|
121
|
+
<a-button @click="filterAddExp(column)">添加条件</a-button>
|
|
122
|
+
<a-button @click="filterConfirm(column)">确认</a-button>
|
|
123
|
+
</div>
|
|
124
|
+
</template>
|
|
87
125
|
<template #pager>
|
|
88
126
|
<a-row>
|
|
89
127
|
<a-col :span="8">
|
|
@@ -141,7 +179,6 @@
|
|
|
141
179
|
<span v-else> {{ currentValue }}</span>
|
|
142
180
|
</span>
|
|
143
181
|
</div>
|
|
144
|
-
|
|
145
182
|
<keep-alive>
|
|
146
183
|
<div
|
|
147
184
|
:is="popupAddName"
|
|
@@ -188,6 +225,10 @@ export default {
|
|
|
188
225
|
},
|
|
189
226
|
sorts: [],
|
|
190
227
|
defaultSort: [],
|
|
228
|
+
filterExpression: {
|
|
229
|
+
operator: 'and',
|
|
230
|
+
expressions: []
|
|
231
|
+
}
|
|
191
232
|
};
|
|
192
233
|
},
|
|
193
234
|
props: {
|
|
@@ -387,6 +428,27 @@ export default {
|
|
|
387
428
|
if (this.columns[i].isCheckbox === true) {
|
|
388
429
|
this.columns[i]["type"] = "checkbox";
|
|
389
430
|
}
|
|
431
|
+
// 设置字段的过滤插槽
|
|
432
|
+
if(this.columns[i].filter) {
|
|
433
|
+
this.columns[i]["filterMultiple"] = false;
|
|
434
|
+
this.columns[i]['filters'] = [
|
|
435
|
+
{
|
|
436
|
+
data: ''
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
switch(this.columns[i].controlType) {
|
|
440
|
+
// case 'checkbox':
|
|
441
|
+
// this.columns[i]['slots'] = {
|
|
442
|
+
// filter: `checkbox_filter`
|
|
443
|
+
// }
|
|
444
|
+
// break
|
|
445
|
+
default:
|
|
446
|
+
this.columns[i]['slots'] = {
|
|
447
|
+
filter: `text_filter`
|
|
448
|
+
}
|
|
449
|
+
break
|
|
450
|
+
}
|
|
451
|
+
}
|
|
390
452
|
// 默认排序
|
|
391
453
|
if (this.columns[i].defaultSort) {
|
|
392
454
|
this.defaultSort.push({
|
|
@@ -464,6 +526,7 @@ export default {
|
|
|
464
526
|
inputClickEvent(event) {
|
|
465
527
|
if (this.$refs.pulldownRef.isPanelVisible() === false) {
|
|
466
528
|
this.$refs.pulldownRef.showPanel();
|
|
529
|
+
this.clearColumnFilter()
|
|
467
530
|
this.searchData();
|
|
468
531
|
} else {
|
|
469
532
|
this.$refs.pulldownRef.hidePanel();
|
|
@@ -744,6 +807,9 @@ export default {
|
|
|
744
807
|
};
|
|
745
808
|
//查询之前从外部组件构造其他的条件
|
|
746
809
|
this.$emit("preSearch", postExpression, repeatRowInfo);
|
|
810
|
+
if(this.filterExpression.expressions.length > 0) {
|
|
811
|
+
postExpression.expression.expressions.push(this.filterExpression)
|
|
812
|
+
}
|
|
747
813
|
let postData = {
|
|
748
814
|
fields: this.fetchFields,
|
|
749
815
|
begin:
|
|
@@ -755,7 +821,7 @@ export default {
|
|
|
755
821
|
sorts: this.sorts,
|
|
756
822
|
extendParams: postExpression.extendParams,
|
|
757
823
|
};
|
|
758
|
-
console.log(postData.sorts);
|
|
824
|
+
// console.log(postData.sorts);
|
|
759
825
|
let tempApi = this.getPostApi(postData);
|
|
760
826
|
|
|
761
827
|
// let tempApi = this.api
|
|
@@ -786,6 +852,7 @@ export default {
|
|
|
786
852
|
vm.gridPagerConfig.total = responseData.extData.totalRows;
|
|
787
853
|
} else {
|
|
788
854
|
vm.searchRows = responseData.content;
|
|
855
|
+
vm.$refs.pupupGridView.loadData(vm.searchRows)
|
|
789
856
|
vm.gridPagerConfig.total = responseData.otherContent.totalRows;
|
|
790
857
|
}
|
|
791
858
|
if (repeatRowInfo.field) {
|
|
@@ -863,6 +930,80 @@ export default {
|
|
|
863
930
|
this.sorts = currentSort;
|
|
864
931
|
this.searchData();
|
|
865
932
|
},
|
|
933
|
+
|
|
934
|
+
// 下拉容器筛选条件被触发
|
|
935
|
+
filterVisible({column}) {
|
|
936
|
+
XEUtils.remove(column.filters, item => {
|
|
937
|
+
return item.data === ''
|
|
938
|
+
})
|
|
939
|
+
if(column.filters.length === 0) {
|
|
940
|
+
column.filters.push({
|
|
941
|
+
data: ''
|
|
942
|
+
})
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
filterConfirm(column) {
|
|
946
|
+
let vm = this
|
|
947
|
+
this.filterExpression = {
|
|
948
|
+
operator: 'and',
|
|
949
|
+
expressions: []
|
|
950
|
+
}
|
|
951
|
+
column.filters[0].checked =
|
|
952
|
+
column.filters[0].data !== '';
|
|
953
|
+
//通知外部筛选改变事件
|
|
954
|
+
let columns = this.$refs.pupupGridView.getTableColumn().collectColumn
|
|
955
|
+
XEUtils.each(columns, item => {
|
|
956
|
+
let filterExpression = {
|
|
957
|
+
operator: 'or',
|
|
958
|
+
expressions: []
|
|
959
|
+
}
|
|
960
|
+
if(item.filters && item.filters[0].checked) {
|
|
961
|
+
XEUtils.each(item.filters, loopItem => {
|
|
962
|
+
if(loopItem.data !== '') {
|
|
963
|
+
filterExpression.expressions.push({
|
|
964
|
+
field: item.field,
|
|
965
|
+
operator: "CO",
|
|
966
|
+
value: loopItem.data
|
|
967
|
+
})
|
|
968
|
+
}
|
|
969
|
+
})
|
|
970
|
+
if(filterExpression.expressions.length > 0) {
|
|
971
|
+
vm.filterExpression.expressions.push(filterExpression)
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
})
|
|
975
|
+
this.gridPagerConfig.currentPage = 1
|
|
976
|
+
this.searchData()
|
|
977
|
+
this.$refs.pupupGridView.closeFilter()
|
|
978
|
+
},
|
|
979
|
+
// 添加筛选条件
|
|
980
|
+
filterAddExp(column) {
|
|
981
|
+
column['filters'].push({
|
|
982
|
+
data: ''
|
|
983
|
+
})
|
|
984
|
+
},
|
|
985
|
+
|
|
986
|
+
// 清楚筛选条件
|
|
987
|
+
clearColumnFilter() {
|
|
988
|
+
let columns = []
|
|
989
|
+
try {
|
|
990
|
+
columns = this.$refs.pupupGridView.getTableColumn().collectColumn
|
|
991
|
+
}catch (err) {
|
|
992
|
+
console.debug(err)
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
XEUtils.each(columns, item => {
|
|
996
|
+
if(item.filters && item.filters[0].checked) {
|
|
997
|
+
item.filters = [{
|
|
998
|
+
data: ''
|
|
999
|
+
}]
|
|
1000
|
+
}
|
|
1001
|
+
})
|
|
1002
|
+
this.filterExpression = {
|
|
1003
|
+
operator: 'and',
|
|
1004
|
+
expressions: []
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
866
1007
|
},
|
|
867
1008
|
};
|
|
868
1009
|
</script>
|
|
@@ -877,9 +1018,14 @@ export default {
|
|
|
877
1018
|
}
|
|
878
1019
|
|
|
879
1020
|
.d-grid-control {
|
|
880
|
-
width: 100%;
|
|
881
1021
|
height: 30px;
|
|
882
1022
|
}
|
|
1023
|
+
.interceptor-class {
|
|
1024
|
+
padding: 10px;
|
|
1025
|
+
::v-deep .ant-btn {
|
|
1026
|
+
margin: 10px 10px 0;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
883
1029
|
</style>
|
|
884
1030
|
|
|
885
1031
|
|