doway-coms 1.4.10 → 1.4.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "1.4.10",
3
+ "version": "1.4.12",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -1123,16 +1123,18 @@ export default {
1123
1123
  break;
1124
1124
  case "clearFilter":
1125
1125
  // 示例
1126
- const filterList = vm.$refs.baseGrid.getCheckedFilters();
1126
+ const filterList = this.$refs.baseGrid.getCheckedFilters();
1127
+ this.$refs.baseGrid.clearFilter();
1127
1128
  filterList.forEach((col) => {
1128
- if (
1129
- col.column.params.controlType === "select" ||
1130
- col.column.params.controlType === "checkbox"
1131
- ) {
1129
+ // if (
1130
+ // col.column.params.controlType === "select" ||
1131
+ // col.column.params.controlType === "checkbox"
1132
+ // ) {
1133
+ // col.column.filters = [{ data: [] }];
1134
+ // } else {
1135
+ // col.column.filters = [{ data: [] }];
1136
+ // }
1132
1137
  col.column.filters = [{ data: [] }];
1133
- } else {
1134
- col.column.filters = [];
1135
- }
1136
1138
  });
1137
1139
  vm.$emit("filterChange");
1138
1140
  break;
@@ -513,4 +513,31 @@ export function numberDigitsRound(rowInfo, colInfo) {
513
513
  rowInfo[colInfo.number] = rowInfo[colInfo.number].toFixed(rowInfo[colInfo.digits])
514
514
  break;
515
515
  }
516
+ }
517
+ // 导出用
518
+ export function getExportParams(columns) {
519
+ let tempParams = {
520
+ fields: [],
521
+ dicts: {}
522
+ }
523
+ for (let i = 0; i < columns.length; i++) {
524
+ if (columns[i].visible === false) {
525
+ continue
526
+ }
527
+ let tempFieldInfo = {
528
+ field: columns[i].field,
529
+ title: columns[i].title
530
+ }
531
+ tempParams.fields.push(tempFieldInfo)
532
+ if (columns[i].dataSource && columns[i].dataSource.length > 0) {
533
+ if (!tempParams.dicts[columns[i].field]) {
534
+ tempParams.dicts[columns[i].field] = {}
535
+ for (let j = 0; j < columns[i].dataSource.length; j++) {
536
+ tempParams.dicts[columns[i].field][columns[i].dataSource[j].value] =
537
+ columns[i].dataSource[j].caption
538
+ }
539
+ }
540
+ }
541
+ }
542
+ return tempParams
516
543
  }