This commit is contained in:
2025-09-12 10:00:09 +08:00
19 changed files with 176 additions and 95 deletions

View File

@@ -60,6 +60,14 @@ export interface HouseChargeVO {
chargeStatus: string;
personId: string;
/**
* 单位
*/
residentUnitText: string;
/**
* 单位面积
*/
area: number;
}
export interface HouseChargeForm extends BaseEntity {

View File

@@ -36,6 +36,7 @@ export interface Resident_unitVO {
*/
location: string;
locations: string[];
locationDetail: string;
/**
* 入驻时间

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

View File

@@ -27,7 +27,7 @@ const [BasicModal, modalApi] = useVbenModal({
},
});
const orderDetail = shallowRef<null | WorkOrdersVO>(null);
const orderDetail = ref<null | WorkOrdersVO>(null);
const handleRecords = ref<HandleRecords[]>([])
async function handleOpenChange(open: boolean) {

View File

@@ -35,8 +35,8 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{
title: '房屋',
field: 'roomName',
title: '单位',
field: 'residentUnitText',
minWidth: 150,
},
{
@@ -104,12 +104,33 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '房屋',
fieldName: 'roomId',
component: 'TreeSelect',
label: '单位',
fieldName: 'residentUnitId',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
formItemClass: 'col-span-2',
},
{
label: '入驻房间',
fieldName: 'roomInfo',
component: 'Input',
dependencies: {
show: (fromValue) => fromValue.residentUnitId,
triggerFields: ['residentUnitId'],
},
formItemClass: 'col-span-2',
},
{
label: '单位面积',
fieldName: 'area',
component: 'Input',
dependencies: {
show: (fromValue) => fromValue.residentUnitId,
triggerFields: ['residentUnitId'],
},
formItemClass: 'col-span-2',
},
{
label: '业主',

View File

@@ -59,11 +59,11 @@ async function handleOpenChange(open: boolean) {
<DescriptionsItem label="计费时间">
{{ houseChargeDetail.startTime + ' 至 ' + houseChargeDetail.endTime }}
</DescriptionsItem>
<DescriptionsItem label="房间">
{{ room?.roomNumber }}
<DescriptionsItem label="单位">
{{ houseChargeDetail?.residentUnitText }}
</DescriptionsItem>
<DescriptionsItem label="房间面积">
{{ `建筑面积:${room?.area} 套内面积:${room?.insideInArea}` }}
<DescriptionsItem label="单位面积">
{{ `${houseChargeDetail?.area} (㎡)` }}
</DescriptionsItem>
<DescriptionsItem label="单价">
{{ costItem?.unitPrice }}

View File

@@ -121,11 +121,11 @@ async function handleClosed() {
<DescriptionsItem label="计费起始">
{{ record.startTime }}
</DescriptionsItem>
<DescriptionsItem label="房间">
{{ room?.roomNumber }}
<DescriptionsItem label="单位">
{{ record.residentUnitText }}
</DescriptionsItem>
<DescriptionsItem label="面积(㎡)">
{{ `${room?.area} 套内面积:${room?.insideInArea}` }}
<DescriptionsItem label="单位面积">
{{ `${record.area} ` }}
</DescriptionsItem>
<DescriptionsItem label="单价">
{{ costItem?.unitPrice }}

View File

@@ -20,6 +20,7 @@ import type { CostItemSettingVO } from '#/api/property/costManagement/costItemSe
import { getDictOptions } from '#/utils/dict';
import { personList } from '#/api/property/resident/person';
import { renderDictValue } from '#/utils/render';
import {resident_unitInfo, resident_unitList} from "#/api/property/resident/unit";
const emit = defineEmits<{ reload: [] }>();
@@ -32,7 +33,7 @@ const title = computed(() => {
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
formItemClass: 'col-span-1',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
@@ -54,7 +55,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
class: 'w-[70%]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
@@ -64,10 +65,10 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
await initRoomOptions();
await queryCostItemOptions();
await queryCostItemOptions(null);
await initCostTypeOptions();
await queryPersonData();
await queryUnitData();
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
@@ -111,46 +112,10 @@ async function handleClosed() {
resetInitialized();
}
/**
* 房间数据
*/
async function initRoomOptions() {
const roomList = await communityTree(4);
const splitStr = '/';
handleNode(roomList, 'label', splitStr, function (node: any) {
if (node.level != 4) {
node.disabled = true;
}
});
formApi.updateSchema([
{
componentProps: () => ({
class: 'w-full',
fieldNames: {
key: 'id',
label: 'label',
value: 'code',
children: 'children',
},
placeholder: '请选择房间',
showSearch: true,
treeData: roomList,
treeDefaultExpandAll: true,
treeLine: { showLeafIcon: false },
// 筛选的字段
treeNodeFilterProp: 'label',
// 选中后显示在输入框的值
treeNodeLabelProp: 'fullName',
}),
fieldName: 'roomId',
},
]);
}
/**
* 查询费用项设置
*/
async function queryCostItemOptions(costType: string) {
async function queryCostItemOptions(costType: string|null) {
let params = {
pageSize: 1000,
pageNum: 1,
@@ -233,10 +198,57 @@ async function queryPersonData() {
},
]);
}
//查询入驻单位数据
async function queryUnitData() {
let params = {
pageSize: 1000,
pageNum: 1,
};
const res = await resident_unitList(params);
const options = res.rows.map((unit) => ({
label:unit.name,
value: unit.id,
}));
formApi.updateSchema([
{
componentProps: () => ({
options: options,
showSearch: true,
optionFilterProp: 'label',
optionLabelProp: 'label',
onChange: async (value: string) => {
if (value) {
await queryRoomByUnit(value);
}
},
}),
fieldName: 'residentUnitId',
},
]);
}
async function queryRoomByUnit(unitId: string) {
let unitInfo = await resident_unitInfo(unitId);
if(unitInfo&&unitInfo.locationDetail){
await formApi.setFieldValue('roomInfo', unitInfo.locationDetail);
await formApi.setFieldValue('area', unitInfo.area);
}
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
<BasicForm>
<template #roomInfo="slotProps">
<div>
{{slotProps.field.value}}
</div>
</template>
<template #area="slotProps">
<div>
{{slotProps.field.value}}
</div>
</template>
</BasicForm>
</BasicModal>
</template>

View File

@@ -6,7 +6,6 @@ import {cloneDeep} from '@vben/utils';
import {useVbenForm} from '#/adapter/form';
import {
houseChargeAdd,
houseChargeInfo,
houseChargeUpdate
} from '#/api/property/costManagement/houseCharge';
@@ -123,11 +122,11 @@ async function handleClosed() {
<DescriptionsItem label="计费起始">
{{ record.startTime }}
</DescriptionsItem>
<DescriptionsItem label="房间">
{{ room?.roomNumber }}
<DescriptionsItem label="单位">
{{ record.residentUnitText }}
</DescriptionsItem>
<DescriptionsItem label="面积(㎡)">
{{ `${room?.area} 套内面积:${room?.insideInArea}` }}
<DescriptionsItem label="单位面积">
{{ `${record.area} ` }}
</DescriptionsItem>
<DescriptionsItem label="单价">
{{ costItem?.unitPrice }}

View File

@@ -5,11 +5,11 @@ import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'roomNumber',
label: '房屋',
},
// {
// component: 'Input',
// fieldName: 'roomNumber',
// label: '房屋',
// },
{
component: 'Select',
componentProps: {

View File

@@ -42,7 +42,7 @@
</div>
<div class="header-item">
<span class="header-label">设备总数</span>
<span class="header-value green">500</span>
<span class="header-value green">{{total}}</span>
<span class="header-unit"></span>
</div>
</div>
@@ -160,6 +160,7 @@
<script setup lang="ts">
import {getStatistics,getworkOrder,getTodayMeetCount,getHydropower,getAccessControl,getCamera,queryTwentyfourRunningDatasByPlNos,getVisitorCount} from '#/api/analytics';
import AnalyticsTrends from './analytics-trends.vue';
import { computed } from 'vue';
import { Radio } from 'ant-design-vue';
import {EchartsUI, useEcharts} from "@vben/plugins/echarts";
@@ -194,10 +195,11 @@ const handleTodayMeetCount = async () => {
};
// 水
const water = ref();
const waterTotal = ref();
const { renderEcharts: renderWater } = useEcharts(water);
async function fetchWater() {
const data = await getHydropower()
const total = data.water.off + data.water.on;
waterTotal.value = data.water.off + data.water.on;
const waterData = [
{ name: '离线', value: data.water.off },
{ name: '在线', value: data.water.on }
@@ -229,7 +231,7 @@ async function fetchWater() {
label: {
show: true,
position: 'center',
formatter: `${total}`,
formatter: `${waterTotal.value}`,
fontSize: 14,
color: '#fff',
fontWeight: 'bold'
@@ -250,10 +252,11 @@ async function fetchWater() {
}
// 电
const electricity = ref();
const electricityTotal = ref();
const { renderEcharts: renderElectricity } = useEcharts(electricity);
async function fetchElectricity() {
const data = await getHydropower()
const total = data.power.off + data.power.on;
electricityTotal.value = data.power.off + data.power.on;
const electricityData = [
{ name: '离线', value: data.power.off },
{ name: '在线', value: data.power.on }
@@ -285,7 +288,7 @@ async function fetchElectricity() {
label: {
show: true,
position: 'center',
formatter: `${total}`,
formatter: `${electricityTotal.value}`,
fontSize: 14,
color: '#fff',
fontWeight: 'bold'
@@ -306,10 +309,11 @@ async function fetchElectricity() {
}
// 门禁
const accessControl = ref();
const accessControlTotal = ref();
const { renderEcharts: renderAccessControl } = useEcharts(accessControl);
async function fetchAccessControl() {
const data = await getAccessControl()
const total = data.off + data.on;
accessControlTotal.value = data.off + data.on;
const accessControlData = [
{ name: '离线', value: data.off },
{ name: '在线', value: data.on }
@@ -341,7 +345,7 @@ async function fetchAccessControl() {
label: {
show: true,
position: 'center',
formatter: `${total}`,
formatter: `${accessControlTotal.value}`,
fontSize: 14,
color: '#fff',
fontWeight: 'bold'
@@ -362,10 +366,11 @@ async function fetchAccessControl() {
}
// 摄像头
const camera = ref();
const cameraTotal = ref();
const { renderEcharts: renderCamera } = useEcharts(camera);
async function fetchCamera() {
const data = await getCamera()
const total = data.off + data.on;
cameraTotal.value = data.off + data.on;
const cameraData = [
{ name: '离线', value: data.off },
{ name: '在线', value: data.on }
@@ -397,7 +402,7 @@ async function fetchCamera() {
label: {
show: true,
position: 'center',
formatter: `${total}`,
formatter: `${cameraTotal.value}`,
fontSize: 14,
color: '#fff',
fontWeight: 'bold'
@@ -416,6 +421,9 @@ async function fetchCamera() {
]
})
}
const total = computed(() => {
return Number(waterTotal.value) + Number(electricityTotal.value) + Number(cameraTotal.value) + Number(accessControlTotal.value);
});
//顶部 电
const powerMonth = ref();
const powerYear = ref();
@@ -530,14 +538,30 @@ const initBarChart = async () => {
const initPowerChart = async () => {
if (!powerChart.value) return;
const chart = echarts.init(powerChart.value);
await getVisitorCount()
console.log(await getVisitorCount(),252)
const res = await getVisitorCount()
const visitorData = [];
const invitationData = [];
res.forEach(item => {
const { type, todayCounts } = item;
Object.entries(todayCounts).forEach(([date, count]) => {
const dataItem = { date, value: count };
if (type === "访客") {
visitorData.push(dataItem);
} else if (type === "邀约") {
invitationData.push(dataItem);
}
});
});
const dates = visitorData.map(item => item.date);
const visitor = visitorData.map(item => item.value);
const invitation = invitationData.map(item => item.value);
console.log(dates,1,visitor,2,invitation)
const option = {
tooltip: { trigger: 'axis' },
grid: { left: 40, right: 20, top: 50, bottom: 20 },
xAxis: {
type: 'category',
data: [80, 120, 100, 180, 150, 120, 60, 40],
data: dates,
axisLine: { lineStyle: { color: '#3ec6ff' } },
axisLabel: { color: '#fff' },
},
@@ -549,8 +573,8 @@ const initPowerChart = async () => {
},
series: [
{
name: '车流',
data: [80, 180, 100, 180, 150, 120, 60, 40],
name: '访客',
data: visitor,
type: 'line',
smooth: true,
itemStyle: { color: '#b388ff' },
@@ -560,8 +584,8 @@ const initPowerChart = async () => {
symbolSize: 0,
},
{
name: '去年',
data: [80, 120, 100, 180, 150, 120, 60, 40],
name: '邀约',
data: invitation,
type: 'line',
smooth: true,
itemStyle: { color: '#ffb300' },
@@ -680,7 +704,7 @@ onBeforeUnmount(() => {
}
.mian {
height: 100vh;
background: url('../../../assets/property/bg1.png');
background: url('../../../assets/property/bg.png');
background-size: 100% 100%;
background-color: #081b3a;
display: flex;

View File

@@ -1,11 +1,20 @@
<script setup lang="ts">
import { ref, shallowRef } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { Descriptions, DescriptionsItem, Image, Tag,Divider } from 'ant-design-vue';
import {
Descriptions,
DescriptionsItem,
Divider,
Image,
Tag,
} from 'ant-design-vue';
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
import { fallImg } from '../../common';
import {alarmEventProcessList, queryResult} from '#/api/sis/alarmEventProcess';
import {
alarmEventProcessList,
queryResult,
} from '#/api/sis/alarmEventProcess';
import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
const [BasicModal, modalApi] = useVbenModal({
@@ -34,8 +43,8 @@ async function handleOpenChange(open: boolean) {
}
// 加载事件附件信息
currFiles.value = await queryAlarmEventAttachmentsList(id);
const d = await queryResult(id)
console.log(d)
const d = await queryResult(id);
console.log(d);
// 加载处理流程
loadProcessList();
modalApi.modalLoading(false);
@@ -80,11 +89,11 @@ function loadProcessList() {
</DescriptionsItem>
<DescriptionsItem label="设备IP"
>{{ warningDetail.deviceIp }}
>{{ warningDetail.deviceIp }}
</DescriptionsItem>
<DescriptionsItem label="设备名称"
>{{ warningDetail.deviceName }}
>{{ warningDetail.deviceName }}
</DescriptionsItem>
<DescriptionsItem label="预警位置" :span="2">
{{ warningDetail.deviceName }}
@@ -131,7 +140,8 @@ function loadProcessList() {
:column="2"
bordered
:labelStyle="{ width: '120px' }"
style="margin-bottom: 30px">
style="margin-bottom: 30px"
>
<DescriptionsItem label="处理状态">
<Tag>
{{ warningDetail.stateName }}

View File

@@ -34,6 +34,15 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'level',
label: '预警级别',
},
{
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.alarm_state, true),
},
fieldName: 'state',
label: '事件状态',
},
];
export const columns: VxeGridProps['columns'] = [

View File

@@ -48,7 +48,7 @@ const gridOptions: VxeGridProps = {
return await alarmEventsList({
pageNum: page.currentPage,
pageSize: page.pageSize,
state: 10,
// state: 10,
...formValues,
});
},

View File

@@ -11,7 +11,6 @@ import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
// warningDetail.value = null;
modalApi.close();
},
});

View File

@@ -17,7 +17,6 @@ import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
// warningDetail.value = null;
modalApi.close();
},
});

View File

@@ -32,7 +32,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
currentGetter: defaultFormValueGetter(formApi),
},
);
let currentSelectData: any = null;
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[70%]',
fullscreenButton: false,
@@ -89,8 +88,8 @@ async function handleConfirm() {
};
await alarmEventComplete(params);
resetInitialized();
emit('reload');
modalApi.close();
emit('reload');
} catch (error) {
console.error(error);
} finally {