From 7d15ff713cf0ef8e4032089170f8a583bcdf14b8 Mon Sep 17 00:00:00 2001
From: fyy <2717885210@qq.com>
Date: Mon, 18 Aug 2025 11:30:21 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../attendanceArea/attendanceArea-modal.vue | 13 +++++---
.../attendanceArea/index.vue | 24 +++++++++------
.../workforceManagement/arrangement-modal.vue | 29 ++++++++----------
.../workforceManagement/data.ts | 24 +++++++--------
.../workforceManagement/workforce-detail.vue | 30 ++++++++-----------
5 files changed, 61 insertions(+), 59 deletions(-)
diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/attendanceArea-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/attendanceArea-modal.vue
index 36ca4e4a..e8a282b5 100644
--- a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/attendanceArea-modal.vue
+++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/attendanceArea-modal.vue
@@ -6,7 +6,11 @@ import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
-import { attendanceAreaAdd, attendanceAreaInfo, attendanceAreaUpdate } from '#/api/property/attendanceManagement/attendanceArea';
+import {
+ attendanceAreaAdd,
+ attendanceAreaInfo,
+ attendanceAreaUpdate,
+} from '#/api/property/attendanceManagement/attendanceArea';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
@@ -27,7 +31,7 @@ const [BasicForm, formApi] = useVbenForm({
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
- }
+ },
},
schema: modalSchema(),
showDefaultActions: false,
@@ -76,7 +80,9 @@ async function handleConfirm() {
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
- await (isUpdate.value ? attendanceAreaUpdate(data) : attendanceAreaAdd(data));
+ await (isUpdate.value
+ ? attendanceAreaUpdate(data)
+ : attendanceAreaAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
@@ -98,4 +104,3 @@ async function handleClosed() {
-
diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/index.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/index.vue
index 52cc246e..bdcf7cbf 100644
--- a/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/index.vue
+++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceArea/index.vue
@@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
-import {
+import {
useVbenVxeGrid,
vxeCheckboxChecked,
- type VxeGridProps
+ type VxeGridProps,
} from '#/adapter/vxe-table';
import {
@@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
- id: 'property-attendanceArea-index'
+ id: 'property-attendanceArea-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -118,9 +118,14 @@ function handleMultiDelete() {
}
function handleDownloadExcel() {
- commonDownloadExcel(attendanceAreaExport, '区域区域管理数据', tableApi.formApi.form.values, {
- fieldMappingTime: formOptions.fieldMappingTime,
- });
+ commonDownloadExcel(
+ attendanceAreaExport,
+ '区域区域管理数据',
+ tableApi.formApi.form.values,
+ {
+ fieldMappingTime: formOptions.fieldMappingTime,
+ },
+ );
}
@@ -138,9 +143,10 @@ function handleDownloadExcel() {
+ type="primary"
+ v-access:code="['property:attendanceArea:remove']"
+ @click="handleMultiDelete"
+ >
{{ $t('pages.common.delete') }}
();
//表单项
@@ -33,7 +31,7 @@ let formModal = reactive<{
dateType: number | undefined;
startDate: string;
endDate: string;
- areaId:string;
+ areaId: string;
userGroupList: any[];
}>({
id: '',
@@ -45,7 +43,7 @@ let formModal = reactive<{
// dateRange: [null, null],
startDate: '', //开始日期
endDate: '', //结束日期
- areaId:'',//区域
+ areaId: '', //区域
userGroupList: [
// scheduleId:undefined,//排班ID
// employeeId:undefined,//员工ID
@@ -63,8 +61,8 @@ const rules = {
attendanceType: [{ required: true }],
dateType: [{ required: true, message: '请选择排班日期' }],
};
-const groupOptions = ref([]);//考勤组
-const areaOptions = ref([]);//区域
+const groupOptions = ref([]); //考勤组
+const areaOptions = ref([]); //区域
const groupMap = ref>({}); // 用于快速查找
let tableData = reactive<
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
@@ -246,13 +244,12 @@ async function getGroupList() {
groupMap.value[item.id] = item;
});
}
-async function getAreaList(){
- const res = await attendanceAreaList({ pageSize: 1000000000,
- pageNum: 1,})
- areaOptions.value = (res.rows || []).map((item)=>({
- label:item.area,
- value:item.id
- }));
+async function getAreaList() {
+ const res = await attendanceAreaList({ pageSize: 1000000000, pageNum: 1 });
+ areaOptions.value = (res.rows || []).map((item) => ({
+ label: item.area,
+ value: item.id,
+ }));
}
function chooseGroup(value: any) {
const group = groupMap.value[value];
@@ -316,7 +313,7 @@ async function handleConfirm() {
dateType: undefined,
startDate: '',
endDate: '',
- areaId:'',
+ areaId: '',
userGroupList: [],
});
// 重置其他数据
@@ -341,7 +338,7 @@ async function handleClosed() {
dateType: undefined,
startDate: '',
endDate: '',
- areaId:'',
+ areaId: '',
userGroupList: [],
});
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 d571478b..3756201a 100644
--- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts
+++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/data.ts
@@ -1,9 +1,7 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { renderDict } from '#/utils/render';
-import {
- attendanceAreaList
-} from '#/api/property/attendanceManagement/attendanceArea';
+import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
export const querySchema: FormSchemaGetter = () => [
{
@@ -265,18 +263,18 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
- label:'选择区域',
- fieldName:'areaId',
- component:'ApiSelect',
- componentProps:{
- api: async ()=>{
- const res = await attendanceAreaList({pageNum:1,pageSize:10000});
+ label: '选择区域',
+ fieldName: 'areaId',
+ component: 'ApiSelect',
+ componentProps: {
+ api: async () => {
+ const res = await attendanceAreaList({ pageNum: 1, pageSize: 10000 });
return res;
},
- resultField:'rows',
- labelField:'',
- valueField:''
- }
+ resultField: 'rows',
+ labelField: '',
+ valueField: '',
+ },
},
{
label: '状态:0-未生效,1-已生效',
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 c88e1b95..06817e6b 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
@@ -14,9 +14,7 @@ import dayjs from 'dayjs';
import type { PersonVO } from './type';
import { ref, h } from 'vue';
import { Tag, Table } from 'ant-design-vue';
-import {
- attendanceAreaList,
-} from '#/api/property/attendanceManagement/attendanceArea';
+import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
const emit = defineEmits<{ reload: [] }>();
//表单项
@@ -24,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
@@ -42,8 +40,8 @@ let formModal = reactive<{
dateType: undefined, //排班日期类型
});
const formRef = ref();
-const groupOptions = ref([]);//考勤组
- const areaOptions = ref([]);//区域
+const groupOptions = ref([]); //考勤组
+const areaOptions = ref([]); //区域
const groupMap = ref>({}); // 用于快速查找
let tableData = reactive<
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
@@ -182,7 +180,6 @@ const [BasicModal, modalApi] = useVbenModal({
formModal.groupId = record.attendanceGroup.id;
formModal.dateType = record.dateType;
-
if (record.userGroupList) {
// 按部门分组处理 userGroupList
const deptMap = new Map();
@@ -231,13 +228,12 @@ async function getGroupList() {
groupMap.value[item.id] = item;
});
}
-async function getAreaList(){
- const res = await attendanceAreaList({ pageSize: 1000000000,
- pageNum: 1,})
- areaOptions.value = (res.rows || []).map((item)=>({
- label:item.area,
- value:item.id
- }));
+async function getAreaList() {
+ const res = await attendanceAreaList({ pageSize: 1000000000, pageNum: 1 });
+ areaOptions.value = (res.rows || []).map((item) => ({
+ label: item.area,
+ value: item.id,
+ }));
}
function chooseGroup(value: any) {
const group = groupMap.value[value];
@@ -274,7 +270,7 @@ async function handleConfirm() {
dateType: undefined,
startDate: '',
endDate: '',
- areaId:'',
+ areaId: '',
userGroupList: [],
});
// 重置其他数据
@@ -296,7 +292,7 @@ async function handleClosed() {
dateType: undefined,
startDate: '',
endDate: '',
- areaId:'',
+ areaId: '',
userGroupList: [],
});