diff --git a/api/app/lib/controllers/superScreen/community.js b/api/app/lib/controllers/superScreen/community.js index ab5ec42..67ff20e 100644 --- a/api/app/lib/controllers/superScreen/community.js +++ b/api/app/lib/controllers/superScreen/community.js @@ -66,7 +66,7 @@ function getHomeInfo(opts) { ], group: ['houseCommunity'], // 分组的字段 where: { - houseStatus: false + houseStatus: false, } }); @@ -78,7 +78,7 @@ function getHomeInfo(opts) { ], group: ['house_id'], // 分组的字段 where: { - houseStatus: false, + houseStatus: false, houseCommunity: communitys[i].houseCommunity } }) @@ -119,12 +119,23 @@ function getHomeInfo(opts) { } }); + let communityPersons = await models.AffordableHousing.count({ + attributes: [ + 'person_community', // 分组的字段 + ], + group: ['person_community'], // 分组的字段 + where: { + houseStatus: false + } + }); + ctx.status = 200; ctx.body = { inuse: inuse, //租赁中套数 unuse: unuse, //空置套数 communityInUse, - communityUnUse + communityUnUse, + communityPersons }; } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); diff --git a/super-screen/client/assets/images/homepage/communtity/bg.webp b/super-screen/client/assets/images/homepage/communtity/bg.webp new file mode 100644 index 0000000..51ff1a7 Binary files /dev/null and b/super-screen/client/assets/images/homepage/communtity/bg.webp differ diff --git a/super-screen/client/src/sections/community-safty/components/traffic-ranking.js b/super-screen/client/src/sections/community-safty/components/traffic-ranking.js index 5003258..e67dcc0 100644 --- a/super-screen/client/src/sections/community-safty/components/traffic-ranking.js +++ b/super-screen/client/src/sections/community-safty/components/traffic-ranking.js @@ -5,14 +5,15 @@ import { communtity_data } from '../constants/index' function DataTop5({ communtityInfo }) { const content =
- {communtity_data.map(s => { - let inuse = communtityInfo?.communityInUse?.find(v => v.houseCommunity == s.name)?.count || 0 - // let unuse = communtityInfo?.communityUnUse?.find(v => v.houseCommunity == s.name)?.count || 0 - return
-
{s?.name}
-
{parseInt(inuse)}
-
- })} + {communtityInfo?.communityPersons + ?.filter(x => !!x.person_community) + ?.sort((a, b) => b.count - a.count) + ?.map(s => { + return
+
{s?.person_community}
+
{parseInt(s?.count)}
+
+ })}
@@ -20,7 +21,7 @@ function DataTop5({ communtityInfo }) {
社区名称
-
户数 /
+
人数 /
diff --git a/super-screen/client/src/sections/community-safty/containers/style.less b/super-screen/client/src/sections/community-safty/containers/style.less index 82890ba..31dcf84 100644 --- a/super-screen/client/src/sections/community-safty/containers/style.less +++ b/super-screen/client/src/sections/community-safty/containers/style.less @@ -4,7 +4,7 @@ position: absolute; top: 0; left: 0; - background: url('/assets/images/homepage/communtity/bg.png'); + background: url('/assets/images/homepage/communtity/bg.webp'); background-repeat: no-repeat; background-size: 100% 100%; overflow: hidden; diff --git a/super-screen/client/src/sections/fire-control/containers/style.less b/super-screen/client/src/sections/fire-control/containers/style.less index ff8555a..a48f4f9 100644 --- a/super-screen/client/src/sections/fire-control/containers/style.less +++ b/super-screen/client/src/sections/fire-control/containers/style.less @@ -4,7 +4,7 @@ position: absolute; top: 0; left: 0; - background: url('/assets/images/homepage/communtity/bg.png'); + background: url('/assets/images/homepage/communtity/bg.webp'); background-repeat: no-repeat; background-size: 100% 100%; overflow: hidden; diff --git a/super-screen/client/src/sections/water-prevention/containers/style.less b/super-screen/client/src/sections/water-prevention/containers/style.less index 9cb3084..8edef92 100644 --- a/super-screen/client/src/sections/water-prevention/containers/style.less +++ b/super-screen/client/src/sections/water-prevention/containers/style.less @@ -4,7 +4,7 @@ position: absolute; top: 0; left: 0; - background: url('/assets/images/homepage/communtity/bg.png'); + background: url('/assets/images/homepage/communtity/bg.webp'); background-repeat: no-repeat; background-size: 100% 100%; overflow: hidden;