From ca4f180e7ea0d70caa5e01e2c64f4401e08b701c Mon Sep 17 00:00:00 2001 From: fyy <2717885210@qq.com> Date: Tue, 19 Aug 2025 10:52:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E8=80=83=E5=8B=A4?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=8B=E7=9A=84=E5=8C=BA=E5=9F=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E6=8E=92=E7=8F=AD=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../arrangement/model.d.ts | 1 + .../attendanceArea/data.ts | 15 +++++++++++++-- .../workforceManagement/arrangement-modal.vue | 9 +++++---- .../workforceManagement/data.ts | 18 +++++++++++++++++- .../workforceManagement/workforce-detail.vue | 13 ++++++------- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts b/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts index 5dd87db2..596a3177 100644 --- a/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts +++ b/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts @@ -43,6 +43,7 @@ export interface ArrangementVO { userGroupList?: any[]; attendanceGroup?: any; dateType?: number; + areaList: any[]; //区域 } export interface ArrangementForm extends BaseEntity { diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/data.ts b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/data.ts index 9f0abf52..fe433e70 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/data.ts +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/data.ts @@ -19,9 +19,20 @@ export const columns: VxeGridProps['columns'] = [ width: 'auto', }, { - title: '摄像机id', - field: 'deviceManageId', + title: '摄像机', + field: 'areaDevice', minWidth: 300, + slots: { + default: ({ row }: { row: any }) => { + if (!row.areaDevice || !Array.isArray(row.areaDevice)) { + return ''; + } + return row.areaDevice + .map((device: any) => device.remoteSisDeviceManage?.deviceName || '') + .filter((deviceName: string) => deviceName) + .join(', '); + }, + }, }, { diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue index cc36d025..7d227467 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue @@ -31,7 +31,7 @@ let formModal = reactive<{ dateType: number | undefined; startDate: string; endDate: string; - areaId: string; + areaId: string[]; userGroupList: any[]; }>({ id: '', @@ -43,7 +43,7 @@ let formModal = reactive<{ // dateRange: [null, null], startDate: '', //开始日期 endDate: '', //结束日期 - areaId: '', //区域 + areaId: [], //区域 userGroupList: [ // scheduleId:undefined,//排班ID // employeeId:undefined,//员工ID @@ -313,7 +313,7 @@ async function handleConfirm() { dateType: undefined, startDate: '', endDate: '', - areaId: '', + areaId: [], userGroupList: [], }); // 重置其他数据 @@ -338,7 +338,7 @@ async function handleClosed() { dateType: undefined, startDate: '', endDate: '', - areaId: '', + areaId: [], userGroupList: [], }); @@ -422,6 +422,7 @@ onMounted(() => {}); v-model:value="formModal.areaId" :options="areaOptions" placeholder="请选择" + mode="multiple" @change="chooseGroup" /> diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts index 3756201a..1134544e 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts @@ -59,7 +59,7 @@ export const querySchema: FormSchemaGetter = () => [ export const unitQuerySchema: FormSchemaGetter = () => [ { component: 'Input', - fieldName: 'scheduleName', + fieldName: 'userName', label: '姓名', }, { @@ -339,6 +339,22 @@ export const workforceDayDetailColumns: VxeGridProps['columns'] = [ }, }, }, + { + title: '区域', + field: 'areaList', + width: 'auto', + slots: { + default: ({ row }: { row: any }) => { + if (!row.areaList || !Array.isArray(row.areaList)) { + return ''; + } + return row.areaList + .map((item: any) => item.area || '') + .filter((areaName: string) => areaName) + .join(', '); + }, + }, + }, { title: '班组人数', field: 'userCount', diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue index 06817e6b..c7e6f34b 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue @@ -22,14 +22,14 @@ let formModal = reactive<{ id: string | number; groupId?: string | number; attendanceType: string; - areaId: string; + areaId: string[]; userGroupList: any[]; dateType: number | undefined; }>({ id: '', groupId: '', attendanceType: '', //考勤组类型 - areaId: '', //区域 + areaId: [], //区域 userGroupList: [ // scheduleId:undefined,//排班ID // employeeId:undefined,//员工ID @@ -179,6 +179,7 @@ const [BasicModal, modalApi] = useVbenModal({ formModal.id = record.id; formModal.groupId = record.attendanceGroup.id; formModal.dateType = record.dateType; + formModal.areaId = record.areaList?.map((area: any) => area.id) || []; if (record.userGroupList) { // 按部门分组处理 userGroupList @@ -203,8 +204,6 @@ const [BasicModal, modalApi] = useVbenModal({ tableData.splice(0, 0, ...Array.from(deptMap.values())); } } - console.log(tableData); - // await markInitialized(); modalApi.modalLoading(false); }, @@ -251,7 +250,6 @@ async function handleConfirm() { modalApi.lock(true); await formRef.value.validate(); // 先校验 const data = formModal; - console.log(tableData); data.userGroupList = tableData.flatMap((item) => item.users.map((user) => ({ deptId: item.dept.unitId, @@ -270,7 +268,7 @@ async function handleConfirm() { dateType: undefined, startDate: '', endDate: '', - areaId: '', + areaId: [], userGroupList: [], }); // 重置其他数据 @@ -292,7 +290,7 @@ async function handleClosed() { dateType: undefined, startDate: '', endDate: '', - areaId: '', + areaId: [], userGroupList: [], }); @@ -332,6 +330,7 @@ onMounted(() => {}); v-model:value="formModal.areaId" :options="areaOptions" placeholder="请选择" + mode="multiple" @change="chooseGroup" />