Commit 07f7d217 authored by 郭铭瑶's avatar 郭铭瑶 🤘

更新接口

parent a4313de3
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -10,7 +10,8 @@
<body>
<div id="app"></div>
<script src="/SMap.min.js"></script>
<!-- <script src="/SMap.min.js"></script> -->
<script src="/dev/SMap.min.js"></script>
<script src="/Plugins.min.js"></script>
<script src="/hls.js"></script>
<script type="module" src="/src/main.ts"></script>
......
......@@ -19,7 +19,7 @@
"echarts-wordcloud": "^2.0.0",
"normalize.css": "^8.0.1",
"qs": "^6.9.6",
"vue": "^3.0.5",
"vue": "^3.1.5",
"vue-router": "^4.0.6",
"vuex": "^4.0.0"
},
......
......@@ -35,6 +35,7 @@ export default {
GET_CASE: '/service-special-nandong/compairs', // 案件汇总列表
GET_CASE_DETAIL: '/service-special-nandong/compair', // 案件详情
GET_FOR_OLD: '/service-special-nandong/forOldFacilitiess', // 为老
GET_MARKETS: '/service-special-nandong/vegetableMarkets', // 菜场、药店、便利店
GET_DUNGS: '/service-special-nandong/urDungs', // 倒粪口
GET_BINS: '/service-special-nandong/internalDustbins', // 垃圾箱
......@@ -55,8 +56,8 @@ export default {
// 左侧公共
GET_PUBLICSAFE_COMMANDSYSTEM: '/service-special-nandong/commandSystem', // 指挥体系
GET_PUBLICSAFE_STREETPOWER: '/service-special-nandong/streetPower', // 网格工作站(原名街道力量)
GET_PUBLICSAFE_PARTY: '/service-special-nandong/party', // 党建
GET_PUBLICSAFE_STREETPOWER: '/service-special-nandong/workstations', // 网格工作站(原名街道力量)
GET_PUBLICSAFE_PARTY: '/service-special-nandong/partyConstruction/1', // 党建
GET_PUBLICSAFE_ECONOMIC: '/service-special-nandong/economic', // 经济
/** 小区屏 */
......@@ -102,5 +103,9 @@ export default {
GET_ECOLOGY_PHOTO: '/service-special-nandong/buildingPhotos', // 生态 - 商业综合体、文保、历保照片
GET_ELEV_COUNT: '/service-special-nandong/elevatorAdd/workstation', // 美丽家园-电梯加装统计数字
GET_ELEV_LIST: '/service-special-nandong/elevatorAdds', // 美丽家园 - 根据名称查询列表
GET_TOILET: '/service-special-nandong/toilet/renovation', // 马桶改造
GET_TOILET: '/service-special-nandong/toiletRenovations', // 马桶改造
GET_BEAUTY_STREET: '/service-special-nandong/beautifulStreets', // 美丽街区
GET_BEAUTY_HOME: '/service-special-nandong/beautifulHomes', // 美丽家园
GET_EVENTS: '/service-special-nandong/compairs', // 事件
}
......@@ -11,7 +11,7 @@ Axios.interceptors.request.use(
(config) => {
// 添加token
config.headers.Authorization =
'bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMiIsImp0aSI6IjdiMWQ3ODRhLWY2ZjEtNGM5ZS1iYTRlLWJhM2FiMDNkYzRiZCIsImVuYWJsZSI6dHJ1ZSwiY2xpZW50X2lkIjoic3NvIiwidGltZXN0YW1wIjoxNjE4NDYzMzQ5NTY4LCJzY29wZSI6WyJyZWFkIiwid3JpdGUiLCJ0cnVzdCJdfQ.JnyKdHUPFIrb4CWZg2JyoU8JTXGZvWVN2kQNYnhKj-vBBt7eAmmJ9I3JqYBC2MieAF-qiNPvJDO0_pL54Ko2xZ0JpeflXMbr5GMqKoozNiZYcNdqsN8AWew4PPKTGr7gcdGQEO1_eLtTXvwnGVTiAP8vqPpLGFaKs282yWc9tdDp1976RjEEi4Knb5VEbnHiW1oyyCZ3WPGHCjO7M6s7iNNh0inA5Af-r7JZNTNL89gEH1lj3dEHReiPMylnwMCi4F5oOY4er6PNIkIjEoA0ydEpaC4YyEhbXGHrXKUsXZxQc8XoS99PLdVumWreDq6KCuZis-qm_T_lfFTTp1gmJA'
'bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMCIsImVuYWJsZSI6dHJ1ZSwic2NvcGUiOlsicmVhZCIsIndyaXRlIiwidHJ1c3QiXSwiZXhwIjoxNjMyNDc4MjczLCJqdGkiOiJiNWJlNjVhMS0xOTZmLTQ0MWQtYWUxYy1hNjFhMTM3YTE1ZmYiLCJjbGllbnRfaWQiOiJzc28iLCJ0aW1lc3RhbXAiOjE2MzI0NzEwNzMwNTh9.BppOUuGxmYTgAPr2XloyhaxrKI49_loj901RPLyizu9wEgVr40CpBGOcTDSy4LlYAwcRYCcRxm6xYBW5TNm5jH5iljHRi796CRnO6kyQUycnwdog4J-J3n_vkVPTqOg-CfO6KThnbrqkksxI14Lv8sYQXcT03ypMQlwC-_P56WK7h2N50dS4O-RY1P2iElzZcaDq_Q5icx2hsWeyPDDpSDYcyRIp5dVgBQLjqf0clH_FK2o4N7c6vnkC5Se6VTGbBRBCkhEi9JM0FkcpP8Fj-VbXBYO4HPQ-1ddiMRdxRx-nPT69lOTA_iGJteHruAA9EK2kFDHLsGdbiW2vB5WBlQ'
return config
},
(error) => {
......
......@@ -43,7 +43,7 @@ export default defineComponent({
viewMode: '3D',
center: [1019.614669, 54.167243],
// center: [-135.98002789627407, -722.1597065437004],
zooms: [7, 20],
zooms: [6, 20],
zoom: 8,
pitch: 45,
mapStyle: 'smap://styles/dark',
......
......@@ -15,7 +15,7 @@
</template>
<script lang="ts">
import { computed, defineComponent, onBeforeUnmount, onMounted, PropType, ref } from 'vue'
import { computed, defineComponent, PropType } from 'vue'
import MonitorCount from '../MyCount/my-count.vue'
export interface ProgressProps {
......@@ -67,17 +67,7 @@ export default defineComponent({
}
return { background: props.color }
})
const percent = ref(0)
const timer = ref<any>(null)
onMounted(() => {
timer.value = setTimeout(() => {
percent.value = props.value > 100 ? 100 : props.value
}, 500)
})
onBeforeUnmount(() => {
clearTimeout(timer.value)
timer.value = null
})
const percent = computed(() => (props.value > 100 ? 100 : props.value))
return {
barColor,
bgColor,
......
......@@ -67,6 +67,9 @@ export default {
dispatch('getEcologyConvenient')
dispatch('getEcologyPhoto')
dispatch('getElevCount')
dispatch('GET_BEAUTY_STREET')
dispatch('GET_BEAUTY_HOME')
dispatch('GET_FACILITY_CONVENIENT')
},
// 物业三架马车数据 (缺交叉任职数)
......@@ -234,7 +237,6 @@ export default {
const { content } = (
await ajax.get({ url: api.GET_PUBLICSAFE_SOS_MATERIAL })
).data
// console.log(content)
commit('SET_PUBLICSAFE_SOS_MATERIAL', content)
},
......@@ -360,7 +362,7 @@ export default {
const { content } = (
await ajax.get({ url: api.GET_PUBLICSAFE_STREETPOWER })
).data
commit('SET_PUBLICSAFE_STREETPOWER', content.workStation || [])
commit('SET_PUBLICSAFE_STREETPOWER', content || [])
},
// 左侧公共 - 党建
......@@ -445,7 +447,7 @@ export default {
},
async getDutyList(
{ commit }: Method,
params: { [key: string]: string }
params: { [key: string]: string | number }
): Promise<void> {
if (!params.gridId) return
const { content } = (
......@@ -668,4 +670,92 @@ export default {
).data
commit('SET_RESPONSIVITY', content)
},
async GET_BEAUTY_STREET({ commit }: Method): Promise<void> {
const { content } = (
await ajax.get({
url: api.GET_BEAUTY_STREET,
params: { pageSize: 10000 },
})
).data
commit('SET_BEAUTY_STREET', content)
},
async GET_BEAUTY_HOME({ commit }: Method): Promise<void> {
const { content } = (
await ajax.get({
url: api.GET_BEAUTY_HOME,
params: { pageSize: 10000 },
})
).data
commit('SET_BEAUTY_HOME', content)
},
async GET_FACILITY_CONVENIENT({ commit }: Method): Promise<void> {
const result = {
为老:
(
await ajax.get({
url: api.GET_FOR_OLD,
params: { pageSize: 10000 },
})
)?.data?.content || [],
菜场:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '菜场', pageSize: 10000 },
})
)?.data?.content || [],
便利店:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '便利店', pageSize: 10000 },
})
)?.data?.content || [],
电话亭:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '电话亭', pageSize: 10000 },
})
)?.data?.content || [],
餐车:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '餐车', pageSize: 10000 },
})
)?.data?.content || [],
公厕:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '公厕', pageSize: 10000 },
})
)?.data?.content || [],
街面废物箱:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '街面废物箱', pageSize: 10000 },
})
)?.data?.content || [],
垃圾箱房:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '垃圾箱房', pageSize: 10000 },
})
)?.data?.content || [],
药房:
(
await ajax.get({
url: api.GET_MARKETS,
params: { labelName: '药房', pageSize: 10000 },
})
)?.data?.content || [],
}
commit('SET_FACILITY_CONVENIENT', result)
},
}
......@@ -166,6 +166,9 @@ export interface GlobalStateProps {
responsivity: ResponsivityProp[]
entry: EntryProp[]
emergencyPoints: any[]
beautyStreet: any[]
beautyHome: any[]
facilityConvenient: any
}
/** ------------------------------------- 分隔线 --------------------------------------- */
......
......@@ -308,4 +308,15 @@ export default {
SET_EMERGENCY_POINTS(state: GlobalStateProps, data: any[]): void {
state.emergencyPoints = data
},
SET_BEAUTY_STREET(state: GlobalStateProps, data: any[]): void {
state.beautyStreet = data
},
SET_BEAUTY_HOME(state: GlobalStateProps, data: any[]): void {
state.beautyHome = data
},
SET_FACILITY_CONVENIENT(state: GlobalStateProps, data: any): void {
state.facilityConvenient = data
},
}
......@@ -245,4 +245,7 @@ export default {
responsivity: [],
entry: [],
emergencyPoints: [],
beautyStreet: [],
beautyHome: [],
facilityConvenient: {},
} as GlobalStateProps
......@@ -165,8 +165,6 @@ export default defineComponent({
}
const map = ref<any>(null)
onMounted(async () => {
console.log('route', route)
curId.value = route.query.id || communityOptions.value[0].type
initData(curId.value)
store.commit(
......@@ -196,7 +194,6 @@ export default defineComponent({
icon: getIcon(item.classification, item.relationName),
})
})
console.log(pointData)
points.value = map.value.addPoint({
key: key,
size: [100, 500],
......
......@@ -166,6 +166,7 @@ export default function useSwitchMap(map: any): any {
} else {
hideCommunity()
}
// TODO 现在衣食住行不撒点的原因是分辨的标签没有了
const yiPoints = pointData.filter((e) => e.labelName === '衣')
const shiPoints = pointData.filter((e) => e.labelName === '食')
const zhuPoints = pointData.filter((e) => e.labelName === '住')
......
......@@ -146,7 +146,7 @@ export default defineComponent({
personnelNight: '夜间人',
workTimeDay: '8时-18时',
workTimeNight: '18时-8时',
number: '5',
number: 0,
},
{
group: '第二工作站',
......@@ -154,7 +154,7 @@ export default defineComponent({
personnelNight: '夜间人',
workTimeDay: '8时-18时',
workTimeNight: '18时-8时',
number: '5',
number: 0,
},
{
group: '第三工作站',
......@@ -162,26 +162,23 @@ export default defineComponent({
personnelNight: '夜间人',
workTimeDay: '8时-18时',
workTimeNight: '18时-8时',
number: '5',
number: 0,
},
])
watch(
// 监听改变网格工作站的数据
[() => streetPower.value, () => dutyTableData.value],
([data, dutyData]) => {
() => streetPower.value,
(data) => {
if (data.length === 0) return
dutyData.forEach((ele: any, i: number) => {
const duty = data.find((e: any) => e.workstationName === ele.group)
if (duty) {
dutyTableData.value[i] = {
group: ele.group,
personnelDay: duty.personnelDay,
personnelNight: duty.personnelNight,
workTimeDay: duty.workTimeDay,
workTimeNight: duty.workTimeNight,
number: duty.num,
}
dutyTableData.value = data.map((item: any) => {
return {
group: item.stationName,
personnelDay: item.personnelDay,
personnelNight: item.personnelNight,
workTimeDay: item.workTimeDay,
workTimeNight: item.workTimeNight,
number: item.stationPersonnelNum,
}
})
},
......@@ -242,7 +239,7 @@ export default defineComponent({
]
})
const propertySummary = computed(() => {
const { wy, com, ywh, cross } = store.state.pubulicLeftParty
const { wy, com, ywh, crossOffice } = party.value
return [
{
name: '居委会',
......@@ -261,7 +258,7 @@ export default defineComponent({
},
{
name: '交叉任职',
value: cross || 0,
value: crossOffice || 0,
},
]
})
......
......@@ -34,12 +34,13 @@
</div>
</m-card>
<m-card class="card" mode="4" title="网格力量">
<div class="table">
<div v-if="gridList.length > 0" class="table">
<div v-for="(item, i) in gridList" :key="i">
<p>{{ item.department }}</p>
<p>{{ item.persons }}</p>
</div>
</div>
<m-empty v-else />
</m-card>
</m-card>
</template>
......@@ -58,7 +59,12 @@ import store from '@/store'
export default defineComponent({
name: 'ManageBasic',
setup() {
const stationInfo = computed(() => store.state.stationInfo)
const streetPower = computed(() => store.state.pubulicLeftStreetPower)
const stationInfo = computed(
() =>
streetPower.value.find((e: any) => e.id === store.state.curView.id) ||
{}
)
const basicList = computed(() => {
const {
totalArea = 0,
......
......@@ -16,7 +16,7 @@
</div>
<m-sub2
click-able
:addition="{ value: elevNum, unit: '幢' }"
:addition="{ value: elevAmount, unit: '幢' }"
@select="handleClick"
>
电梯加装(排摸)
......@@ -24,9 +24,14 @@
<m-sub2>马桶改造</m-sub2>
<Brief :list="toiletSituation" color="#fff" />
<m-progress
:value="80"
:value="rate"
:color="['rgba(253,211,116,.15)', '#F7933E']"
:msg="{ value: 80, unit: '%', name: '改造进度', color: '#fff' }"
:msg="{
value: rate,
unit: '%',
name: '改造进度',
color: '#fff',
}"
/>
</div>
</m-card>
......@@ -38,16 +43,16 @@
offset="-44%"
>
<div class="elev-modal">
<div v-for="item in elevData" :key="item.id">
<p>{{ item.sectAddr }}</p>
<p>{{ item.cmtName }} | {{ item.sectName }}</p>
<div v-for="item in elevList" :key="item.id">
<p>{{ item.sectAddr || '无' }}</p>
<p>{{ item.cmtName }} | {{ item.sectName || '无' }}</p>
</div>
</div>
</m-modal>
</template>
<script lang="ts">
import { computed, defineComponent, ref } from 'vue'
import { computed, defineComponent, onMounted, ref } from 'vue'
import Brief, { BriefProp } from '../components/brief.vue'
import store from '@/store'
import icon31 from '@/assets/images/icon31.png'
......@@ -63,34 +68,75 @@ export default defineComponent({
components: { Brief },
setup() {
const curViewType = computed(() => store.state.curView.type)
const summary = ref([
{ name: '2020年', value: 26 },
{ name: '2019年', value: 24 },
{ name: '2018年', value: 18 },
])
const situation = ref<BriefProp[]>([
{ name: '小区微更新', value: 26, icon: icon31 },
{ name: '门岗规范化', value: 12, icon: icon32 },
{ name: '充电桩', value: 64, icon: icon33 },
{ name: '雨污混接', value: 18, icon: icon34 },
const beautyHome = computed(() => store.state.beautyHome)
const summary = computed(() => {
const result: any = {}
beautyHome.value.forEach((item) => {
const year = item.implementYear?.slice(0, 4) + '年'
if (!result[year]) {
result[year] = []
}
result[year].push(item)
})
return Object.keys(result).map((key: string) => ({
name: key,
value: result[key]?.length || 0,
}))
})
const situation = computed<BriefProp[]>(() => [
{
name: '小区微更新',
value:
beautyHome.value.filter((e) => e.projectType == '小区微更新')
?.length || 0,
icon: icon31,
},
{
name: '门岗规范化',
value:
beautyHome.value.filter((e) => e.projectType == '门岗规范化')
?.length || 0,
icon: icon32,
},
{
name: '充电桩',
value:
beautyHome.value.filter((e) => e.projectType == '充电桩')?.length ||
0,
icon: icon33,
},
{
name: '雨水混接',
value:
beautyHome.value.filter((e) => e.projectType == '雨水混接')?.length ||
0,
icon: icon34,
},
])
const toiletSituation = ref<BriefProp[]>([
{ name: '已完成改造', value: 26, icon: icon35 },
{ name: '应改造', value: 64, icon: icon36 },
{ name: '已完成改造', value: 0, icon: icon35 },
{ name: '应改造', value: 0, icon: icon36 },
])
const barData = {
const rate = ref(0)
onMounted(async () => {
const { content } = (await ajax.get({ url: api.GET_TOILET })).data
let totalNum = 0,
completeNum = 0
content.forEach((item: any) => {
totalNum += item.totalNum || 0
completeNum += item.completeNum || 0
})
toiletSituation.value[0].value = completeNum
toiletSituation.value[1].value = totalNum
rate.value = Math.round((completeNum / totalNum) * 100)
})
const barData = computed(() => ({
dimensions: [
{ name: 'name', displayName: '类型' },
{ name: 'value', displayName: '' },
],
source: [
{ name: '架空线梳理', value: 16 },
{ name: '店招店牌美化', value: 26 },
{ name: '绿化整治', value: 15 },
{ name: '外立面整治', value: 8 },
{ name: '公共设置', value: 8 },
],
}
source: [...situation.value],
}))
const chartOption = {
color: [['#F7943C', '#FF6C2E']],
legend: { show: false },
......@@ -100,6 +146,9 @@ export default defineComponent({
barWidth: '20%',
},
],
yAxis: {
minInterval: 1,
},
xAxis: {
axisLabel: {
formatter: (value: string) => {
......@@ -109,32 +158,34 @@ export default defineComponent({
},
},
}
const elevNum = computed(() => {
const data = store.state.elevCount
const { id } = store.state.curView
return data
.filter((e) => e.workstationId === id)
.reduce((acc, cur) => acc + cur.num, 0)
const elevList = ref<any[]>([])
const elevAmount = ref(0)
ajax
.get({
url: api.GET_ELEV_LIST,
params: { pageSize: 1000 },
})
.then((res) => {
const result: any = {}
const data = res?.data?.content || []
data.forEach((e: any) => {
if (!result[e.cmtName]) {
result[e.cmtName] = 0
}
result[e.cmtName] += 1
})
elevList.value = data
elevAmount.value = data.length || 0
})
const showElevModal = ref(false)
const elevData = ref<any>([])
const dic: any = {
'01001': ['振兴', '新昌', '江阴', '顺天村'],
'01002': ['小花园'],
'01003': ['福海', '定兴'],
}
const handleClick = async () => {
const { content } = (
await ajax.get({
url: api.GET_ELEV_LIST,
params: { pageSize: 1000 },
})
).data
const { id } = store.state.curView
elevData.value = content.filter(
(e: any) => id && dic[id].includes(e.cmtName)
)
showElevModal.value = true
}
......@@ -143,11 +194,12 @@ export default defineComponent({
summary,
situation,
toiletSituation,
rate,
barData,
chartOption,
elevNum,
elevAmount,
showElevModal,
elevData,
elevList,
handleClick,
}
},
......
......@@ -9,7 +9,9 @@
</div>
</div>
<Brief :list="situation" color="#fff" />
<m-sub2 :addition="{ value: 33, unit: '幢' }">电梯加装(排摸)</m-sub2>
<m-sub2 :addition="{ value: elevAmount, unit: '幢' }">
电梯加装(排摸)
</m-sub2>
<div class="sum-card">
<div
v-for="item in elevList"
......@@ -25,16 +27,10 @@
<Brief :list="toiletSituation" color="#fff" />
<m-progress
v-if="show"
:value="
Math.round(
(toiletSituation[0].value / toiletSituation[1].value) * 100
)
"
:value="rate"
:color="['rgba(253,211,116,.15)', '#F7933E']"
:msg="{
value: Math.round(
(toiletSituation[0].value / toiletSituation[1].value) * 100
),
value: rate,
unit: '%',
name: '改造进度',
color: '#fff',
......@@ -75,21 +71,77 @@ export default defineComponent({
components: { Brief },
setup() {
const show = computed(() => store.state.curTheme === 'service')
const summary = ref([
{ name: '2020年', value: 26 },
{ name: '2019年', value: 24 },
{ name: '2018年', value: 18 },
])
const situation = ref<BriefProp[]>([
{ name: '小区微更新', value: 26, icon: icon31 },
{ name: '门岗规范化', value: 12, icon: icon32 },
{ name: '充电桩', value: 64, icon: icon33 },
{ name: '雨污混接', value: 18, icon: icon34 },
const beautyHome = computed(() => store.state.beautyHome)
const summary = computed(() => {
const result: any = {}
beautyHome.value.forEach((item) => {
const year = item.implementYear?.slice(0, 4) + '年'
if (!result[year]) {
result[year] = []
}
result[year].push(item)
})
return Object.keys(result).map((key: string) => ({
name: key,
value: result[key]?.length || 0,
}))
})
const situation = computed<BriefProp[]>(() => [
{
name: '小区微更新',
value:
beautyHome.value.filter((e) => e.projectType == '小区微更新')
?.length || 0,
icon: icon31,
},
{
name: '门岗规范化',
value:
beautyHome.value.filter((e) => e.projectType == '门岗规范化')
?.length || 0,
icon: icon32,
},
{
name: '充电桩',
value:
beautyHome.value.filter((e) => e.projectType == '充电桩')?.length ||
0,
icon: icon33,
},
{
name: '雨水混接',
value:
beautyHome.value.filter((e) => e.projectType == '雨水混接')?.length ||
0,
icon: icon34,
},
])
const elevList = computed(() => store.state.elevCount)
const elevList = ref<any[]>([])
const curCmtName = ref<string | null>(null)
const elevData = ref<any>([])
const showElevModal = ref(false)
const elevAmount = ref(0)
ajax
.get({
url: api.GET_ELEV_LIST,
params: { pageSize: 1000 },
})
.then((res) => {
const result: any = {}
const data = res?.data?.content || []
data.forEach((e: any) => {
if (!result[e.cmtName]) {
result[e.cmtName] = 0
}
result[e.cmtName] += 1
})
elevList.value = Object.keys(result).map((key: string) => ({
cmtName: key,
num: result[key],
}))
elevAmount.value = data.length || 0
})
const handleSelect = async (name: string) => {
curCmtName.value === name
? (curCmtName.value = null)
......@@ -112,29 +164,31 @@ export default defineComponent({
{ name: '已完成改造', value: 0, icon: icon35 },
{ name: '应改造', value: 0, icon: icon36 },
])
const rate = ref(0)
onMounted(async () => {
const { content } = (await ajax.get({ url: api.GET_TOILET })).data
toiletSituation.value[0].value = content.completeNum
toiletSituation.value[1].value = content.totalNum
let totalNum = 0,
completeNum = 0
content.forEach((item: any) => {
totalNum += item.totalNum || 0
completeNum += item.completeNum || 0
})
toiletSituation.value[0].value = completeNum
toiletSituation.value[1].value = totalNum
rate.value = Math.round((completeNum / totalNum) * 100)
})
const workStationProjects = ref([
{ name: '架空线梳理', value: 16 },
{ name: '店招店牌美化', value: 26 },
{ name: '绿化整治', value: 15 },
{ name: '外立面整治', value: 8 },
{ name: '公共设置', value: 8 },
])
return {
show,
summary,
situation,
elevAmount,
elevList,
curCmtName,
elevData,
showElevModal,
handleSelect,
toiletSituation,
workStationProjects,
rate,
}
},
})
......
......@@ -8,7 +8,7 @@
</div>
</div>
<div v-if="showChart" class="chart">
<a-select v-model:value="year">
<a-select :value="curYear" @change="handleSelect">
<a-select-option
v-for="item in summary"
:key="item.name"
......@@ -26,29 +26,93 @@
</template>
<script lang="ts">
import { defineComponent, ref, computed } from 'vue'
import { defineComponent, ref, computed, watch } from 'vue'
import store from '@/store'
export default defineComponent({
name: 'BeautyStreet',
setup() {
const summary = ref([
{ name: '2020年', value: 26 },
{ name: '2019年', value: 24 },
{ name: '2018年', value: 18 },
])
const beautyStreet = computed(() => store.state.beautyStreet)
const list = ref<any>({})
const summary = ref<{ name: string; value: any }[]>([])
const curYear = ref('')
const handleSelect = (val: string) => {
curYear.value = val
}
const barData = ref({
dimensions: [
{ name: 'name', displayName: '项目' },
{ name: 'value', displayName: '数量' },
],
source: [
{ name: '架空线梳理', value: 15 },
{ name: '店招店牌美化', value: 9 },
{ name: '绿化整治', value: 4 },
{ name: '外立面整治', value: 5 },
{ name: '公共设施', value: 3 },
{ name: '架空线梳理', value: 0 },
{ name: '店招店牌美化', value: 0 },
{ name: '绿化整治', value: 0 },
{ name: '外立面整治', value: 0 },
{ name: '公共设施', value: 0 },
],
})
watch(
() => curYear.value,
(
year: string = summary.value?.[summary.value.length - 1]?.name || ''
) => {
barData.value.source = [
{
name: '架空线梳理',
value:
list.value[year]?.filter(
(e: any) => e.projectType == '架空线梳理'
)?.length || 0,
},
{
name: '店招店牌美化',
value:
list.value[year]?.filter(
(e: any) => e.projectType == '店招店牌美化'
)?.length || 0,
},
{
name: '绿化整治',
value:
list.value[year]?.filter((e: any) => e.projectType == '绿化整治')
?.length || 0,
},
{
name: '外立面整治',
value:
list.value[year]?.filter(
(e: any) => e.projectType == '外立面整治'
)?.length || 0,
},
{
name: '公共设施',
value:
list.value[year]?.filter((e: any) => e.projectType == '公共设施')
?.length || 0,
},
]
},
{ immediate: true }
)
watch(
() => beautyStreet.value,
(data: any[]) => {
const result: any = {}
data.forEach((item) => {
const year = item.implementYear?.slice(0, 4) + '年'
if (!result[year]) {
result[year] = []
}
result[year].push(item)
})
list.value = result
summary.value = Object.keys(list.value).map((key: string) => ({
name: key,
value: list.value?.[key]?.length || 0,
}))
curYear.value = summary.value?.[summary.value.length - 1]?.name || ''
}
)
const fontSize = computed(() => Math.floor((screen.height * 1.6) / 100))
const barOption = ref({
color: [['#F7973D', 'rgba(234,173,0,.1)']],
......@@ -83,14 +147,14 @@ export default defineComponent({
},
],
})
const year = ref('2020年')
const showChart = computed(() => store.state.curTheme === 'service')
return {
summary,
barData,
barOption,
year,
curYear,
showChart,
handleSelect,
}
},
})
......@@ -117,7 +181,6 @@ export default defineComponent({
.chart
width 100%
height 1.2rem
margin-bottom .1rem
position relative
</style>
<style lang="stylus">
......
......@@ -30,11 +30,27 @@ export default defineComponent({
name: 'Convenient',
components: { Brief },
setup() {
const forOld = computed(() => store.state.oldService)
const convenientList = computed(() => store.state.lifeConvenient)
const workstationId = computed(() => store.state.curView.id)
const convenients = computed(() => store.state.facilityConvenient)
const forOld = computed(() => {
const data =
convenients.value?.['为老']?.filter(
(e: any) => e.workstationId == workstationId.value
) || []
const result: any = {}
data.forEach((item: any) => {
if (!result[item.facilitiesType]) {
result[item.facilitiesType] = 0
}
result[item.facilitiesType] += 1
})
return Object.keys(result).map((key: string) => ({
facilitiesType: key,
num: result[key],
}))
})
function getNum(name: string): number {
const result = convenientList.value.find((e) => e.labelName === name)
return (result && result.num) || 0
return convenients.value[name]?.length || 0
}
const forLive = computed(() => {
return [
......
......@@ -23,7 +23,13 @@
<div>
<m-sub2>商业综合体</m-sub2>
<div class="business">
<img v-for="photo in businessPhotos" :key="photo" :src="photo" />
<!-- <img v-for="photo in businessPhotos" :key="photo" :src="photo" /> -->
<div
v-for="photo in businessPhotos"
:key="photo"
class="photo"
:style="`background-image:url('${photo}')`"
/>
</div>
</div>
<div>
......@@ -95,6 +101,7 @@ import img5 from '@/assets/images/img5.png'
import img6 from '@/assets/images/img6.png'
import img7 from '@/assets/images/img7.png'
import img8 from '@/assets/images/img8.png'
import img9 from '@/assets/images/img9.png'
import photo1 from '@/assets/images/photo1.png'
import photo2 from '@/assets/images/photo2.png'
import store from '@/store'
......@@ -108,11 +115,12 @@ export default defineComponent({
return data.filter((e) => keys.includes(e.labelName))
})
const sumList = computed(() => {
return store.state.ecologyConvenient.map((item) => {
const data = store.state.facilityConvenient
return Object.keys(data).map((key: string) => {
return {
name: item.labelName,
value: item.num,
icon: whichIcon(item.labelName),
name: key,
value: data?.[key]?.length || 0,
icon: whichIcon(key),
}
})
})
......@@ -123,13 +131,19 @@ export default defineComponent({
case '公厕':
return img7
case '药房':
return img8
return img9
case '菜场':
return img5
case '菜店':
return img2
case '为老设施':
case '为老':
return img1
case '电话亭':
return img4
case '垃圾箱房':
return img8
case '街面废物箱':
return img6
default:
return img3
}
......@@ -228,6 +242,10 @@ export default defineComponent({
display flex
justify-content space-between
margin-bottom .02rem
>img
.photo
width 48%
height 1.1rem
background-repeat no-repeat
background-size cover
background-position bottom center
</style>
......@@ -39,5 +39,5 @@ export default defineComponent({
.beauty1
flex 1
.beauty2
flex 1.6
flex 2
</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