Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
15683799673
2025-07-21 03:38:34 +08:00
21 changed files with 337 additions and 246 deletions

1
.gitignore vendored
View File

@@ -52,3 +52,4 @@ vite.config.ts.*
# 排除自动生成的类型文件 # 排除自动生成的类型文件
apps/web-antd/types/components.d.ts apps/web-antd/types/components.d.ts
.history .history
apps/web-antd/vite.config.mts

View File

@@ -59,3 +59,12 @@ export function groupUpdate(data: GroupForm) {
export function groupRemove(id: ID | IDS) { export function groupRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/Property/group/${id}`); return requestClient.deleteWithMsg<void>(`/Property/group/${id}`);
} }
/**
* 获取节假日数据
* @param year
*/
export async function getHoliday(year: string) {
const response = await fetch(`https://timor.tech/api/holiday/year/${year}`);
return response.json();
}

View File

@@ -1,4 +1,4 @@
import type { PageQuery, BaseEntity } from '#/api/common'; import type {PageQuery, BaseEntity} from '#/api/common';
export interface GroupVO { export interface GroupVO {
/** /**
@@ -63,7 +63,16 @@ export interface GroupQuery extends PageQuery {
attendanceType?: number; attendanceType?: number;
/** /**
* 日期范围参数 * 日期范围参数
*/ */
params?: any; params?: any;
} }
/**
* 假期
*/
export interface Holiday {
holiday: boolean;
name: string;
date: string;
}

View File

@@ -1,8 +1,6 @@
import type { ShiftVO, ShiftForm, ShiftQuery } from './model'; import type { ShiftVO, ShiftForm, ShiftQuery } from './model';
import type { ID, IDS } from '#/api/common'; import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common'; import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper'; import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request'; import { requestClient } from '#/api/request';

View File

@@ -40,7 +40,6 @@ export interface ShiftVO {
* 休息结束时间 * 休息结束时间
*/ */
restEndTime: string; restEndTime: string;
} }
export interface ShiftForm extends BaseEntity { export interface ShiftForm extends BaseEntity {
@@ -83,7 +82,6 @@ export interface ShiftForm extends BaseEntity {
* 休息结束时间 * 休息结束时间
*/ */
restEndTime?: string; restEndTime?: string;
} }
export interface ShiftQuery extends PageQuery { export interface ShiftQuery extends PageQuery {

View File

@@ -58,6 +58,8 @@ export interface HouseChargeVO {
costItemsVo: CostItemSettingVO; costItemsVo: CostItemSettingVO;
chargeStatus: string; chargeStatus: string;
personId: string;
} }
export interface HouseChargeForm extends BaseEntity { export interface HouseChargeForm extends BaseEntity {

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

View File

@@ -2,7 +2,7 @@ import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict"; import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
import type { TableColumnsType } from 'ant-design-vue';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
@@ -124,6 +124,18 @@ export const modalSchema: FormSchemaGetter = () => [
rules:'required', rules:'required',
defaultValue:'1', defaultValue:'1',
}, },
{
label: '',
fieldName: 'shiftData',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'shiftData'
},
},
{ {
label: '排班周期', label: '排班周期',
fieldName: 'schedulingCycle', fieldName: 'schedulingCycle',
@@ -138,32 +150,99 @@ export const modalSchema: FormSchemaGetter = () => [
defaultValue:'1', defaultValue:'1',
rules:'required' rules:'required'
}, },
{
label: '',
fieldName: 'cycleData',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'cycleData'
},
},
]; ];
export const weekdayColumns: VxeGridProps['columns'] = [ export const weekdayColumns: TableColumnsType = [
{ {
title: '工作日', title: '工作日',
name: 'label', key: 'label',
width:180, width:180,
align:'center', align:'center',
dataIndex:'label' dataIndex:'label'
}, },
{ {
title: '班次', title: '班次',
name: 'shift', key: 'shift',
minWidth:180, minWidth:180,
align:'center', align:'center',
dataIndex:'shift' dataIndex:'shift'
}, },
{ {
title: '操作', title: '操作',
name: 'action', key: 'action',
dataIndex:'action', dataIndex:'action',
width:180, width:180,
align:'center', align:'center',
slots:{
default:'action'
},
}, },
] ]
export const noClockingColumns: TableColumnsType = [
{
title: '无需打卡日期',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
},
]
export const clockingColumns: TableColumnsType = [
{
title: '必须打卡日期',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
},
]
export const cycleColumns: TableColumnsType = [
{
title: '天数',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '班次',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
},
]

View File

@@ -13,9 +13,16 @@ import {
} from '#/api/property/attendanceManagement/attendanceGroupSettings'; } from '#/api/property/attendanceManagement/attendanceGroupSettings';
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup'; import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchema, weekdayColumns} from './data'; import {
import {Tag, Button, Table} from 'ant-design-vue' clockingColumns,
cycleColumns,
modalSchema,
noClockingColumns,
weekdayColumns
} from './data';
import {Tag, Button, Table, Checkbox} from 'ant-design-vue'
import {getDictOptions} from "#/utils/dict"; import {getDictOptions} from "#/utils/dict";
import holidayCalendar from './holiday-calendar.vue'
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
@@ -24,7 +31,9 @@ const weekdayData = ref<any[]>([])
const title = computed(() => { 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 settingData = ref<any>({
isAutomatic: true,
})
const [BasicForm, formApi] = useVbenForm({ const [BasicForm, formApi] = useVbenForm({
commonConfig: { commonConfig: {
// 默认占满两列 // 默认占满两列
@@ -50,8 +59,9 @@ const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度 // 在这里更改宽度
class: 'w-[70%]', class: 'w-[80%]',
fullscreenButton: false, fullscreenButton: false,
maskClosable:false,
onBeforeClose, onBeforeClose,
onClosed: handleClosed, onClosed: handleClosed,
onConfirm: handleConfirm, onConfirm: handleConfirm,
@@ -66,18 +76,17 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await groupInfo(id); const record = await groupInfo(id);
await formApi.setValues(record); await formApi.setValues(record);
}else { } else {
weekdayData.value=[] weekdayData.value = []
getDictOptions('wy_kqgzr').forEach(item=>{ getDictOptions('wy_kqgzr').forEach(item => {
weekdayData.value.push({ weekdayData.value.push({
dayOfWeek:item.value, dayOfWeek: item.value,
label:item.label, label: item.label,
shift:item.value=='6'||item.value=='7'?'休息':'常规班次08:00:00~12:00:00 14:00:00~17:00:00' shift: item.value == '6' || item.value == '7' ? '休息' : '常规班次08:00:00~12:00:00 14:00:00~17:00:00'
}) })
}) })
} }
await markInitialized(); await markInitialized();
modalApi.modalLoading(false); modalApi.modalLoading(false);
}, },
}); });
@@ -106,41 +115,95 @@ async function handleClosed() {
await formApi.resetForm(); await formApi.resetForm();
resetInitialized(); resetInitialized();
} }
const [HolidayCalendar, holidayApi] = useVbenModal({
connectedComponent: holidayCalendar,
});
/**
* 查看法定节假日日历
*/
async function showHoliday() {
holidayApi.open()
}
</script> </script>
<template> <template>
<BasicModal :title="title"> <BasicModal :title="title">
<BasicForm> <BasicForm>
<template #weekdaySetting> <template #weekdaySetting>
<div style="font-size: 0.875rem;"> <div class="item-font">
<span>快捷设置班次</span> <span>快捷设置班次</span>
<Tag color="processing">常规班次08:00:00~12:00:00 14:00:00~17:00:00</Tag> <Tag color="processing">常规班次08:00:00~12:00:00 14:00:00~17:00:00</Tag>
<Button type="link">更改班次</Button> <Button type="link">更改班次</Button>
</div> </div>
</template> </template>
<template #settingItem> <template #settingItem>
<Table style="width: 100%" bordered :columns="weekdayColumns" :data-source="weekdayData" <div class="item-font" style="width: 100%;">
size="small" :pagination="false"> <Table style="width: 100%" bordered :columns="weekdayColumns" :data-source="weekdayData"
<!-- <template #headerCell="{ column }">--> size="small" :pagination="false">
<!-- </template>--> <!-- <template #headerCell="{ column }">-->
<!-- <template #bodyCell="{ column, record }">--> <!-- </template>-->
<!-- <template>--> <!-- <template #bodyCell="{ column, record }">-->
<!-- {{ record[column.field] }}--> <!-- <template>-->
<!-- </template>--> <!-- {{ record[column.field] }}-->
<!-- </template>--> <!-- </template>-->
<!-- <template #action="{row}">--> <!-- </template>-->
<!-- <Button type="link">更改班次</Button>--> <!-- <template #action="{row}">-->
<!-- <Button type="link">休息</Button>--> <!-- <Button type="link">更改班次</Button>-->
<!-- </template>--> <!-- <Button type="link">休息</Button>-->
</Table> <!-- </template>-->
</Table>
<Checkbox class="item-padding-top" v-model:checked="settingData.isAutomatic">
法定节假日自动排休
</Checkbox>
<!-- https://timor.tech/api/holiday/year/2024 国务院节假日安排API-->
<Button type="link" @click="showHoliday">查看法定节假日日历</Button>
<p class="item-padding-top item-font-weight">特殊日期</p>
<p class="item-padding">无需打卡日期</p>
<Table style="width: 80%" bordered :columns="noClockingColumns" :data-source="[]"
size="small" :pagination="false">
</Table>
<p class="item-padding">必须打卡日期</p>
<Table style="width: 80%" bordered :columns="clockingColumns" :data-source="[]"
size="small" :pagination="false">
</Table>
</div>
</template> </template>
<template #attendanceShift> <template #attendanceShift>
班次 <Button size="small">选择班次</Button>
</template>
<template #shiftData>
<Tag closable color="processing">早班</Tag>
</template> </template>
<template #schedulingCycle> <template #schedulingCycle>
周期 <span class="item-font">周期天数4天</span>
</template>
<template #cycleData>
<Table style="width: 100%" bordered :columns="cycleColumns" :data-source="[]"
size="small" :pagination="false">
</Table>
</template> </template>
</BasicForm> </BasicForm>
<HolidayCalendar></HolidayCalendar>
</BasicModal> </BasicModal>
</template> </template>
<style lang="scss" scoped>
.item-font {
font-size: 0.875rem;
}
.item-font-weight {
font-weight: 500;
}
.item-padding-top {
padding-top: 1.1rem;
}
.item-padding {
padding: 1.1rem 0 0.5rem 0;
}
</style>

View File

@@ -0,0 +1,78 @@
<script setup lang="ts">
import {ref, shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import dayjs, {type Dayjs} from 'dayjs';
import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime';
dayjs.extend(duration);
dayjs.extend(relativeTime);
import type {HouseChargeVO} from "#/api/property/costManagement/houseCharge/model";
import {getHoliday} from "#/api/property/attendanceManagement/attendanceGroupSettings";
import {Calendar, Tag} from 'ant-design-vue'
import type {Holiday} from "#/api/property/attendanceManagement/attendanceGroupSettings/model";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
houseChargeDetail.value = null;
},
});
const houseChargeDetail = shallowRef<null | HouseChargeVO>(null);
const holidayData = ref<any>({})
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const res = await getHoliday(new Date().getFullYear());
holidayData.value = res.holiday
modalApi.modalLoading(false);
}
const day = ref<Holiday>();
const getListData = (value: Dayjs) => {
const date = value.format('MM-DD');
day.value = holidayData.value?.[date] ?? null;
return !!day.value;
};
const getMonthData = (value: Dayjs) => {
if (value.month() === 8) {
return 1394;
}
};
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="法定节假日日历" class="w-[40%]">
<Calendar>
<template #dateCellRender="{ current }">
<div v-if="getListData(current)" style="height: 50px">
<Tag v-if="day.holiday" color="blue">
<span style="padding: 0 10px"></span>
</Tag>
<Tag v-else color="red">
<span style="padding: 0 10px"></span>
</Tag>
</div>
</template>
<template #monthCellRender="{ current }">
<div v-if="getMonthData(current)" class="notes-month">
<span>Backlog number</span>
</div>
</template>
</Calendar>
</BasicModal>
</template>
<style scoped lang="scss">
:deep(.ant-picker-calendar.ant-picker-calendar-full .ant-picker-calendar-date-content) {
height: 46px !important;
}
</style>

View File

@@ -17,6 +17,7 @@ import shiftModal from './shift-modal.vue';
import shiftDetail from './shift-detail.vue'; import shiftDetail from './shift-detail.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import {TableSwitch} from "#/components/table"; import {TableSwitch} from "#/components/table";
import { $t } from '#/locales';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {

View File

@@ -3,15 +3,9 @@ import type {ShiftVO} from '#/api/property/attendanceManagement/shiftSetting/mod
import {shallowRef} from 'vue'; import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui'; import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue'; import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime';
import {shiftInfo} from '#/api/property/attendanceManagement/shiftSetting'; import {shiftInfo} from '#/api/property/attendanceManagement/shiftSetting';
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
dayjs.extend(duration);
dayjs.extend(relativeTime);
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange, onOpenChange: handleOpenChange,
onClosed() { onClosed() {
@@ -40,7 +34,7 @@ async function handleOpenChange(open: boolean) {
{{ shiftSettingDetail.name }} {{ shiftSettingDetail.name }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="考勤时间"> <DescriptionsItem label="考勤时间">
{{ shiftSettingDetail.startTime ? shiftSettingDetail.startTime + '-' + shiftSettingDetail.endTime : '-' }} {{ shiftSettingDetail.startTime + '-' + shiftSettingDetail.endTime }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="是否休息"> <DescriptionsItem label="是否休息">
{{ shiftSettingDetail.isRest===0 ? '不休息' : '休息' }} {{ shiftSettingDetail.isRest===0 ? '不休息' : '休息' }}

View File

@@ -4,28 +4,23 @@ import dayjs from 'dayjs';
import { useVbenModal } from '@vben/common-ui'; import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { shiftAdd, shiftInfo, shiftUpdate } from '#/api/property/attendanceManagement/shiftSetting'; import { shiftAdd, shiftInfo, shiftUpdate } from '#/api/property/attendanceManagement/shiftSetting';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data'; import { modalSchema } from './data';
import {TimeRangePicker} from "ant-design-vue"; import {TimeRangePicker} from "ant-design-vue";
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false); const isUpdate = ref(false);
const title = computed(() => { 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({ const [BasicForm, formApi] = useVbenForm({
commonConfig: { commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2', formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 100, labelWidth: 100,
// 通用配置项 会影响到所有表单项
componentProps: { componentProps: {
class: 'w-full', class: 'w-full',
} }
@@ -43,7 +38,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
); );
const [BasicModal, modalApi] = useVbenModal({ const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]', class: 'w-[550px]',
fullscreenButton: false, fullscreenButton: false,
onBeforeClose, onBeforeClose,
@@ -54,16 +48,13 @@ const [BasicModal, modalApi] = useVbenModal({
return null; return null;
} }
modalApi.modalLoading(true); modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string }; const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id; isUpdate.value = !!id;
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await shiftInfo(id); const record = await shiftInfo(id);
await formApi.setValues(record); await formApi.setValues(record);
} }
await markInitialized(); await markInitialized();
modalApi.modalLoading(false); modalApi.modalLoading(false);
}, },
}); });
@@ -75,7 +66,6 @@ async function handleConfirm() {
if (!valid) { if (!valid) {
return; return;
} }
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
data.startTime = dayjs(data.attendanceTimeRange[0]).format('HH:mm:ss'); data.startTime = dayjs(data.attendanceTimeRange[0]).format('HH:mm:ss');
data.endTime = dayjs(data.attendanceTimeRange[1]).format('HH:mm:ss'); data.endTime = dayjs(data.attendanceTimeRange[1]).format('HH:mm:ss');
@@ -86,7 +76,7 @@ async function handleConfirm() {
await (isUpdate.value ? shiftUpdate(data) : shiftAdd(data)); await (isUpdate.value ? shiftUpdate(data) : shiftAdd(data));
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');
modalApi.close(); await modalApi.close();
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} finally { } finally {

View File

@@ -2,16 +2,14 @@
import { Radio, Select, Button, Table,Calendar } from 'ant-design-vue'; import { Radio, Select, Button, Table,Calendar } from 'ant-design-vue';
import type { RadioChangeEvent } from 'ant-design-vue'; import type { RadioChangeEvent } from 'ant-design-vue';
import {ref} from 'vue'; import {ref} from 'vue';
import dayjs from 'dayjs';
import { Dayjs } from 'dayjs'; import { Dayjs } from 'dayjs';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { import {
arrangementExport, arrangementExport,
arrangementList, arrangementList,
@@ -22,11 +20,7 @@ import type { ArrangementForm } from '#/api/property/attendanceManagement/arrang
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
const emit = defineEmits<{(e:'changeView',value:boolean):void}>(); const emit = defineEmits<{(e:'changeView',value:boolean):void}>();
const props = defineProps<{ const props = defineProps<{
viewMode:'calender' | 'schedule' viewMode:'calender' | 'schedule'
}>(); }>();
@@ -40,25 +34,6 @@ function handleViewModeChange(e: RadioChangeEvent): void {
emit('changeView',e.target.value) emit('changeView',e.target.value)
} }
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@@ -90,10 +65,23 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// 表格全局唯一表示 保存列配置需要用到 // 表格全局唯一表示 保存列配置需要用到
id: 'property-arrangement-index' id: 'property-arrangement-index',
toolbarConfig: {
// 控制工具栏整体是否显示(默认显示)
show: true,
// 隐藏"刷新/重置"按钮(对应 redo
refresh: false,
// 隐藏"全屏"按钮
fullscreen: false,
// 隐藏"列设置"按钮(对应 setting
columns: false,
// 隐藏"表格尺寸"按钮(对应 size
size: undefined,
// 其他可能的按钮(如导出等,按需配置)
// export: false, // 如果有导出按钮,也可以隐藏
},
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions, gridOptions,
}); });
@@ -129,7 +117,7 @@ async function handleDelete(row: Required<ArrangementForm>) {
</div> </div>
<div class="flex-1"> <div class="flex-1">
<Page :auto-content-height="true"> <Page :auto-content-height="true">
<BasicTable table-title="排班列表"> <BasicTable >
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
@@ -162,4 +150,3 @@ async function handleDelete(row: Required<ArrangementForm>) {
</template> </template>
<style> <style>
</style> </style>

View File

@@ -6,13 +6,11 @@ import {cloneDeep} from '@vben/utils';
import {useVbenForm} from '#/adapter/form'; import {useVbenForm} from '#/adapter/form';
import { import {
houseChargeAdd,
houseChargeInfo, houseChargeRefund, houseChargeInfo, houseChargeRefund,
houseChargeUpdate
} from '#/api/property/costManagement/houseCharge'; } from '#/api/property/costManagement/houseCharge';
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup'; import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchemaRefund, modalSchemaUpdate} from './data'; import {modalSchemaRefund} from './data';
import {renderDict} from "#/utils/render"; import {renderDict} from "#/utils/render";
import {Descriptions, DescriptionsItem, Divider} from "ant-design-vue"; import {Descriptions, DescriptionsItem, Divider} from "ant-design-vue";
import type {HouseChargeVO} from "#/api/property/costManagement/houseCharge/model"; import type {HouseChargeVO} from "#/api/property/costManagement/houseCharge/model";
@@ -62,14 +60,15 @@ const [BasicModal, modalApi] = useVbenModal({
modalApi.modalLoading(true); modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id?: number | string }; const {id} = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id; isUpdate.value = !!id;
record.value = await houseChargeInfo(id); if(id){
if (record.value) { record.value = await houseChargeInfo(id);
room.value = record.value.roomVo if (record.value) {
costItem.value = record.value.costItemsVo room.value = record.value.roomVo
costItem.value = record.value.costItemsVo
}
await formApi.setValues(record.value);
} }
await formApi.setValues(record.value);
await markInitialized(); await markInitialized();
modalApi.modalLoading(false); modalApi.modalLoading(false);
}, },
}); });
@@ -83,8 +82,8 @@ async function handleConfirm() {
} }
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次 // getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
data.costItemsId = record.value.costItemsId data.costItemsId = record.value?.costItemsId
data.personId = record.value.personId data.personId = record.value?.personId
await houseChargeRefund(data); await houseChargeRefund(data);
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');
@@ -123,7 +122,7 @@ async function handleClosed() {
{{ record.startTime }} {{ record.startTime }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="房间"> <DescriptionsItem label="房间">
{{ room.roomNumber }} {{ room?.roomNumber }}
</DescriptionsItem> </DescriptionsItem>
<DescriptionsItem label="面积(㎡)"> <DescriptionsItem label="面积(㎡)">
{{ `${room?.area} (套内面积:${room?.insideInArea}` }} {{ `${room?.area} (套内面积:${room?.insideInArea}` }}

View File

@@ -71,6 +71,10 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) { if (isUpdate.value && id) {
const record = await meterInfoInfo(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); await formApi.setValues(record);
} }
await markInitialized(); await markInitialized();

View File

@@ -168,14 +168,19 @@ const updateTime = () => {
const initBarChart = () => { const initBarChart = () => {
if (!barChart.value) return if (!barChart.value) return
const chart = echarts.init(barChart.value) const myChart = echarts.init(barChart.value);
const option = getThreeDBarOption({ myChart.setOption({
xData: ['A区', 'B区', 'C区', 'D区'], tooltip: {},
yData: [320, 452, 688, 400] xAxis: { data: ['A', 'B', 'C', 'D'] },
}) yAxis: {},
chart.setOption(option) series: [
barChartInstance = chart {
addChartToResizeManager(chart) name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20],
},
],
});
} }
// 初始化电力图表 // 初始化电力图表
@@ -601,6 +606,9 @@ onBeforeUnmount(() => {
min-height: unset; min-height: unset;
margin: 0 auto; margin: 0 auto;
} }
.bar-chart{
}
} }
.second{ .second{
height: 12rem; height: 12rem;

View File

@@ -1,116 +0,0 @@
<script setup lang="ts">
import { ref } from 'vue'
import { cloneDeep } from '@vben/utils'
import { useVbenModal } from '@vben/common-ui'
import { useVbenForm } from '#/adapter/form'
import { queryByUnitId } from '#/api/property/floor'
import { refAdd, refQuery } from '#/api/sis/elevatorInfo'
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
const dataForm = ref<any>()
const title = ref('楼层授权')
const [BasicForm, formApi] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-1',
// 所有表单项
componentProps: {
class: 'w-full',
},
},
layout: 'horizontal',
schema: [
{
component: 'CheckboxGroup',
componentProps: {
name: 'cname',
options: [],
},
defaultValue: [],
fieldName: 'floorNums',
label: '楼层'
}],
wrapperClass: 'grid-cols-1',
showDefaultActions: false
})
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[700px]',
fullscreenButton: false,
loading: true,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpened: handleInit,
})
function handleInit() {
dataForm.value = modalApi.getData()
const { unitId } = modalApi.getData()
queryByUnitId(unitId).then((res) => {
const arr: any[] = []
res.forEach((item) => {
arr.push({
label: item.floorName,
value: item.floorNumber,
})
})
formApi.updateSchema([
{
fieldName: 'floorNums',
componentProps: { options: arr },
}
])
handleChecked()
})
}
function handleChecked() {
const { elevatorId } = modalApi.getData()
refQuery(elevatorId).then((res) => {
const arr: any[] = []
res.forEach((item) => {
arr.push(item.floorNum)
})
formApi.setFieldValue('floorNums', arr)
}).finally(() => {
modalApi.setState({ loading: false });
})
}
const { resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
)
async function handleConfirm() {
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues())
const params = {
elevatorId: dataForm.value.elevatorId,
floorNums: data.floorNums
}
refAdd(params).finally(() => {
modalApi.close()
})
}
async function handleClosed() {
await formApi.resetForm()
resetInitialized()
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -25,7 +25,6 @@ import { commonDownloadExcel } from '#/utils/file/download';
import elevatorInfoModal from './elevatorInfo-modal.vue'; import elevatorInfoModal from './elevatorInfo-modal.vue';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import floorAuthModal from './floorAuth-modal.vue';
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
commonConfig: { commonConfig: {
@@ -89,10 +88,6 @@ const [ElevatorInfoModal, modalApi] = useVbenModal({
connectedComponent: elevatorInfoModal, connectedComponent: elevatorInfoModal,
}); });
const [FloorAuthModal, floorAuthModalApi] = useVbenModal({
connectedComponent: floorAuthModal,
});
function handleAdd() { function handleAdd() {
modalApi.setData({}); modalApi.setData({});
modalApi.open(); modalApi.open();
@@ -128,11 +123,6 @@ function handleDownloadExcel() {
}); });
} }
function handleAuth(row: Required<ElevatorInfoForm>) {
floorAuthModalApi.setData({ unitId: row.unitId, elevatorId: row.elevatorId });
floorAuthModalApi.open();
}
</script> </script>
<template> <template>
@@ -165,8 +155,6 @@ function handleAuth(row: Required<ElevatorInfoForm>) {
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button @click.stop="handleAuth(row)">楼层授权</ghost-button>
<ghost-button <ghost-button
v-access:code="['sis:elevatorInfo:edit']" v-access:code="['sis:elevatorInfo:edit']"
@click.stop="handleEdit(row)" @click.stop="handleEdit(row)"
@@ -191,6 +179,5 @@ function handleAuth(row: Required<ElevatorInfoForm>) {
</template> </template>
</BasicTable> </BasicTable>
<ElevatorInfoModal @reload="tableApi.query()" /> <ElevatorInfoModal @reload="tableApi.query()" />
<FloorAuthModal @reload="tableApi.query()" />
</Page> </Page>
</template> </template>

View File

@@ -281,7 +281,7 @@ const handleAccountLogin = async () => {
align-items: center; align-items: center;
background: background:
url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed,
url('../../../../../apps/web-antd/src/assets/222.gif'); url('../../../../../apps/web-antd/src/assets/222.png');
background-size: cover, cover; background-size: cover, cover;
color: #fff; color: #fff;
} }