diff --git a/.eslintrc.json b/.eslintrc.json index 91e484b66a96f4720434f7d88f9213150bc0bcb7..f88927c69facfdbfdbad749af1b17470a738e230 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,15 +1,15 @@ { "root": true, - "parser": "@typescript-eslint/parser", + "parser": "vue-eslint-parser", "parserOptions": { - "ecmaVersion": 2020, + "parser": "@typescript-eslint/parser", + "extraFileExtensions": [".vue"], + "project": "./tsconfig.json", "sourceType": "module", - "project": ["./tsconfig.json"] + "ecmaVersion": "latest" }, "plugins": ["@typescript-eslint", "import", "prettier"], - "extends": [ - "prettier" - ], + "extends": ["prettier"], "settings": { "import/resolver": { "typescript": {} @@ -17,9 +17,13 @@ }, "rules": { "prettier/prettier": "error", - "@typescript-eslint/no-unused-vars": "error", "no-console": "warn", - "@typescript-eslint/prefer-optional-chain": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error" + "no-undef": "off", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "quotes": "off" + }, + "env": { + "browser": true, // 声明代码运行在浏览器环境 + "es2021": true // 启用 ES2021 全局变量 } } diff --git a/.gitignore b/.gitignore index 4b7c8707953847c9b01c76273fff3604a969aea9..5fe63fa59caca8c7c105e0de899147f57dde1604 100755 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ package-lock.json .gitee/ .npmrc .pnpm-lock.yaml +pnpm-lock.yaml diff --git a/.prettierrc.json b/.prettierrc.json index 23ab7bf6c97933f94a1d366ada25a8193fdb66d7..493e4f08bb0b9d58b7cd36c400246015ab865a7e 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,7 +3,7 @@ "tabWidth": 2, "useTabs": false, "semi": true, - "singleQuote": false, + "singleQuote": true, "trailingComma": "es5", "bracketSpacing": true, "bracketSameLine": true, diff --git a/commitlint.config.cjs b/commitlint.config.cjs index ef0d01994605fd990ac53022ff530cec1086be17..c12ee4e2db98e24d2a6cacd8c2bc7f6a438c43b2 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -21,10 +21,10 @@ module.exports = { 'ci', // 修改 CI 配置、脚本 'revert', // 回滚 commit 'chore', // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) - 'wip' // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) - ] + 'wip', // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) + ], ], - 'subject-case': [0] // subject大小写不做校验 + 'subject-case': [0], // subject大小写不做校验 }, prompt: { @@ -40,7 +40,7 @@ module.exports = { footer: '列举关联issue (可选) 例如: #31, #I3244 :\n', generatingByAI: '正在通过 AI 生成你的提交简短描述...', generatedSelectByAI: '选择一个 AI 生成的简短描述:', - confirmCommit: '是否提交或修改commit ?' + confirmCommit: '是否提交或修改commit ?', }, // prettier-ignore types: [ @@ -88,6 +88,6 @@ module.exports = { defaultBody: '', defaultIssues: '', defaultScope: '', - defaultSubject: '' - } + defaultSubject: '', + }, }; diff --git a/lint-staged.config.cjs b/lint-staged.config.cjs index c9a75fd0b978bd12eb38170f243ce54b31a5f8f5..774b22c4285d338ed2649f56eb2cc7d736812115 100644 --- a/lint-staged.config.cjs +++ b/lint-staged.config.cjs @@ -4,5 +4,5 @@ module.exports = { 'package.json': ['prettier --write'], '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'], '*.{scss,less,styl,html}': ['stylelint --fix --allow-empty-input', 'prettier --write '], - '*.md': ['prettier --write'] + '*.md': ['prettier --write'], }; diff --git a/package.json b/package.json index b12707cd44ebcac0e912fa19ffd99fbaa153f38c..ab97dd95cb5e97d5b0b720e6d3e5ab5e12752ad2 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@computing/opendesign2": "file:lib\\opendesign2-2.0.11.tgz", + "@computing/opendesign2": "file:lib/opendesign2-2.0.11.tgz", "@element-plus/icons-vue": "^2.3.1", "@stomp/stompjs": "^7.0.0", "@vueuse/core": "^10.11.1", @@ -72,8 +72,8 @@ "devDependencies": { "@commitlint/cli": "^18.6.1", "@commitlint/config-conventional": "^18.6.3", - "@computing/opendesign-icons": "file:lib\\opendesign-icons-1.0.3.tgz", - "@computing/opendesign2": "file:lib\\opendesign2-2.0.11.tgz", + "@computing/opendesign-icons": "file:lib/opendesign-icons-1.0.3.tgz", + "@computing/opendesign2": "file:lib/opendesign2-2.0.11.tgz", "@iconify-json/ep": "^1.1.16", "@types/codemirror": "^5.60.15", "@types/color": "^3.0.6", @@ -121,6 +121,7 @@ "vite-plugin-mock-dev-server": "^1.7.1", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-devtools": "^7.3.8", + "vue-eslint-parser": "^10.1.1", "vue-tsc": "^2.0.29" }, "license": "MIT", diff --git a/src/App.vue b/src/App.vue index 0a538aaf6130d1bf81e1594da7e5bc5e76d16172..d38fc96e219808cd79283a0145396070b698237c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ import router from './router'; const locale = computed(() => appStore.locale); onMounted(() => { - window.addEventListener('beforeunload', (e) => { + window.addEventListener('beforeunload', () => { sessionStorage.setItem('beforeunload', '1'); }); // 监听页面刷新 diff --git a/src/api/auth.ts b/src/api/auth.ts index ef2713372dad21ab832439f6f6bca3f08d3d78a9..05444899815af939ae912ef5a9c53d3f916748e0 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -9,7 +9,7 @@ class AuthAPI { return request({ url: `/user/add`, method: 'post', - data: newData + data: newData, }); } @@ -20,7 +20,7 @@ class AuthAPI { return request({ url: `/user/login`, method: 'get', - params: newData + params: newData, }); } @@ -28,7 +28,7 @@ class AuthAPI { static logout() { return request({ url: `/user/logout`, - method: 'get' + method: 'get', }); } @@ -37,7 +37,7 @@ class AuthAPI { return request({ url: `/user/update`, method: 'post', - data: data + data: data, }); } } diff --git a/src/api/kbApp.ts b/src/api/kbApp.ts index 5dbf70f53c7a27b8d7a45019c95cacd9e8c825e6..2a2822f8dd7d959baf90ec9c59ba77d88ba5367c 100644 --- a/src/api/kbApp.ts +++ b/src/api/kbApp.ts @@ -8,7 +8,7 @@ class KbAppAPI { return request({ url: `/kb/list`, method: 'post', - data: data + data: data, }); } @@ -17,7 +17,7 @@ class KbAppAPI { return request({ url: `/kb/rm`, method: 'post', - data: data + data: data, }); } @@ -26,7 +26,7 @@ class KbAppAPI { return request({ url: `/kb/create`, method: 'post', - data: data + data: data, }); } @@ -35,7 +35,7 @@ class KbAppAPI { return request({ url: `/kb/update`, method: 'post', - data: data + data: data, }); } @@ -44,7 +44,7 @@ class KbAppAPI { return request({ url: `/kb/task/list`, method: 'post', - data: data + data: data, }); } @@ -52,7 +52,7 @@ class KbAppAPI { return request({ url: `/kb/task/rm`, method: 'post', - data: data + data: data, }); } @@ -63,14 +63,14 @@ class KbAppAPI { method: 'post', data: payload.data, headers: { - 'Content-Type': 'multipart/form-data' + 'Content-Type': 'multipart/form-data', }, onUploadProgress(e) { const rate = Math.floor((e.loaded / (e.total as number)) * 100); if (rate < 100) { options.onProgress(rate); } - } + }, }); } @@ -80,7 +80,7 @@ class KbAppAPI { return request({ url: `/kb/export`, data: { - id + id, }, method: 'post', onUploadProgress(e) { @@ -88,7 +88,7 @@ class KbAppAPI { if (rate < 100) { options.onProgress(rate); } - } + }, }); } @@ -97,30 +97,30 @@ class KbAppAPI { return request({ url: `/kb/download`, data: { - id: fileId + id: fileId, }, - method: 'post' + method: 'post', }); } static queryLanguageList() { return request({ url: `/kb/language`, - method: 'get' + method: 'get', }); } static queryEmbeddingModelList() { return request({ url: `/other/embedding_model`, - method: 'get' + method: 'get', }); } static queryParseMethodList() { return request({ url: `/other/parse_method`, - method: 'get' + method: 'get', }); } @@ -129,21 +129,21 @@ class KbAppAPI { return request({ url: `/model/update`, method: 'post', - data: data + data: data, }); } static getdUserModel() { return request({ url: `/model/get`, - method: 'get' + method: 'get', }); } static localModelList() { return request({ url: `/model/list`, - method: 'get' + method: 'get', }); } } diff --git a/src/api/kfApp.ts b/src/api/kfApp.ts index 40580edd60be28155e2114b662a3f341dd02228d..f94c938d19ef7f7f8fafe6bc56ef3c30d81a9759 100644 --- a/src/api/kfApp.ts +++ b/src/api/kfApp.ts @@ -7,7 +7,7 @@ class KfAppAPI { return request({ url: `/doc/list`, method: 'post', - data: data + data: data, }); } /** 修改资产库里的文件*/ @@ -15,7 +15,7 @@ class KfAppAPI { return request({ url: `/doc/update`, method: 'post', - data: data + data: data, }); } @@ -24,7 +24,7 @@ class KfAppAPI { return request({ url: `/doc/switch`, method: 'post', - data: data + data: data, }); } @@ -33,7 +33,7 @@ class KfAppAPI { return request({ url: `/doc/rm`, method: 'post', - data: data + data: data, }); } @@ -42,7 +42,7 @@ class KfAppAPI { return request({ url: `/doc/run`, method: 'post', - data: data + data: data, }); } @@ -53,14 +53,14 @@ class KfAppAPI { method: 'post', data: payload.data, headers: { - 'Content-Type': 'multipart/form-data' + 'Content-Type': 'multipart/form-data', }, onUploadProgress(e) { const rate = Math.floor((e.loaded / (e.total as number)) * 100); if (rate < 100) { options.onProgress(rate); } - } + }, }); } @@ -69,7 +69,7 @@ class KfAppAPI { return request({ url: `/doc/download`, method: 'post', - data: data + data: data, }); } @@ -78,7 +78,7 @@ class KfAppAPI { return request({ url: `/doc/task/list`, method: 'post', - data: data + data: data, }); } @@ -86,7 +86,7 @@ class KfAppAPI { return request({ url: `/doc/task/stop`, method: 'post', - data: data + data: data, }); } @@ -95,7 +95,7 @@ class KfAppAPI { return request({ url: `/chunk/list`, method: 'post', - data: data + data: data, }); } @@ -104,7 +104,7 @@ class KfAppAPI { return request({ url: `/chunk/switch`, method: 'post', - data: data + data: data, }); } } diff --git a/src/api/menu.ts b/src/api/menu.ts index f38f810d2dd371f439c0c01806fe3d2cc54e5148..485d3378cec69c928afa59ca26d00f272834300c 100644 --- a/src/api/menu.ts +++ b/src/api/menu.ts @@ -13,7 +13,7 @@ class MenuAPI { static getRoutes() { return request({ url: `${MENU_BASE_URL}/routes`, - method: 'get' + method: 'get', }); } } diff --git a/src/api/user.ts b/src/api/user.ts index 87d0f2d4a08d5f4ae584847367c3cbe2c39b7e84..5b768e71c7256d0707695d1d9ec0edb47b2c7e37 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -11,7 +11,7 @@ class UserAPI { static getInfo() { return request({ url: `${USER_BASE_URL}/me`, - method: 'get' + method: 'get', }); } } diff --git a/src/components/CustomLoading/index.vue b/src/components/CustomLoading/index.vue index c705c5415897d4ff7188ce20ebc6b2fb6eec9029..55aba1903b91a3e96bb6ec481483321566225312 100644 --- a/src/components/CustomLoading/index.vue +++ b/src/components/CustomLoading/index.vue @@ -6,19 +6,6 @@ :element-loading-text="loadingText || `${$t('pageTipText.Loading')}...`" element-loading-background="rgba(122, 122, 122, 0.5)"> -