bri-components 1.4.61 → 1.4.62

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": "bri-components",
3
- "version": "1.4.61",
3
+ "version": "1.4.62",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -55,7 +55,7 @@ export default {
55
55
  return this.selfPropsObj._selectFilterVals || []; // 老版级联表格层级属性那用到单选,缺这些属性,会产生undefined,有问题
56
56
  },
57
57
  selectFilterKey () {
58
- return this.selfPropsObj._selectFilterKey;
58
+ return this.selfPropsObj._selectFilterKey || this.saveKey;
59
59
  },
60
60
 
61
61
  listData () {
@@ -63,8 +63,8 @@ export default {
63
63
  listData = this.selectFilterVals.length
64
64
  ? listData.filter(item =>
65
65
  this.reverseFilter
66
- ? !this.selectFilterVals.includes(item[this.selectFilterKey || this.saveKey])
67
- : this.selectFilterVals.includes(item[this.selectFilterKey || this.saveKey])
66
+ ? !this.selectFilterVals.includes(item[this.selectFilterKey])
67
+ : this.selectFilterVals.includes(item[this.selectFilterKey])
68
68
  )
69
69
  : listData;
70
70
  listData = this.$dataType(this.selfPropsObj._filterFunc, "function")
@@ -53,8 +53,9 @@
53
53
  <template v-else>
54
54
  <bri-table
55
55
  class="DshFlatTable-main"
56
+ :isLoading="isLoading"
56
57
  :columns="showColumns"
57
- :data="selfShowListData"
58
+ :data="isLoading ? [] : selfShowListData"
58
59
  :footer-data="footerData"
59
60
  :propsObj="tablePropsObj"
60
61
  @changeSelect="changeSelect"
@@ -161,8 +162,9 @@
161
162
  <template v-else>
162
163
  <bri-table
163
164
  class="DshFlatTable-fullscreen-inner-main"
165
+ :isLoading="isLoading"
164
166
  :columns="showColumns"
165
- :data="selfShowListData"
167
+ :data="isLoading ? [] : selfShowListData"
166
168
  :footer-data="footerData"
167
169
  :propsObj="tableInModalPropsObj"
168
170
  @changeSelect="changeSelect"
@@ -11,26 +11,37 @@
11
11
 
12
12
  <!-- 表格 -->
13
13
  <bri-table
14
+ class="DshTreeTable-main"
15
+ :isLoading="isLoading"
16
+ :columns="showColumns"
17
+ :data="isLoading ? [] : showListData"
18
+ :footer-data="footerData"
19
+ :propsObj="tablePropsObj"
20
+ @changeSelect="changeSelect"
21
+ @selectAll="changeSelect"
22
+ ></bri-table>
23
+ <!-- <bri-table
14
24
  v-show="showListData.length"
15
- ref="briTable"
16
25
  class="DshTreeTable-main"
26
+ :isLoading="isLoading"
17
27
  :columns="showColumns"
18
- :data="renderedListData"
28
+ :data="isLoading ? [] : renderedListData"
19
29
  :footer-data="footerData"
20
30
  :propsObj="tablePropsObj"
21
31
  @changeSelect="changeSelect"
22
32
  @selectAll="changeSelect"
23
33
  ></bri-table>
24
34
  <bri-table
25
- v-show="!showListData.length"
35
+ v-if="!showListData.length"
26
36
  class="DshTreeTable-main"
37
+ :isLoading="isLoading"
27
38
  :columns="showColumns"
28
- :data="showListData"
39
+ :data="[]"
29
40
  :footer-data="footerData"
30
41
  :propsObj="tablePropsObj"
31
42
  @changeSelect="changeSelect"
32
43
  @selectAll="changeSelect"
33
- ></bri-table>
44
+ ></bri-table> -->
34
45
 
35
46
  <!-- 添加行 -->
36
47
  <dsh-render :render="createBtnRender"></dsh-render>
@@ -58,20 +69,10 @@
58
69
 
59
70
  <!-- 表格 -->
60
71
  <bri-table
61
- v-show="showListData.length"
62
- class="DshTreeTable-fullscreen-inner-main"
63
- :columns="showColumns"
64
- :data="renderedListData"
65
- :footer-data="footerData"
66
- :propsObj="tableInModalPropsObj"
67
- @changeSelect="changeSelect"
68
- @selectAll="changeSelect"
69
- ></bri-table>
70
- <bri-table
71
- v-show="!showListData.length"
72
72
  class="DshTreeTable-fullscreen-inner-main"
73
+ :isLoading="isLoading"
73
74
  :columns="showColumns"
74
- :data="showListData"
75
+ :data="isLoading ? [] : showListData"
75
76
  :footer-data="footerData"
76
77
  :propsObj="tableInModalPropsObj"
77
78
  @changeSelect="changeSelect"
@@ -130,46 +130,48 @@ export default {
130
130
  return h("div", {
131
131
  class: "DshCasTable-main-center-list"
132
132
  }, [
133
- h("div", {
134
- class: "DshCasTable-main-center-list-inner"
135
- }, [
136
- h("table", {
137
- class: "table",
138
- attrs: {
139
- border: "1",
140
- cellspacin: "0",
141
- bordercolor: "#E7EDF8"
142
- }
133
+ this.isLoading
134
+ ? h("bri-loading")
135
+ : h("div", {
136
+ class: "DshCasTable-main-center-list-inner"
143
137
  }, [
144
- h("tbody", {
145
- class: ""
138
+ h("table", {
139
+ class: "table",
140
+ attrs: {
141
+ border: "1",
142
+ cellspacin: "0",
143
+ bordercolor: "#E7EDF8"
144
+ }
146
145
  }, [
147
- this.showListData.length
148
- ? this.showListData.map((mixedRow, rowIndex) => {
149
- return h(
146
+ h("tbody", {
147
+ class: ""
148
+ }, [
149
+ this.showListData.length
150
+ ? this.showListData.map((mixedRow, rowIndex) => {
151
+ return h(
152
+ "tr",
153
+ {
154
+ key: mixedRow._id,
155
+ class: ""
156
+ },
157
+ this.rowColumnsArr[rowIndex].map(column => {
158
+ return this.tdRender(h, { row: mixedRow[column.nodeKey || column._key], rowIndex, column });
159
+ })
160
+ );
161
+ })
162
+ // 无数据
163
+ : h(
150
164
  "tr",
151
165
  {
152
- key: mixedRow._id,
153
- class: ""
166
+ class: "bri-table-nodata"
154
167
  },
155
- this.rowColumnsArr[rowIndex].map(column => {
156
- return this.tdRender(h, { row: mixedRow[column.nodeKey || column._key], rowIndex, column });
157
- })
158
- );
159
- })
160
- // 无数据
161
- : h(
162
- "tr",
163
- {
164
- class: "bri-table-nodata"
165
- },
166
- [
167
- this.emptyTdRender(h, {})
168
- ]
169
- )
168
+ [
169
+ this.emptyTdRender(h, {})
170
+ ]
171
+ )
172
+ ])
170
173
  ])
171
174
  ])
172
- ])
173
175
  ]);
174
176
  },
175
177
  // 表头单元格渲染函数 (无法共用contentColumns的renderHeaderCell,因为级联老版表头的无renderHeaderCell)
@@ -256,18 +256,26 @@ export default {
256
256
  if (this.isUseDescSort) {
257
257
  if (row) {
258
258
  list.splice(newRowIndex - 1, 0, newRow);
259
- rowIndex + 1 === this.pagePropsObj.pagesize && this.changePage(this.pagePropsObj.page + 1);
259
+ if (rowIndex + 1 === this.pagePropsObj.pagesize) {
260
+ this.changePage(this.pagePropsObj.page + 1); // 一定翻页了
261
+ }
260
262
  } else {
261
263
  list.splice(newRowIndex, 0, newRow);
262
- this.changePage(1);
264
+ if (this.pagePropsObj.page !== 1) {
265
+ this.changePage(1);
266
+ }
263
267
  }
264
268
  } else {
265
269
  if (row) {
266
270
  list.splice(newRowIndex, 0, newRow);
267
- rowIndex + 1 === this.pagePropsObj.pagesize && this.changePage(this.pagePropsObj.page + 1);
271
+ if (rowIndex + 1 === this.pagePropsObj.pagesize) {
272
+ this.changePage(this.pagePropsObj.page + 1); // 一定翻页了
273
+ }
268
274
  } else {
269
275
  list.splice(newRowIndex, 0, newRow);
270
- this.changePage(this.PageNum);
276
+ if (this.pagePropsObj.page !== this.PageNum) {
277
+ this.changePage(this.PageNum);
278
+ }
271
279
  }
272
280
  }
273
281
  }
@@ -95,6 +95,7 @@ export default {
95
95
  conditions: []
96
96
  },
97
97
 
98
+ isLoading: false,
98
99
  isUseDescSort: false,
99
100
  pageMode: "small",
100
101
  pagePropsObj: {
@@ -424,7 +425,9 @@ export default {
424
425
  },
425
426
  // 是否搜索状态
426
427
  isSearching () {
427
- return this.$isAdvSearching(this.finalTableAdvSearch);
428
+ return this.parentObj.__isCreate__ === true
429
+ ? false
430
+ : this.$isAdvSearching(this.finalTableAdvSearch);
428
431
  },
429
432
  searchTitle () {
430
433
  return `${this.isSearching ? "筛选" : "全部"}数据;`;
@@ -474,10 +477,12 @@ export default {
474
477
  },
475
478
  // 全部数据 或 筛选时符合条件的数据 -当前页的
476
479
  curPageShowListData () {
477
- return this.showListData.slice(
478
- (this.pagePropsObj.page - 1) * this.pagePropsObj.pagesize,
479
- this.pagePropsObj.page * this.pagePropsObj.pagesize
480
- );
480
+ return this.pagePropsObj.page >= 1
481
+ ? this.showListData.slice(
482
+ (this.pagePropsObj.page - 1) * this.pagePropsObj.pagesize,
483
+ this.pagePropsObj.page * this.pagePropsObj.pagesize
484
+ )
485
+ : [];
481
486
  },
482
487
  // 全部数据 或 筛选时符合条件的数据 -总数
483
488
  total () {
@@ -584,6 +589,7 @@ export default {
584
589
 
585
590
  tablePropsObj () {
586
591
  return {
592
+ // isLoading: false,
587
593
  // rowStyleOption: {
588
594
  // hoverHighlight: true,
589
595
  // clickHighlight: true,
@@ -802,7 +808,10 @@ export default {
802
808
  this.searchListFields.includes(conditionItem.fieldKey)
803
809
  )
804
810
  };
811
+
812
+ this.loadingFunc();
805
813
  },
814
+
806
815
  // 重置
807
816
  reset () {
808
817
  this.initFlag = true;
@@ -813,12 +822,12 @@ export default {
813
822
  this.hoverRecordMap = {};
814
823
  this.ruleRecordMap = {};
815
824
 
816
- this.changePage(1);
817
825
  this.dftAdvSearch = {
818
826
  logic: "and",
819
827
  conditions: []
820
828
  };
821
829
  this.hideStatus = true;
830
+ this.changePage(1);
822
831
 
823
832
  this.selfReset && this.selfReset();
824
833
  },
@@ -831,9 +840,11 @@ export default {
831
840
 
832
841
  // 筛选回调
833
842
  searchCb (conditions) {
834
- this.isExpandAction = false;
835
- this.dftAdvSearch.conditions = conditions;
836
- this.changePage(1);
843
+ if (this.parentObj.__isCreate__ !== true) {
844
+ this.isExpandAction = false;
845
+ this.dftAdvSearch.conditions = conditions;
846
+ this.changePage(1);
847
+ }
837
848
  },
838
849
  // 列表选择项改变
839
850
  changeSelect (list) {
@@ -847,12 +858,19 @@ export default {
847
858
  // 切换分页
848
859
  changePage (page) {
849
860
  this.pagePropsObj.page = page;
861
+ this.loadingFunc();
850
862
  },
851
863
  // 切换分页条数
852
864
  changePageSize (pagesize) {
853
865
  this.pagePropsObj.page = 1;
854
866
  this.pagePropsObj.pagesize = pagesize;
855
867
  },
868
+ loadingFunc () {
869
+ this.isLoading = true;
870
+ setTimeout(() => {
871
+ this.isLoading = false;
872
+ });
873
+ },
856
874
 
857
875
  // 输入框失去焦点
858
876
  controlBlur (operationItem, row, rowIndex, column, params) {
@@ -1576,7 +1594,7 @@ export default {
1576
1594
  row._id = this.$ObjectID().str;
1577
1595
  }
1578
1596
 
1579
- row.__old__ = this.isDftSet ? false : !this.parentObj.__isCreate__; // 标记老数据
1597
+ row.__old__ = this.isDftSet ? false : this.parentObj.__isCreate__ !== true; // 标记老数据
1580
1598
  row.__isDefault__ = this.isDftSet ? true : !!row.__isDefault__; // 标记默认数据(配置端默认值)
1581
1599
 
1582
1600
  // 初次进来 把关于展示的状态值全部清除
@@ -113,12 +113,12 @@
113
113
  <style lang="less" scoped>
114
114
  .BriLoading {
115
115
  &-fix {
116
+ width: 100%;
117
+ height: 100%;
116
118
  position: absolute;
117
119
  top: 0;
118
120
  left: 0;
119
121
  z-index: 8;
120
- width: 100%;
121
- height: 100%;
122
122
 
123
123
  .BriLoading-main {
124
124
  position: absolute;
package/src/index.js CHANGED
@@ -13,10 +13,6 @@ import DshBox from "./components/list/DshBox/DshBox.vue";
13
13
  import DshList from "./components/list/DshBox/DshList.vue";
14
14
  import DshTable from "./components/list/DshBox/DshTable.vue";
15
15
  import DshPage from "./components/list/DshPage.vue";
16
- import DshCrossTable from "./components/list/DshBox/DshCrossTable.vue";
17
- import DshFlatTable from "./components/list/DshFlatTable.vue";
18
- // import DshCascaderTable from "./components/list/DshCascaderTable.vue";
19
- // import DshTreeTable from "./components/list/DshTreeTable.vue";
20
16
 
21
17
  // form
22
18
  import DshForm from "./components/form/DshForm.vue";
@@ -63,6 +59,10 @@ import Error403 from "./components/Error/Error403.vue";
63
59
  import Error404 from "./components/Error/Error404.vue";
64
60
 
65
61
  // list
62
+ import DshCrossTable from "./components/list/DshBox/DshCrossTable.vue";
63
+ import DshFlatTable from "./components/list/DshFlatTable.vue";
64
+ // import DshCascaderTable from "./components/list/DshCascaderTable.vue";
65
+ // import DshTreeTable from "./components/list/DshTreeTable.vue";
66
66
  import BriCard from "./components/list/BriCard.vue";
67
67
  import BriTree from "./components/list/BriTree.vue";
68
68
  import BriTreeItem from "./components/list/BriTreeItem.vue";