Commit 92a6b586 authored by 郭铭瑶's avatar 郭铭瑶 🤘

修改安全排查和电梯加装

parent 1e98125b
...@@ -8,7 +8,7 @@ const Axios = axios.create({ ...@@ -8,7 +8,7 @@ const Axios = axios.create({
}) })
Axios.interceptors.request.use( Axios.interceptors.request.use(
(config) => { (config) => {
config.baseURL = window._base_url config.baseURL = window._base_url || api.BASE_URL
// 添加token // 添加token
// config.headers.Authorization = '' // config.headers.Authorization = ''
return config return config
......
...@@ -28,6 +28,7 @@ export interface ProgressProps { ...@@ -28,6 +28,7 @@ export interface ProgressProps {
value?: number value?: number
unit?: string unit?: string
color?: string color?: string
decimal?: number
} }
export default defineComponent({ export default defineComponent({
name: 'MyProgress', name: 'MyProgress',
......
<template> <template>
<m-card title="安全排查"> <m-card title="安全排查">
<div class="summary">
<div v-for="item in list" :key="item.name">
<m-count class="orange-count" :value="item.value" :decimal="2" />%
<p>{{ item.name }}</p>
</div>
</div>
<div class="chart-wrapper"> <div class="chart-wrapper">
<template v-if="pieData.source.length > 0"> <template v-if="pieData.source.length > 0">
<div class="chart"> <div class="chart">
...@@ -21,20 +27,6 @@ ...@@ -21,20 +27,6 @@
</template> </template>
<m-empty v-else /> <m-empty v-else />
</div> </div>
<m-progress
v-for="item in list"
:key="item.name"
:value="item.value"
:msg="{
name: item.name,
value: item.value,
unit: '%',
decimal: 2,
color: '#fff',
}"
:color="['rgb(36,59,86)', '#F4923E']"
/>
<p />
</m-card> </m-card>
</template> </template>
...@@ -123,11 +115,9 @@ const list = ref([ ...@@ -123,11 +115,9 @@ const list = ref([
display flex display flex
.chart .chart
width 25% width 25%
height .8rem height 1rem
.legend .legend
flex 1 flex 1
height .8rem
overflow-y auto
.inner .inner
display flex display flex
flex-wrap wrap flex-wrap wrap
...@@ -150,4 +140,10 @@ const list = ref([ ...@@ -150,4 +140,10 @@ const list = ref([
overflow hidden overflow hidden
white-space nowrap white-space nowrap
text-overflow ellipsis text-overflow ellipsis
.summary
display flex
justify-content space-between
margin-bottom .04rem
>div
text-align center
</style> </style>
...@@ -37,8 +37,8 @@ import { ajax } from '@/ajax' ...@@ -37,8 +37,8 @@ import { ajax } from '@/ajax'
ajax.get({ url: _config.apis.main }).then((res) => { ajax.get({ url: _config.apis.main }).then((res) => {
const { statistical, streetData = [] } = res?.data?.content || {} const { statistical, streetData = [] } = res?.data?.content || {}
list.value = [ list.value = [
{ name: '多层住宅房屋', value: +statistical.totalNum || 0, unit: '幢' }, // { name: '多层住宅房屋', value: +statistical.totalNum || 0, unit: '幢' },
{ name: '可加梯门牌数', value: +statistical.caddNum || 0, unit: '幢' }, // { name: '可加梯门牌数', value: +statistical.caddNum || 0, unit: '幢' },
{ name: '完成加梯征询', value: +statistical.passNum || 0, unit: '幢' }, { name: '完成加梯征询', value: +statistical.passNum || 0, unit: '幢' },
{ name: '加梯完工', value: +statistical.finishNum || 0, unit: '幢' }, { name: '加梯完工', value: +statistical.finishNum || 0, unit: '幢' },
] ]
...@@ -100,8 +100,8 @@ const option = { ...@@ -100,8 +100,8 @@ const option = {
], ],
} }
const list = ref([ const list = ref([
{ name: '多层住宅房屋', value: 0, unit: '幢' }, // { name: '多层住宅房屋', value: 0, unit: '幢' },
{ name: '可加梯门牌数', value: 0, unit: '幢' }, // { name: '可加梯门牌数', value: 0, unit: '幢' },
{ name: '完成加梯征询', value: 0, unit: '幢' }, { name: '完成加梯征询', value: 0, unit: '幢' },
{ name: '加梯完工', value: 0, unit: '幢' }, { name: '加梯完工', value: 0, unit: '幢' },
]) ])
...@@ -112,9 +112,7 @@ const list = ref([ ...@@ -112,9 +112,7 @@ const list = ref([
.sum .sum
display flex display flex
justify-content space-between justify-content space-between
flex-wrap wrap
>div >div
width 50%
display flex display flex
align-items center align-items center
font-size .09rem font-size .09rem
......
...@@ -60,48 +60,55 @@ const _config = { ...@@ -60,48 +60,55 @@ const _config = {
export default _config export default _config
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref, watch } from 'vue'
import { NSpace, NSelect } from 'naive-ui' import { NSpace, NSelect } from 'naive-ui'
import { ajax } from '@/ajax' import { ajax } from '@/ajax'
const year = ref('2021') const year = ref('2021')
const total = ref(0) const total = ref(0)
ajax
.get({ watch(
url:_config.apis.main, () => year.value,
params: { year: year.value }, (val) => {
}) ajax
.then((res) => { .get({
const { url: _config.apis.main,
noLivePresaleNum = 0, //非居预售证数 params: { year: val },
totalSets = 0, //总套数 })
liveRate = 0, //居住占比 .then((res) => {
totalPrice = 0, //总金额 const {
presaleNum = 0, //预售证数 noLivePresaleNum = 0, //非居预售证数
noLiveRate = 0, //非居占比 totalSets = 0, //总套数
livePresaleNum = 0, //居住预售证数 liveRate = 0, //居住占比
totalArea = 0, //总面积 totalPrice = 0, //总金额
} = res?.data?.content || {} presaleNum = 0, //预售证数
total.value = totalPrice noLiveRate = 0, //非居占比
list.value = [ livePresaleNum = 0, //居住预售证数
{ totalArea = 0, //总面积
name: '住房', } = res?.data?.content || {}
value: livePresaleNum, total.value = totalPrice
rate: liveRate * 100, list.value = [
color: '#ff9d26', {
}, name: '住房',
{ value: livePresaleNum,
name: '商办', rate: liveRate * 100,
value: noLivePresaleNum, color: '#ff9d26',
rate: noLiveRate * 100, },
color: '#01bffe', {
}, name: '商办',
] value: noLivePresaleNum,
areas.value = [ rate: noLiveRate * 100,
{ name: '预销售面积', value: totalArea, unit: '㎡', decimal: 2 }, color: '#01bffe',
{ name: '预销售套数', value: totalSets, unit: '套', decimal: 0 }, },
] ]
}) areas.value = [
{ name: '预销售面积', value: totalArea, unit: '㎡', decimal: 2 },
{ name: '预销售套数', value: totalSets, unit: '套', decimal: 0 },
]
})
},
{ immediate: true },
)
const yearOptions = [ const yearOptions = [
{ label: '2021', value: '2021' }, { label: '2021', value: '2021' },
......
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