批量分组、表格数据优化

This commit is contained in:
Qi 2025-06-17 09:46:43 +08:00
parent 9086285b76
commit 04b8fa5cbc
4 changed files with 65 additions and 5 deletions

View File

@ -11,6 +11,7 @@ enum Api {
deleteBatch = '/cet/cetInvigilateData/deleteBatch',
importExcel = '/cet/cetInvigilateData/importExcel',
exportXls = '/cet/cetInvigilateData/exportXls',
batchHandleGroup = 'cet/cetInvigilateData/batchHandleGroup',
}
/**
* api
@ -53,6 +54,25 @@ export const batchDelete = (params, handleSuccess) => {
},
});
};
/**
*
* @param params
*/
export const batchHandleGroups = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认分组',
content: '是否将选中的数据进行随机分组',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({ url: Api.batchHandleGroup, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
},
});
};
/**
*
* @param params

View File

@ -30,7 +30,11 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'sex',
},
{
title: '分组名称',
align: 'center',
dataIndex: 'groupName',
},
{
title: '类型',
align: 'center',
@ -77,7 +81,7 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '教师姓名',
label: '姓名',
field: 'name',
component: 'Input',
dynamicRules: ({ model, schema }) => {

View File

@ -14,6 +14,10 @@
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
<a-menu-item key="1" @click="batchHandleGroup">
<Icon icon="ant-design:delete-outlined" />
批量分组
</a-menu-item>
</a-menu>
</template>
<a-button
@ -43,7 +47,7 @@
import { useListPage } from '/@/hooks/system/useListPage';
import CetInvigilateDataModal from './components/CetInvigilateDataModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './CetInvigilateData.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetInvigilateData.api';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, batchHandleGroups } from './CetInvigilateData.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
const queryParam = reactive<any>({});
@ -140,6 +144,13 @@
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 批量分组事件
*/
async function batchHandleGroup() {
await batchHandleGroups({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/

View File

@ -34,6 +34,20 @@ export const columns: BasicColumn[] = [
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '校区',
field: 'campus',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '江北', value: '江北' },
{ label: '江南', value: '江南' },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择校区!!' }];
},
},
{
label: '教师姓名',
field: 'name',
@ -65,9 +79,20 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '校区',
field: 'campus',
label: '学院',
field: 'college',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入教师学院!!' }];
},
},
{
label: '工号',
field: 'college',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入教师工号!!' }];
},
},
//{
// label: '照片地址',