完善表单细节
This commit is contained in:
parent
2beaa3b57e
commit
34f7309717
|
@ -6,28 +6,27 @@ import { render } from '/@/utils/common/renderUtils';
|
|||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '宿舍信息',
|
||||
align:"center",
|
||||
dataIndex: 'dormitory'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitory',
|
||||
},
|
||||
{
|
||||
title: '宿舍类型(男/女)',
|
||||
align:"center",
|
||||
dataIndex: 'dormitoryType'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitoryType',
|
||||
},
|
||||
{
|
||||
title: '宿舍人数',
|
||||
align:"center",
|
||||
dataIndex: 'dormitoryNum'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitoryNum',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'dormitoryStatus'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitoryStatus',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
|
@ -35,19 +34,21 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'dormitory',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入宿舍信息!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入宿舍信息!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '男/女',
|
||||
field: 'dormitoryType',
|
||||
component: 'Input',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '男', value: 0 },
|
||||
{ label: '女', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入男/女!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择男/女!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -55,19 +56,22 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'dormitoryNum',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入宿舍人数!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入宿舍人数!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '宿舍状态0没满,1已满',
|
||||
label: '宿舍状态',
|
||||
//0没满,1已满
|
||||
field: 'dormitoryStatus',
|
||||
component: 'Input',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '未满', value: 0 },
|
||||
{ label: '已满', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入宿舍状态0没满,1已满!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择宿舍状态' }];
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
|
@ -75,16 +79,16 @@ export const formSchema: FormSchema[] = [
|
|||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
dormitory: {title: '宿舍信息',order: 0,view: 'text', type: 'string',},
|
||||
dormitoryType: {title: '男/女',order: 1,view: 'text', type: 'string',},
|
||||
dormitoryNum: {title: '宿舍人数',order: 2,view: 'number', type: 'number',},
|
||||
dormitoryStatus: {title: '宿舍状态0没满,1已满',order: 3,view: 'text', type: 'string',},
|
||||
dormitory: { title: '宿舍信息', order: 0, view: 'text', type: 'string' },
|
||||
dormitoryType: { title: '男/女', order: 1, view: 'text', type: 'string' },
|
||||
dormitoryNum: { title: '宿舍人数', order: 2, view: 'number', type: 'number' },
|
||||
dormitoryStatus: { title: '宿舍状态0没满,1已满', order: 3, view: 'text', type: 'string' },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
|
@ -28,11 +29,20 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<span v-if="column.dataIndex === 'dormitoryType'">
|
||||
<a-tag v-if="record.dormitoryType === 0" color="green">男</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryType !== 0" color="red">女</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'dormitoryStatus'">
|
||||
<a-tag v-if="record.dormitoryStatus === 0" color="green">未满</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red">已满</a-tag>
|
||||
</span>
|
||||
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CeesDormitoryInfoModal @register="registerModal" @success="handleSuccess"></CeesDormitoryInfoModal>
|
||||
<CeesDormitoryInfoModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -40,8 +50,8 @@
|
|||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import CeesDormitoryInfoModal from './components/CeesDormitoryInfoModal.vue'
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesDormitoryInfoModal from './components/CeesDormitoryInfoModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CeesDormitoryInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesDormitoryInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
|
@ -63,31 +73,29 @@
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"宿舍信息表",
|
||||
name: '宿舍信息表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
success: handleSuccess,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
@ -156,8 +164,8 @@
|
|||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
|
@ -167,20 +175,17 @@
|
|||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<BasicForm @register="registerForm" />
|
||||
<div style="width: 100%; text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
|
@ -16,9 +16,9 @@
|
|||
import { saveOrUpdate } from '../CeesDormitoryInfo.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "CeesDormitoryInfoForm",
|
||||
name: 'CeesDormitoryInfoForm',
|
||||
components: {
|
||||
BasicForm
|
||||
BasicForm,
|
||||
},
|
||||
props: {
|
||||
formData: propTypes.object.def({}),
|
||||
|
@ -29,7 +29,7 @@
|
|||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const formDisabled = computed(() => {
|
||||
|
@ -44,18 +44,18 @@
|
|||
async function initFormData() {
|
||||
let params = { id: props.formData.dataId };
|
||||
const data = await defHttp.get({ url: queryByIdUrl, params });
|
||||
formData = {...data}
|
||||
formData = { ...data };
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
await setProps({ disabled: formDisabled.value });
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
console.log('表单数据', params);
|
||||
await saveOrUpdate(params, true);
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
@ -64,7 +64,7 @@
|
|||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
|
@ -18,7 +18,7 @@
|
|||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
|
@ -33,7 +33,7 @@
|
|||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
@ -57,10 +57,10 @@
|
|||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
|
@ -6,54 +6,54 @@ import { render } from '/@/utils/common/renderUtils';
|
|||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户id',
|
||||
align:"center",
|
||||
dataIndex: 'userId'
|
||||
align: 'center',
|
||||
dataIndex: 'userId',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
align:"center",
|
||||
dataIndex: 'userName'
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '专业id,0表示未选择',
|
||||
align:"center",
|
||||
dataIndex: 'majorId'
|
||||
align: 'center',
|
||||
dataIndex: 'majorId',
|
||||
},
|
||||
{
|
||||
title: '用户专业id',
|
||||
align:"center",
|
||||
dataIndex: 'userMajorId'
|
||||
align: 'center',
|
||||
dataIndex: 'userMajorId',
|
||||
},
|
||||
{
|
||||
title: '用户专业id',
|
||||
align:"center",
|
||||
dataIndex: 'teacherId'
|
||||
align: 'center',
|
||||
dataIndex: 'teacherId',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
align: 'center',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '组id',
|
||||
align:"center",
|
||||
dataIndex: 'groupId'
|
||||
align: 'center',
|
||||
dataIndex: 'groupId',
|
||||
},
|
||||
{
|
||||
title: '使用次数',
|
||||
align:"center",
|
||||
dataIndex: 'numberuse'
|
||||
align: 'center',
|
||||
dataIndex: 'numberuse',
|
||||
},
|
||||
{
|
||||
title: '状态:0正常 1禁用',
|
||||
align:"center",
|
||||
dataIndex: 'status'
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "用户名",
|
||||
label: '用户名',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
//colProps: {span: 6},
|
||||
|
@ -66,9 +66,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -76,9 +74,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户名!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户名!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -86,9 +82,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'majorId',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入专业id,0表示未选择!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入专业id,0表示未选择!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -96,9 +90,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userMajorId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户专业id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户专业id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -106,9 +98,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'teacherId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户专业id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户专业id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -116,9 +106,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'phone',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入手机号!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入手机号!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -126,9 +114,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'groupId',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入组id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入组id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -136,19 +122,21 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'numberuse',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入使用次数!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入使用次数!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态:0正常 1禁用',
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'InputNumber',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '禁用', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入状态:0正常 1禁用!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择状态!' }];
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
|
@ -156,21 +144,21 @@ export const formSchema: FormSchema[] = [
|
|||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
|
||||
userName: {title: '用户名',order: 1,view: 'text', type: 'string',},
|
||||
majorId: {title: '专业id,0表示未选择',order: 2,view: 'number', type: 'number',},
|
||||
userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',},
|
||||
teacherId: {title: '用户专业id',order: 4,view: 'text', type: 'string',},
|
||||
phone: {title: '手机号',order: 5,view: 'text', type: 'string',},
|
||||
groupId: {title: '组id',order: 6,view: 'number', type: 'number',},
|
||||
numberuse: {title: '使用次数',order: 7,view: 'number', type: 'number',},
|
||||
status: {title: '状态:0正常 1禁用',order: 8,view: 'number', type: 'number',},
|
||||
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
|
||||
userName: { title: '用户名', order: 1, view: 'text', type: 'string' },
|
||||
majorId: { title: '专业id,0表示未选择', order: 2, view: 'number', type: 'number' },
|
||||
userMajorId: { title: '用户专业id', order: 3, view: 'text', type: 'string' },
|
||||
teacherId: { title: '用户专业id', order: 4, view: 'text', type: 'string' },
|
||||
phone: { title: '手机号', order: 5, view: 'text', type: 'string' },
|
||||
groupId: { title: '组id', order: 6, view: 'number', type: 'number' },
|
||||
numberuse: { title: '使用次数', order: 7, view: 'number', type: 'number' },
|
||||
status: { title: '状态:0正常 1禁用', order: 8, view: 'number', type: 'number' },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
|
@ -28,11 +29,15 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<span v-if="column.dataIndex === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
|
||||
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CeesLocalTeacherModal @register="registerModal" @success="handleSuccess"></CeesLocalTeacherModal>
|
||||
<CeesLocalTeacherModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -40,8 +45,8 @@
|
|||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import CeesLocalTeacherModal from './components/CeesLocalTeacherModal.vue'
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesLocalTeacherModal from './components/CeesLocalTeacherModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CeesLocalTeacher.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesLocalTeacher.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
|
@ -63,31 +68,29 @@
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"本校教师表",
|
||||
name: '本校教师表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
success: handleSuccess,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
@ -156,8 +159,8 @@
|
|||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
|
@ -167,20 +170,17 @@
|
|||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -25,27 +25,27 @@ const filterMajor = (value, row) => {
|
|||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '学生名',
|
||||
align:"center",
|
||||
dataIndex: 'userName'
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
align:"center",
|
||||
dataIndex: 'userId'
|
||||
align: 'center',
|
||||
dataIndex: 'userId',
|
||||
},
|
||||
{
|
||||
title: '学号',
|
||||
align:"center",
|
||||
dataIndex: 'studentId'
|
||||
align: 'center',
|
||||
dataIndex: 'studentId',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
align: 'center',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '学科',
|
||||
align:"center",
|
||||
align: 'center',
|
||||
dataIndex: 'majorId',
|
||||
customRender: ({ text }) => {
|
||||
return isMajor(text); // 根据 majorId 显示学科名称
|
||||
|
@ -62,33 +62,30 @@ export const columns: BasicColumn[] = [
|
|||
},
|
||||
{
|
||||
title: '所属分组',
|
||||
align:"center",
|
||||
dataIndex: 'groupId'
|
||||
align: 'center',
|
||||
dataIndex: 'groupId',
|
||||
},
|
||||
{
|
||||
title: '是否第一次阅卷',
|
||||
align:"center",
|
||||
align: 'center',
|
||||
dataIndex: 'checked',
|
||||
customRender: ({text}) => {
|
||||
return text == 1 ? '是' : '否';
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '使用次数',
|
||||
align:"center",
|
||||
dataIndex: 'numberuse'
|
||||
align: 'center',
|
||||
dataIndex: 'numberuse',
|
||||
},
|
||||
{
|
||||
title: '状态:0正常 1禁用',
|
||||
align:"center",
|
||||
dataIndex: 'status'
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "用户名",
|
||||
label: '用户名',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
//colProps: {span: 6},
|
||||
|
@ -101,9 +98,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -111,9 +106,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户名!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户名!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -129,9 +122,7 @@ export const formSchema: FormSchema[] = [
|
|||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请选择学科!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择学科!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -139,9 +130,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userMajorId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户专业id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户专业id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -149,9 +138,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'studentId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入学生id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入学生id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -159,9 +146,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'phone',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入手机号!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入手机号!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -170,14 +155,12 @@ export const formSchema: FormSchema[] = [
|
|||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请选择是否第一次阅卷!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择是否第一次阅卷!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -185,9 +168,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'groupId',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入组id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入组id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -195,19 +176,21 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'numberuse',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入使用次数!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入使用次数!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态:0正常 1禁用',
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'InputNumber',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '禁用', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入状态:0正常 1禁用!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择状态!' }];
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
|
@ -215,22 +198,22 @@ export const formSchema: FormSchema[] = [
|
|||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
|
||||
userName: {title: '用户名',order: 1,view: 'text', type: 'string',},
|
||||
majorId: {title: '专业id,0表示未选择',order: 2,view: 'number', type: 'number',},
|
||||
userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',},
|
||||
studentId: {title: '学生id',order: 4,view: 'text', type: 'string',},
|
||||
phone: {title: '手机号',order: 5,view: 'text', type: 'string',},
|
||||
checked: {title: '是否第一次阅卷',order: 6,view: 'text', type: 'string',},
|
||||
groupId: {title: '组id',order: 7,view: 'number', type: 'number',},
|
||||
numberuse: {title: '使用次数',order: 8,view: 'number', type: 'number',},
|
||||
status: {title: '状态:0正常 1禁用',order: 9,view: 'number', type: 'number',},
|
||||
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
|
||||
userName: { title: '用户名', order: 1, view: 'text', type: 'string' },
|
||||
majorId: { title: '专业id,0表示未选择', order: 2, view: 'number', type: 'number' },
|
||||
userMajorId: { title: '用户专业id', order: 3, view: 'text', type: 'string' },
|
||||
studentId: { title: '学生id', order: 4, view: 'text', type: 'string' },
|
||||
phone: { title: '手机号', order: 5, view: 'text', type: 'string' },
|
||||
checked: { title: '是否第一次阅卷', order: 6, view: 'text', type: 'string' },
|
||||
groupId: { title: '组id', order: 7, view: 'number', type: 'number' },
|
||||
numberuse: { title: '使用次数', order: 8, view: 'number', type: 'number' },
|
||||
status: { title: '状态:0正常 1禁用', order: 9, view: 'number', type: 'number' },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
|
@ -28,11 +29,19 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<span v-if="column.dataIndex === 'checked'">
|
||||
<a-tag v-if="record.checked === 0" color="green">是</a-tag>
|
||||
<a-tag v-else-if="record.checked !== 0" color="red">否</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
|
||||
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<StudentModal @register="registerModal" @success="handleSuccess"></StudentModal>
|
||||
<StudentModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -40,8 +49,8 @@
|
|||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import StudentModal from './components/StudentModal.vue'
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import StudentModal from './components/StudentModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './Student.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Student.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
|
@ -63,31 +72,29 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right'
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "研究生表",
|
||||
name: '研究生表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
success: handleSuccess,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
@ -156,8 +163,8 @@ function getTableAction(record) {
|
|||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
|
@ -167,18 +174,17 @@ function getDropDownAction(record) {
|
|||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -6,130 +6,130 @@ import { render } from '/@/utils/common/renderUtils';
|
|||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户id',
|
||||
align:"center",
|
||||
dataIndex: 'userId'
|
||||
align: 'center',
|
||||
dataIndex: 'userId',
|
||||
},
|
||||
{
|
||||
title: '专业id',
|
||||
align:"center",
|
||||
dataIndex: 'majorId'
|
||||
align: 'center',
|
||||
dataIndex: 'majorId',
|
||||
},
|
||||
{
|
||||
title: '用户专业id',
|
||||
align:"center",
|
||||
dataIndex: 'userMajorId'
|
||||
align: 'center',
|
||||
dataIndex: 'userMajorId',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
align:"center",
|
||||
dataIndex: 'userName'
|
||||
align: 'center',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
align: 'center',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '职称',
|
||||
align:"center",
|
||||
dataIndex: 'jobTitle'
|
||||
align: 'center',
|
||||
dataIndex: 'jobTitle',
|
||||
},
|
||||
{
|
||||
title: '银行卡号',
|
||||
align:"center",
|
||||
dataIndex: 'pyCard'
|
||||
align: 'center',
|
||||
dataIndex: 'pyCard',
|
||||
},
|
||||
{
|
||||
title: '饭卡',
|
||||
align:"center",
|
||||
dataIndex: 'mealCard'
|
||||
align: 'center',
|
||||
dataIndex: 'mealCard',
|
||||
},
|
||||
{
|
||||
title: '办公位',
|
||||
align:"center",
|
||||
dataIndex: 'office'
|
||||
align: 'center',
|
||||
dataIndex: 'office',
|
||||
},
|
||||
{
|
||||
title: '工作名称',
|
||||
align:"center",
|
||||
dataIndex: 'workName'
|
||||
align: 'center',
|
||||
dataIndex: 'workName',
|
||||
},
|
||||
{
|
||||
title: '固定电话',
|
||||
align:"center",
|
||||
dataIndex: 'workPhone'
|
||||
align: 'center',
|
||||
dataIndex: 'workPhone',
|
||||
},
|
||||
{
|
||||
title: '身份证',
|
||||
align:"center",
|
||||
dataIndex: 'identityId'
|
||||
align: 'center',
|
||||
dataIndex: 'identityId',
|
||||
},
|
||||
{
|
||||
title: '车牌号',
|
||||
align:"center",
|
||||
dataIndex: 'carNumber'
|
||||
align: 'center',
|
||||
dataIndex: 'carNumber',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align:"center",
|
||||
dataIndex: 'sex'
|
||||
align: 'center',
|
||||
dataIndex: 'sex',
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align:"center",
|
||||
dataIndex: 'age'
|
||||
align: 'center',
|
||||
dataIndex: 'age',
|
||||
},
|
||||
{
|
||||
title: '车辆是否入校',
|
||||
align:"center",
|
||||
dataIndex: 'carStatus'
|
||||
align: 'center',
|
||||
dataIndex: 'carStatus',
|
||||
},
|
||||
{
|
||||
title: '宿舍信息',
|
||||
align:"center",
|
||||
dataIndex: 'dormitory'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitory',
|
||||
},
|
||||
{
|
||||
title: '是否住宿',
|
||||
align:"center",
|
||||
dataIndex: 'dormitoryStatus'
|
||||
align: 'center',
|
||||
dataIndex: 'dormitoryStatus',
|
||||
},
|
||||
{
|
||||
title: '开户所在地',
|
||||
align:"center",
|
||||
dataIndex: 'bankAddress'
|
||||
align: 'center',
|
||||
dataIndex: 'bankAddress',
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
align:"center",
|
||||
dataIndex: 'bankName'
|
||||
align: 'center',
|
||||
dataIndex: 'bankName',
|
||||
},
|
||||
{
|
||||
title: '组id',
|
||||
align:"center",
|
||||
dataIndex: 'groupId'
|
||||
align: 'center',
|
||||
dataIndex: 'groupId',
|
||||
},
|
||||
{
|
||||
title: '使用次数',
|
||||
align:"center",
|
||||
dataIndex: 'numberuse'
|
||||
align: 'center',
|
||||
dataIndex: 'numberuse',
|
||||
},
|
||||
{
|
||||
title: '状态:0已报道 1未报到',
|
||||
align:"center",
|
||||
dataIndex: 'status'
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "专业id",
|
||||
field: "majorId",
|
||||
label: '专业id',
|
||||
field: 'majorId',
|
||||
component: 'JRangeNumber',
|
||||
//colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
label: '用户名',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
//colProps: {span: 6},
|
||||
|
@ -142,9 +142,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -152,9 +150,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'majorId',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入专业id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入专业id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -162,9 +158,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userMajorId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户专业id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户专业id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -172,9 +166,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'userName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户名!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入用户名!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -182,9 +174,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'phone',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入手机号!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入手机号!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -192,9 +182,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'jobTitle',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入职称!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入职称!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -202,9 +190,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'pyCard',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入银行卡号!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入银行卡号!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -212,9 +198,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'mealCard',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入饭卡!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入饭卡!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -222,9 +206,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'office',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入办公位!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入办公位!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -232,9 +214,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'workName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入工作名称!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入工作名称!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -242,9 +222,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'workPhone',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入固定电话!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入固定电话!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -252,9 +230,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'identityId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入身份证!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入身份证!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -262,15 +238,19 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'carNumber',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入车牌号!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入车牌号!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '性别',
|
||||
field: 'sex',
|
||||
component: 'Input',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '男', value: 0 },
|
||||
{ label: '女', value: 1 },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
|
@ -280,11 +260,15 @@ export const formSchema: FormSchema[] = [
|
|||
{
|
||||
label: '车辆是否入校',
|
||||
field: 'carStatus',
|
||||
component: 'InputNumber',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入车辆是否入校!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入车辆是否入校!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -292,19 +276,21 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'dormitory',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入宿舍信息!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入宿舍信息!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否住宿',
|
||||
field: 'dormitoryStatus',
|
||||
component: 'Input',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入是否住宿!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入是否住宿!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -312,9 +298,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'bankAddress',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入开户所在地!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入开户所在地!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -322,9 +306,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'bankName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入开户行!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入开户行!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -332,9 +314,7 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'groupId',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入组id!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入组id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -342,19 +322,21 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'numberuse',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入使用次数!'},
|
||||
];
|
||||
return [{ required: true, message: '请输入使用次数!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态:0已报道 1未报到',
|
||||
label: '状态:',
|
||||
field: 'status',
|
||||
component: 'InputNumber',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '已报到', value: 0 },
|
||||
{ label: '未报到', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [
|
||||
{ required: true, message: '请输入状态:0已报道 1未报到!'},
|
||||
];
|
||||
return [{ required: true, message: '请选择状态' }];
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
|
@ -362,35 +344,35 @@ export const formSchema: FormSchema[] = [
|
|||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
|
||||
majorId: {title: '专业id',order: 1,view: 'number', type: 'number',},
|
||||
userMajorId: {title: '用户专业id',order: 2,view: 'text', type: 'string',},
|
||||
userName: {title: '用户名',order: 3,view: 'text', type: 'string',},
|
||||
phone: {title: '手机号',order: 4,view: 'text', type: 'string',},
|
||||
jobTitle: {title: '职称',order: 5,view: 'text', type: 'string',},
|
||||
pyCard: {title: '银行卡号',order: 6,view: 'text', type: 'string',},
|
||||
mealCard: {title: '饭卡',order: 7,view: 'text', type: 'string',},
|
||||
office: {title: '办公位',order: 8,view: 'text', type: 'string',},
|
||||
workName: {title: '工作名称',order: 9,view: 'text', type: 'string',},
|
||||
workPhone: {title: '固定电话',order: 10,view: 'text', type: 'string',},
|
||||
identityId: {title: '身份证',order: 11,view: 'text', type: 'string',},
|
||||
carNumber: {title: '车牌号',order: 12,view: 'text', type: 'string',},
|
||||
sex: {title: '性别',order: 13,view: 'text', type: 'string',},
|
||||
age: {title: '年龄',order: 14,view: 'number', type: 'number',},
|
||||
carStatus: {title: '车辆是否入校',order: 15,view: 'number', type: 'number',},
|
||||
dormitory: {title: '宿舍信息',order: 16,view: 'text', type: 'string',},
|
||||
dormitoryStatus: {title: '是否住宿',order: 17,view: 'text', type: 'string',},
|
||||
bankAddress: {title: '开户所在地',order: 18,view: 'text', type: 'string',},
|
||||
bankName: {title: '开户行',order: 19,view: 'text', type: 'string',},
|
||||
groupId: {title: '组id',order: 20,view: 'number', type: 'number',},
|
||||
numberuse: {title: '使用次数',order: 21,view: 'number', type: 'number',},
|
||||
status: {title: '状态:0已报道 1未报到',order: 22,view: 'number', type: 'number',},
|
||||
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
|
||||
majorId: { title: '专业id', order: 1, view: 'number', type: 'number' },
|
||||
userMajorId: { title: '用户专业id', order: 2, view: 'text', type: 'string' },
|
||||
userName: { title: '用户名', order: 3, view: 'text', type: 'string' },
|
||||
phone: { title: '手机号', order: 4, view: 'text', type: 'string' },
|
||||
jobTitle: { title: '职称', order: 5, view: 'text', type: 'string' },
|
||||
pyCard: { title: '银行卡号', order: 6, view: 'text', type: 'string' },
|
||||
mealCard: { title: '饭卡', order: 7, view: 'text', type: 'string' },
|
||||
office: { title: '办公位', order: 8, view: 'text', type: 'string' },
|
||||
workName: { title: '工作名称', order: 9, view: 'text', type: 'string' },
|
||||
workPhone: { title: '固定电话', order: 10, view: 'text', type: 'string' },
|
||||
identityId: { title: '身份证', order: 11, view: 'text', type: 'string' },
|
||||
carNumber: { title: '车牌号', order: 12, view: 'text', type: 'string' },
|
||||
sex: { title: '性别', order: 13, view: 'text', type: 'string' },
|
||||
age: { title: '年龄', order: 14, view: 'number', type: 'number' },
|
||||
carStatus: { title: '车辆是否入校', order: 15, view: 'number', type: 'number' },
|
||||
dormitory: { title: '宿舍信息', order: 16, view: 'text', type: 'string' },
|
||||
dormitoryStatus: { title: '是否住宿', order: 17, view: 'text', type: 'string' },
|
||||
bankAddress: { title: '开户所在地', order: 18, view: 'text', type: 'string' },
|
||||
bankName: { title: '开户行', order: 19, view: 'text', type: 'string' },
|
||||
groupId: { title: '组id', order: 20, view: 'number', type: 'number' },
|
||||
numberuse: { title: '使用次数', order: 21, view: 'number', type: 'number' },
|
||||
status: { title: '状态:0已报道 1未报到', order: 22, view: 'number', type: 'number' },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
|
@ -28,11 +29,27 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<span v-if="column.dataIndex === 'sex'">
|
||||
<a-tag v-if="record.dormitoryType === 0" color="green">男</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryType !== 0" color="red">女</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'status'">
|
||||
<a-tag v-if="record.dormitoryStatus === 0" color="green">已报到</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red">未报到</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'carStatus'">
|
||||
<a-tag v-if="record.carStatus === 0" color="green">是</a-tag>
|
||||
<a-tag v-else-if="record.carStatus !== 0" color="red">否</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'dormitoryStatus'">
|
||||
<a-tag v-if="record.dormitoryStatus === 0" color="green">是</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red">否</a-tag>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CeesWaiTeacherModal @register="registerModal" @success="handleSuccess"></CeesWaiTeacherModal>
|
||||
<CeesWaiTeacherModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -40,8 +57,8 @@
|
|||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue'
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CeesWaiTeacher.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesWaiTeacher.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
|
@ -63,32 +80,29 @@
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
['majorId', ['majorId_begin', 'majorId_end']],
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
fieldMapToNumber: [['majorId', ['majorId_begin', 'majorId_end']]],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"外校老师管理",
|
||||
name: '外校老师管理',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
success: handleSuccess,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
@ -157,8 +171,8 @@
|
|||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
|
@ -168,20 +182,17 @@
|
|||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
Loading…
Reference in New Issue