diff --git a/apps/web-antd/src/api/property/customerService/activity/index.ts b/apps/web-antd/src/api/property/customerService/activity/index.ts new file mode 100644 index 00000000..1caa165f --- /dev/null +++ b/apps/web-antd/src/api/property/customerService/activity/index.ts @@ -0,0 +1,61 @@ +import type { ActivityVO, ActivityForm, ActivityQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询客户服务-活动列表 +* @param params +* @returns 客户服务-活动列表 +*/ +export function activityList(params?: ActivityQuery) { + return requestClient.get>('/property/activity/list', { params }); +} + +/** + * 导出客户服务-活动列表 + * @param params + * @returns 客户服务-活动列表 + */ +export function activityExport(params?: ActivityQuery) { + return commonExport('/property/activity/export', params ?? {}); +} + +/** + * 查询客户服务-活动详情 + * @param id id + * @returns 客户服务-活动详情 + */ +export function activityInfo(id: ID) { + return requestClient.get(`/property/activity/${id}`); +} + +/** + * 新增客户服务-活动 + * @param data + * @returns void + */ +export function activityAdd(data: ActivityForm) { + return requestClient.postWithMsg('/property/activity', data); +} + +/** + * 更新客户服务-活动 + * @param data + * @returns void + */ +export function activityUpdate(data: ActivityForm) { + return requestClient.putWithMsg('/property/activity', data); +} + +/** + * 删除客户服务-活动 + * @param id id + * @returns void + */ +export function activityRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/activity/${id}`); +} diff --git a/apps/web-antd/src/api/property/customerService/activity/model.d.ts b/apps/web-antd/src/api/property/customerService/activity/model.d.ts new file mode 100644 index 00000000..4370dd31 --- /dev/null +++ b/apps/web-antd/src/api/property/customerService/activity/model.d.ts @@ -0,0 +1,154 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface ActivityVO { + /** + * 主键 + */ + id: string | number; + + /** + * 标题 + */ + title: string; + + /** + * 状态(1待进行2进行中3已完成) + */ + status: string; + + /** + * 活动图片 + */ + activityImgUrl: string; + + /** + * 开始时间 + */ + startTime: string; + + /** + * 结束时间 + */ + endTime: string; + + /** + * 活动内容 + */ + activityContent: string; + + /** + * 备注 + */ + remark: string; + + /** + * 发布人 + */ + issuers: number; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface ActivityForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 标题 + */ + title?: string; + + /** + * 状态(1待进行2进行中3已完成) + */ + status?: string; + + /** + * 活动图片 + */ + activityImgUrl?: string; + + /** + * 开始时间 + */ + startTime?: string; + + /** + * 结束时间 + */ + endTime?: string; + + /** + * 活动内容 + */ + activityContent?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 发布人 + */ + issuers?: number; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface ActivityQuery extends PageQuery { + /** + * 标题 + */ + title?: string; + + /** + * 状态(1待进行2进行中3已完成) + */ + status?: string; + + /** + * 活动图片 + */ + activityImgUrl?: string; + + /** + * 开始时间 + */ + startTime?: string; + + /** + * 结束时间 + */ + endTime?: string; + + /** + * 活动内容 + */ + activityContent?: string; + + /** + * 发布人 + */ + issuers?: number; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/property/resident/unit/model.d.ts b/apps/web-antd/src/api/property/resident/unit/model.d.ts index 259e2abe..1c6d50df 100644 --- a/apps/web-antd/src/api/property/resident/unit/model.d.ts +++ b/apps/web-antd/src/api/property/resident/unit/model.d.ts @@ -1,4 +1,4 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type {PageQuery, BaseEntity} from '#/api/common'; export interface Resident_unitVO { /** @@ -67,8 +67,8 @@ export interface Resident_unitVO { */ authGroupName?: string; // 授权期限 - authBegDate?:string;//开始 - authEndDate?:string;//结束 + authBegDate?: string;//开始 + authEndDate?: string;//结束 } @@ -177,8 +177,8 @@ export interface Resident_unitQuery extends PageQuery { number?: number; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; } @@ -240,4 +240,9 @@ export interface Unit extends BaseEntity { */ remark?: string; + /** + * 入驻面积 + */ + area?: string; + } diff --git a/apps/web-antd/src/store/notify.ts b/apps/web-antd/src/store/notify.ts index 00e81fa4..0a5fa553 100644 --- a/apps/web-antd/src/store/notify.ts +++ b/apps/web-antd/src/store/notify.ts @@ -63,8 +63,6 @@ export const useNotifyStore = defineStore( watch(data, (message) => { if (!message) return - console.log(`接收到消息: ${message}`) - try { // 尝试解析JSON const obj = JSON.parse(message) diff --git a/apps/web-antd/src/views/dashboard/analytics/index.vue b/apps/web-antd/src/views/dashboard/analytics/index.vue index f330e43d..71f79cce 100644 --- a/apps/web-antd/src/views/dashboard/analytics/index.vue +++ b/apps/web-antd/src/views/dashboard/analytics/index.vue @@ -19,11 +19,12 @@ import { getStatisticsCurrDay, getStatistics, } from '#/api/analytics/index'; +import { getVisitorList } from '#/api/property/resident/passRecordManagement'; const overviewItems = ref([ { icon: SvgCardIcon, - title: '今日访客量', - totalTitle: '总访客量', + title: '今日通行量', + totalTitle: '总通行量', totalValue: 0, value: 0, }, @@ -73,6 +74,37 @@ const handleDateChange = (date: any) => { } }; +// 通行量 +async function getPersonCount() { + const date = new Date(); + const nowDate = date + .toLocaleDateString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }) + .replace(/\//g, '-'); + + const historyData = { + pageNum: 1, + pageSize: 10, + begTime: '2025-09-01', + endTime: nowDate, + }; + + const todayData = { + pageNum: 1, + pageSize: 10, + begTime: nowDate, + endTime: nowDate, + }; + + const historyTotal = await getVisitorList(historyData); + const todayTotal = await getVisitorList(todayData); + overviewItems.value[0].totalValue = historyTotal.total; + overviewItems.value[0].value = todayTotal.total; +} + // 工单数量 async function getIndex() { const res = await getIndexCount(); @@ -91,8 +123,7 @@ async function getCarCount() { endDate.setHours(23, 59, 59, 999); // 转换为正确的 ISO 格式,考虑时区偏移 const toLocalISOString = (date: Date) => { - const timezoneOffset = date.getTimezoneOffset() * 60000; // 转换为毫秒 - const localTime = new Date(date.getTime() - timezoneOffset); + const localTime = new Date(date.getTime()); return localTime.toISOString().slice(0, -1) + 'Z'; }; const response = await fetch( @@ -146,6 +177,7 @@ async function getStatisticsCount() { onMounted(() => { getIndex(); getCarCount(); + getPersonCount(); getStatisticsCurrDayCount(); getStatisticsCount(); }); diff --git a/apps/web-antd/src/views/property/businessManagement/workOrders/workOrders-modal.vue b/apps/web-antd/src/views/property/businessManagement/workOrders/workOrders-modal.vue index f766a4ef..403f5f44 100644 --- a/apps/web-antd/src/views/property/businessManagement/workOrders/workOrders-modal.vue +++ b/apps/web-antd/src/views/property/businessManagement/workOrders/workOrders-modal.vue @@ -3,7 +3,7 @@ import {computed, ref} from 'vue'; import {useVbenModal} from '@vben/common-ui'; import {$t} from '@vben/locales'; -import {cloneDeep} from '@vben/utils'; +import {cloneDeep, handleNode} from '@vben/utils'; import {useVbenForm} from '#/adapter/form'; import { @@ -107,6 +107,12 @@ async function handleClosed() { async function queryWorkOrdersType() { const options = await workOrdersTypeTree() + const splitStr = '/'; + handleNode(options, 'orderTypeName', splitStr, function (node: any) { + if (node.children.length) { + node.disabled = true; + } + }); formApi.updateSchema([ { componentProps: (formModel) => ({ diff --git a/apps/web-antd/src/views/property/customerService/activity/activity-detail.vue b/apps/web-antd/src/views/property/customerService/activity/activity-detail.vue new file mode 100644 index 00000000..ed0f841b --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/activity/activity-detail.vue @@ -0,0 +1,70 @@ + + + diff --git a/apps/web-antd/src/views/property/customerService/activity/activity-modal.vue b/apps/web-antd/src/views/property/customerService/activity/activity-modal.vue new file mode 100644 index 00000000..a682a710 --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/activity/activity-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/property/customerService/activity/data.ts b/apps/web-antd/src/views/property/customerService/activity/data.ts new file mode 100644 index 00000000..70dba5ed --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/activity/data.ts @@ -0,0 +1,112 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; +import { renderDict } from '#/utils/render'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'title', + label: '标题', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '活动ID', + field: 'id', + }, + { + title: '标题', + field: 'title', + }, + { + title: '开始时间', + field: 'startTime', + }, + { + title: '结束时间', + field: 'endTime', + }, + { + title: '发布状态', + field: 'status', + slots: { + default: ({ row }) => { + return renderDict(row.status, 'pro_release_status'); + }, + }, + }, + { + title: '发布人', + field: 'issuersText', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '标题', + fieldName: 'title', + component: 'Input', + rules: 'required', + }, + { + label: '活动图片', + fieldName: 'activityImgUrl', + component: 'ImageUpload', + componentProps: { + maxCount: 1, + }, + // rules: 'required', + }, + { + label: '开始时间', + fieldName: 'startTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + rules: 'required', + }, + { + label: '结束时间', + fieldName: 'endTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + rules: 'required', + }, + { + label: '活动内容', + fieldName: 'activityContent', + component: 'RichTextarea', + componentProps: { + // disabled: false, // 是否只读 + // height: 400 // 高度 默认400 + }, + rules: 'required', + }, +]; diff --git a/apps/web-antd/src/views/property/customerService/activity/index.vue b/apps/web-antd/src/views/property/customerService/activity/index.vue new file mode 100644 index 00000000..485625f2 --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/activity/index.vue @@ -0,0 +1,195 @@ + + + diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue index 767526bb..35da0d07 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue @@ -19,18 +19,15 @@ onMounted(() => { () => notifyStore.sseList, (val) => { const latestMessage = val[val.length - 1]; - try { // 尝试解析消息内容 const parsedMessage = JSON.parse(latestMessage); - console.log('收到sse消息:', parsedMessage); if (parsedMessage.type === 'meter') { // 根据消息内容执行相应操作 handleSSEMessage(parsedMessage); } } catch (e) { console.log('收到非JSON消息:', latestMessage); - // 处理非JSON格式消息 } }, { deep: true }, diff --git a/apps/web-antd/src/views/property/resident/unit/unit-detail.vue b/apps/web-antd/src/views/property/resident/unit/unit-detail.vue index 90b2871c..398f6908 100644 --- a/apps/web-antd/src/views/property/resident/unit/unit-detail.vue +++ b/apps/web-antd/src/views/property/resident/unit/unit-detail.vue @@ -44,7 +44,7 @@ async function handleOpenChange(open: boolean) {