diff --git a/src/views/cees/adminInfo/CeesAdminInfo.api.ts b/src/views/cees/adminInfo/CeesAdminInfo.api.ts new file mode 100644 index 0000000..5ed1d12 --- /dev/null +++ b/src/views/cees/adminInfo/CeesAdminInfo.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/cees/ceesAdminInfo/list', + save='/cees/ceesAdminInfo/add', + edit='/cees/ceesAdminInfo/edit', + deleteOne = '/cees/ceesAdminInfo/delete', + deleteBatch = '/cees/ceesAdminInfo/deleteBatch', + importExcel = '/cees/ceesAdminInfo/importExcel', + exportXls = '/cees/ceesAdminInfo/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}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +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 + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/src/views/cees/adminInfo/CeesAdminInfo.data.ts b/src/views/cees/adminInfo/CeesAdminInfo.data.ts new file mode 100644 index 0000000..f508593 --- /dev/null +++ b/src/views/cees/adminInfo/CeesAdminInfo.data.ts @@ -0,0 +1,171 @@ +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: '用户名', + align:"center", + dataIndex: 'userName' + }, + { + title: '工号', + align:"center", + dataIndex: 'workNumber' + }, + { + title: '往年组别', + align:"center", + dataIndex: 'beforeGroupLevel' + }, + { + title: '组别', + align:"center", + dataIndex: 'groupLevel' + }, + { + title: '往年职务', + align:"center", + dataIndex: 'beforeDuty' + }, + { + title: '职务', + align:"center", + dataIndex: 'duty' + }, + { + title: '部门', + align:"center", + dataIndex: 'department' + }, + { + title: '岗位', + align:"center", + dataIndex: 'job' + }, + + // { + // title: '用户id', + // align:"center", + // dataIndex: 'userId' + // }, + // { + // title: '用户专业id', + // align:"center", + // dataIndex: 'userMajorId' + // }, + // { + // title: '专业id,0表示未选择', + // align:"center", + // dataIndex: 'majorId' + // }, + // { + // title: '组别', + // align:"center", + // dataIndex: 'groupId' + // }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: '用户名', + field: 'userName', + component: 'Input', + //colProps: {span: 6}, + }, +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户名', + field: 'userName', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入用户名!' }]; + }, + }, + { + label: '工号', + field: 'workNumber', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入工号!' }]; + }, + }, + { + label: '往年组别', + field: 'beforeGroupLevel', + component: 'Input', + }, + { + label: '组别', + field: 'groupLevel', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入组别!' }]; + }, + }, + { + label: '往年职务', + field: 'beforeDuty', + component: 'Input', + }, + { + label: '职务', + field: 'duty', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入职务!' }]; + }, + }, + { + label: '部门', + field: 'department', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入部门!' }]; + }, + }, + { + label: '岗位', + field: 'job', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '请输入岗位!' }]; + }, + }, + + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + workNumber: {title: '工号',order: 0,view: 'text', type: 'string',}, + userName: {title: '姓名',order: 1,view: 'text', type: 'string',}, + userId: {title: '用户id',order: 2,view: 'text', type: 'string',}, + userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',}, + majorId: {title: '专业id,0表示未选择',order: 4,view: 'number', type: 'number',}, + groupId: {title: '组别',order: 5,view: 'text', type: 'string',}, + beforeGroupLevel: {title: '组级别',order: 6,view: 'text', type: 'string',}, + groupLevel: {title: '组级别',order: 7,view: 'text', type: 'string',}, + beforeDuty: {title: '之前的职务',order: 8,view: 'text', type: 'string',}, + duty: {title: '职务',order: 9,view: 'text', type: 'string',}, + department: {title: '部门',order: 10,view: 'text', type: 'string',}, + job: {title: '岗位',order: 11,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/src/views/cees/adminInfo/CeesAdminInfoList.vue b/src/views/cees/adminInfo/CeesAdminInfoList.vue new file mode 100644 index 0000000..89ac0ea --- /dev/null +++ b/src/views/cees/adminInfo/CeesAdminInfoList.vue @@ -0,0 +1,186 @@ + + + + + \ No newline at end of file diff --git a/src/views/cees/adminInfo/components/CeesAdminInfoForm.vue b/src/views/cees/adminInfo/components/CeesAdminInfoForm.vue new file mode 100644 index 0000000..4573fb6 --- /dev/null +++ b/src/views/cees/adminInfo/components/CeesAdminInfoForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/src/views/cees/adminInfo/components/CeesAdminInfoModal.vue b/src/views/cees/adminInfo/components/CeesAdminInfoModal.vue new file mode 100644 index 0000000..36d7722 --- /dev/null +++ b/src/views/cees/adminInfo/components/CeesAdminInfoModal.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/src/views/cees/group/CeesGroup.data.ts b/src/views/cees/group/CeesGroup.data.ts index 63ca4d4..4e126fe 100644 --- a/src/views/cees/group/CeesGroup.data.ts +++ b/src/views/cees/group/CeesGroup.data.ts @@ -2,9 +2,13 @@ import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; import { rules} from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; +import { usePermission } from '/@/hooks/web/usePermission'; + //import { getRowUser } from '/@/views/cees/group/CeesGroup.api'; //列表数据 +const { hasPermission } = usePermission(); + export const columns: BasicColumn[] = [ { title: '组名', @@ -42,6 +46,12 @@ export const columns: BasicColumn[] = [ ]; //查询数据 export const searchFormSchema: FormSchema[] = [ + { + label: '组名', + field: 'name', + component: 'Input', + //colProps: {span: 6}, + }, ]; //表单数据 export const formSchema: FormSchema[] = [ @@ -72,6 +82,9 @@ export const formSchema: FormSchema[] = [ { required: true, message: '请选择学科!'}, ]; }, + show: ({ values }) => { + return hasPermission('majorId:edit'); + } }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/src/views/cees/user/CeesUserList.vue b/src/views/cees/user/CeesUserList.vue index 33ab46c..320c29a 100644 --- a/src/views/cees/user/CeesUserList.vue +++ b/src/views/cees/user/CeesUserList.vue @@ -16,15 +16,15 @@ - 批量操作 + 批量操作 - 生成账号 + 生成账号 +