This commit is contained in:
lxj
2025-08-27 20:41:02 +08:00
131 changed files with 3346 additions and 1711 deletions

View File

@@ -2,13 +2,15 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
branches: branches:
- master - prod
jobs: jobs:
Explore-Gitea-Actions: Explore-Gitea-Actions:
runs-on: ubuntu runs-on: ubuntu
steps: steps:
- name: 拉取代码仓库 - name: 拉取代码仓库
uses: http://git.missmoc.top/mocheng/checkout@v4 uses: http://git.missmoc.top/mocheng/checkout@v4
with:
fetch-depth: 1 # 只拉取最新的1个提交浅克隆
- name: Set up Node.js - name: Set up Node.js
uses: http://git.missmoc.top/mocheng/setup-node@v3 uses: http://git.missmoc.top/mocheng/setup-node@v3
@@ -37,12 +39,6 @@ jobs:
exit 1 exit 1
fi fi
- name: 通过SSH复制文件 - name: 通过SSH复制文件
uses: http://git.missmoc.top/mocheng/scp-action@v0.1.7 run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property
with:
host: 127.0.0.1
username: ${{ secrets.SERVER_NAME }} # 使用secrets存储
password: ${{ secrets.SERVER_PWD }} # 使用secrets存储
port: 11001
source: "./apps/web-antd/dist"
target: "/www/wwwroot/183.230.235.66_11010/property"

View File

@@ -20,7 +20,7 @@ export interface AttendanceAreaVO {
* 备注 * 备注
*/ */
reamark: string; reamark: string;
areaDevice?: any[];
} }
export interface AttendanceAreaForm extends BaseEntity { export interface AttendanceAreaForm extends BaseEntity {
@@ -43,7 +43,6 @@ export interface AttendanceAreaForm extends BaseEntity {
* 备注 * 备注
*/ */
reamark?: string; reamark?: string;
} }
export interface AttendanceAreaQuery extends PageQuery { export interface AttendanceAreaQuery extends PageQuery {
@@ -63,7 +62,7 @@ export interface AttendanceAreaQuery extends PageQuery {
reamark?: string; reamark?: string;
/** /**
* 日期范围参数 * 日期范围参数
*/ */
params?: any; params?: any;
} }

View File

@@ -59,3 +59,19 @@ export function workOrdersUpdate(data: WorkOrdersForm) {
export function workOrdersRemove(id: ID | IDS) { export function workOrdersRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/workOrders/${id}`); return requestClient.deleteWithMsg<void>(`/property/workOrders/${id}`);
} }
/**
* 派单
* @param data
*/
export function workOrdersDispatch(data: WorkOrdersForm) {
return requestClient.putWithMsg<void>('/property/workOrders/dispatch', data);
}
/**
* 抢单
* @param data
*/
export function workOrdersGrab(data: WorkOrdersForm) {
return requestClient.putWithMsg<void>('/property/workOrders/grab', data);
}

View File

@@ -64,7 +64,7 @@ export interface WorkOrdersVO {
/** /**
* 评价 * 评价
*/ */
serviceEvalua: string; serviceEvalua: number;
/** /**
* 是否超时 * 是否超时
@@ -82,6 +82,8 @@ export interface WorkOrdersVO {
* 评价图片 * 评价图片
*/ */
imgUrl: string; imgUrl: string;
evaluateImgPath: string[];
/** /**
* 评价内容 * 评价内容
*/ */
@@ -99,6 +101,12 @@ export interface WorkOrdersVO {
*/ */
orderImgUrl: string; orderImgUrl: string;
orderImgPath: string[];
reportingType: string;
processingWeight: string;
} }
export interface HandleRecords { export interface HandleRecords {

View File

@@ -37,6 +37,11 @@ export interface WorkOrdersTypeVO {
isTransfers: string; isTransfers: string;
excludeId: string; excludeId: string;
/**
* 处理优先级
*/
processingWeight: string;
} }
export interface WorkOrdersTypeForm extends BaseEntity { export interface WorkOrdersTypeForm extends BaseEntity {
@@ -79,6 +84,11 @@ export interface WorkOrdersTypeForm extends BaseEntity {
* 上级类型id * 上级类型id
*/ */
parentId?: string; parentId?: string;
/**
* 处理优先级
*/
processingWeight: string;
} }
export interface WorkOrdersTypeQuery extends PageQuery { export interface WorkOrdersTypeQuery extends PageQuery {

View File

@@ -144,6 +144,16 @@ export interface Clean_orderForm extends BaseEntity {
*/ */
phone?: string; phone?: string;
/**
* 签到图片
*/
signImgUrl?: string;
/**
* 评价图片
*/
imgUrl?: string;
} }
export interface Clean_orderQuery extends PageQuery { export interface Clean_orderQuery extends PageQuery {

View File

@@ -1,65 +1,65 @@
import type { PageQuery, BaseEntity } from '#/api/common'; import type { PageQuery, BaseEntity } from '#/api/common'
export interface MeterInfoVO { export interface MeterInfoVO {
/** /**
* id * id
*/ */
id: string | number; id: string | number
/** /**
* *
*/ */
meterName: string; meterName: string
/** /**
* *
*/ */
meterCode: string; meterCode: string
/** /**
* *
*/ */
factoryNo: string; factoryNo: string
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterType: number; meterType: number | String
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterUnit: number; meterUnit: number | String
/** /**
* *
*/ */
installLocation: string; installLocation: string
/** /**
* *
*/ */
initReading: number; initReading: number
/** /**
* *
*/ */
maxRang: number; maxRang: number
/** /**
* *
*/ */
communicationState: number; communicationState: number | String
/** /**
* *
*/ */
runningState: number; runningState: number | String
/** /**
* *
*/ */
remark: string; remark: string
} }
@@ -67,62 +67,67 @@ export interface MeterInfoForm extends BaseEntity {
/** /**
* id * id
*/ */
id?: string | number; id?: string | number
/** /**
* *
*/ */
meterName?: string; meterName?: string
/** /**
* *
*/ */
meterCode?: string; meterCode?: string
/** /**
* *
*/ */
factoryNo?: string; factoryNo?: string
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterType?: number; meterType?: number
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterUnit?: number; meterUnit?: number
/** /**
* *
*/ */
installLocation?: string; installLocation?: string
/** /**
* *
*/ */
initReading?: number; initReading?: number
/** /**
* *
*/ */
maxRang?: number; maxRang?: number
/** /**
* *
*/ */
communicationState?: number; communicationState?: number
/** /**
* *
*/ */
runningState?: number; runningState?: number
/**
* IP
*/
hostIp?: string
/** /**
* *
*/ */
remark?: string; remark?: string
} }
@@ -130,55 +135,55 @@ export interface MeterInfoQuery extends PageQuery {
/** /**
* *
*/ */
meterName?: string; meterName?: string
/** /**
* *
*/ */
meterCode?: string; meterCode?: string
/** /**
* *
*/ */
factoryNo?: string; factoryNo?: string
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterType?: number; meterType?: number
/** /**
* (1-2-3-) * (1-2-3-)
*/ */
meterUnit?: number; meterUnit?: number
/** /**
* *
*/ */
installLocation?: string; installLocation?: string
/** /**
* *
*/ */
initReading?: number; initReading?: number
/** /**
* *
*/ */
maxRang?: number; maxRang?: number
/** /**
* *
*/ */
communicationState?: number; communicationState?: number
/** /**
* *
*/ */
runningState?: number; runningState?: number
/** /**
* *
*/ */
params?: any; params?: any
} }

View File

@@ -0,0 +1,61 @@
import type { MeterRecordVO, MeterRecordForm, MeterRecordQuery } 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 meterRecordList(params?: MeterRecordQuery) {
return requestClient.get<PageResult<MeterRecordVO>>('/property/meterRecord/list', { params });
}
/**
* 导出抄表记录列表
* @param params
* @returns 抄表记录列表
*/
export function meterRecordExport(params?: MeterRecordQuery) {
return commonExport('/property/meterRecord/export', params ?? {});
}
/**
* 查询抄表记录详情
* @param id id
* @returns 抄表记录详情
*/
export function meterRecordInfo(id: ID) {
return requestClient.get<MeterRecordVO>(`/property/meterRecord/${id}`);
}
/**
* 新增抄表记录
* @param data
* @returns void
*/
export function meterRecordAdd(data: MeterRecordForm) {
return requestClient.postWithMsg<void>('/property/meterRecord', data);
}
/**
* 更新抄表记录
* @param data
* @returns void
*/
export function meterRecordUpdate(data: MeterRecordForm) {
return requestClient.putWithMsg<void>('/property/meterRecord', data);
}
/**
* 删除抄表记录
* @param id id
* @returns void
*/
export function meterRecordRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/meterRecord/${id}`);
}

View File

@@ -0,0 +1,149 @@
import type { PageQuery, BaseEntity } from '#/api/common'
export interface MeterRecordVO {
/**
* 记录ID
*/
id: string | number
/**
* 仪表编号
*/
meterId: string | number
/**
* 仪表类型
*/
meterType: string | number
/**
* 抄表员ID
*/
readerId: string | number
/**
* 抄表时间
*/
readingTime: string
/**
* 当前读数
*/
currentReading: number
/**
* 上次读数
*/
previousReading: number
/**
* 用量
*/
consumption: number
/**
* 抄表方式(1手动 2自动 3用户上报)
*/
readingMethod: number
/**
* 抄表照片
*/
imgOssid: string | number
}
export interface MeterRecordForm extends BaseEntity {
/**
* 记录ID
*/
id?: string | number
/**
* 仪表编号
*/
meterId?: string | number
/**
* 抄表员ID
*/
readerId?: string | number
/**
* 抄表时间
*/
readingTime?: string
/**
* 当前读数
*/
currentReading?: number
/**
* 上次读数
*/
previousReading?: number
/**
* 用量
*/
consumption?: number
/**
* 抄表方式(1手动 2自动 3用户上报)
*/
readingMethod?: number
/**
* 抄表照片
*/
imgOssid?: string | number
}
export interface MeterRecordQuery extends PageQuery {
/**
* 仪表编号
*/
meterId?: string | number
/**
* 抄表员ID
*/
readerId?: string | number
/**
* 抄表时间
*/
readingTime?: string
/**
* 当前读数
*/
currentReading?: number
/**
* 上次读数
*/
previousReading?: number
/**
* 用量
*/
consumption?: number
/**
* 抄表方式(1手动 2自动 3用户上报)
*/
readingMethod?: number
/**
* 抄表照片
*/
imgOssid?: string | number
/**
* 日期范围参数
*/
params?: any
}

View File

@@ -21,6 +21,8 @@ export interface KnowledgeVO {
*/ */
covers: string; covers: string;
coversPath: string|undefined;
/** /**
* 内容 * 内容
*/ */

View File

@@ -26,6 +26,8 @@ export interface PropertyVO {
*/ */
imgPath: string; imgPath: string;
plantImg: string;
/** /**
* 规格 * 规格
*/ */
@@ -102,7 +104,6 @@ export interface PropertyForm extends BaseEntity {
* 备注 * 备注
*/ */
remark?: string; remark?: string;
} }
export interface PropertyQuery extends PageQuery { export interface PropertyQuery extends PageQuery {
@@ -178,6 +179,8 @@ export interface plantsProduct extends BaseEntity {
*/ */
imgPath?: string; imgPath?: string;
plantImg: string |undefined;
/** /**
* 规格 * 规格
*/ */

View File

@@ -0,0 +1,11 @@
import { requestClient } from '#/api/request';
import type { PageResult } from '#/api/common';
/**
* 通行记录列表
* @param data
* @returns void
*/
export function getVisitorList(params?: any) {
return requestClient.get<PageResult<any>>('/sis/visitor/list', { params });
}

View File

@@ -31,6 +31,8 @@ export interface PersonVO {
*/ */
img: string img: string
imgPath?: string
/** /**
* 所属单位id * 所属单位id
*/ */
@@ -79,6 +81,10 @@ export interface PersonVO {
rosterType?: string | number rosterType?: string | number
email?: string
idCard?: string
} }
export interface PersonForm extends BaseEntity { export interface PersonForm extends BaseEntity {

View File

@@ -35,6 +35,7 @@ export interface Resident_unitVO {
* 入驻位置 * 入驻位置
*/ */
location: string; location: string;
locations: string[];
/** /**
* 入驻时间 * 入驻时间
@@ -65,6 +66,9 @@ export interface Resident_unitVO {
* 权限组名称 * 权限组名称
*/ */
authGroupName?: string; authGroupName?: string;
// 授权期限
authBegDate?:string;//开始
authEndDate?:string;//结束
} }

View File

@@ -67,6 +67,8 @@ export interface MeetVO {
* 图片 * 图片
*/ */
picture: string; picture: string;
pictureArr: string[];
/** /**
* 开放时段开始时间 * 开放时段开始时间
*/ */
@@ -75,6 +77,19 @@ export interface MeetVO {
* 开放时段结束时间 * 开放时段结束时间
*/ */
openEndHours: string; openEndHours: string;
/**
* 会议室类型
*/
meetingRoomType: string;
/**
* 位置
*/
locationName: string;
/**
* 负责人
*/
principalsName: string;
} }
export interface MeetForm extends BaseEntity { export interface MeetForm extends BaseEntity {
@@ -161,6 +176,8 @@ export interface MeetForm extends BaseEntity {
*/ */
picture: string; picture: string;
pictureArr: string[];
/** /**
* 开放时段开始时间 * 开放时段开始时间
*/ */

View File

@@ -84,13 +84,13 @@ const menus = computed(() => {
// icon: CircleHelp, // icon: CircleHelp,
// text: $t('ui.widgets.qa'), // text: $t('ui.widgets.qa'),
// }, // },
{ // {
handler: () => { // handler: () => {
router.push('/navigation'); // router.push('/navigation');
}, // },
// icon: TagOutlined, // // icon: TagOutlined,
text: '返回导航', // text: '返回导航',
}, // },
]; ];
/** /**
* 租户选中状态 不显示个人中心 * 租户选中状态 不显示个人中心

View File

@@ -56,9 +56,7 @@ export const useAuthStore = defineStore('auth', () => {
if (accessStore.loginExpired) { if (accessStore.loginExpired) {
accessStore.setLoginExpired(false); accessStore.setLoginExpired(false);
} else { } else {
onSuccess onSuccess ? await onSuccess?.() : await router.push('/analytics');
? await onSuccess?.()
: await router.push('/navigation');
} }
if (userInfo?.realName) { if (userInfo?.realName) {

View File

@@ -26,7 +26,7 @@ onMounted(() => {
{ name: '搜索引擎', value: 1048 }, { name: '搜索引擎', value: 1048 },
{ name: '直接访问', value: 735 }, { name: '直接访问', value: 735 },
{ name: '邮件营销', value: 580 }, { name: '邮件营销', value: 580 },
{ name: '联盟广告', value: 484 }, // { name: '联盟广告', value: 484 },
], ],
emphasis: { emphasis: {
label: { label: {

View File

@@ -25,29 +25,29 @@ const overviewItems: AnalysisOverviewItem[] = [
icon: SvgCardIcon, icon: SvgCardIcon,
title: '用户量', title: '用户量',
totalTitle: '总用户量', totalTitle: '总用户量',
totalValue: 120_000, totalValue: 78,
value: 2000, value: 15,
}, },
{ {
icon: SvgCakeIcon, icon: SvgCakeIcon,
title: '访问量', title: '访问量',
totalTitle: '总访问量', totalTitle: '总访问量',
totalValue: 500_000, totalValue: 2_278,
value: 20_000, value: 461,
}, },
{ {
icon: SvgDownloadIcon, icon: SvgDownloadIcon,
title: '下载量', title: '下载量',
totalTitle: '总下载量', totalTitle: '总下载量',
totalValue: 120_000, totalValue: 17,
value: 8000, value: 2,
}, },
{ {
icon: SvgBellIcon, icon: SvgBellIcon,
title: '使用量', title: '使用量',
totalTitle: '总使用量', totalTitle: '总使用量',
totalValue: 50_000, totalValue: 6_652,
value: 5000, value: 3_739,
}, },
]; ];

View File

@@ -61,5 +61,11 @@ export const modalSchema: FormSchemaGetter = () => [
label: '排序', label: '排序',
fieldName: 'sort', fieldName: 'sort',
component: 'InputNumber', component: 'InputNumber',
rules:'required',
componentProps: {
min: 0,
precision: 0,
step: 1
},
}, },
]; ];

View File

@@ -164,7 +164,7 @@ const { hasAccessByCodes } = useAccess();
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:depot:info']" v-access:code="['property:depot:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -5,9 +5,9 @@ import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render'; import { renderDict } from '#/utils/render';
import { suppliersList } from '#/api/property/assetManage/suppliers'; import { suppliersList } from '#/api/property/assetManage/suppliers';
import { depotList } from '#/api/property/assetManage/depot'; import { depotList } from '#/api/property/assetManage/depot';
import { useUserStore } from '@vben/stores'; // import { useUserStore } from '@vben/stores';
const userStore = useUserStore(); // const userStore = useUserStore();
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
// { // {
@@ -39,11 +39,13 @@ export const querySchema: FormSchemaGetter = () => [
{ {
component: 'Select', component: 'Select',
componentProps: {}, componentProps: {
options: getDictOptions('wy_zccgfs'),
},
fieldName: 'buyType', fieldName: 'buyType',
label: '采购方式', label: '采购方式',
options: getDictOptions('wy_zccgfs'),
}, },
{ {
component: 'Select', component: 'Select',
componentProps: { componentProps: {

View File

@@ -179,7 +179,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['domain:procurementApplication:audit']" v-access:code="['domain:procurementApplication:edit']"
:disabled="row.state === '1' || row.state === '2'" :disabled="row.state === '1' || row.state === '2'"
type="primary" type="primary"
@click.stop="handleAudit(row)" @click.stop="handleAudit(row)"
@@ -187,7 +187,7 @@ function handleDownloadExcel() {
审核 审核
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['domain:procurementApplication:detail']" v-access:code="['domain:procurementApplication:query']"
@click.stop="handleDetail(row)" @click.stop="handleDetail(row)"
> >
详情 详情

View File

@@ -155,14 +155,14 @@ const { hasAccessByCodes } = useAccess();
:unCheckedValue="0" :unCheckedValue="0"
v-model:value="row.state" v-model:value="row.state"
:api="() => suppliersUpdate(row)" :api="() => suppliersUpdate(row)"
:disabled="!hasAccessByCodes(['property:suppliers:update'])" :disabled="!hasAccessByCodes(['property:suppliers:edit'])"
@reload="() => tableApi.query()" @reload="() => tableApi.query()"
/> />
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:suppliers:info']" v-access:code="['property:suppliers:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -1,20 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs'; import {
import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
assetTypeExport, assetTypeExport,
assetTypeList, assetTypeList,
@@ -35,15 +27,6 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
}; };
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
@@ -138,8 +121,8 @@ function handleDownloadExcel() {
<a-button <a-button
:disabled="!vxeCheckboxChecked(tableApi)" :disabled="!vxeCheckboxChecked(tableApi)"
danger danger
type="primary" type="primary"
v-access:code="['property:assetType:remove']" v-access:code="['property:assetType:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>

View File

@@ -63,6 +63,9 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await attendanceAreaInfo(id); const record = await attendanceAreaInfo(id);
record.deviceManageId = record.areaDevice
.map((device: any) => device.remoteSisDeviceManage?.id || '')
.filter((id: string) => id);
await formApi.setValues(record); await formApi.setValues(record);
} }
await markInitialized(); await markInitialized();

View File

@@ -62,11 +62,13 @@ export const modalSchema: FormSchemaGetter = () => [
label: '区域', label: '区域',
fieldName: 'area', fieldName: 'area',
component: 'Input', component: 'Input',
rules: 'required',
}, },
{ {
label: '摄像机', label: '摄像机',
fieldName: 'deviceManageId', fieldName: 'deviceManageId',
component: 'ApiSelect', component: 'ApiSelect',
rules: 'required',
componentProps: { componentProps: {
api: async () => { api: async () => {
const res = await deviceManageList({ const res = await deviceManageList({

View File

@@ -154,7 +154,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['Property:group:info']" v-access:code="['Property:group:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
@@ -187,7 +187,7 @@ function handleDownloadExcel() {
:unCheckedValue="0" :unCheckedValue="0"
v-model:value="row.status" v-model:value="row.status"
:api="() => groupUpdate(row)" :api="() => groupUpdate(row)"
:disabled="!hasAccessByCodes(['property:depot:edit'])" :disabled="!hasAccessByCodes(['Property:group:edit'])"
@reload="() => tableApi.query()" @reload="() => tableApi.query()"
/> />
</template> </template>

View File

@@ -276,7 +276,7 @@ defineExpose({
</div> </div>
</div> </div>
<div> <div>
<Button type="primary" @click="handleAdd">新增排班</Button> <Button type="primary" @click="handleAdd" v-access:code="['Property:arrangement:add']">新增排班</Button>
</div> </div>
</div> </div>
<div class="flex-1 p-1"> <div class="flex-1 p-1">
@@ -295,12 +295,16 @@ defineExpose({
<a <a
style="margin-left: 4px; color: #1890ff; cursor: pointer" style="margin-left: 4px; color: #1890ff; cursor: pointer"
@click.stop="handleEdit(item.item, current)" @click.stop="handleEdit(item.item, current)"
v-access:code="['Property:arrangement:edit']"
> >
编辑 编辑
</a> </a>
<a <a
style="margin-left: 4px; color: #ff4d4f; cursor: pointer" style="margin-left: 4px; color: #ff4d4f; cursor: pointer"
@click.stop="handleDelete(item.item)" @click.stop="handleDelete(item.item)"
v-access:code="['Property:arrangement:remove']"
> >
删除 删除
</a> </a>
@@ -311,6 +315,7 @@ defineExpose({
v-if="getListData2(current).length > 0" v-if="getListData2(current).length > 0"
style="margin-left: 4px; color: #1890ff; cursor: pointer" style="margin-left: 4px; color: #1890ff; cursor: pointer"
@click.stop="handleViewDateDetails(current)" @click.stop="handleViewDateDetails(current)"
v-access:code="['Property:userGroup:queryScheduleView']"
> >
详情 详情
</a> </a>

View File

@@ -137,7 +137,7 @@ defineExpose({
> >
<ghost-button <ghost-button
danger danger
v-access:code="['property:arrangement:remove']" v-access:code="['Property:arrangement:remove']"
@click.stop="" @click.stop=""
> >
移除 移除

View File

@@ -75,7 +75,7 @@ function handleInfo(row:any) {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:workOrders:info']" v-access:code="['property:workOrders:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -8,7 +8,7 @@ import {
import { import {
workOrdersList, workOrdersList,
} from '#/api/property/businessManagement/workOrders'; } from '#/api/property/businessManagement/workOrders';
import workOrdersDetail from './work-orders-detail.vue'; import workOrdersDetail from '../workOrders/work-orders-detail.vue';
import {columns, querySchema} from './data'; import {columns, querySchema} from './data';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
@@ -75,7 +75,7 @@ function handleInfo(row:any) {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:workOrders:info']" v-access:code="['property:workOrders:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -2,8 +2,6 @@ import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table'; import type {VxeGridProps} from '#/adapter/vxe-table';
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
import {getDictOptions} from "#/utils/dict"; import {getDictOptions} from "#/utils/dict";
import {h} from "vue";
import {Rate} from "ant-design-vue";
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
@@ -56,7 +54,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'reportingType', field: 'reportingType',
slots: { slots: {
default: ({row}) => { default: ({row}) => {
return renderDict(row.reportingType, 'wy_gdsblx'); return row.reportingType!=null?renderDict(row.reportingType, 'wy_gdsblx'):'';
}, },
}, },
width: 100, width: 100,
@@ -86,7 +84,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'processingWeight', field: 'processingWeight',
slots: { slots: {
default: ({row}) => { default: ({row}) => {
return renderDict(row.processingWeight, 'pro_processing_weight'); return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
}, },
}, },
width: 100, width: 100,
@@ -96,34 +94,34 @@ export const columns: VxeGridProps['columns'] = [
// field: 'planCompleTime', // field: 'planCompleTime',
// width: 100, // width: 100,
// }, // },
{ // {
title: '完成时间', // title: '完成时间',
field: 'compleTime', // field: 'compleTime',
width: 100, // width: 100,
}, // },
{ // {
title: '评价', // title: '评价',
field: 'serviceEvalua', // field: 'serviceEvalua',
width: 180, // width: 180,
slots: { // slots: {
default: ({row}) => { // default: ({row}) => {
return h(Rate, { // return h(Rate, {
value: row.serviceEvalua || 0, // value: row.serviceEvalua || 0,
disabled: true, // disabled: true,
}); // });
}, // },
}, // },
}, // },
{ // {
title: '是否超时', // title: '是否超时',
field: 'isTimeOut', // field: 'isTimeOut',
width: 100, // width: 100,
slots: { // slots: {
default: ({row}) => { // default: ({row}) => {
return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : ''; // return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
}, // },
}, // },
}, // },
{ {
title: '创建时间', title: '创建时间',
field: 'createTime', field: 'createTime',

View File

@@ -184,19 +184,21 @@ onMounted(async () => {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:workOrders:dispatch']"
@click.stop="handleOrders(row,'group')" @click.stop="handleOrders(row,'group')"
v-if="row.status!=='1' && row.status!=='2'" v-if="row.status!=='1' && row.status!=='2'&&row.operationMode!=='2'"
> >
{{ '派单' }} {{ '派单' }}
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['property:workOrders:grab']"
@click.stop="handleOrders(row,'rob')" @click.stop="handleOrders(row,'rob')"
v-if="row.status!=='1' && row.status!=='2'" v-if="row.status!=='1' && row.status!=='2'&&row.operationMode!=='2'"
> >
{{ '抢单' }} {{ '抢单' }}
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['property:workOrders:info']" v-access:code="['property:workOrders:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -3,6 +3,7 @@ import {useVbenModal} from '@vben/common-ui';
import {cloneDeep} from '@vben/utils'; import {cloneDeep} from '@vben/utils';
import {useVbenForm} from '#/adapter/form'; import {useVbenForm} from '#/adapter/form';
import { import {
workOrdersDispatch, workOrdersGrab,
workOrdersInfo, workOrdersInfo,
workOrdersUpdate workOrdersUpdate
} from '#/api/property/businessManagement/workOrders'; } from '#/api/property/businessManagement/workOrders';
@@ -84,11 +85,15 @@ async function handleConfirm() {
} }
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
if(title.value === '派单'){ if(title.value === '派单'){
//派单
record.value.handler = data.handler record.value.handler = data.handler
await workOrdersDispatch(record.value)
}else{ }else{
//抢单
record.value.handler = userStore.userInfo.userId record.value.handler = userStore.userInfo.userId
await workOrdersGrab(record.value)
} }
await workOrdersUpdate(record.value)
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');
modalApi.close(); modalApi.close();

View File

@@ -1,13 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, shallowRef} from 'vue'; import {ref, shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui'; import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem, Timeline, TimelineItem, Rate,Divider} from 'ant-design-vue'; import {
Descriptions,
DescriptionsItem,
Timeline,
TimelineItem,
Rate,
Divider
} from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration'; import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime'; import relativeTime from 'dayjs/plugin/relativeTime';
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
import {workOrdersInfo} from "#/api/property/businessManagement/workOrders"; import {workOrdersInfo} from "#/api/property/businessManagement/workOrders";
import type {HandleRecords, WorkOrdersVO} from "#/api/property/businessManagement/workOrders/model"; import type {HandleRecords, WorkOrdersVO} from "#/api/property/businessManagement/workOrders/model";
import {ossInfo} from "#/api/system/oss";
dayjs.extend(duration); dayjs.extend(duration);
dayjs.extend(relativeTime); dayjs.extend(relativeTime);
@@ -20,7 +28,8 @@ const [BasicModal, modalApi] = useVbenModal({
}); });
const orderDetail = shallowRef<null | WorkOrdersVO>(null); const orderDetail = shallowRef<null | WorkOrdersVO>(null);
const handleRecords=ref<HandleRecords[]>([]) const handleRecords = ref<HandleRecords[]>([])
async function handleOpenChange(open: boolean) { async function handleOpenChange(open: boolean) {
if (!open) { if (!open) {
return null; return null;
@@ -28,14 +37,33 @@ async function handleOpenChange(open: boolean) {
modalApi.modalLoading(true); modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string }; const {id} = modalApi.getData() as { id: number | string };
orderDetail.value = await workOrdersInfo(id); orderDetail.value = await workOrdersInfo(id);
if(orderDetail.value){ if (orderDetail.value.workOrdersRecordVoList) {
handleRecords.value = orderDetail.value.workOrdersRecordVoList.map( (item, index) => ({ handleRecords.value = orderDetail.value.workOrdersRecordVoList.map((item, index) => ({
status: item.status, status: item.status,
createTime: item.createTime, createTime: item.createTime,
handlerName: index === 0 ? item.initiatorPeople : item.handlerName handlerName: index === 0 ? item.initiatorPeople : item.handlerName
})) }))
} }
modalApi.modalLoading(false); try {
if (orderDetail.value.orderImgUrl) {
const res = await ossInfo([orderDetail.value.orderImgUrl]);
let imgUrls = [] as string[];
res.forEach(item => {
imgUrls.push(item.url)
})
orderDetail.value.orderImgPath = imgUrls;
}
if (orderDetail.value.imgUrl) {
const res = await ossInfo([orderDetail.value.imgUrl]);
let imgUrls = [] as string[];
res.forEach(item => {
imgUrls.push(item.url)
})
orderDetail.value.evaluateImgPath = imgUrls
}
} catch (e) {
}
modalApi.modalLoading(false);
} }
</script> </script>
@@ -50,16 +78,16 @@ async function handleOpenChange(open: boolean) {
{{ orderDetail.orderName }} {{ orderDetail.orderName }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="工单类型"> <DescriptionsItem label="工单类型">
{{orderDetail.typeName}} {{ orderDetail.typeName }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="上报类型"> <DescriptionsItem label="上报类型">
<component <component v-if="orderDetail.reportingType!=null"
:is="renderDict(orderDetail.reportingType,'wy_gdsblx')" :is="renderDict(orderDetail.reportingType,'wy_gdsblx')"
/> />
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="处理优先级"> <DescriptionsItem label="处理优先级">
<component <component v-if="orderDetail.processingWeight!=null"
:is="renderDict(orderDetail.processingWeight,'pro_processing_weight')" :is="renderDict(orderDetail.processingWeight,'pro_processing_weight')"
/> />
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="发起人"> <DescriptionsItem label="发起人">
@@ -74,10 +102,9 @@ async function handleOpenChange(open: boolean) {
<DescriptionsItem label="具体位置" :span="2"> <DescriptionsItem label="具体位置" :span="2">
{{ orderDetail.location }} {{ orderDetail.location }}
</DescriptionsItem> </DescriptionsItem>
<!-- <DescriptionsItem label="计划完成时间">--> <!-- <DescriptionsItem label="计划完成时间">-->
<!-- {{ orderDetail.planCompleTime }}--> <!-- {{ orderDetail.planCompleTime }}-->
<!-- </DescriptionsItem>--> <!-- </DescriptionsItem>-->
<DescriptionsItem label="备注" :span="2"> <DescriptionsItem label="备注" :span="2">
{{ orderDetail.remark }} {{ orderDetail.remark }}
@@ -88,23 +115,24 @@ async function handleOpenChange(open: boolean) {
<DescriptionsItem label="完成时间"> <DescriptionsItem label="完成时间">
{{ orderDetail.compleTime }} {{ orderDetail.compleTime }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="是否超时" :span="2">
<DescriptionsItem label="是否超时" v-if="orderDetail.isTimeOut!=null"> <component v-if="orderDetail.isTimeOut!=null"
<component :is="renderDict(orderDetail.isTimeOut,'wy_sf')"
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
/> />
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgPath" :span="2">
<img v-for="item in orderDetail.orderImgPath" :src="item" alt="图片加载失败"
class="orders-img"/>
</DescriptionsItem>
<DescriptionsItem label="服务评价" v-if="orderDetail.serviceEvalua!=null" :span="2"> <DescriptionsItem label="服务评价" v-if="orderDetail.serviceEvalua!=null" :span="2">
<Rate :value="orderDetail.serviceEvalua" disabled/> <Rate :value="orderDetail.serviceEvalua" disabled/>
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="评价内容" v-if="orderDetail.serviceEvaluaText" :span="2"> <DescriptionsItem label="评价内容" v-if="orderDetail.serviceEvaluaText" :span="2">
{{ orderDetail.serviceEvaluaText }} {{ orderDetail.serviceEvaluaText }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="评价图片" v-if="orderDetail.imgUrl" :span="2"> <DescriptionsItem label="评价图片" v-if="orderDetail.evaluateImgPath" :span="2">
{{ orderDetail.imgUrl }} <img v-for="item in orderDetail.evaluateImgPath" :src="item" alt="图片加载失败"
</DescriptionsItem> class="orders-img"/>
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgUrl" :span="2">
{{ orderDetail.orderImgUrl }}
</DescriptionsItem> </DescriptionsItem>
</Descriptions> </Descriptions>
<Divider orientation="left" orientation-margin="0px"> <Divider orientation="left" orientation-margin="0px">
@@ -112,14 +140,22 @@ async function handleOpenChange(open: boolean) {
</Divider> </Divider>
<Timeline> <Timeline>
<TimelineItem v-for="(item,index) in handleRecords" :key="index"> <TimelineItem v-for="(item,index) in handleRecords" :key="index">
<p style="display: flex;">类型 <p style="display: flex;">类型
<component <component v-if="item.status!=null"
:is="renderDict(item.status,'wy_gdclzt')" :is="renderDict(item.status,'wy_gdclzt')"
/></p> />
<p>时间{{item.createTime}}</p> </p>
<p>处理人{{item.handlerName}}</p> <p>时间{{ item.createTime }}</p>
<p>处理人{{ item.handlerName }}</p>
</TimelineItem> </TimelineItem>
</Timeline> </Timeline>
</div> </div>
</BasicModal> </BasicModal>
</template> </template>
<style scoped lang="scss">
.orders-img {
width: 100px;
margin: 5px 10px;
display: inline-block;
}
</style>

View File

@@ -15,6 +15,7 @@ import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchema} from './data'; import {modalSchema} from './data';
import {workOrdersTypeTree} from "#/api/property/businessManagement/workOrdersType"; import {workOrdersTypeTree} from "#/api/property/businessManagement/workOrdersType";
import type {WorkOrdersTypeVO} from "#/api/property/businessManagement/workOrdersType/model";
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
@@ -108,7 +109,7 @@ async function queryWorkOrdersType() {
const options = await workOrdersTypeTree() const options = await workOrdersTypeTree()
formApi.updateSchema([ formApi.updateSchema([
{ {
componentProps: () => ({ componentProps: (formModel) => ({
class: 'w-full', class: 'w-full',
fieldNames: { fieldNames: {
key: 'id', key: 'id',
@@ -123,16 +124,15 @@ async function queryWorkOrdersType() {
treeLine: { showLeafIcon: false }, treeLine: { showLeafIcon: false },
treeNodeFilterProp: 'orderTypeName', treeNodeFilterProp: 'orderTypeName',
treeNodeLabelProp: 'orderTypeName', treeNodeLabelProp: 'orderTypeName',
async onSelect(type:string,node:WorkOrdersTypeVO) {
formModel.processingWeight = node.processingWeight;
},
}), }),
fieldName: 'type', fieldName: 'type',
}, },
]); ]);
} }
const filterOption = (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
</script> </script>
<template> <template>

View File

@@ -46,6 +46,16 @@ export const columns: VxeGridProps['columns'] = [
}, },
width:180, width:180,
}, },
{
title: '处理优先级',
field: 'processingWeight',
slots: {
default: ({row}) => {
return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
},
},
width: 100,
},
{ {
title: '排序值', title: '排序值',
field: 'sort', field: 'sort',
@@ -105,6 +115,15 @@ export const modalSchema: FormSchemaGetter = () => [
}, },
rules: 'selectRequired', rules: 'selectRequired',
}, },
{
label: '处理优先级',
fieldName: 'processingWeight',
component: 'Select',
componentProps: {
options: getDictOptions('pro_processing_weight'),
},
rules: 'selectRequired',
},
{ {
label: '完成时效(小时)', label: '完成时效(小时)',
fieldName: 'completionNumber', fieldName: 'completionNumber',

View File

@@ -140,6 +140,7 @@ function handleMultiDelete() {
<Space> <Space>
<ghost-button <ghost-button
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
v-access:code="['property:workOrdersType:query']"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>

View File

@@ -37,11 +37,16 @@ async function handleOpenChange(open: boolean) {
<DescriptionsItem label="类型名称"> <DescriptionsItem label="类型名称">
{{ workOrdersTypeInfoDetail.orderTypeName }} {{ workOrdersTypeInfoDetail.orderTypeName }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="运作模式" v-if="workOrdersTypeInfoDetail.operationMode!=null"> <DescriptionsItem label="运作模式" >
<component <component v-if="workOrdersTypeInfoDetail.operationMode!=null"
:is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')" :is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')"
/> />
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="处理优先级">
<component v-if="workOrdersTypeInfoDetail.processingWeight!=null"
:is="renderDict(workOrdersTypeInfoDetail.processingWeight,'pro_processing_weight')"
/>
</DescriptionsItem>
<DescriptionsItem label="排序值"> <DescriptionsItem label="排序值">
{{ workOrdersTypeInfoDetail.sort }} {{ workOrdersTypeInfoDetail.sort }}
</DescriptionsItem> </DescriptionsItem>

View File

@@ -26,6 +26,7 @@ import cleanDetailModal from './clean-detail-modal.vue';
// import { modalSchema } from './data'; // import { modalSchema } from './data';
import { communityTree } from '#/api/property/community'; import { communityTree } from '#/api/property/community';
import { getDictOptions } from '#/utils/dict'; import { getDictOptions } from '#/utils/dict';
import type {Clean_orderForm} from "#/api/property/clean_order/model";
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
@@ -190,9 +191,13 @@ const modalSchema = [
{ {
label: '评价图片', label: '评价图片',
fieldName: 'imgUrl', fieldName: 'imgUrl',
component: 'Input', component: 'ImageUpload',
componentProps: {
helpMessage: false,
},
dependencies: { dependencies: {
show: () => (isReadonly.value ? true : false), show: (formValue:Clean_orderForm) =>
isReadonly.value && formValue.imgUrl ? true : false,
triggerFields: [''], triggerFields: [''],
}, },
}, },
@@ -201,7 +206,7 @@ const modalSchema = [
fieldName: 'signType', fieldName: 'signType',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options:getDictOptions('wy_bjqdfs') options: getDictOptions('wy_bjqdfs'),
}, },
dependencies: { dependencies: {
show: () => (isReadonly.value ? true : false), show: () => (isReadonly.value ? true : false),
@@ -213,10 +218,11 @@ const modalSchema = [
fieldName: 'signImgUrl', fieldName: 'signImgUrl',
component: 'ImageUpload', component: 'ImageUpload',
componentProps: { componentProps: {
helpMessage:false helpMessage: false,
}, },
dependencies: { dependencies: {
show: (formValue) => (isReadonly.value&&formValue.signImgUrl ? true : false), show: (formValue:Clean_orderForm) =>
isReadonly.value && formValue.signImgUrl ? true : false,
triggerFields: [''], triggerFields: [''],
}, },
}, },
@@ -289,7 +295,6 @@ const [BasicModal, modalApi] = useVbenModal({
if (!isOpen) { if (!isOpen) {
return null; return null;
} }
console.log(isReadonly.value);
// 查询服务地址树形结构 // 查询服务地址树形结构
setupCommunitySelect(); setupCommunitySelect();
@@ -314,6 +319,7 @@ const [BasicModal, modalApi] = useVbenModal({
} }
if ((isUpdate.value || isReadonly.value) && id) { if ((isUpdate.value || isReadonly.value) && id) {
const record: any = await clean_orderInfo(id); const record: any = await clean_orderInfo(id);
if (record.starTime) record.starTime = dayjs(record.starTime); if (record.starTime) record.starTime = dayjs(record.starTime);
if (record.endTime) record.endTime = dayjs(record.endTime); if (record.endTime) record.endTime = dayjs(record.endTime);
editUnitId.value = record.unitId || ''; editUnitId.value = record.unitId || '';
@@ -496,7 +502,6 @@ async function handleConfirm() {
return; return;
} }
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
console.log(data);
// 单位数据缓存 // 单位数据缓存
if (unitListData.length === 0) { if (unitListData.length === 0) {
@@ -537,7 +542,6 @@ async function handleClosed() {
// 获取服务地址 // 获取服务地址
async function setupCommunitySelect() { async function setupCommunitySelect() {
const areaList = await communityTree(4); const areaList = await communityTree(4);
console.log(areaList);
// 选中后显示在输入框的值 即父节点 / 子节点 // 选中后显示在输入框的值 即父节点 / 子节点
// addFullName(areaList, 'areaName', ' / '); // addFullName(areaList, 'areaName', ' / ');

View File

@@ -74,8 +74,8 @@ export const columns: VxeGridProps['columns'] = [
}, },
{ {
title: '服务地址', title: '服务地址',
field: 'location', field: 'locationName',
width: '180', width: '260',
}, },
{ {
title: '合计费用(元)', title: '合计费用(元)',

View File

@@ -7,8 +7,6 @@ import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render'; import { renderDict } from '#/utils/render';
import { costItemSettingList } from '#/api/property/costManagement/costItemSetting'; import { costItemSettingList } from '#/api/property/costManagement/costItemSetting';
import { personList } from '#/api/property/resident/person'; import { personList } from '#/api/property/resident/person';
import { communityTree } from '#/api/property/community';
import { handleNode } from '@vben/utils';
/** /**
* 查询表单 schema * 查询表单 schema
@@ -57,7 +55,7 @@ export const columns: VxeGridProps['columns'] = [
}, },
{ title: '车牌号', field: 'carNumber' }, { title: '车牌号', field: 'carNumber' },
{ title: '车位', field: 'location' }, { title: '车位', field: 'location' },
{ title: '业主', field: 'personId' }, { title: '业主', field: 'personName' },
{ {
title: '缴费状态', title: '缴费状态',
field: 'chargeStatus', field: 'chargeStatus',
@@ -106,12 +104,12 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required', rules: 'required',
componentProps: { componentProps: {
api: async () => { api: async () => {
const rows = await personList({ pageSize: 1000000000, pageNum: 1 }); const rows = await userList({ pageSize: 1000000000, pageNum: 1 });
return rows; return rows;
}, },
resultField: 'rows', resultField: 'rows',
labelField: 'userName', labelField: 'userName',
valueField: 'id', valueField: 'userId',
}, },
disabled: true, disabled: true,
}, },
@@ -143,7 +141,11 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
api: async () => { api: async () => {
const rows = await costItemSettingList({ pageSize: 1000000000, pageNum: 1, costType: '2' }); const rows = await costItemSettingList({
pageSize: 1000000000,
pageNum: 1,
costType: '2',
});
return rows; return rows;
}, },
resultField: 'rows', resultField: 'rows',
@@ -244,7 +246,11 @@ export const addModalSchema: FormSchemaGetter = () => [
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
api: async () => { api: async () => {
const rows = await costItemSettingList({ pageSize: 1000000000, pageNum: 1, costType: '2' }); const rows = await costItemSettingList({
pageSize: 1000000000,
pageNum: 1,
costType: '2',
});
return rows; return rows;
}, },
resultField: 'rows', resultField: 'rows',

View File

@@ -152,7 +152,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:carCharge:info']" v-access:code="['property:carCharge:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -19,7 +19,7 @@ import { personList } from '#/api/property/resident/person';
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
const costItemsOptions = ref<any>([]); const costItemsOptions = ref<any>([]);
const meterTypeOptions = ref<any>([]); const meterTypeOptions = ref<any>([]);
const isMeterType = ref(false); const isMeterType = ref(false); //是否选择了费用类型
const isUpdate = ref(false); const isUpdate = ref(false);
const title = computed(() => { const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
@@ -48,11 +48,11 @@ const schema = [
componentProps: { componentProps: {
api: async () => { api: async () => {
const res = await personList({ pageSize: 1000000000, pageNum: 1 }); const res = await personList({ pageSize: 1000000000, pageNum: 1 });
return res.rows.map((item: any) => ({ return res;
label: item.userName,
value: item.id,
}));
}, },
resultField: 'rows',
labelField: 'userName',
valueField: 'id',
}, },
}, },
{ {
@@ -70,6 +70,7 @@ const schema = [
isMeterType.value = false; isMeterType.value = false;
} else { } else {
isMeterType.value = true; isMeterType.value = true;
// 获取费用项目
const costItemsRes = await costItemSettingList({ const costItemsRes = await costItemSettingList({
pageSize: 1000000000, pageSize: 1000000000,
pageNum: 1, pageNum: 1,
@@ -79,10 +80,11 @@ const schema = [
label: item.chargeItem, label: item.chargeItem,
value: item.id, value: item.id,
})); }));
// 获取抄表类型水费字典为0电费为1
const meterTypeRes = await meterReadingTypeList({ const meterTypeRes = await meterReadingTypeList({
pageSize: 1000000000, pageSize: 1000000000,
pageNum: 1, pageNum: 1,
costType: value == '5' ? 0 : 1, meterType: value == '5' ? '0' : '1',
}); });
meterTypeOptions.value = (meterTypeRes?.rows || []).map((item) => ({ meterTypeOptions.value = (meterTypeRes?.rows || []).map((item) => ({
label: item.name, label: item.name,

View File

@@ -1,8 +1,7 @@
import type { FormSchemaGetter } from '#/adapter/form'; import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict'; import { getDictOptions } from '#/utils/dict';
import { costItemSettingList } from '#/api/property/costManagement/costItemSetting'; import {renderDict} from "#/utils/render";
import {meterReadingTypeList} from '#/api/property/costManagement/meterReadingType';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
@@ -27,11 +26,16 @@ export const columns: VxeGridProps['columns'] = [
}, },
{ {
title: '费用类型', title: '费用类型',
field: 'itemId', field: 'costType',
slots: {
default: ({ row }) => {
return renderDict(row.costType, 'wy_cbfylx');
},
},
}, },
{ {
title: '抄表类型', title: '抄表类型',
field: 'meterTypeId', field: 'costTypeName',
}, },
{ {
title: '本期度数', title: '本期度数',
@@ -97,7 +101,7 @@ export const modalSchema: FormSchemaGetter = () => [
// return { // return {
// api: async ()=>{ // api: async ()=>{
// console.log(values); // console.log(values);
// const rows = await costItemSettingList({pageSize:1000000000,pageNum:1,costType:values.costType}); // const rows = await costItemSettingList({pageSize:1000000000,pageNum:1,costType:values.costType});
// return rows; // return rows;
// }, // },
@@ -118,7 +122,7 @@ export const modalSchema: FormSchemaGetter = () => [
// return { // return {
// api: async()=>{ // api: async()=>{
// const rows = await meterReadingTypeList({pageSize:1000000000,pageNum:1,costType:values.costType=='5'?0:1}); // const rows = await meterReadingTypeList({pageSize:1000000000,pageNum:1,costType:values.costType=='5'?0:1});
// return rows; // return rows;
// }, // },
// resultField:'rows', // resultField:'rows',
// labelField:'name', // labelField:'name',

View File

@@ -29,15 +29,6 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
}; };
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {

View File

@@ -36,7 +36,7 @@ export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60}, {type: 'checkbox', width: 60},
{ {
title: '房屋', title: '房屋',
field: 'roomId', field: 'roomName',
minWidth: 150, minWidth: 150,
}, },
{ {

View File

@@ -164,7 +164,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:houseCharge:info']" v-access:code="['property:houseCharge:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -33,8 +33,13 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 }, { type: 'checkbox', width: 60 },
{ {
title: '房屋', title: '费用类型',
field: 'roomNumber', field: 'costType',
slots: {
default: ({ row }) => {
return renderDict(row.costType, 'pro_expense_type');
},
},
}, },
{ {
title: '费用项目', title: '费用项目',

View File

@@ -85,12 +85,14 @@ async function handleEdit(row: Required<PaymentReviewForm>) {
<Space> <Space>
<ghost-button <ghost-button
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
v-access:code="['property:payFeeAudit:query']"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>
<ghost-button <ghost-button
:disabled="row.state!=='0'" :disabled="row.state!=='0'"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"
v-access:code="['property:payFeeAudit:edit']"
> >
{{ '审核' }} {{ '审核' }}
</ghost-button> </ghost-button>

View File

@@ -36,7 +36,7 @@ async function handleOpenChange(open: boolean) {
<BasicModal :footer="false" :fullscreen-button="false" title="缴费审核详情" class="w-[70%]"> <BasicModal :footer="false" :fullscreen-button="false" title="缴费审核详情" class="w-[70%]">
<Descriptions v-if="paymentReviewDetail" size="small" :column="2" bordered <Descriptions v-if="paymentReviewDetail" size="small" :column="2" bordered
:labelStyle="{width:'120px'}"> :labelStyle="{width:'120px'}">
<DescriptionsItem label="房屋"> <DescriptionsItem label="房屋" v-if="paymentReviewDetail.roomNumber">
{{ paymentReviewDetail.roomNumber }} {{ paymentReviewDetail.roomNumber }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="费用项目"> <DescriptionsItem label="费用项目">

View File

@@ -158,7 +158,7 @@ function handleDownloadExcel() {
审核 审核
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['property:returnPayFee:info']" v-access:code="['property:returnPayFee:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -0,0 +1,88 @@
<script setup lang="ts">
import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { contingenPlanInfo, contingenPlanUpdate } from '#/api/property/customerService/contingenPlan';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import {schema} from './data';
const emit = defineEmits<{ reload: [] }>();
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
formItemClass: 'col-span-1',
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
schema: schema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const record = ref({})
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
record.value = await contingenPlanInfo(id);
await formApi.setValues(record.value);
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
record.value.status = data.status
await contingenPlanUpdate(record.value)
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal title="审核">
<BasicForm />
</BasicModal>
</template>

View File

@@ -39,6 +39,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
}, },
); );
const record = ref({})
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度 // 在这里更改宽度
class: 'w-[60%]', class: 'w-[60%]',
@@ -56,8 +57,8 @@ const [BasicModal, modalApi] = useVbenModal({
isUpdate.value = !!id; isUpdate.value = !!id;
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await contingenPlanInfo(id); record.value = await contingenPlanInfo(id);
await formApi.setValues(record); await formApi.setValues(record.value);
} }
await markInitialized(); await markInitialized();
@@ -74,6 +75,8 @@ async function handleConfirm() {
} }
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次 // getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
data.status = record.value.status
console.log(data,123)
await (isUpdate.value ? contingenPlanUpdate(data) : contingenPlanAdd(data)); await (isUpdate.value ? contingenPlanUpdate(data) : contingenPlanAdd(data));
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');

View File

@@ -156,3 +156,27 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required', rules: 'required',
}, },
]; ];
export const schema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '演练状态',
fieldName: 'status',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '已取消', value: 1 },
{ label: '待进行', value: 2 },
],
},
rules: 'required',
}
];

View File

@@ -18,6 +18,7 @@ import type { ContingenPlanForm } from '#/api/property/customerService/contingen
import { commonDownloadExcel } from '#/utils/file/download'; import { commonDownloadExcel } from '#/utils/file/download';
import contingenPlanModal from './contingenPlan-modal.vue'; import contingenPlanModal from './contingenPlan-modal.vue';
import contingenPlanExamine from './contingenPlan-examine.vue';
import contingenPlanDetail from './contingenPlan-detail.vue'; import contingenPlanDetail from './contingenPlan-detail.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import {personList} from "#/api/property/resident/person"; import {personList} from "#/api/property/resident/person";
@@ -96,10 +97,13 @@ async function handleDelete(row: Required<ContingenPlanForm>) {
await tableApi.query(); await tableApi.query();
} }
const [ContingenPlanExamine, contingenPlanExamineApi] = useVbenModal({
connectedComponent: contingenPlanExamine,
});
async function handleExamine(row: Required<ContingenPlanForm>) { async function handleExamine(row: Required<ContingenPlanForm>) {
row.status = '1' contingenPlanExamineApi.setData({ id: row.id });
await contingenPlanUpdate(row); contingenPlanExamineApi.open();
await tableApi.query();
} }
function handleMultiDelete() { function handleMultiDelete() {
@@ -183,19 +187,12 @@ onMounted(async () => {
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<Popconfirm <ghost-button
v-if="row.status === '0'" v-if="row.status === '0'"
:get-popup-container="getVxePopupContainer" @click.stop="handleExamine(row)"
placement="left"
title="确认审核?"
@confirm="handleExamine(row)"
> >
<ghost-button {{ '审核' }}
@click.stop="" </ghost-button>
>
{{ '审核' }}
</ghost-button>
</Popconfirm>
<ghost-button <ghost-button
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
@@ -227,5 +224,6 @@ onMounted(async () => {
</BasicTable> </BasicTable>
<ContingenPlanModal @reload="tableApi.query()" /> <ContingenPlanModal @reload="tableApi.query()" />
<contingenPlanDetailModal/> <contingenPlanDetailModal/>
<ContingenPlanExamine @reload="tableApi.query()" />
</Page> </Page>
</template> </template>

View File

@@ -122,7 +122,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['system:feedbacks:info']" v-access:code="['system:feedbacks:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
@@ -134,7 +134,7 @@ function handleDownloadExcel() {
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['system:feedbacks:info']" v-access:code="['system:feedbacks:query']"
@click.stop="handleOrderInfo(row)" @click.stop="handleOrderInfo(row)"
:disabled="row.isWorkOrder=='1'" :disabled="row.isWorkOrder=='1'"
> >

View File

@@ -147,7 +147,7 @@ async function handleDelete(row: Required<QuestionnaireForm>) {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:questionnaire:info']" v-access:code="['property:questionnaire:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
预览问卷 预览问卷
@@ -175,8 +175,7 @@ async function handleDelete(row: Required<QuestionnaireForm>) {
</ghost-button> </ghost-button>
</Popconfirm> </Popconfirm>
<ghost-button <ghost-button
v-access:code="['property:questionnaire:statistics']" :disabled="row.status=='1'"
@click.stop="handleEdit(row)"
> >
统计分析 统计分析
</ghost-button> </ghost-button>

View File

@@ -1,97 +0,0 @@
<script setup lang="ts">
import type { PropType } from 'vue';
import { onMounted, ref } from 'vue';
import { Empty, Skeleton, Tree } from 'ant-design-vue';
import { communityTree } from "#/api/property/community";
import type { CommunityVO } from "#/api/property/community/model";
defineOptions({ inheritAttrs: false });
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true });
const emit = defineEmits<{
reload: [];
select: [];
}>();
const selectFloorId = defineModel('selectFloorId', {
type: Array as PropType<string[]>,
});
const searchValue = defineModel('searchValue', {
type: String,
default: '',
});
type TreeArray = CommunityVO[];
const treeArray = ref<TreeArray>([]);
const showTreeSkeleton = ref<boolean>(true);
async function loadTree() {
showTreeSkeleton.value = true;
searchValue.value = '';
selectFloorId.value = [];
treeArray.value = await communityTree(4);
showTreeSkeleton.value = false;
}
// async function handleReload() {
// await loadTree();
// emit('reload');
// }
onMounted(loadTree);
</script>
<template>
<div class="h-full flex flex-col">
<Skeleton
:loading="showTreeSkeleton"
:paragraph="{ rows: 8 }"
active
class="p-[8px] flex-1 min-h-0"
>
<div class="bg-background flex flex-col h-full rounded-lg">
<div class="flex-1 overflow-y-auto px-[8px] mt-2.5 min-h-0">
<Tree
class="tree-background"
v-bind="$attrs"
v-if="treeArray.length > 0"
v-model:selected-keys="selectFloorId"
:field-names="{ title: 'label', key: 'id' }"
:show-line="{ showLeafIcon: false }"
:tree-data="treeArray"
:virtual="false"
default-expand-all
@select="$emit('select')"
>
<template #title="{ label }">
<span v-if="label.indexOf(searchValue) > -1">
{{ label.substring(0, label.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else>{{ label }}</span>
</template>
</Tree>
<div v-else class="mt-5">
<Empty
:image="Empty.PRESENTED_IMAGE_SIMPLE"
description="暂无数据"
/>
</div>
</div>
</div>
</Skeleton>
</div>
</template>
<style scoped lang="scss">
.bg-background{
background-color: white;
:deep(.ant-tree){
background-color: white;
color: #333;
}
}
</style>

View File

@@ -1,14 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { Page, type VbenFormProps } from '@vben/common-ui'; import { Page, type VbenFormProps } from '@vben/common-ui'
import { import {
useVbenVxeGrid, useVbenVxeGrid,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table'
import { import {
paymentReviewList, paymentReviewList,
} from '#/api/property/costManagement/paymentReview'; } from '#/api/property/costManagement/paymentReview'
import { columns, querySchema } from './data';
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import { columns, querySchema } from './data'
import FloorTree from "../components/floor-tree.vue"
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -19,7 +21,7 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
}; }
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -37,7 +39,7 @@ const gridOptions: VxeGridProps = {
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
}); })
}, },
}, },
}, },
@@ -45,7 +47,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
id: 'property-paymentReview-index' id: 'property-paymentReview-index'
}; }
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
@@ -54,18 +56,16 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree></FloorTree>
<Page :auto-content-height="true"> <BasicTable class="flex-1 overflow-hidden" table-title="用电费用报表" />
<BasicTable table-title="用电费用报表"/>
</Page>
</div> </div>
</div> </Page>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.box{ .box {
display: grid; display: grid;
grid-template-columns: 1fr 3fr; grid-template-columns: 1fr 3fr;

View File

@@ -1,120 +1,14 @@
<template>
<div class="energy-monitor-page">
<div class="left-content">
<FloorTree></FloorTree>
</div>
<div class="right-content">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.todayEnergy }}</div>
<div class="item-title">今日用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.yesterdaySamePeriodEnergy }}</div>
<div class="item-title">昨日同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.dayTrendPercentage }}</div>
<div>{{ chainData.dayTrendValue }}<span class="item-unit">kW.h</span></div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
</div>
<div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header">
<div class="header-title">能耗趋势</div>
</div>
<RadioGroup v-model:value="energyTrendTime"
button-style="solid"
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="1">当日</RadioButton>
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="chart-placeholder" ref="energyTrendChart">
</div>
</div>
</div>
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">日用电功率曲线</div>
</div>
<!-- <div class="chart-placeholder" ref="powerCurveChart">-->
<div class="power-chart" ref="powerCurveChart">
</div>
</div>
<div class="power-peak-container">
<div class="section-header">
<div class="header-title">电功率峰值</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.todayPeakPower }}</p>
<p class="time">{{ peakData.todayPeakTime }}</p>
<div class="bottom-text">当日(kW)</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.yesterdayPeakPower }}</p>
<p class="time">{{ peakData.yesterdayPeakTime }}</p>
<div class="bottom-text">昨日(kW)</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts"> <script setup lang="ts">
import {RadioGroup, RadioButton} from 'ant-design-vue' import { RadioGroup, RadioButton } from 'ant-design-vue'
import {ref, onMounted, onBeforeUnmount, reactive} from 'vue' import { Page } from '@vben/common-ui'
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import type {ECharts, EChartsOption} from 'echarts' import type { ECharts, EChartsOption } from 'echarts'
import FloorTree from "./floor-tree.vue"; import FloorTree from "../components/floor-tree.vue"
import dayjs from "dayjs"; import dayjs from "dayjs"
//
const selectFloorId = ref<string[]>([])
const chainData = reactive({ const chainData = reactive({
todayEnergy: '231.78', todayEnergy: '231.78',
@@ -166,8 +60,8 @@ const energyTrendOption: EChartsOption = {
type: 'bar', type: 'bar',
markPoint: { markPoint: {
data: [ data: [
{type: 'max', name: 'Max'}, { type: 'max', name: 'Max' },
{type: 'min', name: 'Min'} { type: 'min', name: 'Min' }
] ]
}, },
} }
@@ -197,37 +91,37 @@ const initEnergyTrendChart = () => {
} }
function buildingEnergyTrendData(val: string) { function buildingEnergyTrendData(val: string) {
const now = new Date(); const now = new Date()
let timeArr = []; let timeArr = []
let valArr = []; let valArr = []
let name = '时间'; let name = '时间'
if (val == '1') { if (val == '1') {
const hour = now.getHours() const hour = now.getHours()
for (let i = 0; i < hour; i++) { for (let i = 0; i < hour; i++) {
timeArr.push(i); timeArr.push(i)
valArr.push(parseFloat((Math.random() * 35).toFixed(2))); valArr.push(parseFloat((Math.random() * 35).toFixed(2)))
} }
} else if (val == '2') { } else if (val == '2') {
const day = now.getDate() const day = now.getDate()
for (let i = 1; i < day; i++) { for (let i = 1; i < day; i++) {
timeArr.push(i); timeArr.push(i)
valArr.push(parseFloat((Math.random() * 800).toFixed(2))); valArr.push(parseFloat((Math.random() * 800).toFixed(2)))
} }
name = '日期'; name = '日期'
} else { } else {
const month = now.getMonth() + 1; const month = now.getMonth() + 1
for (let i = 1; i < month; i++) { for (let i = 1; i < month; i++) {
timeArr.push(i); timeArr.push(i)
valArr.push(parseFloat((Math.random() * 21000).toFixed(2))); valArr.push(parseFloat((Math.random() * 21000).toFixed(2)))
} }
name = '月份'; name = '月份'
} }
if (energyTrendInstance.value) { if (energyTrendInstance.value) {
energyTrendInstance.value.setOption({ energyTrendInstance.value.setOption({
xAxis: {data: timeArr, name}, xAxis: { data: timeArr, name },
series: [{data: valArr}], series: [{ data: valArr }],
}); })
} }
} }
@@ -235,7 +129,6 @@ function buildingEnergyTrendData(val: string) {
const powerCurveChart = ref<HTMLElement | null>(null) const powerCurveChart = ref<HTMLElement | null>(null)
const powerCurveInstance = ref<ECharts | null>(null) const powerCurveInstance = ref<ECharts | null>(null)
const powerCurveOption: EChartsOption = { const powerCurveOption: EChartsOption = {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
@@ -248,8 +141,8 @@ const powerCurveOption: EChartsOption = {
}, },
toolbox: { toolbox: {
feature: { feature: {
magicType: {show: true, type: ['line', 'bar']}, magicType: { show: true, type: ['line', 'bar'] },
restore: {show: true}, restore: { show: true },
} }
}, },
legend: { legend: {
@@ -279,8 +172,8 @@ const powerCurveOption: EChartsOption = {
data: [], data: [],
markPoint: { markPoint: {
data: [ data: [
{type: 'max',}, { type: 'max', },
{type: 'min',} { type: 'min', }
] ]
}, },
}, },
@@ -291,15 +184,15 @@ const powerCurveOption: EChartsOption = {
data: [], data: [],
markPoint: { markPoint: {
data: [ data: [
{type: 'max',}, { type: 'max', },
{type: 'min',} { type: 'min', }
] ]
}, },
itemStyle: {color: '#cbb0e3'}, // itemStyle: { color: '#cbb0e3' }, //
lineStyle: {color: '#cbb0e3'} // 线 lineStyle: { color: '#cbb0e3' } // 线
}, },
] ]
}; }
const initPowerCurveChart = () => { const initPowerCurveChart = () => {
if (powerCurveChart.value) { if (powerCurveChart.value) {
@@ -324,23 +217,23 @@ const initPowerCurveChart = () => {
} }
function buildingPowerCurveData() { function buildingPowerCurveData() {
const now = new Date(); const now = new Date()
const hour = now.getHours() const hour = now.getHours()
let yesterday = []; let yesterday = []
let today = []; let today = []
let timeDate = [] let timeDate = []
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
timeDate.push(i); timeDate.push(i)
yesterday.push(parseFloat((Math.random() * 3000).toFixed(2))); yesterday.push(parseFloat((Math.random() * 3000).toFixed(2)))
if (hour > i) { if (hour > i) {
today.push(parseFloat((Math.random() * 3000).toFixed(2))); today.push(parseFloat((Math.random() * 3000).toFixed(2)))
} }
} }
if (powerCurveInstance.value) { if (powerCurveInstance.value) {
powerCurveInstance.value.setOption({ powerCurveInstance.value.setOption({
xAxis: {data: timeDate}, xAxis: { data: timeDate },
series: [{data: today}, {data: yesterday}], series: [{ data: today }, { data: yesterday }],
}); })
} }
} }
@@ -352,34 +245,125 @@ onMounted(() => {
// //
onBeforeUnmount(() => { onBeforeUnmount(() => {
energyTrendInstance.value?.dispose(); energyTrendInstance.value?.dispose()
powerCurveInstance.value?.dispose(); powerCurveInstance.value?.dispose()
}) })
function handleSelectFloor() {
console.log(selectFloorId.value[0])
}
</script> </script>
<template>
<Page :auto-content-height="true">
<div class="flex h-full gap-[8px]">
<FloorTree class="w-[260px]" @select="handleSelectFloor" v-model:select-floor-id="selectFloorId"></FloorTree>
<div class="flex-1 overflow-hidden">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.todayEnergy }}</div>
<div class="item-title">今日用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.yesterdaySamePeriodEnergy }}</div>
<div class="item-title">昨日同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.dayTrendPercentage }}</div>
<div>{{ chainData.dayTrendValue }}<span class="item-unit">kW.h</span></div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
</div>
<div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header">
<div class="header-title">能耗趋势</div>
</div>
<RadioGroup v-model:value="energyTrendTime" button-style="solid" size="small"
@change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="1">当日</RadioButton>
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="chart-placeholder" ref="energyTrendChart">
</div>
</div>
</div>
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">日用电功率曲线</div>
</div>
<!-- <div class="chart-placeholder" ref="powerCurveChart">-->
<div class="power-chart" ref="powerCurveChart">
</div>
</div>
<div class="power-peak-container">
<div class="section-header">
<div class="header-title">电功率峰值</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.todayPeakPower }}</p>
<p class="time">{{ peakData.todayPeakTime }}</p>
<div class="bottom-text">当日(kW)</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.yesterdayPeakPower }}</p>
<p class="time">{{ peakData.yesterdayPeakTime }}</p>
<div class="bottom-text">昨日(kW)</div>
</div>
</div>
</div>
</div>
</div>
</Page>
</template>
<style scoped> <style scoped>
.energy-monitor-page {
display: flex;
gap: 1rem;
padding: 1rem;
background-color: #f4f4f4;
min-height: 100vh;
}
.left-content {
flex: 1;
height: 95vh;
}
.right-content {
display: flex;
flex: 4;
flex-direction: column;
gap: 1rem;
}
.row { .row {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
@@ -395,10 +379,12 @@ onBeforeUnmount(() => {
} }
.power-curve-container { .power-curve-container {
margin-top: 10px;
flex: 5; flex: 5;
} }
.power-peak-container { .power-peak-container {
margin-top: 10px;
flex: 1; flex: 1;
} }
@@ -475,13 +461,15 @@ onBeforeUnmount(() => {
justify-content: center; justify-content: center;
border-radius: 4px; border-radius: 4px;
} }
.power-chart{
.power-chart {
height: 38vh; height: 38vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 4px; border-radius: 4px;
} }
.peak-item { .peak-item {
padding: 15px 0 0 0; padding: 15px 0 0 0;
border: 1px solid #3671e8; border: 1px solid #3671e8;

View File

@@ -1,28 +1,29 @@
<script setup lang="ts"> <script setup lang="ts">
import * as echarts from 'echarts'; import * as echarts from 'echarts'
import {onMounted, ref} from "vue"; import { onMounted, ref } from "vue"
import type { Dayjs } from 'dayjs'; import type { Dayjs } from 'dayjs'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import { DatePicker } from 'ant-design-vue'; import { Page } from '@vben/common-ui'
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import { DatePicker } from 'ant-design-vue'
import FloorTree from "../components/floor-tree.vue"
const currentDay = ref<Dayjs>(dayjs()); const currentDay = ref<Dayjs>(dayjs())
const currentMonth = ref<Dayjs>(dayjs()); const currentMonth = ref<Dayjs>(dayjs())
const currentYear = ref<Dayjs>(dayjs()); const currentYear = ref<Dayjs>(dayjs())
const disabledDay = (current: Dayjs) => { const disabledDay = (current: Dayjs) => {
return current && current > dayjs().endOf('day'); return current && current > dayjs().endOf('day')
}; }
const disabledMonth = (current: Dayjs) => { const disabledMonth = (current: Dayjs) => {
return current && current > dayjs().endOf('month'); return current && current > dayjs().endOf('month')
}; }
const disabledYear = (current: Dayjs) => { const disabledYear = (current: Dayjs) => {
return current && current > dayjs().endOf('year'); return current && current > dayjs().endOf('year')
}; }
onMounted(()=>{ onMounted(() => {
//day //day
const chartDay = document.getElementById('day'); const chartDay = document.getElementById('day')
const myChartDay = echarts.init(chartDay); const myChartDay = echarts.init(chartDay)
const optionDay = { const optionDay = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -41,14 +42,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'时', name: '时',
data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00','12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'] data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'KW.h' name: 'KW.h'
} }
], ],
series: [ series: [
@@ -87,12 +88,12 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionDay && myChartDay.setOption(optionDay); optionDay && myChartDay.setOption(optionDay)
//month //month
const chartMonth = document.getElementById('month'); const chartMonth = document.getElementById('month')
const myChartMonth = echarts.init(chartMonth); const myChartMonth = echarts.init(chartMonth)
const optionMonth = { const optionMonth = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -111,14 +112,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'日', name: '日',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'KW.h' name: 'KW.h'
} }
], ],
series: [ series: [
@@ -126,7 +127,7 @@ onMounted(()=>{
name: '当月', name: '当月',
type: 'bar', type: 'bar',
data: [ data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
], ],
markPoint: { markPoint: {
data: [ data: [
@@ -139,7 +140,7 @@ onMounted(()=>{
name: '上月', name: '上月',
type: 'bar', type: 'bar',
data: [ data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
], ],
markPoint: { markPoint: {
data: [ data: [
@@ -157,12 +158,12 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionMonth && myChartMonth.setOption(optionMonth); optionMonth && myChartMonth.setOption(optionMonth)
//year //year
const chartYear = document.getElementById('year'); const chartYear = document.getElementById('year')
const myChartYear = echarts.init(chartYear); const myChartYear = echarts.init(chartYear)
const optionYear = { const optionYear = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -181,14 +182,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'月', name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'KW.h' name: 'KW.h'
} }
], ],
series: [ series: [
@@ -227,8 +228,8 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionYear && myChartYear.setOption(optionYear); optionYear && myChartYear.setOption(optionYear)
// //
myChartDay.on('mouseover', { seriesIndex: 0 }, () => { myChartDay.on('mouseover', { seriesIndex: 0 }, () => {
@@ -236,8 +237,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartDay.on('mouseout', { seriesIndex: 0 }, () => { myChartDay.on('mouseout', { seriesIndex: 0 }, () => {
@@ -245,8 +246,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
// //
myChartYear.on('mouseover', { seriesIndex: 0 }, () => { myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
@@ -254,8 +255,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartYear.on('mouseout', { seriesIndex: 0 }, () => { myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
@@ -263,8 +264,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
// //
myChartMonth.on('mouseover', { seriesIndex: 0 }, () => { myChartMonth.on('mouseover', { seriesIndex: 0 }, () => {
@@ -272,8 +273,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartMonth.on('mouseout', { seriesIndex: 0 }, () => { myChartMonth.on('mouseout', { seriesIndex: 0 }, () => {
@@ -281,56 +282,41 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
}) })
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<div style="background: #fff;border-radius: 8px;padding: 10px"> <div class=" flex-1 overflow-hidden">
<div> <div style="background: #fff;border-radius: 8px;padding: 10px;height: 33%">
<div style="display: flex;justify-content: space-between;"> <div>
<DatePicker <div style="display: flex;justify-content: space-between;">
v-model:value="currentDay" <DatePicker v-model:value="currentDay" :disabled-date="disabledDay" />当日能耗总值125.04KW.h
:disabled-date="disabledDay" </div>
/>125.04KW.h</div> </div>
<div id="day" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentMonth" :disabled-date="disabledMonth" picker="month" />当月能耗总值125.04KW.h
</div>
</div>
<div id="month" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值125.04KW.h
</div>
</div>
<div id="year" style="height: 100%;width: 100%;"></div>
</div>
</div> </div>
<div id="day" style="height: 250px;width: 100%;"></div>
</div> </div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;"> </Page>
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentMonth"
:disabled-date="disabledMonth"
picker="month"
/>125.04KW.h</div>
</div>
<div id="month" style="height: 250px;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentYear"
:disabled-date="disabledYear"
picker="year"
/>125.04KW.h</div>
</div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
</div>
</div>
</template> </template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -1,14 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { Page, type VbenFormProps } from '@vben/common-ui'; import { Page, type VbenFormProps } from '@vben/common-ui'
import { import {
useVbenVxeGrid, useVbenVxeGrid,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table'
import { import {
paymentReviewList, paymentReviewList,
} from '#/api/property/costManagement/paymentReview'; } from '#/api/property/costManagement/paymentReview'
import { columns, querySchema } from './data'; import { columns, querySchema } from './data'
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import FloorTree from "../components/floor-tree.vue"
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -19,7 +19,7 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
}; }
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -37,7 +37,7 @@ const gridOptions: VxeGridProps = {
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
}); })
}, },
}, },
}, },
@@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
id: 'property-paymentReview-index' id: 'property-paymentReview-index'
}; }
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
@@ -54,18 +54,16 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<Page :auto-content-height="true"> <BasicTable class="flex-1 overflow-hidden" table-title="用电环比分析列表" />
<BasicTable table-title="用水环比分析列表"/>
</Page>
</div> </div>
</div> </Page>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.box{ .box {
display: grid; display: grid;
grid-template-columns: 1fr 3fr; grid-template-columns: 1fr 3fr;
} }

View File

@@ -1,22 +1,22 @@
<script setup lang="ts"> <script setup lang="ts">
import * as echarts from 'echarts'; import * as echarts from 'echarts'
import {onMounted, ref} from "vue"; import { onMounted, ref } from "vue"
import type { Dayjs } from 'dayjs'; import type { Dayjs } from 'dayjs'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import { Table } from 'ant-design-vue' import { Page } from '@vben/common-ui'
import { DatePicker } from 'ant-design-vue'; import { Table, DatePicker } from 'ant-design-vue'
import { SearchOutlined } from '@ant-design/icons-vue'; import { SearchOutlined } from '@ant-design/icons-vue'
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import FloorTree from "../components/floor-tree.vue"
const currentYear = ref<Dayjs>(dayjs()); const currentYear = ref<Dayjs>(dayjs())
const disabledYear = (current: Dayjs) => { const disabledYear = (current: Dayjs) => {
return current && current > dayjs().endOf('year'); return current && current > dayjs().endOf('year')
}; }
onMounted(()=>{ onMounted(() => {
//year //year
const chartYear = document.getElementById('year'); const chartYear = document.getElementById('year')
const myChartYear = echarts.init(chartYear); const myChartYear = echarts.init(chartYear)
const optionYear = { const optionYear = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -35,14 +35,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'月', name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'KW.h' name: 'KW.h'
} }
], ],
series: [ series: [
@@ -81,8 +81,8 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionYear && myChartYear.setOption(optionYear); optionYear && myChartYear.setOption(optionYear)
// //
myChartYear.on('mouseover', { seriesIndex: 0 }, () => { myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
@@ -90,8 +90,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartYear.on('mouseout', { seriesIndex: 0 }, () => { myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
@@ -99,8 +99,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
}) })
const columns = [ const columns = [
@@ -120,54 +120,39 @@ const columns = [
title: '同比(%)', title: '同比(%)',
dataIndex: 'address', dataIndex: 'address',
}, },
]; ]
const data = [...Array(32)].map((_, i) => ({ const data = [...Array(32)].map((_, i) => ({
key: i, key: i,
name: `${i+1}`, name: `${i + 1}`,
age: '--', age: '--',
address: `--`, address: `--`,
})); }));
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;"> <div class="flex-1 overflow-hidden">
<div> <div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;">
年份 <div>
<DatePicker 年份
style="margin: 0 10px;" <DatePicker style="margin: 0 10px;" v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />
v-model:value="currentYear" <a-button type="primary">
:disabled-date="disabledYear" <template #icon>
picker="year" <SearchOutlined />
/> </template>
<a-button type="primary"> 查询
<template #icon><SearchOutlined /></template> </a-button>
查询 </div>
</a-button> <div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table style="border-radius: 8px;" :columns="columns" :data-source="data" :pagination="false"
:scroll="{ y: '50vh' }" />
</div> </div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table
style="border-radius: 8px;"
:columns="columns"
:data-source="data"
:pagination="false"
:scroll="{ y: '50vh' }"
/>
</div> </div>
</div> </div>
</div> </Page>
</template> </template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -0,0 +1,81 @@
<script setup lang="ts">
import type { PropType } from 'vue'
import { onMounted, ref } from 'vue'
import { handleNode } from '@vben/utils'
import { Empty, Skeleton, Tree } from 'ant-design-vue'
import { communityTree } from "#/api/property/community"
import type { CommunityVO } from "#/api/property/community/model"
defineOptions({ inheritAttrs: false })
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true })
const emit = defineEmits<{
/**
* 点击刷新按钮的事件
*/
reload: []
/**
* 点击节点的事件
*/
select: []
}>()
const selectFloorId = defineModel('selectFloorId', {
type: Array as PropType<string[]>,
})
const searchValue = defineModel('searchValue', {
type: String,
default: '',
})
type TreeArray = CommunityVO[]
const treeArray = ref<TreeArray>([])
/** 骨架屏加载 */
const showTreeSkeleton = ref<boolean>(true)
async function loadTree() {
showTreeSkeleton.value = true
searchValue.value = ''
selectFloorId.value = []
const ret = await communityTree(3)
const splitStr = '/'
handleNode(ret, 'label', splitStr, function (node: any) {
if (node.level != 3) {
node.disabled = true
}
})
treeArray.value = ret
showTreeSkeleton.value = false
}
onMounted(loadTree);
</script>
<template>
<div :class="$attrs.class">
<Skeleton :loading="showTreeSkeleton" :paragraph="{ rows: 8 }" active class="p-[8px] flex-1 min-h-0">
<div class="bg-background flex h-full flex-col overflow-y-auto rounded-lg">
<div class="h-full overflow-x-hidden px-[8px]">
<Tree v-bind="$attrs" v-if="treeArray.length > 0" v-model:selected-keys="selectFloorId"
:field-names="{ title: 'label', key: 'id' }" :show-line="{ showLeafIcon: false }" :tree-data="treeArray"
:virtual="false" default-expand-all @select="$emit('select')">
<template #title="{ label }">
<span v-if="label.indexOf(searchValue) > -1">
{{ label.substring(0, label.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else>{{ label }}</span>
</template>
</Tree>
<div v-else class="mt-5">
<Empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" />
</div>
</div>
</div>
</Skeleton>
</div>
</template>

View File

@@ -2,7 +2,7 @@
import { TableSwitch } from "#/components/table" import { TableSwitch } from "#/components/table"
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui' import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils'
import { ref } from 'vue' import { ref } from 'vue'
@@ -21,8 +21,8 @@ import {
lightInfoList, lightInfoList,
lightInfoRemove, lightInfoRemove,
switchSingleLight, switchSingleLight,
} from '#/api/property/meter/lightInfo' } from '#/api/property/energyManagement/lightInfo'
import type { LightInfoForm } from '#/api/property/meter/lightInfo/model' import type { LightInfoForm } from '#/api/property/energyManagement/lightInfo/model'
// //
const selectFloorId = ref<string[]>([]) const selectFloorId = ref<string[]>([])
@@ -69,7 +69,7 @@ const gridOptions: VxeGridProps = {
if (selectFloorId.value.length === 1) { if (selectFloorId.value.length === 1) {
formValues.floorId = selectFloorId.value[0] formValues.floorId = selectFloorId.value[0]
} else { } else {
Reflect.deleteProperty(formValues, 'deptId') Reflect.deleteProperty(formValues, 'floorId')
} }
return await lightInfoList({ return await lightInfoList({
pageNum: page.currentPage, pageNum: page.currentPage,

View File

@@ -7,10 +7,10 @@ import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils'
import { useVbenForm } from '#/adapter/form' import { useVbenForm } from '#/adapter/form'
import { communityTree } from '#/api/property/community' import { communityTree } from '#/api/property/community'
import { lightInfoAdd, lightInfoInfo, lightInfoUpdate } from '#/api/property/meter/lightInfo' import { lightInfoAdd, lightInfoInfo, lightInfoUpdate } from '#/api/property/energyManagement/lightInfo'
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup' import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
import { drawerSchema } from './data'; import { drawerSchema } from './data'
const emit = defineEmits<{ reload: [] }>() const emit = defineEmits<{ reload: [] }>()

View File

@@ -4,8 +4,17 @@ import type { VxeGridProps } from '#/adapter/vxe-table'
import { getDictOptions } from '#/utils/dict' import { getDictOptions } from '#/utils/dict'
import { renderDict } from '#/utils/render' import { renderDict } from '#/utils/render'
export function initMoalForm(type: number) { export function initDrawerForm(type: number) {
const modalSchema: FormSchemaGetter = () => [ const drawerSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{ {
label: '仪表名称', label: '仪表名称',
fieldName: 'meterName', fieldName: 'meterName',
@@ -13,14 +22,28 @@ export function initMoalForm(type: number) {
rules: 'selectRequired', rules: 'selectRequired',
}, },
{ {
label: '仪表编码', label: '楼层',
fieldName: 'meterCode', fieldName: 'floorId',
component: 'TreeSelect',
defaultValue: undefined,
rules: 'required',
},
{
label: '安装位置',
fieldName: 'installLocation',
component: 'Input', component: 'Input',
}, },
{ {
label: '设备厂商', label: '仪表编码',
fieldName: 'factoryNo', fieldName: 'meterCode',
component: 'Input', component: 'Input',
rules: 'required',
},
{
label: '采集器IP',
fieldName: 'hostIp',
component: 'Input',
rules: 'required',
}, },
{ {
label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)', label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
@@ -46,11 +69,6 @@ export function initMoalForm(type: number) {
}, },
rules: 'selectRequired', rules: 'selectRequired',
}, },
{
label: '安装位置',
fieldName: 'installLocation',
component: 'Input',
},
{ {
label: '初始读数', label: '初始读数',
fieldName: 'initReading', fieldName: 'initReading',
@@ -70,15 +88,15 @@ export function initMoalForm(type: number) {
options: getDictOptions('sis_device_status'), options: getDictOptions('sis_device_status'),
}, },
}, },
{ // {
label: '运行状态', // label: '运行状态',
fieldName: 'runningState', // fieldName: 'runningState',
component: 'Select', // component: 'Select',
componentProps: { // componentProps: {
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护 // // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
options: getDictOptions('sis_device_status'), // options: getDictOptions('sis_device_status'),
}, // },
}, // },
{ {
label: '备注', label: '备注',
fieldName: 'remark', fieldName: 'remark',
@@ -86,7 +104,7 @@ export function initMoalForm(type: number) {
}, },
] ]
return modalSchema return drawerSchema
} }
export function initQuerySchema(type: number) { export function initQuerySchema(type: number) {
@@ -131,10 +149,10 @@ export function initColumns(type: number) {
title: '仪表编码', title: '仪表编码',
field: 'meterCode', field: 'meterCode',
}, },
{ // {
title: '设备厂商', // title: '设备厂商',
field: 'factoryNo', // field: 'factoryNo',
}, // },
{ {
title: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)', title: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
field: 'meterType', field: 'meterType',
@@ -155,6 +173,10 @@ export function initColumns(type: number) {
}, },
}, },
}, },
{
title: '楼层',
field: 'floorName',
},
{ {
title: '安装位置', title: '安装位置',
field: 'installLocation', field: 'installLocation',
@@ -177,16 +199,16 @@ export function initColumns(type: number) {
}, },
}, },
}, },
{ // {
title: '运行状态', // title: '运行状态',
field: 'runningState', // field: 'runningState',
slots: { // slots: {
default: ({ row }) => { // default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护 // // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
return renderDict(row.runningState, 'sis_device_status') // return renderDict(row.runningState, 'sis_device_status')
}, // },
}, // },
}, // },
{ {
title: '备注', title: '备注',
field: 'remark', field: 'remark',

View File

@@ -0,0 +1,158 @@
<script setup lang="ts">
import { computed, ref } from "vue"
import { useVbenDrawer } from "@vben/common-ui"
import { $t } from "@vben/locales"
import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils'
import { useVbenForm } from "#/adapter/form"
import { communityTree } from '#/api/property/community'
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup"
import {
meterInfoAdd,
meterInfoInfo,
meterInfoUpdate,
} from "#/api/property/energyManagement/meterInfo"
const props = defineProps({
meterType: {
type: Number,
required: true,
},
})
import { initDrawerForm } from "./data"
const drawerSchema = initDrawerForm(props.meterType)
const emit = defineEmits<{ reload: [] }>()
const isUpdate = ref(false)
const title = computed(() => {
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add")
})
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: "col-span-2",
// 默认label宽度 px
labelWidth: 120,
// 通用配置项 会影响到所有表单项
componentProps: {
class: "w-full",
},
},
schema: drawerSchema(),
showDefaultActions: false,
wrapperClass: "grid-cols-2",
})
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
}
)
const [BasicModal, modalApi] = useVbenDrawer({
// 在这里更改宽度
class: "w-[600px]",
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null
}
modalApi.drawerLoading(true)
const { id } = modalApi.getData() as { id?: number | string }
isUpdate.value = !!id
setupCommunitySelect()
if (isUpdate.value && id) {
const record = await meterInfoInfo(id)
record.meterType = record.meterType.toString()
record.meterUnit = record.meterUnit.toString()
record.runningState = record.runningState.toString()
record.communicationState = record.communicationState.toString()
await formApi.setValues(record)
}
await markInitialized()
modalApi.drawerLoading(false)
},
})
async function handleConfirm() {
try {
modalApi.lock(true)
const { valid } = await formApi.validate()
if (!valid) {
return
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues())
await (isUpdate.value ? meterInfoUpdate(data) : meterInfoAdd(data))
resetInitialized()
emit("reload")
modalApi.close()
} catch (error) {
console.error(error)
} finally {
modalApi.lock(false)
}
}
async function handleClosed() {
await formApi.resetForm()
resetInitialized()
}
/**
* 初始化城市
*/
async function setupCommunitySelect() {
const areaList = await communityTree(3)
// 选中后显示在输入框的值 即父节点 / 子节点
// addFullName(areaList, 'areaName', ' / ');
const splitStr = '/'
handleNode(areaList, 'label', splitStr, function (node: any) {
if (node.level != 3) {
node.disabled = true
}
})
formApi.updateSchema([
{
componentProps: () => ({
fieldNames: {
key: 'id',
label: 'label',
value: 'code',
children: 'children',
},
getPopupContainer,
placeholder: '请选择建筑',
showSearch: true,
treeData: areaList,
treeDefaultExpandAll: true,
treeLine: { showLeafIcon: false },
// 筛选的字段
treeNodeFilterProp: 'label',
// 选中后显示在输入框的值
treeNodeLabelProp: 'fullName',
}),
fieldName: 'floorId',
},
])
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -1,32 +1,32 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Recordable } from "@vben/types"; import type { Recordable } from "@vben/types"
import { ref } from "vue"; import { ref } from "vue"
import { Page, useVbenModal, type VbenFormProps } from "@vben/common-ui"; import { Page, useVbenDrawer, type VbenFormProps } from "@vben/common-ui"
import { getVxePopupContainer } from "@vben/utils"; import { getVxePopupContainer } from "@vben/utils"
import { Modal, Popconfirm, Space } from "ant-design-vue"; import { Modal, Popconfirm, Space } from "ant-design-vue"
import dayjs from "dayjs"; import dayjs from "dayjs"
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps, type VxeGridProps,
} from "#/adapter/vxe-table"; } from "#/adapter/vxe-table"
import { import {
meterInfoExport, meterInfoExport,
meterInfoList, meterInfoList,
meterInfoRemove, meterInfoRemove,
} from "#/api/property/meter/meterInfo"; } from "#/api/property/energyManagement/meterInfo"
import type { MeterInfoForm } from "#/api/property/meterInfo/model"; import type { MeterInfoForm } from "#/api/property/meterInfo/model"
import { commonDownloadExcel } from "#/utils/file/download"; import { commonDownloadExcel } from "#/utils/file/download"
import meterInfoModal from "../components/meterInfo-modal.vue"; import meterInfoDrawer from "../components/meterInfo-drawer.vue"
import { initQuerySchema, initColumns } from "../components/data"; import { initQuerySchema, initColumns } from "../components/data"
const columns = initColumns(3); const columns = initColumns(3)
const querySchema = initQuerySchema(3); const querySchema = initQuerySchema(3)
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'], // ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ], // ],
// ], // ],
}; }
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -70,7 +70,7 @@ const gridOptions: VxeGridProps = {
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
}); })
}, },
}, },
}, },
@@ -79,44 +79,44 @@ const gridOptions: VxeGridProps = {
}, },
// //
id: "property-meterInfo-index", id: "property-meterInfo-index",
}; }
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
gridOptions, gridOptions,
}); })
const [MeterInfoModal, modalApi] = useVbenModal({ const [MeterInfoDrawer, modalApi] = useVbenDrawer({
connectedComponent: meterInfoModal, connectedComponent: meterInfoDrawer,
}); })
function handleAdd() { function handleAdd() {
modalApi.setData({}); modalApi.setData({})
modalApi.open(); modalApi.open()
} }
async function handleEdit(row: Required<MeterInfoForm>) { async function handleEdit(row: Required<MeterInfoForm>) {
modalApi.setData({ id: row.id }); modalApi.setData({ id: row.id })
modalApi.open(); modalApi.open()
} }
async function handleDelete(row: Required<MeterInfoForm>) { async function handleDelete(row: Required<MeterInfoForm>) {
await meterInfoRemove(row.id); await meterInfoRemove(row.id)
await tableApi.query(); await tableApi.query()
} }
function handleMultiDelete() { function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords(); const rows = tableApi.grid.getCheckboxRecords()
const ids = rows.map((row: Required<MeterInfoForm>) => row.id); const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
okType: "danger", okType: "danger",
content: `确认删除选中的${ids.length}条记录吗?`, content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => { onOk: async () => {
await meterInfoRemove(ids); await meterInfoRemove(ids)
await tableApi.query(); await tableApi.query()
}, },
}); })
} }
function handleDownloadExcel() { function handleDownloadExcel() {
@@ -127,7 +127,7 @@ function handleDownloadExcel() {
{ {
fieldMappingTime: formOptions.fieldMappingTime, fieldMappingTime: formOptions.fieldMappingTime,
} }
); )
} }
</script> </script>
@@ -136,43 +136,32 @@ function handleDownloadExcel() {
<BasicTable table-title="水电气列表"> <BasicTable table-title="水电气列表">
<template #toolbar-tools> <template #toolbar-tools>
<Space> <Space>
<a-button v-access:code="['property:meterInfo:export']" <a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
@click="handleDownloadExcel">
{{ $t('pages.common.export') }} {{ $t('pages.common.export') }}
</a-button> </a-button>
<a-button :disabled="!vxeCheckboxChecked(tableApi)" <a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
danger v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
type="primary"
v-access:code="['property:meterInfo:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button type="primary" <a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
v-access:code="['property:meterInfo:add']"
@click="handleAdd">
{{ $t('pages.common.add') }} {{ $t('pages.common.add') }}
</a-button> </a-button>
</Space> </Space>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button v-access:code="['property:meterInfo:edit']" <ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
@click.stop="handleEdit(row)">
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
</ghost-button> </ghost-button>
<Popconfirm :get-popup-container="getVxePopupContainer" <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
placement="left" @confirm="handleDelete(row)">
title="确认删除?" <ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
@confirm="handleDelete(row)">
<ghost-button danger
v-access:code="['property:meterInfo:remove']"
@click.stop="">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</ghost-button> </ghost-button>
</Popconfirm> </Popconfirm>
</Space> </Space>
</template> </template>
</BasicTable> </BasicTable>
<MeterInfoModal @reload="tableApi.query()" :meterType="3" /> <MeterInfoDrawer @reload="tableApi.query()" :meterType="3" />
</Page> </Page>
</template> </template>

View File

@@ -1,32 +1,32 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Recordable } from '@vben/types'; import type { Recordable } from '@vben/types'
import { ref } from 'vue'; import { ref } from 'vue'
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils'
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table'
import { import {
meterInfoExport, meterInfoExport,
meterInfoList, meterInfoList,
meterInfoRemove, meterInfoRemove,
} from '#/api/property/meter/meterInfo'; } from '#/api/property/energyManagement/meterInfo'
import type { MeterInfoForm } from '#/api/property/meterInfo/model'; import type { MeterInfoForm } from '#/api/property/meterInfo/model'
import { commonDownloadExcel } from '#/utils/file/download'; import { commonDownloadExcel } from '#/utils/file/download'
import meterInfoModal from "../components/meterInfo-modal.vue"; import meterInfoDrawer from "../components/meterInfo-drawer.vue"
import { initQuerySchema, initColumns } from "../components/data"; import { initQuerySchema, initColumns } from "../components/data"
const columns = initColumns(2); const columns = initColumns(1)
const querySchema = initQuerySchema(2); const querySchema = initQuerySchema(1)
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'], // ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ], // ],
// ], // ],
}; }
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -70,7 +70,7 @@ const gridOptions: VxeGridProps = {
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
}); })
}, },
}, },
}, },
@@ -79,50 +79,50 @@ const gridOptions: VxeGridProps = {
}, },
// //
id: 'property-meterInfo-index' id: 'property-meterInfo-index'
}; }
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
gridOptions, gridOptions,
}); })
const [MeterInfoModal, modalApi] = useVbenModal({ const [MeterInfoDrawer, modalApi] = useVbenDrawer({
connectedComponent: meterInfoModal, connectedComponent: meterInfoDrawer,
}); })
function handleAdd() { function handleAdd() {
modalApi.setData({}); modalApi.setData({})
modalApi.open(); modalApi.open()
} }
async function handleEdit(row: Required<MeterInfoForm>) { async function handleEdit(row: Required<MeterInfoForm>) {
modalApi.setData({ id: row.id }); modalApi.setData({ id: row.id })
modalApi.open(); modalApi.open()
} }
async function handleDelete(row: Required<MeterInfoForm>) { async function handleDelete(row: Required<MeterInfoForm>) {
await meterInfoRemove(row.id); await meterInfoRemove(row.id)
await tableApi.query(); await tableApi.query()
} }
function handleMultiDelete() { function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords(); const rows = tableApi.grid.getCheckboxRecords()
const ids = rows.map((row: Required<MeterInfoForm>) => row.id); const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
okType: 'danger', okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`, content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => { onOk: async () => {
await meterInfoRemove(ids); await meterInfoRemove(ids)
await tableApi.query(); await tableApi.query()
}, },
}); })
} }
function handleDownloadExcel() { function handleDownloadExcel() {
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, { commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime, fieldMappingTime: formOptions.fieldMappingTime,
}); })
} }
</script> </script>
@@ -131,54 +131,32 @@ function handleDownloadExcel() {
<BasicTable table-title="水电气列表"> <BasicTable table-title="水电气列表">
<template #toolbar-tools> <template #toolbar-tools>
<Space> <Space>
<a-button <a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
v-access:code="['property:meterInfo:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }} {{ $t('pages.common.export') }}
</a-button> </a-button>
<a-button <a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
:disabled="!vxeCheckboxChecked(tableApi)" v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
danger
type="primary"
v-access:code="['property:meterInfo:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
type="primary"
v-access:code="['property:meterInfo:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }} {{ $t('pages.common.add') }}
</a-button> </a-button>
</Space> </Space>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
v-access:code="['property:meterInfo:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
</ghost-button> </ghost-button>
<Popconfirm <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
:get-popup-container="getVxePopupContainer" @confirm="handleDelete(row)">
placement="left" <ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:meterInfo:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</ghost-button> </ghost-button>
</Popconfirm> </Popconfirm>
</Space> </Space>
</template> </template>
</BasicTable> </BasicTable>
<MeterInfoModal @reload="tableApi.query()" :meterType="2" /> <MeterInfoDrawer @reload="tableApi.query()" :meterType="1" />
</Page> </Page>
</template> </template>

View File

@@ -0,0 +1,162 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types'
import { ref } from 'vue'
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'
import { getVxePopupContainer } from '@vben/utils'
import { Modal, Popconfirm, Space } from 'ant-design-vue'
import dayjs from 'dayjs'
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table'
import {
meterInfoExport,
meterInfoList,
meterInfoRemove,
} from '#/api/property/energyManagement/meterInfo'
import type { MeterInfoForm } from '#/api/property/meterInfo/model'
import { commonDownloadExcel } from '#/utils/file/download'
import meterInfoDrawer from "../components/meterInfo-drawer.vue"
import { initQuerySchema, initColumns } from "../components/data"
const columns = initColumns(2)
const querySchema = initQuerySchema(2)
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
}
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await meterInfoList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
})
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-meterInfo-index'
}
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
})
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
connectedComponent: meterInfoDrawer,
})
function handleAdd() {
modalApi.setData({})
modalApi.open()
}
async function handleEdit(row: Required<MeterInfoForm>) {
modalApi.setData({ id: row.id })
modalApi.open()
}
async function handleDelete(row: Required<MeterInfoForm>) {
await meterInfoRemove(row.id)
await tableApi.query()
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords()
const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await meterInfoRemove(ids)
await tableApi.query()
},
})
}
function handleDownloadExcel() {
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
})
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="水电气列表">
<template #toolbar-tools>
<Space>
<a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
{{ $t('pages.common.export') }}
</a-button>
<a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
@confirm="handleDelete(row)">
<ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<MeterInfoDrawer @reload="tableApi.query()" :meterType="2" />
</Page>
</template>

View File

@@ -0,0 +1,157 @@
import type { FormSchemaGetter } from '#/adapter/form'
import type { VxeGridProps } from '#/adapter/vxe-table'
import { getDictOptions } from '#/utils/dict'
import { renderDict } from '#/utils/render'
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.METER_TYPE 便于维护
options: getDictOptions('meter_type'),
},
fieldName: 'meterType',
label: '设备类型',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'readingTime',
label: '抄表时间',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.METER_TYPE 便于维护
options: getDictOptions('meter_record_type'),
},
fieldName: 'readingMethod',
label: '抄表方式',
},
]
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '仪表编号',
field: 'meterId',
},
{
title: '仪表类型',
field: 'meterType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
return renderDict(row.meterType, 'meter_type')
},
},
},
{
title: '抄表员ID',
field: 'readerId',
},
{
title: '抄表时间',
field: 'readingTime',
},
{
title: '当前读数',
field: 'currentReading',
},
{
title: '上次读数',
field: 'previousReading',
},
{
title: '用量',
field: 'consumption',
},
{
title: '抄表方式',
field: 'readingMethod',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
return renderDict(row.readingMethod, 'meter_record_type')
},
},
},
{
title: '抄表照片',
field: 'imgOssid',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
]
export const drawerSchema: FormSchemaGetter = () => [
{
label: '记录ID',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '仪表编号',
fieldName: 'meterId',
component: 'Input',
rules: 'required',
},
// {
// label: '抄表员ID',
// fieldName: 'readerId',
// component: 'Input',
// rules: 'required',
// },
{
label: '抄表时间',
fieldName: 'readingTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '当前读数',
fieldName: 'currentReading',
component: 'Input',
rules: 'required',
},
{
label: '上次读数',
fieldName: 'previousReading',
component: 'Input',
rules: 'required',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.METER_TYPE 便于维护
options: getDictOptions('meter_record_type'),
},
fieldName: 'readingMethod',
label: '抄表方式',
},
// {
// label: '抄表照片',
// fieldName: 'imgOssid',
// component: 'Input',
// },
]

View File

@@ -3,7 +3,7 @@ import type { Recordable } from '@vben/types';
import { ref } from 'vue'; import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
@@ -16,17 +16,16 @@ import {
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
meterInfoExport, meterRecordExport,
meterInfoList, meterRecordList,
meterInfoRemove, meterRecordRemove,
} from '#/api/property/meter/meterInfo'; } from '#/api/property/energyManagement/meterRecord';
import type { MeterInfoForm } from '#/api/property/meterInfo/model';
import type { MeterRecordForm } from '#/api/property/energyManagement/meterRecord/model';
import { commonDownloadExcel } from '#/utils/file/download'; import { commonDownloadExcel } from '#/utils/file/download';
import meterInfoModal from "../components/meterInfo-modal.vue"; import meterRecordDrawer from './meterRecord-drawer.vue';
import { initQuerySchema, initColumns } from "../components/data"; import { columns, querySchema } from './data';
const columns = initColumns(1);
const querySchema = initQuerySchema(1);
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -66,7 +65,7 @@ const gridOptions: VxeGridProps = {
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }, formValues = {}) => { query: async ({ page }, formValues = {}) => {
return await meterInfoList({ return await meterRecordList({
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
@@ -78,7 +77,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// //
id: 'property-meterInfo-index' id: 'property-meterRecord-index'
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -86,41 +85,41 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
gridOptions, gridOptions,
}); });
const [MeterInfoModal, modalApi] = useVbenModal({ const [MeterRecordDrawer, drawerApi] = useVbenDrawer({
connectedComponent: meterInfoModal, connectedComponent: meterRecordDrawer,
}); });
function handleAdd() { function handleAdd() {
modalApi.setData({}); drawerApi.setData({});
modalApi.open(); drawerApi.open();
} }
async function handleEdit(row: Required<MeterInfoForm>) { async function handleEdit(row: Required<MeterRecordForm>) {
modalApi.setData({ id: row.id }); drawerApi.setData({ id: row.id });
modalApi.open(); drawerApi.open();
} }
async function handleDelete(row: Required<MeterInfoForm>) { async function handleDelete(row: Required<MeterRecordForm>) {
await meterInfoRemove(row.id); await meterRecordRemove(row.id);
await tableApi.query(); await tableApi.query();
} }
function handleMultiDelete() { function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords(); const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<MeterInfoForm>) => row.id); const ids = rows.map((row: Required<MeterRecordForm>) => row.id);
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
okType: 'danger', okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`, content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => { onOk: async () => {
await meterInfoRemove(ids); await meterRecordRemove(ids);
await tableApi.query(); await tableApi.query();
}, },
}); });
} }
function handleDownloadExcel() { function handleDownloadExcel() {
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, { commonDownloadExcel(meterRecordExport, '抄表记录数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime, fieldMappingTime: formOptions.fieldMappingTime,
}); });
} }
@@ -128,36 +127,23 @@ function handleDownloadExcel() {
<template> <template>
<Page :auto-content-height="true"> <Page :auto-content-height="true">
<BasicTable table-title="水电气列表"> <BasicTable table-title="抄表记录列表">
<template #toolbar-tools> <template #toolbar-tools>
<Space> <Space>
<a-button
v-access:code="['property:meterInfo:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button <a-button
:disabled="!vxeCheckboxChecked(tableApi)" :disabled="!vxeCheckboxChecked(tableApi)"
danger danger
type="primary" type="primary"
v-access:code="['property:meterInfo:remove']" v-access:code="['property:meterRecord:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button
type="primary"
v-access:code="['property:meterInfo:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space> </Space>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:meterInfo:edit']" v-access:code="['property:meterRecord:edit']"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"
> >
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
@@ -170,7 +156,7 @@ function handleDownloadExcel() {
> >
<ghost-button <ghost-button
danger danger
v-access:code="['property:meterInfo:remove']" v-access:code="['property:meterRecord:remove']"
@click.stop="" @click.stop=""
> >
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
@@ -179,6 +165,6 @@ function handleDownloadExcel() {
</Space> </Space>
</template> </template>
</BasicTable> </BasicTable>
<MeterInfoModal @reload="tableApi.query()" :meterType="1" /> <MeterRecordDrawer @reload="tableApi.query()" />
</Page> </Page>
</template> </template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenDrawer } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { meterRecordAdd, meterRecordInfo, meterRecordUpdate } from '#/api/property/energyManagement/meterRecord';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { drawerSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: drawerSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicDrawer, drawerApi] = useVbenDrawer({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
drawerApi.drawerLoading(true);
const { id } = drawerApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await meterRecordInfo(id);
await formApi.setValues(record);
}
await markInitialized();
drawerApi.drawerLoading(false);
},
});
async function handleConfirm() {
try {
drawerApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? meterRecordUpdate(data) : meterRecordAdd(data));
resetInitialized();
emit('reload');
drawerApi.close();
} catch (error) {
console.error(error);
} finally {
drawerApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicDrawer :title="title">
<BasicForm />
</BasicDrawer>
</template>

View File

@@ -0,0 +1,80 @@
<script setup lang="ts">
import type { PropType } from 'vue'
import { onMounted, ref } from 'vue'
import { handleNode } from '@vben/utils'
import { Empty, Skeleton, Tree } from 'ant-design-vue'
import { communityTree } from "#/api/property/community"
import type { CommunityVO } from "#/api/property/community/model"
defineOptions({ inheritAttrs: false })
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true })
const emit = defineEmits<{
/**
* 点击刷新按钮的事件
*/
reload: []
/**
* 点击节点的事件
*/
select: []
}>()
const selectFloorId = defineModel('selectFloorId', {
type: Array as PropType<string[]>,
})
const searchValue = defineModel('searchValue', {
type: String,
default: '',
})
type TreeArray = CommunityVO[]
const treeArray = ref<TreeArray>([])
/** 骨架屏加载 */
const showTreeSkeleton = ref<boolean>(true)
async function loadTree() {
showTreeSkeleton.value = true
searchValue.value = ''
selectFloorId.value = []
const ret = await communityTree(3)
const splitStr = '/'
handleNode(ret, 'label', splitStr, function (node: any) {
if (node.level != 3) {
node.disabled = true
}
})
treeArray.value = ret
showTreeSkeleton.value = false
}
onMounted(loadTree);
</script>
<template>
<div :class="$attrs.class">
<Skeleton :loading="showTreeSkeleton" :paragraph="{ rows: 8 }" active class="p-[8px] flex-1 min-h-0">
<div class="bg-background flex h-full flex-col overflow-y-auto rounded-lg">
<div class="h-full overflow-x-hidden px-[8px]">
<Tree v-bind="$attrs" v-if="treeArray.length > 0" v-model:selected-keys="selectFloorId"
:field-names="{ title: 'label', key: 'id' }" :show-line="{ showLeafIcon: false }" :tree-data="treeArray"
:virtual="false" default-expand-all @select="$emit('select')">
<template #title="{ label }">
<span v-if="label.indexOf(searchValue) > -1">
{{ label.substring(0, label.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else>{{ label }}</span>
</template>
</Tree>
<div v-else class="mt-5">
<Empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" />
</div>
</div>
</div>
</Skeleton>
</div>
</template>

View File

@@ -0,0 +1,55 @@
<script setup lang="ts">
import { columns, querySchema } from './data'
import FloorTree from "../components/floor-tree.vue"
import { Page, type VbenFormProps } from '@vben/common-ui'
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table'
import { paymentReviewList, } from '#/api/property/costManagement/paymentReview'
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 30,
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-1 lg:grid-cols-3 xl:grid-cols-4',
}
const gridOptions: VxeGridProps = {
checkboxConfig: {
highlight: true,
reserve: true,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await paymentReviewList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
})
},
},
},
rowConfig: {
keyField: 'id',
},
id: 'property-paymentReview-index'
}
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
</script>
<template>
<Page :auto-content-height="true">
<div class="flex h-full gap-[8px]">
<FloorTree class="w-[260px]"></FloorTree>
<BasicTable class="flex-1 overflow-hidden" table-title="用水费用报表" />
</div>
</Page>
</template>

View File

@@ -1,14 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { Page, type VbenFormProps } from '@vben/common-ui'; import { columns, querySchema } from './data'
import { import FloorTree from "../components/floor-tree.vue"
useVbenVxeGrid, import { Page, type VbenFormProps } from '@vben/common-ui'
type VxeGridProps import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table'
} from '#/adapter/vxe-table'; import { paymentReviewList } from '#/api/property/costManagement/paymentReview'
import {
paymentReviewList,
} from '#/api/property/costManagement/paymentReview';
import { columns, querySchema } from './data';
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -19,7 +14,7 @@ const formOptions: VbenFormProps = {
}, },
schema: querySchema(), schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
}; }
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -37,7 +32,7 @@ const gridOptions: VxeGridProps = {
pageNum: page.currentPage, pageNum: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
...formValues, ...formValues,
}); })
}, },
}, },
}, },
@@ -45,7 +40,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
id: 'property-paymentReview-index' id: 'property-paymentReview-index'
}; }
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions, formOptions,
@@ -54,19 +49,10 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<Page :auto-content-height="true"> <BasicTable class="flex-1 overflow-hidden" table-title="用水环比分析列表" />
<BasicTable table-title="用电环比分析列表"/>
</Page>
</div> </div>
</div> </Page>
</template> </template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
}
</style>

View File

@@ -1,87 +1,87 @@
<template> <template>
<div class="energy-monitor-page"> <Page :auto-content-height="true">
<div class="left-content"> <div class="flex h-full gap-[8px]">
<FloorTree></FloorTree> <FloorTree class="w-[260px]"></FloorTree>
</div> <div class="flex-1 overflow-hidden">
<div class="right-content"> <div class="row">
<div class="row"> <div class="comparison-section-container">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
</div>
<div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header"> <div class="section-header">
<div class="header-title">能耗趋势</div> <div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div> </div>
<RadioGroup v-model:value="energyTrendTime"
button-style="solid"
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div> </div>
<div class="energy-chart" ref="energyTrendChart"> <div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header">
<div class="header-title">能耗趋势</div>
</div>
<RadioGroup v-model:value="energyTrendTime" button-style="solid" size="small"
@change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="energy-chart" ref="energyTrendChart">
</div>
</div> </div>
</div> </div>
</div> <div class="row">
<div class="row"> <div class="power-curve-container">
<div class="power-curve-container"> <div class="section-header">
<div class="section-header"> <div class="header-title">当年数据曲线</div>
<div class="header-title">当年数据曲线</div> </div>
</div> <div class="power-chart" ref="powerCurveChart">
<div class="power-chart" ref="powerCurveChart"> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </Page>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {RadioGroup, RadioButton} from 'ant-design-vue' import { RadioGroup, RadioButton } from 'ant-design-vue'
import {ref, onMounted, onBeforeUnmount, reactive} from 'vue' import { Page } from '@vben/common-ui'
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import type {ECharts, EChartsOption} from 'echarts' import type { ECharts, EChartsOption } from 'echarts'
import FloorTree from "../../electricEnergy/elctricitySituation/floor-tree.vue"; import FloorTree from "../../electricEnergy/components/floor-tree.vue"
const chainData = reactive({ const chainData = reactive({
currentMonthEnergy: '9', currentMonthEnergy: '9',
@@ -122,8 +122,8 @@ const energyTrendOption: EChartsOption = {
type: 'bar', type: 'bar',
markPoint: { markPoint: {
data: [ data: [
{type: 'max', name: 'Max'}, { type: 'max', name: 'Max' },
{type: 'min', name: 'Min'} { type: 'min', name: 'Min' }
] ]
}, },
} }
@@ -153,30 +153,30 @@ const initEnergyTrendChart = () => {
} }
function buildingEnergyTrendData(val: string) { function buildingEnergyTrendData(val: string) {
const now = new Date(); const now = new Date()
let timeArr = []; let timeArr = []
let valArr = []; let valArr = []
let name = '日期'; let name = '日期'
if (val == '2') { if (val == '2') {
const day = now.getDate() const day = now.getDate()
for (let i = 1; i < day; i++) { for (let i = 1; i < day; i++) {
timeArr.push(i); timeArr.push(i)
valArr.push(parseFloat((Math.random() * 10).toFixed(2))); valArr.push(parseFloat((Math.random() * 10).toFixed(2)))
} }
} else { } else {
const month = now.getMonth() + 1; const month = now.getMonth() + 1
for (let i = 1; i < month; i++) { for (let i = 1; i < month; i++) {
timeArr.push(i); timeArr.push(i)
valArr.push(parseFloat((Math.random() * 80).toFixed(2))); valArr.push(parseFloat((Math.random() * 80).toFixed(2)))
} }
name = '月份'; name = '月份'
} }
if (energyTrendInstance.value) { if (energyTrendInstance.value) {
energyTrendInstance.value.setOption({ energyTrendInstance.value.setOption({
xAxis: {data: timeArr, name}, xAxis: { data: timeArr, name },
series: [{data: valArr}], series: [{ data: valArr }],
}); })
} }
} }
@@ -197,8 +197,8 @@ const powerCurveOption: EChartsOption = {
}, },
toolbox: { toolbox: {
feature: { feature: {
magicType: {show: true, type: ['line', 'bar']}, magicType: { show: true, type: ['line', 'bar'] },
restore: {show: true}, restore: { show: true },
} }
}, },
legend: { legend: {
@@ -228,13 +228,13 @@ const powerCurveOption: EChartsOption = {
data: [], data: [],
markPoint: { markPoint: {
data: [ data: [
{type: 'max',}, { type: 'max', },
{type: 'min',} { type: 'min', }
] ]
}, },
}, },
] ]
}; }
const initPowerCurveChart = () => { const initPowerCurveChart = () => {
if (powerCurveChart.value) { if (powerCurveChart.value) {
@@ -259,19 +259,19 @@ const initPowerCurveChart = () => {
} }
function buildingPowerCurveData() { function buildingPowerCurveData() {
const now = new Date(); const now = new Date()
const month = now.getMonth()+1; const month = now.getMonth() + 1
let yearData = []; let yearData = []
let timeDate = [] let timeDate = []
for (let i = 1; i < month; i++) { for (let i = 1; i < month; i++) {
timeDate.push(i+'月'); timeDate.push(i + '月')
yearData.push(parseFloat((Math.random() * 60).toFixed(2))); yearData.push(parseFloat((Math.random() * 60).toFixed(2)))
} }
if (powerCurveInstance.value) { if (powerCurveInstance.value) {
powerCurveInstance.value.setOption({ powerCurveInstance.value.setOption({
xAxis: {data: timeDate}, xAxis: { data: timeDate },
series: [{data: yearData}], series: [{ data: yearData }],
}); })
} }
} }
@@ -283,34 +283,12 @@ onMounted(() => {
// //
onBeforeUnmount(() => { onBeforeUnmount(() => {
energyTrendInstance.value?.dispose(); energyTrendInstance.value?.dispose()
powerCurveInstance.value?.dispose(); powerCurveInstance.value?.dispose()
}) })
</script> </script>
<style scoped> <style scoped>
.energy-monitor-page {
display: flex;
gap: 1rem;
padding: 1rem;
background-color: #f4f4f4;
min-height: 100vh;
}
.left-content {
flex: 1;
height: 95vh;
}
.right-content {
display: flex;
flex: 4;
flex-direction: column;
gap: 1rem;
}
.row { .row {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
@@ -324,9 +302,12 @@ onBeforeUnmount(() => {
.energy-trend-container { .energy-trend-container {
flex: 3; flex: 3;
} }
.power-curve-container { .power-curve-container {
margin-top: 10px;
flex: 5; flex: 5;
} }
.energy-trend-top { .energy-trend-top {
display: flex; display: flex;
justify-content: space-between justify-content: space-between
@@ -345,7 +326,7 @@ onBeforeUnmount(() => {
.comparison-section-container, .comparison-section-container,
.energy-trend-container, .energy-trend-container,
.power-curve-container{ .power-curve-container {
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
@@ -386,12 +367,11 @@ onBeforeUnmount(() => {
border-bottom: 1px solid #666; border-bottom: 1px solid #666;
} }
.power-chart{ .power-chart {
height: 45vh; height: 45vh;
} }
.energy-chart{ .energy-chart {
height: 30vh; height: 30vh;
} }
</style> </style>

View File

@@ -1,24 +1,25 @@
<script setup lang="ts"> <script setup lang="ts">
import * as echarts from 'echarts'; import dayjs from 'dayjs'
import {onMounted, ref} from "vue"; import type { Dayjs } from 'dayjs'
import type { Dayjs } from 'dayjs'; import * as echarts from 'echarts'
import dayjs from 'dayjs'; import { onMounted, ref } from "vue"
import { DatePicker } from 'ant-design-vue'; import { Page } from '@vben/common-ui'
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import { DatePicker } from 'ant-design-vue'
import FloorTree from "../components/floor-tree.vue"
const currentMonth = ref<Dayjs>(dayjs()); const currentMonth = ref<Dayjs>(dayjs())
const currentYear = ref<Dayjs>(dayjs()); const currentYear = ref<Dayjs>(dayjs())
const disabledMonth = (current: Dayjs) => { const disabledMonth = (current: Dayjs) => {
return current && current > dayjs().endOf('month'); return current && current > dayjs().endOf('month')
}; }
const disabledYear = (current: Dayjs) => { const disabledYear = (current: Dayjs) => {
return current && current > dayjs().endOf('year'); return current && current > dayjs().endOf('year')
}; }
onMounted(()=>{ onMounted(() => {
//month //month
const chartMonth = document.getElementById('month'); const chartMonth = document.getElementById('month')
const myChartMonth = echarts.init(chartMonth); const myChartMonth = echarts.init(chartMonth)
const optionMonth = { const optionMonth = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -37,14 +38,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'日', name: '日',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'t' name: 't'
} }
], ],
series: [ series: [
@@ -52,7 +53,7 @@ onMounted(()=>{
name: '当月', name: '当月',
type: 'bar', type: 'bar',
data: [ data: [
2.0, 4.9, 7.0, 23.2, 25.6, 0.0, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 0.0, 7.0, 23.2, 0.0, 76.7, 135.6, 162.2, 32.6, 0.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6 2.0, 4.9, 7.0, 23.2, 25.6, 0.0, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 0.0, 7.0, 23.2, 0.0, 76.7, 135.6, 162.2, 32.6, 0.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
], ],
markPoint: { markPoint: {
data: [ data: [
@@ -65,7 +66,7 @@ onMounted(()=>{
name: '上月', name: '上月',
type: 'bar', type: 'bar',
data: [ data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 0.0, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 0.0, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 0.0, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 0.0, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
], ],
markPoint: { markPoint: {
data: [ data: [
@@ -83,12 +84,12 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionMonth && myChartMonth.setOption(optionMonth); optionMonth && myChartMonth.setOption(optionMonth)
//year //year
const chartYear = document.getElementById('year'); const chartYear = document.getElementById('year')
const myChartYear = echarts.init(chartYear); const myChartYear = echarts.init(chartYear)
const optionYear = { const optionYear = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -107,14 +108,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'月', name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'t' name: 't'
} }
], ],
series: [ series: [
@@ -153,8 +154,8 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionYear && myChartYear.setOption(optionYear); optionYear && myChartYear.setOption(optionYear)
// //
myChartYear.on('mouseover', { seriesIndex: 0 }, () => { myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
@@ -162,8 +163,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartYear.on('mouseout', { seriesIndex: 0 }, () => { myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
@@ -171,8 +172,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
// //
myChartMonth.on('mouseover', { seriesIndex: 0 }, () => { myChartMonth.on('mouseover', { seriesIndex: 0 }, () => {
@@ -180,8 +181,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartMonth.on('mouseout', { seriesIndex: 0 }, () => { myChartMonth.on('mouseout', { seriesIndex: 0 }, () => {
@@ -189,46 +190,33 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
}) })
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<div style="background: #fff;border-radius: 8px;padding: 10px;"> <div class="flex-1 overflow-hidden">
<div> <div style="background: #fff;border-radius: 8px;padding: 10px;height: 50%;">
<div style="display: flex;justify-content: space-between;"> <div>
<DatePicker <div style="display: flex;justify-content: space-between;">
v-model:value="currentMonth" <DatePicker v-model:value="currentMonth" :disabled-date="disabledMonth" picker="month" />当月能耗总值30.00t
:disabled-date="disabledMonth" </div>
picker="month" </div>
/>30.00t</div> <div id="month" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 50%;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值59.00t
</div>
</div>
<div id="year" style="height: 100%;width: 100%;"></div>
</div>
</div> </div>
<div id="month" style="height: 350px;width: 100%;"></div>
</div> </div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;"> </Page>
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentYear"
:disabled-date="disabledYear"
picker="year"
/>59.00t</div>
</div>
<div id="year" style="height: 350px;width: 100%;"></div>
</div>
</div>
</div>
</template> </template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -1,22 +1,22 @@
<script setup lang="ts"> <script setup lang="ts">
import * as echarts from 'echarts'; import * as echarts from 'echarts'
import {onMounted, ref} from "vue"; import { onMounted, ref } from "vue"
import type { Dayjs } from 'dayjs'; import type { Dayjs } from 'dayjs'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import { Table } from 'ant-design-vue' import { Page } from '@vben/common-ui'
import { DatePicker } from 'ant-design-vue'; import { Table, DatePicker } from 'ant-design-vue'
import { SearchOutlined } from '@ant-design/icons-vue'; import FloorTree from "../components/floor-tree.vue"
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; import { SearchOutlined } from '@ant-design/icons-vue'
const currentYear = ref<Dayjs>(dayjs()); const currentYear = ref<Dayjs>(dayjs())
const disabledYear = (current: Dayjs) => { const disabledYear = (current: Dayjs) => {
return current && current > dayjs().endOf('year'); return current && current > dayjs().endOf('year')
}; }
onMounted(()=>{ onMounted(() => {
//year //year
const chartYear = document.getElementById('year'); const chartYear = document.getElementById('year')
const myChartYear = echarts.init(chartYear); const myChartYear = echarts.init(chartYear)
const optionYear = { const optionYear = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -35,14 +35,14 @@ onMounted(()=>{
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name:'月', name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name:'t' name: 't'
} }
], ],
series: [ series: [
@@ -81,8 +81,8 @@ onMounted(()=>{
filterMode: 'filter', filterMode: 'filter',
}, },
], ],
}; }
optionYear && myChartYear.setOption(optionYear); optionYear && myChartYear.setOption(optionYear)
// //
myChartYear.on('mouseover', { seriesIndex: 0 }, () => { myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
@@ -90,8 +90,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: true, dataZoomSelectActive: true,
}); })
}); })
// //
myChartYear.on('mouseout', { seriesIndex: 0 }, () => { myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
@@ -99,8 +99,8 @@ onMounted(()=>{
type: 'takeGlobalCursor', type: 'takeGlobalCursor',
key: 'dataZoomSelect', key: 'dataZoomSelect',
dataZoomSelectActive: false, dataZoomSelectActive: false,
}); })
}); })
}) })
const columns = [ const columns = [
@@ -120,54 +120,39 @@ const columns = [
title: '同比(%)', title: '同比(%)',
dataIndex: 'address', dataIndex: 'address',
}, },
]; ]
const data = [...Array(32)].map((_, i) => ({ const data = [...Array(32)].map((_, i) => ({
key: i, key: i,
name: `${i+1}`, name: `${i + 1}`,
age: '--', age: '--',
address: `--`, address: `--`,
})); }));
</script> </script>
<template> <template>
<div class="box"> <Page :auto-content-height="true">
<div class="left"><FloorTree></FloorTree></div> <div class="flex h-full gap-[8px]">
<div class="right"> <FloorTree class="w-[260px]"></FloorTree>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;"> <div class="flex-1 overflow-hidden">
<div> <div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;">
年份 <div>
<DatePicker 年份
style="margin: 0 10px;" <DatePicker style="margin: 0 10px;" v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />
v-model:value="currentYear" <a-button type="primary">
:disabled-date="disabledYear" <template #icon>
picker="year" <SearchOutlined />
/> </template>
<a-button type="primary"> 查询
<template #icon><SearchOutlined /></template> </a-button>
查询 </div>
</a-button> <div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table style="border-radius: 8px;" :columns="columns" :data-source="data" :pagination="false"
:scroll="{ y: '50vh' }" />
</div> </div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table
style="border-radius: 8px;"
:columns="columns"
:data-source="data"
:pagination="false"
:scroll="{ y: '50vh' }"
/>
</div> </div>
</div> </div>
</div> </Page>
</template> </template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -173,7 +173,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:machine:info']" v-access:code="['property:machine:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -153,7 +153,7 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:maintainPlan:info']" v-access:code="['property:maintainPlan:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}

View File

@@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps,
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
orderChargeList, orderChargeList,
@@ -51,7 +51,7 @@ const gridOptions: VxeGridProps = {
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
}, },
id: 'property-orderCharge-index' id: 'property-orderCharge-index',
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -112,7 +112,8 @@ function handleMultiDelete() {
danger danger
type="primary" type="primary"
v-access:code="['property:orderCharge:remove']" v-access:code="['property:orderCharge:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete"
>
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button
@@ -128,6 +129,7 @@ function handleMultiDelete() {
<Space> <Space>
<ghost-button <ghost-button
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
v-access:code="['property:orderCharge:query']"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>
@@ -155,6 +157,6 @@ function handleMultiDelete() {
</template> </template>
</BasicTable> </BasicTable>
<OrderChargeModal @reload="tableApi.query()" /> <OrderChargeModal @reload="tableApi.query()" />
<orderChargeDetailModal/> <orderChargeDetailModal />
</Page> </Page>
</template> </template>

View File

@@ -89,7 +89,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'inspectResult', field: 'inspectResult',
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return renderDict(row.inspectResult, 'pro_inspection_results'); return row.inspectResult!=null? renderDict(row.inspectResult, 'pro_inspection_results'):'';
}, },
}, },
minWidth: '120', minWidth: '120',
@@ -152,6 +152,7 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input', component: 'Input',
rules: 'required', rules: 'required',
labelWidth: 100, labelWidth: 100,
formItemClass:'col-span-2'
}, },
{ {
label: '服务地点', label: '服务地点',
@@ -160,6 +161,7 @@ export const modalSchema: FormSchemaGetter = () => [
defaultValue: undefined, defaultValue: undefined,
rules: 'required', rules: 'required',
labelWidth: 100, labelWidth: 100,
formItemClass:'col-span-2'
}, },
{ {
label: '服务类型', label: '服务类型',
@@ -226,50 +228,51 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required', rules: 'required',
labelWidth: 100, labelWidth: 100,
}, },
{ //
label: '巡检结果', // {
fieldName: 'inspectResult', // label: '巡检结果',
component: 'Select', // fieldName: 'inspectResult',
componentProps: { // component: 'Select',
options: getDictOptions('pro_inspection_results'), // componentProps: {
}, // options: getDictOptions('pro_inspection_results'),
rules: 'selectRequired', // },
labelWidth: 100, // rules: 'selectRequired',
}, // labelWidth: 100,
{ // },
label: '处理措施', // {
fieldName: 'measure', // label: '处理措施',
component: 'Textarea', // fieldName: 'measure',
rules: 'required', // component: 'Textarea',
labelWidth: 100, // rules: 'required',
}, // labelWidth: 100,
{ // },
label: '客户评分', // {
fieldName: 'customerScore', // label: '客户评分',
component: 'Rate', // fieldName: 'customerScore',
componentProps: { // component: 'Rate',
allowHalf: false, // componentProps: {
count: 5, // allowHalf: false,
tooltips: ['1星', '2星', '3星', '4星', '5星'], // count: 5,
defaultValue: 0, // tooltips: ['1星', '2星', '3星', '4星', '5星'],
}, // defaultValue: 0,
rules: 'required', // },
labelWidth: 100, // rules: 'required',
}, // labelWidth: 100,
{ // },
label: '客户反馈', // {
fieldName: 'customerAdvice', // label: '客户反馈',
component: 'Textarea', // fieldName: 'customerAdvice',
labelWidth: 100, // component: 'Textarea',
}, // labelWidth: 100,
{ // },
label: '处理状态', // {
fieldName: 'state', // label: '处理状态',
component: 'Select', // fieldName: 'state',
componentProps: { // component: 'Select',
options: getDictOptions('pro_processing_status'), // componentProps: {
}, // options: getDictOptions('pro_processing_status'),
rules: 'selectRequired', // },
labelWidth: 100, // rules: 'selectRequired',
}, // labelWidth: 100,
// },
]; ];

View File

@@ -6,13 +6,13 @@ import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space,Tag } from 'ant-design-vue'; import { Modal, Popconfirm, Space, Tag } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps,
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
@@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// 表格全局唯一表示 保存列配置需要用到 // 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalPlan-index' id: 'property-rentalPlan-index',
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -103,7 +103,7 @@ async function handleDelete(row: Required<RentalPlanForm>) {
await tableApi.query(); await tableApi.query();
} }
async function handleView(row: Required<RentalPlanForm>) { async function handleView(row: Required<RentalPlanForm>) {
modalApi.setData({ id: row.id, readonly: true,}); modalApi.setData({ id: row.id, readonly: true });
modalApi.open(); modalApi.open();
} }
function handleMultiDelete() { function handleMultiDelete() {
@@ -121,11 +121,15 @@ function handleMultiDelete() {
} }
function handleDownloadExcel() { function handleDownloadExcel() {
commonDownloadExcel(rentalPlanExport, '绿植租赁-租赁方案数据', tableApi.formApi.form.values, { commonDownloadExcel(
fieldMappingTime: formOptions.fieldMappingTime, rentalPlanExport,
}); '绿植租赁-租赁方案数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
} }
</script> </script>
<template> <template>
@@ -144,7 +148,8 @@ function handleDownloadExcel() {
danger danger
type="primary" type="primary"
v-access:code="['property:rentalPlan:remove']" v-access:code="['property:rentalPlan:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete"
>
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button
@@ -158,7 +163,9 @@ function handleDownloadExcel() {
</template> </template>
<template #rentalPeriod="{ row }"> <template #rentalPeriod="{ row }">
<div> <div>
{{ row.rentalPeriod == 0?'月':row.rentalPeriod == 1 ? '季度':'年' }} {{
row.rentalPeriod == 0 ? '月' : row.rentalPeriod == 1 ? '季度' : '年'
}}
</div> </div>
</template> </template>
<template #state="{ row }"> <template #state="{ row }">
@@ -167,7 +174,12 @@ function handleDownloadExcel() {
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button> <ghost-button
@click.stop="handleView(row)"
v-access:code="['property:rentalPlan:query']"
>
查看
</ghost-button>
<ghost-button <ghost-button
v-access:code="['property:rentalPlan:edit']" v-access:code="['property:rentalPlan:edit']"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"

View File

@@ -47,7 +47,7 @@ export const columns: VxeGridProps['columns'] = [
{ {
title: '订单号', title: '订单号',
field: 'orderNo', field: 'orderNo',
width: 100 minWidth: 180
}, },
{ {
title: '客户名称', title: '客户名称',
@@ -134,7 +134,7 @@ export const columns: VxeGridProps['columns'] = [
fixed: 'right', fixed: 'right',
slots: {default: 'action'}, slots: {default: 'action'},
title: '操作', title: '操作',
minWidth: 180, width: 180,
}, },
]; ];

View File

@@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
@@ -8,7 +7,7 @@ import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps,
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
@@ -62,7 +61,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// 表格全局唯一表示 保存列配置需要用到 // 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalOrder-index' id: 'property-rentalOrder-index',
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -108,9 +107,14 @@ function handleMultiDelete() {
} }
function handleDownloadExcel() { function handleDownloadExcel() {
commonDownloadExcel(rentalOrderExport, '绿植租赁-订单管理数据', tableApi.formApi.form.values, { commonDownloadExcel(
fieldMappingTime: formOptions.fieldMappingTime, rentalOrderExport,
}); '绿植租赁-订单管理数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
} }
</script> </script>
@@ -130,7 +134,8 @@ function handleDownloadExcel() {
danger danger
type="primary" type="primary"
v-access:code="['property:rentalOrder:remove']" v-access:code="['property:rentalOrder:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete"
>
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button
@@ -145,12 +150,13 @@ function handleDownloadExcel() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:rentalOrder:info']" v-access:code="['property:rentalOrder:query']"
@click.stop="handleInfo(row)"> @click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>
<Popconfirm <Popconfirm
:disabled="row.paymentStatus==1&&row.contractStatus==1" :disabled="row.paymentStatus == 1 && row.contractStatus == 1"
:get-popup-container="getVxePopupContainer" :get-popup-container="getVxePopupContainer"
placement="left" placement="left"
title="确认删除?" title="确认删除?"

View File

@@ -15,7 +15,6 @@ import type { PropertyForm } from '#/api/property/productManagement/model';
import PlantsProductModal from './plantsProduct-modal.vue'; import PlantsProductModal from './plantsProduct-modal.vue';
import PlantsProductDetail from './plantsProduct-detail.vue'; import PlantsProductDetail from './plantsProduct-detail.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import { ref } from 'vue';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
labelWidth: 80, labelWidth: 80,
@@ -110,13 +109,13 @@ function handleMultiDelete() {
:disabled="!vxeCheckboxChecked(tableApi)" :disabled="!vxeCheckboxChecked(tableApi)"
danger danger
type="primary" type="primary"
v-access:code="['property:property:remove']" v-access:code="['property:plantsProduct:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete">
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button
type="primary" type="primary"
v-access:code="['property:property:add']" v-access:code="['property:plantsProduct:add']"
@click="handleAdd" @click="handleAdd"
> >
{{ $t('pages.common.add') }} {{ $t('pages.common.add') }}
@@ -126,12 +125,13 @@ function handleMultiDelete() {
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
v-access:code="['property:plantsProduct:query']"
@click.stop="handleInfo(row)" @click.stop="handleInfo(row)"
> >
{{ $t('pages.common.info') }} {{ $t('pages.common.info') }}
</ghost-button> </ghost-button>
<ghost-button <ghost-button
v-access:code="['property:property:edit']" v-access:code="['property:plantsProduct:edit']"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"
> >
{{ $t('pages.common.edit') }} {{ $t('pages.common.edit') }}
@@ -144,7 +144,7 @@ function handleMultiDelete() {
> >
<ghost-button <ghost-button
danger danger
v-access:code="['property:property:remove']" v-access:code="['property:plantsProduct:remove']"
@click.stop="" @click.stop=""
> >
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}

View File

@@ -5,6 +5,7 @@ import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue'; import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {plantsProductInfo} from '#/api/property/productManagement'; import {plantsProductInfo} from '#/api/property/productManagement';
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
import {ossInfo} from "#/api/system/oss";
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange, onOpenChange: handleOpenChange,
@@ -21,8 +22,11 @@ async function handleOpenChange(open: boolean) {
} }
modalApi.modalLoading(true); modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string }; const {id} = modalApi.getData() as { id: number | string };
const response = await plantsProductInfo(id); plantsProductDetail.value = await plantsProductInfo(id);
plantsProductDetail.value = response; if(plantsProductDetail.value.imgPath){
const res = await ossInfo([plantsProductDetail.value.imgPath]);
plantsProductDetail.value.plantImg = res?.[0]?.url
}
modalApi.modalLoading(false); modalApi.modalLoading(false);
} }
</script> </script>
@@ -55,15 +59,16 @@ async function handleOpenChange(open: boolean) {
:is="renderDict(plantsProductDetail.state,'product_management_status')" :is="renderDict(plantsProductDetail.state,'product_management_status')"
/> />
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="产品图片">
<img :src="plantsProductDetail.imgPath" alt="">
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ plantsProductDetail.remark }}
</DescriptionsItem>
<DescriptionsItem label="创建时间"> <DescriptionsItem label="创建时间">
{{ plantsProductDetail.createTime }} {{ plantsProductDetail.createTime }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="产品图片" :span="2">
<img v-if="plantsProductDetail.plantImg" :src="plantsProductDetail.plantImg" alt="图片加载失败" class="w-[100px] h-[100px]" />
</DescriptionsItem>
<DescriptionsItem label="备注" :span="2">
{{ plantsProductDetail.remark }}
</DescriptionsItem>
</Descriptions> </Descriptions>
</BasicModal> </BasicModal>
</template> </template>

Some files were not shown because too many files have changed in this diff Show More