diff --git a/mock/community.ts b/mock/community.ts index 10623fe..e56c902 100644 --- a/mock/community.ts +++ b/mock/community.ts @@ -6,7 +6,7 @@ const randomNumber = (range: number = 100) => { export default defineFakeRoute([ { - url: 'community-statistics', + url: '/api/community/community-statistics', method: 'GET', response: () => ({ code: 200, @@ -14,25 +14,29 @@ export default defineFakeRoute([ { name: '统计人口', total: randomNumber(9999), - subtitle: `${randomNumber()}%`, + subtitle: '常驻人口', + subPercent: `${randomNumber()}%`, subTotal: randomNumber(99999), }, { name: '统计人口', total: randomNumber(9999), - subtitle: `${randomNumber()}%`, + subtitle: '常驻人口', + subPercent: `${randomNumber()}%`, subTotal: randomNumber(99999), }, { name: '统计人口', total: randomNumber(9999), - subtitle: `${randomNumber()}%`, + subtitle: '常驻人口', + subPercent: `${randomNumber()}%`, subTotal: randomNumber(99999), }, { name: '统计人口', total: randomNumber(9999), - subtitle: `${randomNumber()}%`, + subtitle: '常驻人口', + subPercent: `${randomNumber()}%`, subTotal: randomNumber(99999), }, ], diff --git a/public/images/community/body-image-1.png b/public/images/community/body-image-1.png new file mode 100644 index 0000000..76f6c17 Binary files /dev/null and b/public/images/community/body-image-1.png differ diff --git a/public/images/community/body-image-2.png b/public/images/community/body-image-2.png new file mode 100644 index 0000000..840e345 Binary files /dev/null and b/public/images/community/body-image-2.png differ diff --git a/public/images/community/body-image-3.png b/public/images/community/body-image-3.png new file mode 100644 index 0000000..0aabf7b Binary files /dev/null and b/public/images/community/body-image-3.png differ diff --git a/src/api/community.ts b/src/api/community.ts index 174b539..6610482 100644 --- a/src/api/community.ts +++ b/src/api/community.ts @@ -2,5 +2,5 @@ import request from '@/api/server/request'; /* 社区统计 */ export const getCommunityStatistics = () => { - return request.get('community-statistics'); + return request.get('community/community-statistics'); }; diff --git a/src/assets/images/common/bg/bg-frame-4.png b/src/assets/images/common/bg/bg-frame-4.png new file mode 100644 index 0000000..b01f882 Binary files /dev/null and b/src/assets/images/common/bg/bg-frame-4.png differ diff --git a/src/assets/styles/global.scss b/src/assets/styles/global.scss index 45eedc5..dd01032 100644 --- a/src/assets/styles/global.scss +++ b/src/assets/styles/global.scss @@ -4,6 +4,7 @@ :root { --color-primary: #027AFF; --color-primary-1: #4F94E6; + --color-primary-2: #32C5FF; --color-primary-secondary: #00FFFF; --color-primary-secondary-1: #00FFFFB5; --color-success: #44D7B6; diff --git a/src/assets/styles/minix/sidebar.scss b/src/assets/styles/minix/sidebar.scss index 6a5ec59..bbb07a8 100644 --- a/src/assets/styles/minix/sidebar.scss +++ b/src/assets/styles/minix/sidebar.scss @@ -33,7 +33,7 @@ height: 42px; font-size: 22px; color: #fff; - background: url('@/assets/images/business-supervision/bg/sidebar/bg-frame-4.png') no-repeat; + background: url('@/assets/images/common/bg/bg-frame-4.png') no-repeat; background-size: cover; } diff --git a/src/components/PanelItem/DigitalNumber.tsx b/src/components/DigitalNumber/DigitalCurrency.tsx similarity index 100% rename from src/components/PanelItem/DigitalNumber.tsx rename to src/components/DigitalNumber/DigitalCurrency.tsx diff --git a/src/components/DigitalNumber/DigitalNumber.tsx b/src/components/DigitalNumber/DigitalNumber.tsx new file mode 100644 index 0000000..bb61b5d --- /dev/null +++ b/src/components/DigitalNumber/DigitalNumber.tsx @@ -0,0 +1,31 @@ +import { defineComponent } from 'vue-demi'; + +import { formatter } from '@/utils/chart'; + +/** 显示数字 */ +export default defineComponent({ + name: 'DigitalNumber', + props: { + money: Number, + separator: { + type: Boolean, + default: false, + }, + }, + setup(props) { + const moneyString: string = props.separator ? formatter(props.money) : props.money.toString(); + const moneyStringList = moneyString + .split(/(\d,)/g) + .filter((item) => item !== '') + .map((item) => (!item.includes(',') ? item.split('') : item)) + .flat(); + + return () => ( + <> + {moneyStringList.map((item, index) => ( + {item} + ))} + + ); + }, +}); diff --git a/src/store/modules/community.ts b/src/store/modules/community.ts index 933bc4a..b2c9f0d 100644 --- a/src/store/modules/community.ts +++ b/src/store/modules/community.ts @@ -9,8 +9,7 @@ export const useCommunityStore = defineStore('communityStore', { actions: { /* 社区统计 */ async loadCommunityStatisticsList() { - const result = await getCommunityStatistics(); - this.communityStatisticsList = result.data; + this.communityStatisticsList = await getCommunityStatistics(); }, }, }); diff --git a/src/views/big-data/components/big-data-left/index.vue b/src/views/big-data/components/big-data-left/index.vue index 9dd678f..86c9bfa 100644 --- a/src/views/big-data/components/big-data-left/index.vue +++ b/src/views/big-data/components/big-data-left/index.vue @@ -2,7 +2,7 @@ import { useIntervalFn } from '@vueuse/core'; import { onMounted, ref } from 'vue'; -import { displayContent } from '@/components/PanelItem/DigitalNumber'; +import { displayContent } from '@/components/DigitalNumber/DigitalCurrency'; import TimeSelect from '@/components/TimeSelect/index.vue'; import { TimeSelectType } from '@/components/TimeSelect/type'; import { formatter } from '@/utils/chart'; diff --git a/src/views/big-data/components/big-data-right/components/right-top.vue b/src/views/big-data/components/big-data-right/components/right-top.vue index 337dbaf..a144afc 100644 --- a/src/views/big-data/components/big-data-right/components/right-top.vue +++ b/src/views/big-data/components/big-data-right/components/right-top.vue @@ -1,7 +1,7 @@ + diff --git a/src/views/community/components/community-left.vue b/src/views/community/components/community-left.vue index b3df438..11c297c 100644 --- a/src/views/community/components/community-left.vue +++ b/src/views/community/components/community-left.vue @@ -1,11 +1,16 @@