befly-admin-ui 1.47.0 → 1.48.0

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.
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
 
35
35
  <div v-if="$Prop.isPagination" class="main-page">
36
- <TPagination :current-page="$Data.pager.currentPage" :page-size="$Data.pager.limit" :total="$Data.pager.total" align="right" :layout="$Prop.paginationLayout" @current-change="$Method.onPageChange" @page-size-change="$Method.onPageSizeChange" />
36
+ <TPagination :current="$Data.pager.current" :page-size="$Const.pageLimit" :total="$Data.pager.total" :showPageSize="false" align="right" layout="total, prev, pager, next" @current-change="$Method.onPageChange" />
37
37
  </div>
38
38
 
39
39
  <slot name="dialogs" :reload="$Method.reload" :current-row="$Data.currentRow"></slot>
@@ -66,18 +66,10 @@ const $Prop = defineProps({
66
66
  type: Boolean,
67
67
  default: true
68
68
  },
69
- pageSize: {
70
- type: Number,
71
- default: 30
72
- },
73
69
  endpoints: {
74
70
  type: Object,
75
71
  default: undefined
76
72
  },
77
- paginationLayout: {
78
- type: String,
79
- default: "total, prev, pager, next, jumper"
80
- },
81
73
  autoLoad: {
82
74
  type: Boolean,
83
75
  default: true
@@ -96,6 +88,7 @@ const $From = {
96
88
  };
97
89
 
98
90
  const $Const = {
91
+ pageLimit: 30,
99
92
  reservedSlotNames: ["toolLeft", "toolRight", "detail", "dialogs", "operation", "default"]
100
93
  };
101
94
 
@@ -103,8 +96,7 @@ const $Data = reactive({
103
96
  rows: [],
104
97
  loading: false,
105
98
  pager: {
106
- currentPage: 1,
107
- limit: $Prop.pageSize,
99
+ current: 1,
108
100
  total: 0
109
101
  },
110
102
  currentRow: null,
@@ -237,13 +229,13 @@ const $Method = {
237
229
  const limitKey = listEndpoint.limitKey || "limit";
238
230
 
239
231
  const data = {};
240
- data[pageKey] = $Data.pager.currentPage;
241
- data[limitKey] = $Data.pager.limit;
232
+ data[pageKey] = $Data.pager.current;
233
+ data[limitKey] = $Const.pageLimit;
242
234
 
243
235
  if (listEndpoint.buildData) {
244
236
  const extra = listEndpoint.buildData({
245
- currentPage: $Data.pager.currentPage,
246
- limit: $Data.pager.limit
237
+ currentPage: $Data.pager.current,
238
+ limit: $Const.pageLimit
247
239
  });
248
240
  if (extra && typeof extra === "object") {
249
241
  for (const key of Object.keys(extra)) {
@@ -263,9 +255,9 @@ const $Method = {
263
255
 
264
256
  const allowPageFallback = options?.allowPageFallback !== false;
265
257
  if (allowPageFallback && lists.length === 0 && total > 0) {
266
- const lastPage = $Method.getLastPage(total, $Data.pager.limit);
267
- if ($Data.pager.currentPage > lastPage) {
268
- $Data.pager.currentPage = lastPage;
258
+ const lastPage = $Method.getLastPage(total, $Const.pageLimit);
259
+ if ($Data.pager.current > lastPage) {
260
+ $Data.pager.current = lastPage;
269
261
  await $Method.loadList({
270
262
  keepSelection: false,
271
263
  allowPageFallback: false
@@ -292,22 +284,17 @@ const $Method = {
292
284
  },
293
285
  reload: async function (options) {
294
286
  if (options?.resetPage) {
295
- $Data.pager.currentPage = 1;
287
+ $Data.pager.current = 1;
296
288
  }
297
289
  await $Method.loadList({
298
290
  keepSelection: options?.keepSelection,
299
291
  allowPageFallback: true
300
292
  });
301
293
  },
302
- onPageChange: function (info) {
303
- $Data.pager.currentPage = info.currentPage;
294
+ onPageChange: function (current) {
295
+ $Data.pager.current = current;
304
296
  $Method.reload({ keepSelection: true });
305
297
  },
306
- onPageSizeChange: function (info) {
307
- $Data.pager.limit = info.pageSize;
308
- $Data.pager.currentPage = 1;
309
- $Method.reload({ keepSelection: false });
310
- },
311
298
  onActiveChange: function (value, context) {
312
299
  if (value.length === 0) {
313
300
  if ($Data.activeRowKeys.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly-admin-ui",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "gitHead": "071d17be177355cdd61f30659c6e4c5873f87d39",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
@@ -99,17 +99,19 @@ import { reactive } from "vue";
99
99
 
100
100
  const $Data = reactive({
101
101
  columns: withDefaultColumns([
102
- { colKey: "productName", title: "产品名称" },
102
+ { colKey: "productName", title: "产品名称", width:120 },
103
103
  { colKey: "productCode", title: "产品代号", width: 150 },
104
- { colKey: "productVersion", title: "产品版本", width: 130 },
104
+
105
+ { colKey: "errorType", title: "错误类型", width: 120 },
106
+ { colKey: "message", title: "错误信息", ellipsis: true },
107
+ { colKey: "productVersion", title: "产品版本", width: 130 },
105
108
  { colKey: "pageName", title: "页面名称" },
106
109
  { colKey: "pagePath", title: "页面路径", width: 220, ellipsis: true },
107
- { colKey: "errorType", title: "错误类型", width: 120 },
108
- { colKey: "deviceType", title: "设备类型", width: 110 },
109
- { colKey: "browserName", title: "浏览器", width: 140 },
110
- { colKey: "osName", title: "操作系统", width: 140 },
111
- { colKey: "hitCount", title: "次数", width: 100 },
112
- { colKey: "message", title: "错误信息", ellipsis: true },
110
+
111
+ { colKey: "deviceType", title: "设备类型", width: 100 },
112
+ { colKey: "browserName", title: "浏览器", width: 100 },
113
+ { colKey: "osName", title: "操作系统", width: 100 },
114
+ { colKey: "hitCount", title: "次数", width: 100 },
113
115
  { colKey: "source", title: "来源", width: 100 },
114
116
  { colKey: "reportTime", title: "上报时间", width: 170 },
115
117
  { colKey: "firstReportTime", title: "首次上报", width: 170, detail: true },
@@ -122,7 +124,7 @@ const $Data = reactive({
122
124
  { colKey: "engineName", title: "渲染引擎", detail: true },
123
125
  { colKey: "cpuArchitecture", title: "CPU架构", detail: true },
124
126
  { colKey: "userAgent", title: "UA字符串", detail: true },
125
- { colKey: "detail", title: "错误详情", detail: true }
127
+ { colKey: "detail", title: "错误详情", detail: true }
126
128
  ]),
127
129
  endpoints: {
128
130
  list: {