Commit e5a21d99 authored by 郭铭瑶's avatar 郭铭瑶 🤘

档案弹窗基本完成(业委会成员/设施设备/公共设施暂无数据)

parent c202ad50
...@@ -24,9 +24,11 @@ export default { ...@@ -24,9 +24,11 @@ export default {
GET_LIST: '/service-special-nandong/classifyAddrs', // 根据地址搜索 GET_LIST: '/service-special-nandong/classifyAddrs', // 根据地址搜索
GET_ROOM: '/service-special-nandong/households', // 获取分户 GET_ROOM: '/service-special-nandong/households', // 获取分户
GET_PERSON: '/service-special-nandong/personnels', // 实有人口 GET_PERSON: '/service-special-nandong/personnels', // 实有人口
GET_COMMUNITY_DETAIL: '/service-basicdatasync-ddd/communities', GET_COMMUNITY: '/service-basicdatasync-ddd/communities',
GET_MANAGE: '/service-basicdatasync-ddd/css', // 小区管理处
GET_BUILDING: '/service-basicdatasync-ddd/building', // 门牌幢列表 GET_BUILDING: '/service-basicdatasync-ddd/building', // 门牌幢列表
GET_INDUSTRY_AUTHORITY: '/service-basicdatasync-ddd/indCous', // 业委会列表 GET_INDUSTRY_AUTHORITY: '/service-basicdatasync-ddd/indCous', // 业委会列表
GET_HOC_MEMBER: '/service-basicdatasync-ddd/indcou/members', // 业委会成员
GET_COMMITTEE: '/service-basicdatasync-ddd/residentsCommittees', // 居委会列表 GET_COMMITTEE: '/service-basicdatasync-ddd/residentsCommittees', // 居委会列表
GET_COMPANY: '/service-basicdatasync-ddd/propCompanies', // 物业列表 GET_COMPANY: '/service-basicdatasync-ddd/propCompanies', // 物业列表
GET_CASE: '/service-special-nandong/compairs', // 案件汇总列表 GET_CASE: '/service-special-nandong/compairs', // 案件汇总列表
......
...@@ -177,7 +177,7 @@ export default defineComponent({ ...@@ -177,7 +177,7 @@ export default defineComponent({
background transparent background transparent
$full() $full()
p p
padding .05rem padding 0 .05rem
margin 0 margin 0
flex 1 flex 1
box-sizing border-box box-sizing border-box
......
<template>
<div class="community-list" :class="{ 'select-able': selectAble }">
<template v-if="list && list.length > 0">
<div
v-for="(item, i) in list"
:key="i"
class="community-item"
@click="handleClick(item)"
>
<div>
<p>{{ item.stNameFrst }}</p>
<span>
<b>{{ item.sectTypeName }}</b>
</span>
<template v-if="item.cmtName"> | {{ item.cmtName }} | </template>
</div>
<p>{{ item.addrFrst }}</p>
<p>{{ item.cspName }}</p>
</div>
</template>
<m-empty v-else :img="empty" hidden-text />
</div>
</template>
<script lang="ts">
import { defineComponent, PropType, ref } from 'vue'
import empty from '@/assets/images/empty.png'
export default defineComponent({
name: 'CommunityList',
props: {
list: {
type: Array as PropType<any[] | null>,
default: () => {
return []
},
},
selectAble: {
type: Boolean as PropType<boolean>,
default: false,
},
},
emits: ['select'],
setup(_, ctx) {
const handleClick = (data: unknown) => {
ctx.emit('select', data)
}
const data = ref<any>([])
return {
data,
empty,
handleClick,
}
},
})
</script>
<style lang="stylus" scoped>
@import '../../components/MyComponent/main.styl'
.community-list
width 100%
height 100%
padding-right .05rem
overflow-y auto
&.select-able
.community-item
cursor pointer
transition all .1s ease
&:hover
background rgba(70,83,97,.25)
box-shadow none
.community-item
position relative
margin-bottom .08rem
padding .05rem .08rem
overflow hidden
background rgba(70,83,97,.45)
box-shadow 0 0 .04rem 0 rgba(44,51,70,.65), inset 0 .01rem .02rem 0 rgba(204,204,204,.2)
border-radius .04rem
>p
&:nth-of-type(1)
color #ccc
&:nth-of-type(2)
color $blue
>div
display flex
align-items center
border-bottom .01rem dotted rgba(91,213,255,.5)
margin-bottom .08rem
padding-bottom .06rem
color #ccc
p
font-size .11rem
font-weight bold
color #fff
span
display inline-block
font-size .08rem
padding 0 .06rem
border-radius .08rem
margin 0 .1rem
transform skew(-30deg)
background $edge
>b
display inline-block
transform skew(30deg)
font-weight normal
color #000
</style>
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
<template v-else-if="searchType === 'population'"> <template v-else-if="searchType === 'population'">
<PersonList :list="list" select-able @select="handleSelect" /> <PersonList :list="list" select-able @select="handleSelect" />
</template> </template>
<template v-else-if="searchType === 'community'"></template> <template v-else-if="searchType === 'community'">
<CommunityList :list="list" select-able @select="handleSelect" />
</template>
</template> </template>
<m-empty v-else /> <m-empty v-else />
</div> </div>
...@@ -63,6 +65,7 @@ import CommunityDrawer from '@/view/drawers/community-drawer.vue' ...@@ -63,6 +65,7 @@ import CommunityDrawer from '@/view/drawers/community-drawer.vue'
import { ajax, api } from '@/ajax' import { ajax, api } from '@/ajax'
import CaseList from './case-list.vue' import CaseList from './case-list.vue'
import PersonList from './person-list.vue' import PersonList from './person-list.vue'
import CommunityList from './community-list.vue'
export default defineComponent({ export default defineComponent({
name: 'SearchView', name: 'SearchView',
...@@ -72,6 +75,7 @@ export default defineComponent({ ...@@ -72,6 +75,7 @@ export default defineComponent({
CommunityDrawer, CommunityDrawer,
CaseList, CaseList,
PersonList, PersonList,
CommunityList,
}, },
setup() { setup() {
const searchType = ref('case') const searchType = ref('case')
...@@ -96,15 +100,34 @@ export default defineComponent({ ...@@ -96,15 +100,34 @@ export default defineComponent({
).data ).data
return content return content
} }
const searchCommunity = async (address: string, pageSize = 100) => { const searchCommunity = async (
address: unknown,
sectId: unknown,
pageSize = 100
) => {
const { content } = ( const { content } = (
await ajax.get({ await ajax.get({
url: api.GET_LIST, url: api.GET_COMMUNITY,
params: { pageSize, addr_l: address, classifyName: '小区' }, params: { addrFrst_l: address, pageSize, sectId },
}) })
).data ).data
return content return content
} }
const searchBuilding = async (params: any) => {
const { content } = (
await ajax.get({
url: api.GET_BUILDING,
params: { ...params, pageSize: 100 },
})
).data
return content
}
const searchCompany = async (id: string) => {
const { content } = (
await ajax.get({ url: api.GET_COMPANY, params: { cspId: id } })
).data
return content
}
const handleSearch = async () => { const handleSearch = async () => {
const address = searchKey.value const address = searchKey.value
switch (searchType.value) { switch (searchType.value) {
...@@ -115,7 +138,7 @@ export default defineComponent({ ...@@ -115,7 +138,7 @@ export default defineComponent({
list.value = await searchRoom(address) list.value = await searchRoom(address)
break break
case 'community': case 'community':
list.value = await searchCommunity(address) list.value = await searchCommunity(address, null)
break break
default: default:
list.value = [] list.value = []
...@@ -132,82 +155,151 @@ export default defineComponent({ ...@@ -132,82 +155,151 @@ export default defineComponent({
const caseInfo = ref<any>(null) const caseInfo = ref<any>(null)
const roomInfo = ref<any>(null) const roomInfo = ref<any>(null)
const buildingInfo = ref<any>(null) const buildingInfo = ref<any>(null)
const handleSelect = async (item: any) => { const handleSelect = async (item: unknown) => {
caseInfo.value = item switch (searchType.value) {
if (item.communityId) { case 'case':
const { content } = ( await selectCase(item)
await ajax.get({ break
url: api.GET_COMMUNITY_DETAIL, case 'population':
params: { sectId: item.communityId }, await selectRoom(item)
}) break
).data case 'community':
await selectCommunity(item)
break
default:
communityModal.value = false
populationModal.value = false
caseModal.value = false
break
}
}
async function selectCase(data: any) {
caseInfo.value = data
if (data.communityId) {
const content = await searchCommunity(null, data.communityId)
communityInfo.value = content && content[0] communityInfo.value = content && content[0]
const cspId = content && content[0] && content[0].cspId const cspId = content && content[0] && content[0].cspId
if (cspId) { if (cspId) {
const { content } = ( const content = await searchCompany(cspId)
await ajax.get({ url: api.GET_COMPANY, params: { cspId } })
).data
propertyInfo.value = content && content[0] propertyInfo.value = content && content[0]
} }
} else { } else {
communityInfo.value = {} communityInfo.value = {}
propertyInfo.value = {} propertyInfo.value = {}
} }
if (searchType.value === 'case') { caseModal.value = true
caseModal.value = true populationModal.value = false
populationModal.value = false communityModal.value = false
communityModal.value = false }
} else { async function selectRoom(data: any) {
const { content } = ( roomInfo.value = data
await ajax.get({ const content = await searchCase(data.address || data.addr)
url: api.GET_CASE, caseInfo.value = content || []
params: { pageSize: 200, address_l: item.address || item.addr }, const { buildingId } = data
}) if (buildingId) {
).data const content = await searchBuilding({ unitId: buildingId })
caseInfo.value = content || [] buildingInfo.value = content && content[0]
if (searchType.value === 'population') { const sectId = content && content[0] && content[0].sectId
if (item.addr) { if (sectId) {
const content = await searchCommunity(null, sectId)
communityInfo.value = content && content[0]
const csId = communityInfo.value && communityInfo.value.csId
if (csId) {
const { content } = ( const { content } = (
await ajax.get({ url: api.GET_ROOM, params: { addr: item.addr } }) await ajax.get({
url: api.GET_MANAGE,
params: { csId },
})
).data ).data
roomInfo.value = content && content[0] communityInfo.value.manageInfo = (content && content[0]) || {}
const buildingId = content && content[0] && content[0].buildingId
if (buildingId) {
const { content } = (
await ajax.get({
url: api.GET_BUILDING,
params: { unitId: buildingId },
})
).data
buildingInfo.value = content && content[0]
const sectId = content && content[0] && content[0].sectId
if (sectId) {
const { content } = (
await ajax.get({
url: api.GET_COMMUNITY_DETAIL,
params: { sectId },
})
).data
communityInfo.value = content && content[0]
} else {
communityInfo.value = null
}
} else {
buildingInfo.value = null
}
} else { } else {
roomInfo.value = null communityInfo.value.manageInfo = {}
} }
const hocId = communityInfo.value && communityInfo.value.hocId
populationModal.value = true if (hocId) {
caseModal.value = false const { content } = (
communityModal.value = false await ajax.get({
} else if (searchType.value === 'community') { url: api.GET_INDUSTRY_AUTHORITY,
communityModal.value = true params: { hocId },
populationModal.value = false })
caseModal.value = false ).data
communityInfo.value.hocInfo = (content && content[0]) || {}
const { content: memberList } = (
await ajax.get({
url: api.GET_HOC_MEMBER,
params: { hocId },
})
).data
communityInfo.value.hocInfo.memberList = memberList || []
} else {
communityInfo.value.hocInfo = {}
}
const cspId = communityInfo.value && communityInfo.value.cspId
if (cspId) {
const content = await searchCompany(cspId)
propertyInfo.value = content && content[0]
} else {
propertyInfo.value = {}
}
communityInfo.value.buildingList =
(await searchBuilding({ sectId })) || []
} else {
communityInfo.value = {}
} }
} else {
buildingInfo.value = {}
}
populationModal.value = true
caseModal.value = false
communityModal.value = false
}
async function selectCommunity(data: any) {
const content = await searchCase(data.addrFrst)
caseInfo.value = content || []
communityInfo.value = data
const csId = communityInfo.value && communityInfo.value.csId
if (csId) {
const { content } = (
await ajax.get({
url: api.GET_MANAGE,
params: { csId },
})
).data
communityInfo.value.manageInfo = (content && content[0]) || {}
} else {
communityInfo.value.manageInfo = {}
}
const hocId = communityInfo.value && communityInfo.value.hocId
if (hocId) {
const { content } = (
await ajax.get({
url: api.GET_INDUSTRY_AUTHORITY,
params: { hocId },
})
).data
communityInfo.value.hocInfo = (content && content[0]) || {}
const { content: memberList } = (
await ajax.get({
url: api.GET_HOC_MEMBER,
params: { hocId },
})
).data
communityInfo.value.hocInfo.memberList = memberList || []
} else {
communityInfo.value.hocInfo = {}
}
const cspId = communityInfo.value && communityInfo.value.cspId
if (cspId) {
const content = await searchCompany(cspId)
propertyInfo.value = content && content[0]
} else {
propertyInfo.value = {}
} }
communityInfo.value.buildingList =
(await searchBuilding({ sectId: data.sectId })) || []
communityModal.value = true
populationModal.value = false
caseModal.value = false
} }
return { return {
searchType, searchType,
......
...@@ -87,7 +87,7 @@ export default defineComponent({ ...@@ -87,7 +87,7 @@ export default defineComponent({
color $edge color $edge
font-size .09rem font-size .09rem
opacity 0.6 opacity 0.6
transition all .2s ease transition all .1s ease
&.on &.on
&:hover &:hover
color #fff color #fff
......
This diff is collapsed.
This diff is collapsed.
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