diff --git a/src/api/org/department.ts b/src/api/org/department.ts index 45cba7e..f8cea02 100644 --- a/src/api/org/department.ts +++ b/src/api/org/department.ts @@ -5,6 +5,10 @@ export function deptLists(params?: any) { return request.get({ url: '/system/dept/list', params }) } +export function deptAll() { + return request.get({ url: '/system/dept/all/tree' }) +} + // 添加部门 export function deptAdd(params: any) { return request.post({ url: '/system/dept/add', params }) diff --git a/src/api/perms/admin.ts b/src/api/perms/admin.ts index 53bdaf3..549e911 100644 --- a/src/api/perms/admin.ts +++ b/src/api/perms/admin.ts @@ -58,6 +58,10 @@ export function listByCurrentEmpNo(query) { return request.get({ url: '/system/admin/listByCurrentEmpNo', query}) } +export function listByCoHanding() { + return request.get({ url: '/system/admin/listByCoHanding'}) +} + // 重置密码 export function resetPassword(params: any) { return request.post({ url: '/system/resetPassword', params }) diff --git a/src/components/FileList.vue b/src/components/FileList.vue index d021635..b9033c5 100644 --- a/src/components/FileList.vue +++ b/src/components/FileList.vue @@ -52,7 +52,10 @@ {{ item.orgiinFilename }} -
+
+ +
- {{ fileList.indexOf(activeFile) + 1 }} / {{ fileList.length }} + {{ fileList.indexOf(activeFile) + 1 }} / + {{ fileList.length }}
+ +
- + + @@ -157,25 +194,38 @@ const preview = ref(false); const activeFile = ref({}); const fileRrror = ref(false); const imgRef = ref(); -let scale = 1; +let rotate = 0; + +function prev() { + const index = fileList.value.indexOf(activeFile.value); + if (index === 0) { + filePreview(fileList.value[fileList.value.length - 1]) + } else { + filePreview(fileList.value[index - 1]) + } +} +function next() { + const index = fileList.value.indexOf(activeFile.value); + if (index === fileList.value.length - 1) { + filePreview(fileList.value[0]) + } else { + filePreview(fileList.value[index + 1]) + } +} function filePreview(file) { preview.value = true; fileRrror.value = false; activeFile.value = file; - nextTick(() => { - if (imgRef.value) { - scale = 1; - imgRef.value.addEventListener("wheel", function (event) { - if (event.deltaY > 0) { - scale += 0.1; - } - if (event.deltaY < 0 && scale > 0.1) { - scale -= 0.1; - } - imgRef.value.style.transform = `scale(${scale})`; - }); - } - }); + rotate = 0 + imgRef.value.style.transform = `rotate(0deg)`; +} + +function rotateLeft() { + imgRef.value.style.transform = `rotate(${(rotate += 90)}deg)`; +} + +function rotateRight() { + imgRef.value.style.transform = `rotate(${(rotate -= 90)}deg)`; } function getIconName(filetype) { @@ -213,11 +263,13 @@ function download() { } function getDocFilepath() { - if (activeFile.value.type === 'application/msword' && activeFile.value.docxFilepath) { - return `${VITE_API_URL}/api/file/stream/${activeFile.value.docxFilepath}` + if ( + activeFile.value.type === "application/msword" && + activeFile.value.docxFilepath + ) { + return `${VITE_API_URL}/api/file/stream/${activeFile.value.docxFilepath}`; } - return `${VITE_API_URL}/api/file/stream/${activeFile.value.filepath}` - + return `${VITE_API_URL}/api/file/stream/${activeFile.value.filepath}`; }