diff --git a/src/views/cet/cet-student/Cet4Major.api.ts b/src/views/cet/cet-student/Cet4Major.api.ts new file mode 100644 index 0000000..aff90b2 --- /dev/null +++ b/src/views/cet/cet-student/Cet4Major.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/com/cet4Major/list', + save='/com/cet4Major/add', + edit='/com/cet4Major/edit', + deleteOne = '/com/cet4Major/delete', + deleteBatch = '/com/cet4Major/deleteBatch', + importExcel = '/com/cet4Major/importExcel', + exportXls = '/com/cet4Major/exportXls', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +} diff --git a/src/views/cet/cet-student/Cet4Major.data.ts b/src/views/cet/cet-student/Cet4Major.data.ts new file mode 100644 index 0000000..f2805ca --- /dev/null +++ b/src/views/cet/cet-student/Cet4Major.data.ts @@ -0,0 +1,103 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import { rules } from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '年级', + dataIndex: 'entrydate', + key: 'entrydate', + align: 'center', + }, + { + title: '学生人数', + dataIndex: 'studentNumber', + key: 'studentNumber', + align: 'center', + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = []; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: 'name', + field: 'name', + component: 'Input', + }, + { + label: 'college', + field: 'college', + component: 'Input', + }, + { + label: 'majorId', + field: 'majorId', + component: 'Input', + }, + { + label: 'majorname', + field: 'majorname', + component: 'Input', + }, + { + label: 'className', + field: 'className', + component: 'Input', + }, + { + label: 'educate', + field: 'educate', + component: 'Input', + }, + { + label: 'entrydate', + field: 'entrydate', + component: 'Input', + }, + { + label: 'campus', + field: 'campus', + component: 'Input', + }, + { + label: 'state', + field: 'state', + component: 'Input', + }, + { + label: 'level', + field: 'level', + component: 'Input', + }, + { + label: 'category', + field: 'category', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: { title: 'name', order: 0, view: 'text', type: 'string' }, + college: { title: 'college', order: 1, view: 'text', type: 'string' }, + majorId: { title: 'majorId', order: 2, view: 'text', type: 'string' }, + majorname: { title: 'majorname', order: 3, view: 'text', type: 'string' }, + className: { title: 'className', order: 4, view: 'text', type: 'string' }, + educate: { title: 'educate', order: 5, view: 'text', type: 'string' }, + entrydate: { title: 'entrydate', order: 6, view: 'text', type: 'string' }, + campus: { title: 'campus', order: 7, view: 'text', type: 'string' }, + state: { title: 'state', order: 8, view: 'text', type: 'string' }, + level: { title: 'level', order: 9, view: 'text', type: 'string' }, + category: { title: 'category', order: 10, view: 'text', type: 'string' }, +}; diff --git a/src/views/cet/cet-student/Cet4MajorList.vue b/src/views/cet/cet-student/Cet4MajorList.vue new file mode 100644 index 0000000..09314f8 --- /dev/null +++ b/src/views/cet/cet-student/Cet4MajorList.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/views/cet/cet-student/components/Cet4MajorForm.vue b/src/views/cet/cet-student/components/Cet4MajorForm.vue new file mode 100644 index 0000000..31f15f1 --- /dev/null +++ b/src/views/cet/cet-student/components/Cet4MajorForm.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/views/cet/cet-student/components/Cet4MajorModal.vue b/src/views/cet/cet-student/components/Cet4MajorModal.vue new file mode 100644 index 0000000..1abe807 --- /dev/null +++ b/src/views/cet/cet-student/components/Cet4MajorModal.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/src/views/cet/data-import/student-data-import.vue b/src/views/cet/data-import/student-data-import.vue deleted file mode 100644 index ebfecf7..0000000 --- a/src/views/cet/data-import/student-data-import.vue +++ /dev/null @@ -1,228 +0,0 @@ - - - - - \ No newline at end of file