Commit 967aafbf authored by 王玉鑫's avatar 王玉鑫

feat: 首页产业政策查询跳转

parent e6468ea8
......@@ -14,7 +14,7 @@ type CurrentUrl = RequestUrl | ShallowRef<{ target: RequestUrl }>;
export function useListView<
T extends { id: number; [index: string]: any },
C extends Record<any, any> & { name?: string },
>(url: CurrentUrl, specialParams: Ref<Record<string, any>> = {} as any) {
>(url: CurrentUrl, specialParams: Ref<Record<string, any>> = {} as any, nameField = 'name') {
const { open, router } = useJump();
const getCurrentUrl = () => {
if (typeof url === 'string') {
......@@ -46,7 +46,7 @@ export function useListView<
const { searchName } = searchParamsStore;
return {
...specialParams.value,
...(searchName ? { name: searchName } : {}),
...(searchName ? { [nameField]: searchName } : {}),
};
});
......
......@@ -55,7 +55,12 @@
>
找产业分类
</span>
<span style="cursor: default">找产业政策</span>
<span
:class="{ active: searchType === 'policy' }"
@click="changeSearchType('policy', '356px', '产业政策')"
>
找产业政策
</span>
<i class="absolute" :style="{ left: searchArrowLeft }"></i>
</div>
<!-- 搜索框 -->
......@@ -250,6 +255,9 @@ const toList = () => {
case 'category':
name = RouteName.industryCategory;
break;
case 'policy':
name = RouteName.industryPolicy;
break;
default:
break;
}
......
......@@ -36,11 +36,12 @@ import { useListView } from '@/composable/useListView.ts';
import { RouteName } from '@/router/router.ts';
import { RequestUrl } from '@/types/api.ts';
import ListPagination from '@/components/list/ListPagination.vue';
import { ref } from 'vue';
const { pageNum, pageSize, totalCount, datas, handleDetail, handleNameSearch } = useListView<
PolicyListItem,
PolicyListCondition
>(RequestUrl.policyList);
>(RequestUrl.policyList, ref({}), 'title');
</script>
<style lang="scss" scoped>
.title-bottom-bg {
......
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