Commit 687bda87 authored by 郭铭瑶's avatar 郭铭瑶 🤘

安全排查&电梯加装点击emit出撒点数据(目前还没有坐标)

parent 44edffbe
......@@ -19,15 +19,9 @@
</div>
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue'
export default defineComponent({
name: 'ServeDev',
})
</script>
<script lang="ts" setup>
import { computed } from 'vue'
import * as components from '@/lib/index'
import eventBus from '@/util/event-bus'
const isPro = computed(() => process.env.NODE_ENV === 'production')
function copyName(name) {
......@@ -38,9 +32,6 @@ function copyName(name) {
document.execCommand('Copy')
document.body.removeChild(input)
}
eventBus.on('map', (e: any) => {
console.log('emit by bus:', e)
})
</script>
<style lang="stylus" scoped>
......
......@@ -9,7 +9,7 @@
<p><slot /></p>
<div v-if="addition" class="addition">
<MyCount
v-if="addition.value"
v-if="addition.value || addition.value === 0"
class="count orange-count"
:value="addition.value"
/>
......
......@@ -38,7 +38,7 @@ export interface BriefProp {
name: string
value: number | number[]
icon?: any
data?: any
[key: string]: unknown
}
export default defineComponent({
name: 'Brief',
......
......@@ -24,7 +24,8 @@ const _config = {
row: 1,
baseUrl: window._base_url,
apis: {
community: '/service-basicdatasync-ddd/public/communities',
// community: '/service-basicdatasync-ddd/public/communities',
community: '/service-customkey-ddd/public/communities/v2?pageSize=9000',
nonResident: '/service-basicdatasync-ddd/public/nonResi/buildings',
api1: '/service-basicdatasync-ddd/public/indCous',
api2: '/service-basicdatasync-ddd/public/residentsCommitteesV2',
......@@ -41,28 +42,40 @@ import icon6 from '@/assets/images/icon6.png'
import icon7 from '@/assets/images/icon7.png'
import icon8 from '@/assets/images/icon8.png'
import icon9 from '@/assets/images/icon9.png'
import Brief from '@/components/brief.vue'
import { ref } from 'vue'
import c1 from '@/assets/images/c1.png'
import c2 from '@/assets/images/c2.png'
import c3 from '@/assets/images/c3.png'
import c4 from '@/assets/images/c4.png'
import c5 from '@/assets/images/c5.png'
import c6 from '@/assets/images/c6.png'
import Brief, { BriefProp } from '@/components/brief.vue'
import { onMounted, ref } from 'vue'
import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
const totalCommunityCount = ref(0)
const summary = ref([
{ icon: icon4, name: '商品房', value: 0, data: [] },
{ icon: icon5, name: '公房', value: 0, data: [] },
{ icon: icon1, name: '公租房', value: 0, data: [] },
{ icon: icon6, name: '混合', value: 0, data: [] },
{ icon: icon7, name: '军产', value: 0, data: [] },
{ icon: icon8, name: '售后房', value: 0, data: [] },
const summary = ref<BriefProp[]>([
{ icon: icon4, name: '商品房', value: 0, point: c1 },
{ icon: icon5, name: '公房', value: 0, point: c2 },
{ icon: icon1, name: '公租房', value: 0, point: c3 },
{ icon: icon6, name: '混合', value: 0, point: c4 },
{ icon: icon7, name: '军产', value: 0, point: c5 },
{ icon: icon8, name: '售后房', value: 0, point: c6 },
])
ajax
.get({
onMounted(() => {
ajax
.post({
url: _config.apis.community,
params: { sectType: '1', pageSize: 9000 },
params: {
conditions: [{ conditionsGroup: [] }],
subject: 'tbl_community',
},
})
.then((res) => {
const data = res?.data?.content || []
bus.emit('communityList', { icon: c6, data })
totalCommunityCount.value = data.length
// 1商品房 2动迁房 3共有产权保障房 4售后房 5直管公房 6混合 7系统公房 8集体土地集资房 9军产 10私产 11公租房
const list = {
type1: data.filter((item) => item?.stKind == '01'),
type2: data.filter(
......@@ -79,42 +92,50 @@ ajax
name: '商品房',
value: list.type1?.length || 0,
data: list.type1,
point: c1,
},
{
icon: icon5,
name: '公房',
value: list.type2?.length || 0,
data: list.type2,
point: c2,
},
{
icon: icon1,
name: '公租房',
value: list.type3?.length || 0,
data: list.type3,
point: c3,
},
{
icon: icon6,
name: '混合',
value: list.type4?.length || 0,
data: list.type4,
point: c4,
},
{
icon: icon7,
name: '军产',
value: list.type5?.length || 0,
data: list.type5,
point: c5,
},
{
icon: icon8,
name: '售后房',
value: list.type6?.length || 0,
data: list.type6,
point: c6,
},
]
})
})
const onTouch = (i: number) => {
bus.emit('addPoints', summary.value[i].data)
const { data, point } = summary.value[i]
bus.emit('addPoints', { icon: point, data })
}
const nonResident = ref([])
......@@ -124,7 +145,7 @@ ajax
nonResident.value = res?.data?.content || []
})
const onSelect = () => {
bus.emit('addPoints', nonResident.value)
bus.emit('addPoints', { icon: c1, data: nonResident.value })
}
const list = ref([
......
......@@ -38,6 +38,7 @@ const _config = {
baseUrl: window._base_url,
apis: {
main: '/service-special-ja-ddd/public/risk/type/statistical',
list: '/service-special-ja-ddd/public/wholeBuildingRiskss',
},
}
export default _config
......@@ -46,13 +47,31 @@ export default _config
import { ref } from 'vue'
import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
import p1 from '@/assets/images/p1.png'
import p3 from '@/assets/images/p3.png'
import p4 from '@/assets/images/p4.png'
ajax.get({ url: _config.apis.main }).then((res) => {
const { checkRate, riskTypeStatistical = [] } = res?.data?.content || {}
list.value = [
{ name: '需专业排查', value: +checkRate.judgeType * 100 || 0 },
{ name: '需应急排险', value: +checkRate.isEmergencyRisk * 100 || 0 },
{ name: '小梁薄板', value: +checkRate.isThinPlate * 100 || 0 },
{
name: '需专业排查',
value: +checkRate.judgeType * 100 || 0,
query: { judgeType: '需专业排查评估' },
icon: p1,
},
{
name: '需应急排险',
value: +checkRate.isEmergencyRisk * 100 || 0,
query: { isEmergencyRisk: true },
icon: p3,
},
{
name: '小梁薄板',
value: +checkRate.isThinPlate * 100 || 0,
query: { isThinPlate: true },
icon: p4,
},
]
const total = riskTypeStatistical.reduce((acc, cur) => acc + +cur.num, 0)
pieData.source = riskTypeStatistical.map((item) => ({
......@@ -103,14 +122,21 @@ const pieOption = {
},
],
}
const list = ref([
const list = ref<any[]>([
{ name: '需专业排查', value: 0 },
{ name: '需应急排险', value: 0 },
{ name: '小梁薄板', value: 0 },
])
function onClick({ name }) {
bus.emit('addPoints', name)
async function onClick({ query, icon }) {
const data =
(
await ajax.get({
url: _config.apis.list,
params: { pageSize: 9000, createTime_desc: 'desc', ...query },
})
)?.data?.content || []
bus.emit('addPoints', { data, icon })
}
</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