Commit 8f645e4c authored by tanghao's avatar tanghao

分页查询

parent 11ec22d9
......@@ -95,15 +95,26 @@ export const getInformationListTitlesApi = (params: any) => {
})
}
// /**
// * 获取资料库列表数据
// * @param params
// * @returns
// */
// export const getInformationListApi = (data: any) => {
// return axios.post('/api/information/listInformation', data)
// }
/**
* 获取资料库列表数据
* @param params
* @returns
*/
export const getInformationListApi = (data: any) => {
return axios.post('/api/information/listInformation', data)
return axios.post('/api/information/pageInformation', data)
}
/**
* 导入客户资料
* @param params
......
......@@ -45,8 +45,8 @@
</template>
</vxe-column>
</vxe-table>
<vxe-pager v-if="total > 0" size="small" background v-model:current-page="form.currentPage"
v-model:page-size="form.pageSize" :total="total" @page-change="onSearch"
<vxe-pager size="small" background v-model:current-page="currentPage"
v-model:page-size="pageSize" :total="total" @page-change="onSearch"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'Sizes', 'FullJump', 'Total']">
</vxe-pager>
</div>
......@@ -72,6 +72,9 @@ const form = ref<any>({})
const defualtForm = ref<any>({})
const total = ref(0)
const currentPage = ref(1)
const pageSize = ref(10)
const xTable = ref<VxeTableInstance>()
const tableData = ref([])
const tableColumn = ref([])
......@@ -102,11 +105,11 @@ const initData = async () => {
form.value[ele] = ""
defualtForm.value[ele]=""
});
getInformationListApi(params).then((res) => {
if (res.data?.code == 200) {
tableData.value = res.data?.result
}
})
// getInformationListApi(params).then((res) => {
// if (res.data?.code == 200) {
// tableData.value = res.data?.result
// }
// })
}
} catch (error) {
......@@ -120,7 +123,9 @@ const getInformationList = async (params: any) => {
try {
const res = await getInformationListApi(params);
if (res.data?.code == 200) {
tableData.value = res.data?.result
console.log(res)
tableData.value = res.data?.result.records
total.value = res.data?.result.total
}
} catch (error) {
......@@ -129,20 +134,24 @@ const getInformationList = async (params: any) => {
}
}
const onReset = () => {
if(formRef?.value) {
formRef?.value.resetFields()
}
const params = {
informationType: route.query.informationType
}
getInformationList(params)
// const params = {
// informationType: route.query.informationType
// }
// getInformationList(params)
onSearch()
}
const onSearch = () => {
const params = {
informationType: route.query.informationType,
json: JSON.stringify(form.value)
json: JSON.stringify(form.value),
currentPage:currentPage.value,
pageSize:pageSize.value
}
getInformationList(params)
}
......@@ -221,7 +230,7 @@ const handleImport = () => {
const onImportChange = (type: any) => {
importVisible.value = false
if (type != 'close') {
initData()
onSearch()
}
}
......@@ -230,6 +239,7 @@ onMounted(() => {
return
}
initData()
onSearch()
})
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment