From 7ecfbb9c15fe33c480f7a46fd905f1d1de6ad718 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 15 Apr 2024 20:35:37 +0800 Subject: [PATCH] refactor: eslint src --fix --- src/apis/common/captcha.ts | 2 +- src/apis/common/common.ts | 4 +- src/apis/index.ts | 1 - src/apis/monitor/type.ts | 2 +- src/apis/system/type.ts | 2 +- src/components/GiCell/GiCellTag.vue | 34 ++--- src/components/GiFooter/index.vue | 6 +- src/components/GiIconSelector/index.vue | 2 +- src/components/JsonPretty/index.vue | 12 +- src/components/TextCopy/index.vue | 14 +- src/hooks/modules/useDownload.ts | 11 +- src/layout/components/Logo.vue | 8 +- src/layout/components/Menu/index.vue | 2 +- src/router/permission.ts | 6 +- src/stores/modules/app.ts | 16 +-- src/types/global.d.ts | 1 - src/utils/http.ts | 4 +- src/utils/index.ts | 26 ++-- src/views/home/components/Sponsor.vue | 12 +- src/views/login/components/LoginBg/index.vue | 3 +- src/views/login/index.vue | 9 +- src/views/monitor/log/LoginLog.vue | 4 +- .../monitor/log/OperationLogDetailDrawer.vue | 12 +- src/views/monitor/log/index.vue | 2 +- src/views/setting/notice/index.vue | 4 +- src/views/setting/profile/index.vue | 1 - src/views/setting/security/index.vue | 4 +- .../system/config/components/BasicSetting.vue | 132 +++++++++--------- src/views/system/dept/AddDeptModal.vue | 2 +- src/views/system/dept/index.vue | 2 +- src/views/system/menu/AddMenuModal.vue | 8 +- src/views/system/role/RoleDetailDrawer.vue | 24 ++-- src/views/system/role/index.vue | 1 - src/views/system/storage/AddStorageModal.vue | 2 +- src/views/system/user/UserAddModal.vue | 10 +- src/views/system/user/UserDetailDrawer.vue | 7 +- src/views/system/user/UserResetPwdModal.vue | 4 +- src/views/system/user/index.vue | 18 ++- 38 files changed, 187 insertions(+), 227 deletions(-) diff --git a/src/apis/common/captcha.ts b/src/apis/common/captcha.ts index 25a1542..3dfbe8a 100644 --- a/src/apis/common/captcha.ts +++ b/src/apis/common/captcha.ts @@ -6,4 +6,4 @@ const BASE_URL = '/captcha' /** @desc 获取图片验证码 */ export function getImageCaptcha() { return http.get(`${BASE_URL}/img`) -} \ No newline at end of file +} diff --git a/src/apis/common/common.ts b/src/apis/common/common.ts index fc5110d..ebc9172 100644 --- a/src/apis/common/common.ts +++ b/src/apis/common/common.ts @@ -1,7 +1,7 @@ import http from '@/utils/http' import type { LabelValueState } from '@/types/global' import type { TreeNodeData } from '@arco-design/web-vue' -import type {OptionQuery} from '@/apis' +import type { OptionQuery } from '@/apis' const BASE_URL = '/common' @@ -33,4 +33,4 @@ export function listOption(params: OptionQuery) { /** @desc 上传文件 */ export function uploadFile(data: FormData) { return http.post(`${BASE_URL}/file`, data) -} \ No newline at end of file +} diff --git a/src/apis/index.ts b/src/apis/index.ts index a3a8862..bcb56ce 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -9,4 +9,3 @@ export * from './auth/type' export * from './common/type' export * from './monitor/type' export * from './system/type' - diff --git a/src/apis/monitor/type.ts b/src/apis/monitor/type.ts index eff5cfa..a4194a5 100644 --- a/src/apis/monitor/type.ts +++ b/src/apis/monitor/type.ts @@ -43,7 +43,7 @@ export interface LogDetailResp extends LogResp { responseHeaders: string responseBody: string } -export interface LogQuery{ +export interface LogQuery { description?: string module?: string ip?: string diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 8d0780a..8a2d691 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -221,4 +221,4 @@ export interface BasicConfigRecordResp { site_copyright?: string site_logo?: string site_favicon?: string -} \ No newline at end of file +} diff --git a/src/components/GiCell/GiCellTag.vue b/src/components/GiCell/GiCellTag.vue index 36b62ef..2059b02 100644 --- a/src/components/GiCell/GiCellTag.vue +++ b/src/components/GiCell/GiCellTag.vue @@ -1,21 +1,11 @@ @@ -27,19 +17,17 @@ defineOptions({ name: 'GiCellTag' }) const props = defineProps({ dict: { type: Array, - required: true, + required: true }, value: { type: [Number, String], - required: true, - }, -}); + required: true + } +}) const dictItem = computed(() => - props.dict.find( - (d) => d.value === String(props.value) || d.value === Number(props.value), - ), -); + props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value)) +) diff --git a/src/components/GiFooter/index.vue b/src/components/GiFooter/index.vue index 5b574c4..e61fa7a 100644 --- a/src/components/GiFooter/index.vue +++ b/src/components/GiFooter/index.vue @@ -1,12 +1,12 @@ \ No newline at end of file + diff --git a/src/components/TextCopy/index.vue b/src/components/TextCopy/index.vue index c61d9a1..727705d 100644 --- a/src/components/TextCopy/index.vue +++ b/src/components/TextCopy/index.vue @@ -1,15 +1,15 @@ \ No newline at end of file + diff --git a/src/hooks/modules/useDownload.ts b/src/hooks/modules/useDownload.ts index ee26467..cfd44d2 100644 --- a/src/hooks/modules/useDownload.ts +++ b/src/hooks/modules/useDownload.ts @@ -10,16 +10,11 @@ import { Message, Notification } from '@arco-design/web-vue' interface NavigatorWithMsSaveOrOpenBlob extends Navigator { msSaveOrOpenBlob(blob: Blob, fileName: string): void } -export const useDownload = async ( - api: () => Promise, - isNotify = true, - tempName: string = '', - fileType = '.xlsx' -) => { +export const useDownload = async (api: () => Promise, isNotify = true, tempName = '', fileType = '.xlsx') => { try { const res = await api() if (res.headers['content-disposition']) { - tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]); + tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]) } else { tempName = tempName ? tempName : new Date().getTime() + fileType } @@ -36,7 +31,7 @@ export const useDownload = async ( const blob = new Blob([res.data]) // 兼容 edge 不支持 createObjectURL 方法 if ('msSaveOrOpenBlob' in (navigator as unknown as NavigatorWithMsSaveOrOpenBlob)) { - ; (window.navigator as unknown as NavigatorWithMsSaveOrOpenBlob).msSaveOrOpenBlob(blob, tempName + fileType) + ;(window.navigator as unknown as NavigatorWithMsSaveOrOpenBlob).msSaveOrOpenBlob(blob, tempName + fileType) } const blobUrl = window.URL.createObjectURL(blob) const exportFile = document.createElement('a') diff --git a/src/layout/components/Logo.vue b/src/layout/components/Logo.vue index 787e9f2..58b6cf9 100644 --- a/src/layout/components/Logo.vue +++ b/src/layout/components/Logo.vue @@ -1,14 +1,14 @@ diff --git a/src/views/login/components/LoginBg/index.vue b/src/views/login/components/LoginBg/index.vue index 57b4084..195447f 100644 --- a/src/views/login/components/LoginBg/index.vue +++ b/src/views/login/components/LoginBg/index.vue @@ -7,8 +7,7 @@ - + diff --git a/src/views/system/storage/AddStorageModal.vue b/src/views/system/storage/AddStorageModal.vue index 0ff961a..ccb2315 100644 --- a/src/views/system/storage/AddStorageModal.vue +++ b/src/views/system/storage/AddStorageModal.vue @@ -85,7 +85,7 @@