bri-components 1.1.2 → 1.1.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.
Files changed (158) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/10.bri-components.min.js +1 -0
  4. package/lib/2.bri-components.min.js +1 -1
  5. package/lib/3.bri-components.min.js +1 -1
  6. package/lib/4.bri-components.min.js +1 -1
  7. package/lib/5.bri-components.min.js +1 -1
  8. package/lib/6.bri-components.min.js +1 -1
  9. package/lib/7.bri-components.min.js +1 -1
  10. package/lib/8.bri-components.min.js +1 -1
  11. package/lib/9.bri-components.min.js +1 -1
  12. package/lib/bri-components.min.js +6 -6
  13. package/lib/styles/bri-components.css +1 -1
  14. package/package.json +1 -1
  15. package/src/abolish/DshCascaders.less +11 -0
  16. package/src/{components/controls/base/DshCascaderMultiple.vue → abolish/DshCascaders.vue} +17 -27
  17. package/src/{components/list → abolish}/DshFlatTable.vue +1 -1
  18. package/src/abolish/DshTexts.less +13 -0
  19. package/src/{components/controls/base/textMultiple/DshTextMultiple.vue → abolish/DshTexts.vue} +17 -25
  20. package/src/components/controls/base/{textMultiple/MultipleInput.vue → BriInputs.vue} +18 -17
  21. package/src/components/controls/base/{ZUpload/YUploadImage.vue → BriUpload/BriUploadImage.vue} +56 -15
  22. package/src/components/controls/base/{ZUpload → BriUpload}/index.vue +24 -21
  23. package/src/components/controls/base/{ZUpload → BriUpload}/upload-list.vue +20 -13
  24. package/src/components/controls/base/{ZUpload → BriUpload}/uploadMixin.js +7 -3
  25. package/src/components/controls/base/{DshCascader.vue → DshCascader/DshCascader.vue} +33 -26
  26. package/src/components/controls/base/DshCheckbox.vue +17 -20
  27. package/src/components/controls/base/DshCoordinates.vue +119 -110
  28. package/src/components/controls/base/DshDate.vue +24 -37
  29. package/src/components/controls/base/DshDaterange.vue +3 -1
  30. package/src/components/controls/base/DshEditor.vue +73 -60
  31. package/src/components/controls/base/DshInput.vue +72 -60
  32. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
  33. package/src/components/controls/base/DshNumber/DshNumber.vue +52 -48
  34. package/src/components/controls/base/DshNumberange.vue +11 -21
  35. package/src/components/controls/base/DshSelect.vue +13 -17
  36. package/src/components/controls/controlMap.js +12 -11
  37. package/src/components/controls/controlMixin.js +40 -29
  38. package/src/components/controls/controlShow.vue +44 -0
  39. package/src/components/controls/{base → senior}/BriLabels.vue +7 -12
  40. package/src/components/controls/{base → senior}/DshPackage.vue +6 -25
  41. package/src/components/controls/senior/cascaderTable.vue +52 -51
  42. package/src/components/controls/senior/flatTable.vue +20 -17
  43. package/src/components/controls/{base → special}/DshBack.vue +4 -4
  44. package/src/components/controls/{base → special}/DshUndeveloped.vue +3 -1
  45. package/src/components/form/DshAdvSearchForm.vue +10 -1
  46. package/src/components/form/DshForm.vue +10 -3
  47. package/src/components/list/BriFlatTable.vue +5 -5
  48. package/src/components/list/BriTable.vue +6 -8
  49. package/src/components/list/DshBox/DshBox.vue +7 -24
  50. package/src/components/list/DshBox/DshCard.vue +15 -74
  51. package/src/components/list/DshBox/DshCrossTable.vue +4 -8
  52. package/src/components/list/DshBox/DshList.vue +8 -136
  53. package/src/components/list/DshBox/DshPanel.vue +0 -110
  54. package/src/components/list/DshBox/DshTable.vue +1 -4
  55. package/src/components/list/DshCascaderTable.vue +1 -1
  56. package/src/components/list/ZTree.vue +0 -58
  57. package/src/components/other/ZIframe.vue +5 -0
  58. package/src/components/small/DshControlDefine.vue +6 -2
  59. package/src/components/small/DshModal.vue +0 -134
  60. package/src/components/small/DshPage.vue +1 -0
  61. package/src/components/unit/DshFormItem.vue +7 -10
  62. package/src/components/unit/DshUnit.vue +1 -11
  63. package/src/components/unit/unitMixin.js +8 -5
  64. package/src/index.js +16 -33
  65. package/src/styles/common/control.less +63 -27
  66. package/src/styles/components/controls/{MultipleInput.less → BriInputs.less} +1 -1
  67. package/src/styles/components/controls/BriLabels.less +4 -2
  68. package/src/styles/components/controls/{ZUpload.less → BriUpload.less} +5 -6
  69. package/src/styles/components/controls/DshCheckbox.less +45 -42
  70. package/src/styles/components/controls/DshCoordinates.less +66 -59
  71. package/src/styles/components/controls/DshDate.less +1 -52
  72. package/src/styles/components/controls/DshEditor.less +51 -34
  73. package/src/styles/components/controls/DshInput.less +13 -34
  74. package/src/styles/components/controls/DshNumber.less +51 -0
  75. package/src/styles/components/controls/DshNumberange.less +8 -3
  76. package/src/styles/components/controls/DshSelect.less +78 -92
  77. package/src/styles/components/{other → controls}/InfoCascader.less +4 -4
  78. package/src/styles/components/controls/cascaderTable.less +10 -24
  79. package/src/styles/components/controls/controlShow.less +3 -1
  80. package/src/styles/components/controls/flatTable.less +10 -23
  81. package/src/styles/components/form/DshAdvSearchForm.less +0 -9
  82. package/src/styles/components/form/DshDefaultSearch.less +0 -20
  83. package/src/styles/components/index.less +24 -17
  84. package/src/styles/components/list/DshBox/DshBox.less +20 -0
  85. package/src/styles/components/list/DshBox/DshCard.less +59 -0
  86. package/src/styles/components/list/DshBox/DshList.less +142 -0
  87. package/src/styles/components/list/DshBox/DshPanel.less +107 -0
  88. package/src/styles/components/list/DshBox/DshTable.less +4 -0
  89. package/src/styles/components/list/ZTree.less +52 -0
  90. package/src/styles/components/small/DshControlDefine.less +4 -7
  91. package/src/styles/components/small/DshDropdown.less +1 -0
  92. package/src/styles/components/small/DshModal.less +207 -0
  93. package/src/styles/components/unit/DshFormItem.less +2 -0
  94. package/src/styles/reset.less +14 -0
  95. package/src/styles/variables.less +1 -0
  96. package/src/utils/table.js +5 -4
  97. package/src/components/controls/base/DshLabels.vue +0 -309
  98. package/src/components/controls/base/YSerialNumber.vue +0 -36
  99. package/src/components/controls/base/controlShow.vue +0 -52
  100. package/src/components/list/easyTable/index.js +0 -23
  101. package/src/components/list/easyTable/src/directives/clickoutside.js +0 -32
  102. package/src/components/list/easyTable/src/mixins/layerAdjustment.js +0 -62
  103. package/src/components/list/easyTable/src/settings/settings.js +0 -11
  104. package/src/components/list/easyTable/src/utils/deepClone.js +0 -256
  105. package/src/components/list/easyTable/src/utils/dom.js +0 -41
  106. package/src/components/list/easyTable/src/utils/utils.js +0 -190
  107. package/src/components/list/easyTable/v-checkbox/index.js +0 -7
  108. package/src/components/list/easyTable/v-checkbox/src/checkbox.vue +0 -127
  109. package/src/components/list/easyTable/v-checkbox-group/index.js +0 -7
  110. package/src/components/list/easyTable/v-checkbox-group/src/checkbox-group.vue +0 -68
  111. package/src/components/list/easyTable/v-dropdown/index.js +0 -7
  112. package/src/components/list/easyTable/v-dropdown/src/dropdown.vue +0 -337
  113. package/src/components/list/easyTable/v-table/index.js +0 -7
  114. package/src/components/list/easyTable/v-table/src/body-cell-merge-mixin.js +0 -141
  115. package/src/components/list/easyTable/v-table/src/cell-edit-mixin.js +0 -102
  116. package/src/components/list/easyTable/v-table/src/checkbox-selection-mixin.js +0 -189
  117. package/src/components/list/easyTable/v-table/src/classes-mixin.js +0 -56
  118. package/src/components/list/easyTable/v-table/src/drag-width-mixin.js +0 -202
  119. package/src/components/list/easyTable/v-table/src/export-csv.js +0 -74
  120. package/src/components/list/easyTable/v-table/src/frozen-columns-mixin.js +0 -134
  121. package/src/components/list/easyTable/v-table/src/loading.vue +0 -49
  122. package/src/components/list/easyTable/v-table/src/scroll-bar-control-mixin.js +0 -21
  123. package/src/components/list/easyTable/v-table/src/scroll-control-mixin.js +0 -92
  124. package/src/components/list/easyTable/v-table/src/sort-control-mixin.js +0 -108
  125. package/src/components/list/easyTable/v-table/src/table-empty-mixin.js +0 -73
  126. package/src/components/list/easyTable/v-table/src/table-empty.vue +0 -66
  127. package/src/components/list/easyTable/v-table/src/table-filters-mixin.js +0 -126
  128. package/src/components/list/easyTable/v-table/src/table-footer-mixin.js +0 -122
  129. package/src/components/list/easyTable/v-table/src/table-resize-mixin.js +0 -279
  130. package/src/components/list/easyTable/v-table/src/table-row-mouse-events-mixin.js +0 -123
  131. package/src/components/list/easyTable/v-table/src/table.vue +0 -1565
  132. package/src/components/list/easyTable/v-table/src/title-cell-merge-mixin.js +0 -115
  133. package/src/components/list/evTable/EvTable.vue +0 -321
  134. package/src/components/list/evTable/EvTableMixin.js +0 -26
  135. package/src/styles/components/controls/DshLabels.less +0 -187
  136. package/src/styles/components/list/evTable.less +0 -79
  137. package/src/styles/components/list/evtable/animation.less +0 -141
  138. package/src/styles/components/list/evtable/font/fontello.eot +0 -0
  139. package/src/styles/components/list/evtable/font/fontello.svg +0 -32
  140. package/src/styles/components/list/evtable/font/fontello.ttf +0 -0
  141. package/src/styles/components/list/evtable/font/fontello.woff +0 -0
  142. package/src/styles/components/list/evtable/font/fontello.woff2 +0 -0
  143. package/src/styles/components/list/evtable/fontello.less +0 -68
  144. package/src/styles/components/list/evtable/index.less +0 -5
  145. package/src/styles/components/list/evtable/v-checkbox.less +0 -167
  146. package/src/styles/components/list/evtable/v-dropdown.less +0 -235
  147. package/src/styles/components/list/evtable/v-table.less +0 -334
  148. package/src/styles/components/list/ivu_reset.less +0 -49
  149. /package/src/{styles/components/list → abolish}/DshFlatTable.less +0 -0
  150. /package/src/components/{pages/Error → Error}/Error403.vue +0 -0
  151. /package/src/components/{pages/Error → Error}/Error404.vue +0 -0
  152. /package/src/components/{pages/Error → Error}/Error500.vue +0 -0
  153. /package/src/components/{pages/Error → Error}/error.less +0 -0
  154. /package/src/components/{pages/Error → Error}/errorBack.vue +0 -0
  155. /package/src/components/controls/base/{ZUpload → BriUpload}/upload-listItem.vue +0 -0
  156. /package/src/components/{other → controls/base/DshCascader}/InfoCascader.vue +0 -0
  157. /package/src/styles/components/list/{DshCrossTable.less → DshBox/DshCrossTable.less} +0 -0
  158. /package/src/styles/components/list/{DshSingleData.less → DshBox/DshSingleData.less} +0 -0
@@ -1,134 +0,0 @@
1
- /*
2
- * 固定列
3
- *
4
- * */
5
-
6
- export default {
7
- computed: {
8
- // 冻结的列集合
9
- frozenCols () {
10
- return this.internalColumns.filter(x => x.isFrozen === true);
11
- },
12
- // 冻结的列集合
13
- frozenRightCols () {
14
- return this.internalColumns.filter(x => x.isFrozenRight === true);
15
- },
16
- // 非冻结列集合
17
- noFrozenCols () {
18
- return this.internalColumns.filter(x => x.isFrozen !== true && x.isFrozenRight !== true);
19
- },
20
- // 冻结的表头列集合
21
- frozenTitleCols () {
22
- let frozenTitleCols = [];
23
- let self = this;
24
-
25
- if (this.internalTitleRows.length > 0) {
26
-
27
- // 获取当前锁定的字段集合
28
- let frozenFields = this.frozenCols.map(x => x.field);
29
-
30
- this.internalTitleRows.forEach(function (rows) {
31
-
32
- let frozenTitleRows = rows.filter(function (row) {
33
- if (Array.isArray(row.fields)) {
34
- if (row.fields.every(field => frozenFields.indexOf(field) !== -1)) {
35
- return true;
36
- }
37
- }
38
- });
39
-
40
- if (frozenTitleRows.length > 0) {
41
-
42
- frozenTitleCols.push(frozenTitleRows);
43
-
44
- let minRowspan = self.getMinRowspan(frozenTitleRows);
45
-
46
- if (minRowspan && minRowspan > 0) {
47
-
48
- for (let i = 0; i < minRowspan; i++) {
49
-
50
- frozenTitleCols.push([]);
51
- }
52
- }
53
- }
54
- });
55
- }
56
-
57
- return frozenTitleCols;
58
- },
59
- // 冻结的表头列集合
60
- frozenRightTitleCols () {
61
- let frozenRightTitleCols = [];
62
- let self = this;
63
-
64
- if (this.internalTitleRows.length > 0) {
65
-
66
- // 获取当前锁定的字段集合
67
- let frozenRightFields = this.frozenRightCols.map(x => x.field);
68
-
69
- this.internalTitleRows.forEach(function (rows) {
70
-
71
- let frozenRightTitleRows = rows.filter(function (row) {
72
- if (Array.isArray(row.fields)) {
73
- if (row.fields.every(field => frozenRightFields.indexOf(field) !== -1)) {
74
- return true;
75
- }
76
- }
77
- });
78
-
79
- if (frozenRightTitleRows.length > 0) {
80
-
81
- frozenRightTitleCols.push(frozenRightTitleRows);
82
-
83
- let minRowspan = self.getMinRowspan(frozenRightTitleRows);
84
-
85
- if (minRowspan && minRowspan > 0) {
86
-
87
- for (let i = 0; i < minRowspan; i++) {
88
-
89
- frozenRightTitleCols.push([]);
90
- }
91
- }
92
- }
93
- });
94
- }
95
-
96
- return frozenRightTitleCols;
97
- },
98
- // 未的表头列集合
99
- noFrozenTitleCols () {
100
- let noFrozenTitleCols = [];
101
- let self = this;
102
-
103
- if (this.internalTitleRows.length > 0) {
104
-
105
- // 获取当前未锁定的字段集合
106
- let noFrozenFields = this.noFrozenCols.map(x => x.field);
107
-
108
- this.internalTitleRows.forEach(function (rows) {
109
-
110
- let noFrozenTitleRows = rows.filter(function (row) {
111
- if (Array.isArray(row.fields)) {
112
- return row.fields.every(field => noFrozenFields.indexOf(field) !== -1);
113
- }
114
- });
115
-
116
- if (noFrozenTitleRows.length > 0) {
117
- noFrozenTitleCols.push(noFrozenTitleRows);
118
-
119
- let minRowspan = self.getMinRowspan(noFrozenTitleRows);
120
-
121
- if (minRowspan && minRowspan > 0) {
122
-
123
- for (let i = 0; i < minRowspan; i++) {
124
-
125
- noFrozenTitleCols.push([]);
126
- }
127
- }
128
- }
129
- });
130
- }
131
- return noFrozenTitleCols;
132
- }
133
- }
134
- };
@@ -1,49 +0,0 @@
1
- <template>
2
- <div style="width:100%;height: 100%;">
3
- <div class="v-table-loading" :style="{'opacity':loadingOpacity}"></div>
4
- <div class="v-table-loading-content" v-html="loadingContent"></div>
5
- </div>
6
-
7
- </template>
8
-
9
- <script>
10
- export default{
11
-
12
- props: {
13
-
14
- loadingContent: [String],
15
-
16
- loadingOpacity: [Number],
17
-
18
- titleRows: [Array],
19
-
20
- titleRowHeight: [Number],
21
-
22
- columns: [Array]
23
- },
24
-
25
- methods: {
26
-
27
- setPosition () {
28
-
29
- let loadingEle = this.$el;
30
- let loadingContentEle = this.$el.querySelector(".v-table-loading-content");
31
- let titleHeight = 0;
32
-
33
- if (this.columns && this.columns.length > 0) {
34
-
35
- titleHeight = (this.titleRows && this.titleRows.length > 0) ? this.titleRows.length * this.titleRowHeight : this.titleRowHeight;
36
- }
37
-
38
- loadingContentEle.style.top = ((loadingEle.clientHeight + titleHeight) / 2 - loadingContentEle.clientHeight / 2) + "px";
39
- }
40
- },
41
-
42
- mounted () {
43
-
44
- this.$nextTick(x => {
45
- this.setPosition();
46
- });
47
- }
48
- };
49
- </script>
@@ -1,21 +0,0 @@
1
- import utils from "../../src/utils/utils.js";
2
- export default {
3
- data () {
4
- return {
5
- scrollbarWidth: 0
6
- };
7
- },
8
- methods: {
9
- // 如果存在footer 则横向滚动条体现在footer上
10
- controlScrollBar () {
11
- if (this.hasTableFooter) {
12
- let body = this.$el.querySelector(".v-table-centerview .v-table-body");
13
- body.style.overflowX = "hidden";
14
- }
15
- },
16
- setScrollbarWidth () {
17
- this.scrollbarWidth = utils.getScrollbarWidth();
18
- }
19
- }
20
-
21
- };
@@ -1,92 +0,0 @@
1
- /*
2
- * 鼠标滚动,滚动条改变
3
- * */
4
- import utils from "../../src/utils/utils.js";
5
- export default {
6
- methods: {
7
- body0Mousewheel (e) {
8
- let body2 = this.$el.querySelector(".v-table-centerview .v-table-body");
9
- let e1 = e.originalEvent || window.event || e;
10
- let scrollHeight = e1.wheelDelta || e1.detail * (-1);
11
- body2.scrollTop = (body2.scrollTop - scrollHeight);
12
- },
13
-
14
- // 表格内容滚动到顶部(常用与分页)
15
- bodyScrollTop () {
16
- let body0 = this.$el.querySelector(".v-table-rightview .v-table-body");
17
- let body1 = this.$el.querySelector(".v-table-leftview .v-table-body");
18
- let body2 = this.$el.querySelector(".v-table-centerview .v-table-body");
19
-
20
- if (body0) {
21
- body0.scrollTop = 0;
22
- }
23
- if (body1) {
24
- body1.scrollTop = 0;
25
- }
26
- body2.scrollTop = 0;
27
- },
28
-
29
- body2Scroll (e) {
30
- let view2 = this.$el.querySelector(".v-table-centerview");
31
- let body0 = this.$el.querySelector(".v-table-rightview .v-table-body");
32
- let body1 = this.$el.querySelector(".v-table-leftview .v-table-body");
33
- let body2 = this.$el.querySelector(".v-table-centerview .v-table-body");
34
- if (body1) {
35
- body1.scrollTop = body2.scrollTop;
36
- }
37
- if (body0) {
38
- body0.scrollTop = body2.scrollTop;
39
- }
40
-
41
- view2.querySelector(".v-table-header").scrollLeft = body2.scrollLeft;
42
- },
43
-
44
- centerViewFooterScroll () {
45
- let view2 = this.$el.querySelector(".v-table-centerview");
46
- let centerViewFooter = this.$el.querySelector(".v-table-centerview .v-table-footer");
47
-
48
- view2.querySelector(".v-table-header").scrollLeft = centerViewFooter.scrollLeft;
49
- view2.querySelector(".v-table-body").scrollLeft = centerViewFooter.scrollLeft;
50
-
51
- },
52
-
53
- // 列表中滚动条控制
54
- scrollControl () {
55
- this.unbindEvents();
56
- // 修复左侧固定列绑定滚动事件失效的问题
57
- setTimeout(x => {
58
- let body0 = this.$el.querySelector(".v-table-rightview .v-table-body");
59
- let body1 = this.$el.querySelector(".v-table-leftview .v-table-body");
60
- let body2 = this.$el.querySelector(".v-table-centerview .v-table-body");
61
- let centerViewFooter = this.$el.querySelector(".v-table-centerview .v-table-footer");
62
-
63
- utils.bind(body0, "mousewheel", this.body0Mousewheel);
64
- utils.bind(body1, "mousewheel", this.body0Mousewheel);
65
- utils.bind(body2, "scroll", this.body2Scroll);
66
- utils.bind(centerViewFooter, "scroll", this.centerViewFooterScroll);
67
- });
68
- },
69
-
70
- unbindEvents () {
71
- let body0 = this.$el.querySelector(".v-table-rightview .v-table-body");
72
- let body1 = this.$el.querySelector(".v-table-leftview .v-table-body");
73
- let body2 = this.$el.querySelector(".v-table-centerview .v-table-body");
74
- let centerViewFooter = this.$el.querySelector(".v-table-centerview .v-table-footer");
75
-
76
- utils.unbind(body0, "mousewheel", this.body0Mousewheel);
77
- utils.unbind(body1, "mousewheel", this.body1Mousewheel);
78
- utils.unbind(body2, "scroll", this.body2Scroll);
79
- utils.unbind(centerViewFooter, "scroll", this.centerViewFooterScroll);
80
- },
81
-
82
- // 对外暴露的方法
83
- scrollToTop () {
84
- this.bodyScrollTop();
85
- }
86
- },
87
-
88
- beforeDestroy () {
89
-
90
- this.unbindEvents();
91
- }
92
- };
@@ -1,108 +0,0 @@
1
- /*
2
- * 排序
3
- * */
4
- export default {
5
-
6
- data () {
7
-
8
- return {
9
- sortColumns: {}
10
- };
11
- },
12
-
13
- methods: {
14
- // 是否允许排序
15
- enableSort (val) {
16
- return this.showSort && typeof val === "string";
17
- },
18
- // 允许排序的列集合
19
- setSortColumns () {
20
- let titleRowsToSortInfo = [];
21
- this.sortColumns = {};
22
-
23
- if (this.internalTitleRows.length > 0) {
24
- this.internalTitleRows.filter((row) => {
25
- row.filter((column, index) => {
26
- if (typeof column.orderBy === "string" && column.fields.length === 1) {
27
- column.field = column.fields[0];
28
- titleRowsToSortInfo.push(column);
29
- }
30
- });
31
- });
32
- }
33
-
34
- let collection = titleRowsToSortInfo.length > 0 ? titleRowsToSortInfo : this.internalColumns;
35
-
36
- collection.forEach(item => {
37
- if (this.enableSort(item.orderBy)) {
38
- this.sortColumns[item.field] = item.orderBy;
39
- }
40
- });
41
-
42
- // this.singleSortInit();
43
- },
44
-
45
- // 获取当前排序规则
46
- getCurrentSort (field) {
47
-
48
- return this.sortColumns[field];
49
- },
50
-
51
- // 排序控制
52
- sortControl (field) {
53
-
54
- let orderBy = this.sortColumns[field];
55
- if (this.enableSort(orderBy)) {
56
-
57
- if (this.sortAlways) {
58
- this.sortColumns[field] = orderBy === "asc" ? "desc" : "asc";
59
- } else {
60
- this.sortColumns[field] = orderBy === "asc" ? "desc"
61
- : (this.sortColumns[field] === "desc" ? "" : "asc");
62
- }
63
-
64
- if (!this.multipleSort) {
65
-
66
- for (let col in this.sortColumns) {
67
-
68
- if (col !== field) {
69
-
70
- this.sortColumns[col] = "";
71
- }
72
- }
73
- }
74
- this.$emit("sort-change", {
75
- field: field,
76
- sortType: this.sortColumns[field]
77
- });
78
- }
79
-
80
- },
81
-
82
- // 单排时只允许保留第一个排序规则(‘asc’或者‘desc’)
83
- singleSortInit () {
84
-
85
- let result = false;
86
-
87
- if (!this.multipleSort && this.sortColumns) {
88
-
89
- for (let col in this.sortColumns) {
90
-
91
- if (result) {
92
-
93
- this.sortColumns[col] = "";
94
- }
95
- result = true;
96
- }
97
- }
98
- },
99
-
100
- // 对外暴露的方法(重置排序规则)
101
- resetOrder () {
102
-
103
- this.setSortColumns();
104
-
105
- this.$emit("sort-change", this.sortColumns);
106
- }
107
- }
108
- };
@@ -1,73 +0,0 @@
1
- // 表格数据为空时的处理逻辑
2
- import utils from "../../src/utils/utils.js";
3
- export default {
4
-
5
- data () {
6
- return {
7
-
8
- isTableEmpty: false,
9
-
10
- // 表格数据为空时表头的高度(若有滚动条会包含滚动条的宽度)
11
- // tableEmptyContentHeight: 50,
12
-
13
- // 表格数据为空时的总高度
14
- tableEmptyHeight: 0
15
- };
16
- },
17
-
18
- methods: {
19
-
20
- // table 数据为空的处理
21
- tableEmpty () {
22
-
23
- let tableData = this.internalTableData;
24
- let tableEmptyHeight = 0;
25
-
26
- if (Array.isArray(tableData) && tableData.length > 0) {
27
-
28
- this.isTableEmpty = false;
29
- return false;
30
- }
31
-
32
- this.isTableEmpty = true;
33
-
34
- tableEmptyHeight = this.getTotalColumnsHeight() + this.errorContentHeight;
35
-
36
- this.tableEmptyHeight = tableEmptyHeight;
37
-
38
- this.$nextTick(x => {
39
-
40
- this.tableEmptyScroll();
41
- });
42
-
43
- },
44
-
45
- tableEmptyScrollEvent (e) {
46
-
47
- let headerEle = this.$el.querySelector(".v-table-centerview .v-table-header");
48
- let tableEmptyEle = this.$el.querySelector(".v-table-empty .v-table-empty-scroll");
49
-
50
- if (headerEle && tableEmptyEle) {
51
-
52
- headerEle.scrollLeft = tableEmptyEle.scrollLeft;
53
- }
54
-
55
- },
56
-
57
- // 无数据时的滚动条控制
58
- tableEmptyScroll () {
59
-
60
- let tableEmptyEle = this.$el.querySelector(".v-table-empty .v-table-empty-scroll");
61
- // 无数据时的滚动条控制
62
- utils.bind(tableEmptyEle, "scroll", this.tableEmptyScrollEvent);
63
- }
64
-
65
- },
66
-
67
- beforeDestroy () {
68
-
69
- let tableEmptyEle = this.$el.querySelector(".v-table-empty .v-table-empty-scroll");
70
- // 无数据时的滚动条控制
71
- utils.unbind(tableEmptyEle, "scroll", this.tableEmptyScrollEvent);
72
- }
73
- };
@@ -1,66 +0,0 @@
1
- <template>
2
-
3
- <div class="v-table-empty">
4
- <!--表格无数据的提示信息-->
5
- <div class="v-table-empty-content"
6
- :style="{'height':contentHeight+'px','width':width+'px','top':titleHeight+'px'}">
7
- <div class="v-table-empty-inner"
8
- :style="{'height':contentHeight+'px','width':'100%','line-height':contentHeight+'px'}"
9
- v-html="getCurrentContent"></div>
10
- </div>
11
-
12
- <!--表格无数据的滚动条-->
13
- <div class="v-table-empty-scroll"
14
- :style="{'height':contentHeight+'px','width':width+'px','top':titleHeight+'px'}">
15
- <div class="v-table-empty-inner" :style="{'height':'1px','width':totalColumnsWidth+'px'}"></div>
16
- </div>
17
-
18
- </div>
19
-
20
- </template>
21
-
22
- <script>
23
- // import utils from "../../src/utils/utils.js";
24
-
25
- export default{
26
-
27
- props: {
28
-
29
- // 表头的宽度
30
- titleHeight: [Number, String],
31
-
32
- // 内容显示的高度
33
- contentHeight: [Number, String],
34
-
35
- // 显示的宽度
36
- width: [Number, String],
37
-
38
- // 所有列的宽度和
39
- totalColumnsWidth: [Number, String],
40
-
41
- // 没数据时显示的内容
42
- errorContent: {
43
- type: [String]
44
- },
45
-
46
- // 是否正在加载
47
- isLoading: [Boolean]
48
-
49
- },
50
-
51
- computed: {
52
- // 获取当前要显示的内容
53
- getCurrentContent () {
54
-
55
- let result = "";
56
-
57
- if (!this.isLoading) {
58
- result = this.errorContent;
59
- }
60
-
61
- return result;
62
- }
63
-
64
- }
65
- };
66
- </script>
@@ -1,126 +0,0 @@
1
- export default {
2
- data () {
3
-
4
- return {
5
-
6
- filterSpecialValue: "__all__"
7
- };
8
- },
9
- methods: {
10
-
11
- // 初始化 columns filters
12
- initColumnsFilters () {
13
-
14
- // 如果是复杂表头
15
- if (this.isComplexTitle) {
16
-
17
- this.internalTitleRows.forEach(rows => {
18
-
19
- rows.forEach(col => {
20
-
21
- if (this.enableFilters(col.filters, col.fields) && !col.filterMultiple) {
22
-
23
- col.filters.unshift({label: "全部", value: this.filterSpecialValue, selected: true});
24
- }
25
- });
26
- });
27
- } else {
28
-
29
- this.internalColumns.map(col => {
30
-
31
- if (this.enableFilters(col.filters) && !col.filterMultiple) {
32
-
33
- col.filters.unshift({label: "全部", value: this.filterSpecialValue, selected: true});
34
- }
35
- });
36
- }
37
- },
38
-
39
- // 单选条件改变
40
- filterConditionChange (filterMultiple) {
41
-
42
- // 单选
43
- if (!filterMultiple) {
44
-
45
- this.filterSummary();
46
- }
47
- },
48
-
49
- /*
50
- * 是否包含 filters 功能
51
- * fields : 当是复杂表头时,必须保证不是 colspan 的列
52
- * */
53
- enableFilters (filters, fields) {
54
-
55
- let result = false;
56
-
57
- if (Array.isArray(fields) && fields.length > 1) {
58
-
59
- result = false;
60
- }
61
- if (Array.isArray(filters) && filters.length > 0) {
62
-
63
- result = true;
64
- }
65
- return result;
66
- },
67
-
68
- filterEvent () {
69
-
70
- this.filterSummary();
71
- },
72
-
73
- filterSummary () {
74
-
75
- let result = {};
76
- let columns = [];
77
- let tempArr = [];
78
-
79
- // 复杂表头
80
- if (this.isComplexTitle) {
81
-
82
- columns = this.internalTitleRows;
83
-
84
- columns.forEach(rows => {
85
-
86
- rows.forEach(col => {
87
-
88
- tempArr = [];
89
- if (this.enableFilters(col.filters, col.fields)) {
90
-
91
- col.filters.forEach(f => {
92
-
93
- if (f.selected && f.value !== this.filterSpecialValue) {
94
- tempArr.push(f.value);
95
- }
96
- });
97
-
98
- result[col.fields[0]] = tempArr.length > 0 ? tempArr : null;
99
- }
100
- });
101
- });
102
- } else {
103
-
104
- columns = this.internalColumns;
105
-
106
- columns.forEach(col => {
107
-
108
- tempArr = [];
109
- if (this.enableFilters(col.filters)) {
110
-
111
- col.filters.forEach(f => {
112
-
113
- if (f.selected && f.value !== this.filterSpecialValue) {
114
- tempArr.push(f.value);
115
- }
116
- });
117
-
118
- result[col.field] = tempArr.length > 0 ? tempArr : null;
119
- }
120
- });
121
- }
122
-
123
- this.filterMethod && this.filterMethod(result);
124
- }
125
- }
126
- };