@jetlinks-web/components 3.1.13 → 3.1.14
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/es/ProTable/ProTable.js +26 -26
- package/es/ProTable/setting.js +1 -1
- package/lib/ProTable/ProTable.js +26 -26
- package/lib/ProTable/setting.js +1 -1
- package/package.json +3 -3
package/es/ProTable/ProTable.js
CHANGED
|
@@ -116,7 +116,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
116
116
|
const column = ref(4);
|
|
117
117
|
const page = reactive({
|
|
118
118
|
pageIndex: 0,
|
|
119
|
-
pageSize: 12,
|
|
119
|
+
pageSize: _optionalChain([tableConfig, 'access', _2 => _2.pagination, 'optionalAccess', _3 => _3.pageSize]) || 12,
|
|
120
120
|
total: 0,
|
|
121
121
|
loading: false
|
|
122
122
|
});
|
|
@@ -127,7 +127,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
127
127
|
const extraSlots = ['headerRightRender', 'headerLeftRender', 'paginationRender', 'alertRender'];
|
|
128
128
|
const _rowSelection = useTableInject();
|
|
129
129
|
const showAlert = computed(() => {
|
|
130
|
-
return props.alertShow && (_optionalChain([props, 'access',
|
|
130
|
+
return props.alertShow && (_optionalChain([props, 'access', _4 => _4.rowSelection, 'optionalAccess', _5 => _5.selectedRowKeys, 'optionalAccess', _6 => _6.length]) || _optionalChain([_rowSelection, 'optionalAccess', _7 => _7.value, 'optionalAccess', _8 => _8.selectedRowKeys, 'optionalAccess', _9 => _9.length]));
|
|
131
131
|
});
|
|
132
132
|
const showPagination = computed(() => {
|
|
133
133
|
return !!_dataSource.value.length && !props.noPagination && props.type === 'PAGE';
|
|
@@ -145,23 +145,23 @@ const __sfc_main__ = _defineComponent({
|
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
_dataSource.value = result || [];
|
|
148
|
-
page.pageIndex = _optionalChain([_params, 'optionalAccess',
|
|
149
|
-
page.pageSize = _optionalChain([_params, 'optionalAccess',
|
|
148
|
+
page.pageIndex = _optionalChain([_params, 'optionalAccess', _10 => _10.pageIndex]) || 0;
|
|
149
|
+
page.pageSize = _optionalChain([_params, 'optionalAccess', _11 => _11.pageSize]) || 12;
|
|
150
150
|
page.total = page.pageSize * (page.pageIndex + 1) + 1;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
else {
|
|
154
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
155
|
-
_optionalChain([result, 'optionalAccess',
|
|
156
|
-
_optionalChain([result, 'optionalAccess',
|
|
157
|
-
_optionalChain([result, 'optionalAccess',
|
|
154
|
+
if (_optionalChain([result, 'optionalAccess', _12 => _12.total]) &&
|
|
155
|
+
_optionalChain([result, 'optionalAccess', _13 => _13.pageSize]) &&
|
|
156
|
+
_optionalChain([result, 'optionalAccess', _14 => _14.pageIndex]) &&
|
|
157
|
+
_optionalChain([result, 'optionalAccess', _15 => _15.data, 'optionalAccess', _16 => _16.length]) === 0) {
|
|
158
158
|
return true;
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
161
|
-
_dataSource.value = _optionalChain([result, 'optionalAccess',
|
|
162
|
-
page.pageIndex = _optionalChain([result, 'optionalAccess',
|
|
163
|
-
page.pageSize = _optionalChain([result, 'optionalAccess',
|
|
164
|
-
page.total = _optionalChain([result, 'optionalAccess',
|
|
161
|
+
_dataSource.value = _optionalChain([result, 'optionalAccess', _17 => _17.data]) || [];
|
|
162
|
+
page.pageIndex = _optionalChain([result, 'optionalAccess', _18 => _18.pageIndex]) || 0;
|
|
163
|
+
page.pageSize = _optionalChain([result, 'optionalAccess', _19 => _19.pageSize]) || 12;
|
|
164
|
+
page.total = _optionalChain([result, 'optionalAccess', _20 => _20.total]) || 0;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -181,8 +181,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
181
181
|
...props.defaultParams,
|
|
182
182
|
..._params,
|
|
183
183
|
terms: [
|
|
184
|
-
...(_optionalChain([props, 'access',
|
|
185
|
-
...(_optionalChain([_params, 'optionalAccess',
|
|
184
|
+
...(_optionalChain([props, 'access', _21 => _21.defaultParams, 'optionalAccess', _22 => _22.terms]) || []),
|
|
185
|
+
...(_optionalChain([_params, 'optionalAccess', _23 => _23.terms]) || []),
|
|
186
186
|
],
|
|
187
187
|
};
|
|
188
188
|
loading.value = true;
|
|
@@ -193,7 +193,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
193
193
|
const flag = handleData(resp.result || {}, _params);
|
|
194
194
|
if (flag) { // 判断如果是最后一页且最后一页为空,就跳转到前一页
|
|
195
195
|
if (props.totalRequest) {
|
|
196
|
-
onlyMessage(_optionalChain([contextLocale, 'access',
|
|
196
|
+
onlyMessage(_optionalChain([contextLocale, 'access', _24 => _24.value, 'access', _25 => _25.pagination, 'optionalAccess', _26 => _26.lastPage]) || '', 'error');
|
|
197
197
|
// 置灰下一页
|
|
198
198
|
page.total = page.pageSize * (page.pageIndex > 0 ? page.pageIndex : 1);
|
|
199
199
|
}
|
|
@@ -239,11 +239,11 @@ const __sfc_main__ = _defineComponent({
|
|
|
239
239
|
};
|
|
240
240
|
const onClose = () => {
|
|
241
241
|
if (props.rowSelection) {
|
|
242
|
-
_optionalChain([props, 'access',
|
|
243
|
-
_optionalChain([props, 'access',
|
|
242
|
+
_optionalChain([props, 'access', _27 => _27.rowSelection, 'access', _28 => _28.onChange, 'optionalCall', _29 => _29([], [])]);
|
|
243
|
+
_optionalChain([props, 'access', _30 => _30.rowSelection, 'access', _31 => _31.onSelectNone, 'optionalCall', _32 => _32()]);
|
|
244
244
|
}
|
|
245
|
-
else if (_optionalChain([_rowSelection, 'optionalAccess',
|
|
246
|
-
_optionalChain([_rowSelection, 'access',
|
|
245
|
+
else if (_optionalChain([_rowSelection, 'optionalAccess', _33 => _33.value])) {
|
|
246
|
+
_optionalChain([_rowSelection, 'access', _34 => _34.value, 'optionalAccess', _35 => _35.onSelectNone, 'optionalCall', _36 => _36()]);
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
/**
|
|
@@ -259,10 +259,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
259
259
|
});
|
|
260
260
|
};
|
|
261
261
|
const _gridColumns = computed(() => {
|
|
262
|
-
if (_optionalChain([props, 'access',
|
|
262
|
+
if (_optionalChain([props, 'access', _37 => _37.gridColumns, 'optionalAccess', _38 => _38.length])) {
|
|
263
263
|
const arr = props.gridColumns;
|
|
264
|
-
const lastValue = _optionalChain([arr, 'access',
|
|
265
|
-
if (_optionalChain([arr, 'optionalAccess',
|
|
264
|
+
const lastValue = _optionalChain([arr, 'access', _39 => _39.slice, 'call', _40 => _40(-1), 'optionalAccess', _41 => _41[0]]);
|
|
265
|
+
if (_optionalChain([arr, 'optionalAccess', _42 => _42.length]) < 4) {
|
|
266
266
|
while (arr.length < 4) {
|
|
267
267
|
arr.push(lastValue);
|
|
268
268
|
}
|
|
@@ -283,16 +283,16 @@ const __sfc_main__ = _defineComponent({
|
|
|
283
283
|
const styles = window.getComputedStyle(ele);
|
|
284
284
|
const width = parseFloat(styles.width);
|
|
285
285
|
if (width <= 992) {
|
|
286
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
286
|
+
column.value = _optionalChain([_gridColumns, 'access', _43 => _43.value, 'optionalAccess', _44 => _44[0]]) || 1;
|
|
287
287
|
}
|
|
288
288
|
else if (width > 992 && width <= 1440) {
|
|
289
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
289
|
+
column.value = _optionalChain([_gridColumns, 'access', _45 => _45.value, 'optionalAccess', _46 => _46[1]]) || 2;
|
|
290
290
|
}
|
|
291
291
|
else if (width > 1440 && width <= 1600) {
|
|
292
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
292
|
+
column.value = _optionalChain([_gridColumns, 'access', _47 => _47.value, 'optionalAccess', _48 => _48[2]]) || 3;
|
|
293
293
|
}
|
|
294
294
|
else if (width > 1600) {
|
|
295
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
295
|
+
column.value = _optionalChain([_gridColumns, 'access', _49 => _49.value, 'optionalAccess', _50 => _50[3]]) || 4;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
};
|
package/es/ProTable/setting.js
CHANGED
package/lib/ProTable/ProTable.js
CHANGED
|
@@ -116,7 +116,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
116
116
|
const column = ref(4);
|
|
117
117
|
const page = reactive({
|
|
118
118
|
pageIndex: 0,
|
|
119
|
-
pageSize: 12,
|
|
119
|
+
pageSize: _optionalChain([tableConfig, 'access', _2 => _2.pagination, 'optionalAccess', _3 => _3.pageSize]) || 12,
|
|
120
120
|
total: 0,
|
|
121
121
|
loading: false
|
|
122
122
|
});
|
|
@@ -127,7 +127,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
127
127
|
const extraSlots = ['headerRightRender', 'headerLeftRender', 'paginationRender', 'alertRender'];
|
|
128
128
|
const _rowSelection = useTableInject();
|
|
129
129
|
const showAlert = computed(() => {
|
|
130
|
-
return props.alertShow && (_optionalChain([props, 'access',
|
|
130
|
+
return props.alertShow && (_optionalChain([props, 'access', _4 => _4.rowSelection, 'optionalAccess', _5 => _5.selectedRowKeys, 'optionalAccess', _6 => _6.length]) || _optionalChain([_rowSelection, 'optionalAccess', _7 => _7.value, 'optionalAccess', _8 => _8.selectedRowKeys, 'optionalAccess', _9 => _9.length]));
|
|
131
131
|
});
|
|
132
132
|
const showPagination = computed(() => {
|
|
133
133
|
return !!_dataSource.value.length && !props.noPagination && props.type === 'PAGE';
|
|
@@ -145,23 +145,23 @@ const __sfc_main__ = _defineComponent({
|
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
_dataSource.value = result || [];
|
|
148
|
-
page.pageIndex = _optionalChain([_params, 'optionalAccess',
|
|
149
|
-
page.pageSize = _optionalChain([_params, 'optionalAccess',
|
|
148
|
+
page.pageIndex = _optionalChain([_params, 'optionalAccess', _10 => _10.pageIndex]) || 0;
|
|
149
|
+
page.pageSize = _optionalChain([_params, 'optionalAccess', _11 => _11.pageSize]) || 12;
|
|
150
150
|
page.total = page.pageSize * (page.pageIndex + 1) + 1;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
else {
|
|
154
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
155
|
-
_optionalChain([result, 'optionalAccess',
|
|
156
|
-
_optionalChain([result, 'optionalAccess',
|
|
157
|
-
_optionalChain([result, 'optionalAccess',
|
|
154
|
+
if (_optionalChain([result, 'optionalAccess', _12 => _12.total]) &&
|
|
155
|
+
_optionalChain([result, 'optionalAccess', _13 => _13.pageSize]) &&
|
|
156
|
+
_optionalChain([result, 'optionalAccess', _14 => _14.pageIndex]) &&
|
|
157
|
+
_optionalChain([result, 'optionalAccess', _15 => _15.data, 'optionalAccess', _16 => _16.length]) === 0) {
|
|
158
158
|
return true;
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
161
|
-
_dataSource.value = _optionalChain([result, 'optionalAccess',
|
|
162
|
-
page.pageIndex = _optionalChain([result, 'optionalAccess',
|
|
163
|
-
page.pageSize = _optionalChain([result, 'optionalAccess',
|
|
164
|
-
page.total = _optionalChain([result, 'optionalAccess',
|
|
161
|
+
_dataSource.value = _optionalChain([result, 'optionalAccess', _17 => _17.data]) || [];
|
|
162
|
+
page.pageIndex = _optionalChain([result, 'optionalAccess', _18 => _18.pageIndex]) || 0;
|
|
163
|
+
page.pageSize = _optionalChain([result, 'optionalAccess', _19 => _19.pageSize]) || 12;
|
|
164
|
+
page.total = _optionalChain([result, 'optionalAccess', _20 => _20.total]) || 0;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -181,8 +181,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
181
181
|
...props.defaultParams,
|
|
182
182
|
..._params,
|
|
183
183
|
terms: [
|
|
184
|
-
...(_optionalChain([props, 'access',
|
|
185
|
-
...(_optionalChain([_params, 'optionalAccess',
|
|
184
|
+
...(_optionalChain([props, 'access', _21 => _21.defaultParams, 'optionalAccess', _22 => _22.terms]) || []),
|
|
185
|
+
...(_optionalChain([_params, 'optionalAccess', _23 => _23.terms]) || []),
|
|
186
186
|
],
|
|
187
187
|
};
|
|
188
188
|
loading.value = true;
|
|
@@ -193,7 +193,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
193
193
|
const flag = handleData(resp.result || {}, _params);
|
|
194
194
|
if (flag) { // 判断如果是最后一页且最后一页为空,就跳转到前一页
|
|
195
195
|
if (props.totalRequest) {
|
|
196
|
-
onlyMessage(_optionalChain([contextLocale, 'access',
|
|
196
|
+
onlyMessage(_optionalChain([contextLocale, 'access', _24 => _24.value, 'access', _25 => _25.pagination, 'optionalAccess', _26 => _26.lastPage]) || '', 'error');
|
|
197
197
|
// 置灰下一页
|
|
198
198
|
page.total = page.pageSize * (page.pageIndex > 0 ? page.pageIndex : 1);
|
|
199
199
|
}
|
|
@@ -239,11 +239,11 @@ const __sfc_main__ = _defineComponent({
|
|
|
239
239
|
};
|
|
240
240
|
const onClose = () => {
|
|
241
241
|
if (props.rowSelection) {
|
|
242
|
-
_optionalChain([props, 'access',
|
|
243
|
-
_optionalChain([props, 'access',
|
|
242
|
+
_optionalChain([props, 'access', _27 => _27.rowSelection, 'access', _28 => _28.onChange, 'optionalCall', _29 => _29([], [])]);
|
|
243
|
+
_optionalChain([props, 'access', _30 => _30.rowSelection, 'access', _31 => _31.onSelectNone, 'optionalCall', _32 => _32()]);
|
|
244
244
|
}
|
|
245
|
-
else if (_optionalChain([_rowSelection, 'optionalAccess',
|
|
246
|
-
_optionalChain([_rowSelection, 'access',
|
|
245
|
+
else if (_optionalChain([_rowSelection, 'optionalAccess', _33 => _33.value])) {
|
|
246
|
+
_optionalChain([_rowSelection, 'access', _34 => _34.value, 'optionalAccess', _35 => _35.onSelectNone, 'optionalCall', _36 => _36()]);
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
/**
|
|
@@ -259,10 +259,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
259
259
|
});
|
|
260
260
|
};
|
|
261
261
|
const _gridColumns = computed(() => {
|
|
262
|
-
if (_optionalChain([props, 'access',
|
|
262
|
+
if (_optionalChain([props, 'access', _37 => _37.gridColumns, 'optionalAccess', _38 => _38.length])) {
|
|
263
263
|
const arr = props.gridColumns;
|
|
264
|
-
const lastValue = _optionalChain([arr, 'access',
|
|
265
|
-
if (_optionalChain([arr, 'optionalAccess',
|
|
264
|
+
const lastValue = _optionalChain([arr, 'access', _39 => _39.slice, 'call', _40 => _40(-1), 'optionalAccess', _41 => _41[0]]);
|
|
265
|
+
if (_optionalChain([arr, 'optionalAccess', _42 => _42.length]) < 4) {
|
|
266
266
|
while (arr.length < 4) {
|
|
267
267
|
arr.push(lastValue);
|
|
268
268
|
}
|
|
@@ -283,16 +283,16 @@ const __sfc_main__ = _defineComponent({
|
|
|
283
283
|
const styles = window.getComputedStyle(ele);
|
|
284
284
|
const width = parseFloat(styles.width);
|
|
285
285
|
if (width <= 992) {
|
|
286
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
286
|
+
column.value = _optionalChain([_gridColumns, 'access', _43 => _43.value, 'optionalAccess', _44 => _44[0]]) || 1;
|
|
287
287
|
}
|
|
288
288
|
else if (width > 992 && width <= 1440) {
|
|
289
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
289
|
+
column.value = _optionalChain([_gridColumns, 'access', _45 => _45.value, 'optionalAccess', _46 => _46[1]]) || 2;
|
|
290
290
|
}
|
|
291
291
|
else if (width > 1440 && width <= 1600) {
|
|
292
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
292
|
+
column.value = _optionalChain([_gridColumns, 'access', _47 => _47.value, 'optionalAccess', _48 => _48[2]]) || 3;
|
|
293
293
|
}
|
|
294
294
|
else if (width > 1600) {
|
|
295
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
295
|
+
column.value = _optionalChain([_gridColumns, 'access', _49 => _49.value, 'optionalAccess', _50 => _50[3]]) || 4;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
};
|
package/lib/ProTable/setting.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -155,8 +155,8 @@
|
|
|
155
155
|
"webpack-merge": "^5.0.0",
|
|
156
156
|
"webpackbar": "^5.0.2",
|
|
157
157
|
"@jetlinks-web/constants": "^1.0.9",
|
|
158
|
-
"@jetlinks-web/
|
|
159
|
-
"@jetlinks-web/
|
|
158
|
+
"@jetlinks-web/hooks": "^1.1.1",
|
|
159
|
+
"@jetlinks-web/utils": "^1.2.12"
|
|
160
160
|
},
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"registry": "https://registry.npmjs.org/",
|