@jetlinks-web/components 3.0.1 → 3.1.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.
- package/es/ProTable/Content.js +77 -36
- package/es/ProTable/Pagination.js +16 -7
- package/es/ProTable/ProTable.js +79 -33
- package/es/ProTable/setting.js +23 -0
- package/es/VirtualTable/VirtualTable.js +398 -0
- package/es/VirtualTable/data.js +36 -0
- package/es/VirtualTable/index.js +5 -0
- package/es/VirtualTable/style/index.js +32 -0
- package/es/components.js +2 -1
- package/es/locale/en-US.js +3 -1
- package/es/locale/zh-CN.js +3 -1
- package/lib/ProTable/Content.js +77 -36
- package/lib/ProTable/Pagination.js +16 -7
- package/lib/ProTable/ProTable.js +79 -33
- package/lib/ProTable/setting.js +23 -0
- package/lib/VirtualTable/VirtualTable.js +398 -0
- package/lib/VirtualTable/data.js +43 -0
- package/lib/VirtualTable/index.js +12 -0
- package/lib/VirtualTable/style/index.js +39 -0
- package/lib/components.js +7 -0
- package/lib/locale/en-US.js +3 -1
- package/lib/locale/zh-CN.js +3 -1
- package/package.json +3 -3
package/es/ProTable/Content.js
CHANGED
|
@@ -26,6 +26,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
26
26
|
"useTableInject": "setup-maybe-ref",
|
|
27
27
|
"useProTableStyle": "setup-maybe-ref",
|
|
28
28
|
"useLocaleReceiver": "setup-maybe-ref",
|
|
29
|
+
"JVirtualTable": "setup-maybe-ref",
|
|
29
30
|
"props": "setup-reactive-const",
|
|
30
31
|
"slots": "setup-maybe-ref",
|
|
31
32
|
"contextLocale": "setup-maybe-ref",
|
|
@@ -66,6 +67,7 @@ import Empty from '../Empty';
|
|
|
66
67
|
import { useTableInject } from './hooks';
|
|
67
68
|
import useProTableStyle from './style';
|
|
68
69
|
import { useLocaleReceiver } from "../LocaleReciver";
|
|
70
|
+
import JVirtualTable from '../VirtualTable';
|
|
69
71
|
const __sfc_main__ = _defineComponent({
|
|
70
72
|
...{
|
|
71
73
|
name: 'Content'
|
|
@@ -165,42 +167,81 @@ const __sfc_main__ = _defineComponent({
|
|
|
165
167
|
])
|
|
166
168
|
]))
|
|
167
169
|
]))
|
|
168
|
-
: (_openBlock(),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
170
|
+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
|
|
171
|
+
(props.type === 'TREE')
|
|
172
|
+
? (_openBlock(), _createBlock(_unref(JVirtualTable), {
|
|
173
|
+
key: 0,
|
|
174
|
+
rowKey: _ctx.rowKey,
|
|
175
|
+
"row-selection": __rowSelection.value,
|
|
176
|
+
dataSource: _ctx.dataSource,
|
|
177
|
+
columns: _columns.value,
|
|
178
|
+
height: _ctx.height
|
|
179
|
+
}, _createSlots({
|
|
180
|
+
bodyCell: _withCtx(({ column, record, index }) => [
|
|
181
|
+
((_optionalChain([column, 'optionalAccess', _26 => _26.key]) || _optionalChain([column, 'optionalAccess', _27 => _27.dataIndex])) && _optionalChain([column, 'optionalAccess', _28 => _28.scopedSlots]) && (_optionalChain([_slots, 'access', _29 => _29.value, 'optionalAccess', _30 => _30[_optionalChain([column, 'optionalAccess', _31 => _31.dataIndex])]]) || _optionalChain([_slots, 'access', _32 => _32.value, 'optionalAccess', _33 => _33[_optionalChain([column, 'optionalAccess', _34 => _34.key])]])))
|
|
182
|
+
? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _35 => _35.key]) || _optionalChain([column, 'optionalAccess', _36 => _36.dataIndex]), _mergeProps({ key: 0 }, record, {
|
|
183
|
+
index: index,
|
|
184
|
+
column: column
|
|
185
|
+
}))
|
|
186
|
+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
|
|
187
|
+
_createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _37 => _37.dataIndex]) || _optionalChain([column, 'optionalAccess', _38 => _38.key])) || '--'), 1 /* TEXT */)
|
|
188
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
189
|
+
]),
|
|
190
|
+
emptyText: _withCtx(() => [
|
|
191
|
+
_renderSlot(_ctx.$slots, "emptyText", {}, () => [
|
|
192
|
+
_createVNode(_unref(Empty))
|
|
193
|
+
])
|
|
194
|
+
]),
|
|
195
|
+
_: 2 /* DYNAMIC */
|
|
196
|
+
}, [
|
|
197
|
+
_renderList(_slots.value, (_, slotKey) => {
|
|
198
|
+
return {
|
|
199
|
+
name: slotKey,
|
|
200
|
+
fn: _withCtx((slotProps) => [
|
|
201
|
+
(!((_optionalChain([__props, 'access', _39 => _39.column, 'optionalAccess', _40 => _40.key]) || _optionalChain([__props, 'access', _41 => _41.column, 'optionalAccess', _42 => _42.dataIndex])) && _optionalChain([__props, 'access', _43 => _43.column, 'optionalAccess', _44 => _44.scopedSlots]) && (_optionalChain([_slots, 'access', _45 => _45.value, 'optionalAccess', _46 => _46[_optionalChain([__props, 'access', _47 => _47.column, 'optionalAccess', _48 => _48.dataIndex])]]) || _optionalChain([_slots, 'access', _49 => _49.value, 'optionalAccess', _50 => _50[_optionalChain([__props, 'access', _51 => _51.column, 'optionalAccess', _52 => _52.key])]]))))
|
|
202
|
+
? _renderSlot(_ctx.$slots, slotKey, _normalizeProps(_mergeProps({ key: 0 }, slotProps)))
|
|
203
|
+
: _createCommentVNode("v-if", true)
|
|
204
|
+
])
|
|
205
|
+
};
|
|
206
|
+
})
|
|
207
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["rowKey", "row-selection", "dataSource", "columns", "height"]))
|
|
208
|
+
: (_openBlock(), _createBlock(_unref(Table), _mergeProps({ key: 1 }, props, {
|
|
209
|
+
"row-selection": __rowSelection.value,
|
|
210
|
+
dataSource: _ctx.dataSource,
|
|
211
|
+
columns: _columns.value,
|
|
212
|
+
pagination: false,
|
|
213
|
+
scroll: _scroll.value,
|
|
214
|
+
class: { 'j-table-scroll': !_optionalChain([props, 'access', _53 => _53.scroll, 'optionalAccess', _54 => _54.y]) }
|
|
215
|
+
}), _createSlots({
|
|
216
|
+
bodyCell: _withCtx(({ column, record, index }) => [
|
|
217
|
+
((_optionalChain([column, 'optionalAccess', _55 => _55.key]) || _optionalChain([column, 'optionalAccess', _56 => _56.dataIndex])) && _optionalChain([column, 'optionalAccess', _57 => _57.scopedSlots]) && (_optionalChain([_slots, 'access', _58 => _58.value, 'optionalAccess', _59 => _59[_optionalChain([column, 'optionalAccess', _60 => _60.dataIndex])]]) || _optionalChain([_slots, 'access', _61 => _61.value, 'optionalAccess', _62 => _62[_optionalChain([column, 'optionalAccess', _63 => _63.key])]])))
|
|
218
|
+
? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _64 => _64.key]) || _optionalChain([column, 'optionalAccess', _65 => _65.dataIndex]), _mergeProps({ key: 0 }, record, {
|
|
219
|
+
index: index,
|
|
220
|
+
column: column
|
|
221
|
+
}))
|
|
222
|
+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
|
|
223
|
+
_createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _66 => _66.dataIndex]) || _optionalChain([column, 'optionalAccess', _67 => _67.key])) || '--'), 1 /* TEXT */)
|
|
224
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
225
|
+
]),
|
|
226
|
+
emptyText: _withCtx(() => [
|
|
227
|
+
_renderSlot(_ctx.$slots, "emptyText", {}, () => [
|
|
228
|
+
_createVNode(_unref(Empty))
|
|
229
|
+
])
|
|
230
|
+
]),
|
|
231
|
+
_: 2 /* DYNAMIC */
|
|
232
|
+
}, [
|
|
233
|
+
_renderList(_slots.value, (_, slotKey) => {
|
|
234
|
+
return {
|
|
235
|
+
name: slotKey,
|
|
236
|
+
fn: _withCtx((slotProps) => [
|
|
237
|
+
(!((_optionalChain([__props, 'access', _68 => _68.column, 'optionalAccess', _69 => _69.key]) || _optionalChain([__props, 'access', _70 => _70.column, 'optionalAccess', _71 => _71.dataIndex])) && _optionalChain([__props, 'access', _72 => _72.column, 'optionalAccess', _73 => _73.scopedSlots]) && (_optionalChain([_slots, 'access', _74 => _74.value, 'optionalAccess', _75 => _75[_optionalChain([__props, 'access', _76 => _76.column, 'optionalAccess', _77 => _77.dataIndex])]]) || _optionalChain([_slots, 'access', _78 => _78.value, 'optionalAccess', _79 => _79[_optionalChain([__props, 'access', _80 => _80.column, 'optionalAccess', _81 => _81.key])]]))))
|
|
238
|
+
? _renderSlot(_ctx.$slots, slotKey, _normalizeProps(_mergeProps({ key: 0 }, slotProps)))
|
|
239
|
+
: _createCommentVNode("v-if", true)
|
|
240
|
+
])
|
|
241
|
+
};
|
|
242
|
+
})
|
|
243
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["row-selection", "dataSource", "columns", "scroll", "class"]))
|
|
244
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
204
245
|
], 2 /* CLASS */));
|
|
205
246
|
};
|
|
206
247
|
}
|
|
@@ -16,8 +16,10 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
16
16
|
} return value; }
|
|
17
17
|
/* Analyzed bindings: {
|
|
18
18
|
"Pagination": "setup-maybe-ref",
|
|
19
|
+
"Spin": "setup-maybe-ref",
|
|
19
20
|
"_paginationProps": "setup-maybe-ref",
|
|
20
21
|
"computed": "setup-const",
|
|
22
|
+
"h": "setup-const",
|
|
21
23
|
"useLocaleReceiver": "setup-maybe-ref",
|
|
22
24
|
"useProTableStyle": "setup-maybe-ref",
|
|
23
25
|
"props": "setup-reactive-const",
|
|
@@ -32,9 +34,9 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
32
34
|
} */
|
|
33
35
|
import { defineComponent as _defineComponent } from 'vue';
|
|
34
36
|
import { unref as _unref, renderSlot as _renderSlot, mergeProps as _mergeProps, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
35
|
-
import { Pagination } from 'ant-design-vue';
|
|
37
|
+
import { Pagination, Spin } from 'ant-design-vue';
|
|
36
38
|
import { _paginationProps } from "./setting";
|
|
37
|
-
import { computed } from 'vue';
|
|
39
|
+
import { computed, h } from 'vue';
|
|
38
40
|
import { useLocaleReceiver } from "../LocaleReciver";
|
|
39
41
|
import useProTableStyle from './style';
|
|
40
42
|
const __sfc_main__ = _defineComponent({
|
|
@@ -57,12 +59,19 @@ const __sfc_main__ = _defineComponent({
|
|
|
57
59
|
const _showTotal = (num) => {
|
|
58
60
|
const minSize = props.pageIndex * props.pageSize + 1;
|
|
59
61
|
const MaxSize = (props.pageIndex + 1) * props.pageSize;
|
|
60
|
-
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
let localePage = _optionalChain([contextLocale, 'access', _ => _.value, 'access', _2 => _2.pagination, 'optionalAccess', _3 => _3.page]) || '';
|
|
63
|
+
let localeTotal = _optionalChain([contextLocale, 'access', _4 => _4.value, 'access', _5 => _5.pagination, 'optionalAccess', _6 => _6.total]) || '';
|
|
64
|
+
const _maxSize = props.totalLoading ? MaxSize : (MaxSize > num ? num : MaxSize);
|
|
65
|
+
[minSize, _maxSize].forEach((item, index) => {
|
|
66
|
+
localePage = localePage.replace(`{${index}}`, item);
|
|
64
67
|
});
|
|
65
|
-
return
|
|
68
|
+
return h('span', {}, [
|
|
69
|
+
localePage,
|
|
70
|
+
props.totalLoading
|
|
71
|
+
? h(Spin, { size: 'small', style: { margin: '0 4px' } })
|
|
72
|
+
: h('span', { style: { margin: '0 4px' } }, num),
|
|
73
|
+
localeTotal
|
|
74
|
+
]);
|
|
66
75
|
};
|
|
67
76
|
const onChange = (page, size) => {
|
|
68
77
|
emits('change', page, size);
|
package/es/ProTable/ProTable.js
CHANGED
|
@@ -39,6 +39,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
39
39
|
"TableConfig": "setup-maybe-ref",
|
|
40
40
|
"useTableInject": "setup-maybe-ref",
|
|
41
41
|
"useProTableStyle": "setup-maybe-ref",
|
|
42
|
+
"onlyMessage": "setup-maybe-ref",
|
|
43
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
42
44
|
"tableConfig": "setup-maybe-ref",
|
|
43
45
|
"props": "setup-reactive-const",
|
|
44
46
|
"slots": "setup-maybe-ref",
|
|
@@ -51,6 +53,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
51
53
|
"prefixCls": "setup-ref",
|
|
52
54
|
"wrapSSR": "setup-maybe-ref",
|
|
53
55
|
"hashId": "setup-maybe-ref",
|
|
56
|
+
"contextLocale": "setup-maybe-ref",
|
|
57
|
+
"currentRequestId": "setup-let",
|
|
54
58
|
"extraSlots": "setup-const",
|
|
55
59
|
"_rowSelection": "setup-maybe-ref",
|
|
56
60
|
"showAlert": "setup-ref",
|
|
@@ -79,6 +83,8 @@ import { debounce } from 'lodash-es';
|
|
|
79
83
|
import { TableConfig } from "../utils/constants";
|
|
80
84
|
import { useTableInject } from "./hooks";
|
|
81
85
|
import useProTableStyle from "./style";
|
|
86
|
+
import { onlyMessage } from "@jetlinks-web/utils";
|
|
87
|
+
import { useLocaleReceiver } from "../LocaleReciver";
|
|
82
88
|
const __sfc_main__ = _defineComponent({
|
|
83
89
|
...{
|
|
84
90
|
name: 'JProTable'
|
|
@@ -111,10 +117,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
111
117
|
const page = reactive({
|
|
112
118
|
pageIndex: 0,
|
|
113
119
|
pageSize: 12,
|
|
114
|
-
total: 0
|
|
120
|
+
total: 0,
|
|
121
|
+
loading: false
|
|
115
122
|
});
|
|
116
123
|
const prefixCls = computed(() => 'pro-table');
|
|
117
124
|
const [wrapSSR, hashId] = useProTableStyle(prefixCls);
|
|
125
|
+
const [contextLocale] = useLocaleReceiver('ProTable');
|
|
126
|
+
let currentRequestId = 0;
|
|
118
127
|
const extraSlots = ['headerRightRender', 'headerLeftRender', 'paginationRender', 'alertRender'];
|
|
119
128
|
const _rowSelection = useTableInject();
|
|
120
129
|
const showAlert = computed(() => {
|
|
@@ -126,20 +135,34 @@ const __sfc_main__ = _defineComponent({
|
|
|
126
135
|
const onCheck = (e) => {
|
|
127
136
|
_mode.value = e.target.value;
|
|
128
137
|
};
|
|
129
|
-
const handleData = (result) => {
|
|
138
|
+
const handleData = (result, _params) => {
|
|
130
139
|
if (props.type === 'PAGE') {
|
|
131
140
|
// 判断如果是最后一页且最后一页为空,就跳转到前一页
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
// 判断条件:如果是total分开查询,判断result的长度;如果不分开查询就判断result.data的长度
|
|
142
|
+
if (props.totalRequest) {
|
|
143
|
+
if (result.length === 0) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
_dataSource.value = result || [];
|
|
148
|
+
page.pageIndex = _optionalChain([_params, 'optionalAccess', _8 => _8.pageIndex]) || 0;
|
|
149
|
+
page.pageSize = _optionalChain([_params, 'optionalAccess', _9 => _9.pageSize]) || 12;
|
|
150
|
+
page.total = page.pageSize * (page.pageIndex + 1) + 1;
|
|
151
|
+
}
|
|
137
152
|
}
|
|
138
153
|
else {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
if (_optionalChain([result, 'optionalAccess', _10 => _10.total]) &&
|
|
155
|
+
_optionalChain([result, 'optionalAccess', _11 => _11.pageSize]) &&
|
|
156
|
+
_optionalChain([result, 'optionalAccess', _12 => _12.pageIndex]) &&
|
|
157
|
+
_optionalChain([result, 'optionalAccess', _13 => _13.data, 'optionalAccess', _14 => _14.length]) === 0) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
_dataSource.value = _optionalChain([result, 'optionalAccess', _15 => _15.data]) || [];
|
|
162
|
+
page.pageIndex = _optionalChain([result, 'optionalAccess', _16 => _16.pageIndex]) || 0;
|
|
163
|
+
page.pageSize = _optionalChain([result, 'optionalAccess', _17 => _17.pageSize]) || 12;
|
|
164
|
+
page.total = _optionalChain([result, 'optionalAccess', _18 => _18.total]) || 0;
|
|
165
|
+
}
|
|
143
166
|
}
|
|
144
167
|
}
|
|
145
168
|
else {
|
|
@@ -158,8 +181,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
158
181
|
...props.defaultParams,
|
|
159
182
|
..._params,
|
|
160
183
|
terms: [
|
|
161
|
-
...(_optionalChain([props, 'access',
|
|
162
|
-
...(_optionalChain([_params, 'optionalAccess',
|
|
184
|
+
...(_optionalChain([props, 'access', _19 => _19.defaultParams, 'optionalAccess', _20 => _20.terms]) || []),
|
|
185
|
+
...(_optionalChain([_params, 'optionalAccess', _21 => _21.terms]) || []),
|
|
163
186
|
],
|
|
164
187
|
};
|
|
165
188
|
loading.value = true;
|
|
@@ -167,19 +190,40 @@ const __sfc_main__ = _defineComponent({
|
|
|
167
190
|
loading.value = false;
|
|
168
191
|
});
|
|
169
192
|
if (resp.success) {
|
|
170
|
-
const flag = handleData(resp.result || {});
|
|
193
|
+
const flag = handleData(resp.result || {}, _params);
|
|
171
194
|
if (flag) { // 判断如果是最后一页且最后一页为空,就跳转到前一页
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
pageSize
|
|
176
|
-
|
|
177
|
-
|
|
195
|
+
if (props.totalRequest) {
|
|
196
|
+
onlyMessage(_optionalChain([contextLocale, 'access', _22 => _22.value, 'access', _23 => _23.pagination, 'optionalAccess', _24 => _24.lastPage]) || '', 'error');
|
|
197
|
+
// 置灰下一页
|
|
198
|
+
page.total = page.pageSize * (page.pageIndex > 0 ? page.pageIndex : 1);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
page.pageIndex = page.pageIndex > 0 ? page.pageIndex - 1 : 0;
|
|
202
|
+
handleSearch({
|
|
203
|
+
..._params,
|
|
204
|
+
pageSize: page.pageSize,
|
|
205
|
+
pageIndex: page.pageIndex,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
178
208
|
}
|
|
179
209
|
}
|
|
180
210
|
else {
|
|
181
211
|
_dataSource.value = [];
|
|
182
212
|
}
|
|
213
|
+
if (props.totalRequest) {
|
|
214
|
+
currentRequestId++;
|
|
215
|
+
const requestId = currentRequestId;
|
|
216
|
+
page.loading = true;
|
|
217
|
+
props.totalRequest(__params).then((res) => {
|
|
218
|
+
if (res.success) {
|
|
219
|
+
page.total = res.result || 0;
|
|
220
|
+
}
|
|
221
|
+
}).finally(() => {
|
|
222
|
+
if (requestId === currentRequestId) {
|
|
223
|
+
page.loading = false;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
183
227
|
}
|
|
184
228
|
else {
|
|
185
229
|
_dataSource.value = [];
|
|
@@ -195,11 +239,11 @@ const __sfc_main__ = _defineComponent({
|
|
|
195
239
|
};
|
|
196
240
|
const onClose = () => {
|
|
197
241
|
if (props.rowSelection) {
|
|
198
|
-
_optionalChain([props, 'access',
|
|
199
|
-
_optionalChain([props, 'access',
|
|
242
|
+
_optionalChain([props, 'access', _25 => _25.rowSelection, 'access', _26 => _26.onChange, 'optionalCall', _27 => _27([], [])]);
|
|
243
|
+
_optionalChain([props, 'access', _28 => _28.rowSelection, 'access', _29 => _29.onSelectNone, 'optionalCall', _30 => _30()]);
|
|
200
244
|
}
|
|
201
|
-
else if (_optionalChain([_rowSelection, 'optionalAccess',
|
|
202
|
-
_optionalChain([_rowSelection, 'access',
|
|
245
|
+
else if (_optionalChain([_rowSelection, 'optionalAccess', _31 => _31.value])) {
|
|
246
|
+
_optionalChain([_rowSelection, 'access', _32 => _32.value, 'optionalAccess', _33 => _33.onSelectNone, 'optionalCall', _34 => _34()]);
|
|
203
247
|
}
|
|
204
248
|
};
|
|
205
249
|
/**
|
|
@@ -215,10 +259,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
215
259
|
});
|
|
216
260
|
};
|
|
217
261
|
const _gridColumns = computed(() => {
|
|
218
|
-
if (_optionalChain([props, 'access',
|
|
262
|
+
if (_optionalChain([props, 'access', _35 => _35.gridColumns, 'optionalAccess', _36 => _36.length])) {
|
|
219
263
|
const arr = props.gridColumns;
|
|
220
|
-
const lastValue = _optionalChain([arr, 'access',
|
|
221
|
-
if (_optionalChain([arr, 'optionalAccess',
|
|
264
|
+
const lastValue = _optionalChain([arr, 'access', _37 => _37.slice, 'call', _38 => _38(-1), 'optionalAccess', _39 => _39[0]]);
|
|
265
|
+
if (_optionalChain([arr, 'optionalAccess', _40 => _40.length]) < 4) {
|
|
222
266
|
while (arr.length < 4) {
|
|
223
267
|
arr.push(lastValue);
|
|
224
268
|
}
|
|
@@ -239,16 +283,16 @@ const __sfc_main__ = _defineComponent({
|
|
|
239
283
|
const styles = window.getComputedStyle(ele);
|
|
240
284
|
const width = parseFloat(styles.width);
|
|
241
285
|
if (width <= 992) {
|
|
242
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
286
|
+
column.value = _optionalChain([_gridColumns, 'access', _41 => _41.value, 'optionalAccess', _42 => _42[0]]) || 1;
|
|
243
287
|
}
|
|
244
288
|
else if (width > 992 && width <= 1440) {
|
|
245
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
289
|
+
column.value = _optionalChain([_gridColumns, 'access', _43 => _43.value, 'optionalAccess', _44 => _44[1]]) || 2;
|
|
246
290
|
}
|
|
247
291
|
else if (width > 1440 && width <= 1600) {
|
|
248
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
292
|
+
column.value = _optionalChain([_gridColumns, 'access', _45 => _45.value, 'optionalAccess', _46 => _46[2]]) || 3;
|
|
249
293
|
}
|
|
250
294
|
else if (width > 1600) {
|
|
251
|
-
column.value = _optionalChain([_gridColumns, 'access',
|
|
295
|
+
column.value = _optionalChain([_gridColumns, 'access', _47 => _47.value, 'optionalAccess', _48 => _48[3]]) || 4;
|
|
252
296
|
}
|
|
253
297
|
}
|
|
254
298
|
};
|
|
@@ -331,7 +375,9 @@ const __sfc_main__ = _defineComponent({
|
|
|
331
375
|
}, myPagination.value, {
|
|
332
376
|
total: page.total,
|
|
333
377
|
pageIndex: page.pageIndex,
|
|
334
|
-
pageSize: page.pageSize
|
|
378
|
+
pageSize: page.pageSize,
|
|
379
|
+
totalLoading: page.loading,
|
|
380
|
+
totalRequest: _ctx.totalRequest
|
|
335
381
|
}), {
|
|
336
382
|
default: _withCtx(() => [
|
|
337
383
|
_renderSlot(_ctx.$slots, "paginationRender", {
|
|
@@ -342,7 +388,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
342
388
|
})
|
|
343
389
|
]),
|
|
344
390
|
_: 3 /* FORWARDED */
|
|
345
|
-
}, 16 /* FULL_PROPS */, ["total", "pageIndex", "pageSize"]))
|
|
391
|
+
}, 16 /* FULL_PROPS */, ["total", "pageIndex", "pageSize", "totalLoading", "totalRequest"]))
|
|
346
392
|
: _createCommentVNode("v-if", true)
|
|
347
393
|
])
|
|
348
394
|
]),
|
package/es/ProTable/setting.js
CHANGED
|
@@ -56,6 +56,14 @@ export var _contentProps = _objectSpread(_objectSpread(_objectSpread({}, tablePr
|
|
|
56
56
|
rowKey: {
|
|
57
57
|
type: [String, Function],
|
|
58
58
|
default: 'id'
|
|
59
|
+
},
|
|
60
|
+
type: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'PAGE'
|
|
63
|
+
},
|
|
64
|
+
height: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 500
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
69
|
export var _paginationProps = _objectSpread(_objectSpread({}, omit(paginationProps(), ['onChange'])), {}, {
|
|
@@ -76,6 +84,17 @@ export var _paginationProps = _objectSpread(_objectSpread({}, omit(paginationPro
|
|
|
76
84
|
*/
|
|
77
85
|
isShowContent: {
|
|
78
86
|
type: Boolean
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* 总数loading状态
|
|
90
|
+
*/
|
|
91
|
+
totalLoading: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
},
|
|
95
|
+
totalRequest: {
|
|
96
|
+
type: Function,
|
|
97
|
+
default: undefined
|
|
79
98
|
}
|
|
80
99
|
});
|
|
81
100
|
export var proTableProps = _objectSpread(_objectSpread(_objectSpread({}, _contentProps), _alertProps), {}, {
|
|
@@ -91,6 +110,10 @@ export var proTableProps = _objectSpread(_objectSpread(_objectSpread({}, _conten
|
|
|
91
110
|
type: Function,
|
|
92
111
|
default: undefined
|
|
93
112
|
},
|
|
113
|
+
totalRequest: {
|
|
114
|
+
type: Function,
|
|
115
|
+
default: undefined
|
|
116
|
+
},
|
|
94
117
|
params: {
|
|
95
118
|
type: Object,
|
|
96
119
|
default: function _default() {
|