From 01a4dd0b452ba1df9d3628081f293b054ab299c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A3=89=E8=8A=B1?= <12559203+radish-hi_0@user.noreply.gitee.com> Date: Tue, 5 Dec 2023 12:57:44 +0000 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8FElUploadInstance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 棉花 <12559203+radish-hi_0@user.noreply.gitee.com> --- src/types/element.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/types/element.d.ts b/src/types/element.d.ts index e8d1f620..ba7598d6 100644 --- a/src/types/element.d.ts +++ b/src/types/element.d.ts @@ -24,7 +24,6 @@ declare global { declare type ElColorPickerInstance = InstanceType; declare type ElRateInstance = InstanceType; declare type ElSliderInstance = InstanceType; - declare type ElUploadInstance = InstanceType; declare type ElScrollbarInstance = InstanceType; declare type TransferKey = ep.TransferKey; -- Gitee From b23cff9eb29168d2b94c18377d9645b9ea3eb2d4 Mon Sep 17 00:00:00 2001 From: ahao Date: Tue, 12 Dec 2023 17:32:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 +- .eslintrc.js | 23 +- .prettierrc | 20 ++ package.json | 63 ++-- src/App.vue | 10 +- src/api/tool/gen/index.ts | 4 +- src/components/Breadcrumb/index.vue | 39 +- src/components/BuildCode/index.vue | 69 ++-- src/components/BuildCode/render.vue | 67 ++-- src/components/DictTag/index.vue | 70 ++-- src/components/Editor/index.vue | 158 ++++---- src/components/FileUpload/index.vue | 240 +++++++------ src/components/Hamburger/index.vue | 8 +- src/components/HeaderSearch/index.vue | 96 ++--- src/components/IconSelect/index.vue | 24 +- src/components/ImagePreview/index.vue | 18 +- src/components/ImageUpload/index.vue | 239 +++++++------ src/components/LangSelect/index.vue | 7 +- src/components/Pagination/index.vue | 94 ++--- src/components/RightToolbar/index.vue | 50 ++- src/components/RuoYiDoc/index.vue | 2 +- src/components/RuoYiGit/index.vue | 2 +- src/components/SizeSelect/index.vue | 12 +- src/components/SvgIcon/index.vue | 20 +- src/components/TopNav/index.vue | 98 ++--- src/components/TreeSelect/index.vue | 123 +++---- src/components/iFrame/index.vue | 12 +- src/directive/permission/index.ts | 4 +- src/layout/components/AppMain.vue | 21 +- src/layout/components/IframeToggle/index.vue | 12 +- src/layout/components/InnerLink/index.vue | 13 +- src/layout/components/Navbar.vue | 91 ++--- src/layout/components/Settings/index.vue | 176 ++++----- src/layout/components/Sidebar/Link.vue | 44 +-- src/layout/components/Sidebar/Logo.vue | 26 +- src/layout/components/Sidebar/SidebarItem.vue | 124 ++++--- src/layout/components/Sidebar/index.vue | 41 ++- .../components/SocialCallback/index.vue | 5 +- src/layout/components/TagsView/ScrollPane.vue | 110 +++--- src/layout/components/TagsView/index.vue | 337 +++++++++--------- src/layout/components/TopBar/search.vue | 187 +++++----- src/layout/components/notice/index.vue | 23 +- src/layout/index.vue | 66 ++-- src/permission.ts | 5 +- src/plugins/tab.ts | 18 +- src/router/index.ts | 6 +- src/store/modules/notice.ts | 2 +- src/store/modules/permission.ts | 65 ++-- src/store/modules/settings.ts | 38 +- src/store/modules/tagsView.ts | 24 +- src/types/element.d.ts | 6 +- src/types/env.d.ts | 5 +- src/types/global.d.ts | 73 +++- src/types/router.d.ts | 46 ++- src/types/setting.d.ts | 70 ---- src/utils/propTypes.ts | 1 + src/utils/request.ts | 2 - src/utils/websocket.ts | 4 +- src/views/demo/demo/index.vue | 104 +++--- src/views/demo/tree/index.vue | 123 +++---- src/views/error/401.vue | 4 +- src/views/error/404.vue | 8 +- src/views/index.vue | 12 +- src/views/login.vue | 55 +-- src/views/monitor/cache/index.vue | 74 ++-- src/views/monitor/logininfor/index.vue | 142 ++++---- src/views/monitor/online/index.vue | 26 +- src/views/monitor/operlog/index.vue | 73 ++-- src/views/redirect/index.vue | 8 +- src/views/register.vue | 69 ++-- src/views/system/client/index.vue | 124 +++---- src/views/system/config/index.vue | 94 ++--- src/views/system/dept/index.vue | 126 ++++--- src/views/system/dict/data.vue | 128 +++---- src/views/system/dict/index.vue | 91 ++--- src/views/system/menu/index.vue | 132 +++---- src/views/system/notice/index.vue | 76 ++-- src/views/system/oss/config.vue | 163 ++++----- src/views/system/oss/index.vue | 132 ++++--- src/views/system/post/index.vue | 82 +++-- src/views/system/role/authUser.vue | 57 ++- src/views/system/role/index.vue | 252 ++++++------- src/views/system/role/selectUser.vue | 35 +- src/views/system/tenant/index.vue | 128 +++---- src/views/system/tenantPackage/index.vue | 93 ++--- src/views/system/user/authRole.vue | 26 +- src/views/system/user/index.vue | 288 ++++++++------- src/views/system/user/profile/index.vue | 50 +-- src/views/system/user/profile/resetPwd.vue | 44 ++- src/views/system/user/profile/thirdParty.vue | 39 +- src/views/system/user/profile/userAvatar.vue | 46 ++- src/views/system/user/profile/userInfo.vue | 33 +- src/views/tool/gen/basicInfoForm.vue | 22 +- src/views/tool/gen/editTable.vue | 32 +- src/views/tool/gen/genInfoForm.vue | 49 +-- src/views/tool/gen/importTable.vue | 40 +-- src/views/tool/gen/index.vue | 76 ++-- tsconfig.json | 8 +- 98 files changed, 3214 insertions(+), 3165 deletions(-) create mode 100644 .prettierrc delete mode 100644 src/types/setting.d.ts diff --git a/.eslintignore b/.eslintignore index c4d771a1..9858f3eb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -14,4 +14,4 @@ dist .eslintrc.js prettier.config.js src/assets -tailwind.config.js \ No newline at end of file +tailwind.config.js diff --git a/.eslintrc.js b/.eslintrc.js index a1b32e39..3fab2db0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,28 +1,35 @@ module.exports = { env: { browser: true, - es2021: true, - node: true + node: true, + es6: true }, parser: 'vue-eslint-parser', extends: [ - 'eslint:recommended', - 'plugin:vue/vue3-essential', - 'plugin:@typescript-eslint/recommended', + 'plugin:vue/vue3-recommended', './.eslintrc-auto-import.json', - 'plugin:prettier/recommended' + 'plugin:@typescript-eslint/recommended', + "prettier", + 'plugin:prettier/recommended', ], parserOptions: { ecmaVersion: '2020', sourceType: 'module', + project: "./tsconfig.*?.json", parser: '@typescript-eslint/parser' }, - plugins: ['vue', '@typescript-eslint'], + plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'], rules: { - 'vue/multi-word-component-names': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-explicit-any': 'off', + + // vue + 'vue/multi-word-component-names': 'off', + 'vue/valid-define-props': 'off', 'vue/no-v-model-argument': 'off', + 'prefer-rest-params': 'off', + // prettier + 'prettier/prettier': 'error', '@typescript-eslint/ban-types': [ 'error', { diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..0b008904 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,20 @@ +{ + "printWidth": 150, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "bracketSameLine": false, + "trailingComma": "none", + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "arrowParens": "always", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "endOfLine": "auto" +} diff --git a/package.json b/package.json index 13e0f926..95cd2a13 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "license": "MIT", "scripts": { "dev": "vite serve --mode development", - "build:prod": "vite build --mode production &&vue-tsc --noEmit", + "build:prod": "vite build --mode production", + "build:dev": "vite build --mode development", "preview": "vite preview", - "lint": "eslint src/**/*.{ts,js,vue} --fix", + "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", "prepare": "husky install", "prettier": "prettier --write ." }, @@ -19,28 +20,28 @@ "dependencies": { "@element-plus/icons-vue": "2.1.0", "@vueup/vue-quill": "1.2.0", - "@vueuse/core": "9.5.0", + "@vueuse/core": "10.7.0", "animate.css": "4.1.1", "await-to-js": "^3.0.0", "axios": "^1.3.4", + "crypto-js": "^4.1.1", "echarts": "5.4.0", - "element-plus": "2.2.27", + "element-plus": "2.4.3", "file-saver": "2.0.5", "fuse.js": "6.6.2", "js-cookie": "3.0.1", "jsencrypt": "3.3.1", - "crypto-js": "^4.1.1", "nprogress": "0.2.0", "path-browserify": "1.0.1", "path-to-regexp": "6.2.0", - "pinia": "2.0.22", + "pinia": "2.1.7", "screenfull": "6.0.0", "vform3-builds": "3.0.8", - "vue": "3.2.45", + "vue": "3.3.11", "vue-cropper": "1.0.3", "vue-i18n": "9.2.2", - "vue-router": "4.1.4", - "vue-types": "^5.0.3" + "vue-router": "4.2.5", + "vue-types": "5.1.1" }, "devDependencies": { "@iconify/json": "^2.2.40", @@ -51,34 +52,38 @@ "@types/node": "18.14.2", "@types/nprogress": "0.2.0", "@types/path-browserify": "^1.0.0", - "@typescript-eslint/eslint-plugin": "5.56.0", - "@typescript-eslint/parser": "5.56.0", - "@unocss/preset-attributify": "^0.50.6", - "@unocss/preset-icons": "^0.50.6", - "@unocss/preset-uno": "^0.50.6", - "@vitejs/plugin-vue": "4.0.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "@unocss/preset-attributify": "^0.58.0", + "@unocss/preset-icons": "^0.58.0", + "@unocss/preset-uno": "^0.58.0", "@vue/compiler-sfc": "3.2.45", + "@vitejs/plugin-vue": "4.5.2", "autoprefixer": "10.4.14", - "eslint": "8.36.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-vue": "9.9.0", + "eslint": "8.55.0", + "eslint-config-prettier": "9.1.0", + "eslint-define-config": "2.0.0", + "eslint-plugin-prettier": "5.0.1", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-import": "2.29.0", + "eslint-plugin-vue": "9.19.2", "fast-glob": "^3.2.11", "husky": "7.0.4", "postcss": "^8.4.21", - "prettier": "2.8.6", + "prettier": "3.1.1", "sass": "1.56.1", - "typescript": "4.9.5", - "unocss": "^0.50.6", - "unplugin-auto-import": "0.13.0", - "unplugin-icons": "0.15.1", - "unplugin-vue-components": "0.23.0", - "vite": "4.3.1", + "typescript": "5.2.2", + "unocss": "^0.58.0", + "unplugin-auto-import": "0.17.2", + "unplugin-icons": "0.18.1", + "unplugin-vue-components": "0.26.0", + "unplugin-vue-setup-extend-plus": "0.4.9", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", - "unplugin-vue-setup-extend-plus": "0.4.9", "vitest": "^0.29.7", - "vue-eslint-parser": "9.1.0", - "vue-tsc": "0.35.0" + "vue-eslint-parser": "9.3.2", + "vue-tsc": "0.35.0", + "vite": "5.0.4" } } diff --git a/src/App.vue b/src/App.vue index 41ffdd4d..0b058d75 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,8 +5,8 @@ diff --git a/src/api/tool/gen/index.ts b/src/api/tool/gen/index.ts index b91df6ac..efe079cf 100644 --- a/src/api/tool/gen/index.ts +++ b/src/api/tool/gen/index.ts @@ -28,7 +28,7 @@ export const getGenTable = (tableId: string | number): AxiosPromise }; // 修改代码生成信息 -export const updateGenTable = (data: DbTableForm) => { +export const updateGenTable = (data: DbTableForm): AxiosPromise => { return request({ url: '/tool/gen', method: 'put', @@ -37,7 +37,7 @@ export const updateGenTable = (data: DbTableForm) => { }; // 导入表 -export const importTable = (data: { tables: string; dataName: string }) => { +export const importTable = (data: { tables: string; dataName: string }): AxiosPromise => { return request({ url: '/tool/gen/importTable', method: 'post', diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index b96829af..57a30ace 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,8 +2,7 @@ - {{ - item.meta?.title }} + {{ item.meta?.title }} {{ item.meta?.title }} @@ -11,42 +10,42 @@ diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index be99ac03..67abaabf 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -1,6 +1,7 @@ diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue index 489ac43e..f9f5e623 100644 --- a/src/components/Hamburger/index.vue +++ b/src/components/Hamburger/index.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index 723ccdb2..349c4435 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -15,11 +15,11 @@ const props = defineProps({ src: propTypes.string.def(''), width: { type: [Number, String], - default: "" + default: '' }, height: { type: [Number, String], - default: "" + default: '' } }); @@ -27,7 +27,7 @@ const realSrc = computed(() => { if (!props.src) { return; } - let real_src = props.src.split(",")[0]; + let real_src = props.src.split(',')[0]; return real_src; }); @@ -35,21 +35,17 @@ const realSrcList = computed(() => { if (!props.src) { return; } - let real_src_list = props.src.split(","); + let real_src_list = props.src.split(','); let srcList: string[] = []; - real_src_list.forEach(item => { + real_src_list.forEach((item) => { return srcList.push(item); }); return srcList; }); -const realWidth = computed(() => - typeof props.width == "string" ? props.width : `${props.width}px` -); +const realWidth = computed(() => (typeof props.width == 'string' ? props.width : `${props.width}px`)); -const realHeight = computed(() => - typeof props.height == "string" ? props.height : `${props.height}px` -); +const realHeight = computed(() => (typeof props.height == 'string' ? props.height : `${props.height}px`)); diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index a30a2f69..f5ae8e8b 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -20,16 +20,15 @@ import { useAppStore } from '@/store/modules/app'; const appStore = useAppStore(); const { locale } = useI18n(); - const message: any = { zh_CN: '切换语言成功!', - en_US: 'Switch Language Successful!', -} + en_US: 'Switch Language Successful!' +}; const handleLanguageChange = (lang: string) => { locale.value = lang; appStore.changeLanguage(lang); ElMessage.success(message[lang] || '切换语言成功!'); -} +}; diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index ef4a6a9a..e43b2b8c 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -1,12 +1,12 @@