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

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

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