|
@ -86,7 +86,7 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref, reactive, onMounted, onUnmounted } from "vue"; |
|
|
import { ref, reactive, onMounted, onUnmounted } from "vue"; |
|
|
import { gePolicytList, getPolicyInfo } from "@/api/policy"; |
|
|
import { gePolicytList, getPolicyInfo } from "@/api/policy"; |
|
|
|
|
|
import { Message } from '@arco-design/web-vue' |
|
|
// tabList |
|
|
// tabList |
|
|
const tabList = reactive([ |
|
|
const tabList = reactive([ |
|
|
{ |
|
|
{ |
|
@ -123,14 +123,14 @@ interface PolicyResponse { |
|
|
const showDetail = ref(false); |
|
|
const showDetail = ref(false); |
|
|
const handleClickTab = (item: any) => { |
|
|
const handleClickTab = (item: any) => { |
|
|
active.value = item.dictValue; |
|
|
active.value = item.dictValue; |
|
|
joinIn.pageNo = 1; |
|
|
joinIn.pageNum = 1; |
|
|
joinIn.dictCode = item.dictValue; |
|
|
joinIn.dictCode = item.dictValue; |
|
|
list.value = []; |
|
|
list.value = []; |
|
|
isLoading.value = true; |
|
|
isLoading.value = true; |
|
|
getList(); |
|
|
getList(); |
|
|
}; |
|
|
}; |
|
|
const joinIn = { |
|
|
const joinIn = { |
|
|
pageNo: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 5, |
|
|
pageSize: 5, |
|
|
dictCode: active.value, |
|
|
dictCode: active.value, |
|
|
}; |
|
|
}; |
|
@ -144,7 +144,10 @@ const isLoading = ref(true); |
|
|
// 修改 getList 函数以支持分页加载 |
|
|
// 修改 getList 函数以支持分页加载 |
|
|
const getList = async () => { |
|
|
const getList = async () => { |
|
|
try { |
|
|
try { |
|
|
if (!isLoading.value) return; |
|
|
if (!isLoading.value) { |
|
|
|
|
|
Message.info('没有更多了') |
|
|
|
|
|
return false; |
|
|
|
|
|
}; |
|
|
// 显式指定响应类型 |
|
|
// 显式指定响应类型 |
|
|
const res:PolicyResponse = await gePolicytList(joinIn); |
|
|
const res:PolicyResponse = await gePolicytList(joinIn); |
|
|
list.value = [...list.value, ...res.data]; |
|
|
list.value = [...list.value, ...res.data]; |
|
@ -152,7 +155,7 @@ const getList = async () => { |
|
|
isLoading.value = false; |
|
|
isLoading.value = false; |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
joinIn.pageNo++; |
|
|
joinIn.pageNum++; |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
console.error("获取数据失败:", err); |
|
|
console.error("获取数据失败:", err); |
|
|
} |
|
|
} |
|
|