批量分组、表格数据优化
This commit is contained in:
parent
9086285b76
commit
04b8fa5cbc
|
@ -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
|
||||
|
|
|
@ -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 }) => {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
|
|
|
@ -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: '照片地址',
|
||||
|
|
Loading…
Reference in New Issue