From 4d2fb0cb6f1e222e1237033da581160fa84ae26a Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 24 Nov 2023 10:32:04 +0800 Subject: [PATCH] refactor: '/@/' ==> '@/' and '/#/ '==> '#/' (#3329) * refactor: /@/ ==> @/ * chore: '/@/' ==> '@/' and '/#/ '==> '#/' * fix: lint:prettier --- .vscode/settings.json | 2 +- .../vite-config/src/config/application.ts | 10 - mock/_util.ts | 2 +- src/api/demo/account.ts | 2 +- src/api/demo/cascader.ts | 4 +- src/api/demo/error.ts | 2 +- src/api/demo/model/optionsModel.ts | 2 +- src/api/demo/model/systemModel.ts | 2 +- src/api/demo/model/tableModel.ts | 2 +- src/api/demo/select.ts | 2 +- src/api/demo/system.ts | 2 +- src/api/demo/table.ts | 2 +- src/api/demo/tree.ts | 2 +- src/api/sys/menu.ts | 2 +- src/api/sys/upload.ts | 6 +- src/api/sys/user.ts | 4 +- .../Application/src/AppLocalePicker.vue | 2 +- src/components/Dropdown/src/Dropdown.vue | 2 +- src/components/Form/src/hooks/useForm.ts | 2 +- src/components/Menu/src/useOpenKeys.ts | 2 +- .../SimpleMenu/src/components/SubMenuItem.vue | 2 +- src/components/Table/src/hooks/useTable.ts | 2 +- src/directives/clickOutside.ts | 4 +- src/directives/loading.ts | 2 +- src/directives/permission.ts | 2 +- src/directives/repeatClick.ts | 2 +- src/hooks/setting/index.ts | 2 +- src/hooks/setting/useHeaderSetting.ts | 2 +- src/hooks/setting/useMenuSetting.ts | 2 +- src/hooks/setting/useMultipleTabSetting.ts | 2 +- src/hooks/setting/useRootSetting.ts | 2 +- src/hooks/setting/useTransitionSetting.ts | 2 +- .../default/header/components/Breadcrumb.vue | 22 +- .../header/components/ChangeApi/index.vue | 2 +- src/layouts/default/setting/handler.ts | 2 +- src/locales/helper.ts | 2 +- src/locales/lang/en/common.json | 30 +-- src/locales/lang/en/component.json | 188 +++++++++--------- src/locales/lang/en/layout.json | 2 +- src/locales/lang/en/routes/basic.json | 2 +- src/locales/lang/en/sys.json | 156 +++++++-------- .../lang/zh-CN/antdLocale/DatePicker.json | 2 +- src/locales/lang/zh-CN/component.json | 188 +++++++++--------- src/locales/lang/zh-CN/layout.json | 2 +- src/locales/lang/zh-CN/sys.json | 156 +++++++-------- src/locales/lang/zh_CN.ts | 2 +- src/locales/setupI18n.ts | 4 +- src/locales/useLocale.ts | 4 +- src/logics/error-handle/index.ts | 8 +- src/logics/initAppConfig.ts | 26 +-- src/logics/mitt/routeChange.ts | 4 +- src/logics/theme/dark.ts | 2 +- src/logics/theme/updateBackground.ts | 6 +- src/router/constant.ts | 4 +- src/router/guard/index.ts | 14 +- src/router/guard/paramMenuGuard.ts | 6 +- src/router/guard/permissionGuard.ts | 10 +- src/router/guard/stateGuard.ts | 12 +- src/router/helper/menuHelper.ts | 8 +- src/router/helper/routeHelper.ts | 8 +- src/router/menus/index.ts | 16 +- src/router/routes/basic.ts | 15 +- src/router/routes/index.ts | 10 +- src/router/routes/mainOut.ts | 4 +- src/router/routes/modules/about.ts | 8 +- src/router/routes/modules/dashboard.ts | 10 +- src/router/routes/modules/demo/charts.ts | 18 +- src/router/routes/modules/demo/comp.ts | 112 +++++------ src/router/routes/modules/demo/feat.ts | 68 +++---- src/router/routes/modules/demo/flow.ts | 8 +- src/router/routes/modules/demo/iframe.ts | 8 +- src/router/routes/modules/demo/level.ts | 12 +- src/router/routes/modules/demo/page.ts | 34 ++-- src/router/routes/modules/demo/permission.ts | 20 +- src/router/routes/modules/demo/setup.ts | 8 +- src/router/routes/modules/demo/system.ts | 20 +- src/router/routes/modules/form-design/main.ts | 8 +- src/router/types.ts | 2 +- src/settings/encryptionSetting.ts | 2 +- src/settings/localeSetting.ts | 2 +- src/settings/projectSetting.ts | 8 +- src/store/modules/app.ts | 18 +- src/store/modules/errorLog.ts | 10 +- src/store/modules/locale.ts | 10 +- src/store/modules/lock.ts | 6 +- src/store/modules/multipleTab.ts | 18 +- src/store/modules/permission.ts | 28 +-- src/store/modules/user.ts | 30 +-- src/utils/auth/index.ts | 6 +- src/utils/bem.ts | 2 +- src/utils/cache/index.ts | 7 +- src/utils/cache/persistent.ts | 10 +- src/utils/cache/storageCache.ts | 4 +- src/utils/env.ts | 4 +- src/utils/factory/createAsyncComponent.tsx | 2 +- src/utils/helper/tsxHelper.tsx | 4 +- src/utils/http/axios/Axios.ts | 6 +- src/utils/http/axios/axiosTransform.ts | 2 +- src/utils/http/axios/checkStatus.ts | 16 +- src/utils/http/axios/helper.ts | 2 +- src/utils/http/axios/index.ts | 22 +- src/utils/index.ts | 2 +- src/views/dashboard/workbench/index.vue | 2 +- src/views/demo/editor/markdown/index.vue | 4 +- src/views/demo/feat/tab-params/index.vue | 2 +- src/views/demo/table/AuthColumn.vue | 2 +- .../VFormDesign/components/ComponentProps.vue | 2 +- .../components/ImportJsonModal.vue | 4 +- .../VFormDesign/components/PreviewCode.vue | 6 +- .../components/VFormDesign/index.vue | 4 +- .../VFormDesign/modules/CollapseItem.vue | 2 +- .../components/VFormItem/vFormItem.vue | 4 +- .../components/VFormPreview/useForm.vue | 2 +- src/views/form-design/components/index.ts | 4 +- src/views/form-design/core/formItemConfig.ts | 4 +- src/views/form-design/examples/baseForm.vue | 2 +- src/views/form-design/index.vue | 2 +- .../form-design/typings/v-form-component.ts | 4 +- src/views/form-design/utils/index.ts | 2 +- src/views/form-design/utils/message.ts | 2 +- src/views/sys/error-log/DetailModal.vue | 2 +- src/views/sys/error-log/index.vue | 2 +- src/views/sys/login/Login.vue | 4 +- tsconfig.json | 2 - types/config.d.ts | 6 +- types/store.d.ts | 6 +- types/vue-router.d.ts | 2 +- 127 files changed, 807 insertions(+), 827 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f3df7a4f..52e54b72 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -57,7 +57,7 @@ "stylelint.enable": true, "stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"], "path-intellisense.mappings": { - "/@/": "${workspaceRoot}/src" + "@/": "${workspaceRoot}/src" }, "[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/internal/vite-config/src/config/application.ts b/internal/vite-config/src/config/application.ts index b6c07d4b..1a24f175 100644 --- a/internal/vite-config/src/config/application.ts +++ b/internal/vite-config/src/config/application.ts @@ -45,16 +45,6 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { find: 'vue-i18n', replacement: 'vue-i18n/dist/vue-i18n.cjs.js', }, - // /@/xxxx => src/xxxx - { - find: /\/@\//, - replacement: pathResolve('src') + '/', - }, - // /#/xxxx => types/xxxx - { - find: /\/#\//, - replacement: pathResolve('types') + '/', - }, // @/xxxx => src/xxxx { find: /@\//, diff --git a/mock/_util.ts b/mock/_util.ts index de4d5584..380c3a32 100644 --- a/mock/_util.ts +++ b/mock/_util.ts @@ -1,5 +1,5 @@ // Interface data format used to return a unified format -import { ResultEnum } from '/@/enums/httpEnum'; +import { ResultEnum } from '@/enums/httpEnum'; export function resultSuccess(result: T, { message = 'ok' } = {}) { return { diff --git a/src/api/demo/account.ts b/src/api/demo/account.ts index 2a368138..d4d9c277 100644 --- a/src/api/demo/account.ts +++ b/src/api/demo/account.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; import { GetAccountInfoModel } from './model/accountModel'; enum Api { diff --git a/src/api/demo/cascader.ts b/src/api/demo/cascader.ts index 83dcab07..65a1f480 100644 --- a/src/api/demo/cascader.ts +++ b/src/api/demo/cascader.ts @@ -1,5 +1,5 @@ -import { defHttp } from '/@/utils/http/axios'; -import { AreaModel, AreaParams } from '/@/api/demo/model/areaModel'; +import { defHttp } from '@/utils/http/axios'; +import { AreaModel, AreaParams } from '@/api/demo/model/areaModel'; enum Api { AREA_RECORD = '/cascader/getAreaRecord', diff --git a/src/api/demo/error.ts b/src/api/demo/error.ts index 3ce60721..0a7f6628 100644 --- a/src/api/demo/error.ts +++ b/src/api/demo/error.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; enum Api { // The address does not exist diff --git a/src/api/demo/model/optionsModel.ts b/src/api/demo/model/optionsModel.ts index 82667763..871ae9f1 100644 --- a/src/api/demo/model/optionsModel.ts +++ b/src/api/demo/model/optionsModel.ts @@ -1,4 +1,4 @@ -import { BasicFetchResult } from '/@/api/model/baseModel'; +import { BasicFetchResult } from '@/api/model/baseModel'; export interface DemoOptionsItem { name: string; diff --git a/src/api/demo/model/systemModel.ts b/src/api/demo/model/systemModel.ts index 06865476..0e5f8fa7 100644 --- a/src/api/demo/model/systemModel.ts +++ b/src/api/demo/model/systemModel.ts @@ -1,4 +1,4 @@ -import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; +import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel'; export type AccountParams = BasicPageParams & { account?: string; diff --git a/src/api/demo/model/tableModel.ts b/src/api/demo/model/tableModel.ts index eba35bb9..8f1eea58 100644 --- a/src/api/demo/model/tableModel.ts +++ b/src/api/demo/model/tableModel.ts @@ -1,4 +1,4 @@ -import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; +import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel'; /** * @description: Request list interface parameters */ diff --git a/src/api/demo/select.ts b/src/api/demo/select.ts index e21e1e6d..f5f5cf9f 100644 --- a/src/api/demo/select.ts +++ b/src/api/demo/select.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; import { DemoOptionsItem, selectParams } from './model/optionsModel'; enum Api { diff --git a/src/api/demo/system.ts b/src/api/demo/system.ts index f5c296b5..980e58c4 100644 --- a/src/api/demo/system.ts +++ b/src/api/demo/system.ts @@ -10,7 +10,7 @@ import { RolePageListGetResultModel, RoleListGetResultModel, } from './model/systemModel'; -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; enum Api { AccountList = '/system/getAccountList', diff --git a/src/api/demo/table.ts b/src/api/demo/table.ts index b9b60df6..f24491b7 100644 --- a/src/api/demo/table.ts +++ b/src/api/demo/table.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; import { DemoParams, DemoListGetResultModel } from './model/tableModel'; enum Api { diff --git a/src/api/demo/tree.ts b/src/api/demo/tree.ts index 8b8a94f1..3c278a70 100644 --- a/src/api/demo/tree.ts +++ b/src/api/demo/tree.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; enum Api { TREE_OPTIONS_LIST = '/tree/getDemoOptions', diff --git a/src/api/sys/menu.ts b/src/api/sys/menu.ts index de9fa563..27fb826d 100644 --- a/src/api/sys/menu.ts +++ b/src/api/sys/menu.ts @@ -1,4 +1,4 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; import { getMenuListResultModel } from './model/menuModel'; enum Api { diff --git a/src/api/sys/upload.ts b/src/api/sys/upload.ts index f4406680..2c4e191a 100644 --- a/src/api/sys/upload.ts +++ b/src/api/sys/upload.ts @@ -1,7 +1,7 @@ import { UploadApiResult } from './model/uploadModel'; -import { defHttp } from '/@/utils/http/axios'; -import { UploadFileParams } from '/#/axios'; -import { useGlobSetting } from '/@/hooks/setting'; +import { defHttp } from '@/utils/http/axios'; +import { UploadFileParams } from '#/axios'; +import { useGlobSetting } from '@/hooks/setting'; import { AxiosProgressEvent } from 'axios'; const { uploadUrl = '' } = useGlobSetting(); diff --git a/src/api/sys/user.ts b/src/api/sys/user.ts index f30d14f0..511fca2e 100644 --- a/src/api/sys/user.ts +++ b/src/api/sys/user.ts @@ -1,7 +1,7 @@ -import { defHttp } from '/@/utils/http/axios'; +import { defHttp } from '@/utils/http/axios'; import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel'; -import { ErrorMessageMode } from '/#/axios'; +import { ErrorMessageMode } from '#/axios'; enum Api { Login = '/login', diff --git a/src/components/Application/src/AppLocalePicker.vue b/src/components/Application/src/AppLocalePicker.vue index 8e3e68f9..f44a2f7a 100644 --- a/src/components/Application/src/AppLocalePicker.vue +++ b/src/components/Application/src/AppLocalePicker.vue @@ -18,7 +18,7 @@ diff --git a/src/views/form-design/typings/v-form-component.ts b/src/views/form-design/typings/v-form-component.ts index 8d079814..b5dce99c 100644 --- a/src/views/form-design/typings/v-form-component.ts +++ b/src/views/form-design/typings/v-form-component.ts @@ -2,12 +2,12 @@ import { IAnyObject } from './base-type'; // import { ComponentOptions } from 'vue/types/options'; import { ComponentOptions } from 'vue'; import { IVFormMethods } from '../hooks/useVFormMethods'; -import { ColEx } from '/@/components/Form/src/types'; +import { ColEx } from '@/components/Form/src/types'; import { SelectValue } from 'ant-design-vue/lib/select'; import { validateOptions } from 'ant-design-vue/lib/form/useForm'; import { RuleError } from 'ant-design-vue/lib/form/interface'; -import { FormItem } from '/@/components/Form'; +import { FormItem } from '@/components/Form'; import { FormLayout, FormProps } from 'ant-design-vue/lib/form/Form'; type labelLayout = 'flex' | 'Grid'; diff --git a/src/views/form-design/utils/index.ts b/src/views/form-design/utils/index.ts index e26028fb..94fbd819 100644 --- a/src/views/form-design/utils/index.ts +++ b/src/views/form-design/utils/index.ts @@ -2,7 +2,7 @@ import { IVFormComponent, IFormConfig, IValidationRule } from '../typings/v-form-component'; import { cloneDeep, isArray, isFunction, isNumber, uniqueId } from 'lodash-es'; // import { del } from '@vue/composition-api'; -// import { withInstall } from '/@/utils'; +// import { withInstall } from '@/utils'; /** * 组件install方法 diff --git a/src/views/form-design/utils/message.ts b/src/views/form-design/utils/message.ts index 97b9c836..1f3d71a3 100644 --- a/src/views/form-design/utils/message.ts +++ b/src/views/form-design/utils/message.ts @@ -1,4 +1,4 @@ -import { useMessage } from '/@/hooks/web/useMessage'; +import { useMessage } from '@/hooks/web/useMessage'; const { createMessage } = useMessage(); const message = Object.assign({ diff --git a/src/views/sys/error-log/DetailModal.vue b/src/views/sys/error-log/DetailModal.vue index ab16df14..9390c04d 100644 --- a/src/views/sys/error-log/DetailModal.vue +++ b/src/views/sys/error-log/DetailModal.vue @@ -5,7 +5,7 @@