Compare commits
16 Commits
66b7cc44e9
...
master
Author | SHA1 | Date | |
---|---|---|---|
e8d2650f9a | |||
5646112e44 | |||
82e971d98f | |||
d6da044b48 | |||
8c062feef0 | |||
bc59c2c22f | |||
90eceb508a | |||
f794f6a8a9 | |||
6cc969e56a | |||
6ca27444e0 | |||
2f2f8fb798 | |||
1de539ddde | |||
67b80d7687 | |||
b44fa6ee7f | |||
559bd55153 | |||
cc24027880 |
@@ -2,13 +2,15 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- prod
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- name: 拉取代码仓库
|
||||
uses: http://git.missmoc.top/mocheng/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1 # 只拉取最新的1个提交(浅克隆)
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: http://git.missmoc.top/mocheng/setup-node@v3
|
||||
|
@@ -1,65 +1,65 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type { PageQuery, BaseEntity } from '#/api/common'
|
||||
|
||||
export interface MeterInfoVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
id: string | number
|
||||
|
||||
/**
|
||||
* 仪表名称
|
||||
*/
|
||||
meterName: string;
|
||||
meterName: string
|
||||
|
||||
/**
|
||||
* 仪表编码
|
||||
*/
|
||||
meterCode: string;
|
||||
meterCode: string
|
||||
|
||||
/**
|
||||
* 设备厂商
|
||||
*/
|
||||
factoryNo: string;
|
||||
factoryNo: string
|
||||
|
||||
/**
|
||||
* 设备类型(1-电表,2-水表,3-气表)
|
||||
*/
|
||||
meterType: number;
|
||||
meterType: number | String
|
||||
|
||||
/**
|
||||
* 计量单位(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?: string | number;
|
||||
id?: string | number
|
||||
|
||||
/**
|
||||
* 仪表名称
|
||||
*/
|
||||
meterName?: string;
|
||||
meterName?: string
|
||||
|
||||
/**
|
||||
* 仪表编码
|
||||
*/
|
||||
meterCode?: string;
|
||||
meterCode?: string
|
||||
|
||||
/**
|
||||
* 设备厂商
|
||||
*/
|
||||
factoryNo?: string;
|
||||
factoryNo?: string
|
||||
|
||||
/**
|
||||
* 设备类型(1-电表,2-水表,3-气表)
|
||||
*/
|
||||
meterType?: number;
|
||||
meterType?: number
|
||||
|
||||
/**
|
||||
* 计量单位(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-气表)
|
||||
*/
|
||||
meterType?: number;
|
||||
meterType?: number
|
||||
|
||||
/**
|
||||
* 计量单位(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
|
||||
}
|
||||
|
@@ -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}`);
|
||||
}
|
149
apps/web-antd/src/api/property/energyManagement/meterRecord/model.d.ts
vendored
Normal file
149
apps/web-antd/src/api/property/energyManagement/meterRecord/model.d.ts
vendored
Normal 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
|
||||
}
|
@@ -35,6 +35,7 @@ export interface Resident_unitVO {
|
||||
* 入驻位置
|
||||
*/
|
||||
location: string;
|
||||
locations: string[];
|
||||
|
||||
/**
|
||||
* 入驻时间
|
||||
|
@@ -84,13 +84,13 @@ const menus = computed(() => {
|
||||
// icon: CircleHelp,
|
||||
// text: $t('ui.widgets.qa'),
|
||||
// },
|
||||
{
|
||||
handler: () => {
|
||||
router.push('/navigation');
|
||||
},
|
||||
// icon: TagOutlined,
|
||||
text: '返回导航',
|
||||
},
|
||||
// {
|
||||
// handler: () => {
|
||||
// router.push('/navigation');
|
||||
// },
|
||||
// // icon: TagOutlined,
|
||||
// text: '返回导航',
|
||||
// },
|
||||
];
|
||||
/**
|
||||
* 租户选中状态 不显示个人中心
|
||||
|
@@ -56,9 +56,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
if (accessStore.loginExpired) {
|
||||
accessStore.setLoginExpired(false);
|
||||
} else {
|
||||
onSuccess
|
||||
? await onSuccess?.()
|
||||
: await router.push('/navigation');
|
||||
onSuccess ? await onSuccess?.() : await router.push('/analytics');
|
||||
}
|
||||
|
||||
if (userInfo?.realName) {
|
||||
|
@@ -26,7 +26,7 @@ onMounted(() => {
|
||||
{ name: '搜索引擎', value: 1048 },
|
||||
{ name: '直接访问', value: 735 },
|
||||
{ name: '邮件营销', value: 580 },
|
||||
{ name: '联盟广告', value: 484 },
|
||||
// { name: '联盟广告', value: 484 },
|
||||
],
|
||||
emphasis: {
|
||||
label: {
|
||||
|
@@ -25,29 +25,29 @@ const overviewItems: AnalysisOverviewItem[] = [
|
||||
icon: SvgCardIcon,
|
||||
title: '用户量',
|
||||
totalTitle: '总用户量',
|
||||
totalValue: 120_000,
|
||||
value: 2000,
|
||||
totalValue: 78,
|
||||
value: 15,
|
||||
},
|
||||
{
|
||||
icon: SvgCakeIcon,
|
||||
title: '访问量',
|
||||
totalTitle: '总访问量',
|
||||
totalValue: 500_000,
|
||||
value: 20_000,
|
||||
totalValue: 2_278,
|
||||
value: 461,
|
||||
},
|
||||
{
|
||||
icon: SvgDownloadIcon,
|
||||
title: '下载量',
|
||||
totalTitle: '总下载量',
|
||||
totalValue: 120_000,
|
||||
value: 8000,
|
||||
totalValue: 17,
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
icon: SvgBellIcon,
|
||||
title: '使用量',
|
||||
totalTitle: '总使用量',
|
||||
totalValue: 50_000,
|
||||
value: 5000,
|
||||
totalValue: 6_652,
|
||||
value: 3_739,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -2,8 +2,6 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {h} from "vue";
|
||||
import {Rate} from "ant-design-vue";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -96,34 +94,34 @@ export const columns: VxeGridProps['columns'] = [
|
||||
// field: 'planCompleTime',
|
||||
// width: 100,
|
||||
// },
|
||||
{
|
||||
title: '完成时间',
|
||||
field: 'compleTime',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '评价',
|
||||
field: 'serviceEvalua',
|
||||
width: 180,
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return h(Rate, {
|
||||
value: row.serviceEvalua || 0,
|
||||
disabled: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否超时',
|
||||
field: 'isTimeOut',
|
||||
width: 100,
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '完成时间',
|
||||
// field: 'compleTime',
|
||||
// width: 100,
|
||||
// },
|
||||
// {
|
||||
// title: '评价',
|
||||
// field: 'serviceEvalua',
|
||||
// width: 180,
|
||||
// slots: {
|
||||
// default: ({row}) => {
|
||||
// return h(Rate, {
|
||||
// value: row.serviceEvalua || 0,
|
||||
// disabled: true,
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: '是否超时',
|
||||
// field: 'isTimeOut',
|
||||
// width: 100,
|
||||
// slots: {
|
||||
// default: ({row}) => {
|
||||
// return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
|
@@ -47,7 +47,7 @@ async function handleOpenChange(open: boolean) {
|
||||
try {
|
||||
if (orderDetail.value.orderImgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.orderImgUrl]);
|
||||
let imgUrls = [];
|
||||
let imgUrls = [] as string[];
|
||||
res.forEach(item => {
|
||||
imgUrls.push(item.url)
|
||||
})
|
||||
@@ -55,7 +55,7 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
if (orderDetail.value.imgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.imgUrl]);
|
||||
let imgUrls = [];
|
||||
let imgUrls = [] as string[];
|
||||
res.forEach(item => {
|
||||
imgUrls.push(item.url)
|
||||
})
|
||||
@@ -106,7 +106,6 @@ async function handleOpenChange(open: boolean) {
|
||||
<!-- {{ orderDetail.planCompleTime }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
|
||||
|
||||
<DescriptionsItem label="备注" :span="2">
|
||||
{{ orderDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
|
@@ -35,7 +35,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '抄表类型',
|
||||
field: 'meterTypeId',
|
||||
field: 'costTypeName',
|
||||
},
|
||||
{
|
||||
title: '本期度数',
|
||||
|
@@ -33,8 +33,13 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '房屋',
|
||||
field: 'roomNumber',
|
||||
title: '费用类型',
|
||||
field: 'costType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.costType, 'pro_expense_type');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '费用项目',
|
||||
|
@@ -36,7 +36,7 @@ async function handleOpenChange(open: boolean) {
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="缴费审核详情" class="w-[70%]">
|
||||
<Descriptions v-if="paymentReviewDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="房屋">
|
||||
<DescriptionsItem label="房屋" v-if="paymentReviewDetail.roomNumber">
|
||||
{{ paymentReviewDetail.roomNumber }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="费用项目">
|
||||
|
@@ -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>
|
||||
|
@@ -156,3 +156,27 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
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',
|
||||
}
|
||||
];
|
||||
|
@@ -18,6 +18,7 @@ import type { ContingenPlanForm } from '#/api/property/customerService/contingen
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import contingenPlanModal from './contingenPlan-modal.vue';
|
||||
import contingenPlanExamine from './contingenPlan-examine.vue';
|
||||
import contingenPlanDetail from './contingenPlan-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
@@ -96,10 +97,13 @@ async function handleDelete(row: Required<ContingenPlanForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
const [ContingenPlanExamine, contingenPlanExamineApi] = useVbenModal({
|
||||
connectedComponent: contingenPlanExamine,
|
||||
});
|
||||
|
||||
async function handleExamine(row: Required<ContingenPlanForm>) {
|
||||
row.status = '1'
|
||||
await contingenPlanUpdate(row);
|
||||
await tableApi.query();
|
||||
contingenPlanExamineApi.setData({ id: row.id });
|
||||
contingenPlanExamineApi.open();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
@@ -183,19 +187,12 @@ onMounted(async () => {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<Popconfirm
|
||||
<ghost-button
|
||||
v-if="row.status === '0'"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认审核?"
|
||||
@confirm="handleExamine(row)"
|
||||
@click.stop="handleExamine(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
@@ -227,5 +224,6 @@ onMounted(async () => {
|
||||
</BasicTable>
|
||||
<ContingenPlanModal @reload="tableApi.query()" />
|
||||
<contingenPlanDetailModal/>
|
||||
<ContingenPlanExamine @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -1,112 +1,3 @@
|
||||
<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">
|
||||
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
||||
import { Page } from '@vben/common-ui'
|
||||
@@ -116,6 +7,9 @@ import type { ECharts, EChartsOption } from 'echarts'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
import dayjs from "dayjs"
|
||||
|
||||
// 左边楼层用
|
||||
const selectFloorId = ref<string[]>([])
|
||||
|
||||
const chainData = reactive({
|
||||
todayEnergy: '231.78',
|
||||
yesterdaySamePeriodEnergy: '269.56',
|
||||
@@ -235,7 +129,6 @@ function buildingEnergyTrendData(val: string) {
|
||||
const powerCurveChart = ref<HTMLElement | null>(null)
|
||||
const powerCurveInstance = ref<ECharts | null>(null)
|
||||
|
||||
|
||||
const powerCurveOption: EChartsOption = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@@ -355,8 +248,121 @@ onBeforeUnmount(() => {
|
||||
energyTrendInstance.value?.dispose()
|
||||
powerCurveInstance.value?.dispose()
|
||||
})
|
||||
|
||||
function handleSelectFloor() {
|
||||
console.log(selectFloorId.value[0])
|
||||
}
|
||||
</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>
|
||||
.row {
|
||||
display: flex;
|
||||
|
@@ -4,8 +4,17 @@ import type { VxeGridProps } from '#/adapter/vxe-table'
|
||||
import { getDictOptions } from '#/utils/dict'
|
||||
import { renderDict } from '#/utils/render'
|
||||
|
||||
export function initMoalForm(type: number) {
|
||||
const modalSchema: FormSchemaGetter = () => [
|
||||
export function initDrawerForm(type: number) {
|
||||
const drawerSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '仪表名称',
|
||||
fieldName: 'meterName',
|
||||
@@ -13,14 +22,28 @@ export function initMoalForm(type: number) {
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '仪表编码',
|
||||
fieldName: 'meterCode',
|
||||
label: '楼层',
|
||||
fieldName: 'floorId',
|
||||
component: 'TreeSelect',
|
||||
defaultValue: undefined,
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '安装位置',
|
||||
fieldName: 'installLocation',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备厂商',
|
||||
fieldName: 'factoryNo',
|
||||
label: '仪表编码',
|
||||
fieldName: 'meterCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '采集器IP',
|
||||
fieldName: 'hostIp',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
||||
@@ -46,11 +69,6 @@ export function initMoalForm(type: number) {
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '安装位置',
|
||||
fieldName: 'installLocation',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '初始读数',
|
||||
fieldName: 'initReading',
|
||||
@@ -70,15 +88,15 @@ export function initMoalForm(type: number) {
|
||||
options: getDictOptions('sis_device_status'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '运行状态',
|
||||
fieldName: 'runningState',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
options: getDictOptions('sis_device_status'),
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '运行状态',
|
||||
// fieldName: 'runningState',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
// options: getDictOptions('sis_device_status'),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
@@ -86,7 +104,7 @@ export function initMoalForm(type: number) {
|
||||
},
|
||||
]
|
||||
|
||||
return modalSchema
|
||||
return drawerSchema
|
||||
}
|
||||
|
||||
export function initQuerySchema(type: number) {
|
||||
@@ -131,10 +149,10 @@ export function initColumns(type: number) {
|
||||
title: '仪表编码',
|
||||
field: 'meterCode',
|
||||
},
|
||||
{
|
||||
title: '设备厂商',
|
||||
field: 'factoryNo',
|
||||
},
|
||||
// {
|
||||
// title: '设备厂商',
|
||||
// field: 'factoryNo',
|
||||
// },
|
||||
{
|
||||
title: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
||||
field: 'meterType',
|
||||
@@ -155,6 +173,10 @@ export function initColumns(type: number) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
field: 'floorName',
|
||||
},
|
||||
{
|
||||
title: '安装位置',
|
||||
field: 'installLocation',
|
||||
@@ -177,16 +199,16 @@ export function initColumns(type: number) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '运行状态',
|
||||
field: 'runningState',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
return renderDict(row.runningState, 'sis_device_status')
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '运行状态',
|
||||
// field: 'runningState',
|
||||
// slots: {
|
||||
// default: ({ row }) => {
|
||||
// // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
// return renderDict(row.runningState, 'sis_device_status')
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
|
@@ -1,17 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue"
|
||||
|
||||
import { useVbenModal } from "@vben/common-ui"
|
||||
import { useVbenDrawer } from "@vben/common-ui"
|
||||
import { $t } from "@vben/locales"
|
||||
import { cloneDeep } from "@vben/utils"
|
||||
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"
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup"
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
meterType: {
|
||||
@@ -20,8 +23,8 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
import { initMoalForm } from "./data"
|
||||
const modalSchema = initMoalForm(props.meterType)
|
||||
import { initDrawerForm } from "./data"
|
||||
const drawerSchema = initDrawerForm(props.meterType)
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>()
|
||||
const isUpdate = ref(false)
|
||||
@@ -32,7 +35,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: "col-span-1",
|
||||
formItemClass: "col-span-2",
|
||||
// 默认label宽度 px
|
||||
labelWidth: 120,
|
||||
|
||||
@@ -41,7 +44,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
class: "w-full",
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
schema: drawerSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: "grid-cols-2",
|
||||
})
|
||||
@@ -53,9 +56,9 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
}
|
||||
)
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
const [BasicModal, modalApi] = useVbenDrawer({
|
||||
// 在这里更改宽度
|
||||
class: "w-[900px]",
|
||||
class: "w-[600px]",
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -64,11 +67,11 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return null
|
||||
}
|
||||
modalApi.modalLoading(true)
|
||||
|
||||
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()
|
||||
@@ -79,7 +82,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
}
|
||||
await markInitialized()
|
||||
|
||||
modalApi.modalLoading(false)
|
||||
modalApi.drawerLoading(false)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -107,6 +110,44 @@ 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>
|
@@ -3,7 +3,7 @@ import type { Recordable } from "@vben/types"
|
||||
|
||||
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 { Modal, Popconfirm, Space } from "ant-design-vue"
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import type { MeterInfoForm } from "#/api/property/meterInfo/model"
|
||||
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"
|
||||
const columns = initColumns(3)
|
||||
const querySchema = initQuerySchema(3)
|
||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
||||
connectedComponent: meterInfoDrawer,
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
@@ -162,6 +162,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MeterInfoModal @reload="tableApi.query()" :meterType="3" />
|
||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="3" />
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -3,7 +3,7 @@ import type { Recordable } from '@vben/types'
|
||||
|
||||
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 { Modal, Popconfirm, Space } from 'ant-design-vue'
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model'
|
||||
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"
|
||||
const columns = initColumns(1)
|
||||
const querySchema = initQuerySchema(1)
|
||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
||||
connectedComponent: meterInfoDrawer,
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
@@ -157,6 +157,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MeterInfoModal @reload="tableApi.query()" :meterType="1" />
|
||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="1" />
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -3,7 +3,7 @@ import type { Recordable } from '@vben/types'
|
||||
|
||||
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 { Modal, Popconfirm, Space } from 'ant-design-vue'
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model'
|
||||
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"
|
||||
const columns = initColumns(2)
|
||||
const querySchema = initQuerySchema(2)
|
||||
@@ -86,8 +86,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
const [MeterInfoDrawer, modalApi] = useVbenDrawer({
|
||||
connectedComponent: meterInfoDrawer,
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
@@ -157,6 +157,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MeterInfoModal @reload="tableApi.query()" :meterType="2" />
|
||||
<MeterInfoDrawer @reload="tableApi.query()" :meterType="2" />
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -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',
|
||||
// },
|
||||
]
|
@@ -0,0 +1,170 @@
|
||||
<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>
|
@@ -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>
|
||||
|
@@ -157,7 +157,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '入驻位置',
|
||||
fieldName: 'location',
|
||||
fieldName: 'locations',
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2'
|
||||
|
@@ -64,7 +64,11 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
await initLocationOptions();
|
||||
if (isUpdate.value && id) {
|
||||
const record = await resident_unitInfo(id);
|
||||
await formApi.setValues({...record,authTime:[record.authBegDate,record.authEndDate]});
|
||||
let roomIds=record.location.split(',')
|
||||
await formApi.setValues({...record,
|
||||
authTime:[record.authBegDate,record.authEndDate],
|
||||
locations:roomIds
|
||||
});
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
@@ -84,7 +88,7 @@ async function handleConfirm() {
|
||||
|
||||
data.authBegDate = data.authTime[0];
|
||||
data.authEndDate = data.authTime[1];
|
||||
|
||||
data.location=data.locations.join(',')
|
||||
await (isUpdate.value ? resident_unitUpdate(data) : resident_unitAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -125,8 +129,9 @@ async function initLocationOptions() {
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
multiple:true
|
||||
}),
|
||||
fieldName: 'location',
|
||||
fieldName: 'locations',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
@@ -43,16 +43,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'unitName',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '预定人',
|
||||
field: 'personName',
|
||||
minWidth:'120'
|
||||
},
|
||||
{
|
||||
title: '联系方式',
|
||||
field: 'phone',
|
||||
minWidth:'120'
|
||||
},
|
||||
// {
|
||||
// title: '预定人',
|
||||
// field: 'personName',
|
||||
// minWidth:'120'
|
||||
// },
|
||||
// {
|
||||
// title: '联系方式',
|
||||
// field: 'phone',
|
||||
// minWidth:'120'
|
||||
// },
|
||||
// {
|
||||
// title: '预定时间',
|
||||
// field: 'scheduledStarttime',
|
||||
@@ -64,7 +64,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '预定时间',
|
||||
field: 'scheduledStarttime',
|
||||
minWidth: '180',
|
||||
minWidth: '200',
|
||||
formatter: ({ row }) => {
|
||||
const start = row.scheduledStarttime;
|
||||
const end = row.scheduledEndtime;
|
||||
|
@@ -10,9 +10,14 @@
|
||||
<Select
|
||||
v-model:value="formState.meetingRoomType"
|
||||
class="room-select"
|
||||
placeholder="请选择会议室类型"
|
||||
style="width: 180px;"
|
||||
placeholder="请选择类型"
|
||||
style="width: 150px;"
|
||||
>
|
||||
<SelectOption
|
||||
key="all"
|
||||
value="all">
|
||||
全部类型
|
||||
</SelectOption>
|
||||
<SelectOption
|
||||
v-for="item in getDictOptions('meeting_room_type')"
|
||||
:key="item.value"
|
||||
@@ -20,17 +25,18 @@
|
||||
>
|
||||
{{ item.label }}
|
||||
</SelectOption>
|
||||
|
||||
</Select>
|
||||
</a-form-item>
|
||||
<a-form-item label="会议日期">
|
||||
<DatePicker v-model:value="formState.appointmentTime" style="width: 180px;"/>
|
||||
<DatePicker v-model:value="formState.appointmentTime" style="width: 130px;"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="会议时段">
|
||||
<TimeRangePicker style="width: 200px;" format="HH:mm"
|
||||
<TimeRangePicker style="width: 190px;" format="HH:mm"
|
||||
v-model:value="formState.openHours"></TimeRangePicker>
|
||||
</a-form-item>
|
||||
<a-form-item label="参会人数">
|
||||
<InputNumber style="width: 150px;" placeholder="请输入参会人数"
|
||||
<InputNumber style="width: 120px;" placeholder="请输入人数"
|
||||
v-model:value="formState.personNumber"/>
|
||||
</a-form-item>
|
||||
<a-form-item >
|
||||
@@ -113,7 +119,7 @@ async function handleSearch() {
|
||||
openStartHours: openStartHours??undefined,
|
||||
openEndHours:openEndHours??undefined,
|
||||
appointmentTime:formState.appointmentTime?formState.appointmentTime.format('YYYY-MM-DD'):undefined,
|
||||
meetingRoomType:formState.meetingRoomType
|
||||
meetingRoomType:formState.meetingRoomType=='all'?undefined:formState.meetingRoomType,
|
||||
}
|
||||
meetingList.value =await notlist(obj);
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'meetingRoomType',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.meetingRoomType, 'meeting_room_type');
|
||||
return row.meetingRoomType!=null?renderDict(row.meetingRoomType, 'meeting_room_type'):'';
|
||||
},
|
||||
},
|
||||
minWidth:100,
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -87,6 +88,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '事由',
|
||||
field: 'visitingReason',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.visitingReason, 'reason_for_visit');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '拜访时间',
|
||||
|
@@ -36,17 +36,17 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =
|
||||
usePreferences();
|
||||
</script> -->
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useAuthStore } from '../../../../../apps/web-antd/src/store'
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useAuthStore } from '../../../../../apps/web-antd/src/store';
|
||||
import { Checkbox } from 'ant-design-vue';
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
// 响应式数据
|
||||
const username = ref('')
|
||||
const password = ref('')
|
||||
const rememberMe = ref(false)
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const rememberMe = ref(false);
|
||||
|
||||
// 页面加载时恢复用户名
|
||||
onMounted(() => {
|
||||
@@ -58,55 +58,59 @@ onMounted(() => {
|
||||
});
|
||||
function getRetUrlParam() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
console.log('urlParams', urlParams);
|
||||
return urlParams.get('returl');
|
||||
}
|
||||
const retUrl : string | null = getRetUrlParam();
|
||||
const retUrl: string | null = getRetUrlParam();
|
||||
|
||||
// 登录逻辑
|
||||
const login = () => {
|
||||
// 验证输入
|
||||
if (!username.value.trim()) {
|
||||
alert('请输入用户名')
|
||||
return
|
||||
alert('请输入用户名');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!password.value.trim()) {
|
||||
alert('请输入密码')
|
||||
return
|
||||
alert('请输入密码');
|
||||
return;
|
||||
}
|
||||
|
||||
// 模拟登录请求
|
||||
console.log('正在登录...', { username: username.value, password: password.value })
|
||||
console.log('正在登录...', {
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
alert('登录成功!')
|
||||
alert('登录成功!');
|
||||
|
||||
// 存储用户名
|
||||
if (rememberMe.value) {
|
||||
localStorage.setItem('rememberedUser', username.value)
|
||||
localStorage.setItem('rememberedUser', username.value);
|
||||
} else {
|
||||
localStorage.removeItem('rememberedUser')
|
||||
localStorage.removeItem('rememberedUser');
|
||||
}
|
||||
|
||||
// 跳转页面
|
||||
router.push('/navigation')
|
||||
}, 800)
|
||||
}
|
||||
router.push('/navigation');
|
||||
}, 800);
|
||||
};
|
||||
const handleAccountLogin = async () => {
|
||||
try {
|
||||
// const requestParam: any = omit(values, ['code']);
|
||||
// 登录
|
||||
await authStore.authLogin({
|
||||
grantType: "password",
|
||||
grantType: 'password',
|
||||
password: password.value,
|
||||
tenantId: "000000",
|
||||
tenantId: '000000',
|
||||
username: username.value,
|
||||
retUrl: retUrl,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -122,22 +126,30 @@ const handleAccountLogin = async () => {
|
||||
<h3>用户登录</h3>
|
||||
<!-- 用户名输入 -->
|
||||
<div class="input-group">
|
||||
<img src="../../../../../apps/web-antd/src/assets/my.png" alt="User Icon" class="input-icon">
|
||||
<img
|
||||
src="../../../../../apps/web-antd/src/assets/my.png"
|
||||
alt="User Icon"
|
||||
class="input-icon"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入您的用户名"
|
||||
v-model="username"
|
||||
type="text"
|
||||
placeholder="请输入您的用户名"
|
||||
v-model="username"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 密码输入 -->
|
||||
<div class="input-group">
|
||||
<img src="../../../../../apps/web-antd/src/assets/mima.png" alt="Password Icon" class="input-icon">
|
||||
<img
|
||||
src="../../../../../apps/web-antd/src/assets/mima.png"
|
||||
alt="Password Icon"
|
||||
class="input-icon"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="请输入您的密码"
|
||||
v-model="password"
|
||||
@keyup.enter="handleAccountLogin"
|
||||
type="password"
|
||||
placeholder="请输入您的密码"
|
||||
v-model="password"
|
||||
@keyup.enter="handleAccountLogin"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -158,13 +170,13 @@ const handleAccountLogin = async () => {
|
||||
class="flex min-h-full flex-1 select-none overflow-x-hidden"
|
||||
style="display: none;"
|
||||
> -->
|
||||
<!--<template v-if="toolbar">
|
||||
<!--<template v-if="toolbar">
|
||||
<slot name="toolbar">
|
||||
<Toolbar :toolbar-list="toolbarList" />
|
||||
</slot>
|
||||
</template>-->
|
||||
<!-- 左侧认证面板 -->
|
||||
<!--<AuthenticationFormView
|
||||
<!-- 左侧认证面板 -->
|
||||
<!--<AuthenticationFormView
|
||||
v-if="authPanelLeft"
|
||||
class="min-h-full w-2/5 flex-1"
|
||||
transition-name="slide-left"
|
||||
@@ -179,8 +191,8 @@ const handleAccountLogin = async () => {
|
||||
</template>
|
||||
</AuthenticationFormView>-->
|
||||
|
||||
<!-- 头部 Logo 和应用名称 -->
|
||||
<!--<div
|
||||
<!-- 头部 Logo 和应用名称 -->
|
||||
<!--<div
|
||||
v-if="logo || appName"
|
||||
class="absolute left-0 top-0 z-10 flex flex-1"
|
||||
@click="clickLogo"
|
||||
@@ -195,8 +207,8 @@ const handleAccountLogin = async () => {
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!-- 系统介绍 -->
|
||||
<!--<div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
|
||||
<!-- 系统介绍 -->
|
||||
<!--<div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
|
||||
<div
|
||||
class="bg-background-deep absolute inset-0 h-full w-full dark:bg-[#070709]"
|
||||
>
|
||||
@@ -220,8 +232,8 @@ const handleAccountLogin = async () => {
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!-- 中心认证面板 -->
|
||||
<!--<div v-if="authPanelCenter" class="flex-center relative w-full">
|
||||
<!-- 中心认证面板 -->
|
||||
<!--<div v-if="authPanelCenter" class="flex-center relative w-full">
|
||||
<div class="login-background absolute left-0 top-0 size-full"></div>
|
||||
<AuthenticationFormView
|
||||
class="md:bg-background shadow-primary/5 shadow-float w-full rounded-3xl pb-20 md:w-2/3 lg:w-1/2 xl:w-[36%]"
|
||||
@@ -237,8 +249,8 @@ const handleAccountLogin = async () => {
|
||||
</AuthenticationFormView>
|
||||
</div>-->
|
||||
|
||||
<!-- 右侧认证面板 -->
|
||||
<!--<AuthenticationFormView
|
||||
<!-- 右侧认证面板 -->
|
||||
<!--<AuthenticationFormView
|
||||
v-if="authPanelRight"
|
||||
class="min-h-full w-[34%] flex-1"
|
||||
>
|
||||
@@ -280,7 +292,8 @@ const handleAccountLogin = async () => {
|
||||
<style scoped>
|
||||
@font-face {
|
||||
font-family: 'BaiduVariety';
|
||||
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf') format('truetype');
|
||||
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf')
|
||||
format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@@ -293,36 +306,38 @@ const handleAccountLogin = async () => {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background:
|
||||
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */
|
||||
url('../../../../../apps/web-antd/src/assets/222.png') no-repeat center center fixed;
|
||||
background-size: 100% 100%, 100% 100%;
|
||||
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */ url('../../../../../apps/web-antd/src/assets/222.png')
|
||||
no-repeat center center fixed;
|
||||
background-size:
|
||||
100% 100%,
|
||||
100% 100%;
|
||||
/* background-repeat: no-repeat, no-repeat;
|
||||
background-position: center center, center center; */
|
||||
color: #fff;
|
||||
}
|
||||
.login-wapter{
|
||||
.login-wapter {
|
||||
position: relative;
|
||||
top: -115px; /* 负值越大,越往上 */
|
||||
.login-wapter1 {
|
||||
font-size: 44px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.login-wapter2 {
|
||||
font-size: 60px;
|
||||
/* margin-bottom: 38px; */
|
||||
background: linear-gradient(to bottom, #ffffff, #cbeaff);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-family: 'BaiduVariety',sans-serif;
|
||||
letter-spacing: 6px;
|
||||
}
|
||||
font-size: 44px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.login-wapter2 {
|
||||
font-size: 60px;
|
||||
/* margin-bottom: 38px; */
|
||||
background: linear-gradient(to bottom, #ffffff, #cbeaff);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-family: 'BaiduVariety', sans-serif;
|
||||
letter-spacing: 6px;
|
||||
}
|
||||
}
|
||||
.login-bg_1 {
|
||||
flex-direction: column;
|
||||
@@ -335,7 +350,8 @@ const handleAccountLogin = async () => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat center center fixed;
|
||||
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat
|
||||
center center fixed;
|
||||
}
|
||||
.login-form {
|
||||
border-radius: 10px;
|
||||
@@ -380,8 +396,8 @@ input:-webkit-autofill {
|
||||
margin-top: 20px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: #19DCF8;
|
||||
color: #0254A5;
|
||||
background-color: #19dcf8;
|
||||
color: #0254a5;
|
||||
cursor: pointer;
|
||||
font-size: 22px;
|
||||
margin-top: 70px;
|
||||
@@ -401,8 +417,6 @@ input:-webkit-autofill {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 新增 .input-group 样式 */
|
||||
.input-group {
|
||||
display: flex;
|
||||
@@ -433,7 +447,7 @@ input:-webkit-autofill {
|
||||
.login-form input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.42); /* 例如灰色 */
|
||||
}
|
||||
.login-footer{
|
||||
.login-footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
@@ -11,7 +11,7 @@ import {
|
||||
LanguageToggle,
|
||||
PreferencesButton,
|
||||
ThemeToggle,
|
||||
BackNavigation,
|
||||
// BackNavigation,
|
||||
} from '../../widgets';
|
||||
|
||||
interface Props {
|
||||
@@ -44,8 +44,7 @@ const rightSlots = computed(() => {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE,
|
||||
name: 'global-search',
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (preferencesButtonPosition.value.header) {
|
||||
@@ -172,9 +171,9 @@ function clearPreferencesAndLogout() {
|
||||
<template v-else-if="slot.name === 'fullscreen'">
|
||||
<VbenFullScreen class="mr-1" />
|
||||
</template>
|
||||
<template v-else-if="slot.name === 'back-navigation'">
|
||||
<!-- <template v-else-if="slot.name === 'back-navigation'">
|
||||
<BackNavigation class="mr-1" />
|
||||
</template>
|
||||
</template> -->
|
||||
</slot>
|
||||
</template>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user