diff --git a/.env.development b/.env.development index 53750c90994079baba819a3533c24c65aff904d2..7edd98a2396a70361ec9b1bc654c55a3aae9ad69 100644 --- a/.env.development +++ b/.env.development @@ -20,6 +20,8 @@ VITE_APP_PORT = 80 # 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换 VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' +# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换 +VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=' # 客户端id VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' diff --git a/.env.production b/.env.production index c4635427e445766807dda9d4dd79406d1e7dc949..0e3b9fc5282a6c242948fa75356ec1b942e07901 100644 --- a/.env.production +++ b/.env.production @@ -23,6 +23,8 @@ VITE_APP_PORT = 80 # 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换 VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' +# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换 +VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=' # 客户端id VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' diff --git a/.eslintignore b/.eslintignore index c4d771a13f37a416c0ca5a57778945e5802d7b08..9858f3eb709ce287ebcbf7abc32fc75e3ed1c634 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 a1b32e3987b7595620506444b2204e11ee1b72a5..3fab2db0b6e2435a2eecaa3eb55906beba953d0c 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 0000000000000000000000000000000000000000..6ca3ce50e67c2ad83f8152f280c5b5bc974e3d56 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,20 @@ +{ + "printWidth": 150, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "quoteProps": "preserve", + "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/README.md b/README.md index 6644daf2c53a3fd658b211a5299bea2e10b97f6d..27424637da781085de7881fd92c5537a4cebc7c9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ npm install --registry=https://registry.npmmirror.com # 启动服务 npm run dev -# 构建生产环境 yarn build:prod +# 构建生产环境 +npm run build:prod + # 前端访问地址 http://localhost:80 ``` diff --git a/package.json b/package.json index 13e0f926115ee9fdd440066bf41bac341e3a6e1a..3b1c1d64bf38db54878089293d90a257e01ef844 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 ." }, @@ -17,68 +18,72 @@ "url": "https://gitee.com/JavaLionLi/plus-ui.git" }, "dependencies": { - "@element-plus/icons-vue": "2.1.0", + "@element-plus/icons-vue": "2.3.1", "@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", - "echarts": "5.4.0", - "element-plus": "2.2.27", + "crypto-js": "^4.1.1", + "echarts": "5.4.3", + "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", + "js-cookie": "3.0.5", + "jsencrypt": "3.3.2", "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-cropper": "1.0.3", + "vue": "3.3.11", + "vue-cropper": "1.1.1", "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", - "@intlify/unplugin-vue-i18n": "0.8.2", + "@iconify/json": "^2.2.157", + "@intlify/unplugin-vue-i18n": "1.6.0", "@types/crypto-js": "^4.1.1", "@types/file-saver": "2.0.5", "@types/js-cookie": "3.0.3", "@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", - "@vue/compiler-sfc": "3.2.45", + "@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.3.9", + "@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", - "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", + "prettier": "3.1.1", + "sass": "1.69.5", + "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": "1.0.0", "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 41ffdd4d92ba5eeb196d6e28b3385c1460906b4f..a93790af8edb3b0b4a1f9541026171f6f0d3febe 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,17 +5,17 @@ diff --git a/src/api/tool/gen/index.ts b/src/api/tool/gen/index.ts index b91df6ace4cce7566c90820a4f8d58b3392da519..efe079cf0c2bbb01866b55c37984f75db472c26c 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 b96829af9e95a304a51d934936a83f5b6a8505f3..57a30aceac2f6d8c3a8fca67e5babb8b8751cbc7 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 be99ac0325f1c4636125284ba031f004a183b169..67abaabf16485f852cb4fde12bfd3349e831f7d2 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 489ac43e738cded772ecb31118edd5bf725cf330..f9f5e6233020e0926673081470d810c65b0e687b 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 723ccdb208bf657c7c516ecb5e3d3ff9ed3e85d9..31bf8738d2371a1a1fad4140e0e4748cceff5cbb 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: string) => { 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 a30a2f698ab7155b7e656ab9854d1f5141d1a668..f5ae8e8b0027cc21360da7adb8384a47bf0d1bf1 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 ef4a6a9a270a9e823fc31c182d29eac89bf2ca70..e43b2b8cfc72ed9f8e3c197074149a2456d32ecc 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -1,12 +1,12 @@