diff --git a/web/.prettierrc b/web/.prettierrc new file mode 100644 index 000000000..bc61a53e1 --- /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 2e882ae9b..06f1a8cce 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 88029f087..b1becff1a 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 eb1fb7298..3b443c591 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/jsconfig.json b/web/jsconfig.json index deaa520aa..ca4501469 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/postcss.config.js b/web/postcss.config.js index 33ad091d2..85f717cc0 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/api/api.js b/web/src/api/api.js index 17147b04e..7eed8fc2b 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 61b22067a..040127320 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 9fe73bf42..e12db4712 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 544330902..016e68778 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 4dc4eed58..38e106703 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 4dd5eca25..9395519a3 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/charts/index.vue b/web/src/components/charts/index.vue index 4ea5a75d1..089543482 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/customPic/index.vue b/web/src/components/customPic/index.vue index 63743d535..6a265dee4 100644 --- a/web/src/components/customPic/index.vue +++ b/web/src/components/customPic/index.vue @@ -1,28 +1,12 @@ - + diff --git a/web/src/view/dashboard/components/charts-people-numbers.vue b/web/src/view/dashboard/components/charts-people-numbers.vue index a7013f20e..3d10b3fab 100644 --- a/web/src/view/dashboard/components/charts-people-numbers.vue +++ b/web/src/view/dashboard/components/charts-people-numbers.vue @@ -11,131 +11,128 @@ - + diff --git a/web/src/view/dashboard/components/charts.vue b/web/src/view/dashboard/components/charts.vue index 3bcf5a9ed..650b5f13f 100644 --- a/web/src/view/dashboard/components/charts.vue +++ b/web/src/view/dashboard/components/charts.vue @@ -11,7 +11,7 @@ -
+
@@ -20,7 +20,7 @@ +80%
-
+
@@ -31,28 +31,24 @@ - + diff --git a/web/src/view/dashboard/components/index.js b/web/src/view/dashboard/components/index.js index 23cc04a76..a59985be7 100644 --- a/web/src/view/dashboard/components/index.js +++ b/web/src/view/dashboard/components/index.js @@ -1,19 +1,19 @@ -import GvaBanner from "./banner.vue" -import GvaCard from "./card.vue" -import GvaChart from "./charts.vue" -import GvaTable from "./table.vue" -import GvaNotice from "./notice.vue" -import GvaQuickLink from "./quickLinks.vue" -import GvaWiki from "./wiki.vue" -import GvaPluginTable from "./pluginTable.vue" +import GvaBanner from './banner.vue' +import GvaCard from './card.vue' +import GvaChart from './charts.vue' +import GvaTable from './table.vue' +import GvaNotice from './notice.vue' +import GvaQuickLink from './quickLinks.vue' +import GvaWiki from './wiki.vue' +import GvaPluginTable from './pluginTable.vue' export { - GvaBanner, - GvaCard, - GvaChart, - GvaTable, - GvaNotice, - GvaQuickLink, - GvaWiki, - GvaPluginTable + GvaBanner, + GvaCard, + GvaChart, + GvaTable, + GvaNotice, + GvaQuickLink, + GvaWiki, + GvaPluginTable } diff --git a/web/src/view/error/reload.vue b/web/src/view/error/reload.vue index 2504c55f0..1fd027e66 100644 --- a/web/src/view/error/reload.vue +++ b/web/src/view/error/reload.vue @@ -3,12 +3,12 @@ diff --git a/web/src/view/example/index.vue b/web/src/view/example/index.vue index 8b322d621..0c3b58dde 100644 --- a/web/src/view/example/index.vue +++ b/web/src/view/example/index.vue @@ -1,10 +1,7 @@ diff --git a/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue b/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue index 678683fa5..b9c4bf4b8 100644 --- a/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue +++ b/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue @@ -7,9 +7,9 @@ diff --git a/web/src/view/layout/aside/asideComponent/index.vue b/web/src/view/layout/aside/asideComponent/index.vue index 8558655ab..32e7d4186 100644 --- a/web/src/view/layout/aside/asideComponent/index.vue +++ b/web/src/view/layout/aside/asideComponent/index.vue @@ -4,7 +4,7 @@ v-if="!routerInfo.hidden" :router-info="routerInfo" > - - - + diff --git a/web/src/view/layout/aside/combinationMode.vue b/web/src/view/layout/aside/combinationMode.vue index f8a934188..22c6c38df 100644 --- a/web/src/view/layout/aside/combinationMode.vue +++ b/web/src/view/layout/aside/combinationMode.vue @@ -1,12 +1,15 @@