diff --git a/.env.development b/.env.development index 60fa452..0042ee8 100644 --- a/.env.development +++ b/.env.development @@ -26,13 +26,9 @@ VITE_APP_SNAILJOB_ADMIN='http://192.168.1.215/snail-job' VITE_APP_PORT=5174 -# 登录成功跳转地址 +# 登录成功跳转地址(/index → 统计汇总首页) # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' VITE_LOGIN_BACK_URL='/index' -# 工作台正式内容:false 假内容:true -VITE_LOGIN_BACK_URL_WORKBENCH_TRUE=false -# 是否展示工作台 -VITE_APP_SHOW_WORK_PLATFORM=true # 地图类型 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key VITE_APP_MAP_TYPE='WGS84' diff --git a/.env.production b/.env.production index e794369..b0cdbe3 100644 --- a/.env.production +++ b/.env.production @@ -18,13 +18,9 @@ VITE_APP_SNAILJOB_ADMIN='/snail-job' # VITE_APP_BASE_API = 'https://wuyeapi.bugtc.com' VITE_APP_BASE_API='https://wuyeapi.ckdzkj.com' #VITE_APP_BASE_API='http://192.168.1.198' -# 登录成功跳转地址 +# 登录成功跳转地址(/index → 统计汇总首页) # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' VITE_LOGIN_BACK_URL='/index' -# 工作台正式内容:false 假内容:true -VITE_LOGIN_BACK_URL_WORKBENCH_TRUE=false -# 是否展示工作台 -VITE_APP_SHOW_WORK_PLATFORM=true # 地图类型 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key VITE_APP_MAP_TYPE='GCJ02' diff --git a/src/api/system/electricityShare/index.ts b/src/api/system/electricityShare/index.ts index cbe75a9..aca95e6 100644 --- a/src/api/system/electricityShare/index.ts +++ b/src/api/system/electricityShare/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { ElectricityShareVO, ElectricityShareForm, ElectricityShareQuery } from '@/api/electricityShare/electricityShare/types'; +import { ElectricityShareVO, ElectricityShareForm, ElectricityShareQuery } from '@/api/system/electricityShare/types'; /** * 查询公摊电表配置列表 diff --git a/src/api/system/electricityShare/types.ts b/src/api/system/electricityShare/types.ts index ec3a605..0ebef99 100644 --- a/src/api/system/electricityShare/types.ts +++ b/src/api/system/electricityShare/types.ts @@ -9,6 +9,11 @@ export interface ElectricityShareVO { */ villageId: string | number; + /** + * 小区名称 + */ + villageName?: string; + /** * 公摊电表设备id */ @@ -29,6 +34,31 @@ export interface ElectricityShareVO { */ status: string; + /** + * 分摊房屋数量 + */ + houseCount?: number; + + /** + * 建筑面积合计 + */ + totalArea?: number | string; + + /** + * 分摊房屋id集合 + */ + houseIds?: Array; + + /** + * 分摊房屋列表 + */ + houseList?: ElectricityShareHouseVO[]; + + /** + * 创建时间 + */ + createTime?: string; + /** * 备注 */ @@ -36,6 +66,58 @@ export interface ElectricityShareVO { } +export interface ElectricityShareHouseVO { + /** + * 主键 + */ + id?: string | number; + + /** + * 公摊配置id + */ + shareId?: string | number; + + /** + * 房屋id + */ + houseId: string | number; + + /** + * 小区名称 + */ + villageName?: string; + + /** + * 楼栋名称 + */ + buildingName?: string; + + /** + * 房号 + */ + houseNo?: string; + + /** + * 房屋名称 + */ + houseName: string; + + /** + * 房屋面积 + */ + houseArea?: string | number; + + /** + * 分摊比例 + */ + shareRatio?: string | number; + + /** + * 分摊金额 + */ + shareAmount?: string | number | null; +} + export interface ElectricityShareForm extends BaseEntity { /** * 主键 @@ -67,6 +149,21 @@ export interface ElectricityShareForm extends BaseEntity { */ status?: string; + /** + * 分摊房屋数量 + */ + houseCount?: number; + + /** + * 建筑面积合计 + */ + totalArea?: number; + + /** + * 分摊房屋id集合 + */ + houseIds?: Array; + /** * 备注 */ @@ -101,6 +198,16 @@ export interface ElectricityShareQuery extends PageQuery { */ status?: string; + /** + * 分摊房屋数量 + */ + houseCount?: number; + + /** + * 建筑面积合计 + */ + totalArea?: number | string; + /** * 日期范围参数 */ diff --git a/src/api/system/house/index.ts b/src/api/system/house/index.ts index 44f65e3..bca28bc 100644 --- a/src/api/system/house/index.ts +++ b/src/api/system/house/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { addBuildingType, addHouseType, BuildingUnit, BuildingVo, HouseListPageVO, HouseListQuery } from './type'; +import { addBuildingType, addHouseType, BuildingUnit, BuildingVo, HouseListPageVO, HouseListQuery, HouseOptionVO } from './type'; // 楼栋--------------------------------------------------------------------------------------- @@ -80,6 +80,13 @@ export function getHouseListAPI(query: HouseListQuery = {}): AxiosPromise { + return request({ + url: `/house/listByVillage/${villageId}`, + method: 'get' + }); +} // 添加房屋 /** 添加房屋 */ export function addHouseAPI(data: addHouseType) { diff --git a/src/api/system/house/type.ts b/src/api/system/house/type.ts index a837a60..f708435 100644 --- a/src/api/system/house/type.ts +++ b/src/api/system/house/type.ts @@ -75,6 +75,12 @@ export interface HouseType { houseNo: string; } +// 小区房屋下拉选项 +export interface HouseOptionVO { + houseId: string | number; + houseName: string; +} + export interface addBuildingType { buildingName: string; villageId?: string; diff --git a/src/api/system/statisticsSummary/index.ts b/src/api/system/statisticsSummary/index.ts new file mode 100644 index 0000000..444af7a --- /dev/null +++ b/src/api/system/statisticsSummary/index.ts @@ -0,0 +1,26 @@ +import request from '@/utils/request'; +import { StatisticsSummaryQuery, StatisticsSummaryResult, StatisticsSummaryTotalResult } from './types'; + +/** + * 查询统计汇总列表 + * @param query + */ +export const listStatisticsSummary = (query?: StatisticsSummaryQuery) => { + return request({ + url: '/statisticsSummary/list', + method: 'get', + params: query + }) as unknown as Promise; +}; + +/** + * 查询统计汇总合计 + * @param query + */ +export const getStatisticsSummaryTotal = (query?: StatisticsSummaryQuery) => { + return request({ + url: '/statisticsSummary/total', + method: 'get', + params: query + }) as unknown as Promise; +}; diff --git a/src/api/system/statisticsSummary/types.ts b/src/api/system/statisticsSummary/types.ts new file mode 100644 index 0000000..98fbe76 --- /dev/null +++ b/src/api/system/statisticsSummary/types.ts @@ -0,0 +1,115 @@ +export interface StatisticsSummaryVO { + /** + * 房屋id + */ + houseId: string; + + /** + * 小区id + */ + villageId: string; + + /** + * 小区名称 + */ + villageName: string; + + /** + * 楼栋id + */ + buildingId: string; + + /** + * 楼栋名称 + */ + buildingName: string; + + /** + * 楼层 + */ + floorNo: number; + + /** + * 房号 + */ + houseNo: string; + + /** + * 房屋名称 + */ + houseName: string; + + /** + * 承租方姓名 + */ + lesseeName: string | null; + + /** + * 承租方电话 + */ + lesseePhone: string | null; + + /** + * 设备编码(多个用逗号分隔) + */ + deviceCodes: string; + + /** + * 设备数量 + */ + deviceCount: number; + + /** + * 用电量 + */ + usageEnergy: string; +} + +export interface StatisticsSummaryTotal { + /** + * 房屋数量 + */ + houseCount: number; + + /** + * 房屋用电合计 + */ + houseUsageTotal: string; + + /** + * 公摊用电合计 + */ + shareUsageTotal: string; + + /** + * 用电总计 + */ + totalUsage: string; +} + +export interface StatisticsSummaryQuery { + pageNum?: number; + pageSize?: number; + /** + * 开始时间 + */ + beginTime?: string; + /** + * 结束时间 + */ + endTime?: string; + params?: any; +} + +export interface StatisticsSummaryResult { + code: number; + msg: string; + total: number; + rows: StatisticsSummaryVO[]; +} + +export interface StatisticsSummaryTotalResult { + code: number; + msg: string; + data: StatisticsSummaryTotal; +} diff --git a/src/router/index.ts b/src/router/index.ts index aa01e6c..396a3ad 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -52,6 +52,19 @@ export const constantRoutes: RouteRecordRaw[] = [ component: () => import('@/views/register.vue'), hidden: true }, + { + path: '/electricityShareDetail', + component: Layout, + hidden: true, + children: [ + { + path: '', + component: () => import('@/views/system/Sdb/SdbElectricityShare/detail.vue'), + name: 'ElectricityShareDetail', + meta: { title: '公摊电表配置详情' } + } + ] + }, { path: '/:pathMatch(.*)*', component: () => import('@/views/error/404.vue'), @@ -79,22 +92,16 @@ export const constantRoutes: RouteRecordRaw[] = [ ] } ]; -if (import.meta.env.VITE_APP_SHOW_WORK_PLATFORM === 'true') { - const find = constantRoutes.find((item) => item.path === ''); - if (find) { - find.children?.push({ - path: '/index', - component: () => { - if (import.meta.env.VITE_LOGIN_BACK_URL_WORKBENCH_TRUE === 'true') { - return import('@/views/workbench/index.vue'); - } else { - return import('@/views/workbench/index2.vue'); - } - }, - name: 'Index', - meta: { title: '工作台', icon: 'dashboard', affix: true } - }); - } +// 默认首页:统计汇总(登录后 / 访问根路径均进入此页面) +{ + const homeRoute = constantRoutes.find((item) => item.path === ''); + homeRoute?.children?.push({ + path: '/index', + component: () => import('@/views/system/statistics-summary/index.vue'), + name: 'Index', + hidden: true, + meta: { title: '统计汇总', icon: 'dashboard', affix: true } + }); } // 动态路由,基于用户权限动态去加载 diff --git a/src/types/env.d.ts b/src/types/env.d.ts index f87ab9c..eb84aff 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -29,8 +29,6 @@ interface ImportMetaEnv { VITE_TIANDITU_KEY: string; VITE_LOGIN_BACK_URL: string; - VITE_LOGIN_BACK_URL_WORKBENCH_TRU: boolean; - VITE_APP_SHOW_WORK_PLATFORM: string; } interface ImportMeta { readonly env: ImportMetaEnv; diff --git a/src/views/login.vue b/src/views/login.vue index f4679a9..1e1fd07 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -112,7 +112,7 @@ const handleLogin = () => { // 调用action的登录方法 const [err] = await to(userStore.login(loginForm.value)); if (!err) { - // 登录后固定进入工作台(小区由后端默认,无需选择) + // 登录后进入统计汇总页(/index,小区由后端默认,无需选择) await router.push(import.meta.env.VITE_LOGIN_BACK_URL || '/'); loading.value = false; } else { diff --git a/src/views/system/Sdb/SdbElectricityShare/detail.vue b/src/views/system/Sdb/SdbElectricityShare/detail.vue new file mode 100644 index 0000000..c92be6f --- /dev/null +++ b/src/views/system/Sdb/SdbElectricityShare/detail.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/views/system/Sdb/SdbElectricityShare/index.vue b/src/views/system/Sdb/SdbElectricityShare/index.vue index 8238a45..9c9c808 100644 --- a/src/views/system/Sdb/SdbElectricityShare/index.vue +++ b/src/views/system/Sdb/SdbElectricityShare/index.vue @@ -19,7 +19,7 @@ @@ -42,11 +42,14 @@ - - + +