Commit f3bf8cd1 authored by shilei's avatar shilei

Merge branch 'dev' of http://101.201.78.203/cfld-front/liyeyun into dev

parents 2597f49e c0295f90
<!-- 联系人信息 --> <!-- 联系人信息 -->
<template> <template>
<div class="flex h-[95px] flex-col"> <div class="flex h-[95px] flex-col">
<div <div class="flex h-[100px] flex-none items-center justify-between bg-[#FAFAFC] px-10">
v-if="personName"
class="flex h-[100px] flex-none items-center justify-between bg-[#FAFAFC] px-10"
>
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<div class="flex items-center justify-center"> <div class="flex items-center justify-center">
<div <div
class="flex h-[60px] w-[60px] items-center justify-center rounded bg-[#cccccc] font-yahei text-lg leading-5 text-white" class="flex h-[60px] w-[60px] items-center justify-center rounded bg-[#cccccc] font-yahei text-lg leading-5 text-white"
> >
{{ personName?.[0] }} {{ noPerson ? '空' : personName?.[0] }}
</div> </div>
</div> </div>
<div> <div>
<div class="text-center font-yahei text-sm font-bold text-[#1A1A1A]"> <div class="text-center font-yahei text-sm font-bold text-[#1A1A1A]">
{{ personName }} {{ personName || '暂无对接人' }}
</div> </div>
<div class="mt-[5px] rounded-sm text-sm text-[#4F4F4F]">园区对接人</div> <div class="mt-[5px] rounded-sm text-sm text-[#4F4F4F]">园区对接人</div>
</div> </div>
...@@ -23,9 +20,10 @@ ...@@ -23,9 +20,10 @@
<div> <div>
<div <div
class="flex h-[44px] w-[128px] cursor-pointer items-center justify-center rounded-[4px] bg-[#C0322B] px-[23px] text-base leading-[22px] text-white" class="flex h-[44px] w-[128px] cursor-pointer items-center justify-center rounded-[4px] bg-[#C0322B] px-[23px] text-base leading-[22px] text-white"
:class="{ 'cursor-not-allowed opacity-[.45]': noPerson }"
@click="handleContact" @click="handleContact"
> >
{{ isShowPhone && phone ? phone : '立即沟通' }} {{ btnContent }}
</div> </div>
</div> </div>
</div> </div>
...@@ -85,6 +83,20 @@ const isLogin = computed(() => { ...@@ -85,6 +83,20 @@ const isLogin = computed(() => {
return appStore.isLogin; return appStore.isLogin;
}); });
const noPerson = computed(() => {
return !props.personName;
});
const btnContent = computed(() => {
if (isShowPhone.value && phone.value) {
return phone.value;
} else if (noPerson.value) {
return '暂无对接人';
} else {
return '立即沟通';
}
});
const changeShowPhone = (b: boolean) => { const changeShowPhone = (b: boolean) => {
isShowPhone.value = b; isShowPhone.value = b;
}; };
...@@ -109,7 +121,7 @@ const handlePhone = async () => { ...@@ -109,7 +121,7 @@ const handlePhone = async () => {
}; };
const handleContact = () => { const handleContact = () => {
if (!phone.value) { if (!phone.value && !noPerson.value) {
if (isLogin.value) { if (isLogin.value) {
handlePhone(); handlePhone();
} else { } else {
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
视频 视频
</div> </div>
<div <div
v-if="imageUrls.length > 0"
class="flex flex-1 items-center justify-center rounded-[50px]" class="flex flex-1 items-center justify-center rounded-[50px]"
:class="{ 'bg-white text-[#C0322B]': isPictureType }" :class="{ 'bg-white text-[#C0322B]': isPictureType }"
@click="changeListType(ListType.picture)" @click="changeListType(ListType.picture)"
......
...@@ -59,7 +59,12 @@ ...@@ -59,7 +59,12 @@
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="name" :label="typeName + '名称'"> <ElTableColumn prop="name" :label="typeName + '名称'">
<template #default="{ row }"> <template #default="{ row }">
<div class="link cursor-pointer" @click="toDetail(row)">{{ row.name }}</div> <div
class="cursor-pointer text-sm leading-6 text-[#2C68FF] hover:underline"
@click="toDetail(row)"
>
{{ row.name }}
</div>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="isSystemName" label="来源方式"></ElTableColumn> <ElTableColumn prop="isSystemName" label="来源方式"></ElTableColumn>
...@@ -68,7 +73,10 @@ ...@@ -68,7 +73,10 @@
<ElTableColumn prop="statusName" label="审批状态"></ElTableColumn> <ElTableColumn prop="statusName" label="审批状态"></ElTableColumn>
<ElTableColumn label="操作"> <ElTableColumn label="操作">
<template #default="{ row }"> <template #default="{ row }">
<div class="cursor-pointer text-sm leading-6 text-[#2C68FF]" @click="toDetail(row)"> <div
class="cursor-pointer text-sm leading-6 text-[#2C68FF] hover:underline"
@click="toDetail(row)"
>
查看 查看
</div> </div>
</template> </template>
...@@ -195,8 +203,3 @@ const handleReset = () => { ...@@ -195,8 +203,3 @@ const handleReset = () => {
searchParams.value = '' as any; searchParams.value = '' as any;
}; };
</script> </script>
<style scoped>
.link:hover {
text-decoration: underline;
}
</style>
import { useQueryList } from '@/composable/useQueryList.ts'; import { useQueryList } from '@/composable/useQueryList.ts';
import { ref, type Ref, watchEffect, nextTick, type ShallowRef } from 'vue'; import { ref, type Ref, watchEffect, nextTick, type ShallowRef, computed } from 'vue';
import { RequestUrl } from '@/types/api.ts'; import { RequestUrl } from '@/types/api.ts';
import type { CommonListResp, CommonListParams } from '@/types/common'; import type { CommonListResp, CommonListParams } from '@/types/common';
import type { RouteName } from '@/router/router.ts'; import type { RouteName } from '@/router/router.ts';
import { useRoute, onBeforeRouteLeave } from 'vue-router'; import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { useSearchParamsStore } from '@/stores/searchParams.ts'; import { useSearchParamsStore } from '@/stores/searchParams.ts';
import { cloneDeep } from 'lodash-es'; import { cloneDeep, isEmpty } from 'lodash-es';
import { useRequest } from './useRequest.ts'; import { useRequest } from './useRequest.ts';
import { useJump } from './useJump.ts'; import { useJump } from './useJump.ts';
...@@ -13,7 +13,7 @@ type CurrentUrl = RequestUrl | ShallowRef<{ target: RequestUrl }>; ...@@ -13,7 +13,7 @@ type CurrentUrl = RequestUrl | ShallowRef<{ target: RequestUrl }>;
export function useListView< export function useListView<
T extends { id: number; [index: string]: any }, T extends { id: number; [index: string]: any },
C extends Record<any, any> & { name?: string }, C extends Record<any, any> & { name?: string },
>(url: CurrentUrl) { >(url: CurrentUrl, specialParams: Ref<Record<string, any>> = {} as any) {
const { open, router } = useJump(); const { open, router } = useJump();
const getCurrentUrl = () => { const getCurrentUrl = () => {
if (typeof url === 'string') { if (typeof url === 'string') {
...@@ -41,6 +41,26 @@ export function useListView< ...@@ -41,6 +41,26 @@ export function useListView<
const searchParams = ref<C>(cloneDeep(searchParamsStore.urlSearchParams) || {}); const searchParams = ref<C>(cloneDeep(searchParamsStore.urlSearchParams) || {});
const isRequesting = ref(false); const isRequesting = ref(false);
const otherParams = computed(() => {
const { searchName } = searchParamsStore;
return {
...specialParams.value,
...(searchName ? { name: searchName } : {}),
};
});
const currentParams = computed(() => {
return {
...searchParams.value,
...otherParams.value,
};
});
/** 是否存在搜索参数 */
const haveSearchParams = computed(() => {
return !isEmpty(currentParams.value);
});
/** /**
* 清除url传递的参数 * 清除url传递的参数
*/ */
...@@ -57,7 +77,13 @@ export function useListView< ...@@ -57,7 +77,13 @@ export function useListView<
watchEffect(async () => { watchEffect(async () => {
try { try {
changeIsRequesting(true); changeIsRequesting(true);
const { data } = await queryList(searchParams.value || {}, getCurrentUrl()); const { data } = await queryList(
{
...searchParams.value,
...otherParams.value,
} || {},
getCurrentUrl(),
);
handleUrlClear(); handleUrlClear();
datas.value = data.records; datas.value = data.records;
} catch (error) { } catch (error) {
...@@ -87,14 +113,8 @@ export function useListView< ...@@ -87,14 +113,8 @@ export function useListView<
for (const item of selectList.value) { for (const item of selectList.value) {
temp[item.key] = item.value; temp[item.key] = item.value;
} }
const { searchName } = searchParamsStore;
if (searchName) {
temp.name = searchName;
}
initPagination(); initPagination();
const { investmentDirection } = searchParams.value;
temp.investmentDirection = investmentDirection;
searchParams.value = temp; searchParams.value = temp;
}; };
...@@ -103,10 +123,9 @@ export function useListView< ...@@ -103,10 +123,9 @@ export function useListView<
*/ */
const handleNameSearch = (params: { name: string }) => { const handleNameSearch = (params: { name: string }) => {
nextTick(() => { nextTick(() => {
if (searchParams.value.name !== params.name) { if (searchParamsStore.searchName !== params.name) {
searchParams.value.name = params.name; initPagination();
} }
initPagination();
}); });
}; };
...@@ -121,6 +140,7 @@ export function useListView< ...@@ -121,6 +140,7 @@ export function useListView<
totalCount, totalCount,
datas, datas,
isRequesting, isRequesting,
haveSearchParams,
queryList, queryList,
handleDetail, handleDetail,
initPagination, initPagination,
......
...@@ -47,7 +47,7 @@ export function useQueryList<T, C>(queryFn: QueryFn<T, CommonListParams<C>>) { ...@@ -47,7 +47,7 @@ export function useQueryList<T, C>(queryFn: QueryFn<T, CommonListParams<C>>) {
}; };
const initPagination = () => { const initPagination = () => {
changePagination({ page: 1, size: 10, total: 0 }); changePagination({ page: 1, size: 10 });
}; };
const assignPageParams = (params: C): CommonListParams<C> => { const assignPageParams = (params: C): CommonListParams<C> => {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div> <div>
<!-- 载体列表 --> <!-- 载体列表 -->
<p v-if="!isEmpty(searchParams)" class="mb-7 text-sm font-medium text-[#4d4d4d]"> <p v-if="haveSearchParams" class="mb-7 text-sm font-medium text-[#4d4d4d]">
搜索到 搜索到
<span class="text-[#C0322B]">{{ totalCount }}</span> <span class="text-[#C0322B]">{{ totalCount }}</span>
个相关载体 个相关载体
...@@ -48,7 +48,6 @@ import CommonTitle from '@/components/common/CommonTitle.vue'; ...@@ -48,7 +48,6 @@ import CommonTitle from '@/components/common/CommonTitle.vue';
import FilterView from '@/components/filter/filter-view.vue'; import FilterView from '@/components/filter/filter-view.vue';
import type { CarrierListCondition, CarrierListItem } from '@/types/api/carrierList'; import type { CarrierListCondition, CarrierListItem } from '@/types/api/carrierList';
import { ref } from 'vue'; import { ref } from 'vue';
import { isEmpty } from 'lodash-es';
const { const {
pageNum, pageNum,
...@@ -58,7 +57,7 @@ const { ...@@ -58,7 +57,7 @@ const {
handleDetail, handleDetail,
handleFilterChange, handleFilterChange,
handleNameSearch, handleNameSearch,
searchParams, haveSearchParams,
} = useListView<CarrierListItem, CarrierListCondition>(RequestUrl.carrierList); } = useListView<CarrierListItem, CarrierListCondition>(RequestUrl.carrierList);
// 筛选项 // 筛选项
const filterKeyList = ref([ const filterKeyList = ref([
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<FormModal></FormModal> <FormModal></FormModal>
</div> </div>
<div> <div>
<p v-if="!isEmpty(searchParams)" class="mb-7 text-sm font-medium text-[#4d4d4d]"> <p v-if="haveSearchParams" class="mb-7 text-sm font-medium text-[#4d4d4d]">
搜索到 搜索到
<span class="text-[#C0322B]">{{ totalCount }}</span> <span class="text-[#C0322B]">{{ totalCount }}</span>
个相关开发区 个相关开发区
...@@ -48,7 +48,6 @@ import type { DevelopZoneItem, DevelopZoneListCondition } from '@/types/api/deve ...@@ -48,7 +48,6 @@ import type { DevelopZoneItem, DevelopZoneListCondition } from '@/types/api/deve
import { ParkItemType } from '@/types/enum.ts'; import { ParkItemType } from '@/types/enum.ts';
import FilterView from '@/components/filter/filter-view.vue'; import FilterView from '@/components/filter/filter-view.vue';
import CommonTitle from '@/components/common/CommonTitle.vue'; import CommonTitle from '@/components/common/CommonTitle.vue';
import { isEmpty } from 'lodash-es';
// 筛选项列表 // 筛选项列表
const filterKeyList = [ const filterKeyList = [
...@@ -67,6 +66,6 @@ const { ...@@ -67,6 +66,6 @@ const {
handleDetail, handleDetail,
handleFilterChange, handleFilterChange,
handleNameSearch, handleNameSearch,
searchParams, haveSearchParams,
} = useListView<DevelopZoneItem, DevelopZoneListCondition>(RequestUrl.developZoneList); } = useListView<DevelopZoneItem, DevelopZoneListCondition>(RequestUrl.developZoneList);
</script> </script>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<FormModal></FormModal> <FormModal></FormModal>
</div> </div>
<div> <div>
<p v-if="!isEmpty(searchParams)" class="mb-7 text-sm font-medium text-[#4d4d4d]"> <p v-if="haveSearchParams" class="mb-7 text-sm font-medium text-[#4d4d4d]">
搜索到 搜索到
<span class="text-[#C0322B]">{{ totalCount }}</span> <span class="text-[#C0322B]">{{ totalCount }}</span>
个相关产业园 个相关产业园
...@@ -50,7 +50,6 @@ import ListPagination from '@/components/list/ListPagination.vue'; ...@@ -50,7 +50,6 @@ import ListPagination from '@/components/list/ListPagination.vue';
import FilterView from '@/components/filter/filter-view.vue'; import FilterView from '@/components/filter/filter-view.vue';
import CommonTitle from '@/components/common/CommonTitle.vue'; import CommonTitle from '@/components/common/CommonTitle.vue';
import ParkItem from '@/components/list/ParkItem.vue'; import ParkItem from '@/components/list/ParkItem.vue';
import { isEmpty } from 'lodash-es';
// import FormModal from '@/components/form-modal/FormModal.vue'; // import FormModal from '@/components/form-modal/FormModal.vue';
import type { import type {
IndustrialParkItem, IndustrialParkItem,
...@@ -66,7 +65,7 @@ const { ...@@ -66,7 +65,7 @@ const {
handleDetail, handleDetail,
handleFilterChange, handleFilterChange,
handleNameSearch, handleNameSearch,
searchParams, haveSearchParams,
} = useListView<IndustrialParkItem, IndustrialParkListCondition>(RequestUrl.industrialParkList); } = useListView<IndustrialParkItem, IndustrialParkListCondition>(RequestUrl.industrialParkList);
// 筛选项 // 筛选项
const filterKeyList = [ const filterKeyList = [
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
@change="handleFilterChange" @change="handleFilterChange"
></FilterView> ></FilterView>
<template v-if="datas.length"> <template v-if="datas.length">
<p v-if="!isEmpty(searchParams)" class="mb-7 text-sm font-medium text-[#4d4d4d]"> <p v-if="haveSearchParams" class="mb-7 text-sm font-medium text-[#4d4d4d]">
搜索到 搜索到
<span class="text-[#C0322B]">{{ totalCount }}</span> <span class="text-[#C0322B]">{{ totalCount }}</span>
个相关{{ tabList[activeTab].name }} 个相关{{ tabList[activeTab].name }}
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowRef, watch, onMounted, nextTick } from 'vue'; import { ref, shallowRef, watch, onMounted, nextTick, computed } from 'vue';
import { useRequest } from '@/composable/useRequest.ts'; import { useRequest } from '@/composable/useRequest.ts';
import { RequestUrl } from '@/types/api.ts'; import { RequestUrl } from '@/types/api.ts';
import { useListView } from '@/composable/useListView.ts'; import { useListView } from '@/composable/useListView.ts';
...@@ -114,7 +114,6 @@ import CarrierListItemView from '@/components/list/list-carrier-item.vue'; ...@@ -114,7 +114,6 @@ import CarrierListItemView from '@/components/list/list-carrier-item.vue';
import LandListItemView from '@/components/list/list-land-item.vue'; import LandListItemView from '@/components/list/list-land-item.vue';
import ParkItem from '@/components/list/ParkItem.vue'; import ParkItem from '@/components/list/ParkItem.vue';
import FilterView from '@/components/filter/filter-view.vue'; import FilterView from '@/components/filter/filter-view.vue';
import { isEmpty } from 'lodash-es';
type tabItem = { type tabItem = {
name: string; name: string;
...@@ -181,6 +180,12 @@ onMounted(async () => { ...@@ -181,6 +180,12 @@ onMounted(async () => {
} }
}); });
const otherParams = computed(() => {
return {
investmentDirection: currentDirection.value,
};
});
const { const {
pageNum, pageNum,
pageSize, pageSize,
...@@ -188,13 +193,12 @@ const { ...@@ -188,13 +193,12 @@ const {
datas, datas,
handleDetail, handleDetail,
handleFilterChange, handleFilterChange,
searchParams, haveSearchParams,
isRequesting, isRequesting,
} = useListView(currentUrl); } = useListView(currentUrl, otherParams);
const handleDirectionClick = (item: string) => { const handleDirectionClick = (item: string) => {
currentDirection.value = item; currentDirection.value = item;
searchParams.value.investmentDirection = item;
}; };
watch( watch(
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<FormModal></FormModal> <FormModal></FormModal>
</div> </div>
<div> <div>
<p v-if="!isEmpty(searchParams)" class="mb-7 text-sm font-medium text-[#4d4d4d]"> <p v-if="haveSearchParams" class="mb-7 text-sm font-medium text-[#4d4d4d]">
搜索到 搜索到
<span class="text-[#C0322B]">{{ totalCount }}</span> <span class="text-[#C0322B]">{{ totalCount }}</span>
个相关土地 个相关土地
...@@ -49,8 +49,7 @@ import LandListItemView from '@/components/list/list-land-item.vue'; ...@@ -49,8 +49,7 @@ import LandListItemView from '@/components/list/list-land-item.vue';
import CommonTitle from '@/components/common/CommonTitle.vue'; import CommonTitle from '@/components/common/CommonTitle.vue';
import FilterView from '@/components/filter/filter-view.vue'; import FilterView from '@/components/filter/filter-view.vue';
import type { LandListCondition, LandListItem } from '@/types/api/landList'; import type { LandListCondition, LandListItem } from '@/types/api/landList';
import { ref, watch } from 'vue'; import { ref } from 'vue';
import { isEmpty } from 'lodash-es';
const Response = useListView<LandListItem, LandListCondition>(RequestUrl.landList); const Response = useListView<LandListItem, LandListCondition>(RequestUrl.landList);
const { const {
...@@ -61,13 +60,8 @@ const { ...@@ -61,13 +60,8 @@ const {
handleDetail, handleDetail,
handleFilterChange, handleFilterChange,
handleNameSearch, handleNameSearch,
searchParams, haveSearchParams,
} = Response; } = Response;
console.log(searchParams);
watch(searchParams, () => {
console.log(isEmpty(searchParams.value));
});
const filterKeyList = ref(['land_price', 'land_type', 'land_area']); const filterKeyList = ref(['land_price', 'land_type', 'land_area']);
</script> </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