|
|
|
@ -4,6 +4,14 @@ |
|
|
|
<van-nav-bar title="执法评价" left-text="返回" left-arrow @click-left="onClickLeft"> |
|
|
|
</van-nav-bar> |
|
|
|
|
|
|
|
<!-- 搜索栏 --> |
|
|
|
<van-search v-model="searchText" show-action placeholder="请输入关键字查询" clearable clear-trigger="always" |
|
|
|
@clear="onClear" @search="onSearch"> |
|
|
|
<template #action> |
|
|
|
<div @click="onSearch">搜索</div> |
|
|
|
</template> |
|
|
|
</van-search> |
|
|
|
|
|
|
|
<!-- 列表区域 --> |
|
|
|
<div class="list-container"> |
|
|
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> |
|
|
|
@ -71,6 +79,7 @@ const finished = ref(false); |
|
|
|
const refreshing = ref(false); |
|
|
|
const pageNum = ref(1); |
|
|
|
const pageSize = ref(10); |
|
|
|
const searchText = ref(''); |
|
|
|
|
|
|
|
// ========== 获取状态文本 ========== |
|
|
|
const getStatusText = (status) => { |
|
|
|
@ -99,6 +108,9 @@ const fetchList = () => { |
|
|
|
pageSize: pageSize.value, |
|
|
|
hasEvaluate: 1, |
|
|
|
}; |
|
|
|
if (searchText.value) { |
|
|
|
params.searchValue = searchText.value; |
|
|
|
} |
|
|
|
queryEvaluateList(params, (res) => { |
|
|
|
if (res.code === 200) { |
|
|
|
const rows = res.rows || res.data?.rows || res.data?.list || res.data || []; |
|
|
|
@ -146,6 +158,21 @@ const onRefresh = () => { |
|
|
|
fetchList(); |
|
|
|
}; |
|
|
|
|
|
|
|
// ========== 搜索 ========== |
|
|
|
const onSearch = () => { |
|
|
|
pageNum.value = 1; |
|
|
|
list.value = []; |
|
|
|
finished.value = false; |
|
|
|
loading.value = true; |
|
|
|
fetchList(); |
|
|
|
}; |
|
|
|
|
|
|
|
// ========== 清空搜索 ========== |
|
|
|
const onClear = () => { |
|
|
|
searchText.value = ''; |
|
|
|
onSearch(); |
|
|
|
}; |
|
|
|
|
|
|
|
// ========== 跳转详情页面 ========== |
|
|
|
const toDetail = (item) => { |
|
|
|
router.push({ |
|
|
|
@ -287,4 +314,22 @@ onMounted(() => { |
|
|
|
:deep(.van-empty) { |
|
|
|
padding: 60px 0; |
|
|
|
} |
|
|
|
/* ===== Vant 搜索框样式覆盖 ===== */ |
|
|
|
:deep(.van-search__content) { |
|
|
|
height: 0.9rem; |
|
|
|
border: 1px solid #ececec; |
|
|
|
border-radius: 0.15rem 0 0 0.15rem; |
|
|
|
} |
|
|
|
|
|
|
|
:deep(.van-search__action) { |
|
|
|
margin: 0 3% 0 0; |
|
|
|
width: 10%; |
|
|
|
height: 0.9rem; |
|
|
|
background: #1367fe; |
|
|
|
border: 0.01rem solid #1367fe; |
|
|
|
border-radius: 0 0.15rem 0.15rem 0; |
|
|
|
color: #fff; |
|
|
|
text-align: center; |
|
|
|
line-height: 0.9rem; |
|
|
|
} |
|
|
|
</style> |