Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
29c20f6403 | |||
90b9b2b7a9 |
@@ -10,24 +10,24 @@ jobs:
|
|||||||
- name: 拉取代码仓库
|
- name: 拉取代码仓库
|
||||||
uses: http://git.missmoc.top/mocheng/checkout@v4
|
uses: http://git.missmoc.top/mocheng/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1 # 只拉取最新的1个提交(浅克隆)
|
fetch-depth: 0 # 只拉取最新的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
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
- name: 安装pnpm
|
- name: 安装pnpm
|
||||||
run: npm i pnpm -g
|
run: npm i pnpm -g
|
||||||
|
|
||||||
- name: 安装依赖
|
- name: 安装依赖
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
continue-on-error: false # 依赖安装失败则终止工作流
|
continue-on-error: false # 依赖安装失败则终止工作流
|
||||||
|
|
||||||
- name: 构建项目
|
- name: 构建项目
|
||||||
run: pnpm build:antd
|
run: pnpm build:antd
|
||||||
continue-on-error: false # 构建失败则终止工作流
|
continue-on-error: false # 构建失败则终止工作流
|
||||||
|
|
||||||
- name: 检查构建结果
|
- name: 检查构建结果
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d "./apps/web-antd/dist" ]; then
|
if [ ! -d "./apps/web-antd/dist" ]; then
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
echo "构建目录为空,构建失败"
|
echo "构建目录为空,构建失败"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
- name: 通过SSH复制文件
|
- name: 通过SSH复制文件
|
||||||
run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property
|
run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property
|
||||||
|
@@ -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 | String
|
meterType: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计量单位(1-度,2-吨,3-立方米)
|
* 计量单位(1-度,2-吨,3-立方米)
|
||||||
*/
|
*/
|
||||||
meterUnit: number | String
|
meterUnit: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安装位置
|
* 安装位置
|
||||||
*/
|
*/
|
||||||
installLocation: string
|
installLocation: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始读数
|
* 初始读数
|
||||||
*/
|
*/
|
||||||
initReading: number
|
initReading: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最大量程
|
* 最大量程
|
||||||
*/
|
*/
|
||||||
maxRang: number
|
maxRang: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通信状态
|
* 通信状态
|
||||||
*/
|
*/
|
||||||
communicationState: number | String
|
communicationState: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行状态
|
* 运行状态
|
||||||
*/
|
*/
|
||||||
runningState: number | String
|
runningState: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
remark: string
|
remark: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,67 +67,62 @@ 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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,55 +130,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;
|
||||||
}
|
}
|
||||||
|
@@ -1,61 +0,0 @@
|
|||||||
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}`);
|
|
||||||
}
|
|
@@ -1,149 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
@@ -2,6 +2,8 @@ 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 = () => [
|
||||||
{
|
{
|
||||||
@@ -94,34 +96,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',
|
||||||
|
@@ -47,7 +47,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
try {
|
try {
|
||||||
if (orderDetail.value.orderImgUrl) {
|
if (orderDetail.value.orderImgUrl) {
|
||||||
const res = await ossInfo([orderDetail.value.orderImgUrl]);
|
const res = await ossInfo([orderDetail.value.orderImgUrl]);
|
||||||
let imgUrls = [] as string[];
|
let imgUrls = [];
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
imgUrls.push(item.url)
|
imgUrls.push(item.url)
|
||||||
})
|
})
|
||||||
@@ -55,7 +55,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
}
|
}
|
||||||
if (orderDetail.value.imgUrl) {
|
if (orderDetail.value.imgUrl) {
|
||||||
const res = await ossInfo([orderDetail.value.imgUrl]);
|
const res = await ossInfo([orderDetail.value.imgUrl]);
|
||||||
let imgUrls = [] as string[];
|
let imgUrls = [];
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
imgUrls.push(item.url)
|
imgUrls.push(item.url)
|
||||||
})
|
})
|
||||||
@@ -106,6 +106,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<!-- {{ orderDetail.planCompleTime }}-->
|
<!-- {{ orderDetail.planCompleTime }}-->
|
||||||
<!-- </DescriptionsItem>-->
|
<!-- </DescriptionsItem>-->
|
||||||
|
|
||||||
|
|
||||||
<DescriptionsItem label="备注" :span="2">
|
<DescriptionsItem label="备注" :span="2">
|
||||||
{{ orderDetail.remark }}
|
{{ orderDetail.remark }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
@@ -1,3 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<div class="flex h-full gap-[8px]">
|
||||||
|
<FloorTree class="w-[260px]"></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>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
||||||
import { Page } from '@vben/common-ui'
|
import { Page } from '@vben/common-ui'
|
||||||
@@ -7,9 +116,6 @@ import type { ECharts, EChartsOption } from 'echarts'
|
|||||||
import FloorTree from "../components/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',
|
||||||
yesterdaySamePeriodEnergy: '269.56',
|
yesterdaySamePeriodEnergy: '269.56',
|
||||||
@@ -129,6 +235,7 @@ 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,121 +355,8 @@ 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>
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@@ -4,46 +4,23 @@ 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 initDrawerForm(type: number) {
|
export function initMoalForm(type: number) {
|
||||||
const drawerSchema: FormSchemaGetter = () => [
|
const modalSchema: FormSchemaGetter = () => [
|
||||||
{
|
|
||||||
label: '主键id',
|
|
||||||
fieldName: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
dependencies: {
|
|
||||||
show: () => false,
|
|
||||||
triggerFields: [''],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '仪表名称',
|
label: '仪表名称',
|
||||||
fieldName: 'meterName',
|
fieldName: 'meterName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '楼层',
|
|
||||||
fieldName: 'floorId',
|
|
||||||
component: 'TreeSelect',
|
|
||||||
defaultValue: undefined,
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '安装位置',
|
|
||||||
fieldName: 'installLocation',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '仪表编码',
|
label: '仪表编码',
|
||||||
fieldName: 'meterCode',
|
fieldName: 'meterCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '采集器IP',
|
label: '设备厂商',
|
||||||
fieldName: 'hostIp',
|
fieldName: 'factoryNo',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
||||||
@@ -69,6 +46,11 @@ export function initDrawerForm(type: number) {
|
|||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '安装位置',
|
||||||
|
fieldName: 'installLocation',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '初始读数',
|
label: '初始读数',
|
||||||
fieldName: 'initReading',
|
fieldName: 'initReading',
|
||||||
@@ -88,15 +70,15 @@ export function initDrawerForm(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',
|
||||||
@@ -104,7 +86,7 @@ export function initDrawerForm(type: number) {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
return drawerSchema
|
return modalSchema
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initQuerySchema(type: number) {
|
export function initQuerySchema(type: number) {
|
||||||
@@ -149,10 +131,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',
|
||||||
@@ -173,10 +155,6 @@ export function initColumns(type: number) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '楼层',
|
|
||||||
field: 'floorName',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '安装位置',
|
title: '安装位置',
|
||||||
field: 'installLocation',
|
field: 'installLocation',
|
||||||
@@ -199,16 +177,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',
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from "vue"
|
import { computed, ref } from "vue"
|
||||||
|
|
||||||
import { useVbenDrawer } from "@vben/common-ui"
|
import { useVbenModal } from "@vben/common-ui"
|
||||||
import { $t } from "@vben/locales"
|
import { $t } from "@vben/locales"
|
||||||
import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils'
|
import { cloneDeep } from "@vben/utils"
|
||||||
|
|
||||||
import { useVbenForm } from "#/adapter/form"
|
import { useVbenForm } from "#/adapter/form"
|
||||||
import { communityTree } from '#/api/property/community'
|
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup"
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
meterInfoAdd,
|
meterInfoAdd,
|
||||||
meterInfoInfo,
|
meterInfoInfo,
|
||||||
meterInfoUpdate,
|
meterInfoUpdate,
|
||||||
} from "#/api/property/energyManagement/meterInfo"
|
} from "#/api/property/energyManagement/meterInfo"
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup"
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
meterType: {
|
meterType: {
|
||||||
@@ -23,8 +20,8 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
import { initDrawerForm } from "./data"
|
import { initMoalForm } from "./data"
|
||||||
const drawerSchema = initDrawerForm(props.meterType)
|
const modalSchema = initMoalForm(props.meterType)
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>()
|
const emit = defineEmits<{ reload: [] }>()
|
||||||
const isUpdate = ref(false)
|
const isUpdate = ref(false)
|
||||||
@@ -35,7 +32,7 @@ const title = computed(() => {
|
|||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
formItemClass: "col-span-2",
|
formItemClass: "col-span-1",
|
||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 120,
|
labelWidth: 120,
|
||||||
|
|
||||||
@@ -44,7 +41,7 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
class: "w-full",
|
class: "w-full",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
schema: drawerSchema(),
|
schema: modalSchema(),
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: "grid-cols-2",
|
wrapperClass: "grid-cols-2",
|
||||||
})
|
})
|
||||||
@@ -56,9 +53,9 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenDrawer({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: "w-[600px]",
|
class: "w-[900px]",
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
onClosed: handleClosed,
|
onClosed: handleClosed,
|
||||||
@@ -67,11 +64,11 @@ const [BasicModal, modalApi] = useVbenDrawer({
|
|||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
modalApi.drawerLoading(true)
|
modalApi.modalLoading(true)
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string }
|
const { id } = modalApi.getData() as { id?: number | string }
|
||||||
isUpdate.value = !!id
|
isUpdate.value = !!id
|
||||||
setupCommunitySelect()
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await meterInfoInfo(id)
|
const record = await meterInfoInfo(id)
|
||||||
record.meterType = record.meterType.toString()
|
record.meterType = record.meterType.toString()
|
||||||
@@ -82,7 +79,7 @@ const [BasicModal, modalApi] = useVbenDrawer({
|
|||||||
}
|
}
|
||||||
await markInitialized()
|
await markInitialized()
|
||||||
|
|
||||||
modalApi.drawerLoading(false)
|
modalApi.modalLoading(false)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -110,44 +107,6 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm()
|
await formApi.resetForm()
|
||||||
resetInitialized()
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
@@ -3,7 +3,7 @@ import type { Recordable } from "@vben/types"
|
|||||||
|
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
|
|
||||||
import { Page, useVbenDrawer, 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"
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
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 meterInfoDrawer from "../components/meterInfo-drawer.vue"
|
import meterInfoModal from "../components/meterInfo-modal.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)
|
||||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
gridOptions,
|
gridOptions,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: meterInfoDrawer,
|
connectedComponent: meterInfoModal,
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
@@ -162,6 +162,6 @@ function handleDownloadExcel() {
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="3" />
|
<MeterInfoModal @reload="tableApi.query()" :meterType="3" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -3,7 +3,7 @@ import type { Recordable } from '@vben/types'
|
|||||||
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import { Page, useVbenDrawer, 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'
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
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 meterInfoDrawer from "../components/meterInfo-drawer.vue"
|
import meterInfoModal from "../components/meterInfo-modal.vue"
|
||||||
import { initQuerySchema, initColumns } from "../components/data"
|
import { initQuerySchema, initColumns } from "../components/data"
|
||||||
const columns = initColumns(1)
|
const columns = initColumns(1)
|
||||||
const querySchema = initQuerySchema(1)
|
const querySchema = initQuerySchema(1)
|
||||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
gridOptions,
|
gridOptions,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: meterInfoDrawer,
|
connectedComponent: meterInfoModal,
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
@@ -157,6 +157,6 @@ function handleDownloadExcel() {
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="1" />
|
<MeterInfoModal @reload="tableApi.query()" :meterType="1" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -3,7 +3,7 @@ import type { Recordable } from '@vben/types'
|
|||||||
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import { Page, useVbenDrawer, 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'
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
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 meterInfoDrawer from "../components/meterInfo-drawer.vue"
|
import meterInfoModal from "../components/meterInfo-modal.vue"
|
||||||
import { initQuerySchema, initColumns } from "../components/data"
|
import { initQuerySchema, initColumns } from "../components/data"
|
||||||
const columns = initColumns(2)
|
const columns = initColumns(2)
|
||||||
const querySchema = initQuerySchema(2)
|
const querySchema = initQuerySchema(2)
|
||||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
gridOptions,
|
gridOptions,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: meterInfoDrawer,
|
connectedComponent: meterInfoModal,
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
@@ -157,6 +157,6 @@ function handleDownloadExcel() {
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="2" />
|
<MeterInfoModal @reload="tableApi.query()" :meterType="2" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -1,157 +0,0 @@
|
|||||||
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',
|
|
||||||
// },
|
|
||||||
]
|
|
@@ -1,170 +0,0 @@
|
|||||||
<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 {
|
|
||||||
meterRecordExport,
|
|
||||||
meterRecordList,
|
|
||||||
meterRecordRemove,
|
|
||||||
} from '#/api/property/energyManagement/meterRecord';
|
|
||||||
|
|
||||||
import type { MeterRecordForm } from '#/api/property/energyManagement/meterRecord/model';
|
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
|
||||||
|
|
||||||
import meterRecordDrawer from './meterRecord-drawer.vue';
|
|
||||||
import { columns, querySchema } from './data';
|
|
||||||
|
|
||||||
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 meterRecordList({
|
|
||||||
pageNum: page.currentPage,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
...formValues,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rowConfig: {
|
|
||||||
keyField: 'id',
|
|
||||||
},
|
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-meterRecord-index'
|
|
||||||
};
|
|
||||||
|
|
||||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
|
||||||
formOptions,
|
|
||||||
gridOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [MeterRecordDrawer, drawerApi] = useVbenDrawer({
|
|
||||||
connectedComponent: meterRecordDrawer,
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleAdd() {
|
|
||||||
drawerApi.setData({});
|
|
||||||
drawerApi.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleEdit(row: Required<MeterRecordForm>) {
|
|
||||||
drawerApi.setData({ id: row.id });
|
|
||||||
drawerApi.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleDelete(row: Required<MeterRecordForm>) {
|
|
||||||
await meterRecordRemove(row.id);
|
|
||||||
await tableApi.query();
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleMultiDelete() {
|
|
||||||
const rows = tableApi.grid.getCheckboxRecords();
|
|
||||||
const ids = rows.map((row: Required<MeterRecordForm>) => row.id);
|
|
||||||
Modal.confirm({
|
|
||||||
title: '提示',
|
|
||||||
okType: 'danger',
|
|
||||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
|
||||||
onOk: async () => {
|
|
||||||
await meterRecordRemove(ids);
|
|
||||||
await tableApi.query();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleDownloadExcel() {
|
|
||||||
commonDownloadExcel(meterRecordExport, '抄表记录数据', tableApi.formApi.form.values, {
|
|
||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Page :auto-content-height="true">
|
|
||||||
<BasicTable table-title="抄表记录列表">
|
|
||||||
<template #toolbar-tools>
|
|
||||||
<Space>
|
|
||||||
<a-button
|
|
||||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
|
||||||
danger
|
|
||||||
type="primary"
|
|
||||||
v-access:code="['property:meterRecord:remove']"
|
|
||||||
@click="handleMultiDelete">
|
|
||||||
{{ $t('pages.common.delete') }}
|
|
||||||
</a-button>
|
|
||||||
</Space>
|
|
||||||
</template>
|
|
||||||
<template #action="{ row }">
|
|
||||||
<Space>
|
|
||||||
<ghost-button
|
|
||||||
v-access:code="['property:meterRecord: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:meterRecord:remove']"
|
|
||||||
@click.stop=""
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.delete') }}
|
|
||||||
</ghost-button>
|
|
||||||
</Popconfirm>
|
|
||||||
</Space>
|
|
||||||
</template>
|
|
||||||
</BasicTable>
|
|
||||||
<MeterRecordDrawer @reload="tableApi.query()" />
|
|
||||||
</Page>
|
|
||||||
</template>
|
|
@@ -1,101 +0,0 @@
|
|||||||
<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>
|
|
||||||
|
|
@@ -13,11 +13,6 @@
|
|||||||
placeholder="请选择类型"
|
placeholder="请选择类型"
|
||||||
style="width: 150px;"
|
style="width: 150px;"
|
||||||
>
|
>
|
||||||
<SelectOption
|
|
||||||
key="all"
|
|
||||||
value="all">
|
|
||||||
全部类型
|
|
||||||
</SelectOption>
|
|
||||||
<SelectOption
|
<SelectOption
|
||||||
v-for="item in getDictOptions('meeting_room_type')"
|
v-for="item in getDictOptions('meeting_room_type')"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -25,7 +20,6 @@
|
|||||||
>
|
>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</SelectOption>
|
</SelectOption>
|
||||||
|
|
||||||
</Select>
|
</Select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="会议日期">
|
<a-form-item label="会议日期">
|
||||||
@@ -119,7 +113,7 @@ async function handleSearch() {
|
|||||||
openStartHours: openStartHours??undefined,
|
openStartHours: openStartHours??undefined,
|
||||||
openEndHours:openEndHours??undefined,
|
openEndHours:openEndHours??undefined,
|
||||||
appointmentTime:formState.appointmentTime?formState.appointmentTime.format('YYYY-MM-DD'):undefined,
|
appointmentTime:formState.appointmentTime?formState.appointmentTime.format('YYYY-MM-DD'):undefined,
|
||||||
meetingRoomType:formState.meetingRoomType=='all'?undefined:formState.meetingRoomType,
|
meetingRoomType:formState.meetingRoomType
|
||||||
}
|
}
|
||||||
meetingList.value =await notlist(obj);
|
meetingList.value =await notlist(obj);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user