bri-components 1.5.10 → 1.5.11

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.5.10",
3
+ "version": "1.5.11",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -57,6 +57,7 @@
57
57
  <input
58
58
  id="fileupload"
59
59
  class="file"
60
+ :accept="acceptType"
60
61
  :type="inputType"
61
62
  @change="setImage"
62
63
  />
@@ -155,6 +156,9 @@
155
156
  },
156
157
  finalRequestOssType () {
157
158
  return this.propsObj._requestOssType || this.requestOssType || "default";
159
+ },
160
+ acceptType () {
161
+ return this.propsObj._acceptType || "*";
158
162
  }
159
163
  },
160
164
  created () {
@@ -74,12 +74,12 @@
74
74
  >
75
75
  <dsh-page
76
76
  :mode="pageMode"
77
- :total="selfTotal"
77
+ :total="totalNum"
78
78
  :propsObj="pagePropsObj"
79
79
  @changePage="changePage"
80
80
  @changePageSize="changePageSize"
81
81
  >
82
- 共 {{ selfTotal }} 条
82
+ 共 {{ totalNum }} 条
83
83
 
84
84
  <span
85
85
  class="DshFlatTable-sort"
@@ -183,12 +183,12 @@
183
183
  >
184
184
  <dsh-page
185
185
  :mode="pageMode"
186
- :total="selfTotal"
186
+ :total="totalNum"
187
187
  :propsObj="pagePropsObj"
188
188
  @changePage="changePage"
189
189
  @changePageSize="changePageSize"
190
190
  >
191
- 共 {{ selfTotal }} 条
191
+ 共 {{ totalNum }} 条
192
192
 
193
193
  <span
194
194
  class="DshFlatTable-sort"
@@ -35,7 +35,7 @@ export default {
35
35
  },
36
36
  // 替换tableBaseMixin里的
37
37
  searchTitle () {
38
- return `${this.isSearching ? "筛选" : "全部"}数据,共 ${this.selfTotal} 条;`;
38
+ return `${this.isSearching ? "筛选" : "全部"}数据,共 ${this.totalNum} 条;`;
39
39
  },
40
40
 
41
41
  /* --- 列字段 --- */
@@ -60,7 +60,7 @@ export default {
60
60
  },
61
61
  // 替换tableBaseMixin里的
62
62
  searchTitle () {
63
- return `${this.isSearching ? "筛选" : "全部"}数据${this.isMergeRowTable ? `,共 ${this.selfTotal}条;` : ";"}`;
63
+ return `${this.isSearching ? "筛选" : "全部"}数据${this.isMergeRowTable ? `,共 ${this.totalNum}条;` : ";"}`;
64
64
  },
65
65
 
66
66
  /* --- 列字段 --- */
@@ -168,17 +168,17 @@ export default {
168
168
  const pagesize = this.pagePropsObj.pagesize;
169
169
 
170
170
  return page >= 1
171
- ? (page - 1) * pagesize >= this.showListData.length
171
+ ? page > this.totalPage
172
172
  ? this.showListData.slice(-(this.showListData.length % pagesize || pagesize))
173
173
  : this.showListData.slice((page - 1) * pagesize, page * pagesize)
174
174
  : [];
175
175
  },
176
176
  // 全部数据 或 筛选时符合条件的数据 -共多少分(!!!最小为1)
177
- pageNum () {
177
+ totalPage () {
178
178
  return (
179
- this.selfTotal % this.pagePropsObj.pagesize > 0
180
- ? Math.ceil(this.selfTotal / this.pagePropsObj.pagesize)
181
- : this.selfTotal / this.pagePropsObj.pagesize
179
+ this.totalNum % this.pagePropsObj.pagesize > 0
180
+ ? Math.ceil(this.totalNum / this.pagePropsObj.pagesize)
181
+ : this.totalNum / this.pagePropsObj.pagesize
182
182
  ) || 1;
183
183
  }
184
184
  },
@@ -203,15 +203,15 @@ export default {
203
203
  this.changePage(1);
204
204
  }
205
205
  } else {
206
- if (this.pagePropsObj.page !== this.pageNum) {
207
- this.changePage(this.pageNum);
206
+ if (this.pagePropsObj.page !== this.totalPage) {
207
+ this.changePage(this.totalPage);
208
208
  }
209
209
  }
210
210
  },
211
211
  // 也供外部使用 -删除数据时,更正this.pagePropsObj.page
212
212
  fixCurPage () {
213
- if (this.pagePropsObj.page > this.pageNum) {
214
- this.changePage(this.pageNum);
213
+ if (this.pagePropsObj.page > this.totalPage) {
214
+ this.changePage(this.totalPage);
215
215
  }
216
216
  },
217
217
  // 暂未供外部使用 -判断是否要转到下一页(在本页最后一条上插入一行时,要转到下一页)
@@ -643,7 +643,7 @@ export default {
643
643
  .filter(id => !!id);
644
644
  },
645
645
  // 全部数据(或筛选出的数据)-总数
646
- selfTotal () {
646
+ totalNum () {
647
647
  return this.showListData.length;
648
648
  },
649
649