diff --git a/kinit-admin/src/api/vadmin/auth/menu.ts b/kinit-admin/src/api/vadmin/auth/menu.ts index 48e784c..2c7da4a 100644 --- a/kinit-admin/src/api/vadmin/auth/menu.ts +++ b/kinit-admin/src/api/vadmin/auth/menu.ts @@ -1,13 +1,26 @@ import request from '@/config/axios' +import { List } from 'echarts' export const getMenuListApi = (params: any): Promise => { return request.get({ url: '/vadmin/auth/menus/', params }) } -export const delMenuListApi = (params: any): Promise => { - return request.delete({ url: '/vadmin/auth/menus/', params }) +export const delMenuListApi = (data: List): Promise => { + return request.delete({ url: '/vadmin/auth/menus/', data }) +} + +export const addMenuListApi = (data: any): Promise => { + return request.post({ url: '/vadmin/auth/menus/', data }) +} + +export const putMenuListApi = (data: any): Promise => { + return request.put({ url: `/vadmin/auth/menus/${data.id}/`, data }) } export const getMenuTreeOptionsApi = (): Promise => { return request.get({ url: '/vadmin/auth/menus/tree/options/' }) } + +export const getMenuRoleTreeOptionsApi = (): Promise => { + return request.get({ url: '/vadmin/auth/menus/role/tree/options/' }) +} diff --git a/kinit-admin/src/api/vadmin/auth/role.ts b/kinit-admin/src/api/vadmin/auth/role.ts index a9020a6..0ff7874 100644 --- a/kinit-admin/src/api/vadmin/auth/role.ts +++ b/kinit-admin/src/api/vadmin/auth/role.ts @@ -3,3 +3,23 @@ import request from '@/config/axios' export const getRoleListApi = (params: any): Promise => { return request.get({ url: '/vadmin/auth/roles/', params }) } + +export const addRoleListApi = (data: any): Promise => { + return request.post({ url: '/vadmin/auth/roles/', data }) +} + +export const delRoleListApi = (data: any): Promise => { + return request.delete({ url: '/vadmin/auth/roles/', data }) +} + +export const putRoleListApi = (data: any): Promise => { + return request.put({ url: `/vadmin/auth/roles/${data.id}/`, data }) +} + +export const getRoleApi = (dataId: number): Promise => { + return request.get({ url: `/vadmin/auth/roles/${dataId}/` }) +} + +export const getRoleOptionsApi = (): Promise => { + return request.get({ url: `/vadmin/auth/roles/options/` }) +} diff --git a/kinit-admin/src/api/vadmin/auth/user.ts b/kinit-admin/src/api/vadmin/auth/user.ts new file mode 100644 index 0000000..ddfb1fe --- /dev/null +++ b/kinit-admin/src/api/vadmin/auth/user.ts @@ -0,0 +1,21 @@ +import request from '@/config/axios' + +export const getUserListApi = (params: any): Promise => { + return request.get({ url: '/vadmin/auth/users/', params }) +} + +export const addUserListApi = (data: any): Promise => { + return request.post({ url: '/vadmin/auth/users/', data }) +} + +export const delUserListApi = (data: any): Promise => { + return request.delete({ url: '/vadmin/auth/users/', data }) +} + +export const putUserListApi = (data: any): Promise => { + return request.put({ url: `/vadmin/auth/users/${data.id}/`, data }) +} + +export const getUserApi = (dataId: number): Promise => { + return request.get({ url: `/vadmin/auth/users/${dataId}/` }) +} diff --git a/kinit-admin/src/components/Form/src/Form.vue b/kinit-admin/src/components/Form/src/Form.vue index a7d64cc..a658340 100644 --- a/kinit-admin/src/components/Form/src/Form.vue +++ b/kinit-admin/src/components/Form/src/Form.vue @@ -1,5 +1,5 @@ + + diff --git a/kinit-admin/src/views/vadmin/auth/role/components/role.data.ts b/kinit-admin/src/views/vadmin/auth/role/components/role.data.ts new file mode 100644 index 0000000..ff2ab6d --- /dev/null +++ b/kinit-admin/src/views/vadmin/auth/role/components/role.data.ts @@ -0,0 +1,127 @@ +import { reactive } from 'vue' + +export const columns = reactive([ + { + field: 'id', + label: '角色编号' + }, + { + field: 'name', + label: '角色名称' + }, + { + field: 'role_key', + label: '权限字符' + }, + { + field: 'order', + label: '显示顺序' + }, + { + field: 'disabled', + label: '角色状态' + }, + { + field: 'is_admin', + label: '最高权限' + }, + { + field: 'create_datetime', + label: '创建时间' + }, + { + field: 'action', + width: '260px', + label: '操作' + } +]) + +export const schema = reactive([ + { + field: 'name', + label: '角色名称', + colProps: { + span: 24 + }, + component: 'Input' + }, + { + field: 'role_key', + label: '权限字符', + colProps: { + span: 24 + }, + component: 'Input' + }, + { + field: 'order', + label: '显示排序', + colProps: { + span: 24 + }, + component: 'InputNumber' + }, + { + field: 'disabled', + label: '角色状态', + colProps: { + span: 24 + }, + component: 'Radio', + componentProps: { + style: { + width: '100%' + }, + options: [ + { + label: '正常', + value: false + }, + { + label: '禁用', + value: true + } + ] + }, + value: false + }, + { + field: 'is_admin', + label: '最高权限', + colProps: { + span: 24 + }, + component: 'Radio', + componentProps: { + style: { + width: '100%' + }, + options: [ + { + label: '使用', + value: true + }, + { + label: '不使用', + value: false + } + ] + }, + value: false + }, + { + field: 'desc', + label: '描述', + colProps: { + span: 24 + }, + component: 'Input' + }, + { + field: 'menu_ids', + label: '菜单权限', + colProps: { + span: 24 + } + } +]) diff --git a/kinit-admin/src/views/vadmin/auth/role/index.vue b/kinit-admin/src/views/vadmin/auth/role/index.vue index 8da848b..88f693b 100644 --- a/kinit-admin/src/views/vadmin/auth/role/index.vue +++ b/kinit-admin/src/views/vadmin/auth/role/index.vue @@ -1,59 +1,26 @@ + + diff --git a/kinit-admin/src/views/vadmin/auth/user/components/user.data.ts b/kinit-admin/src/views/vadmin/auth/user/components/user.data.ts new file mode 100644 index 0000000..a444548 --- /dev/null +++ b/kinit-admin/src/views/vadmin/auth/user/components/user.data.ts @@ -0,0 +1,170 @@ +import { reactive } from 'vue' + +export const columns = reactive([ + { + field: 'id', + label: '用户编号' + }, + { + field: 'name', + label: '姓名' + }, + { + field: 'nickname', + label: '昵称' + }, + { + field: 'telephone', + label: '手机号' + }, + { + field: 'gender', + label: '性别' + }, + { + field: 'is_active', + label: '是否可用' + }, + { + field: 'last_login', + label: '最近一次登录时间' + }, + { + field: 'create_datetime', + label: '创建时间' + }, + { + field: 'action', + width: '260px', + label: '操作' + } +]) + +export const schema = reactive([ + { + field: 'name', + label: '用户名称', + colProps: { + span: 12 + }, + component: 'Input' + }, + { + field: 'telephone', + label: '手机号码', + colProps: { + span: 12 + }, + component: 'Input' + }, + { + field: 'nickname', + label: '用户昵称', + colProps: { + span: 12 + }, + component: 'Input' + }, + { + field: 'password', + label: '用户密码', + colProps: { + span: 12 + }, + component: 'InputPassword', + componentProps: { + style: { + width: '100%' + } + } + }, + { + field: 'gender', + label: '性别', + colProps: { + span: 12 + }, + component: 'Radio', + componentProps: { + style: { + width: '100%' + }, + options: [ + { + label: '男', + value: '0' + }, + { + label: '女', + value: '1' + } + ] + }, + value: '0' + }, + { + field: 'is_active', + label: '状态', + colProps: { + span: 12 + }, + component: 'Radio', + componentProps: { + style: { + width: '100%' + }, + options: [ + { + label: '正常', + value: true + }, + { + label: '停用', + value: false + } + ] + }, + value: true + }, + { + field: 'role_ids', + label: '角色', + colProps: { + span: 24 + }, + component: 'Select', + componentProps: { + style: { + width: '100%' + }, + // optionsAlias: { + // labelField: 'name', + // valueField: 'id' + // }, + options: [ + { + value: 'Option1', + label: 'Option1' + }, + { + value: 'Option2', + label: 'Option2', + disabled: true + }, + { + value: 'Option3', + label: 'Option3' + }, + { + value: 'Option4', + label: 'Option4' + }, + { + value: 'Option5', + label: 'Option5' + } + ] + }, + value: '' + } +]) diff --git a/kinit-admin/src/views/vadmin/auth/user/index.vue b/kinit-admin/src/views/vadmin/auth/user/index.vue index 68400a1..2692263 100644 --- a/kinit-admin/src/views/vadmin/auth/user/index.vue +++ b/kinit-admin/src/views/vadmin/auth/user/index.vue @@ -1,50 +1,94 @@