bri-components 1.4.60 → 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.60",
3
+ "version": "1.4.62",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -20,16 +20,6 @@
20
20
 
21
21
  <!-- 日期、日期时间、年、月 -->
22
22
  <template v-else>
23
- <!-- <DatePicker
24
- class="DshDate-edit"
25
- v-model="curVal"
26
- :type="subType"
27
- :placeholder="selfPropsObj._placeholder"
28
- :disabled="disabled"
29
- :clearable="clearable"
30
- :options="options"
31
- :transfer="selfPropsObj._transfer"
32
- ></DatePicker> -->
33
23
  <DatePicker
34
24
  class="DshDate-edit"
35
25
  :model-value="curVal"
@@ -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: {
@@ -234,6 +235,9 @@ export default {
234
235
  allScreenKey () {
235
236
  return this.propsObj.allScreenKey;
236
237
  },
238
+ flowInstId () {
239
+ return this.propsObj.flowInstId;
240
+ },
237
241
 
238
242
  commonPropsObj () {
239
243
  return {
@@ -421,7 +425,9 @@ export default {
421
425
  },
422
426
  // 是否搜索状态
423
427
  isSearching () {
424
- return this.$isAdvSearching(this.finalTableAdvSearch);
428
+ return this.parentObj.__isCreate__ === true
429
+ ? false
430
+ : this.$isAdvSearching(this.finalTableAdvSearch);
425
431
  },
426
432
  searchTitle () {
427
433
  return `${this.isSearching ? "筛选" : "全部"}数据;`;
@@ -471,10 +477,12 @@ export default {
471
477
  },
472
478
  // 全部数据 或 筛选时符合条件的数据 -当前页的
473
479
  curPageShowListData () {
474
- return this.showListData.slice(
475
- (this.pagePropsObj.page - 1) * this.pagePropsObj.pagesize,
476
- this.pagePropsObj.page * this.pagePropsObj.pagesize
477
- );
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
+ : [];
478
486
  },
479
487
  // 全部数据 或 筛选时符合条件的数据 -总数
480
488
  total () {
@@ -581,6 +589,7 @@ export default {
581
589
 
582
590
  tablePropsObj () {
583
591
  return {
592
+ // isLoading: false,
584
593
  // rowStyleOption: {
585
594
  // hoverHighlight: true,
586
595
  // clickHighlight: true,
@@ -689,6 +698,7 @@ export default {
689
698
  screenKey: this.screenKey,
690
699
  _id: this.parentDataId,
691
700
  _key: this.controlKey,
701
+ flowinst: this.flowInstId,
692
702
  advSearch: this.finalTableAdvSearch
693
703
  };
694
704
  },
@@ -798,7 +808,10 @@ export default {
798
808
  this.searchListFields.includes(conditionItem.fieldKey)
799
809
  )
800
810
  };
811
+
812
+ this.loadingFunc();
801
813
  },
814
+
802
815
  // 重置
803
816
  reset () {
804
817
  this.initFlag = true;
@@ -809,12 +822,12 @@ export default {
809
822
  this.hoverRecordMap = {};
810
823
  this.ruleRecordMap = {};
811
824
 
812
- this.changePage(1);
813
825
  this.dftAdvSearch = {
814
826
  logic: "and",
815
827
  conditions: []
816
828
  };
817
829
  this.hideStatus = true;
830
+ this.changePage(1);
818
831
 
819
832
  this.selfReset && this.selfReset();
820
833
  },
@@ -827,9 +840,11 @@ export default {
827
840
 
828
841
  // 筛选回调
829
842
  searchCb (conditions) {
830
- this.isExpandAction = false;
831
- this.dftAdvSearch.conditions = conditions;
832
- this.changePage(1);
843
+ if (this.parentObj.__isCreate__ !== true) {
844
+ this.isExpandAction = false;
845
+ this.dftAdvSearch.conditions = conditions;
846
+ this.changePage(1);
847
+ }
833
848
  },
834
849
  // 列表选择项改变
835
850
  changeSelect (list) {
@@ -843,12 +858,19 @@ export default {
843
858
  // 切换分页
844
859
  changePage (page) {
845
860
  this.pagePropsObj.page = page;
861
+ this.loadingFunc();
846
862
  },
847
863
  // 切换分页条数
848
864
  changePageSize (pagesize) {
849
865
  this.pagePropsObj.page = 1;
850
866
  this.pagePropsObj.pagesize = pagesize;
851
867
  },
868
+ loadingFunc () {
869
+ this.isLoading = true;
870
+ setTimeout(() => {
871
+ this.isLoading = false;
872
+ });
873
+ },
852
874
 
853
875
  // 输入框失去焦点
854
876
  controlBlur (operationItem, row, rowIndex, column, params) {
@@ -1572,7 +1594,7 @@ export default {
1572
1594
  row._id = this.$ObjectID().str;
1573
1595
  }
1574
1596
 
1575
- row.__old__ = this.isDftSet ? false : !this.parentObj.__isCreate__; // 标记老数据
1597
+ row.__old__ = this.isDftSet ? false : this.parentObj.__isCreate__ !== true; // 标记老数据
1576
1598
  row.__isDefault__ = this.isDftSet ? true : !!row.__isDefault__; // 标记默认数据(配置端默认值)
1577
1599
 
1578
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";