From 9acc73a591289694ab59bca59de4cea2d3820f54 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 18 Oct 2023 15:38:56 +0800 Subject: [PATCH] fix: fix types --- .../src/collapse/CollapseContainer.vue | 8 +++---- src/components/CronTab/src/validator.ts | 1 + .../Form/src/components/FormItem.vue | 4 +++- src/components/Form/src/hooks/useForm.ts | 2 +- .../Form/src/hooks/useFormEvents.ts | 1 - src/components/Form/src/types/form.ts | 2 +- .../VFormDesign/components/RuleProps.vue | 6 ++--- .../src/components/VFormDesign/index.vue | 3 +-- .../FormDesign/src/hooks/useVFormMethods.ts | 1 - src/components/FormDesign/src/utils/index.ts | 2 +- src/components/Preview/src/Functional.vue | 5 ++++- .../Table/src/components/HeaderCell.vue | 20 ++++++++--------- .../Table/src/components/TableImg.vue | 2 +- .../src/components/editable/CellComponent.ts | 3 +-- src/components/Table/src/hooks/useTable.ts | 1 - src/components/Table/src/types/table.ts | 2 -- src/components/Tinymce/src/tinymce.ts | 1 - .../Transition/src/ExpandTransition.ts | 2 ++ src/components/Tree/src/BasicTree.vue | 20 ++++++++--------- src/components/Upload/src/helper.ts | 3 ++- src/components/Verifition/src/Verify.vue | 4 ++-- .../Verifition/src/Verify/VerifyPoints.vue | 2 +- .../Verifition/src/Verify/VerifySlide.vue | 2 +- src/components/Verifition/src/utils/ase.ts | 2 +- src/hooks/web/useContentHeight.ts | 2 +- src/hooks/web/useDesign.ts | 1 - src/hooks/web/usePage.ts | 1 - src/hooks/web/usePermission.ts | 1 - src/hooks/web/useTabs.ts | 1 - src/layouts/default/menu/index.vue | 22 +++++++++---------- src/layouts/default/setting/handler.ts | 1 + src/layouts/default/tabs/useMultipleTabs.ts | 2 +- src/router/guard/index.ts | 1 - src/router/helper/routeHelper.ts | 1 - src/router/types.ts | 2 -- src/store/modules/multipleTab.ts | 3 +-- src/store/modules/permission.ts | 3 ++- src/utils/auth/index.ts | 1 - src/utils/cache/storageCache.ts | 4 ---- src/utils/color.ts | 2 +- src/utils/domUtils.ts | 8 ++----- src/utils/file/base64Conver.ts | 1 + src/utils/http/axios/index.ts | 1 + src/utils/index.ts | 4 +--- src/utils/is.ts | 1 - src/views/base/profile/data.ts | 1 + src/views/bpm/oa/leave/detail.vue | 2 +- .../bpm/processInstance/create/index.vue | 2 +- .../infra/codegen/components/PreviewModal.vue | 4 ++-- src/views/pay/cashier/index.vue | 2 +- .../tenantPackage/TenantPackageModal.vue | 2 +- src/views/system/user/user.data.ts | 1 + 52 files changed, 81 insertions(+), 95 deletions(-) diff --git a/src/components/Container/src/collapse/CollapseContainer.vue b/src/components/Container/src/collapse/CollapseContainer.vue index 9178fec..bddc9e1 100644 --- a/src/components/Container/src/collapse/CollapseContainer.vue +++ b/src/components/Container/src/collapse/CollapseContainer.vue @@ -72,12 +72,12 @@ export default defineComponent({ {props.loading ? ( - + ) : ( -
- {slots.default?.()} -
+
+ {slots.default?.()} +
)}
diff --git a/src/components/CronTab/src/validator.ts b/src/components/CronTab/src/validator.ts index cf5bece..460c236 100644 --- a/src/components/CronTab/src/validator.ts +++ b/src/components/CronTab/src/validator.ts @@ -1,3 +1,4 @@ +/* eslint-disable prefer-promise-reject-errors */ import CronParser from 'cron-parser' import type { ValidatorRule } from 'ant-design-vue/lib/form/interface' diff --git a/src/components/Form/src/components/FormItem.vue b/src/components/Form/src/components/FormItem.vue index 2c02237..1b6ce67 100644 --- a/src/components/Form/src/components/FormItem.vue +++ b/src/components/Form/src/components/FormItem.vue @@ -286,7 +286,9 @@ export default defineComponent({ const renderLabel = subLabel ? ( - {label} {subLabel} + {label} + {' '} + {subLabel} ) : ( diff --git a/src/components/Form/src/hooks/useForm.ts b/src/components/Form/src/hooks/useForm.ts index 3ae3c04..4588839 100644 --- a/src/components/Form/src/hooks/useForm.ts +++ b/src/components/Form/src/hooks/useForm.ts @@ -101,7 +101,7 @@ export function useForm(props?: Props): UseFormReturnType { return form.submit() }, - validate: async (nameList?: NamePath[] | false): Promise => { + validate: async (nameList?: NamePath[] | false): Promise => { const form = await getForm() return form.validate(nameList) }, diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index 7e0c35d..6228bae 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/require-await */ import type { ComputedRef, Ref } from 'vue' import type { NamePath } from 'ant-design-vue/lib/form/interface' import { nextTick, toRaw, unref } from 'vue' diff --git a/src/components/Form/src/types/form.ts b/src/components/Form/src/types/form.ts index 98fdeca..e838862 100644 --- a/src/components/Form/src/types/form.ts +++ b/src/components/Form/src/types/form.ts @@ -35,7 +35,7 @@ export interface FormActionType { removeSchemaByField: (field: string | string[]) => Promise appendSchemaByField: (schema: FormSchema | FormSchema[], prefixField: string | undefined, first?: boolean | undefined) => Promise validateFields: (nameList?: NamePath[]) => Promise - validate: (nameList?: NamePath[] | false) => Promise + validate: (nameList?: NamePath[] | false) => Promise scrollToField: (name: NamePath, options?: ScrollOptions) => Promise } diff --git a/src/components/FormDesign/src/components/VFormDesign/components/RuleProps.vue b/src/components/FormDesign/src/components/VFormDesign/components/RuleProps.vue index c60cd5b..2516338 100644 --- a/src/components/FormDesign/src/components/VFormDesign/components/RuleProps.vue +++ b/src/components/FormDesign/src/components/VFormDesign/components/RuleProps.vue @@ -95,7 +95,7 @@ const patternDataSource = ref([ }, { value: - // eslint-disable-next-line max-len + '/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z](?:((\\d{5}[A-HJK])|([A-HJK][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])$/', text: '车牌号(新能源)', }, @@ -109,7 +109,7 @@ const patternDataSource = ref([ }, { value: - // eslint-disable-next-line max-len + '/^(([^<>()[\\]\\\\.,;:\\s@"]+(\\.[^<>()[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/', text: 'email(邮箱)', }, @@ -127,7 +127,7 @@ const patternDataSource = ref([ }, { value: - // eslint-disable-next-line max-len + '/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/', text: '中文汉字', }, diff --git a/src/components/FormDesign/src/components/VFormDesign/index.vue b/src/components/FormDesign/src/components/VFormDesign/index.vue index b53aac4..12eee4d 100644 --- a/src/components/FormDesign/src/components/VFormDesign/index.vue +++ b/src/components/FormDesign/src/components/VFormDesign/index.vue @@ -151,8 +151,7 @@ function copyFormItem(formItem: IVFormComponent) { * @param item {IVFormComponent} 当前点击的组件 * @param isCopy {boolean} 是否复制 */ -function handleCopy(item: IVFormComponent = formConfig.value.currentItem as IVFormComponent, - isCopy = true) { +function handleCopy(item: IVFormComponent = formConfig.value.currentItem as IVFormComponent, isCopy = true) { const key = formConfig.value.currentItem?.key /** * 遍历当表单项配置,如果是复制,则复制一份表单项,如果不是复制,则直接添加到表单项中 diff --git a/src/components/FormDesign/src/hooks/useVFormMethods.ts b/src/components/FormDesign/src/hooks/useVFormMethods.ts index c8a2c30..59b2d13 100644 --- a/src/components/FormDesign/src/hooks/useVFormMethods.ts +++ b/src/components/FormDesign/src/hooks/useVFormMethods.ts @@ -132,7 +132,6 @@ export function useVFormMethods( * 获取formData中的值 * @return {Promise>} */ - // eslint-disable-next-line @typescript-eslint/require-await const getData: IGetData = async () => { return cloneDeep(props.formModel) } diff --git a/src/components/FormDesign/src/utils/index.ts b/src/components/FormDesign/src/utils/index.ts index 0af46dc..a3696cc 100644 --- a/src/components/FormDesign/src/utils/index.ts +++ b/src/components/FormDesign/src/utils/index.ts @@ -199,7 +199,7 @@ export function strToReg(rules: IValidationRule[]) { */ export function runCode(code: any): T { try { - // eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func + // eslint-disable-next-line no-new-func return new Function(`return ${code}`)() } catch { diff --git a/src/components/Preview/src/Functional.vue b/src/components/Preview/src/Functional.vue index c6c1118..ed04911 100644 --- a/src/components/Preview/src/Functional.vue +++ b/src/components/Preview/src/Functional.vue @@ -337,7 +337,10 @@ export default defineComponent({ const { imageList } = props return (
- {currentIndex + 1} / {imageList.length} + {currentIndex + 1} + {' '} + / + {imageList.length}
) } diff --git a/src/components/Table/src/components/HeaderCell.vue b/src/components/Table/src/components/HeaderCell.vue index 343d7b1..ca18cfc 100644 --- a/src/components/Table/src/components/HeaderCell.vue +++ b/src/components/Table/src/components/HeaderCell.vue @@ -33,18 +33,18 @@ export default defineComponent({ return () => { return ( -
- {getIsEdit.value - ? ( +
+ {getIsEdit.value + ? ( {getTitle.value} - ) - : ( + ) + : ( {getTitle.value} - )} - {getHelpMessage.value && ( - - )} -
+ )} + {getHelpMessage.value && ( + + )} +
) } }, diff --git a/src/components/Table/src/components/TableImg.vue b/src/components/Table/src/components/TableImg.vue index 1a83bb1..513a4c6 100644 --- a/src/components/Table/src/components/TableImg.vue +++ b/src/components/Table/src/components/TableImg.vue @@ -20,7 +20,7 @@ const props = defineProps({ srcPrefix: propTypes.string.def(''), // fallback,加载失败显示图像占位符。 fallback: propTypes.string.def( - // eslint-disable-next-line max-len + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFj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KnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==', ), }) diff --git a/src/components/Table/src/components/editable/CellComponent.ts b/src/components/Table/src/components/editable/CellComponent.ts index 57e4edf..6430dd5 100644 --- a/src/components/Table/src/components/editable/CellComponent.ts +++ b/src/components/Table/src/components/editable/CellComponent.ts @@ -12,8 +12,7 @@ export interface ComponentProps { getPopupContainer?: Fn } -export function CellComponent({ component = 'Input', rule = true, ruleMessage, popoverOpen, getPopupContainer }: ComponentProps, - { attrs }) { +export function CellComponent({ component = 'Input', rule = true, ruleMessage, popoverOpen, getPopupContainer }: ComponentProps, { attrs }) { const Comp = componentMap.get(component) as typeof defineComponent const DefaultComp = h(Comp, attrs) diff --git a/src/components/Table/src/hooks/useTable.ts b/src/components/Table/src/hooks/useTable.ts index 7df75d0..07983fe 100644 --- a/src/components/Table/src/hooks/useTable.ts +++ b/src/components/Table/src/hooks/useTable.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/await-thenable */ import type { WatchStopHandle } from 'vue' import { onUnmounted, ref, toRaw, unref, watch } from 'vue' import type { BasicColumn, BasicTableProps, FetchParams, TableActionType } from '../types/table' diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index f8ea22a..81f6751 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -403,8 +403,6 @@ export interface BasicTableProps { export type CellFormat = string | ((text: string, record: Recordable, index: number) => string | number) | Map -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error export interface BasicColumn extends ColumnProps { children?: BasicColumn[] filters?: { diff --git a/src/components/Tinymce/src/tinymce.ts b/src/components/Tinymce/src/tinymce.ts index e5f2a3e..7b8887e 100644 --- a/src/components/Tinymce/src/tinymce.ts +++ b/src/components/Tinymce/src/tinymce.ts @@ -1,4 +1,3 @@ -/* eslint-disable max-len */ // Any plugins you want to setting has to be imported // Detail plugins list see https://www.tinymce.com/docs/plugins/ // Custom builds see https://www.tinymce.com/download/custom-builds/ diff --git a/src/components/Transition/src/ExpandTransition.ts b/src/components/Transition/src/ExpandTransition.ts index 662931e..d05e89d 100644 --- a/src/components/Transition/src/ExpandTransition.ts +++ b/src/components/Transition/src/ExpandTransition.ts @@ -38,6 +38,7 @@ export default function (expandedParentClass = '', x = false) { // el.style[sizeProperty] = '0'; + // eslint-disable-next-line no-void void el.offsetHeight // force reflow el.style.transition = initialStyle.transition @@ -63,6 +64,7 @@ export default function (expandedParentClass = '', x = false) { el.style.overflow = 'hidden' el.style[sizeProperty] = `${el[offsetProperty]}px` + // eslint-disable-next-line no-void void el.offsetHeight // force reflow requestAnimationFrame(() => (el.style[sizeProperty] = '0')) diff --git a/src/components/Tree/src/BasicTree.vue b/src/components/Tree/src/BasicTree.vue index 5f9ff95..3362c86 100644 --- a/src/components/Tree/src/BasicTree.vue +++ b/src/components/Tree/src/BasicTree.vue @@ -358,11 +358,11 @@ export default defineComponent({ const titleDom = isHighlight ? ( - - {title.slice(0, searchIdx)} - {searchText} - {title.slice(searchIdx + (searchText as string).length)} - + + {title.slice(0, searchIdx)} + {searchText} + {title.slice(searchIdx + (searchText as string).length)} + ) : ( title @@ -374,11 +374,11 @@ export default defineComponent({ getSlot(slots, 'title', item) ) : ( - <> - {icon && } - {titleDom} - {renderAction(item)} - + <> + {icon && } + {titleDom} + {renderAction(item)} + )} ) diff --git a/src/components/Upload/src/helper.ts b/src/components/Upload/src/helper.ts index 622cc70..05e73ea 100644 --- a/src/components/Upload/src/helper.ts +++ b/src/components/Upload/src/helper.ts @@ -23,5 +23,6 @@ export function getBase64WithFile(file: File) { reader.readAsDataURL(file) reader.onload = () => resolve({ result: reader.result as string, file }) reader.onerror = error => reject(error) - }) + }, + ) } diff --git a/src/components/Verifition/src/Verify.vue b/src/components/Verifition/src/Verify.vue index 954089a..88f1171 100644 --- a/src/components/Verifition/src/Verify.vue +++ b/src/components/Verifition/src/Verify.vue @@ -2,7 +2,7 @@ /** * Verify 验证码组件 * @description 分发验证码使用 - * */ + */ import { computed, ref, toRefs, watchEffect } from 'vue' import VerifySlide from './Verify/VerifySlide.vue' import VerifyPoints from './Verify/VerifyPoints.vue' @@ -70,7 +70,7 @@ export default { /** * refresh * @description 刷新 - * */ + */ const refresh = () => { if (instance.value.refresh) instance.value.refresh() diff --git a/src/components/Verifition/src/Verify/VerifyPoints.vue b/src/components/Verifition/src/Verify/VerifyPoints.vue index acfd6a8..83beec5 100644 --- a/src/components/Verifition/src/Verify/VerifyPoints.vue +++ b/src/components/Verifition/src/Verify/VerifyPoints.vue @@ -2,7 +2,7 @@ /** * VerifyPoints * @description 点选 - * */ + */ import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs } from 'vue' import { resetSize } from './../utils/util' import { aesEncrypt } from './../utils/ase' diff --git a/src/components/Verifition/src/Verify/VerifySlide.vue b/src/components/Verifition/src/Verify/VerifySlide.vue index 7430184..0dd4a16 100644 --- a/src/components/Verifition/src/Verify/VerifySlide.vue +++ b/src/components/Verifition/src/Verify/VerifySlide.vue @@ -2,7 +2,7 @@ /** * VerifySlide * @description 滑块 - * */ + */ import { computed, getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs, watch } from 'vue' import { aesEncrypt } from './../utils/ase' import { resetSize } from './../utils/util' diff --git a/src/components/Verifition/src/utils/ase.ts b/src/components/Verifition/src/utils/ase.ts index ce98fc4..c5c76a4 100644 --- a/src/components/Verifition/src/utils/ase.ts +++ b/src/components/Verifition/src/utils/ase.ts @@ -3,7 +3,7 @@ import CryptoJS from 'crypto-js' /** * @word 要加密的内容 * @keyWord String 服务器随机返回的关键字 - * */ + */ export function aesEncrypt(word, keyWord = 'XwKsGlMcdPMEhR1B') { const key = CryptoJS.enc.Utf8.parse(keyWord) const srcs = CryptoJS.enc.Utf8.parse(word) diff --git a/src/hooks/web/useContentHeight.ts b/src/hooks/web/useContentHeight.ts index 6213fae..495ddd1 100644 --- a/src/hooks/web/useContentHeight.ts +++ b/src/hooks/web/useContentHeight.ts @@ -23,8 +23,8 @@ type Upward = number | string | null | undefined * @param anchorRef 锚点组件 Ref * @param subtractHeightRefs 待减去高度的组件列表 Ref * @param substractSpaceRefs 待减去空闲空间(margins/paddings)的组件列表 Ref - * @param offsetHeightRef 计算偏移的响应式高度,计算高度时将直接减去此值 * @param upwardSpace 向上递归减去空闲空间的 层级 或 直到指定class为止 数值为2代表向上递归两次|数值为ant-layout表示向上递归直到碰见.ant-layout为止 + * @param offsetHeightRef 计算偏移的响应式高度,计算高度时将直接减去此值 * @returns 响应式高度 */ export function useContentHeight( diff --git a/src/hooks/web/useDesign.ts b/src/hooks/web/useDesign.ts index f05ac6d..ef39ea6 100644 --- a/src/hooks/web/useDesign.ts +++ b/src/hooks/web/useDesign.ts @@ -16,7 +16,6 @@ export function useDesign(scope: string) { // } return { // prefixCls: computed(() => `${values.prefixCls}-${scope}`), - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions prefixCls: `${values.prefixCls}-${scope}`, prefixVar: values.prefixCls, // style, diff --git a/src/hooks/web/usePage.ts b/src/hooks/web/usePage.ts index bc2608f..b4c964d 100644 --- a/src/hooks/web/usePage.ts +++ b/src/hooks/web/usePage.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/unbound-method */ import type { RouteLocationRaw, Router } from 'vue-router' import { unref } from 'vue' diff --git a/src/hooks/web/usePermission.ts b/src/hooks/web/usePermission.ts index 9721d6e..b951832 100644 --- a/src/hooks/web/usePermission.ts +++ b/src/hooks/web/usePermission.ts @@ -40,7 +40,6 @@ export function usePermission() { /** * Reset and regain authority resource information * 重置和重新获得权限资源信息 - * @param id */ async function resume() { const tabStore = useMultipleTabStore() diff --git a/src/hooks/web/useTabs.ts b/src/hooks/web/useTabs.ts index af90f7c..e1e0da5 100644 --- a/src/hooks/web/useTabs.ts +++ b/src/hooks/web/useTabs.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/await-thenable */ import type { RouteLocationNormalized, Router } from 'vue-router' import { useRouter } from 'vue-router' diff --git a/src/layouts/default/menu/index.vue b/src/layouts/default/menu/index.vue index 3504d39..ac13287 100644 --- a/src/layouts/default/menu/index.vue +++ b/src/layouts/default/menu/index.vue @@ -103,7 +103,7 @@ export default defineComponent({ }) /** * click menu - * @param menu + * @param path */ function handleMenuClick(path: string) { @@ -112,7 +112,7 @@ export default defineComponent({ /** * before click menu - * @param menu + * @param path */ async function beforeMenuClickFn(path: string) { if (!isUrl(path)) @@ -135,17 +135,17 @@ export default defineComponent({ return null return !props.isHorizontal ? ( - + ) : ( - + ) } diff --git a/src/layouts/default/setting/handler.ts b/src/layouts/default/setting/handler.ts index 8d4dfe7..bc06a10 100644 --- a/src/layouts/default/setting/handler.ts +++ b/src/layouts/default/setting/handler.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-case-declarations */ import { HandlerEnum } from './enum' import { updateHeaderBgColor, updateSidebarBgColor } from '@/logics/theme/updateBackground' import { updateColorWeak } from '@/logics/theme/updateColorWeak' diff --git a/src/layouts/default/tabs/useMultipleTabs.ts b/src/layouts/default/tabs/useMultipleTabs.ts index 9c2c161..45c5cd2 100644 --- a/src/layouts/default/tabs/useMultipleTabs.ts +++ b/src/layouts/default/tabs/useMultipleTabs.ts @@ -62,7 +62,7 @@ export function useTabsDrag(affixTextList: string[]) { const el = document.querySelectorAll(`.${prefixCls} .ant-tabs-nav-wrap > div`)?.[0] as HTMLElement const { initSortable } = useSortable(el, { filter: (_evt, target: HTMLElement) => { - const text = target.innerText + const text = target.textContent if (!text) return false return affixTextList.map(res => t(res)).includes(text) diff --git a/src/router/guard/index.ts b/src/router/guard/index.ts index 5152495..25dddc7 100644 --- a/src/router/guard/index.ts +++ b/src/router/guard/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/require-await */ import type { RouteLocationNormalized, Router } from 'vue-router' import { Modal, notification } from 'ant-design-vue' import { unref } from 'vue' diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index fed23a5..8506444 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -64,7 +64,6 @@ function dynamicImport(dynamicViewsModules: Record Promise 1) { warn( - // eslint-disable-next-line max-len 'Please do not create `.vue` and `.TSX` files with the same file name in the same hierarchical directory under the views folder. This will cause dynamic introduction failure', ) } diff --git a/src/router/types.ts b/src/router/types.ts index 0f803da..8c365ba 100644 --- a/src/router/types.ts +++ b/src/router/types.ts @@ -4,8 +4,6 @@ import type { RoleEnum } from '@/enums/roleEnum' export type Component = ReturnType | (() => Promise) | (() => Promise) -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error export interface AppRouteRecordRaw extends Omit { keepAlive?: boolean visible?: boolean diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index dd710ee..beb12a7 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/unbound-method */ import type { RouteLocationNormalized, RouteLocationRaw, Router } from 'vue-router' import { toRaw, unref } from 'vue' @@ -337,7 +336,7 @@ export const useMultipleTabStore = defineStore('app-multiple-tab', { }, /** * replace tab's path - * * + * */ updateTabPath(fullPath: string, route: RouteLocationNormalized) { const findTab = this.getTabList.find(item => item === route) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 1d99f19..2e6f71a 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-case-declarations */ import { toRaw } from 'vue' import { defineStore } from 'pinia' @@ -132,7 +133,7 @@ export const usePermissionStore = defineStore('app-permission', { /** * @description 根据设置的首页path,修正routes中的affix标记(固定首页) - * */ + */ const patchHomeAffix = (routes: AppRouteRecordRaw[]) => { if (!routes || routes.length === 0) return diff --git a/src/utils/auth/index.ts b/src/utils/auth/index.ts index 473bbef..99c63ae 100644 --- a/src/utils/auth/index.ts +++ b/src/utils/auth/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/unbound-method */ import type { BasicKeys } from '@/utils/cache/persistent' import { Persistent } from '@/utils/cache/persistent' import { ACCESS_TOKEN_KEY, CacheTypeEnum, REFRESH_TOKEN_KEY, TENANT_ID_KEY } from '@/enums/cacheEnum' diff --git a/src/utils/cache/storageCache.ts b/src/utils/cache/storageCache.ts index 847341b..409e3ee 100644 --- a/src/utils/cache/storageCache.ts +++ b/src/utils/cache/storageCache.ts @@ -33,10 +33,6 @@ export function createStorage({ private prefixKey?: string private encryption: AesEncryption private hasEncrypt: boolean - /** - * - * @param {*} storage - */ constructor() { this.storage = storage this.prefixKey = prefixKey diff --git a/src/utils/color.ts b/src/utils/color.ts index b180d51..02b74d3 100644 --- a/src/utils/color.ts +++ b/src/utils/color.ts @@ -2,7 +2,7 @@ * 判断是否 十六进制颜色值. * 输入形式可为 #fff000 #f00 * - * @param String color 十六进制颜色值 + * @param color 十六进制颜色值 * @return Boolean */ export function isHexColor(color: string) { diff --git a/src/utils/domUtils.ts b/src/utils/domUtils.ts index 94517b4..8381754 100644 --- a/src/utils/domUtils.ts +++ b/src/utils/domUtils.ts @@ -158,16 +158,12 @@ export function once(el: HTMLElement, event: string, fn: EventListener): void { export function useRafThrottle(fn: T): T { let locked = false - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - return function (...args: any[]) { + return (...args: any[]) => { if (locked) return locked = true window.requestAnimationFrame(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-invalid-this + // eslint-disable-next-line ts/no-invalid-this fn.apply(this, args) locked = false }) diff --git a/src/utils/file/base64Conver.ts b/src/utils/file/base64Conver.ts index 6ccad69..8ed49ad 100644 --- a/src/utils/file/base64Conver.ts +++ b/src/utils/file/base64Conver.ts @@ -27,6 +27,7 @@ export function urlToBase64(url: string, mineType?: string): Promise { img.crossOrigin = '' img.onload = function () { if (!canvas || !ctx) + // eslint-disable-next-line prefer-promise-reject-errors return reject() canvas.height = img.height diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 576635b..2c80b0a 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -84,6 +84,7 @@ const transform: AxiosTransform = { switch (code) { case ResultEnum.UNAUTHORIZED: timeoutMsg = t('sys.api.timeoutMessage') + // eslint-disable-next-line no-case-declarations const userStore = useUserStoreWithOut() userStore.setAccessToken(undefined) userStore.logout(true) diff --git a/src/utils/index.ts b/src/utils/index.ts index 3e2d8b0..d9c820c 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -165,9 +165,7 @@ export function simpleDebounce(fn, delay = 100) { clearTimeout(timer) timer = setTimeout(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-invalid-this + // eslint-disable-next-line ts/no-invalid-this fn.apply(this, args) }, delay) } diff --git a/src/utils/is.ts b/src/utils/is.ts index 72fa3ab..c3147e6 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -1,6 +1,5 @@ import { isNil } from 'lodash-es' -// eslint-disable-next-line @typescript-eslint/unbound-method const toString = Object.prototype.toString export function is(val: unknown, type: string) { diff --git a/src/views/base/profile/data.ts b/src/views/base/profile/data.ts index 61f7466..22a421c 100644 --- a/src/views/base/profile/data.ts +++ b/src/views/base/profile/data.ts @@ -1,3 +1,4 @@ +/* eslint-disable prefer-promise-reject-errors */ import type { FormSchema } from '@/components/Form' import { useI18n } from '@/hooks/web/useI18n' diff --git a/src/views/bpm/oa/leave/detail.vue b/src/views/bpm/oa/leave/detail.vue index bc35a3f..c0dcfd3 100644 --- a/src/views/bpm/oa/leave/detail.vue +++ b/src/views/bpm/oa/leave/detail.vue @@ -27,7 +27,7 @@ async function getInfo() { datas.value = res } -/** 初始化 **/ +/** 初始化 */ onMounted(async () => { await getInfo() }) diff --git a/src/views/bpm/processInstance/create/index.vue b/src/views/bpm/processInstance/create/index.vue index 69e51c4..2315f94 100644 --- a/src/views/bpm/processInstance/create/index.vue +++ b/src/views/bpm/processInstance/create/index.vue @@ -33,7 +33,7 @@ const [registerTable] = useTable({ }, }) -/** 处理选择流程的按钮操作 **/ +/** 处理选择流程的按钮操作 */ async function handleSelect(row) { // 设置选择的流程 selectProcessInstance.value = row diff --git a/src/views/infra/codegen/components/PreviewModal.vue b/src/views/infra/codegen/components/PreviewModal.vue index f23798f..02f081b 100644 --- a/src/views/infra/codegen/components/PreviewModal.vue +++ b/src/views/infra/codegen/components/PreviewModal.vue @@ -33,7 +33,7 @@ function handleSelect(keys) { activeKey.value = keys[0] } -/** 生成 files 目录 **/ +/** 生成 files 目录 */ interface filesType { id: string label: string @@ -102,7 +102,7 @@ function handleFiles(datas) { return files } -/** 复制 **/ +/** 复制 */ async function copy(text: string) { const { copy, copied, isSupported } = useClipboard({ source: text }) if (!isSupported) { diff --git a/src/views/pay/cashier/index.vue b/src/views/pay/cashier/index.vue index 5450a57..e02379e 100644 --- a/src/views/pay/cashier/index.vue +++ b/src/views/pay/cashier/index.vue @@ -250,7 +250,7 @@ async function getDetail() { datas.value = res } -/** 初始化 **/ +/** 初始化 */ onMounted(async () => { await getDetail() }) diff --git a/src/views/system/tenantPackage/TenantPackageModal.vue b/src/views/system/tenantPackage/TenantPackageModal.vue index fbcad4a..4ab2d65 100644 --- a/src/views/system/tenantPackage/TenantPackageModal.vue +++ b/src/views/system/tenantPackage/TenantPackageModal.vue @@ -93,7 +93,7 @@ function menuReset() { * 父子节点关联情况下 checkedKeys为选中的菜单 e.halfCheckedKeys为父节点数组 * 父子节点独立情况下 checkedKeys为{checked: number[], halfChecked: number[]} e.halfCheckedKeys为null * @param checkedKeys 选中的菜单 - * @param e event + * @param event event */ function menuCheck(checkedKeys: CheckedKeys, event: CheckedEvent) { if (Array.isArray(checkedKeys)) { diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index 8e6f960..7df7e43 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -1,3 +1,4 @@ +/* eslint-disable prefer-promise-reject-errors */ import { h } from 'vue' import { Switch } from 'ant-design-vue' import dayjs from 'dayjs'