18 Commits

Author SHA1 Message Date
29c20f6403 Merge pull request 'master' (#1) from master into prod
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 12m27s
Reviewed-on: #1
2025-08-26 14:15:20 +08:00
FLL
d6da044b48 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5 2025-08-26 11:25:20 +08:00
FLL
8c062feef0 缴费审核 2025-08-26 11:25:01 +08:00
90b9b2b7a9 发布生产
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 12m36s
2025-08-26 11:07:50 +08:00
lsm
bc59c2c22f 更新 .gitea/workflows/dev.yml 2025-08-25 18:37:11 +08:00
FLL
90eceb508a Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 15m9s
2025-08-25 17:29:51 +08:00
FLL
f794f6a8a9 权限 2025-08-25 17:29:43 +08:00
fyy
6cc969e56a feat: 修改首页数据
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 17:28:11 +08:00
fyy
6ca27444e0 feat: 修改首页数据
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 11m28s
2025-08-25 17:12:48 +08:00
fyy
2f2f8fb798 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 17:06:25 +08:00
fyy
1de539ddde feat: 隐藏导航页面 2025-08-25 17:04:41 +08:00
67b80d7687 feat:入驻单位入驻位置多选
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 17:00:32 +08:00
b44fa6ee7f 更新 .gitea/workflows/dev.yml
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 23m35s
2025-08-25 16:32:44 +08:00
FLL
559bd55153 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 16:17:41 +08:00
FLL
cc24027880 权限 2025-08-25 16:17:29 +08:00
fyy
66b7cc44e9 fix: 水电抄表查询抄表类型
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 16:14:11 +08:00
5f3ae86698 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
/ Explore-Gitea-Actions (push) Has been cancelled
2025-08-25 15:46:13 +08:00
84ff3d21b4 refactor(property): 重构能源管理相关页面布局 2025-08-25 15:46:05 +08:00
52 changed files with 1192 additions and 1173 deletions

View File

@@ -2,30 +2,32 @@ 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
with:
node-version: 20.x
- name: 安装pnpm
run: npm i pnpm -g
- name: 安装依赖
run: pnpm install
run: pnpm install
continue-on-error: false # 依赖安装失败则终止工作流
- name: 构建项目
run: pnpm build:antd
continue-on-error: false # 构建失败则终止工作流
- name: 检查构建结果
run: |
if [ ! -d "./apps/web-antd/dist" ]; then
@@ -36,7 +38,7 @@ jobs:
echo "构建目录为空,构建失败"
exit 1
fi
- name: 通过SSH复制文件
run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property
run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property

View File

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

View File

@@ -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: '返回导航',
// },
];
/**
* 租户选中状态 不显示个人中心

View File

@@ -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) {

View File

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

View File

@@ -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,
},
];

View File

@@ -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');
@@ -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,

View File

@@ -35,7 +35,7 @@ export const columns: VxeGridProps['columns'] = [
},
{
title: '抄表类型',
field: 'meterTypeId',
field: 'costTypeName',
},
{
title: '本期度数',

View File

@@ -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: '费用项目',

View File

@@ -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="费用项目">

View File

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

View File

@@ -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',
}
];

View File

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

View File

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

View File

@@ -1,14 +1,16 @@
<script setup lang="ts">
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,18 +56,16 @@ 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="用电费用报表"/>
</Page>
<Page :auto-content-height="true">
<div class="flex h-full gap-[8px]">
<FloorTree></FloorTree>
<BasicTable class="flex-1 overflow-hidden" table-title="用电费用报表" />
</div>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
.box {
display: grid;
grid-template-columns: 1fr 3fr;

View File

@@ -1,120 +1,120 @@
<template>
<div class="energy-monitor-page">
<div class="left-content">
<FloorTree></FloorTree>
</div>
<div class="right-content">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.todayEnergy }}</div>
<div class="item-title">今日用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.yesterdaySamePeriodEnergy }}</div>
<div class="item-title">昨日同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.dayTrendPercentage }}</div>
<div>{{ chainData.dayTrendValue }}<span class="item-unit">kW.h</span></div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
</div>
<div class="energy-trend-container">
<div class="energy-trend-top">
<Page :auto-content-height="true">
<div class="flex h-full gap-[8px]">
<FloorTree class="w-[260px]"></FloorTree>
<div class="flex-1 overflow-hidden">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">能耗趋势</div>
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.todayEnergy }}</div>
<div class="item-title">今日用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.yesterdaySamePeriodEnergy }}</div>
<div class="item-title">昨日同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.dayTrendPercentage }}</div>
<div>{{ chainData.dayTrendValue }}<span class="item-unit">kW.h</span></div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用能(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(kW.h)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">kW.h</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
<RadioGroup v-model:value="energyTrendTime"
button-style="solid"
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="1">当日</RadioButton>
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="chart-placeholder" ref="energyTrendChart">
<div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header">
<div class="header-title">能耗趋势</div>
</div>
<RadioGroup v-model:value="energyTrendTime" button-style="solid" size="small"
@change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="1">当日</RadioButton>
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="chart-placeholder" ref="energyTrendChart">
</div>
</div>
</div>
</div>
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">日用电功率曲线</div>
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">日用电功率曲线</div>
</div>
<!-- <div class="chart-placeholder" ref="powerCurveChart">-->
<div class="power-chart" ref="powerCurveChart">
</div>
</div>
<!-- <div class="chart-placeholder" ref="powerCurveChart">-->
<div class="power-chart" ref="powerCurveChart">
</div>
</div>
<div class="power-peak-container">
<div class="section-header">
<div class="header-title">电功率峰值</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.todayPeakPower }}</p>
<p class="time">{{ peakData.todayPeakTime }}</p>
<div class="bottom-text">当日(kW)</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.yesterdayPeakPower }}</p>
<p class="time">{{ peakData.yesterdayPeakTime }}</p>
<div class="bottom-text">昨日(kW)</div>
<div class="power-peak-container">
<div class="section-header">
<div class="header-title">电功率峰值</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.todayPeakPower }}</p>
<p class="time">{{ peakData.todayPeakTime }}</p>
<div class="bottom-text">当日(kW)</div>
</div>
<div class="peak-item">
<p class="value">{{ peakData.yesterdayPeakPower }}</p>
<p class="time">{{ peakData.yesterdayPeakTime }}</p>
<div class="bottom-text">昨日(kW)</div>
</div>
</div>
</div>
</div>
</div>
</div>
</Page>
</template>
<script setup lang="ts">
import {RadioGroup, RadioButton} from 'ant-design-vue'
import {ref, onMounted, onBeforeUnmount, reactive} from 'vue'
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 type { ECharts, EChartsOption } from 'echarts'
import FloorTree from "../components/floor-tree.vue"
import dayjs from "dayjs"
const chainData = reactive({
todayEnergy: '231.78',
@@ -166,8 +166,8 @@ const energyTrendOption: EChartsOption = {
type: 'bar',
markPoint: {
data: [
{type: 'max', name: 'Max'},
{type: 'min', name: 'Min'}
{ type: 'max', name: 'Max' },
{ type: 'min', name: 'Min' }
]
},
}
@@ -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}],
});
xAxis: { data: timeArr, name },
series: [{ data: valArr }],
})
}
}
@@ -248,8 +248,8 @@ const powerCurveOption: EChartsOption = {
},
toolbox: {
feature: {
magicType: {show: true, type: ['line', 'bar']},
restore: {show: true},
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
}
},
legend: {
@@ -279,8 +279,8 @@ const powerCurveOption: EChartsOption = {
data: [],
markPoint: {
data: [
{type: 'max',},
{type: 'min',}
{ type: 'max', },
{ type: 'min', }
]
},
},
@@ -291,15 +291,15 @@ const powerCurveOption: EChartsOption = {
data: [],
markPoint: {
data: [
{type: 'max',},
{type: 'min',}
{ type: 'max', },
{ type: 'min', }
]
},
itemStyle: {color: '#cbb0e3'}, //
lineStyle: {color: '#cbb0e3'} // 线
itemStyle: { color: '#cbb0e3' }, //
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}],
});
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,13 +455,15 @@ onBeforeUnmount(() => {
justify-content: center;
border-radius: 4px;
}
.power-chart{
.power-chart {
height: 38vh;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.peak-item {
padding: 15px 0 0 0;
border: 1px solid #3671e8;

View File

@@ -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(()=>{
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'
@@ -41,14 +42,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'时',
data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00','12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
name: '时',
data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
}
],
yAxis: [
{
type: 'value',
name:'KW.h'
name: 'KW.h'
}
],
series: [
@@ -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'
@@ -111,14 +112,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'日',
name: '日',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
}
],
yAxis: [
{
type: 'value',
name:'KW.h'
name: 'KW.h'
}
],
series: [
@@ -126,7 +127,7 @@ onMounted(()=>{
name: '当月',
type: 'bar',
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
],
markPoint: {
data: [
@@ -139,7 +140,7 @@ onMounted(()=>{
name: '上月',
type: 'bar',
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
],
markPoint: {
data: [
@@ -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'
@@ -181,14 +182,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'月',
name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
}
],
yAxis: [
{
type: 'value',
name:'KW.h'
name: 'KW.h'
}
],
series: [
@@ -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">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentDay"
:disabled-date="disabledDay"
/>125.04KW.h</div>
<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>
</div>
<div id="day" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentMonth" :disabled-date="disabledMonth" picker="month" />当月能耗总值125.04KW.h
</div>
</div>
<div id="month" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 33%">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值125.04KW.h
</div>
</div>
<div id="year" style="height: 100%;width: 100%;"></div>
</div>
</div>
<div id="day" style="height: 250px;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentMonth"
:disabled-date="disabledMonth"
picker="month"
/>125.04KW.h</div>
</div>
<div id="month" style="height: 250px;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentYear"
:disabled-date="disabledYear"
picker="year"
/>125.04KW.h</div>
</div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
</div>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -1,14 +1,14 @@
<script setup lang="ts">
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,18 +54,16 @@ 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="用电环比分析列表"/>
</Page>
<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>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
.box {
display: grid;
grid-template-columns: 1fr 3fr;
}

View File

@@ -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(()=>{
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'
@@ -35,14 +35,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'月',
name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
}
],
yAxis: [
{
type: 'value',
name:'KW.h'
name: 'KW.h'
}
],
series: [
@@ -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,54 +120,39 @@ const columns = [
title: '同比(%)',
dataIndex: 'address',
},
];
]
const data = [...Array(32)].map((_, i) => ({
key: i,
name: `${i+1}`,
name: `${i + 1}`,
age: '--',
address: `--`,
}));
</script>
<template>
<div class="box">
<div class="left"><FloorTree></FloorTree></div>
<div class="right">
<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"
/>
<a-button type="primary">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<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" />
<a-button type="primary">
<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' }" />
</div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table
style="border-radius: 8px;"
:columns="columns"
:data-source="data"
:pagination="false"
:scroll="{ y: '50vh' }"
/>
</div>
</div>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

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

View File

@@ -2,7 +2,7 @@
import { TableSwitch } from "#/components/table"
import { 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,

View File

@@ -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: [] }>()

View File

@@ -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
}
// getValuesreadonly
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>

View File

@@ -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="确认删除?"
@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>

View File

@@ -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 {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
type VxeGridProps
} 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>

View File

@@ -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 {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
type VxeGridProps
} 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>

View File

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

View File

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

View File

@@ -1,14 +1,9 @@
<script setup lang="ts">
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="用水环比分析列表"/>
</Page>
<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>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
}
</style>

View File

@@ -1,87 +1,87 @@
<template>
<div class="energy-monitor-page">
<div class="left-content">
<FloorTree></FloorTree>
</div>
<div class="right-content">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
</div>
<div class="energy-trend-container">
<div class="energy-trend-top">
<Page :auto-content-height="true">
<div class="flex h-full gap-[8px]">
<FloorTree class="w-[260px]"></FloorTree>
<div class="flex-1 overflow-hidden">
<div class="row">
<div class="comparison-section-container">
<div class="section-header">
<div class="header-title">能耗趋势</div>
<div class="header-title">环比</div>
</div>
<div class="comparison-grid">
<div class="comparison-item">
<div class="item-value">{{ chainData.currentMonthEnergy }}</div>
<div class="item-title">当月用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastMonthSamePeriodEnergy }}</div>
<div class="item-title">上月同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.monthTrendPercentage }}</div>
<div>{{ chainData.monthTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.currentYearEnergy }}</div>
<div class="item-title">当年用水(t)</div>
</div>
<div class="comparison-item">
<div class="item-value">{{ chainData.lastYearSamePeriodEnergy }}</div>
<div class="item-title">去年同期(t)</div>
</div>
<div class="comparison-item">
<div class="item-top">
<div class="item-percent">{{ chainData.yearTrendPercentage }}</div>
<div>{{ chainData.yearTrendValue }}
<span class="item-title">t</span>
</div>
</div>
<div class="item-title">趋势</div>
</div>
</div>
<RadioGroup v-model:value="energyTrendTime"
button-style="solid"
size="small" @change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="energy-chart" ref="energyTrendChart">
<div class="energy-trend-container">
<div class="energy-trend-top">
<div class="section-header">
<div class="header-title">能耗趋势</div>
</div>
<RadioGroup v-model:value="energyTrendTime" button-style="solid" size="small"
@change="buildingEnergyTrendData(energyTrendTime)">
<RadioButton value="2">当月</RadioButton>
<RadioButton value="3">当年</RadioButton>
</RadioGroup>
</div>
<div class="energy-chart" ref="energyTrendChart">
</div>
</div>
</div>
</div>
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">当年数据曲线</div>
</div>
<div class="power-chart" ref="powerCurveChart">
<div class="row">
<div class="power-curve-container">
<div class="section-header">
<div class="header-title">当年数据曲线</div>
</div>
<div class="power-chart" ref="powerCurveChart">
</div>
</div>
</div>
</div>
</div>
</div>
</Page>
</template>
<script setup lang="ts">
import {RadioGroup, RadioButton} from 'ant-design-vue'
import {ref, onMounted, onBeforeUnmount, reactive} from 'vue'
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 type { ECharts, EChartsOption } from 'echarts'
import FloorTree from "../../electricEnergy/components/floor-tree.vue"
const chainData = reactive({
currentMonthEnergy: '9',
@@ -122,8 +122,8 @@ const energyTrendOption: EChartsOption = {
type: 'bar',
markPoint: {
data: [
{type: 'max', name: 'Max'},
{type: 'min', name: 'Min'}
{ type: 'max', name: 'Max' },
{ type: 'min', name: 'Min' }
]
},
}
@@ -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}],
});
xAxis: { data: timeArr, name },
series: [{ data: valArr }],
})
}
}
@@ -197,8 +197,8 @@ const powerCurveOption: EChartsOption = {
},
toolbox: {
feature: {
magicType: {show: true, type: ['line', 'bar']},
restore: {show: true},
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
}
},
legend: {
@@ -228,13 +228,13 @@ const powerCurveOption: EChartsOption = {
data: [],
markPoint: {
data: [
{type: 'max',},
{type: 'min',}
{ type: 'max', },
{ type: 'min', }
]
},
},
]
};
}
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}],
});
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
@@ -345,7 +326,7 @@ onBeforeUnmount(() => {
.comparison-section-container,
.energy-trend-container,
.power-curve-container{
.power-curve-container {
background: #fff;
border-radius: 5px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
@@ -386,12 +367,11 @@ onBeforeUnmount(() => {
border-bottom: 1px solid #666;
}
.power-chart{
.power-chart {
height: 45vh;
}
.energy-chart{
.energy-chart {
height: 30vh;
}
</style>

View File

@@ -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(()=>{
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'
@@ -37,14 +38,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'日',
name: '日',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
}
],
yAxis: [
{
type: 'value',
name:'t'
name: 't'
}
],
series: [
@@ -52,7 +53,7 @@ onMounted(()=>{
name: '当月',
type: 'bar',
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 0.0, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 0.0, 7.0, 23.2, 0.0, 76.7, 135.6, 162.2, 32.6, 0.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
2.0, 4.9, 7.0, 23.2, 25.6, 0.0, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 0.0, 7.0, 23.2, 0.0, 76.7, 135.6, 162.2, 32.6, 0.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
],
markPoint: {
data: [
@@ -65,7 +66,7 @@ onMounted(()=>{
name: '上月',
type: 'bar',
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 0.0, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 0.0, 32.6, 20.0, 6.4, 3.3,2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 0.0, 48.7, 18.8, 6.0, 2.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 0.0, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6
],
markPoint: {
data: [
@@ -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'
@@ -107,14 +108,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'月',
name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
}
],
yAxis: [
{
type: 'value',
name:'t'
name: 't'
}
],
series: [
@@ -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;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentMonth"
:disabled-date="disabledMonth"
picker="month"
/>30.00t</div>
<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>
</div>
<div id="month" style="height: 100%;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;height: 50%;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker v-model:value="currentYear" :disabled-date="disabledYear" picker="year" />当年能耗总值59.00t
</div>
</div>
<div id="year" style="height: 100%;width: 100%;"></div>
</div>
</div>
<div id="month" style="height: 350px;width: 100%;"></div>
</div>
<div style="background: #fff;border-radius: 8px;padding: 10px;margin-top: 16px;">
<div>
<div style="display: flex;justify-content: space-between;">
<DatePicker
v-model:value="currentYear"
:disabled-date="disabledYear"
picker="year"
/>59.00t</div>
</div>
<div id="year" style="height: 350px;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>

View File

@@ -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(()=>{
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'
@@ -35,14 +35,14 @@ onMounted(()=>{
xAxis: [
{
type: 'category',
name:'月',
name: '月',
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
}
],
yAxis: [
{
type: 'value',
name:'t'
name: 't'
}
],
series: [
@@ -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,54 +120,39 @@ const columns = [
title: '同比(%)',
dataIndex: 'address',
},
];
]
const data = [...Array(32)].map((_, i) => ({
key: i,
name: `${i+1}`,
name: `${i + 1}`,
age: '--',
address: `--`,
}));
</script>
<template>
<div class="box">
<div class="left"><FloorTree></FloorTree></div>
<div class="right">
<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"
/>
<a-button type="primary">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<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" />
<a-button type="primary">
<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' }" />
</div>
<div id="year" style="height: 250px;width: 100%;"></div>
</div>
<div>
<Table
style="border-radius: 8px;"
:columns="columns"
:data-source="data"
:pagination="false"
:scroll="{ y: '50vh' }"
/>
</div>
</div>
</div>
</Page>
</template>
<style scoped lang="scss">
.box{
display: grid;
grid-template-columns: 1fr 3fr;
gap: 16px;
padding: 16px;
}
</style>

View File

@@ -157,7 +157,7 @@ export const modalSchema: FormSchemaGetter = () => [
},
{
label: '入驻位置',
fieldName: 'location',
fieldName: 'locations',
component: 'TreeSelect',
rules: 'selectRequired',
formItemClass: 'col-span-2'

View File

@@ -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',
},
]);
}

View File

@@ -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;

View File

@@ -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 >

View File

@@ -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,

View File

@@ -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: '拜访时间',

View File

@@ -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>

View File

@@ -36,17 +36,17 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =
usePreferences();
</script> -->
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '../../../../../apps/web-antd/src/store'
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { useAuthStore } from '../../../../../apps/web-antd/src/store';
import { Checkbox } from 'ant-design-vue';
const router = useRouter()
const router = useRouter();
const authStore = useAuthStore();
// 响应式数据
const username = ref('')
const password = ref('')
const rememberMe = ref(false)
const username = ref('');
const password = ref('');
const rememberMe = ref(false);
// 页面加载时恢复用户名
onMounted(() => {
@@ -58,55 +58,59 @@ onMounted(() => {
});
function getRetUrlParam() {
const urlParams = new URLSearchParams(window.location.search);
console.log('urlParams', urlParams);
return urlParams.get('returl');
}
const retUrl : string | null = getRetUrlParam();
const retUrl: string | null = getRetUrlParam();
// 登录逻辑
const login = () => {
// 验证输入
if (!username.value.trim()) {
alert('请输入用户名')
return
alert('请输入用户名');
return;
}
if (!password.value.trim()) {
alert('请输入密码')
return
alert('请输入密码');
return;
}
// 模拟登录请求
console.log('正在登录...', { username: username.value, password: password.value })
console.log('正在登录...', {
username: username.value,
password: password.value,
});
setTimeout(() => {
alert('登录成功!')
alert('登录成功!');
// 存储用户名
if (rememberMe.value) {
localStorage.setItem('rememberedUser', username.value)
localStorage.setItem('rememberedUser', username.value);
} else {
localStorage.removeItem('rememberedUser')
localStorage.removeItem('rememberedUser');
}
// 跳转页面
router.push('/navigation')
}, 800)
}
router.push('/navigation');
}, 800);
};
const handleAccountLogin = async () => {
try {
// const requestParam: any = omit(values, ['code']);
// 登录
await authStore.authLogin({
grantType: "password",
grantType: 'password',
password: password.value,
tenantId: "000000",
tenantId: '000000',
username: username.value,
retUrl: retUrl,
});
} catch (error) {
console.error(error);
}
}
};
</script>
<template>
@@ -122,22 +126,30 @@ const handleAccountLogin = async () => {
<h3>用户登录</h3>
<!-- 用户名输入 -->
<div class="input-group">
<img src="../../../../../apps/web-antd/src/assets/my.png" alt="User Icon" class="input-icon">
<img
src="../../../../../apps/web-antd/src/assets/my.png"
alt="User Icon"
class="input-icon"
/>
<input
type="text"
placeholder="请输入您的用户名"
v-model="username"
type="text"
placeholder="请输入您的用户名"
v-model="username"
/>
</div>
<!-- 密码输入 -->
<div class="input-group">
<img src="../../../../../apps/web-antd/src/assets/mima.png" alt="Password Icon" class="input-icon">
<img
src="../../../../../apps/web-antd/src/assets/mima.png"
alt="Password Icon"
class="input-icon"
/>
<input
type="password"
placeholder="请输入您的密码"
v-model="password"
@keyup.enter="handleAccountLogin"
type="password"
placeholder="请输入您的密码"
v-model="password"
@keyup.enter="handleAccountLogin"
/>
</div>
@@ -158,13 +170,13 @@ const handleAccountLogin = async () => {
class="flex min-h-full flex-1 select-none overflow-x-hidden"
style="display: none;"
> -->
<!--<template v-if="toolbar">
<!--<template v-if="toolbar">
<slot name="toolbar">
<Toolbar :toolbar-list="toolbarList" />
</slot>
</template>-->
<!-- 左侧认证面板 -->
<!--<AuthenticationFormView
<!-- 左侧认证面板 -->
<!--<AuthenticationFormView
v-if="authPanelLeft"
class="min-h-full w-2/5 flex-1"
transition-name="slide-left"
@@ -179,8 +191,8 @@ const handleAccountLogin = async () => {
</template>
</AuthenticationFormView>-->
<!-- 头部 Logo 和应用名称 -->
<!--<div
<!-- 头部 Logo 和应用名称 -->
<!--<div
v-if="logo || appName"
class="absolute left-0 top-0 z-10 flex flex-1"
@click="clickLogo"
@@ -195,8 +207,8 @@ const handleAccountLogin = async () => {
</div>
</div>-->
<!-- 系统介绍 -->
<!--<div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
<!-- 系统介绍 -->
<!--<div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
<div
class="bg-background-deep absolute inset-0 h-full w-full dark:bg-[#070709]"
>
@@ -220,8 +232,8 @@ const handleAccountLogin = async () => {
</div>
</div>-->
<!-- 中心认证面板 -->
<!--<div v-if="authPanelCenter" class="flex-center relative w-full">
<!-- 中心认证面板 -->
<!--<div v-if="authPanelCenter" class="flex-center relative w-full">
<div class="login-background absolute left-0 top-0 size-full"></div>
<AuthenticationFormView
class="md:bg-background shadow-primary/5 shadow-float w-full rounded-3xl pb-20 md:w-2/3 lg:w-1/2 xl:w-[36%]"
@@ -237,8 +249,8 @@ const handleAccountLogin = async () => {
</AuthenticationFormView>
</div>-->
<!-- 右侧认证面板 -->
<!--<AuthenticationFormView
<!-- 右侧认证面板 -->
<!--<AuthenticationFormView
v-if="authPanelRight"
class="min-h-full w-[34%] flex-1"
>
@@ -280,7 +292,8 @@ const handleAccountLogin = async () => {
<style scoped>
@font-face {
font-family: 'BaiduVariety';
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf') format('truetype');
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf')
format('truetype');
font-weight: normal;
font-style: normal;
}
@@ -293,36 +306,38 @@ const handleAccountLogin = async () => {
justify-content: center;
align-items: center;
background:
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */
url('../../../../../apps/web-antd/src/assets/222.png') no-repeat center center fixed;
background-size: 100% 100%, 100% 100%;
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */ url('../../../../../apps/web-antd/src/assets/222.png')
no-repeat center center fixed;
background-size:
100% 100%,
100% 100%;
/* background-repeat: no-repeat, no-repeat;
background-position: center center, center center; */
color: #fff;
}
.login-wapter{
.login-wapter {
position: relative;
top: -115px; /* 负值越大,越往上 */
.login-wapter1 {
font-size: 44px;
margin-bottom: 20px;
display: flex;
justify-content: center;
}
.login-wapter2 {
font-size: 60px;
/* margin-bottom: 38px; */
background: linear-gradient(to bottom, #ffffff, #cbeaff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
color: transparent;
font-weight: bold;
display: flex;
justify-content: center;
font-family: 'BaiduVariety',sans-serif;
letter-spacing: 6px;
}
font-size: 44px;
margin-bottom: 20px;
display: flex;
justify-content: center;
}
.login-wapter2 {
font-size: 60px;
/* margin-bottom: 38px; */
background: linear-gradient(to bottom, #ffffff, #cbeaff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
color: transparent;
font-weight: bold;
display: flex;
justify-content: center;
font-family: 'BaiduVariety', sans-serif;
letter-spacing: 6px;
}
}
.login-bg_1 {
flex-direction: column;
@@ -335,7 +350,8 @@ const handleAccountLogin = async () => {
width: 100%;
height: 100%;
text-align: center;
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat center center fixed;
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat
center center fixed;
}
.login-form {
border-radius: 10px;
@@ -380,8 +396,8 @@ input:-webkit-autofill {
margin-top: 20px;
border: none;
border-radius: 5px;
background-color: #19DCF8;
color: #0254A5;
background-color: #19dcf8;
color: #0254a5;
cursor: pointer;
font-size: 22px;
margin-top: 70px;
@@ -401,8 +417,6 @@ input:-webkit-autofill {
color: #eee;
}
/* 新增 .input-group 样式 */
.input-group {
display: flex;
@@ -433,7 +447,7 @@ input:-webkit-autofill {
.login-form input::placeholder {
color: rgba(255, 255, 255, 0.42); /* 例如灰色 */
}
.login-footer{
.login-footer {
position: fixed;
bottom: 0;
left: 0;

View File

@@ -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>