diff --git a/web/.prettierrc b/web/.prettierrc new file mode 100644 index 0000000000..bc61a53e1b --- /dev/null +++ b/web/.prettierrc @@ -0,0 +1,12 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": true, + "arrowParens": "always", + "vueIndentScriptAndStyle": true, + "endOfLine": "lf" +} diff --git a/web/README.md b/web/README.md index 2e882ae9b1..06f1a8cce0 100644 --- a/web/README.md +++ b/web/README.md @@ -1,33 +1,38 @@ -# gin-vue-admin web +# gin-vue-admin web ## Project setup + ``` npm install ``` ### Compiles and hot-reloads for development + ``` npm run serve ``` ### Compiles and minifies for production + ``` npm run build ``` ### Run your tests + ``` npm run test ``` ### Lints and fixes files + ``` npm run lint ``` - 整理代码结构 -``` lua + +```lua web ├── babel.config.js ├── Dockerfile @@ -67,7 +72,7 @@ web │ │ ├── asyncRouter.js -- 动态路由相关 │ │ ├── bus.js -- 全局mitt声明文件 │ │ ├── date.js -- 日期相关 - │ │ ├── dictionary.js -- 获取字典方法 + │ │ ├── dictionary.js -- 获取字典方法 │ │ ├── downloadImg.js -- 下载图片方法 │ │ ├── format.js -- 格式整理相关 │ │ ├── image.js -- 图片相关方法 @@ -80,21 +85,21 @@ web | | ├── error -- 错误 | | ├── example --上传案例 | | ├── iconList -- icon列表 - | | ├── init -- 初始化数据 + | | ├── init -- 初始化数据 | | | ├── index -- 新版本 | | | ├── init -- 旧版本 - | | ├── layout -- layout约束页面 - | | | ├── aside + | | ├── layout -- layout约束页面 + | | | ├── aside | | | ├── bottomInfo -- bottomInfo | | | ├── screenfull -- 全屏设置 | | | ├── setting -- 系统设置 | | | └── index.vue -- base 约束 - | | ├── login --登录 - | | ├── person --个人中心 + | | ├── login --登录 + | | ├── person --个人中心 | | ├── superAdmin -- 超级管理员操作 | | ├── system -- 系统检测页面 | | ├── systemTools -- 系统配置相关页面 - | | └── routerHolder.vue -- page 入口页面 + | | └── routerHolder.vue -- page 入口页面 ├── vite.config.js -- vite 配置文件 └── yarn.lock diff --git a/web/babel.config.js b/web/babel.config.js index 88029f0872..b1becff1a0 100644 --- a/web/babel.config.js +++ b/web/babel.config.js @@ -1,8 +1,4 @@ module.exports = { - presets: [ - - ], - 'plugins': [ - - ] + presets: [], + plugins: [] } diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs index eb1fb72981..3b443c5916 100644 --- a/web/eslint.config.mjs +++ b/web/eslint.config.mjs @@ -1,6 +1,6 @@ import js from '@eslint/js' import pluginVue from 'eslint-plugin-vue' -import globals from "globals" +import globals from 'globals' export default [ js.configs.recommended, @@ -10,20 +10,20 @@ export default [ files: ['**/*.{js,mjs,jsx,vue}'], languageOptions: { ecmaVersion: 'latest', - sourceType: "module", + sourceType: 'module', globals: globals.node }, rules: { - "vue/max-attributes-per-line" : 0, - "vue/no-v-model-argument" : 0, - "vue/multi-word-component-names": "off", + 'vue/max-attributes-per-line': 0, + 'vue/no-v-model-argument': 0, + 'vue/multi-word-component-names': 'off', 'no-lone-blocks': 'off', 'no-extend-native': 'off', - 'no-unused-vars': ['error', { "argsIgnorePattern": '^_' }], - }, + 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }] + } }, { name: 'app/files-to-ignore', - ignores: ['**/dist/**', '**/build/*.js', '**/src/assets/**', '**/public/**'], - }, + ignores: ['**/dist/**', '**/build/*.js', '**/src/assets/**', '**/public/**'] + } ] diff --git a/web/index.html b/web/index.html index 4dd71e5a31..1d8d87a24a 100644 --- a/web/index.html +++ b/web/index.html @@ -1,102 +1,115 @@ - + - - - - - - - + + + + + + - + - +
-
-
-
-
-
系统正在加载中,请稍候...
+
+
+
+
+
系统正在加载中,请稍候...
- - + diff --git a/web/jsconfig.json b/web/jsconfig.json index deaa520aa8..ca4501469a 100644 --- a/web/jsconfig.json +++ b/web/jsconfig.json @@ -1,10 +1,10 @@ { - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["src/*"] - } - }, - "exclude": ["node_modules", "dist"], - "include": ["src/**/*"] - } + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"], + "include": ["src/**/*"] +} diff --git a/web/package.json b/web/package.json index 741335c570..a12994ac05 100644 --- a/web/package.json +++ b/web/package.json @@ -1,73 +1,73 @@ { - "name": "gin-vue-admin", - "version": "2.7.7", - "private": true, - "scripts": { - "serve": "node openDocument.js && vite --host --mode development", - "build": "vite build --mode production", - "limit-build": "npm install increase-memory-limit-fixbug cross-env -g && npm run fix-memory-limit && node ./limit && npm run build", - "preview": "vite preview", - "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit" - }, - "dependencies": { - "@element-plus/icons-vue": "^2.3.1", - "@form-create/designer": "^3.2.6", - "@form-create/element-ui": "^3.2.10", - "@vue-office/docx": "^1.6.2", - "@vue-office/excel": "^1.7.11", - "@vue-office/pdf": "^2.0.2", - "@vueuse/core": "^11.0.3", - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "^5.1.12", - "ace-builds": "^1.36.4", - "axios": "^1.7.7", - "chokidar": "^4.0.0", - "core-js": "^3.38.1", - "default-passive-events": "^2.0.0", - "echarts": "5.5.1", - "element-plus": "^2.8.5", - "highlight.js": "^11.10.0", - "js-cookie": "^3.0.5", - "marked": "14.1.1", - "marked-highlight": "^2.1.4", - "mitt": "^3.0.1", - "nprogress": "^0.2.0", - "path": "^0.12.7", - "pinia": "^2.2.2", - "qs": "^6.13.0", - "screenfull": "^6.0.2", - "sortablejs": "^1.15.3", - "spark-md5": "^3.0.2", - "tailwindcss": "^3.4.10", - "vform3-builds": "^3.0.10", - "vite-auto-import-svg": "^1.1.0", - "vue": "^3.5.7", - "vue-echarts": "^7.0.3", - "vue-router": "^4.4.3", - "vue3-ace-editor": "^2.2.4", - "vuedraggable": "^4.1.0" - }, - "devDependencies": { - "@babel/eslint-parser": "^7.25.1", - "@eslint/js": "^9.14.0", - "@vitejs/plugin-legacy": "^5.4.2", - "@vitejs/plugin-vue": "^5.1.4", - "@vue/cli-plugin-babel": "~5.0.8", - "@vue/cli-plugin-eslint": "~5.0.8", - "@vue/cli-plugin-router": "~5.0.8", - "@vue/cli-plugin-vuex": "~5.0.8", - "@vue/cli-service": "~5.0.8", - "@vue/compiler-sfc": "^3.5.1", - "babel-plugin-import": "^1.13.8", - "chalk": "^5.3.0", - "dotenv": "^16.4.5", - "eslint": "^9.14.0", - "eslint-plugin-vue": "^9.30.0", - "sass": "^1.78.0", - "terser": "^5.31.6", - "vite": "^5.4.3", - "vite-plugin-banner": "^0.8.0", - "vite-plugin-importer": "^0.2.5", - "vite-plugin-vue-devtools": "^7.4.4" - } + "name": "gin-vue-admin", + "version": "2.7.7", + "private": true, + "scripts": { + "serve": "node openDocument.js && vite --host --mode development", + "build": "vite build --mode production", + "limit-build": "npm install increase-memory-limit-fixbug cross-env -g && npm run fix-memory-limit && node ./limit && npm run build", + "preview": "vite preview", + "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit" + }, + "dependencies": { + "@element-plus/icons-vue": "^2.3.1", + "@form-create/designer": "^3.2.6", + "@form-create/element-ui": "^3.2.10", + "@vue-office/docx": "^1.6.2", + "@vue-office/excel": "^1.7.11", + "@vue-office/pdf": "^2.0.2", + "@vueuse/core": "^11.0.3", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", + "ace-builds": "^1.36.4", + "axios": "^1.7.7", + "chokidar": "^4.0.0", + "core-js": "^3.38.1", + "default-passive-events": "^2.0.0", + "echarts": "5.5.1", + "element-plus": "^2.8.5", + "highlight.js": "^11.10.0", + "js-cookie": "^3.0.5", + "marked": "14.1.1", + "marked-highlight": "^2.1.4", + "mitt": "^3.0.1", + "nprogress": "^0.2.0", + "path": "^0.12.7", + "pinia": "^2.2.2", + "qs": "^6.13.0", + "screenfull": "^6.0.2", + "sortablejs": "^1.15.3", + "spark-md5": "^3.0.2", + "tailwindcss": "^3.4.10", + "vform3-builds": "^3.0.10", + "vite-auto-import-svg": "^1.1.0", + "vue": "^3.5.7", + "vue-echarts": "^7.0.3", + "vue-router": "^4.4.3", + "vue3-ace-editor": "^2.2.4", + "vuedraggable": "^4.1.0" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.25.1", + "@eslint/js": "^9.14.0", + "@vitejs/plugin-legacy": "^5.4.2", + "@vitejs/plugin-vue": "^5.1.4", + "@vue/cli-plugin-babel": "~5.0.8", + "@vue/cli-plugin-eslint": "~5.0.8", + "@vue/cli-plugin-router": "~5.0.8", + "@vue/cli-plugin-vuex": "~5.0.8", + "@vue/cli-service": "~5.0.8", + "@vue/compiler-sfc": "^3.5.1", + "babel-plugin-import": "^1.13.8", + "chalk": "^5.3.0", + "dotenv": "^16.4.5", + "eslint": "^9.14.0", + "eslint-plugin-vue": "^9.30.0", + "sass": "^1.78.0", + "terser": "^5.31.6", + "vite": "^5.4.3", + "vite-plugin-banner": "^0.8.0", + "vite-plugin-importer": "^0.2.5", + "vite-plugin-vue-devtools": "^7.4.4" + } } diff --git a/web/postcss.config.js b/web/postcss.config.js index 33ad091d26..85f717cc09 100644 --- a/web/postcss.config.js +++ b/web/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { plugins: { tailwindcss: {}, - autoprefixer: {}, - }, + autoprefixer: {} + } } diff --git a/web/src/App.vue b/web/src/App.vue index c4e7535f63..6048a3f5dc 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,5 +1,8 @@ diff --git a/web/src/api/api.js b/web/src/api/api.js index 17147b04e0..7eed8fc2bc 100644 --- a/web/src/api/api.js +++ b/web/src/api/api.js @@ -145,7 +145,6 @@ export const freshCasbin = () => { }) } - export const syncApi = () => { return service({ url: '/api/syncApi', @@ -153,7 +152,6 @@ export const syncApi = () => { }) } - export const getApiGroups = () => { return service({ url: '/api/getApiGroups', @@ -169,11 +167,10 @@ export const ignoreApi = (data) => { }) } - export const enterSyncApi = (data) => { return service({ url: '/api/enterSyncApi', method: 'post', data }) -} \ No newline at end of file +} diff --git a/web/src/api/authority.js b/web/src/api/authority.js index 61b22067aa..0401273206 100644 --- a/web/src/api/authority.js +++ b/web/src/api/authority.js @@ -19,7 +19,7 @@ export const deleteAuthority = (data) => { return service({ url: '/authority/deleteAuthority', method: 'post', - data, + data }) } diff --git a/web/src/api/authorityBtn.js b/web/src/api/authorityBtn.js index 9fe73bf426..e12db47125 100644 --- a/web/src/api/authorityBtn.js +++ b/web/src/api/authorityBtn.js @@ -1,4 +1,3 @@ - import service from '@/utils/request' export const getAuthorityBtnApi = (data) => { @@ -24,4 +23,3 @@ export const canRemoveAuthorityBtnApi = (params) => { params }) } - diff --git a/web/src/api/autoCode.js b/web/src/api/autoCode.js index 5443309025..016e687787 100644 --- a/web/src/api/autoCode.js +++ b/web/src/api/autoCode.js @@ -139,28 +139,26 @@ export const pubPlug = (params) => { }) } - export const llmAuto = (data) => { return service({ url: '/autoCode/llmAuto', method: 'post', - data:{...data,mode:'ai'}, + data: { ...data, mode: 'ai' }, timeout: 1000 * 60 * 10, - loadingOption:{ + loadingOption: { lock: true, - fullscreen:true, - text: `小淼正在思考,请稍候...`, + fullscreen: true, + text: `小淼正在思考,请稍候...` } }) } - export const butler = (data) => { return service({ url: '/autoCode/llmAuto', method: 'post', - data:{...data,mode:'butler'}, - timeout: 1000 * 60 * 10, + data: { ...data, mode: 'butler' }, + timeout: 1000 * 60 * 10 }) } diff --git a/web/src/api/github.js b/web/src/api/github.js index 4dc4eed586..38e1067034 100644 --- a/web/src/api/github.js +++ b/web/src/api/github.js @@ -4,7 +4,9 @@ const service = axios.create() export function Commits(page) { return service({ - url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page, + url: + 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + + page, method: 'get' }) } diff --git a/web/src/api/system.js b/web/src/api/system.js index 4dd5eca250..9395519a3a 100644 --- a/web/src/api/system.js +++ b/web/src/api/system.js @@ -53,4 +53,3 @@ export const reloadSystem = (data) => { data }) } - diff --git a/web/src/components/arrayCtrl/arrayCtrl.vue b/web/src/components/arrayCtrl/arrayCtrl.vue index 08b4ce219e..1296cf7a68 100644 --- a/web/src/components/arrayCtrl/arrayCtrl.vue +++ b/web/src/components/arrayCtrl/arrayCtrl.vue @@ -27,42 +27,41 @@ diff --git a/web/src/components/bottomInfo/bottomInfo.vue b/web/src/components/bottomInfo/bottomInfo.vue index c3c7e1e38a..376de05b6a 100644 --- a/web/src/components/bottomInfo/bottomInfo.vue +++ b/web/src/components/bottomInfo/bottomInfo.vue @@ -3,14 +3,17 @@ 未经授权的商用使用可能会被我们的资产搜索引擎爬取,并可能导致后续索赔。索赔金额将不低于高级授权费的十倍。请您遵守版权法律法规,尊重知识产权。 --> - - diff --git a/web/src/components/charts/index.vue b/web/src/components/charts/index.vue index 4ea5a75d17..089543482b 100644 --- a/web/src/components/charts/index.vue +++ b/web/src/components/charts/index.vue @@ -14,43 +14,41 @@ /> - diff --git a/web/src/components/commandMenu/index.vue b/web/src/components/commandMenu/index.vue index a36d174d20..3d3b72395b 100644 --- a/web/src/components/commandMenu/index.vue +++ b/web/src/components/commandMenu/index.vue @@ -10,20 +10,16 @@ v-model="searchInput" class="quick-input" placeholder="请输入你需要快捷到达的功能" - > + /> -
-
{{ option.label }}
+
+
+ {{ option.label }} +
@@ -40,158 +36,164 @@ diff --git a/web/src/components/customPic/index.vue b/web/src/components/customPic/index.vue index 63743d535d..6a265dee4c 100644 --- a/web/src/components/customPic/index.vue +++ b/web/src/components/customPic/index.vue @@ -1,28 +1,12 @@ - + diff --git a/web/src/components/selectFile/selectFile.vue b/web/src/components/selectFile/selectFile.vue index c7ae4afedf..e662f78d93 100644 --- a/web/src/components/selectFile/selectFile.vue +++ b/web/src/components/selectFile/selectFile.vue @@ -12,76 +12,70 @@ :accept="accept" class="upload-btn" > - - 上传文件 - + 上传文件
- diff --git a/web/src/components/selectImage/selectComponent.vue b/web/src/components/selectImage/selectComponent.vue index 1ff6e04cfc..6124531d1d 100644 --- a/web/src/components/selectImage/selectComponent.vue +++ b/web/src/components/selectImage/selectComponent.vue @@ -15,10 +15,15 @@ muted preload="metadata" > - + - 图片 + 图片