Compare commits
32 Commits
882e1f7452
...
prod
Author | SHA1 | Date | |
---|---|---|---|
29c20f6403 | |||
d6da044b48 | |||
8c062feef0 | |||
90b9b2b7a9 | |||
bc59c2c22f | |||
90eceb508a | |||
f794f6a8a9 | |||
6cc969e56a | |||
6ca27444e0 | |||
2f2f8fb798 | |||
1de539ddde | |||
67b80d7687 | |||
b44fa6ee7f | |||
559bd55153 | |||
cc24027880 | |||
66b7cc44e9 | |||
5f3ae86698 | |||
84ff3d21b4 | |||
e88b8b41d8 | |||
48ea62150d | |||
5975d1b94d | |||
faababd9a4 | |||
c7f52fa107 | |||
28018815b7 | |||
bad1423acd | |||
f6f258c9b7 | |||
559e46dc41 | |||
67b7e64600 | |||
5c40b534f2 | |||
99b02c16eb | |||
c761c8ba0c | |||
553a915027 |
@@ -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: 0 # 只拉取最新的1个提交(浅克隆)
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: http://git.missmoc.top/mocheng/setup-node@v3
|
||||
|
@@ -20,7 +20,7 @@ export interface AttendanceAreaVO {
|
||||
* 备注
|
||||
*/
|
||||
reamark: string;
|
||||
|
||||
areaDevice?: any[];
|
||||
}
|
||||
|
||||
export interface AttendanceAreaForm extends BaseEntity {
|
||||
@@ -43,7 +43,6 @@ export interface AttendanceAreaForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
reamark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface AttendanceAreaQuery extends PageQuery {
|
||||
|
@@ -59,3 +59,19 @@ export function workOrdersUpdate(data: WorkOrdersForm) {
|
||||
export function workOrdersRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/workOrders/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 派单
|
||||
* @param data
|
||||
*/
|
||||
export function workOrdersDispatch(data: WorkOrdersForm) {
|
||||
return requestClient.putWithMsg<void>('/property/workOrders/dispatch', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 抢单
|
||||
* @param data
|
||||
*/
|
||||
export function workOrdersGrab(data: WorkOrdersForm) {
|
||||
return requestClient.putWithMsg<void>('/property/workOrders/grab', data);
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ export interface WorkOrdersVO {
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
serviceEvalua: string;
|
||||
serviceEvalua: number;
|
||||
|
||||
/**
|
||||
* 是否超时
|
||||
@@ -82,6 +82,8 @@ export interface WorkOrdersVO {
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl: string;
|
||||
|
||||
evaluateImgPath: string[];
|
||||
/**
|
||||
* 评价内容
|
||||
*/
|
||||
@@ -99,6 +101,12 @@ export interface WorkOrdersVO {
|
||||
*/
|
||||
orderImgUrl: string;
|
||||
|
||||
orderImgPath: string[];
|
||||
|
||||
reportingType: string;
|
||||
|
||||
processingWeight: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HandleRecords {
|
||||
|
@@ -37,6 +37,11 @@ export interface WorkOrdersTypeVO {
|
||||
isTransfers: string;
|
||||
|
||||
excludeId: string;
|
||||
/**
|
||||
* 处理优先级
|
||||
*/
|
||||
processingWeight: string;
|
||||
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
@@ -79,6 +84,11 @@ export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
* 上级类型id
|
||||
*/
|
||||
parentId?: string;
|
||||
|
||||
/**
|
||||
* 处理优先级
|
||||
*/
|
||||
processingWeight: string;
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeQuery extends PageQuery {
|
||||
|
@@ -144,6 +144,16 @@ export interface Clean_orderForm extends BaseEntity {
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 签到图片
|
||||
*/
|
||||
signImgUrl?: string;
|
||||
|
||||
/**
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface Clean_orderQuery extends PageQuery {
|
||||
|
@@ -21,6 +21,8 @@ export interface KnowledgeVO {
|
||||
*/
|
||||
covers: string;
|
||||
|
||||
coversPath: string|undefined;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
|
@@ -26,6 +26,8 @@ export interface PropertyVO {
|
||||
*/
|
||||
imgPath: string;
|
||||
|
||||
plantImg: string;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@@ -102,7 +104,6 @@ export interface PropertyForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface PropertyQuery extends PageQuery {
|
||||
@@ -178,6 +179,8 @@ export interface plantsProduct extends BaseEntity {
|
||||
*/
|
||||
imgPath?: string;
|
||||
|
||||
plantImg: string |undefined;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
|
@@ -31,6 +31,8 @@ export interface PersonVO {
|
||||
*/
|
||||
img: string
|
||||
|
||||
imgPath?: string
|
||||
|
||||
/**
|
||||
* 所属单位id
|
||||
*/
|
||||
@@ -79,6 +81,10 @@ export interface PersonVO {
|
||||
|
||||
rosterType?: string | number
|
||||
|
||||
email?: string
|
||||
|
||||
idCard?: string
|
||||
|
||||
}
|
||||
|
||||
export interface PersonForm extends BaseEntity {
|
||||
|
@@ -35,6 +35,7 @@ export interface Resident_unitVO {
|
||||
* 入驻位置
|
||||
*/
|
||||
location: string;
|
||||
locations: string[];
|
||||
|
||||
/**
|
||||
* 入驻时间
|
||||
|
@@ -67,6 +67,8 @@ export interface MeetVO {
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: string[];
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
@@ -75,6 +77,19 @@ export interface MeetVO {
|
||||
* 开放时段结束时间
|
||||
*/
|
||||
openEndHours: string;
|
||||
|
||||
/**
|
||||
* 会议室类型
|
||||
*/
|
||||
meetingRoomType: string;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
locationName: string;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principalsName: string;
|
||||
}
|
||||
|
||||
export interface MeetForm extends BaseEntity {
|
||||
@@ -161,6 +176,8 @@ export interface MeetForm extends BaseEntity {
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: 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,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -61,5 +61,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '排序',
|
||||
fieldName: 'sort',
|
||||
component: 'InputNumber',
|
||||
rules:'required',
|
||||
componentProps: {
|
||||
min: 0,
|
||||
precision: 0,
|
||||
step: 1
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@@ -1,20 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, 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 {
|
||||
assetTypeExport,
|
||||
assetTypeList,
|
||||
@@ -35,15 +27,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
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 = {
|
||||
|
@@ -63,6 +63,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await attendanceAreaInfo(id);
|
||||
record.deviceManageId = record.areaDevice
|
||||
.map((device: any) => device.remoteSisDeviceManage?.id || '')
|
||||
.filter((id: string) => id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
@@ -8,7 +8,7 @@ import {
|
||||
import {
|
||||
workOrdersList,
|
||||
} from '#/api/property/businessManagement/workOrders';
|
||||
import workOrdersDetail from './work-orders-detail.vue';
|
||||
import workOrdersDetail from '../workOrders/work-orders-detail.vue';
|
||||
import {columns, querySchema} from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
|
@@ -56,7 +56,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'reportingType',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.reportingType, 'wy_gdsblx');
|
||||
return row.reportingType!=null?renderDict(row.reportingType, 'wy_gdsblx'):'';
|
||||
},
|
||||
},
|
||||
width: 100,
|
||||
@@ -86,7 +86,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'processingWeight',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.processingWeight, 'pro_processing_weight');
|
||||
return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
|
||||
},
|
||||
},
|
||||
width: 100,
|
||||
|
@@ -184,14 +184,16 @@ onMounted(async () => {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:workOrders:dispatch']"
|
||||
@click.stop="handleOrders(row,'group')"
|
||||
v-if="row.status!=='1' && row.status!=='2'"
|
||||
v-if="row.status!=='1' && row.status!=='2'&&row.operationMode!=='2'"
|
||||
>
|
||||
{{ '派单' }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:workOrders:grab']"
|
||||
@click.stop="handleOrders(row,'rob')"
|
||||
v-if="row.status!=='1' && row.status!=='2'"
|
||||
v-if="row.status!=='1' && row.status!=='2'&&row.operationMode!=='2'"
|
||||
>
|
||||
{{ '抢单' }}
|
||||
</ghost-button>
|
||||
|
@@ -3,6 +3,7 @@ import {useVbenModal} from '@vben/common-ui';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
workOrdersDispatch, workOrdersGrab,
|
||||
workOrdersInfo,
|
||||
workOrdersUpdate
|
||||
} from '#/api/property/businessManagement/workOrders';
|
||||
@@ -84,11 +85,15 @@ async function handleConfirm() {
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if(title.value === '派单'){
|
||||
//派单
|
||||
record.value.handler = data.handler
|
||||
await workOrdersDispatch(record.value)
|
||||
}else{
|
||||
//抢单
|
||||
record.value.handler = userStore.userInfo.userId
|
||||
await workOrdersGrab(record.value)
|
||||
}
|
||||
await workOrdersUpdate(record.value)
|
||||
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
|
@@ -1,13 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem, Timeline, TimelineItem, Rate,Divider} from 'ant-design-vue';
|
||||
import {
|
||||
Descriptions,
|
||||
DescriptionsItem,
|
||||
Timeline,
|
||||
TimelineItem,
|
||||
Rate,
|
||||
Divider
|
||||
} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {workOrdersInfo} from "#/api/property/businessManagement/workOrders";
|
||||
import type {HandleRecords, WorkOrdersVO} from "#/api/property/businessManagement/workOrders/model";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -21,6 +29,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
const orderDetail = shallowRef<null | WorkOrdersVO>(null);
|
||||
const handleRecords = ref<HandleRecords[]>([])
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -28,12 +37,31 @@ async function handleOpenChange(open: boolean) {
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
orderDetail.value = await workOrdersInfo(id);
|
||||
if(orderDetail.value){
|
||||
if (orderDetail.value.workOrdersRecordVoList) {
|
||||
handleRecords.value = orderDetail.value.workOrdersRecordVoList.map((item, index) => ({
|
||||
status: item.status,
|
||||
createTime: item.createTime,
|
||||
handlerName: index === 0 ? item.initiatorPeople : item.handlerName
|
||||
}))
|
||||
}
|
||||
try {
|
||||
if (orderDetail.value.orderImgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.orderImgUrl]);
|
||||
let imgUrls = [];
|
||||
res.forEach(item => {
|
||||
imgUrls.push(item.url)
|
||||
})
|
||||
orderDetail.value.orderImgPath = imgUrls;
|
||||
}
|
||||
if (orderDetail.value.imgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.imgUrl]);
|
||||
let imgUrls = [];
|
||||
res.forEach(item => {
|
||||
imgUrls.push(item.url)
|
||||
})
|
||||
orderDetail.value.evaluateImgPath = imgUrls
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
@@ -53,12 +81,12 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ orderDetail.typeName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="上报类型">
|
||||
<component
|
||||
<component v-if="orderDetail.reportingType!=null"
|
||||
:is="renderDict(orderDetail.reportingType,'wy_gdsblx')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="处理优先级">
|
||||
<component
|
||||
<component v-if="orderDetail.processingWeight!=null"
|
||||
:is="renderDict(orderDetail.processingWeight,'pro_processing_weight')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
@@ -88,23 +116,24 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="完成时间">
|
||||
{{ orderDetail.compleTime }}
|
||||
</DescriptionsItem>
|
||||
|
||||
<DescriptionsItem label="是否超时" v-if="orderDetail.isTimeOut!=null">
|
||||
<component
|
||||
<DescriptionsItem label="是否超时" :span="2">
|
||||
<component v-if="orderDetail.isTimeOut!=null"
|
||||
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgPath" :span="2">
|
||||
<img v-for="item in orderDetail.orderImgPath" :src="item" alt="图片加载失败"
|
||||
class="orders-img"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="服务评价" v-if="orderDetail.serviceEvalua!=null" :span="2">
|
||||
<Rate :value="orderDetail.serviceEvalua" disabled/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="评价内容" v-if="orderDetail.serviceEvaluaText" :span="2">
|
||||
{{ orderDetail.serviceEvaluaText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="评价图片" v-if="orderDetail.imgUrl" :span="2">
|
||||
{{ orderDetail.imgUrl }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgUrl" :span="2">
|
||||
{{ orderDetail.orderImgUrl }}
|
||||
<DescriptionsItem label="评价图片" v-if="orderDetail.evaluateImgPath" :span="2">
|
||||
<img v-for="item in orderDetail.evaluateImgPath" :src="item" alt="图片加载失败"
|
||||
class="orders-img"/>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
@@ -113,9 +142,10 @@ async function handleOpenChange(open: boolean) {
|
||||
<Timeline>
|
||||
<TimelineItem v-for="(item,index) in handleRecords" :key="index">
|
||||
<p style="display: flex;">类型:
|
||||
<component
|
||||
<component v-if="item.status!=null"
|
||||
:is="renderDict(item.status,'wy_gdclzt')"
|
||||
/></p>
|
||||
/>
|
||||
</p>
|
||||
<p>时间:{{ item.createTime }}</p>
|
||||
<p>处理人:{{ item.handlerName }}</p>
|
||||
</TimelineItem>
|
||||
@@ -123,3 +153,10 @@ async function handleOpenChange(open: boolean) {
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.orders-img {
|
||||
width: 100px;
|
||||
margin: 5px 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
|
@@ -15,6 +15,7 @@ import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import {modalSchema} from './data';
|
||||
import {workOrdersTypeTree} from "#/api/property/businessManagement/workOrdersType";
|
||||
import type {WorkOrdersTypeVO} from "#/api/property/businessManagement/workOrdersType/model";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -108,7 +109,7 @@ async function queryWorkOrdersType() {
|
||||
const options = await workOrdersTypeTree()
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
componentProps: (formModel) => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
@@ -123,16 +124,15 @@ async function queryWorkOrdersType() {
|
||||
treeLine: { showLeafIcon: false },
|
||||
treeNodeFilterProp: 'orderTypeName',
|
||||
treeNodeLabelProp: 'orderTypeName',
|
||||
async onSelect(type:string,node:WorkOrdersTypeVO) {
|
||||
formModel.processingWeight = node.processingWeight;
|
||||
},
|
||||
}),
|
||||
fieldName: 'type',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@@ -46,6 +46,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '处理优先级',
|
||||
field: 'processingWeight',
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
|
||||
},
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '排序值',
|
||||
field: 'sort',
|
||||
@@ -105,6 +115,15 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '处理优先级',
|
||||
fieldName: 'processingWeight',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_processing_weight'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '完成时效(小时)',
|
||||
fieldName: 'completionNumber',
|
||||
|
@@ -37,11 +37,16 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="类型名称">
|
||||
{{ workOrdersTypeInfoDetail.orderTypeName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="运作模式" v-if="workOrdersTypeInfoDetail.operationMode!=null">
|
||||
<component
|
||||
<DescriptionsItem label="运作模式" >
|
||||
<component v-if="workOrdersTypeInfoDetail.operationMode!=null"
|
||||
:is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="处理优先级">
|
||||
<component v-if="workOrdersTypeInfoDetail.processingWeight!=null"
|
||||
:is="renderDict(workOrdersTypeInfoDetail.processingWeight,'pro_processing_weight')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="排序值">
|
||||
{{ workOrdersTypeInfoDetail.sort }}
|
||||
</DescriptionsItem>
|
||||
|
@@ -26,6 +26,7 @@ import cleanDetailModal from './clean-detail-modal.vue';
|
||||
// import { modalSchema } from './data';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import type {Clean_orderForm} from "#/api/property/clean_order/model";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -190,9 +191,13 @@ const modalSchema = [
|
||||
{
|
||||
label: '评价图片',
|
||||
fieldName: 'imgUrl',
|
||||
component: 'Input',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
helpMessage: false,
|
||||
},
|
||||
dependencies: {
|
||||
show: () => (isReadonly.value ? true : false),
|
||||
show: (formValue:Clean_orderForm) =>
|
||||
isReadonly.value && formValue.imgUrl ? true : false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
@@ -201,7 +206,7 @@ const modalSchema = [
|
||||
fieldName: 'signType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_bjqdfs')
|
||||
options: getDictOptions('wy_bjqdfs'),
|
||||
},
|
||||
dependencies: {
|
||||
show: () => (isReadonly.value ? true : false),
|
||||
@@ -213,10 +218,11 @@ const modalSchema = [
|
||||
fieldName: 'signImgUrl',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
helpMessage:false
|
||||
helpMessage: false,
|
||||
},
|
||||
dependencies: {
|
||||
show: (formValue) => (isReadonly.value&&formValue.signImgUrl ? true : false),
|
||||
show: (formValue:Clean_orderForm) =>
|
||||
isReadonly.value && formValue.signImgUrl ? true : false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
@@ -289,7 +295,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
console.log(isReadonly.value);
|
||||
|
||||
// 查询服务地址树形结构
|
||||
setupCommunitySelect();
|
||||
@@ -314,6 +319,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
}
|
||||
if ((isUpdate.value || isReadonly.value) && id) {
|
||||
const record: any = await clean_orderInfo(id);
|
||||
|
||||
if (record.starTime) record.starTime = dayjs(record.starTime);
|
||||
if (record.endTime) record.endTime = dayjs(record.endTime);
|
||||
editUnitId.value = record.unitId || '';
|
||||
@@ -496,7 +502,6 @@ async function handleConfirm() {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
console.log(data);
|
||||
|
||||
// 单位数据缓存
|
||||
if (unitListData.length === 0) {
|
||||
@@ -537,7 +542,6 @@ async function handleClosed() {
|
||||
// 获取服务地址
|
||||
async function setupCommunitySelect() {
|
||||
const areaList = await communityTree(4);
|
||||
console.log(areaList);
|
||||
|
||||
// 选中后显示在输入框的值 即父节点 / 子节点
|
||||
// addFullName(areaList, 'areaName', ' / ');
|
||||
|
@@ -74,8 +74,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '服务地址',
|
||||
field: 'location',
|
||||
width: '180',
|
||||
field: 'locationName',
|
||||
width: '260',
|
||||
},
|
||||
{
|
||||
title: '合计费用(元)',
|
||||
|
@@ -6,7 +6,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import { costItemSettingList } from '#/api/property/costManagement/costItemSetting';
|
||||
import { userList } from '#/api/system/user';
|
||||
import { personList } from '#/api/property/resident/person';
|
||||
|
||||
/**
|
||||
* 查询表单 schema
|
||||
@@ -23,12 +23,12 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const rows = await userList({ pageSize: 1000000000, pageNum: 1 });
|
||||
const rows = await personList({ pageSize: 1000000000, pageNum: 1 });
|
||||
return rows;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: 'userName',
|
||||
valueField: 'userId',
|
||||
valueField: 'id',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -141,7 +141,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const rows = await costItemSettingList({ pageSize: 1000000000, pageNum: 1, costType: '2' });
|
||||
const rows = await costItemSettingList({
|
||||
pageSize: 1000000000,
|
||||
pageNum: 1,
|
||||
costType: '2',
|
||||
});
|
||||
return rows;
|
||||
},
|
||||
resultField: 'rows',
|
||||
@@ -208,12 +212,12 @@ export const addModalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const rows = await userList({ pageSize: 1000000000, pageNum: 1 });
|
||||
const rows = await personList({ pageSize: 1000000000, pageNum: 1 });
|
||||
return rows;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: 'userName',
|
||||
valueField: 'userId',
|
||||
valueField: 'id',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -242,7 +246,11 @@ export const addModalSchema: FormSchemaGetter = () => [
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const rows = await costItemSettingList({ pageSize: 1000000000, pageNum: 1, costType: '2' });
|
||||
const rows = await costItemSettingList({
|
||||
pageSize: 1000000000,
|
||||
pageNum: 1,
|
||||
costType: '2',
|
||||
});
|
||||
return rows;
|
||||
},
|
||||
resultField: 'rows',
|
||||
|
@@ -19,7 +19,7 @@ import { personList } from '#/api/property/resident/person';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const costItemsOptions = ref<any>([]);
|
||||
const meterTypeOptions = ref<any>([]);
|
||||
const isMeterType = ref(false);
|
||||
const isMeterType = ref(false); //是否选择了费用类型
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
@@ -48,11 +48,11 @@ const schema = [
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await personList({ pageSize: 1000000000, pageNum: 1 });
|
||||
return res.rows.map((item: any) => ({
|
||||
label: item.userName,
|
||||
value: item.id,
|
||||
}));
|
||||
return res;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: 'userName',
|
||||
valueField: 'id',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -70,6 +70,7 @@ const schema = [
|
||||
isMeterType.value = false;
|
||||
} else {
|
||||
isMeterType.value = true;
|
||||
// 获取费用项目
|
||||
const costItemsRes = await costItemSettingList({
|
||||
pageSize: 1000000000,
|
||||
pageNum: 1,
|
||||
@@ -79,10 +80,11 @@ const schema = [
|
||||
label: item.chargeItem,
|
||||
value: item.id,
|
||||
}));
|
||||
// 获取抄表类型:水费字典为0,电费为1
|
||||
const meterTypeRes = await meterReadingTypeList({
|
||||
pageSize: 1000000000,
|
||||
pageNum: 1,
|
||||
costType: value == '5' ? 0 : 1,
|
||||
meterType: value == '5' ? '0' : '1',
|
||||
});
|
||||
meterTypeOptions.value = (meterTypeRes?.rows || []).map((item) => ({
|
||||
label: item.name,
|
||||
|
@@ -1,8 +1,7 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { costItemSettingList } from '#/api/property/costManagement/costItemSetting';
|
||||
import {meterReadingTypeList} from '#/api/property/costManagement/meterReadingType';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -27,11 +26,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '费用类型',
|
||||
field: 'itemId',
|
||||
field: 'costType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.costType, 'wy_cbfylx');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '抄表类型',
|
||||
field: 'meterTypeId',
|
||||
field: 'costTypeName',
|
||||
},
|
||||
{
|
||||
title: '本期度数',
|
||||
|
@@ -29,15 +29,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
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 = {
|
||||
|
@@ -36,7 +36,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '房屋',
|
||||
field: 'roomId',
|
||||
field: 'roomName',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
|
@@ -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>
|
||||
|
@@ -39,6 +39,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
},
|
||||
);
|
||||
|
||||
const record = ref({})
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[60%]',
|
||||
@@ -56,8 +57,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await contingenPlanInfo(id);
|
||||
await formApi.setValues(record);
|
||||
record.value = await contingenPlanInfo(id);
|
||||
await formApi.setValues(record.value);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
@@ -74,6 +75,8 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.status = record.value.status
|
||||
console.log(data,123)
|
||||
await (isUpdate.value ? contingenPlanUpdate(data) : contingenPlanAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
|
@@ -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
|
||||
v-if="row.status === '0'"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认审核?"
|
||||
@confirm="handleExamine(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
v-if="row.status === '0'"
|
||||
@click.stop="handleExamine(row)"
|
||||
>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<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,97 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { Empty, Skeleton, Tree } from 'ant-design-vue';
|
||||
import { communityTree } from "#/api/property/community";
|
||||
import type { CommunityVO } from "#/api/property/community/model";
|
||||
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true });
|
||||
|
||||
const emit = defineEmits<{
|
||||
reload: [];
|
||||
select: [];
|
||||
}>();
|
||||
|
||||
const selectFloorId = defineModel('selectFloorId', {
|
||||
type: Array as PropType<string[]>,
|
||||
});
|
||||
|
||||
const searchValue = defineModel('searchValue', {
|
||||
type: String,
|
||||
default: '',
|
||||
});
|
||||
|
||||
type TreeArray = CommunityVO[];
|
||||
const treeArray = ref<TreeArray>([]);
|
||||
const showTreeSkeleton = ref<boolean>(true);
|
||||
|
||||
async function loadTree() {
|
||||
showTreeSkeleton.value = true;
|
||||
searchValue.value = '';
|
||||
selectFloorId.value = [];
|
||||
treeArray.value = await communityTree(4);
|
||||
showTreeSkeleton.value = false;
|
||||
}
|
||||
|
||||
// async function handleReload() {
|
||||
// await loadTree();
|
||||
// emit('reload');
|
||||
// }
|
||||
|
||||
onMounted(loadTree);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<Skeleton
|
||||
:loading="showTreeSkeleton"
|
||||
:paragraph="{ rows: 8 }"
|
||||
active
|
||||
class="p-[8px] flex-1 min-h-0"
|
||||
>
|
||||
<div class="bg-background flex flex-col h-full rounded-lg">
|
||||
<div class="flex-1 overflow-y-auto px-[8px] mt-2.5 min-h-0">
|
||||
<Tree
|
||||
class="tree-background"
|
||||
v-bind="$attrs"
|
||||
v-if="treeArray.length > 0"
|
||||
v-model:selected-keys="selectFloorId"
|
||||
:field-names="{ title: 'label', key: 'id' }"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
:tree-data="treeArray"
|
||||
:virtual="false"
|
||||
default-expand-all
|
||||
@select="$emit('select')"
|
||||
>
|
||||
<template #title="{ label }">
|
||||
<span v-if="label.indexOf(searchValue) > -1">
|
||||
{{ label.substring(0, label.indexOf(searchValue)) }}
|
||||
<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</template>
|
||||
</Tree>
|
||||
<div v-else class="mt-5">
|
||||
<Empty
|
||||
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
||||
description="暂无数据"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bg-background{
|
||||
background-color: white;
|
||||
:deep(.ant-tree){
|
||||
background-color: white;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,14 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui';
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui'
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
} from '#/adapter/vxe-table'
|
||||
|
||||
import {
|
||||
paymentReviewList,
|
||||
} from '#/api/property/costManagement/paymentReview';
|
||||
import { columns, querySchema } from './data';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
} from '#/api/property/costManagement/paymentReview'
|
||||
|
||||
import { columns, querySchema } from './data'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -19,7 +21,7 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -37,7 +39,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -45,7 +47,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-paymentReview-index'
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
@@ -54,14 +56,12 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="用电费用报表"/>
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree></FloorTree>
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="用电费用报表" />
|
||||
</div>
|
||||
</Page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<div class="energy-monitor-page">
|
||||
<div class="left-content">
|
||||
<FloorTree></FloorTree>
|
||||
</div>
|
||||
<div class="right-content">
|
||||
<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">
|
||||
@@ -67,9 +66,8 @@
|
||||
<div class="section-header">
|
||||
<div class="header-title">能耗趋势</div>
|
||||
</div>
|
||||
<RadioGroup v-model:value="energyTrendTime"
|
||||
button-style="solid"
|
||||
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
|
||||
<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>
|
||||
@@ -106,15 +104,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import type { ECharts, EChartsOption } from 'echarts'
|
||||
import FloorTree from "./floor-tree.vue";
|
||||
import dayjs from "dayjs";
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
import dayjs from "dayjs"
|
||||
|
||||
const chainData = reactive({
|
||||
todayEnergy: '231.78',
|
||||
@@ -197,37 +197,37 @@ const initEnergyTrendChart = () => {
|
||||
}
|
||||
|
||||
function buildingEnergyTrendData(val: string) {
|
||||
const now = new Date();
|
||||
let timeArr = [];
|
||||
let valArr = [];
|
||||
let name = '时间';
|
||||
const now = new Date()
|
||||
let timeArr = []
|
||||
let valArr = []
|
||||
let name = '时间'
|
||||
if (val == '1') {
|
||||
const hour = now.getHours()
|
||||
for (let i = 0; i < hour; i++) {
|
||||
timeArr.push(i);
|
||||
valArr.push(parseFloat((Math.random() * 35).toFixed(2)));
|
||||
timeArr.push(i)
|
||||
valArr.push(parseFloat((Math.random() * 35).toFixed(2)))
|
||||
}
|
||||
} else if (val == '2') {
|
||||
const day = now.getDate()
|
||||
for (let i = 1; i < day; i++) {
|
||||
timeArr.push(i);
|
||||
valArr.push(parseFloat((Math.random() * 800).toFixed(2)));
|
||||
timeArr.push(i)
|
||||
valArr.push(parseFloat((Math.random() * 800).toFixed(2)))
|
||||
}
|
||||
name = '日期';
|
||||
name = '日期'
|
||||
} else {
|
||||
const month = now.getMonth() + 1;
|
||||
const month = now.getMonth() + 1
|
||||
for (let i = 1; i < month; i++) {
|
||||
timeArr.push(i);
|
||||
valArr.push(parseFloat((Math.random() * 21000).toFixed(2)));
|
||||
timeArr.push(i)
|
||||
valArr.push(parseFloat((Math.random() * 21000).toFixed(2)))
|
||||
}
|
||||
name = '月份';
|
||||
name = '月份'
|
||||
}
|
||||
|
||||
if (energyTrendInstance.value) {
|
||||
energyTrendInstance.value.setOption({
|
||||
xAxis: { data: timeArr, name },
|
||||
series: [{ data: valArr }],
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ const powerCurveOption: EChartsOption = {
|
||||
lineStyle: { color: '#cbb0e3' } // 线条颜色
|
||||
},
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
const initPowerCurveChart = () => {
|
||||
if (powerCurveChart.value) {
|
||||
@@ -324,23 +324,23 @@ const initPowerCurveChart = () => {
|
||||
}
|
||||
|
||||
function buildingPowerCurveData() {
|
||||
const now = new Date();
|
||||
const now = new Date()
|
||||
const hour = now.getHours()
|
||||
let yesterday = [];
|
||||
let today = [];
|
||||
let yesterday = []
|
||||
let today = []
|
||||
let timeDate = []
|
||||
for (let i = 0; i < 24; i++) {
|
||||
timeDate.push(i);
|
||||
yesterday.push(parseFloat((Math.random() * 3000).toFixed(2)));
|
||||
timeDate.push(i)
|
||||
yesterday.push(parseFloat((Math.random() * 3000).toFixed(2)))
|
||||
if (hour > i) {
|
||||
today.push(parseFloat((Math.random() * 3000).toFixed(2)));
|
||||
today.push(parseFloat((Math.random() * 3000).toFixed(2)))
|
||||
}
|
||||
}
|
||||
if (powerCurveInstance.value) {
|
||||
powerCurveInstance.value.setOption({
|
||||
xAxis: { data: timeDate },
|
||||
series: [{ data: today }, { data: yesterday }],
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,34 +352,12 @@ onMounted(() => {
|
||||
|
||||
// 组件卸载前销毁图表实例
|
||||
onBeforeUnmount(() => {
|
||||
energyTrendInstance.value?.dispose();
|
||||
powerCurveInstance.value?.dispose();
|
||||
energyTrendInstance.value?.dispose()
|
||||
powerCurveInstance.value?.dispose()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.energy-monitor-page {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background-color: #f4f4f4;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.left-content {
|
||||
flex: 1;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.right-content {
|
||||
display: flex;
|
||||
flex: 4;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
@@ -395,10 +373,12 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
.power-curve-container {
|
||||
margin-top: 10px;
|
||||
flex: 5;
|
||||
}
|
||||
|
||||
.power-peak-container {
|
||||
margin-top: 10px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@@ -475,6 +455,7 @@ onBeforeUnmount(() => {
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.power-chart {
|
||||
height: 38vh;
|
||||
display: flex;
|
||||
@@ -482,6 +463,7 @@ onBeforeUnmount(() => {
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.peak-item {
|
||||
padding: 15px 0 0 0;
|
||||
border: 1px solid #3671e8;
|
@@ -1,28 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import {onMounted, ref} from "vue";
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
import { DatePicker } from 'ant-design-vue';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import * as echarts from 'echarts'
|
||||
import { onMounted, ref } from "vue"
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import dayjs from 'dayjs'
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { DatePicker } from 'ant-design-vue'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
|
||||
const currentDay = ref<Dayjs>(dayjs());
|
||||
const currentMonth = ref<Dayjs>(dayjs());
|
||||
const currentYear = ref<Dayjs>(dayjs());
|
||||
const currentDay = ref<Dayjs>(dayjs())
|
||||
const currentMonth = ref<Dayjs>(dayjs())
|
||||
const currentYear = ref<Dayjs>(dayjs())
|
||||
const disabledDay = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('day');
|
||||
};
|
||||
return current && current > dayjs().endOf('day')
|
||||
}
|
||||
const disabledMonth = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('month');
|
||||
};
|
||||
return current && current > dayjs().endOf('month')
|
||||
}
|
||||
const disabledYear = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('year');
|
||||
};
|
||||
return current && current > dayjs().endOf('year')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
//day
|
||||
const chartDay = document.getElementById('day');
|
||||
const myChartDay = echarts.init(chartDay);
|
||||
const chartDay = document.getElementById('day')
|
||||
const myChartDay = echarts.init(chartDay)
|
||||
const optionDay = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -87,12 +88,12 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionDay && myChartDay.setOption(optionDay);
|
||||
}
|
||||
optionDay && myChartDay.setOption(optionDay)
|
||||
|
||||
//month
|
||||
const chartMonth = document.getElementById('month');
|
||||
const myChartMonth = echarts.init(chartMonth);
|
||||
const chartMonth = document.getElementById('month')
|
||||
const myChartMonth = echarts.init(chartMonth)
|
||||
const optionMonth = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -157,12 +158,12 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionMonth && myChartMonth.setOption(optionMonth);
|
||||
}
|
||||
optionMonth && myChartMonth.setOption(optionMonth)
|
||||
|
||||
//year
|
||||
const chartYear = document.getElementById('year');
|
||||
const myChartYear = echarts.init(chartYear);
|
||||
const chartYear = document.getElementById('year')
|
||||
const myChartYear = echarts.init(chartYear)
|
||||
const optionYear = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -227,8 +228,8 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionYear && myChartYear.setOption(optionYear);
|
||||
}
|
||||
optionYear && myChartYear.setOption(optionYear)
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartDay.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -236,8 +237,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartDay.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -245,8 +246,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -254,8 +255,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -263,8 +264,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartMonth.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -272,8 +273,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartMonth.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -281,56 +282,41 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px">
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<div class=" flex-1 overflow-hidden">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;height: 33%">
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<DatePicker
|
||||
v-model:value="currentDay"
|
||||
:disabled-date="disabledDay"
|
||||
/>当日能耗总值:125.04KW.h</div>
|
||||
<DatePicker v-model:value="currentDay" :disabled-date="disabledDay" />当日能耗总值:125.04KW.h
|
||||
</div>
|
||||
<div id="day" style="height: 250px;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
|
||||
<div id="day" style="height: 100%;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<DatePicker
|
||||
v-model:value="currentMonth"
|
||||
:disabled-date="disabledMonth"
|
||||
picker="month"
|
||||
/>当月能耗总值:125.04KW.h</div>
|
||||
<DatePicker v-model:value="currentMonth" :disabled-date="disabledMonth" picker="month" />当月能耗总值:125.04KW.h
|
||||
</div>
|
||||
<div id="month" style="height: 250px;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
|
||||
<div id="month" style="height: 100%;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<DatePicker
|
||||
v-model:value="currentYear"
|
||||
:disabled-date="disabledYear"
|
||||
picker="year"
|
||||
/>当年能耗总值:125.04KW.h</div>
|
||||
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值:125.04KW.h
|
||||
</div>
|
||||
<div id="year" style="height: 250px;width: 100%;"></div>
|
||||
</div>
|
||||
<div id="year" style="height: 100%;width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@@ -1,14 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui';
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui'
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
} from '#/adapter/vxe-table'
|
||||
import {
|
||||
paymentReviewList,
|
||||
} from '#/api/property/costManagement/paymentReview';
|
||||
import { columns, querySchema } from './data';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
} from '#/api/property/costManagement/paymentReview'
|
||||
import { columns, querySchema } from './data'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -19,7 +19,7 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -37,7 +37,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-paymentReview-index'
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
@@ -54,14 +54,12 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="用电环比分析列表"/>
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="用电环比分析列表" />
|
||||
</div>
|
||||
</Page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
@@ -1,22 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import {onMounted, ref} from "vue";
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
import { Table } from 'ant-design-vue'
|
||||
import { DatePicker } from 'ant-design-vue';
|
||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import * as echarts from 'echarts'
|
||||
import { onMounted, ref } from "vue"
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import dayjs from 'dayjs'
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { Table, DatePicker } from 'ant-design-vue'
|
||||
import { SearchOutlined } from '@ant-design/icons-vue'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
|
||||
const currentYear = ref<Dayjs>(dayjs());
|
||||
const currentYear = ref<Dayjs>(dayjs())
|
||||
const disabledYear = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('year');
|
||||
};
|
||||
return current && current > dayjs().endOf('year')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
//year
|
||||
const chartYear = document.getElementById('year');
|
||||
const myChartYear = echarts.init(chartYear);
|
||||
const chartYear = document.getElementById('year')
|
||||
const myChartYear = echarts.init(chartYear)
|
||||
const optionYear = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -81,8 +81,8 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionYear && myChartYear.setOption(optionYear);
|
||||
}
|
||||
optionYear && myChartYear.setOption(optionYear)
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -90,8 +90,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -99,8 +99,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const columns = [
|
||||
@@ -120,7 +120,7 @@ const columns = [
|
||||
title: '同比(%)',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
];
|
||||
]
|
||||
|
||||
const data = [...Array(32)].map((_, i) => ({
|
||||
key: i,
|
||||
@@ -131,43 +131,28 @@ const data = [...Array(32)].map((_, i) => ({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<div class="flex-1 overflow-hidden">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;">
|
||||
<div>
|
||||
年份
|
||||
<DatePicker
|
||||
style="margin: 0 10px;"
|
||||
v-model:value="currentYear"
|
||||
:disabled-date="disabledYear"
|
||||
picker="year"
|
||||
/>
|
||||
<DatePicker style="margin: 0 10px;" v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />
|
||||
<a-button type="primary">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
</div>
|
||||
<div id="year" style="height: 250px;width: 100%;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<Table
|
||||
style="border-radius: 8px;"
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:pagination="false"
|
||||
:scroll="{ y: '50vh' }"
|
||||
/>
|
||||
<Table style="border-radius: 8px;" :columns="columns" :data-source="data" :pagination="false"
|
||||
:scroll="{ y: '50vh' }" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@@ -0,0 +1,81 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { handleNode } from '@vben/utils'
|
||||
import { Empty, Skeleton, Tree } from 'ant-design-vue'
|
||||
import { communityTree } from "#/api/property/community"
|
||||
import type { CommunityVO } from "#/api/property/community/model"
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true })
|
||||
|
||||
const emit = defineEmits<{
|
||||
/**
|
||||
* 点击刷新按钮的事件
|
||||
*/
|
||||
reload: []
|
||||
/**
|
||||
* 点击节点的事件
|
||||
*/
|
||||
select: []
|
||||
}>()
|
||||
|
||||
const selectFloorId = defineModel('selectFloorId', {
|
||||
type: Array as PropType<string[]>,
|
||||
})
|
||||
|
||||
const searchValue = defineModel('searchValue', {
|
||||
type: String,
|
||||
default: '',
|
||||
})
|
||||
|
||||
type TreeArray = CommunityVO[]
|
||||
const treeArray = ref<TreeArray>([])
|
||||
/** 骨架屏加载 */
|
||||
const showTreeSkeleton = ref<boolean>(true)
|
||||
|
||||
async function loadTree() {
|
||||
showTreeSkeleton.value = true
|
||||
searchValue.value = ''
|
||||
selectFloorId.value = []
|
||||
const ret = await communityTree(3)
|
||||
const splitStr = '/'
|
||||
handleNode(ret, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 3) {
|
||||
node.disabled = true
|
||||
}
|
||||
})
|
||||
treeArray.value = ret
|
||||
showTreeSkeleton.value = false
|
||||
}
|
||||
|
||||
onMounted(loadTree);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="$attrs.class">
|
||||
<Skeleton :loading="showTreeSkeleton" :paragraph="{ rows: 8 }" active class="p-[8px] flex-1 min-h-0">
|
||||
<div class="bg-background flex h-full flex-col overflow-y-auto rounded-lg">
|
||||
<div class="h-full overflow-x-hidden px-[8px]">
|
||||
<Tree v-bind="$attrs" v-if="treeArray.length > 0" v-model:selected-keys="selectFloorId"
|
||||
:field-names="{ title: 'label', key: 'id' }" :show-line="{ showLeafIcon: false }" :tree-data="treeArray"
|
||||
:virtual="false" default-expand-all @select="$emit('select')">
|
||||
<template #title="{ label }">
|
||||
<span v-if="label.indexOf(searchValue) > -1">
|
||||
{{ label.substring(0, label.indexOf(searchValue)) }}
|
||||
<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</template>
|
||||
</Tree>
|
||||
<div v-else class="mt-5">
|
||||
<Empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</div>
|
||||
</template>
|
@@ -2,7 +2,7 @@
|
||||
|
||||
import { TableSwitch } from "#/components/table"
|
||||
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import { getVxePopupContainer } from '@vben/utils'
|
||||
|
||||
|
||||
import { ref } from 'vue'
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
lightInfoList,
|
||||
lightInfoRemove,
|
||||
switchSingleLight,
|
||||
} from '#/api/property/meter/lightInfo'
|
||||
import type { LightInfoForm } from '#/api/property/meter/lightInfo/model'
|
||||
} from '#/api/property/energyManagement/lightInfo'
|
||||
import type { LightInfoForm } from '#/api/property/energyManagement/lightInfo/model'
|
||||
|
||||
// 左边楼层用
|
||||
const selectFloorId = ref<string[]>([])
|
||||
@@ -69,7 +69,7 @@ const gridOptions: VxeGridProps = {
|
||||
if (selectFloorId.value.length === 1) {
|
||||
formValues.floorId = selectFloorId.value[0]
|
||||
} else {
|
||||
Reflect.deleteProperty(formValues, 'deptId')
|
||||
Reflect.deleteProperty(formValues, 'floorId')
|
||||
}
|
||||
return await lightInfoList({
|
||||
pageNum: page.currentPage,
|
@@ -7,10 +7,10 @@ import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils'
|
||||
|
||||
import { useVbenForm } from '#/adapter/form'
|
||||
import { communityTree } from '#/api/property/community'
|
||||
import { lightInfoAdd, lightInfoInfo, lightInfoUpdate } from '#/api/property/meter/lightInfo'
|
||||
import { lightInfoAdd, lightInfoInfo, lightInfoUpdate } from '#/api/property/energyManagement/lightInfo'
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
|
||||
|
||||
import { drawerSchema } from './data';
|
||||
import { drawerSchema } from './data'
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>()
|
||||
|
@@ -1,33 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { computed, ref } from "vue"
|
||||
|
||||
import { useVbenModal } from "@vben/common-ui";
|
||||
import { $t } from "@vben/locales";
|
||||
import { cloneDeep } from "@vben/utils";
|
||||
import { useVbenModal } from "@vben/common-ui"
|
||||
import { $t } from "@vben/locales"
|
||||
import { cloneDeep } from "@vben/utils"
|
||||
|
||||
import { useVbenForm } from "#/adapter/form";
|
||||
import { useVbenForm } from "#/adapter/form"
|
||||
import {
|
||||
meterInfoAdd,
|
||||
meterInfoInfo,
|
||||
meterInfoUpdate,
|
||||
} from "#/api/property/meter/meterInfo";
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup";
|
||||
} from "#/api/property/energyManagement/meterInfo"
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup"
|
||||
|
||||
const props = defineProps({
|
||||
meterType: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
import { initMoalForm } from "./data";
|
||||
const modalSchema = initMoalForm(props.meterType);
|
||||
import { initMoalForm } from "./data"
|
||||
const modalSchema = initMoalForm(props.meterType)
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
const emit = defineEmits<{ reload: [] }>()
|
||||
const isUpdate = ref(false)
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add");
|
||||
});
|
||||
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add")
|
||||
})
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
@@ -44,14 +44,14 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: "grid-cols-2",
|
||||
});
|
||||
})
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
@@ -62,50 +62,50 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
modalApi.modalLoading(true)
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
const { id } = modalApi.getData() as { id?: number | string }
|
||||
isUpdate.value = !!id
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await meterInfoInfo(id);
|
||||
record.meterType = record.meterType.toString();
|
||||
record.meterUnit = record.meterUnit.toString();
|
||||
record.runningState = record.runningState.toString();
|
||||
record.communicationState = record.communicationState.toString();
|
||||
await formApi.setValues(record);
|
||||
const record = await meterInfoInfo(id)
|
||||
record.meterType = record.meterType.toString()
|
||||
record.meterUnit = record.meterUnit.toString()
|
||||
record.runningState = record.runningState.toString()
|
||||
record.communicationState = record.communicationState.toString()
|
||||
await formApi.setValues(record)
|
||||
}
|
||||
await markInitialized();
|
||||
await markInitialized()
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
modalApi.modalLoading(false)
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
modalApi.lock(true)
|
||||
const { valid } = await formApi.validate()
|
||||
if (!valid) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? meterInfoUpdate(data) : meterInfoAdd(data));
|
||||
resetInitialized();
|
||||
emit("reload");
|
||||
modalApi.close();
|
||||
const data = cloneDeep(await formApi.getValues())
|
||||
await (isUpdate.value ? meterInfoUpdate(data) : meterInfoAdd(data))
|
||||
resetInitialized()
|
||||
emit("reload")
|
||||
modalApi.close()
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(error)
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
modalApi.lock(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
await formApi.resetForm()
|
||||
resetInitialized()
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,32 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from "@vben/types";
|
||||
import type { Recordable } from "@vben/types"
|
||||
|
||||
import { ref } from "vue";
|
||||
import { ref } from "vue"
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from "@vben/common-ui";
|
||||
import { getVxePopupContainer } from "@vben/utils";
|
||||
import { Page, useVbenModal, type VbenFormProps } from "@vben/common-ui"
|
||||
import { getVxePopupContainer } from "@vben/utils"
|
||||
|
||||
import { Modal, Popconfirm, Space } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { Modal, Popconfirm, Space } from "ant-design-vue"
|
||||
import dayjs from "dayjs"
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps,
|
||||
} from "#/adapter/vxe-table";
|
||||
} from "#/adapter/vxe-table"
|
||||
|
||||
import {
|
||||
meterInfoExport,
|
||||
meterInfoList,
|
||||
meterInfoRemove,
|
||||
} from "#/api/property/meter/meterInfo";
|
||||
import type { MeterInfoForm } from "#/api/property/meterInfo/model";
|
||||
import { commonDownloadExcel } from "#/utils/file/download";
|
||||
} from "#/api/property/energyManagement/meterInfo"
|
||||
import type { MeterInfoForm } from "#/api/property/meterInfo/model"
|
||||
import { commonDownloadExcel } from "#/utils/file/download"
|
||||
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue";
|
||||
import { initQuerySchema, initColumns } from "../components/data";
|
||||
const columns = initColumns(3);
|
||||
const querySchema = initQuerySchema(3);
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue"
|
||||
import { initQuerySchema, initColumns } from "../components/data"
|
||||
const columns = initColumns(3)
|
||||
const querySchema = initQuerySchema(3)
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -70,7 +70,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -79,44 +79,44 @@ const gridOptions: VxeGridProps = {
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: "property-meterInfo-index",
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
});
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
modalApi.setData({})
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<MeterInfoForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
modalApi.setData({ id: row.id })
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<MeterInfoForm>) {
|
||||
await meterInfoRemove(row.id);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(row.id)
|
||||
await tableApi.query()
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id);
|
||||
const rows = tableApi.grid.getCheckboxRecords()
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
okType: "danger",
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await meterInfoRemove(ids);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(ids)
|
||||
await tableApi.query()
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
@@ -127,7 +127,7 @@ function handleDownloadExcel() {
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
}
|
||||
);
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -136,37 +136,26 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="水电气列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button v-access:code="['property:meterInfo:export']"
|
||||
@click="handleDownloadExcel">
|
||||
<a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button :disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click="handleMultiDelete">
|
||||
<a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
|
||||
v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button type="primary"
|
||||
v-access:code="['property:meterInfo:add']"
|
||||
@click="handleAdd">
|
||||
<a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button v-access:code="['property:meterInfo:edit']"
|
||||
@click.stop="handleEdit(row)">
|
||||
<ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm :get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
<Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
|
||||
@confirm="handleDelete(row)">
|
||||
<ghost-button danger
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click.stop="">
|
||||
<ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
@@ -1,32 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
import type { Recordable } from '@vben/types'
|
||||
|
||||
import { ref } from 'vue';
|
||||
import { ref } from 'vue'
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'
|
||||
import { getVxePopupContainer } from '@vben/utils'
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
} from '#/adapter/vxe-table'
|
||||
|
||||
import {
|
||||
meterInfoExport,
|
||||
meterInfoList,
|
||||
meterInfoRemove,
|
||||
} from '#/api/property/meter/meterInfo';
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
} from '#/api/property/energyManagement/meterInfo'
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model'
|
||||
import { commonDownloadExcel } from '#/utils/file/download'
|
||||
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue";
|
||||
import { initQuerySchema, initColumns } from "../components/data";
|
||||
const columns = initColumns(1);
|
||||
const querySchema = initQuerySchema(1);
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue"
|
||||
import { initQuerySchema, initColumns } from "../components/data"
|
||||
const columns = initColumns(1)
|
||||
const querySchema = initQuerySchema(1)
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -70,7 +70,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -79,50 +79,50 @@ const gridOptions: VxeGridProps = {
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-meterInfo-index'
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
});
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
modalApi.setData({})
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<MeterInfoForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
modalApi.setData({ id: row.id })
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<MeterInfoForm>) {
|
||||
await meterInfoRemove(row.id);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(row.id)
|
||||
await tableApi.query()
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id);
|
||||
const rows = tableApi.grid.getCheckboxRecords()
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await meterInfoRemove(ids);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(ids)
|
||||
await tableApi.query()
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -131,48 +131,26 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="水电气列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:meterInfo:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
<a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click="handleMultiDelete">
|
||||
<a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
|
||||
v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:meterInfo:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
<ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
<Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
|
||||
@confirm="handleDelete(row)">
|
||||
<ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
@@ -1,32 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
import type { Recordable } from '@vben/types'
|
||||
|
||||
import { ref } from 'vue';
|
||||
import { ref } from 'vue'
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'
|
||||
import { getVxePopupContainer } from '@vben/utils'
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
} from '#/adapter/vxe-table'
|
||||
|
||||
import {
|
||||
meterInfoExport,
|
||||
meterInfoList,
|
||||
meterInfoRemove,
|
||||
} from '#/api/property/meter/meterInfo';
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
} from '#/api/property/energyManagement/meterInfo'
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model'
|
||||
import { commonDownloadExcel } from '#/utils/file/download'
|
||||
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue";
|
||||
import { initQuerySchema, initColumns } from "../components/data";
|
||||
const columns = initColumns(2);
|
||||
const querySchema = initQuerySchema(2);
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue"
|
||||
import { initQuerySchema, initColumns } from "../components/data"
|
||||
const columns = initColumns(2)
|
||||
const querySchema = initQuerySchema(2)
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -70,7 +70,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -79,50 +79,50 @@ const gridOptions: VxeGridProps = {
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-meterInfo-index'
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
})
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
});
|
||||
})
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
modalApi.setData({})
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<MeterInfoForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
modalApi.setData({ id: row.id })
|
||||
modalApi.open()
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<MeterInfoForm>) {
|
||||
await meterInfoRemove(row.id);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(row.id)
|
||||
await tableApi.query()
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id);
|
||||
const rows = tableApi.grid.getCheckboxRecords()
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id)
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await meterInfoRemove(ids);
|
||||
await tableApi.query();
|
||||
await meterInfoRemove(ids)
|
||||
await tableApi.query()
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -131,48 +131,26 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="水电气列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:meterInfo:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
<a-button v-access:code="['property:meterInfo:export']" @click="handleDownloadExcel">
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click="handleMultiDelete">
|
||||
<a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary"
|
||||
v-access:code="['property:meterInfo:remove']" @click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<a-button type="primary" v-access:code="['property:meterInfo:add']" @click="handleAdd">
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:meterInfo:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
<ghost-button v-access:code="['property:meterInfo:edit']" @click.stop="handleEdit(row)">
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
<Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认删除?"
|
||||
@confirm="handleDelete(row)">
|
||||
<ghost-button danger v-access:code="['property:meterInfo:remove']" @click.stop="">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
@@ -0,0 +1,80 @@
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { handleNode } from '@vben/utils'
|
||||
import { Empty, Skeleton, Tree } from 'ant-design-vue'
|
||||
import { communityTree } from "#/api/property/community"
|
||||
import type { CommunityVO } from "#/api/property/community/model"
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true })
|
||||
|
||||
const emit = defineEmits<{
|
||||
/**
|
||||
* 点击刷新按钮的事件
|
||||
*/
|
||||
reload: []
|
||||
/**
|
||||
* 点击节点的事件
|
||||
*/
|
||||
select: []
|
||||
}>()
|
||||
|
||||
const selectFloorId = defineModel('selectFloorId', {
|
||||
type: Array as PropType<string[]>,
|
||||
})
|
||||
|
||||
const searchValue = defineModel('searchValue', {
|
||||
type: String,
|
||||
default: '',
|
||||
})
|
||||
|
||||
type TreeArray = CommunityVO[]
|
||||
const treeArray = ref<TreeArray>([])
|
||||
/** 骨架屏加载 */
|
||||
const showTreeSkeleton = ref<boolean>(true)
|
||||
|
||||
async function loadTree() {
|
||||
showTreeSkeleton.value = true
|
||||
searchValue.value = ''
|
||||
selectFloorId.value = []
|
||||
const ret = await communityTree(3)
|
||||
const splitStr = '/'
|
||||
handleNode(ret, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 3) {
|
||||
node.disabled = true
|
||||
}
|
||||
})
|
||||
treeArray.value = ret
|
||||
showTreeSkeleton.value = false
|
||||
}
|
||||
|
||||
onMounted(loadTree);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="$attrs.class">
|
||||
<Skeleton :loading="showTreeSkeleton" :paragraph="{ rows: 8 }" active class="p-[8px] flex-1 min-h-0">
|
||||
<div class="bg-background flex h-full flex-col overflow-y-auto rounded-lg">
|
||||
<div class="h-full overflow-x-hidden px-[8px]">
|
||||
<Tree v-bind="$attrs" v-if="treeArray.length > 0" v-model:selected-keys="selectFloorId"
|
||||
:field-names="{ title: 'label', key: 'id' }" :show-line="{ showLeafIcon: false }" :tree-data="treeArray"
|
||||
:virtual="false" default-expand-all @select="$emit('select')">
|
||||
<template #title="{ label }">
|
||||
<span v-if="label.indexOf(searchValue) > -1">
|
||||
{{ label.substring(0, label.indexOf(searchValue)) }}
|
||||
<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{ label.substring(label.indexOf(searchValue) + searchValue.length) }}
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</template>
|
||||
</Tree>
|
||||
<div v-else class="mt-5">
|
||||
<Empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</div>
|
||||
</template>
|
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
import { columns, querySchema } from './data'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui'
|
||||
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table'
|
||||
import { paymentReviewList, } from '#/api/property/costManagement/paymentReview'
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 30,
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-1 lg:grid-cols-3 xl:grid-cols-4',
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
highlight: true,
|
||||
reserve: true,
|
||||
},
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await paymentReviewList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-paymentReview-index'
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="用水费用报表" />
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
@@ -1,14 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
import {
|
||||
paymentReviewList,
|
||||
} from '#/api/property/costManagement/paymentReview';
|
||||
import { columns, querySchema } from './data';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import { columns, querySchema } from './data'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui'
|
||||
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table'
|
||||
import { paymentReviewList } from '#/api/property/costManagement/paymentReview'
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -19,7 +14,7 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
}
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -37,7 +32,7 @@ const gridOptions: VxeGridProps = {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -45,7 +40,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-paymentReview-index'
|
||||
};
|
||||
}
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
@@ -54,19 +49,10 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="用水环比分析列表"/>
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="用水环比分析列表" />
|
||||
</div>
|
||||
</Page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
}
|
||||
</style>
|
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<div class="energy-monitor-page">
|
||||
<div class="left-content">
|
||||
<FloorTree></FloorTree>
|
||||
</div>
|
||||
<div class="right-content">
|
||||
<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">
|
||||
@@ -52,9 +51,8 @@
|
||||
<div class="section-header">
|
||||
<div class="header-title">能耗趋势</div>
|
||||
</div>
|
||||
<RadioGroup v-model:value="energyTrendTime"
|
||||
button-style="solid"
|
||||
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
|
||||
<RadioGroup v-model:value="energyTrendTime" button-style="solid" size="small"
|
||||
@change="buildingEnergyTrendData(energyTrendTime)">
|
||||
<RadioButton value="2">当月</RadioButton>
|
||||
<RadioButton value="3">当年</RadioButton>
|
||||
</RadioGroup>
|
||||
@@ -74,14 +72,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import type { ECharts, EChartsOption } from 'echarts'
|
||||
import FloorTree from "../../electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import FloorTree from "../../electricEnergy/components/floor-tree.vue"
|
||||
|
||||
const chainData = reactive({
|
||||
currentMonthEnergy: '9',
|
||||
@@ -153,30 +153,30 @@ const initEnergyTrendChart = () => {
|
||||
}
|
||||
|
||||
function buildingEnergyTrendData(val: string) {
|
||||
const now = new Date();
|
||||
let timeArr = [];
|
||||
let valArr = [];
|
||||
let name = '日期';
|
||||
const now = new Date()
|
||||
let timeArr = []
|
||||
let valArr = []
|
||||
let name = '日期'
|
||||
if (val == '2') {
|
||||
const day = now.getDate()
|
||||
for (let i = 1; i < day; i++) {
|
||||
timeArr.push(i);
|
||||
valArr.push(parseFloat((Math.random() * 10).toFixed(2)));
|
||||
timeArr.push(i)
|
||||
valArr.push(parseFloat((Math.random() * 10).toFixed(2)))
|
||||
}
|
||||
} else {
|
||||
const month = now.getMonth() + 1;
|
||||
const month = now.getMonth() + 1
|
||||
for (let i = 1; i < month; i++) {
|
||||
timeArr.push(i);
|
||||
valArr.push(parseFloat((Math.random() * 80).toFixed(2)));
|
||||
timeArr.push(i)
|
||||
valArr.push(parseFloat((Math.random() * 80).toFixed(2)))
|
||||
}
|
||||
name = '月份';
|
||||
name = '月份'
|
||||
}
|
||||
|
||||
if (energyTrendInstance.value) {
|
||||
energyTrendInstance.value.setOption({
|
||||
xAxis: { data: timeArr, name },
|
||||
series: [{ data: valArr }],
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ const powerCurveOption: EChartsOption = {
|
||||
},
|
||||
},
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
const initPowerCurveChart = () => {
|
||||
if (powerCurveChart.value) {
|
||||
@@ -259,19 +259,19 @@ const initPowerCurveChart = () => {
|
||||
}
|
||||
|
||||
function buildingPowerCurveData() {
|
||||
const now = new Date();
|
||||
const month = now.getMonth()+1;
|
||||
let yearData = [];
|
||||
const now = new Date()
|
||||
const month = now.getMonth() + 1
|
||||
let yearData = []
|
||||
let timeDate = []
|
||||
for (let i = 1; i < month; i++) {
|
||||
timeDate.push(i+'月');
|
||||
yearData.push(parseFloat((Math.random() * 60).toFixed(2)));
|
||||
timeDate.push(i + '月')
|
||||
yearData.push(parseFloat((Math.random() * 60).toFixed(2)))
|
||||
}
|
||||
if (powerCurveInstance.value) {
|
||||
powerCurveInstance.value.setOption({
|
||||
xAxis: { data: timeDate },
|
||||
series: [{ data: yearData }],
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,34 +283,12 @@ onMounted(() => {
|
||||
|
||||
// 组件卸载前销毁图表实例
|
||||
onBeforeUnmount(() => {
|
||||
energyTrendInstance.value?.dispose();
|
||||
powerCurveInstance.value?.dispose();
|
||||
energyTrendInstance.value?.dispose()
|
||||
powerCurveInstance.value?.dispose()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.energy-monitor-page {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background-color: #f4f4f4;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.left-content {
|
||||
flex: 1;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.right-content {
|
||||
display: flex;
|
||||
flex: 4;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
@@ -324,9 +302,12 @@ onBeforeUnmount(() => {
|
||||
.energy-trend-container {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
.power-curve-container {
|
||||
margin-top: 10px;
|
||||
flex: 5;
|
||||
}
|
||||
|
||||
.energy-trend-top {
|
||||
display: flex;
|
||||
justify-content: space-between
|
||||
@@ -393,5 +374,4 @@ onBeforeUnmount(() => {
|
||||
.energy-chart {
|
||||
height: 30vh;
|
||||
}
|
||||
|
||||
</style>
|
@@ -1,24 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import {onMounted, ref} from "vue";
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
import { DatePicker } from 'ant-design-vue';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import dayjs from 'dayjs'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import * as echarts from 'echarts'
|
||||
import { onMounted, ref } from "vue"
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { DatePicker } from 'ant-design-vue'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
|
||||
const currentMonth = ref<Dayjs>(dayjs());
|
||||
const currentYear = ref<Dayjs>(dayjs());
|
||||
const currentMonth = ref<Dayjs>(dayjs())
|
||||
const currentYear = ref<Dayjs>(dayjs())
|
||||
const disabledMonth = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('month');
|
||||
};
|
||||
return current && current > dayjs().endOf('month')
|
||||
}
|
||||
const disabledYear = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('year');
|
||||
};
|
||||
return current && current > dayjs().endOf('year')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
//month
|
||||
const chartMonth = document.getElementById('month');
|
||||
const myChartMonth = echarts.init(chartMonth);
|
||||
const chartMonth = document.getElementById('month')
|
||||
const myChartMonth = echarts.init(chartMonth)
|
||||
const optionMonth = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -83,12 +84,12 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionMonth && myChartMonth.setOption(optionMonth);
|
||||
}
|
||||
optionMonth && myChartMonth.setOption(optionMonth)
|
||||
|
||||
//year
|
||||
const chartYear = document.getElementById('year');
|
||||
const myChartYear = echarts.init(chartYear);
|
||||
const chartYear = document.getElementById('year')
|
||||
const myChartYear = echarts.init(chartYear)
|
||||
const optionYear = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -153,8 +154,8 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionYear && myChartYear.setOption(optionYear);
|
||||
}
|
||||
optionYear && myChartYear.setOption(optionYear)
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -162,8 +163,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -171,8 +172,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartMonth.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -180,8 +181,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartMonth.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -189,46 +190,33 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;">
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<div class="flex-1 overflow-hidden">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;height: 50%;">
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<DatePicker
|
||||
v-model:value="currentMonth"
|
||||
:disabled-date="disabledMonth"
|
||||
picker="month"
|
||||
/>当月能耗总值:30.00t</div>
|
||||
<DatePicker v-model:value="currentMonth" :disabled-date="disabledMonth" picker="month" />当月能耗总值:30.00t
|
||||
</div>
|
||||
<div id="month" style="height: 350px;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
|
||||
<div id="month" style="height: 100%;width: 100%;"></div>
|
||||
</div>
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 50%;">
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<DatePicker
|
||||
v-model:value="currentYear"
|
||||
:disabled-date="disabledYear"
|
||||
picker="year"
|
||||
/>当年能耗总值:59.00t</div>
|
||||
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值:59.00t
|
||||
</div>
|
||||
<div id="year" style="height: 350px;width: 100%;"></div>
|
||||
</div>
|
||||
<div id="year" style="height: 100%;width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@@ -1,22 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import {onMounted, ref} from "vue";
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
import { Table } from 'ant-design-vue'
|
||||
import { DatePicker } from 'ant-design-vue';
|
||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
import * as echarts from 'echarts'
|
||||
import { onMounted, ref } from "vue"
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import dayjs from 'dayjs'
|
||||
import { Page } from '@vben/common-ui'
|
||||
import { Table, DatePicker } from 'ant-design-vue'
|
||||
import FloorTree from "../components/floor-tree.vue"
|
||||
import { SearchOutlined } from '@ant-design/icons-vue'
|
||||
|
||||
const currentYear = ref<Dayjs>(dayjs());
|
||||
const currentYear = ref<Dayjs>(dayjs())
|
||||
const disabledYear = (current: Dayjs) => {
|
||||
return current && current > dayjs().endOf('year');
|
||||
};
|
||||
return current && current > dayjs().endOf('year')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
//year
|
||||
const chartYear = document.getElementById('year');
|
||||
const myChartYear = echarts.init(chartYear);
|
||||
const chartYear = document.getElementById('year')
|
||||
const myChartYear = echarts.init(chartYear)
|
||||
const optionYear = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -81,8 +81,8 @@ onMounted(()=>{
|
||||
filterMode: 'filter',
|
||||
},
|
||||
],
|
||||
};
|
||||
optionYear && myChartYear.setOption(optionYear);
|
||||
}
|
||||
optionYear && myChartYear.setOption(optionYear)
|
||||
|
||||
// 鼠标悬停时激活缩放
|
||||
myChartYear.on('mouseover', { seriesIndex: 0 }, () => {
|
||||
@@ -90,8 +90,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: true,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
// 鼠标离开时取消缩放
|
||||
myChartYear.on('mouseout', { seriesIndex: 0 }, () => {
|
||||
@@ -99,8 +99,8 @@ onMounted(()=>{
|
||||
type: 'takeGlobalCursor',
|
||||
key: 'dataZoomSelect',
|
||||
dataZoomSelectActive: false,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const columns = [
|
||||
@@ -120,7 +120,7 @@ const columns = [
|
||||
title: '同比(%)',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
];
|
||||
]
|
||||
|
||||
const data = [...Array(32)].map((_, i) => ({
|
||||
key: i,
|
||||
@@ -131,43 +131,28 @@ const data = [...Array(32)].map((_, i) => ({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<FloorTree class="w-[260px]"></FloorTree>
|
||||
<div class="flex-1 overflow-hidden">
|
||||
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-bottom: 16px;">
|
||||
<div>
|
||||
年份
|
||||
<DatePicker
|
||||
style="margin: 0 10px;"
|
||||
v-model:value="currentYear"
|
||||
:disabled-date="disabledYear"
|
||||
picker="year"
|
||||
/>
|
||||
<DatePicker style="margin: 0 10px;" v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />
|
||||
<a-button type="primary">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
</div>
|
||||
<div id="year" style="height: 250px;width: 100%;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<Table
|
||||
style="border-radius: 8px;"
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:pagination="false"
|
||||
:scroll="{ y: '50vh' }"
|
||||
/>
|
||||
<Table style="border-radius: 8px;" :columns="columns" :data-source="data" :pagination="false"
|
||||
:scroll="{ y: '50vh' }" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@@ -89,7 +89,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'inspectResult',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.inspectResult, 'pro_inspection_results');
|
||||
return row.inspectResult!=null? renderDict(row.inspectResult, 'pro_inspection_results'):'';
|
||||
},
|
||||
},
|
||||
minWidth: '120',
|
||||
@@ -152,6 +152,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '服务地点',
|
||||
@@ -160,6 +161,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
defaultValue: undefined,
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '服务类型',
|
||||
@@ -226,50 +228,51 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '巡检结果',
|
||||
fieldName: 'inspectResult',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_inspection_results'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '处理措施',
|
||||
fieldName: 'measure',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '客户评分',
|
||||
fieldName: 'customerScore',
|
||||
component: 'Rate',
|
||||
componentProps: {
|
||||
allowHalf: false,
|
||||
count: 5,
|
||||
tooltips: ['1星', '2星', '3星', '4星', '5星'],
|
||||
defaultValue: 0,
|
||||
},
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '客户反馈',
|
||||
fieldName: 'customerAdvice',
|
||||
component: 'Textarea',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '处理状态',
|
||||
fieldName: 'state',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_processing_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
labelWidth: 100,
|
||||
},
|
||||
//
|
||||
// {
|
||||
// label: '巡检结果',
|
||||
// fieldName: 'inspectResult',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_inspection_results'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '处理措施',
|
||||
// fieldName: 'measure',
|
||||
// component: 'Textarea',
|
||||
// rules: 'required',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '客户评分',
|
||||
// fieldName: 'customerScore',
|
||||
// component: 'Rate',
|
||||
// componentProps: {
|
||||
// allowHalf: false,
|
||||
// count: 5,
|
||||
// tooltips: ['1星', '2星', '3星', '4星', '5星'],
|
||||
// defaultValue: 0,
|
||||
// },
|
||||
// rules: 'required',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '客户反馈',
|
||||
// fieldName: 'customerAdvice',
|
||||
// component: 'Textarea',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '处理状态',
|
||||
// fieldName: 'state',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_processing_status'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
];
|
||||
|
@@ -15,7 +15,6 @@ import type { PropertyForm } from '#/api/property/productManagement/model';
|
||||
import PlantsProductModal from './plantsProduct-modal.vue';
|
||||
import PlantsProductDetail from './plantsProduct-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import { ref } from 'vue';
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
|
@@ -5,6 +5,7 @@ import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import {plantsProductInfo} from '#/api/property/productManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
@@ -21,8 +22,11 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await plantsProductInfo(id);
|
||||
plantsProductDetail.value = response;
|
||||
plantsProductDetail.value = await plantsProductInfo(id);
|
||||
if(plantsProductDetail.value.imgPath){
|
||||
const res = await ossInfo([plantsProductDetail.value.imgPath]);
|
||||
plantsProductDetail.value.plantImg = res?.[0]?.url
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -55,15 +59,16 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(plantsProductDetail.state,'product_management_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片">
|
||||
<img :src="plantsProductDetail.imgPath" alt="">
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ plantsProductDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ plantsProductDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片" :span="2">
|
||||
<img v-if="plantsProductDetail.plantImg" :src="plantsProductDetail.plantImg" alt="图片加载失败" class="w-[100px] h-[100px]" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注" :span="2">
|
||||
{{ plantsProductDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -8,6 +8,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {knowledgeInfo} from "#/api/property/maintenance/knowledge";
|
||||
import type {KnowledgeVO} from "#/api/property/maintenance/knowledge/model";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -28,6 +29,14 @@ async function handleOpenChange(open: boolean) {
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
knowledgeDetail.value = await knowledgeInfo(id);
|
||||
if(knowledgeDetail.value.covers){
|
||||
try {
|
||||
const res = await ossInfo([knowledgeDetail.value.covers]);
|
||||
knowledgeDetail.value.coversPath = res?.[0]?.url;
|
||||
} catch (e) {
|
||||
knowledgeDetail.value.coversPath = '';
|
||||
}
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -50,7 +59,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="封面" :span="2">
|
||||
<img style="width: 100px" :src="knowledgeDetail.covers"/>
|
||||
<img style="width: 100px" :src="knowledgeDetail.coversPath" alt="图片加载失败"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发布时间" :span="2">
|
||||
{{ knowledgeDetail.releaseTime}}
|
||||
|
@@ -24,6 +24,7 @@ import {getDictOptions} from "#/utils/dict";
|
||||
import type {KnowledgeForm, KnowledgeVO} from "#/api/property/maintenance/knowledge/model";
|
||||
import {renderDict} from "#/utils/render";
|
||||
import knowledgeDetail from '../knowledge/knowledge-detail.vue';
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||
|
||||
const [KnowledgeModal, modalApi] = useVbenModal({
|
||||
@@ -66,6 +67,16 @@ const handleClean = () => {
|
||||
async function queryPageList() {
|
||||
const res = await knowledgeList(formState)
|
||||
pageList.value = res.rows
|
||||
for (const item of pageList.value) {
|
||||
if (item.covers) {
|
||||
try {
|
||||
const res = await ossInfo([item.covers]);
|
||||
item.coversPath = res?.[0]?.url;
|
||||
} catch (e) {
|
||||
item.coversPath = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
total.value = res.total
|
||||
}
|
||||
|
||||
@@ -132,7 +143,7 @@ async function handleInfo(row: Required<KnowledgeForm>) {
|
||||
<template #cover>
|
||||
<img class="card-img"
|
||||
alt="图片加载失败"
|
||||
:src="item.covers"/>
|
||||
:src="item.coversPath"/>
|
||||
</template>
|
||||
<CardMeta :title="item.title">
|
||||
<template #description>
|
||||
|
@@ -9,14 +9,15 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {personInfo} from '#/api/property/resident/person';
|
||||
import type {Person} from "#/api/property/resident/person/model";
|
||||
import type {PersonVO} from "#/api/property/resident/person/model";
|
||||
import {accessControlColumns,carColumns} from "#/views/property/resident/person/data";
|
||||
import {renderDict, renderDictValue} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
const personDetail = shallowRef<null | Person>(null);
|
||||
const personDetail = shallowRef<null | PersonVO>(null);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
@@ -38,7 +39,10 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
personDetail.value = await personInfo(id);
|
||||
|
||||
if(personDetail.value.img){
|
||||
const res = await ossInfo([personDetail.value.img]);
|
||||
personDetail.value.imgPath = res?.[0]?.url
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
@@ -64,7 +68,7 @@ async function handleOpenChange(open: boolean) {
|
||||
<!-- {{ personDetail.locathon }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="人脸图片">
|
||||
{{ personDetail.img }}
|
||||
<img v-if="personDetail.imgPath" :src="personDetail.imgPath" alt="图片加载失败" class="w-[100px] h-[100px]" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻时间">
|
||||
{{ personDetail.time}}
|
||||
|
@@ -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,8 +10,8 @@
|
||||
<Select
|
||||
v-model:value="formState.meetingRoomType"
|
||||
class="room-select"
|
||||
placeholder="请选择会议室类型"
|
||||
style="width: 180px;"
|
||||
placeholder="请选择类型"
|
||||
style="width: 150px;"
|
||||
>
|
||||
<SelectOption
|
||||
v-for="item in getDictOptions('meeting_room_type')"
|
||||
@@ -23,14 +23,14 @@
|
||||
</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 >
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
ConferenceSettingsDetail,
|
||||
MeetVO,
|
||||
} from '#/api/property/roomBooking/conferenceSettings/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
@@ -10,6 +10,7 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -21,7 +22,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
},
|
||||
});
|
||||
|
||||
const conferenceSettingsDetail = shallowRef<null | ConferenceSettingsDetail>(null);
|
||||
const conferenceSettingsDetail = shallowRef<null | MeetVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
@@ -30,6 +31,17 @@ async function handleOpenChange(open: boolean) {
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
conferenceSettingsDetail.value = await meetInfo(id);
|
||||
if (conferenceSettingsDetail.value?.picture) {
|
||||
const res = await ossInfo([conferenceSettingsDetail.value?.picture]);
|
||||
if (res) {
|
||||
let imgArr = [] as string[];
|
||||
res.forEach(item => {
|
||||
imgArr.push(item.url)
|
||||
})
|
||||
conferenceSettingsDetail.value.pictureArr = imgArr;
|
||||
}
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -67,7 +79,9 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ conferenceSettingsDetail.basePrice }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室图片" :span="2">
|
||||
{{ conferenceSettingsDetail.picture }}
|
||||
<div v-if="conferenceSettingsDetail.pictureArr">
|
||||
<img v-for="item in conferenceSettingsDetail.pictureArr" style="width: 100px;margin: 5px 10px;display: inline-block" :src="item" alt="图片加载失败">
|
||||
</div>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约是否审核">
|
||||
<component
|
||||
|
@@ -78,6 +78,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (record.openStartHours&&record.openEndHours) {
|
||||
record.openHours = [dayjs(record.openStartHours, 'HH:mm'), dayjs(record.openEndHours, 'HH:mm')];
|
||||
}
|
||||
if(record.picture){
|
||||
record.pictureArr=record.picture.split(';',)
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -99,6 +102,9 @@ async function handleConfirm() {
|
||||
data.openStartHours=data.openHours[0]?.format('HH:mm');
|
||||
data.openEndHours=data.openHours[1]?.format('HH:mm');
|
||||
}
|
||||
if(data.pictureArr){
|
||||
data.picture=data.pictureArr.join(';',)
|
||||
}
|
||||
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
|
@@ -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,
|
||||
@@ -184,7 +184,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '会议室图片',
|
||||
fieldName: 'picture',
|
||||
fieldName: 'pictureArr',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 10, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||
|
@@ -119,13 +119,13 @@ const { hasAccessByCodes } = useAccess();
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['system:meet:remove']"
|
||||
v-access:code="['property:meet:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['system:meet:add']"
|
||||
v-access:code="['property:meet:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
@@ -140,7 +140,7 @@ const { hasAccessByCodes } = useAccess();
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['system:meet:edit']"
|
||||
v-access:code="['property:meet:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
@@ -153,7 +153,7 @@ const { hasAccessByCodes } = useAccess();
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['system:meet:remove']"
|
||||
v-access:code="['property:meet:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
@@ -169,7 +169,7 @@ const { hasAccessByCodes } = useAccess();
|
||||
:unCheckedText="'停用'"
|
||||
v-model:value="row.status"
|
||||
:api="() => meetUpdate(row)"
|
||||
:disabled=" !hasAccessByCodes(['system:meet:edit'])"
|
||||
:disabled=" !hasAccessByCodes(['property:meet:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
|
@@ -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: '拜访时间',
|
||||
|
@@ -8,6 +8,8 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {visitorManagementInfo} from '#/api/property/visitorManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -28,6 +30,15 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await visitorManagementInfo(id);
|
||||
visitorTodoDetail.value = response;
|
||||
try {
|
||||
if (visitorTodoDetail.value.facePictures) {
|
||||
const res = await ossInfo([visitorTodoDetail.value.facePictures]);
|
||||
console.log(res,123)
|
||||
visitorTodoDetail.value.facePictures = res?.[0]?.url
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -44,8 +55,8 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="访客身份证">
|
||||
{{ visitorTodoDetail.idCard }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="人脸图片">
|
||||
{{ visitorTodoDetail.facePictures }}
|
||||
<DescriptionsItem label="人脸图片" v-if="visitorTodoDetail.facePictures" :span="2">
|
||||
<img :src="visitorTodoDetail.facePictures" alt="图片加载失败" class="w-[100px] h-[100px]"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属公司">
|
||||
{{ visitorTodoDetail.visitorUnit}}
|
||||
@@ -65,7 +76,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="拜访时间">
|
||||
{{ visitorTodoDetail.visitingBeginTime+' - '+visitorTodoDetail.visitingBeginTime }}
|
||||
{{ visitorTodoDetail.visitingBeginTime+' - '+visitorTodoDetail.visitingEndTime }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="是否预约车位" v-if="visitorTodoDetail.bookingParkingSpace!=null">-->
|
||||
<!-- <component-->
|
||||
|
@@ -1,77 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, type VbenFormProps } from '@vben/common-ui';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
import {
|
||||
paymentReviewList,
|
||||
} from '#/api/property/costManagement/paymentReview';
|
||||
import { columns, querySchema } from './data';
|
||||
import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 30,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
highlight: true,
|
||||
reserve: true,
|
||||
},
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await paymentReviewList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-paymentReview-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="left" style="margin: 16px 0 16px 16px"><FloorTree></FloorTree></div>
|
||||
<div class="right">
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="用水费用报表"/>
|
||||
</Page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
|
||||
.right {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,157 +1,171 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from 'vue'
|
||||
import { computed, ref, onMounted } from "vue";
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui'
|
||||
import { $t } from '@vben/locales'
|
||||
import { cloneDeep } from '@vben/utils'
|
||||
import { useVbenModal } from "@vben/common-ui";
|
||||
import { $t } from "@vben/locales";
|
||||
import { cloneDeep } from "@vben/utils";
|
||||
|
||||
import { useVbenForm } from '#/adapter/form'
|
||||
import { authGroupAdd, authGroupInfo, authGroupUpdate } from '#/api/sis/authGroup'
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
|
||||
import { queryTree } from '#/api/sis/authRecord'
|
||||
import { message, Tree } from 'ant-design-vue'
|
||||
import { useVbenForm } from "#/adapter/form";
|
||||
import {
|
||||
authGroupAdd,
|
||||
authGroupInfo,
|
||||
authGroupUpdate,
|
||||
} from "#/api/sis/authGroup";
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup";
|
||||
import { queryTree } from "#/api/sis/authRecord";
|
||||
import { message, Tree } from "ant-design-vue";
|
||||
|
||||
import { modalSchema } from './data'
|
||||
import { modalSchema } from "./data";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>()
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false)
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add')
|
||||
})
|
||||
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add");
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: "col-span-2",
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
class: "w-full",
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
})
|
||||
wrapperClass: "grid-cols-2",
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: "w-[550px]",
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true)
|
||||
loadDeviceTree()
|
||||
const { id } = modalApi.getData() as { id?: number | string }
|
||||
isUpdate.value = !!id
|
||||
modalApi.modalLoading(true);
|
||||
loadDeviceTree();
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
if (isUpdate.value && id) {
|
||||
const record = await authGroupInfo(id)
|
||||
const record = await authGroupInfo(id);
|
||||
|
||||
checkedKeys.value = (record.acIds || []).concat(record.floorIds || [])
|
||||
checkedKeys.value = (record.acIds || []).concat(record.floorIds || []);
|
||||
|
||||
await formApi.setValues(record)
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized()
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false)
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true)
|
||||
const { valid } = await formApi.validate()
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
if (eleIds.value.length === 0 && acIds.value.length === 0) {
|
||||
message.error('请选择授权设备')
|
||||
return
|
||||
message.error("请选择授权设备");
|
||||
return;
|
||||
}
|
||||
|
||||
const data = cloneDeep(await formApi.getValues())
|
||||
data.acIds = acIds.value
|
||||
data.eleIds = eleIds.value
|
||||
data.floorIds = floorIds.value
|
||||
await (isUpdate.value ? authGroupUpdate(data) : authGroupAdd(data))
|
||||
resetInitialized()
|
||||
emit('reload')
|
||||
modalApi.close()
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.acIds = acIds.value;
|
||||
data.eleIds = eleIds.value;
|
||||
data.floorIds = floorIds.value;
|
||||
await (isUpdate.value ? authGroupUpdate(data) : authGroupAdd(data));
|
||||
resetInitialized();
|
||||
emit("reload");
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false)
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm()
|
||||
checkedKeys.value = []
|
||||
resetInitialized()
|
||||
await formApi.resetForm();
|
||||
checkedKeys.value = [];
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const treeData = ref([])
|
||||
const treeData = ref([]);
|
||||
function loadDeviceTree() {
|
||||
queryTree().then((data: any) => {
|
||||
treeData.value = data
|
||||
})
|
||||
data[0].children.forEach((item: any) => {
|
||||
if (item.code === 2) {
|
||||
item.disabled = true;
|
||||
item.children.forEach((item: any) => {
|
||||
item.disabled = true;
|
||||
item.children.forEach((item: any) => {
|
||||
item.disabled = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
treeData.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const fieldNames = {
|
||||
title: 'title',
|
||||
label: 'label',
|
||||
key: 'code',
|
||||
children: 'children',
|
||||
}
|
||||
title: "title",
|
||||
label: "label",
|
||||
key: "code",
|
||||
children: "children",
|
||||
};
|
||||
|
||||
const checkedKeys = ref<any[]>([])
|
||||
type Key = string | number
|
||||
const eleIds = ref<any[]>([])
|
||||
const acIds = ref<any[]>([])
|
||||
const floorIds = ref<any[]>([])
|
||||
function handleCheck(checked: Key[] | { checked: Key[]; halfChecked: Key[] }, info: any) {
|
||||
|
||||
acIds.value = []
|
||||
eleIds.value = []
|
||||
floorIds.value = []
|
||||
const checkedKeys = ref<any[]>([]);
|
||||
type Key = string | number;
|
||||
const eleIds = ref<any[]>([]);
|
||||
const acIds = ref<any[]>([]);
|
||||
const floorIds = ref<any[]>([]);
|
||||
function handleCheck(
|
||||
checked: Key[] | { checked: Key[]; halfChecked: Key[] },
|
||||
info: any
|
||||
) {
|
||||
acIds.value = [];
|
||||
eleIds.value = [];
|
||||
floorIds.value = [];
|
||||
|
||||
info.checkedNodesPositions.forEach((item: any) => {
|
||||
switch (item.node.label) {
|
||||
case 'accessControl':
|
||||
acIds.value = acIds.value.concat(item.node.code)
|
||||
break
|
||||
case 'floor':
|
||||
floorIds.value = floorIds.value.concat(item.node.code)
|
||||
eleIds.value = eleIds.value.concat(item.node.parentCode)
|
||||
break
|
||||
case 'elevator':
|
||||
eleIds.value = eleIds.value.concat(item.node.code)
|
||||
break
|
||||
case "accessControl":
|
||||
acIds.value = acIds.value.concat(item.node.code);
|
||||
break;
|
||||
case "floor":
|
||||
floorIds.value = floorIds.value.concat(item.node.code);
|
||||
eleIds.value = eleIds.value.concat(item.node.parentCode);
|
||||
break;
|
||||
case "elevator":
|
||||
eleIds.value = eleIds.value.concat(item.node.code);
|
||||
break;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 去重
|
||||
acIds.value = [...new Set(acIds.value)]
|
||||
eleIds.value = [...new Set(eleIds.value)]
|
||||
floorIds.value = [...new Set(floorIds.value)]
|
||||
acIds.value = [...new Set(acIds.value)];
|
||||
eleIds.value = [...new Set(eleIds.value)];
|
||||
floorIds.value = [...new Set(floorIds.value)];
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -159,7 +173,10 @@ function handleCheck(checked: Key[] | { checked: Key[]; halfChecked: Key[] }, in
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<div class="p-4">
|
||||
<Tree checkable :tree-data="treeData" :fieldNames="fieldNames" v-model:checkedKeys="checkedKeys"
|
||||
<Tree checkable
|
||||
:tree-data="treeData"
|
||||
:fieldNames="fieldNames"
|
||||
v-model:checkedKeys="checkedKeys"
|
||||
:onCheck="handleCheck">
|
||||
</Tree>
|
||||
</div>
|
||||
|
@@ -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,6 +58,7 @@ onMounted(() => {
|
||||
});
|
||||
function getRetUrlParam() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
console.log('urlParams', urlParams);
|
||||
return urlParams.get('returl');
|
||||
}
|
||||
const retUrl: string | null = getRetUrlParam();
|
||||
@@ -66,47 +67,50 @@ 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,7 +126,11 @@ 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="请输入您的用户名"
|
||||
@@ -132,7 +140,11 @@ const handleAccountLogin = async () => {
|
||||
|
||||
<!-- 密码输入 -->
|
||||
<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="请输入您的密码"
|
||||
@@ -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,9 +306,11 @@ 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;
|
||||
@@ -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;
|
||||
|
@@ -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