feat: 格式化代码
Some checks failed
/ Explore-Gitea-Actions (push) Failing after 2m0s

This commit is contained in:
fyy 2025-08-18 11:30:21 +08:00
parent 93be4f1891
commit 7d15ff713c
5 changed files with 61 additions and 59 deletions

View File

@ -6,7 +6,11 @@ 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 { attendanceAreaAdd, attendanceAreaInfo, attendanceAreaUpdate } from '#/api/property/attendanceManagement/attendanceArea'; import {
attendanceAreaAdd,
attendanceAreaInfo,
attendanceAreaUpdate,
} from '#/api/property/attendanceManagement/attendanceArea';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data'; import { modalSchema } from './data';
@ -27,7 +31,7 @@ const [BasicForm, formApi] = useVbenForm({
// //
componentProps: { componentProps: {
class: 'w-full', class: 'w-full',
} },
}, },
schema: modalSchema(), schema: modalSchema(),
showDefaultActions: false, showDefaultActions: false,
@ -76,7 +80,9 @@ async function handleConfirm() {
} }
// getValuesreadonly // getValuesreadonly
const data = cloneDeep(await formApi.getValues()); const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? attendanceAreaUpdate(data) : attendanceAreaAdd(data)); await (isUpdate.value
? attendanceAreaUpdate(data)
: attendanceAreaAdd(data));
resetInitialized(); resetInitialized();
emit('reload'); emit('reload');
modalApi.close(); modalApi.close();
@ -98,4 +104,3 @@ async function handleClosed() {
<BasicForm /> <BasicForm />
</BasicModal> </BasicModal>
</template> </template>

View File

@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps,
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { import {
@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// //
id: 'property-attendanceArea-index' id: 'property-attendanceArea-index',
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
@ -118,9 +118,14 @@ function handleMultiDelete() {
} }
function handleDownloadExcel() { function handleDownloadExcel() {
commonDownloadExcel(attendanceAreaExport, '区域区域管理数据', tableApi.formApi.form.values, { commonDownloadExcel(
fieldMappingTime: formOptions.fieldMappingTime, attendanceAreaExport,
}); '区域区域管理数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
} }
</script> </script>
@ -138,9 +143,10 @@ function handleDownloadExcel() {
<a-button <a-button
:disabled="!vxeCheckboxChecked(tableApi)" :disabled="!vxeCheckboxChecked(tableApi)"
danger danger
type="primary" type="primary"
v-access:code="['property:attendanceArea:remove']" v-access:code="['property:attendanceArea:remove']"
@click="handleMultiDelete"> @click="handleMultiDelete"
>
{{ $t('pages.common.delete') }} {{ $t('pages.common.delete') }}
</a-button> </a-button>
<a-button <a-button

View File

@ -20,9 +20,7 @@ import dayjs from 'dayjs';
import type { PersonVO } from './type'; import type { PersonVO } from './type';
import { ref, h } from 'vue'; import { ref, h } from 'vue';
import { Tag, Table } from 'ant-design-vue'; import { Tag, Table } from 'ant-design-vue';
import { import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
attendanceAreaList,
} from '#/api/property/attendanceManagement/attendanceArea';
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
// //
@ -33,7 +31,7 @@ let formModal = reactive<{
dateType: number | undefined; dateType: number | undefined;
startDate: string; startDate: string;
endDate: string; endDate: string;
areaId:string; areaId: string;
userGroupList: any[]; userGroupList: any[];
}>({ }>({
id: '', id: '',
@ -45,7 +43,7 @@ let formModal = reactive<{
// dateRange: [null, null], // dateRange: [null, null],
startDate: '', // startDate: '', //
endDate: '', // endDate: '', //
areaId:'',// areaId: '', //
userGroupList: [ userGroupList: [
// scheduleId:undefined,//ID // scheduleId:undefined,//ID
// employeeId:undefined,//ID // employeeId:undefined,//ID
@ -63,8 +61,8 @@ const rules = {
attendanceType: [{ required: true }], attendanceType: [{ required: true }],
dateType: [{ required: true, message: '请选择排班日期' }], dateType: [{ required: true, message: '请选择排班日期' }],
}; };
const groupOptions = ref<any[]>([]);// const groupOptions = ref<any[]>([]); //
const areaOptions = ref<any[]>([]);// const areaOptions = ref<any[]>([]); //
const groupMap = ref<Record<string, any>>({}); // const groupMap = ref<Record<string, any>>({}); //
let tableData = reactive< let tableData = reactive<
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[] { dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
@ -246,13 +244,12 @@ async function getGroupList() {
groupMap.value[item.id] = item; groupMap.value[item.id] = item;
}); });
} }
async function getAreaList(){ async function getAreaList() {
const res = await attendanceAreaList({ pageSize: 1000000000, const res = await attendanceAreaList({ pageSize: 1000000000, pageNum: 1 });
pageNum: 1,}) areaOptions.value = (res.rows || []).map((item) => ({
areaOptions.value = (res.rows || []).map((item)=>({ label: item.area,
label:item.area, value: item.id,
value:item.id }));
}));
} }
function chooseGroup(value: any) { function chooseGroup(value: any) {
const group = groupMap.value[value]; const group = groupMap.value[value];
@ -316,7 +313,7 @@ async function handleConfirm() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId:'', areaId: '',
userGroupList: [], userGroupList: [],
}); });
// //
@ -341,7 +338,7 @@ async function handleClosed() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId:'', areaId: '',
userGroupList: [], userGroupList: [],
}); });

View File

@ -1,9 +1,7 @@
import type { FormSchemaGetter } from '#/adapter/form'; import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import { renderDict } from '#/utils/render'; import { renderDict } from '#/utils/render';
import { import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
attendanceAreaList
} from '#/api/property/attendanceManagement/attendanceArea';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
@ -265,18 +263,18 @@ export const modalSchema: FormSchemaGetter = () => [
}, },
}, },
{ {
label:'选择区域', label: '选择区域',
fieldName:'areaId', fieldName: 'areaId',
component:'ApiSelect', component: 'ApiSelect',
componentProps:{ componentProps: {
api: async ()=>{ api: async () => {
const res = await attendanceAreaList({pageNum:1,pageSize:10000}); const res = await attendanceAreaList({ pageNum: 1, pageSize: 10000 });
return res; return res;
}, },
resultField:'rows', resultField: 'rows',
labelField:'', labelField: '',
valueField:'' valueField: '',
} },
}, },
{ {
label: '状态0-未生效1-已生效', label: '状态0-未生效1-已生效',

View File

@ -14,9 +14,7 @@ import dayjs from 'dayjs';
import type { PersonVO } from './type'; import type { PersonVO } from './type';
import { ref, h } from 'vue'; import { ref, h } from 'vue';
import { Tag, Table } from 'ant-design-vue'; import { Tag, Table } from 'ant-design-vue';
import { import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
attendanceAreaList,
} from '#/api/property/attendanceManagement/attendanceArea';
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
// //
@ -24,14 +22,14 @@ let formModal = reactive<{
id: string | number; id: string | number;
groupId?: string | number; groupId?: string | number;
attendanceType: string; attendanceType: string;
areaId:string; areaId: string;
userGroupList: any[]; userGroupList: any[];
dateType: number | undefined; dateType: number | undefined;
}>({ }>({
id: '', id: '',
groupId: '', groupId: '',
attendanceType: '', // attendanceType: '', //
areaId:'',// areaId: '', //
userGroupList: [ userGroupList: [
// scheduleId:undefined,//ID // scheduleId:undefined,//ID
// employeeId:undefined,//ID // employeeId:undefined,//ID
@ -42,8 +40,8 @@ let formModal = reactive<{
dateType: undefined, // dateType: undefined, //
}); });
const formRef = ref(); const formRef = ref();
const groupOptions = ref<any[]>([]);// const groupOptions = ref<any[]>([]); //
const areaOptions = ref<any[]>([]);// const areaOptions = ref<any[]>([]); //
const groupMap = ref<Record<string, any>>({}); // const groupMap = ref<Record<string, any>>({}); //
let tableData = reactive< let tableData = reactive<
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[] { dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
@ -182,7 +180,6 @@ const [BasicModal, modalApi] = useVbenModal({
formModal.groupId = record.attendanceGroup.id; formModal.groupId = record.attendanceGroup.id;
formModal.dateType = record.dateType; formModal.dateType = record.dateType;
if (record.userGroupList) { if (record.userGroupList) {
// userGroupList // userGroupList
const deptMap = new Map(); const deptMap = new Map();
@ -231,13 +228,12 @@ async function getGroupList() {
groupMap.value[item.id] = item; groupMap.value[item.id] = item;
}); });
} }
async function getAreaList(){ async function getAreaList() {
const res = await attendanceAreaList({ pageSize: 1000000000, const res = await attendanceAreaList({ pageSize: 1000000000, pageNum: 1 });
pageNum: 1,}) areaOptions.value = (res.rows || []).map((item) => ({
areaOptions.value = (res.rows || []).map((item)=>({ label: item.area,
label:item.area, value: item.id,
value:item.id }));
}));
} }
function chooseGroup(value: any) { function chooseGroup(value: any) {
const group = groupMap.value[value]; const group = groupMap.value[value];
@ -274,7 +270,7 @@ async function handleConfirm() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId:'', areaId: '',
userGroupList: [], userGroupList: [],
}); });
// //
@ -296,7 +292,7 @@ async function handleClosed() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId:'', areaId: '',
userGroupList: [], userGroupList: [],
}); });