@neatui/vue 2.7.1 → 2.7.3
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 +1 -1
- package/src/components/basic/IDraggable.vue +11 -11
- package/src/components/form/Upload.vue +23 -22
- package/src/components/loader/FormLoader/FormLoader@v2.vue +192 -194
- package/src/components/loader/TableLoader/TableColView.vue +14 -18
- package/src/components/loader/TableLoader/TableLoader.vue +151 -111
- package/src/components/loader/TableLoader/index.ts +47 -0
- package/src/components/loader/index.ts +2 -1
- package/src/components/tools/Pagination@a.vue +16 -17
- package/src/components/tools/Pagination@b.vue +16 -16
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
<div class="ml-sl ar mob-ac">
|
|
15
15
|
<div class="fr mob-fn m-ss-sub" ui-flex="row rm">
|
|
16
|
-
<button class="flex-fixed" :ui-btn="`@a s read :border :square ${data.
|
|
16
|
+
<button class="flex-fixed" :ui-btn="`@a s read :border :square ${data.page > 1 ? '' : ':disabled'}`" @click="prev">
|
|
17
17
|
<svg
|
|
18
18
|
style="width: 1em; height: 1em"
|
|
19
19
|
t="1701228540398"
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
</svg>
|
|
33
33
|
</button>
|
|
34
34
|
|
|
35
|
-
<button class="flex-fixed" v-for="idx in state.list" :key="idx" :ui-btn="`@a s ${idx === data.
|
|
35
|
+
<button class="flex-fixed" v-for="idx in state.list" :key="idx" :ui-btn="`@a s ${idx === data.page ? 'main' : 'read :border'}`" ui-hide="<pad" @click="page(idx)">
|
|
36
36
|
<code>{{ idx }}</code>
|
|
37
37
|
</button>
|
|
38
38
|
<button class="flex-fixed" ui-btn="@a s read :border" ui-hide=">mob">
|
|
39
39
|
<span>当前第</span>
|
|
40
|
-
<code class="nx-ss">{{ data.
|
|
40
|
+
<code class="nx-ss">{{ data.page || 1 }}</code>
|
|
41
41
|
<span>页</span>
|
|
42
42
|
</button>
|
|
43
|
-
<button class="flex-fixed" :ui-btn="`@a s read :border :square ${data.
|
|
43
|
+
<button class="flex-fixed" :ui-btn="`@a s read :border :square ${data.page < data.totalPages ? '' : ':disabled'}`" @click="next">
|
|
44
44
|
<svg style="width: 1em; height: 1em" class="icon co-read" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2426" width="64" height="64">
|
|
45
45
|
<path
|
|
46
46
|
d="M341.63640988 781.41564784c20.63742578 21.22981847 54.12571728 21.22981847 74.81456101 0l265.95100164-273.75421824c20.62728703-21.26747667 20.62728703-55.75008988 0-76.97556317l-265.95100164-273.74407946c-20.68449855-21.26747667-54.17423844-21.26747667-74.81456101 0-20.67291141 21.23706043-20.67291142 55.71170748 0 76.98497771l228.55639458 235.24869384-228.55567038 235.22117436c-20.67218722 21.26747667-20.67146302 55.74357212 0 77.02263594l0 0z"
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
|
|
134
134
|
interface ModelValueProps {
|
|
135
135
|
pageSize: number;
|
|
136
|
-
|
|
136
|
+
page: number;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
interface DataProps {
|
|
140
140
|
total: number;
|
|
141
141
|
totalPages: number;
|
|
142
|
-
|
|
142
|
+
page: number;
|
|
143
143
|
}
|
|
144
144
|
// 类型
|
|
145
145
|
interface Props {
|
|
@@ -155,15 +155,15 @@
|
|
|
155
155
|
id: '',
|
|
156
156
|
modelValue: () => ({
|
|
157
157
|
pageSize: 0,
|
|
158
|
-
|
|
158
|
+
page: 0,
|
|
159
159
|
}),
|
|
160
160
|
data: () => {
|
|
161
161
|
return {
|
|
162
162
|
total: 0,
|
|
163
163
|
totalPages: 0,
|
|
164
|
-
|
|
164
|
+
page: 0,
|
|
165
165
|
};
|
|
166
|
-
}
|
|
166
|
+
},
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
const emits = defineEmits(['update:modelValue', 'page', 'size']);
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
showTotal: true,
|
|
173
173
|
id: computed(() => (props.id || 'PAGINATION' + route.path?.replace(/\//g, '_')).toUpperCase()),
|
|
174
174
|
list: computed(() => {
|
|
175
|
-
const _page = Number(props.data.
|
|
175
|
+
const _page = Number(props.data.page || 1);
|
|
176
176
|
const list = [_page];
|
|
177
177
|
if (_page > 1) {
|
|
178
178
|
list.unshift(_page - 1);
|
|
@@ -193,23 +193,23 @@
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
return list;
|
|
196
|
-
})
|
|
196
|
+
}),
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
const prev = () => {
|
|
200
|
-
const _page = Number(props.data.
|
|
201
|
-
emits('update:modelValue', { ...props.modelValue, ...{
|
|
200
|
+
const _page = Number(props.data.page) - 1 < 1 ? 1 : Number(props.data.page) - 1;
|
|
201
|
+
emits('update:modelValue', { ...props.modelValue, ...{ page: _page } });
|
|
202
202
|
emits('page', _page);
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
const next = () => {
|
|
206
|
-
const _page = Number(props.data.
|
|
207
|
-
emits('update:modelValue', { ...props.modelValue, ...{
|
|
206
|
+
const _page = Number(props.data.page) + 1 > props.data.totalPages ? props.data.totalPages : Number(props.data.page) + 1;
|
|
207
|
+
emits('update:modelValue', { ...props.modelValue, ...{ page: _page } });
|
|
208
208
|
emits('page', _page);
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
const page = (idx: any) => {
|
|
212
|
-
emits('update:modelValue', { ...props.modelValue, ...{
|
|
212
|
+
emits('update:modelValue', { ...props.modelValue, ...{ page: idx } });
|
|
213
213
|
emits('page', idx);
|
|
214
214
|
};
|
|
215
215
|
|