Commit e28d3a7f authored by 郭铭瑶's avatar 郭铭瑶 🤘

调整

parent e5a21d99
...@@ -291,7 +291,7 @@ export default { ...@@ -291,7 +291,7 @@ export default {
const { content } = ( const { content } = (
await ajax.get({ await ajax.get({
url: api.GET_ECOLOGY_POINTS, url: api.GET_ECOLOGY_POINTS,
params: { labelName: name }, params: { labelName: name, pageSize: 1000 },
}) })
).data ).data
commit('SET_ECOLOGY_POINTS', content) commit('SET_ECOLOGY_POINTS', content)
......
...@@ -128,6 +128,24 @@ export default defineComponent({ ...@@ -128,6 +128,24 @@ export default defineComponent({
).data ).data
return content return content
} }
const searchHoc = async (id: string) => {
const { content } = (
await ajax.get({
url: api.GET_INDUSTRY_AUTHORITY,
params: { hocId: id },
})
).data
return content
}
const searchHocMember = async (id: string) => {
const { content } = (
await ajax.get({
url: api.GET_HOC_MEMBER,
params: { hocId: id },
})
).data
return content
}
const handleSearch = async () => { const handleSearch = async () => {
const address = searchKey.value const address = searchKey.value
switch (searchType.value) { switch (searchType.value) {
...@@ -217,19 +235,9 @@ export default defineComponent({ ...@@ -217,19 +235,9 @@ export default defineComponent({
} }
const hocId = communityInfo.value && communityInfo.value.hocId const hocId = communityInfo.value && communityInfo.value.hocId
if (hocId) { if (hocId) {
const { content } = ( const content = await searchHoc(hocId)
await ajax.get({
url: api.GET_INDUSTRY_AUTHORITY,
params: { hocId },
})
).data
communityInfo.value.hocInfo = (content && content[0]) || {} communityInfo.value.hocInfo = (content && content[0]) || {}
const { content: memberList } = ( const memberList = await searchHocMember(hocId)
await ajax.get({
url: api.GET_HOC_MEMBER,
params: { hocId },
})
).data
communityInfo.value.hocInfo.memberList = memberList || [] communityInfo.value.hocInfo.memberList = memberList || []
} else { } else {
communityInfo.value.hocInfo = {} communityInfo.value.hocInfo = {}
...@@ -271,19 +279,9 @@ export default defineComponent({ ...@@ -271,19 +279,9 @@ export default defineComponent({
} }
const hocId = communityInfo.value && communityInfo.value.hocId const hocId = communityInfo.value && communityInfo.value.hocId
if (hocId) { if (hocId) {
const { content } = ( const content = await searchHoc(hocId)
await ajax.get({
url: api.GET_INDUSTRY_AUTHORITY,
params: { hocId },
})
).data
communityInfo.value.hocInfo = (content && content[0]) || {} communityInfo.value.hocInfo = (content && content[0]) || {}
const { content: memberList } = ( const memberList = await searchHocMember(hocId)
await ajax.get({
url: api.GET_HOC_MEMBER,
params: { hocId },
})
).data
communityInfo.value.hocInfo.memberList = memberList || [] communityInfo.value.hocInfo.memberList = memberList || []
} else { } else {
communityInfo.value.hocInfo = {} communityInfo.value.hocInfo = {}
......
...@@ -15,12 +15,6 @@ ...@@ -15,12 +15,6 @@
</div> </div>
</div> </div>
<m-sub2 :addition="{ value: 33, unit: '幢' }">电梯加装(排摸)</m-sub2> <m-sub2 :addition="{ value: 33, unit: '幢' }">电梯加装(排摸)</m-sub2>
<!-- <div v-if="curViewType === 'street'" class="sum-card">
<div v-for="item in elevList" :key="item.name">
<m-count class="count" :value="item.value" />
<p>{{ item.name }}</p>
</div>
</div> -->
<m-sub2>马桶改造</m-sub2> <m-sub2>马桶改造</m-sub2>
<Brief :list="toiletSituation" color="#fff" /> <Brief :list="toiletSituation" color="#fff" />
<m-progress <m-progress
...@@ -59,26 +53,10 @@ export default defineComponent({ ...@@ -59,26 +53,10 @@ export default defineComponent({
{ name: '充电桩', value: 64, icon: icon33 }, { name: '充电桩', value: 64, icon: icon33 },
{ name: '雨污混接', value: 18, icon: icon34 }, { name: '雨污混接', value: 18, icon: icon34 },
]) ])
const elevList = ref([
{ name: '振兴', value: 9 },
{ name: '福海', value: 5 },
{ name: '江阴', value: 7 },
{ name: '定兴', value: 1 },
{ name: '新昌', value: 5 },
{ name: '小花园', value: 5 },
{ name: '顺天村', value: 1 },
])
const toiletSituation = ref<BriefProp[]>([ const toiletSituation = ref<BriefProp[]>([
{ name: '已完成改造', value: 26, icon: icon35 }, { name: '已完成改造', value: 26, icon: icon35 },
{ name: '应改造', value: 64, icon: icon36 }, { name: '应改造', value: 64, icon: icon36 },
]) ])
const workStationProjects = ref([
{ name: '架空线梳理', value: 16 },
{ name: '店招店牌美化', value: 26 },
{ name: '绿化整治', value: 15 },
{ name: '外立面整治', value: 8 },
{ name: '公共设置', value: 8 },
])
const barData = { const barData = {
dimensions: [ dimensions: [
{ name: 'name', displayName: '类型' }, { name: 'name', displayName: '类型' },
...@@ -114,9 +92,7 @@ export default defineComponent({ ...@@ -114,9 +92,7 @@ export default defineComponent({
curViewType, curViewType,
summary, summary,
situation, situation,
elevList,
toiletSituation, toiletSituation,
workStationProjects,
barData, barData,
chartOption, chartOption,
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<m-sub2>马桶改造</m-sub2> <m-sub2>马桶改造</m-sub2>
<Brief :list="toiletSituation" color="#fff" /> <Brief :list="toiletSituation" color="#fff" />
<m-progress <m-progress
v-if="show"
:value=" :value="
Math.round( Math.round(
(toiletSituation[0].value / toiletSituation[1].value) * 100 (toiletSituation[0].value / toiletSituation[1].value) * 100
...@@ -59,6 +60,7 @@ export default defineComponent({ ...@@ -59,6 +60,7 @@ export default defineComponent({
name: 'BeautyHome', name: 'BeautyHome',
components: { Brief }, components: { Brief },
setup() { setup() {
const show = computed(() => store.state.curTheme === 'service')
const summary = ref([ const summary = ref([
{ name: '2020年', value: 26 }, { name: '2020年', value: 26 },
{ name: '2019年', value: 24 }, { name: '2019年', value: 24 },
...@@ -79,7 +81,10 @@ export default defineComponent({ ...@@ -79,7 +81,10 @@ export default defineComponent({
if (!curCmtName.value) return if (!curCmtName.value) return
const { content } = ( const { content } = (
await ajax.get({ url: api.GET_ELEV_LIST, params: { cmtName: name } }) await ajax.get({
url: api.GET_ELEV_LIST,
params: { cmtName: name, pageSize: 1000 },
})
).data ).data
// TODO 可能要出列表或者地图撒点之类的 // TODO 可能要出列表或者地图撒点之类的
console.log(`美丽街区-加装电梯-${name}区域电梯列表`, content) console.log(`美丽街区-加装电梯-${name}区域电梯列表`, content)
...@@ -101,6 +106,7 @@ export default defineComponent({ ...@@ -101,6 +106,7 @@ export default defineComponent({
{ name: '公共设置', value: 8 }, { name: '公共设置', value: 8 },
]) ])
return { return {
show,
summary, summary,
situation, situation,
elevList, elevList,
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
</div> </div>
</div> </div>
</div> </div>
<m-empty v-else />
</div> </div>
</m-card> </m-card>
</template> </template>
......
...@@ -18,18 +18,26 @@ ...@@ -18,18 +18,26 @@
</div> </div>
<m-sub2>分类排行</m-sub2> <m-sub2>分类排行</m-sub2>
<div class="chart wrapper"> <div class="chart wrapper">
<div> <template
<p v-for="item in classChartData.dimensions" :key="item.name"> v-if="
{{ item.displayName }} classChartData.dimensions &&
<m-count classChartData.dimensions.length > 0
class="count" "
:value="classChartData.source[0][item.name]" >
/> <div>
</p> <p v-for="item in classChartData.dimensions" :key="item.name">
</div> {{ item.displayName }}
<div v-if="showChart"> <m-count
<m-radar :dataset="classChartData" :option="chartOption2" /> class="count"
</div> :value="classChartData.source[0][item.name]"
/>
</p>
</div>
<div v-if="showChart">
<m-radar :dataset="classChartData" :option="chartOption2" />
</div>
</template>
<m-empty v-else style="width: 100%" />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
</div> </div>
</div> </div>
<div> <div>
<div v-if="showChart" class="duty-type"> <div v-if="rankType.length > 0" class="duty-type">
<div v-for="item in mock" :key="item.name"> <div v-for="item in rankType" :key="item.name">
<div class="circle"> <div class="circle">
<Circle <Circle
class="circle-item" class="circle-item"
:value="+item.rate" :value="+item.value"
:stroke-width="8" :stroke-width="8"
:color="['#F7933E', 'rgba(253,211,116,.9)']" :color="['#F7933E', 'rgba(253,211,116,.9)']"
:rate="2.4" :rate="2.4"
...@@ -27,23 +27,8 @@ ...@@ -27,23 +27,8 @@
</div> </div>
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
</div> </div>
<!-- <div v-if="showChart && pieData.source.length > 0" class="chart">
<m-pie :dataset="pieData" :option="pieOption" />
</div>
<m-empty v-else />
<div class="legend">
<div v-for="(item, i) in pieData.source" :key="item.name">
<p>
<span :style="{ background: pieOption.color[i] }" />
{{ item.name }}
</p>
<p>
{{ Math.ceil((item.value / total) * 100).toFixed(0) }}%
<m-count :value="item.value" />
</p>
</div>
</div> -->
</div> </div>
<m-empty v-else />
</div> </div>
<div class="rank"> <div class="rank">
<m-sub2>分类排行</m-sub2> <m-sub2>分类排行</m-sub2>
...@@ -203,53 +188,26 @@ export default defineComponent({ ...@@ -203,53 +188,26 @@ export default defineComponent({
})), })),
})) }))
const pieData = computed(() => { const rankType = computed(() => {
const data = store.state.dutyRank[curOption.value] || [] const data = store.state.dutyRank[curOption.value] || []
return { if (data.length === 0) return []
dimensions: [ const total = data.reduce((acc, cur) => acc + cur.num, 0)
{ name: 'name', displayName: '类型' }, return data.map((item: any) => {
{ name: 'value', displayName: '数量' }, return {
],
source: data.map((item: any) => ({
name: item.businsessType, name: item.businsessType,
value: item.num, value: +Math.ceil((item.num / total) * 100).toFixed(0),
})), }
} })
})
const total = computed(() => {
if (!pieData.value.source) return 0
return pieData.value.source.reduce((acc, cur) => acc + cur.value, 0)
})
const pieOption = ref({
color: ['#00BFFF', '#FFCE34', '#826AFA', '#589C20', '#F47C1F'],
legend: { show: false },
series: [
{
type: 'pie',
radius: [0, '80%'],
center: ['40%', '50%'],
label: {
show: false,
},
},
],
}) })
return { return {
mock: [ rankType,
{ name: '事件类型1', value: 3110, rate: 62 },
{ name: '事件类型2', value: 3110, rate: 62 },
{ name: '事件类型3', value: 3110, rate: 62 },
],
showChart, showChart,
total,
options, options,
curOption, curOption,
rankList, rankList,
placeList, placeList,
barData, barData,
barOption, barOption,
pieData,
pieOption,
} }
}, },
}) })
......
...@@ -138,7 +138,11 @@ export default defineComponent({ ...@@ -138,7 +138,11 @@ export default defineComponent({
const photos2 = computed(() => const photos2 = computed(() =>
photosList.value.filter((e) => e.buildingType.includes('文保')) photosList.value.filter((e) => e.buildingType.includes('文保'))
) )
const getPoints = (name: string) => store.dispatch('getEcologyPoints', name) const getPoints = (name: string) => {
store.dispatch('getEcologyPoints', name)
// TODO 撒点
console.log(`生态—${name}点位信息:`, store.state.ecologyPoints)
}
return { return {
ecologyList, ecologyList,
sumList, sumList,
......
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