mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
--fix bug
This commit is contained in:
@@ -29,6 +29,10 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: ""
|
||||||
},
|
},
|
||||||
|
pageKey: {
|
||||||
|
type: String,
|
||||||
|
default: "pageNo"
|
||||||
|
},
|
||||||
params: {
|
params: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
@@ -45,7 +49,7 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
||||||
const rowSelectKeys = ref([]);
|
const rowSelectKeys = ref([]);
|
||||||
const selectsData = ref([]);
|
const selectsData = ref([]);
|
||||||
const params = useResetRef({ pageNo: 1, pageSize: 10 });
|
const params = useResetRef({ [props.pageKey]: 1, pageSize: 10 });
|
||||||
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
||||||
|
|
||||||
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
||||||
@@ -89,12 +93,12 @@ function onSelectChange(e, l) {
|
|||||||
const pagination = computed(() => ({
|
const pagination = computed(() => ({
|
||||||
total: total.value,
|
total: total.value,
|
||||||
showSizeChanger: false,
|
showSizeChanger: false,
|
||||||
current: params.value.pageNo,
|
current: params.value[props.pageKey],
|
||||||
pageSize: params.value.pageSize,
|
pageSize: params.value.pageSize,
|
||||||
onChange: changePagination,
|
onChange: changePagination,
|
||||||
}));
|
}));
|
||||||
const changePagination = (e) => {
|
const changePagination = (e) => {
|
||||||
params.value.pageNo = e;
|
params.value[props.pageKey] = e;
|
||||||
onFetch();
|
onFetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
margin: 0px 4px 120px 10px;
|
margin: 0px 4px 120px 10px;
|
||||||
border: 1px solid #f0f0f0;
|
border: 1px solid #f0f0f0;
|
||||||
">
|
">
|
||||||
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE"
|
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE" pageKey="page"
|
||||||
:request="useBoeApiUserInfoPage" :params="nameSearch"
|
:request="useBoeApiUserInfoPage" :params="nameSearch"
|
||||||
v-model:selectedRows="stuSelectRows" type="checkbox"></BaseTable>
|
v-model:selectedRows="stuSelectRows" type="checkbox"></BaseTable>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user