diff --git a/.env.development b/.env.development index 14e13358631fd33bcd06157e05d685dfb50d4f11..fa845e76ba5030fecbceb8bb2383cf681163bd06 100644 --- a/.env.development +++ b/.env.development @@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api' VITE_APP_CONTEXT_PATH = '/' # 监控地址 -VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications' +VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/applications' # SnailJob 控制台地址 VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job' diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e74db40bfcd94e703617d0de83d00b004ab7132a..0000000000000000000000000000000000000000 --- a/.eslintignore +++ /dev/null @@ -1,17 +0,0 @@ -*.sh -node_modules -*.md -*.woff -*.ttf -.vscode -.idea -dist -/public -/docs -.husky -.local -/bin -.eslintrc.cjs -prettier.config.js -src/assets -tailwind.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 6042c39be0864a75105eabc787224abee03a6e41..0000000000000000000000000000000000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - es6: true - }, - parser: 'vue-eslint-parser', - extends: [ - 'plugin:vue/vue3-recommended', - './.eslintrc-auto-import.json', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'plugin:prettier/recommended' - ], - parserOptions: { - ecmaVersion: '2020', - sourceType: 'module', - project: './tsconfig.*?.json', - parser: '@typescript-eslint/parser' - }, - plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'], - rules: { - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-this-alias': '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', - { - // 关闭空类型检查 {} - extendDefaults: true, - types: { - '{}': false, - Function: false - } - } - ] - }, - globals: { - DialogOption: 'readonly', - OptionType: 'readonly' - } -}; diff --git a/README.md b/README.md index 010adb9724595c5a5166080bf281322b4498925d..531f64b96b6eab984259c5cc1f21942c867b8ebf 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ - 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。 - 成员项目: 基于 vben(ant-design-vue) 的前端项目 [ruoyi-plus-vben](https://gitee.com/dapppp/ruoyi-plus-vben) +- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5) - 配套后端代码仓库地址 - [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus) - [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus) diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..8b67e9edbaaf71149c57fab255b66622105bb108 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,86 @@ +import globals from 'globals'; +import pluginJs from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import pluginVue from 'eslint-plugin-vue'; +import { readFile } from 'node:fs/promises'; +import prettier from 'eslint-plugin-prettier'; + +/** + * https://blog.csdn.net/sayUonly/article/details/123482912 + * 自动导入的配置 + */ +const autoImportFile = new URL('./.eslintrc-auto-import.json', import.meta.url); +const autoImportGlobals = JSON.parse(await readFile(autoImportFile, 'utf8')); + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + /** + * 不需要.eslintignore文件 而是在这里配置 + */ + ignores: [ + '*.sh', + 'node_modules', + '*.md', + '*.woff', + '*.ttf', + '.vscode', + '.idea', + 'dist', + '/public', + '/docs', + '.husky', + '.local', + '/bin', + '.eslintrc.cjs', + 'prettier.config.js', + 'src/assets', + 'tailwind.config.js' + ] + }, + { files: ['**/*.{js,mjs,cjs,ts,vue}'] }, + { + languageOptions: { + globals: globals.browser + } + }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + ...pluginVue.configs['flat/essential'], + { + files: ['**/*.vue'], + languageOptions: { + parserOptions: { + parser: tseslint.parser + } + } + }, + { + languageOptions: { + globals: { + // 自动导入的配置 undef + ...autoImportGlobals.globals, + DialogOption: 'readonly', + LayoutSetting: 'readonly' + } + }, + plugins: { prettier }, + rules: { + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-this-alias': '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', + // 允许使用空Object类型 {} + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-unused-expressions': 'off' + } + } +]; diff --git a/package.json b/package.json index e67d60f26cc6cf159ae2ef79d53b0c32f1707b19..b911cd65401328ce85120ad94bd32b9500caab3d 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/tsconfig", "name": "ruoyi-vue-plus", "version": "5.2.3", "description": "RuoYi-Vue-Plus多租户管理系统", @@ -10,7 +11,8 @@ "build:prod": "vite build --mode production", "build:dev": "vite build --mode development", "preview": "vite preview", - "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", + "lint:eslint": "eslint", + "lint:eslint:fix": "eslint --fix", "prettier": "prettier --write ." }, "repository": { @@ -21,71 +23,66 @@ "@element-plus/icons-vue": "2.3.1", "@highlightjs/vue-plugin": "2.1.0", "@vueup/vue-quill": "1.2.0", - "@vueuse/core": "10.9.0", + "@vueuse/core": "11.3.0", "animate.css": "4.1.1", "await-to-js": "3.0.0", - "axios": "1.6.8", + "axios": "1.7.8", "bpmn-js": "16.4.0", "crypto-js": "4.2.0", "diagram-js": "12.3.0", "didi": "9.0.2", "echarts": "5.5.0", - "element-plus": "2.7.8", + "element-plus": "2.8.8", "file-saver": "2.0.5", "fuse.js": "7.0.0", "highlight.js": "11.9.0", - "image-conversion": "^2.1.1", + "image-conversion": "2.1.1", "js-cookie": "3.0.5", "jsencrypt": "3.3.2", "nprogress": "0.2.0", - "pinia": "2.1.7", + "pinia": "2.2.6", "screenfull": "6.0.2", - "vue": "3.4.34", + "vue": "3.5.13", "vue-cropper": "1.1.1", "vue-i18n": "9.10.2", - "vue-router": "4.3.2", - "vue-types": "5.1.1", + "vue-json-pretty": "2.4.0", + "vue-router": "4.4.5", + "vue-types": "5.1.3", "vxe-table": "4.5.22" }, "devDependencies": { - "@iconify/json": "2.2.201", - "@intlify/unplugin-vue-i18n": "3.0.1", + "@eslint/js": "9.15.0", + "@iconify/json": "2.2.276", "@types/crypto-js": "4.2.2", "@types/file-saver": "2.0.7", "@types/js-cookie": "3.0.6", "@types/node": "18.18.2", "@types/nprogress": "0.2.3", - "@typescript-eslint/eslint-plugin": "7.3.1", - "@typescript-eslint/parser": "7.3.1", - "@unocss/preset-attributify": "0.58.6", - "@unocss/preset-icons": "0.58.6", - "@unocss/preset-uno": "0.58.6", + "@unocss/preset-attributify": "0.64.1", + "@unocss/preset-icons": "0.64.1", + "@unocss/preset-uno": "0.64.1", "@vitejs/plugin-vue": "5.0.4", "@vue/compiler-sfc": "3.4.23", "autoprefixer": "10.4.18", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-define-config": "2.1.0", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-vue": "9.23.0", + "eslint": "9.15.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-vue": "9.31.0", "fast-glob": "3.3.2", + "globals": "15.12.0", "postcss": "8.4.36", "prettier": "3.2.5", "sass": "1.72.0", - "typescript": "5.4.5", - "unocss": "0.58.6", + "typescript": "5.7.2", + "typescript-eslint": "8.16.0", + "unocss": "0.64.1", "unplugin-auto-import": "0.17.5", "unplugin-icons": "0.18.5", "unplugin-vue-components": "0.26.0", "unplugin-vue-setup-extend-plus": "1.0.1", - "vite": "5.2.12", + "vite": "5.4.11", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", "vitest": "1.5.0", - "vue-eslint-parser": "9.4.2", "vue-tsc": "2.0.13" } } diff --git a/src/api/login.ts b/src/api/login.ts index c7c291e58f20ed2ffbc35a67ea53d2d26114ffea..35e6a4ea0284a64ad71ba83ebd6209a584539e3b 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,10 +51,12 @@ export function register(data: any) { * 注销 */ export function logout() { - request({ - url: '/resource/sse/close', - method: 'get' - }); + if (import.meta.env.VITE_APP_SSE === 'true') { + request({ + url: '/resource/sse/close', + method: 'get' + }); + } return request({ url: '/auth/logout', method: 'post' @@ -100,11 +102,11 @@ export function getInfo(): AxiosPromise { } // 获取租户列表 -export function getTenantList(): AxiosPromise { +export function getTenantList(isToken: boolean): AxiosPromise { return request({ url: '/auth/tenant/list', headers: { - isToken: false + isToken: isToken }, method: 'get' }); diff --git a/src/api/monitor/online/index.ts b/src/api/monitor/online/index.ts index 74847026f16f39a66ad870bc2f80793806e90583..5b3221c173884fb078b33c9e131f4f607417fe5d 100644 --- a/src/api/monitor/online/index.ts +++ b/src/api/monitor/online/index.ts @@ -30,7 +30,7 @@ export function getOnline() { // 删除当前在线设备 export function delOnline(tokenId: string) { return request({ - url: '/monitor/online/' + tokenId, - method: 'post' + url: '/monitor/online/myself/' + tokenId, + method: 'delete' }); } diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts index 7b7b93f0b7461f9f7149092573542c3122aeceb0..d1d8ff82e389bd55eea2526bd1999dd074f643ae 100644 --- a/src/api/system/tenant/index.ts +++ b/src/api/system/tenant/index.ts @@ -96,6 +96,6 @@ export function syncTenantPackage(tenantId: string | number, packageId: string | export function syncTenantDict() { return request({ url: '/system/tenant/syncTenantDict', - method: 'get', + method: 'get' }); } diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index 220e4ac8f541b39466c36208222543e8e341f4b1..5dd573dd680ede01beaa01ff239e5c3528cf3c6e 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -1,4 +1,3 @@ - .el-collapse { .collapse__title { font-weight: 600; diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index 92fc34d508d9dd70da51f216c99684e5800430be..36a8df6f6ea522f6f2751d096059babdbf0522a8 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -20,7 +20,7 @@ --bpmn-panel-bar-background-color: #f5f7fa; // ele - --brder-color: #e8e8e8 + --brder-color: #e8e8e8; } html.dark { --menuBg: #1d1e1f; @@ -42,25 +42,25 @@ html.dark { --el-color-primary-light-9: #262727; } // vxe-table 主题 - --vxe-font-color: #98989E; - --vxe-primary-color: #2C7ECF; - --vxe-icon-background-color: #98989E; - --vxe-table-font-color: #98989E; + --vxe-font-color: #98989e; + --vxe-primary-color: #2c7ecf; + --vxe-icon-background-color: #98989e; + --vxe-table-font-color: #98989e; --vxe-table-resizable-color: #95969a; - --vxe-table-header-background-color: #28282A; + --vxe-table-header-background-color: #28282a; --vxe-table-body-background-color: #151518; --vxe-table-background-color: #4a5663; --vxe-table-border-width: 1px; - --vxe-table-border-color: #37373A; - --vxe-toolbar-background-color: #37373A; + --vxe-table-border-color: #37373a; + --vxe-toolbar-background-color: #37373a; // 工作流 - --bpmn-panel-border: #37373A; - --bpmn-panel-box-shadow: #37373A; - --bpmn-panel-bar-background-color: #37373A; + --bpmn-panel-border: #37373a; + --bpmn-panel-box-shadow: #37373a; + --bpmn-panel-bar-background-color: #37373a; // ele - --brder-color: #37373A + --brder-color: #37373a; } // base color diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 9502e60fc1f51dadff40da24f404f6e72785174c..a8b2f68ca77cc0b8c8936adeb1a6bcabf35b4538 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -11,21 +11,53 @@ diff --git a/src/views/register.vue b/src/views/register.vue index c3d19301c54f5f0ef4c686a2ac548401eb7a5f9a..9f76c70485b383626566ea9146254d0eb615a691 100644 --- a/src/views/register.vue +++ b/src/views/register.vue @@ -1,20 +1,30 @@ diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 1b67d4849aff641dc8ba201c3cbfec9f6d2af575..64a0d4c598cada90750d5c7d56c819ea61484744 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -56,7 +56,7 @@ 刷新缓存 - + @@ -101,7 +101,7 @@ - + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 199a99777d745601dbe1b6a861e17dea13c11dde..15dfaa26c339e7d1e8cdd493bf99d958f3186f4c 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -33,7 +33,7 @@ 展开/折叠 - + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 33c7fc8cb9878d6b5e540f5e4cd15ed9069bd649..0faf1fa715bd96439045ff35d1ffdc27671c43d5 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -40,7 +40,7 @@ 关闭 - + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 4ad70d098374494fbe45639b95d0ab0751dab4e1..adb0b27d711c245fe5d13a144626cf7e93c9cc75 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -49,10 +49,7 @@ 刷新缓存 - - 同步租户字典 - - + @@ -112,15 +109,11 @@ diff --git a/src/views/workflow/category/index.vue b/src/views/workflow/category/index.vue index fd3bfc50f5f11c98d67736eeacac62ddd7b58033..401edcf61b168406313b752093a80f9f798d18ed 100644 --- a/src/views/workflow/category/index.vue +++ b/src/views/workflow/category/index.vue @@ -26,7 +26,7 @@ 展开/折叠 - + 导出 - + diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index f413136b034d16731442da9ab0d0cbd66973da52..1708b6475c605b693ff413e8ea19fdbc18ce4505 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -27,7 +27,7 @@ 导出 - + diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index 55556fdef45e87205321c5e30b3d962610de1f40..418f272632c4bcc89df7e43f0a33522fcbaac3ed 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -192,8 +192,8 @@ const handleStartWorkFlow = async (data: LeaveVO) => { taskVariables.value = { entity: data, leaveDays: data.leaveDays, - userList: ["1", "3"], - userList2: ["1", "3"] + userList: ['1', '3'], + userList2: ['1', '3'] }; submitFormData.value.variables = taskVariables.value; const resp = await startWorkFlow(submitFormData.value); diff --git a/src/views/workflow/model/index.vue b/src/views/workflow/model/index.vue index e83cd944735546f601796d06b2cf0b4535dcb189..86249bbb828cd6803c0e753df8785eb30b4ada47 100644 --- a/src/views/workflow/model/index.vue +++ b/src/views/workflow/model/index.vue @@ -53,7 +53,7 @@ 导出 - + diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 1dacb8032d694f5c7924f3db04e658caa10f26cf..6c686bfad805d3bb0bdf562c8891a173e8bb5047 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -47,7 +47,7 @@ 部署流程文件 - + diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 7c60880bb4b31c0d1b6c8b20e7692328090a8cf2..084cf13095f96e532998b90072c0fb67c11f3675 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -52,7 +52,7 @@ 删除 - + diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index fe530b81af2001a61b6b586d4e882f7a08f63ad6..0bcfd315bb14807b66400aa126712c99b7a31b55 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -35,7 +35,7 @@ 修改办理人 - + diff --git a/src/views/workflow/task/myDocument.vue b/src/views/workflow/task/myDocument.vue index 1bf5bbfb347cdc74d365e48ab64b05b021f626e6..0a2ef19a5a4ef19f0e4544e1dce9f3ce3b40daf2 100644 --- a/src/views/workflow/task/myDocument.vue +++ b/src/views/workflow/task/myDocument.vue @@ -38,7 +38,7 @@ diff --git a/src/views/workflow/task/taskCopyList.vue b/src/views/workflow/task/taskCopyList.vue index 7784a08fd12f5455dfed2015fdfc0deff22f9589..c978cbd0d48828c00169cc6d40078917e3891369 100644 --- a/src/views/workflow/task/taskCopyList.vue +++ b/src/views/workflow/task/taskCopyList.vue @@ -24,7 +24,7 @@ diff --git a/src/views/workflow/task/taskFinish.vue b/src/views/workflow/task/taskFinish.vue index 155bd4f9f437dbb380430ff12c39c3358ecbdefa..dadef159e64648d2ac2e69939ac0f14206de78d6 100644 --- a/src/views/workflow/task/taskFinish.vue +++ b/src/views/workflow/task/taskFinish.vue @@ -24,7 +24,7 @@ diff --git a/src/views/workflow/task/taskWaiting.vue b/src/views/workflow/task/taskWaiting.vue index dc6546a47b4fca80bb849c4aad8b5771c328bd6a..6d548291336137e27c8b0462346846e371e61f60 100644 --- a/src/views/workflow/task/taskWaiting.vue +++ b/src/views/workflow/task/taskWaiting.vue @@ -24,7 +24,7 @@ diff --git a/tsconfig.json b/tsconfig.json index bb287e9d79ccda002f044079edd9dfa5dff6f9e9..6315891fb5d671311f3a313e2d2bf42aa77cf715 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "esnext", "module": "esnext", -// "useDefineForClassFields": true, + // "useDefineForClassFields": true, "moduleResolution": "bundler", "strict": true, "jsx": "preserve", diff --git a/vite/plugins/i18n.ts b/vite/plugins/i18n.ts deleted file mode 100644 index 8777d1aeeca2475620456f7e9ceec66bef075901..0000000000000000000000000000000000000000 --- a/vite/plugins/i18n.ts +++ /dev/null @@ -1,6 +0,0 @@ -import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; -export default (path: any) => { - return VueI18nPlugin({ - include: [path.resolve(__dirname, '../../src/lang/**.json')] - }); -}; diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts index 0ec5b8d7907803d66f87355b557bce378c84a840..30b2835a439ac740be4be641f929f88645f9cf4d 100644 --- a/vite/plugins/index.ts +++ b/vite/plugins/index.ts @@ -6,7 +6,6 @@ import createIcons from './icons'; import createSvgIconsPlugin from './svg-icon'; import createCompression from './compression'; import createSetupExtend from './setup-extend'; -import createI18n from './i18n'; import path from 'path'; export default (viteEnv: any, isBuild = false): [] => { @@ -19,6 +18,5 @@ export default (viteEnv: any, isBuild = false): [] => { vitePlugins.push(createIcons()); vitePlugins.push(createSvgIconsPlugin(path, isBuild)); vitePlugins.push(createSetupExtend()); - vitePlugins.push(createI18n(path)); return vitePlugins; };