diff --git a/src/api/v1/system.ts b/src/api/v1/system.ts index f6ae9c3..6348f1c 100644 --- a/src/api/v1/system.ts +++ b/src/api/v1/system.ts @@ -6,11 +6,6 @@ export const getRouterAsync = () => { return http.request>('get', 'router/getRouterAsync'); }; -/** 图标管理-获取系统图标 */ -export const getMenuIconList = (data: any) => { - return http.request>('get', `menuIcon/getMenuIconList/${data.page}/${data.limit}`, { data }); -}; - /** 菜单管理-列表 */ export const getMenusList = (data?: any) => { return http.request>('get', `router/getMenusList`, { params: data }); @@ -32,67 +27,6 @@ export const deletedMenuByIds = (data?: any) => { }; /** 上传文件 */ -export const fetchUploadFIle = (data: any) => { +export const fetchUploadFile = (data: any) => { return http.post>('/files/upload', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; - -// ------------未确认------------ -/** 获取系统管理-用户管理列表 */ -export const getUserList = (data?: object) => { - return http.request>('post', '/user', { data }); -}; - -/** 系统管理-用户管理-获取所有角色列表 */ -export const getAllRoleList = () => { - return http.request('get', '/list-all-role'); -}; - -/** 系统管理-用户管理-根据userId,获取对应角色id列表(userId:用户id) */ -export const getRoleIds = (data?: object) => { - return http.request('post', '/list-role-ids', { data }); -}; - -/** 获取系统管理-角色管理列表 */ -export const getRoleList = (data?: object) => { - return http.request('post', '/role', { data }); -}; - -/** 获取系统管理-部门管理列表 */ -export const getDeptList = (data?: object) => { - return http.request('post', '/dept', { data }); -}; - -/** 获取系统监控-在线用户列表 */ -export const getOnlineLogsList = (data?: object) => { - return http.request('post', '/online-logs', { data }); -}; - -/** 获取系统监控-登录日志列表 */ -export const getLoginLogsList = (data?: object) => { - return http.request('post', '/login-logs', { data }); -}; - -/** 获取系统监控-操作日志列表 */ -export const getOperationLogsList = (data?: object) => { - return http.request('post', '/operation-logs', { data }); -}; - -/** 获取系统监控-系统日志列表 */ -export const getSystemLogsList = (data?: object) => { - return http.request('post', '/system-logs', { data }); -}; - -/** 获取系统监控-系统日志-根据 id 查日志详情 */ -export const getSystemLogsDetail = (data?: object) => { - return http.request('post', '/system-logs-detail', { data }); -}; - -/** 获取角色管理-权限-菜单权限 */ -export const getRoleMenu = (data?: object) => { - return http.request('post', '/role-menu', { data }); -}; - -/** 获取角色管理-权限-菜单权限-根据角色 id 查对应菜单 */ -export const getRoleMenuIds = (data?: object) => { - return http.request('post', '/role-menu-ids', { data }); -}; diff --git a/src/api/v1/user.ts b/src/api/v1/user.ts index 87c84fa..08ea2cf 100644 --- a/src/api/v1/user.ts +++ b/src/api/v1/user.ts @@ -71,3 +71,11 @@ export const fetchGetUserinfoById = (data?: object) => { export const fetchUpdateUserPasswordByAdmin = (data: any) => { return http.request>('put', 'user/updateUserPasswordByAdmin', { data }); }; + +/** + * 管理员修改管理员用户头像 + * @param data + */ +export const fetchUploadAvatarByAdmin = (data: any) => { + return http.request>('put', 'user/uploadAvatarByAdmin', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); +}; diff --git a/src/components/ReCropper/src/index.tsx b/src/components/ReCropper/src/index.tsx index fdf9028..0cbd75f 100644 --- a/src/components/ReCropper/src/index.tsx +++ b/src/components/ReCropper/src/index.tsx @@ -2,12 +2,12 @@ import './circled.css'; import Cropper from 'cropperjs'; import { ElUpload } from 'element-plus'; import type { CSSProperties } from 'vue'; +import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, unref } from 'vue'; import { useEventListener } from '@vueuse/core'; import { longpress } from '@/directives/longpress'; -import { useTippy, directive as tippy } from 'vue-tippy'; -import { type PropType, ref, unref, computed, onMounted, onUnmounted, defineComponent } from 'vue'; -import { delay, debounce, isArray, downloadByBase64, useResizeObserver } from '@pureadmin/utils'; -import { Reload, Upload, ArrowH, ArrowV, ArrowUp, ArrowDown, ArrowLeft, ChangeIcon, ArrowRight, RotateLeft, SearchPlus, RotateRight, SearchMinus, DownloadIcon } from './svg'; +import { directive as tippy, useTippy } from 'vue-tippy'; +import { debounce, delay, downloadByBase64, isArray, useResizeObserver } from '@pureadmin/utils'; +import { ArrowDown, ArrowH, ArrowLeft, ArrowRight, ArrowUp, ArrowV, ChangeIcon, DownloadIcon, Reload, RotateLeft, RotateRight, SearchMinus, SearchPlus, Upload } from './svg'; type Options = Cropper.Options; @@ -206,57 +206,20 @@ export default defineComponent({ return () => (
- + - downloadByBase64(imgBase64.value, 'cropping.png')} - /> + downloadByBase64(imgBase64.value, 'cropping.png')} /> { inCircled.value = !inCircled.value; realTimeCroppered(); }} /> - handCropper('reset')} - /> - handCropper('move', [0, -10]), '0:100']} - /> - handCropper('move', [0, 10]), '0:100']} - /> + handCropper('reset')} /> + handCropper('move', [0, -10]), '0:100']} /> + handCropper('move', [0, 10]), '0:100']} /> handCropper('move', [-10, 0]), '0:100']} /> - handCropper('move', [10, 0]), '0:100']} - /> - handCropper('scaleX', -1)} - /> - handCropper('scaleY', -1)} - /> - handCropper('rotate', -45)} - /> - handCropper('rotate', 45)} - /> - handCropper('zoom', 0.1), '0:100']} - /> - handCropper('zoom', -0.1), '0:100']} - /> + handCropper('move', [10, 0]), '0:100']} /> + handCropper('scaleX', -1)} /> + handCropper('scaleY', -1)} /> + handCropper('rotate', -45)} /> + handCropper('rotate', 45)} /> + handCropper('zoom', 0.1), '0:100']} /> + handCropper('zoom', -0.1), '0:100']} />
); }, diff --git a/src/components/Upload/UploadDialogImage.vue b/src/components/Upload/UploadDialogImage.vue index eb6c702..d5514c7 100644 --- a/src/components/Upload/UploadDialogImage.vue +++ b/src/components/Upload/UploadDialogImage.vue @@ -17,7 +17,7 @@ import { Plus } from '@element-plus/icons-vue'; import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus'; import { onMounted, ref } from 'vue'; import { SystemEnum } from '@/enums/upload'; -import { fetchUploadFIle } from '@/api/v1/system'; +import { fetchUploadFile } from '@/api/v1/system'; const props = defineProps({ imageUrl: String, @@ -38,7 +38,7 @@ const onUpload = async (options: UploadRequestOptions) => { const data = { file, type }; // 上传文件并返回文件地址 - const result: any = await fetchUploadFIle(data); + const result: any = await fetchUploadFile(data); imageSrc.value = result.data.url; emits('uploadCallback', result); }; @@ -85,16 +85,16 @@ onMounted(() => { }); - diff --git a/src/views/system/adminUser/admin-user-dialog.vue b/src/views/system/adminUser/admin-user-dialog.vue index d305e1f..a4cbd01 100644 --- a/src/views/system/adminUser/admin-user-dialog.vue +++ b/src/views/system/adminUser/admin-user-dialog.vue @@ -6,7 +6,6 @@ import { FormProps } from '@/views/system/adminUser/utils/types'; import { $t } from '@/plugins/i18n'; import ReCol from '@/components/MyCol'; import { sexConstant } from '@/enums/baseConstant'; -import UploadDialogImage from '@/components/Upload/UploadDialogImage.vue'; const props = withDefaults(defineProps(), { formInline: () => ({ @@ -93,13 +92,6 @@ defineExpose({ formRef }); - - - - - - - diff --git a/src/views/system/adminUser/index.vue b/src/views/system/adminUser/index.vue index 3691ce5..b739186 100644 --- a/src/views/system/adminUser/index.vue +++ b/src/views/system/adminUser/index.vue @@ -106,7 +106,7 @@ onMounted(() => {