Commit 58c4ecbc authored by 郭铭瑶's avatar 郭铭瑶 🤘

修改应急物资储备,接入列表接口等

parent e2c03bef
...@@ -55,6 +55,7 @@ export default { ...@@ -55,6 +55,7 @@ export default {
'/service-special-nandong/public/company/statistical', // 公共安全-右侧-实有单位 '/service-special-nandong/public/company/statistical', // 公共安全-右侧-实有单位
GET_PUBLICSAFE_SOS_MATERIAL: GET_PUBLICSAFE_SOS_MATERIAL:
'/service-special-nandong/public/emergencySupplies/1', // 公共安全-右侧-应急物资储备 '/service-special-nandong/public/emergencySupplies/1', // 公共安全-右侧-应急物资储备
GET_SUPPLIES_LIST: '/service-special-nandong/public/emergencySuppliesDetails', // 应急物资储备列表
GET_PUBLICSAFE_OUTHOUSEWALL: GET_PUBLICSAFE_OUTHOUSEWALL:
'/service-special-nandong/public/inspection/statistical', // 公共安全-右侧-房屋外立面 '/service-special-nandong/public/inspection/statistical', // 公共安全-右侧-房屋外立面
GET_PUBLICSAFE_BUILDINGS: '/service-special-nandong/public/inspections', // 公共安全-右侧-重点关注楼宇 GET_PUBLICSAFE_BUILDINGS: '/service-special-nandong/public/inspections', // 公共安全-右侧-重点关注楼宇
......
export function convertName(name: string): string {
let userName = ''
if (!name) return userName
if (name.length == 2) {
userName = name.substring(0, 1) + '*' //截取name 字符串截取第一个字符,
} else if (name.length == 3) {
userName = name.substring(0, 1) + '*' + name.substring(2, 3) //截取第一个和第三个字符
} else if (name.length > 3) {
userName = name.substring(0, 1) + '*' + '*' + name.substring(3, name.length) //截取第一个和大于第4个字符
}
return userName
}
export function convertIds(number: string): string {
if (!number) return ''
return number.replace(/(\d{6})\d*(\d{2})/, '$1**********$2')
}
...@@ -29,6 +29,7 @@ import { defineComponent, PropType, ref, watch } from 'vue' ...@@ -29,6 +29,7 @@ import { defineComponent, PropType, ref, watch } from 'vue'
import empty from '@/assets/images/empty.png' import empty from '@/assets/images/empty.png'
import { ajax, api } from '@/ajax' import { ajax, api } from '@/ajax'
import store from '@/store' import store from '@/store'
import { convertName } from '@/tools/index'
export default defineComponent({ export default defineComponent({
name: 'CaseList', name: 'CaseList',
...@@ -79,7 +80,9 @@ export default defineComponent({ ...@@ -79,7 +80,9 @@ export default defineComponent({
const persons = (data: any) => { const persons = (data: any) => {
const { personInfo } = data const { personInfo } = data
if (personInfo && personInfo.length > 0) { if (personInfo && personInfo.length > 0) {
const result = personInfo.map((item: any) => item.cnName || item.enName) const result = personInfo.map(
(item: any) => convertName(item.cnName) || item.enName
)
return result.join(' | ') return result.join(' | ')
} }
return '无' return '无'
......
...@@ -230,11 +230,11 @@ ...@@ -230,11 +230,11 @@
'cnName:姓名>getName|sex:性别', 'cnName:姓名>getName|sex:性别',
'birthday:出生日期|roomNo:民族', 'birthday:出生日期|roomNo:民族',
'nationalityName:国籍|hometown:籍贯', 'nationalityName:国籍|hometown:籍贯',
'homtownAdmArea:户籍|certCode:证件号', 'homtownAdmArea:户籍|certCode:证件号>convertIds',
'educationName:学历|maritalStatus:婚姻状况', 'educationName:学历|maritalStatus:婚姻状况',
]" ]"
:data="personDetail" :data="personDetail"
:formatter="{ getName }" :formatter="{ getName, convertIds }"
label-width="1.2rem" label-width="1.2rem"
/> />
<SubTitle>标签信息</SubTitle> <SubTitle>标签信息</SubTitle>
...@@ -244,22 +244,22 @@ ...@@ -244,22 +244,22 @@
<m-table <m-table
:template="[ :template="[
'姓名|国籍/户籍|证件号|性别|婚姻状况|入住时间', '姓名|国籍/户籍|证件号|性别|婚姻状况|入住时间',
'cnName>getName|nationalityName|certCode|sex|maritalStatus|time', 'cnName>getName|nationalityName|certCode>convertIds|sex|maritalStatus|time',
]" ]"
selectable selectable
:data="roomInfo.personInfo" :data="roomInfo.personInfo"
:formatter="{ getName }" :formatter="{ getName, convertIds }"
@select="selectPerson" @select="selectPerson"
/> />
<SubTitle>历史居住人</SubTitle> <SubTitle>历史居住人</SubTitle>
<m-table <m-table
:template="[ :template="[
'姓名|国籍/户籍|证件号|性别|婚姻状况|入住时间', '姓名|国籍/户籍|证件号|性别|婚姻状况|入住时间',
'cnName>getName|nationalityName|certCode|sex|maritalStatus|time', 'cnName>getName|nationalityName|certCode>convertIds|sex|maritalStatus|time',
]" ]"
selectable selectable
:data="roomInfo.personInfo" :data="roomInfo.personInfo"
:formatter="{ getName }" :formatter="{ getName, convertIds }"
@select="selectPerson" @select="selectPerson"
/> />
</template> </template>
...@@ -276,6 +276,7 @@ import SubTitle from '../components/sub-title.vue' ...@@ -276,6 +276,7 @@ import SubTitle from '../components/sub-title.vue'
import CaseList from '../components/case-list.vue' import CaseList from '../components/case-list.vue'
import { ajax, api } from '@/ajax' import { ajax, api } from '@/ajax'
import empty from '@/assets/images/empty.png' import empty from '@/assets/images/empty.png'
import { convertName, convertIds } from '@/tools/index'
export default defineComponent({ export default defineComponent({
name: 'PopulationDrawer', name: 'PopulationDrawer',
...@@ -405,7 +406,7 @@ export default defineComponent({ ...@@ -405,7 +406,7 @@ export default defineComponent({
showBuildingRoom.value = true showBuildingRoom.value = true
} }
const getName = (_: unknown, data: any) => { const getName = (_: unknown, data: any) => {
return data.cnName || data.enName return convertName(data.cnName) || data.enName
} }
const deviceType = ref('大门') const deviceType = ref('大门')
const deviceOptions = ref([ const deviceOptions = ref([
...@@ -519,6 +520,7 @@ export default defineComponent({ ...@@ -519,6 +520,7 @@ export default defineComponent({
selectBuilding, selectBuilding,
buildingRoomList, buildingRoomList,
getName, getName,
convertIds,
deviceType, deviceType,
deviceOptions, deviceOptions,
deviceList, deviceList,
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, onBeforeUnmount, ref } from 'vue' import { defineComponent, onBeforeUnmount, ref } from 'vue'
import { getDate, getTime } from '@/components/MyComponent/util' import { getDate, getTime } from '@/components/MyComponent/util'
import store from '@/store'
export default defineComponent({ export default defineComponent({
name: 'MyTitle', name: 'MyTitle',
......
<template> <template>
<m-card title="应急物资储备" style="height: 1.5rem"> <m-card title="应急物资储备" style="height: 0.8rem">
<div class="wrapper"> <div class="wrapper">
<div> <div>
<m-sub2>街道</m-sub2>
<div class="emergency"> <div class="emergency">
<div v-for="(item, index) in list" :key="index"> <div
<m-count class="count orange-count" :value="+item.value" /> v-for="(item, index) in list"
<span>{{ item.name }}</span> :key="index"
<!-- <span></span> @click="selectSupplies(item.key)"
<p>{{ item.name }}</p> --> >
</div>
</div>
</div>
<div>
<m-sub2>金外滩</m-sub2>
<div class="emergency">
<div v-for="(item, index) in list2" :key="index">
<m-count class="count orange-count" :value="+item.value" /> <m-count class="count orange-count" :value="+item.value" />
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<!-- <span></span>
<p>{{ item.name }}</p> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -112,6 +102,23 @@ ...@@ -112,6 +102,23 @@
/> />
</div> </div>
</m-modal> </m-modal>
<m-modal
v-model="showSuppliesModal"
width="40%"
offset="60%"
title="应急物资储备清单"
:mask-closable="false"
>
<div>
<m-table
:template="[
'序号|类别|数量|物资名称*2|规格*2|储备地点*3|联系人*2|联系电话*2|备注*2',
'index|suppliesType|suppliesNum|suppliesName|specification|reserveAddr|contactPerson|phone|remark',
]"
:data="suppliesList"
/>
</div>
</m-modal>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -137,7 +144,7 @@ export default defineComponent({ ...@@ -137,7 +144,7 @@ export default defineComponent({
const pieData = computed(() => store.state.pubulicSafePieData) const pieData = computed(() => store.state.pubulicSafePieData)
const outHouseWall = computed(() => store.state.pubulicSafeOutHouseWall) const outHouseWall = computed(() => store.state.pubulicSafeOutHouseWall)
const year = ref('2020') //年份 const year = ref('2021') //年份
const yearOptions = ref(['2021', '2020', '2019']) //年份option const yearOptions = ref(['2021', '2020', '2019']) //年份option
const houseSum = ref([ const houseSum = ref([
{ name: '检查楼数', value: 0 }, { name: '检查楼数', value: 0 },
...@@ -222,28 +229,6 @@ export default defineComponent({ ...@@ -222,28 +229,6 @@ export default defineComponent({
emergencySupplies = 0, emergencySupplies = 0,
floodPreventionUnits = 0, floodPreventionUnits = 0,
warmAntifreeze = 0, warmAntifreeze = 0,
} = emergencyData.value
return [
{
value: floodPreventionUnits,
name: '防汛防台',
},
{
value: warmAntifreeze,
name: '防寒抗冻',
},
{
value: emergencySupplies,
name: '疫情控制',
},
{
value: emergencyRescue,
name: '应急抢险',
},
]
})
const list2 = computed(() => {
const {
wyEmergencyRescue = 0, wyEmergencyRescue = 0,
wyEmergencySupplies = 0, wyEmergencySupplies = 0,
wyFloodPreventionUnits = 0, wyFloodPreventionUnits = 0,
...@@ -251,20 +236,22 @@ export default defineComponent({ ...@@ -251,20 +236,22 @@ export default defineComponent({
} = emergencyData.value } = emergencyData.value
return [ return [
{ {
value: wyFloodPreventionUnits, value:
name: '防汛防台', +emergencyRescue +
+emergencySupplies +
+floodPreventionUnits +
+warmAntifreeze,
name: '街道应急物资',
key: 'street',
}, },
{ {
value: wyWarmAntifreeze, value:
name: '防寒抗冻', +wyEmergencyRescue +
}, +wyEmergencySupplies +
{ +wyFloodPreventionUnits +
value: wyEmergencySupplies, +wyWarmAntifreeze,
name: '疫情控制', name: '金外滩应急物资',
}, key: 'wy',
{
value: wyEmergencyRescue,
name: '应急抢险',
}, },
] ]
}) })
...@@ -383,10 +370,39 @@ export default defineComponent({ ...@@ -383,10 +370,39 @@ export default defineComponent({
{ immediate: true } { immediate: true }
) )
const showSuppliesModal = ref(false)
const suppliesList = ref<any[]>([])
function selectSupplies(key: string) {
let department = ''
switch (key) {
case 'street':
department = '街道'
break
case 'wy':
department = '金外滩'
break
default:
break
}
ajax
.get({
url: api.GET_SUPPLIES_LIST,
params: { department, pageSize: 9000 },
})
.then((res) => {
suppliesList.value = (res?.data?.content || []).map(
(item: any, i) => ({
index: i + 1,
...item,
})
)
})
showSuppliesModal.value = true
}
return { return {
avatar8, avatar8,
list, list,
list2,
houseSum, houseSum,
listModal, listModal,
population, population,
...@@ -401,6 +417,9 @@ export default defineComponent({ ...@@ -401,6 +417,9 @@ export default defineComponent({
pieData, pieData,
barOption, barOption,
selectBuilding, selectBuilding,
selectSupplies,
showSuppliesModal,
suppliesList,
} }
}, },
}) })
...@@ -413,25 +432,30 @@ export default defineComponent({ ...@@ -413,25 +432,30 @@ export default defineComponent({
height 100% height 100%
display flex display flex
flex-direction column flex-direction column
justify-content space-between justify-content center
.emergency .emergency
display flex display flex
align-items center align-items center
justify-content space-between justify-content space-around
background rgba(70,83,97,.4) background rgba(70,83,97,.4)
padding .04rem 0 padding .08rem 0
box-sizing border-box box-sizing border-box
>div >div
display flex display flex
align-items center align-items center
justify-content center justify-content center
width 20% cursor pointer
transition transform .3s ease-in-out
&:hover
transform scale(1.1)
span
color $orange
.count .count
font-family $font-barlow font-family $font-barlow
font-size .14rem font-size .16rem
margin-right .04rem margin-right .04rem
margin-bottom .04rem
span span
font-size .09rem
color #ccc color #ccc
.out-house .out-house
flex 1 flex 1
...@@ -468,7 +492,7 @@ export default defineComponent({ ...@@ -468,7 +492,7 @@ export default defineComponent({
display flex display flex
flex-wrap wrap flex-wrap wrap
overflow-y auto overflow-y auto
height 1.1rem height 1.8rem
>div >div
width 31% width 31%
padding .05rem .08rem padding .05rem .08rem
......
...@@ -126,11 +126,6 @@ export default defineComponent({ ...@@ -126,11 +126,6 @@ export default defineComponent({
}) })
const houseSum = computed(() => { const houseSum = computed(() => {
return [ return [
{
name: '门面房',
value: pubulicSafeNonResident.value.others,
icon: img3,
},
{ {
name: '商办', name: '商办',
value: pubulicSafeNonResident.value.commercial, value: pubulicSafeNonResident.value.commercial,
...@@ -141,6 +136,11 @@ export default defineComponent({ ...@@ -141,6 +136,11 @@ export default defineComponent({
value: pubulicSafeNonResident.value.comprehensive, value: pubulicSafeNonResident.value.comprehensive,
icon: img10, icon: img10,
}, },
{
name: '其他',
value: pubulicSafeNonResident.value.others,
icon: img3,
},
] ]
}) })
return { return {
......
...@@ -205,7 +205,7 @@ export default defineComponent({ ...@@ -205,7 +205,7 @@ export default defineComponent({
// const total = // const total =
// keys.map((key) => data[key] || 0).reduce((acc, cur) => acc + cur, 0) || // keys.map((key) => data[key] || 0).reduce((acc, cur) => acc + cur, 0) ||
// 1 // 1
const total = 35756 const total = oldData.value?.oldNum || 1
oldType.value = [ oldType.value = [
{ {
name: '孤老', name: '孤老',
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</p> </p>
</div> </div>
<div> <div>
<img :src="mapPhoto" /> <img :src="mapPhoto" @click="openUrl" />
</div> </div>
</div> </div>
</div> </div>
...@@ -168,6 +168,9 @@ export default defineComponent({ ...@@ -168,6 +168,9 @@ export default defineComponent({
searchModal.value = true searchModal.value = true
streetData.value = item streetData.value = item
} }
function openUrl() {
window.open('http://172.21.180.20:8033/Default.aspx', '_blank')
}
return { return {
mapPhoto, mapPhoto,
avatar7, avatar7,
...@@ -184,6 +187,7 @@ export default defineComponent({ ...@@ -184,6 +187,7 @@ export default defineComponent({
curIndex, curIndex,
clickStreetName, clickStreetName,
newFind, newFind,
openUrl,
} }
}, },
}) })
...@@ -238,4 +242,9 @@ export default defineComponent({ ...@@ -238,4 +242,9 @@ export default defineComponent({
flex 1 flex 1
>img >img
width 80% width 80%
cursor pointer
opacity 0.7
transition opacity .3s ease-in-out
&:hover
opacity 1
</style> </style>
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