|
@@ -131,7 +131,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="tableBox">
|
|
|
- <div class="table" ref="tableRef">
|
|
|
+ <div class="table" ref="tableBoxRef">
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
style="width: 100%; height: 100%"
|
|
@@ -142,6 +142,7 @@
|
|
|
color: '#233755',
|
|
|
height: '50px'
|
|
|
}"
|
|
|
+ ref="tableRef"
|
|
|
>
|
|
|
<el-table-column label="序号" width="60">
|
|
|
<template #default="scope">{{ scope.$index + 1 }}</template>
|
|
@@ -223,7 +224,7 @@ const mainTypeAllList = getDictOptions(DICT_TYPE.CONTRACT_MAIN_TYPE)
|
|
|
const secondTypeAllList = getDictOptions(DICT_TYPE.CONTRACT_SECOND_TYPE)
|
|
|
|
|
|
const { exportHandleCommon, operateClick } = useMixins()
|
|
|
-const tableRef: any = ref(null)
|
|
|
+const tableBoxRef: any = ref(null)
|
|
|
const tableHeight: any = ref(0)
|
|
|
const queryParams = reactive<{
|
|
|
contractNumber: string
|
|
@@ -266,6 +267,7 @@ const dueTimeObj = ref()
|
|
|
|
|
|
const handleCurrentChange = (pageNo: number) => {
|
|
|
queryParams.pageNo = pageNo
|
|
|
+ scrollLeft.value = tableRef.value.scrollBarRef.wrapRef.scrollLeft
|
|
|
queryContractListAjax()
|
|
|
}
|
|
|
const exportHandle = async () => {
|
|
@@ -296,9 +298,12 @@ const exportHandle = async () => {
|
|
|
const tableData = ref<Array<any>>([])
|
|
|
const total = ref<number>()
|
|
|
const searchHandle: () => void = () => {
|
|
|
+ scrollLeft.value = tableRef.value.scrollBarRef.wrapRef.scrollLeft
|
|
|
queryContractListCalc()
|
|
|
queryContractListAjax()
|
|
|
}
|
|
|
+const tableRef = ref<any>(null)
|
|
|
+const scrollLeft = ref<number>(0)
|
|
|
const queryContractListAjax = async (): Promise<void> => {
|
|
|
const urlApi = `/contract/page`
|
|
|
if (contractOnObj.value && contractOnObj.value.length > 0) {
|
|
@@ -330,6 +335,7 @@ const queryContractListAjax = async (): Promise<void> => {
|
|
|
const result = await request.get({ url: urlApi, params: sendData }, '/business')
|
|
|
tableData.value = result['records']
|
|
|
total.value = result['total']
|
|
|
+ tableRef.value.setScrollLeft(scrollLeft.value)
|
|
|
}
|
|
|
queryContractListAjax()
|
|
|
|
|
@@ -377,6 +383,6 @@ const queryContractListCalc = async (): Promise<void> => {
|
|
|
queryContractListCalc()
|
|
|
|
|
|
onMounted(() => {
|
|
|
- tableHeight.value = tableRef.value.clientHeight
|
|
|
+ tableHeight.value = tableBoxRef.value.clientHeight
|
|
|
})
|
|
|
</script>
|