Commit 0184d012 authored by 郭铭瑶's avatar 郭铭瑶 🤘

设施设备表

parent dfa0d51b
......@@ -10,7 +10,7 @@
<body>
<div id="app"></div>
<script src="/SMap.min.js"></script>
<script src="/dev/SMap.min.js"></script>
<script src="/Plugins.min.js"></script>
<script src="/hls.js"></script>
<script type="module" src="/src/main.ts"></script>
......
......@@ -27,6 +27,7 @@ export default {
GET_COMMUNITY: '/service-basicdatasync-ddd/communities',
GET_MANAGE: '/service-basicdatasync-ddd/css', // 小区管理处
GET_BUILDING: '/service-basicdatasync-ddd/building', // 门牌幢列表
GET_DEVICE: '/service-basicdatasync-ddd/facilitiesEquipment', // 设施设备列表
GET_INDUSTRY_AUTHORITY: '/service-basicdatasync-ddd/indCous', // 业委会列表
GET_HOC_MEMBER: '/service-basicdatasync-ddd/indcou/members', // 业委会成员
GET_COMMITTEE: '/service-basicdatasync-ddd/residentsCommittees', // 居委会列表
......@@ -90,7 +91,7 @@ export default {
GET_ENTRY: '/service-special-nandong/inputUrl', // 业务入口
/** 公共服务 */
GET_ECOLOGY_LIST: '/service-basicdatasync-ddd/nonResident/ecological', // 生态-衣食住行
GET_ECOLOGY_LIST: '/service-special-nandong/nonResident/ecological', // 生态-衣食住行
GET_ECOLOGY_POINTS: '/service-basicdatasync-ddd/nonResidents', // 获取衣食住行撒点
GET_ECOLOGY_CONVENIENT: '/service-special-nandong/convenient/ecological', // 生态-便民设施
GET_ECOLOGY_PHOTO: '/service-special-nandong/buildingPhotos', // 生态 - 商业综合体、文保、历保照片
......
<template>
<teleport to="body">
<teleport to="#app">
<MyAnimate enter="fadeInRight" leave="fadeOutRight">
<div v-if="modelValue" class="my-drawer" :style="{ width: width }">
<img
......@@ -66,7 +66,7 @@ export default defineComponent({
top .45rem
right .05rem
bottom @right
z-index 9999
z-index 99999
$blur()
color #fff
.close-btn
......
......@@ -165,6 +165,7 @@ export interface GlobalStateProps {
elevCount: ElevCountProp[]
responsivity: ResponsivityProp[]
entry: EntryProp[]
emergencyPoints: any[]
}
export default createStore<GlobalStateProps>({
......
......@@ -304,4 +304,8 @@ export default {
SET_ELEV_COUNT(state: GlobalStateProps, data: ElevCountProp[]): void {
state.elevCount = data
},
SET_EMERGENCY_POINTS(state: GlobalStateProps, data: any[]): void {
state.emergencyPoints = data
},
}
......@@ -244,4 +244,5 @@ export default {
elevCount: [],
responsivity: [],
entry: [],
emergencyPoints: [],
} as GlobalStateProps
<template>
<div class="person-list" :class="{ 'select-able': selectAble }">
<template v-if="list && list.length > 0">
<template v-if="data && data.length > 0">
<div
v-for="(item, i) in data"
:key="i"
......@@ -47,7 +47,7 @@ export default defineComponent({
emits: ['select'],
setup(props, ctx) {
const handleClick = (data: unknown) => {
console.log(data);
console.log(data)
ctx.emit('select', data)
}
......@@ -71,10 +71,10 @@ export default defineComponent({
item.personInfo =
(res[index] && res[index].data && res[index].data.content) || {}
})
data.value = content
}
}
store.commit('SET_LOADING', false)
data.value = content || []
},
{ immediate: true }
)
......
......@@ -123,6 +123,15 @@ export default defineComponent({
).data
return content
}
const searchDevice = async (params: any) => {
const { content } = (
await ajax.get({
url: api.GET_DEVICE,
params: { ...params, pageSize: 1000 },
})
).data
return content
}
const searchCompany = async (id: string) => {
const { content } = (
await ajax.get({ url: api.GET_COMPANY, params: { cspId: id } })
......@@ -216,12 +225,15 @@ export default defineComponent({
caseInfo.value = content || []
const { buildingId } = data
if (buildingId) {
// 楼栋信息
const content = await searchBuilding({ unitId: buildingId })
buildingInfo.value = content && content[0]
const sectId = content && content[0] && content[0].sectId
if (sectId) {
// 小区信息
const content = await searchCommunity(null, sectId)
communityInfo.value = content && content[0]
// 管理处信息
const csId = communityInfo.value && communityInfo.value.csId
if (csId) {
const { content } = (
......@@ -234,6 +246,7 @@ export default defineComponent({
} else {
communityInfo.value.manageInfo = {}
}
// 业委会信息
const hocId = communityInfo.value && communityInfo.value.hocId
if (hocId) {
const content = await searchHoc(hocId)
......@@ -243,6 +256,7 @@ export default defineComponent({
} else {
communityInfo.value.hocInfo = {}
}
// 物业信息
const cspId = communityInfo.value && communityInfo.value.cspId
if (cspId) {
const content = await searchCompany(cspId)
......@@ -250,8 +264,12 @@ export default defineComponent({
} else {
propertyInfo.value = {}
}
// 获取小区楼栋列表
communityInfo.value.buildingList =
(await searchBuilding({ sectId })) || []
// 设施设备列表
communityInfo.value.deviceList =
(await searchDevice({ sectId })) || []
} else {
communityInfo.value = {}
}
......@@ -296,6 +314,9 @@ export default defineComponent({
}
communityInfo.value.buildingList =
(await searchBuilding({ sectId: data.sectId })) || []
// 设施设备列表
communityInfo.value.deviceList =
(await searchDevice({ sectId: data.sectId })) || []
communityModal.value = true
populationModal.value = false
caseModal.value = false
......
<template>
<div class="summary-container" :class="{ 'over-two': list.length > 3 }">
<div
class="summary-container"
:class="{ 'over-two': list.length > 3, 'click-able': clickAble }"
@click="handleClick"
>
<div v-for="(item, i) in list" :key="item.name">
<p>
<img v-if="avatar && i === 0" :src="avatar" />
......@@ -30,6 +34,19 @@ export default defineComponent({
type: String as PropType<string>,
default: null,
},
clickAble: {
type: Boolean as PropType<boolean>,
default: false,
},
},
emits: ['select'],
setup(props, ctx) {
const handleClick = () => {
if (props.clickAble) {
ctx.emit('select')
}
}
return { handleClick }
},
})
</script>
......@@ -57,6 +74,11 @@ $create-border()
$card-bg2()
box-sizing border-box
padding .06rem 0
&.click-able
cursor pointer
&:hover
background rgba(70,83,97,0.5)
box-shadow none
&.over-two
>div
&:nth-last-child(2)
......
......@@ -7,6 +7,7 @@
</m-card>
<m-card title="房屋档案">
<m-form
class="basic-info"
:template="[
'stNameFrst:小区名称',
'address:小区地址|cmtName:所属居委会',
......@@ -103,7 +104,30 @@
<m-empty v-else />
</template>
<template v-else-if="curTab === 'device'">
<m-empty />
<div class="select-bar">
<a-select
v-model:value="deviceType"
dropdown-class-name="device-selector-drop-down"
>
<a-select-option
v-for="option in deviceOptions"
:key="option.name"
:value="option.name"
>
{{ option.name }}
</a-select-option>
</a-select>
</div>
<div v-if="deviceList.length > 0" class="device-table">
<m-table
:template="[
'序号|安装位置*2|名称*2|类型|维保单位*3',
'index|ieAddr|ieName|ieType|ieUnit',
]"
:data="deviceList"
/>
</div>
<m-empty v-else />
</template>
<template v-else-if="curTab === 'public'">
<m-empty />
......@@ -200,6 +224,22 @@ export default defineComponent({
showBuildingRoom.value = true
}
const deviceType = ref('大门')
const deviceOptions = ref([
{ name: '大门', type: 'gate' },
{ name: '监控', type: 'monitor' },
{ name: '防盗门', type: 'security' },
{ name: '电梯', type: 'elevator' },
{ name: '消防泵', type: 'fire' },
])
const deviceList = computed(() => {
const { deviceList: list } = props.communityInfo as any
if (!list || list.length === 0) return []
return list
.filter((e: any) => e.ieClassify.includes(deviceType.value))
.map((e: any, i: number) => ({ index: i + 1, ...e }))
})
return {
curTab,
tabs,
......@@ -207,6 +247,9 @@ export default defineComponent({
showBuildingRoom,
selectBuilding,
buildingRoomList,
deviceType,
deviceOptions,
deviceList,
}
},
})
......@@ -238,7 +281,7 @@ export default defineComponent({
&:hover
background $secondary-color
.building-list
max-height 60vh
max-height 53vh
overflow-y auto
>div
display inline-block
......@@ -266,6 +309,53 @@ export default defineComponent({
border-bottom .01rem dotted rgba(91,213,255,.4)
margin .04rem 0
.room-table
max-height 38vh
max-height 50vh
overflow-y auto
.device-table
max-height 48vh
overflow-y auto
</style>
<style lang="stylus">
.community-drawer
.basic-info
margin-bottom .05rem
.row
.col
p
font-weight bold
padding .05rem
$bg = rgba(13, 39, 76, .7)
$size = .1rem
$height = .2rem
.select-bar
margin .04rem 0
.ant-select
background $bg
min-width .9rem
.ant-select-selector
min-width .9rem
border-top none
border-left none
border-right none
height $height
.ant-select-selection-item
font-size $size
line-height $height
text-align center
color #fff
font-weight bold
.ant-select-arrow
font-size $size * 0.8
.device-selector-drop-down
&.ant-select-dropdown
background $bg
font-size $size
.ant-select-item
font-size $size
line-height $height / 2
.ant-select-item-option-selected:not(.ant-select-item-option-disabled)
background $bg
font-size $size
</style>
......@@ -135,7 +135,30 @@
<m-empty v-else />
</template>
<template v-else-if="curTab2 === 'device'">
<m-empty />
<div class="select-bar">
<a-select
v-model:value="deviceType"
dropdown-class-name="device-selector-drop-down"
>
<a-select-option
v-for="option in deviceOptions"
:key="option.name"
:value="option.name"
>
{{ option.name }}
</a-select-option>
</a-select>
</div>
<div v-if="deviceList.length > 0" class="device-table">
<m-table
:template="[
'序号|安装位置*2|名称*2|类型|维保单位*3',
'index|ieAddr|ieName|ieType|ieUnit',
]"
:data="deviceList"
/>
</div>
<m-empty v-else />
</template>
<template v-else-if="curTab2 === 'public'">
<m-empty />
......@@ -329,6 +352,21 @@ export default defineComponent({
const getName = (_: unknown, data: any) => {
return data.cnName || data.enName
}
const deviceType = ref('大门')
const deviceOptions = ref([
{ name: '大门', type: 'gate' },
{ name: '监控', type: 'monitor' },
{ name: '防盗门', type: 'security' },
{ name: '电梯', type: 'elevator' },
{ name: '消防泵', type: 'fire' },
])
const deviceList = computed(() => {
const { deviceList: list } = props.communityInfo as any
if (!list || list.length === 0) return []
return list
.filter((e: any) => e.ieClassify.includes(deviceType.value))
.map((e: any, i: number) => ({ index: i + 1, ...e }))
})
return {
curTab,
tabs,
......@@ -345,6 +383,9 @@ export default defineComponent({
selectBuilding,
buildingRoomList,
getName,
deviceType,
deviceOptions,
deviceList,
}
},
})
......@@ -406,4 +447,43 @@ export default defineComponent({
.room-table
max-height 38vh
overflow-y auto
.device-table
max-height 35vh
overflow-y auto
</style>
<style lang="stylus">
$bg = rgba(13, 39, 76, .7)
$size = .1rem
$height = .2rem
.select-bar
margin .04rem 0
.ant-select
background $bg
min-width .9rem
.ant-select-selector
min-width .9rem
border-top none
border-left none
border-right none
height $height
.ant-select-selection-item
font-size $size
line-height $height
text-align center
color #fff
font-weight bold
.ant-select-arrow
font-size $size * 0.8
.device-selector-drop-down
&.ant-select-dropdown
background $bg
font-size $size
.ant-select-item
font-size $size
line-height $height / 2
.ant-select-item-option-selected:not(.ant-select-item-option-disabled)
background $bg
font-size $size
</style>
......@@ -136,20 +136,31 @@ export default function useSwitchMap(map: any): any {
}
// 撒点相关
watch([() => curPointType.value, () => checkedKeys.value], ([type, keys]) =>
handlePoint(type, keys)
watch(
[() => curPointType.value, () => checkedKeys.value],
([type, keys], [pastType, pastKeys]) => {
if (type === pastType && keys.join() === pastKeys.join()) return
handlePoint(type, keys)
}
)
const ecologyPoints = computed(() => store.state.ecologyPoints)
const mapPoints = ref<any>(null)
const emergencyPoints = computed(() => store.state.emergencyPoints)
const mapEmergency = ref<any>(null)
function handlePoint(type: null | string, keys: string[]) {
if (!map.value) return
const { showCommunity, hideCommunity, addPoint, remove } = map.value
if (keys.length === 0) {
hideCommunity()
remove(mapPoints.value)
return
}
const pointData = type
? ecologyPoints.value.filter((e) => e.labelName === type)
: ecologyPoints.value
const { showCommunity, hideCommunity, addPoint, remove } = map.value
if (keys.some((key) => key === 'community')) {
showCommunity()
} else {
......@@ -164,6 +175,7 @@ export default function useSwitchMap(map: any): any {
// const signPoints = []
// const historyPoints = []
remove(mapEmergency.value)
remove(mapPoints.value)
mapPoints.value = addPoint({
key: 'map-points',
......@@ -194,6 +206,22 @@ export default function useSwitchMap(map: any): any {
})
}
watch(
() => emergencyPoints.value,
(points) => {
if (points.length === 0 || !map.value) return
store.commit('SET_CHECKED_KEYS', [])
const { addPoint, remove } = map.value
remove(mapEmergency.value)
remove(mapPoints.value)
mapEmergency.value = addPoint({
key: 'map-emergency',
size: 20,
data: points,
})
}
)
return {
handleMapComplete,
selectArea,
......
......@@ -6,7 +6,7 @@
gap="0.05rem"
>
<m-title area="title">南东城运</m-title>
<!-- <m-map ref="map" width="71vw" @complete="handleMapComplete" /> -->
<m-map ref="map" width="71vw" @complete="handleMapComplete" />
<m-animate enter="fadeInLeft" leave="fadeOutLeft">
<Command v-show="'street' === curViewType && !fullScreen" area="left" />
</m-animate>
......
......@@ -24,7 +24,12 @@
</a-select-option>
</a-select>
</div>
<Summary :list="houseSum" :avatar="avatar8" />
<Summary
:list="houseSum"
:avatar="avatar8"
click-able
@select="selectBuilding(null)"
/>
<div class="chart-container">
<div class="info">
<div v-for="item in info" :key="item.name">
......@@ -46,7 +51,10 @@
<div v-for="item in buildings" :key="item.id">
<div>
<span>{{ item.projectName }}</span>
<img src="@/assets/images/location.png" />
<img
src="@/assets/images/location.png"
@click="selectBuilding(item)"
/>
</div>
<div class="secRow">
<span>
......@@ -96,6 +104,8 @@ import avatar8 from '@/assets/images/avatar8.png'
import one from '@/assets/images/1.png'
import two from '@/assets/images/2.png'
import three from '@/assets/images/3.png'
import { ajax, api } from '@/ajax'
import dimond2 from '@/assets/images/dimond2.png'
export default defineComponent({
name: 'EmergencyStore',
......@@ -115,10 +125,57 @@ export default defineComponent({
{ name: '危险点数', value: 0 },
])
const buildings = computed(() => {
const data = store.state.pubulicSafeBuildings
return data.filter((e) => e.year === year.value)
})
const pubulicSafeBuildings = computed(
() => store.state.pubulicSafeBuildings
)
const buildings = computed(() =>
pubulicSafeBuildings.value.filter((e: any) => e.year === year.value)
)
const locations = ref<any>({})
watch(
() => pubulicSafeBuildings.value,
async (list) => {
if (list.length === 0) return
const ids = list
.map((item: any) => (item && item.sectId) || '')
.join(',')
const { content } = (
await ajax.get({
url: api.GET_COMMUNITY,
params: { pageSize: 1000, sectId_in: ids },
})
).data
if (content && content.length > 0) {
const obj: any = {}
content.forEach((item: any) => {
obj[item.sectId] = {
x: item.maxx || item.minx,
y: item.maxy || item.miny,
}
})
locations.value = obj
}
},
{ immediate: true }
)
const emergencyPoints = computed(() => store.state.emergencyPoints)
const selectBuilding = (data: any) => {
let points = buildings.value.map((item: any) => ({
...(locations.value[item.sectId] || {}),
...item,
icon: dimond2,
size: 18,
}))
if (data) {
if (!data.sectId) return
if (emergencyPoints.value.length > 0) {
points.find((e: any) => e.sectId === data.sectId).size = 22
} else {
points = [points.find((e: any) => e.sectId === data.sectId)]
}
}
store.commit('SET_EMERGENCY_POINTS', points)
}
//切换年份
const changeYear = (value: string) => {
......@@ -277,6 +334,7 @@ export default defineComponent({
outHouseWall,
pieData,
barOption,
selectBuilding,
}
},
})
......
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