From 8c1f0ebeec4617f222f55d6bcae5c0ce3bb23a82 Mon Sep 17 00:00:00 2001 From: ulleo Date: Thu, 12 Jun 2025 12:09:30 +0800 Subject: [PATCH] feat: eslint --- frontend/.eslintignore | 4 +- frontend/.eslintrc.js | 2 +- frontend/eslint.config.cjs | 59 +++ frontend/package.json | 12 +- frontend/src/App.vue | 4 +- frontend/src/api/auth.ts | 5 +- frontend/src/api/chat.ts | 349 ++++++++++------ frontend/src/api/dashboard.ts | 21 +- frontend/src/api/datasource.ts | 21 +- frontend/src/api/login.ts | 20 +- frontend/src/api/setting.ts | 7 +- frontend/src/api/system.ts | 5 +- .../components/Language-selector/index.vue | 13 +- frontend/src/components/icon-custom/index.ts | 2 +- .../src/components/icon-custom/src/Icon.vue | 16 +- frontend/src/components/layout/SinglePage.vue | 4 +- frontend/src/components/layout/index.vue | 119 +++--- frontend/src/entity/CommonEntity.ts | 5 +- frontend/src/i18n/index.ts | 10 +- frontend/src/router/index.ts | 96 ++--- frontend/src/stores/dashboard/dashboard.ts | 136 +++---- frontend/src/stores/dashboard/snapshot.ts | 248 ++++++------ frontend/src/utils/canvas.ts | 75 ++-- frontend/src/utils/date.ts | 2 +- frontend/src/utils/request.ts | 67 ++- frontend/src/utils/useCache.ts | 4 +- frontend/src/utils/utils.ts | 40 +- frontend/src/views/WelcomeView.vue | 8 +- frontend/src/views/chat/ChatAnswer.vue | 153 +++---- frontend/src/views/chat/ChatBlock.vue | 8 +- frontend/src/views/chat/ChatList.vue | 157 ++++---- frontend/src/views/chat/ChatRow.vue | 44 +- frontend/src/views/chat/WelcomeBlock.vue | 64 +-- .../src/views/chat/component/BaseChart.ts | 42 +- .../src/views/chat/component/BaseG2Chart.ts | 47 +-- .../views/chat/component/ChartComponent.vue | 62 +-- .../src/views/chat/component/charts/Bar.ts | 56 ++- .../src/views/chat/component/charts/Column.ts | 56 ++- .../src/views/chat/component/charts/Line.ts | 70 ++-- .../src/views/chat/component/charts/Pie.ts | 48 +-- .../src/views/chat/component/charts/Table.ts | 122 +++--- frontend/src/views/chat/component/index.ts | 45 +-- frontend/src/views/chat/index.vue | 380 +++++++++--------- frontend/src/views/chat/typed.ts | 89 ++-- .../src/views/dashboard/canvas/CanvasCore.vue | 252 ++++++------ .../views/dashboard/canvas/CanvasShape.vue | 53 ++- .../src/views/dashboard/canvas/DragHandle.vue | 24 +- .../views/dashboard/canvas/ResizeHandle.vue | 23 +- .../dashboard/common/DashboardDetailInfo.vue | 9 +- .../dashboard/common/EmptyBackground.vue | 12 +- .../src/views/dashboard/common/HandleMore.vue | 54 ++- .../dashboard/common/ResourceGroupOpt.vue | 135 +++---- .../views/dashboard/common/ResourceTree.vue | 174 ++++---- .../button-label/ComponentButtonLabel.vue | 18 +- .../dashboard/components/component-list.ts | 118 +++--- .../dashboard/components/sq-empty/index.vue | 10 +- .../dashboard/components/sq-tab/CustomTab.vue | 32 +- .../dashboard/components/sq-tab/index.vue | 122 +++--- .../dashboard/components/sq-text/index.vue | 55 +-- .../dashboard/components/sq-view/index.vue | 12 +- .../dashboard/editor/DashboardEditor.vue | 68 ++-- .../src/views/dashboard/editor/Toolbar.vue | 121 +++--- frontend/src/views/dashboard/editor/index.vue | 42 +- frontend/src/views/dashboard/index.vue | 2 +- .../dashboard/preview/SQComponentWrapper.vue | 39 +- .../src/views/dashboard/preview/SQPreview.vue | 83 ++-- .../views/dashboard/preview/SQPreviewHead.vue | 22 +- .../views/dashboard/preview/SQPreviewShow.vue | 93 ++--- .../dashboard/preview/SQPreviewSingle.vue | 80 ++-- .../src/views/dashboard/preview/index.vue | 12 +- .../src/views/dashboard/utils/canvasUtils.ts | 141 +++---- .../dashboard/utils/treeDraggableChart.ts | 41 +- .../views/dashboard/utils/treeSortUtils.ts | 10 +- frontend/src/views/ds/DatasourceItemCard.vue | 30 +- frontend/src/views/ds/TableList.vue | 13 +- frontend/src/views/ds/form.vue | 18 +- frontend/src/views/ds/index.vue | 6 +- frontend/src/views/ds/js/aes.ts | 10 +- frontend/src/views/ds/js/ds-type.ts | 16 +- frontend/src/views/login/index.vue | 30 +- frontend/src/views/setting/Professional.vue | 66 +-- frontend/src/views/setting/index.vue | 16 +- frontend/src/views/system/model/index.vue | 132 +++--- frontend/src/views/system/user/index.vue | 68 ++-- frontend/src/views/work/DatasourceCard.vue | 16 +- frontend/src/views/work/index.vue | 46 +-- frontend/vite.config.ts | 8 +- 87 files changed, 2640 insertions(+), 2489 deletions(-) create mode 100644 frontend/eslint.config.cjs diff --git a/frontend/.eslintignore b/frontend/.eslintignore index 653c9a55..87337b4c 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -5,4 +5,6 @@ *.woff *.ttf .vscode/ -.DS_Store \ No newline at end of file +.DS_Store +eslint.config.cjs +.eslintrc.js diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index c382badf..c7c7db27 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -30,4 +30,4 @@ module.exports = { }, ], }, -} \ No newline at end of file +} diff --git a/frontend/eslint.config.cjs b/frontend/eslint.config.cjs new file mode 100644 index 00000000..b98d8374 --- /dev/null +++ b/frontend/eslint.config.cjs @@ -0,0 +1,59 @@ +const { globalIgnores } = require('eslint/config') +const eslint = require('@eslint/js') +const eslintConfigPrettier = require('eslint-config-prettier') +const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended') +const eslintPluginVue = require('eslint-plugin-vue') +const globals = require('globals') +const typescriptEslint = require('typescript-eslint') + +module.exports = typescriptEslint.config( + { + languageOptions: { + globals: globals.browser, + ecmaVersion: 'latest', + parserOptions: { + parser: typescriptEslint.parser, + }, + }, + + extends: [ + eslint.configs.recommended, + ...typescriptEslint.configs.recommended, + ...eslintPluginVue.configs['flat/recommended'], + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'vue/multi-word-component-names': 'off', + 'vue/no-required-prop-with-default': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'warn', + + 'prettier/prettier': [ + 'warn', + { + singleQuote: true, + semi: false, + trailingComma: 'es5', + printWidth: 100, + tabWidth: 2, + endOfLine: 'auto', + }, + ], + }, + }, + globalIgnores([ + 'node_modules/', + 'dist/', + 'public/', + 'eslint.config.cjs', + '.eslintrc.js', + '**/*.md', + '**/*.woff', + '**/*.ttf', + '**/.vscode/', + '**/.DS_Store', + ]), + eslintConfigPrettier, + eslintPluginPrettierRecommended +) diff --git a/frontend/package.json b/frontend/package.json index 32b888a6..fbe51e57 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,10 +3,17 @@ "private": true, "version": "0.0.0", "type": "module", + "eslintConfig": { + "env": { + "browser": true, + "node": true + } + }, "scripts": { "dev": "vite", "build": "vue-tsc -b && vite build", - "preview": "vite preview" + "preview": "vite preview", + "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix" }, "dependencies": { "@antv/g2": "^5.3.3", @@ -28,6 +35,7 @@ }, "devDependencies": { "@element-plus/icons-vue": "^2.3.1", + "@eslint/migrate-config": "^1.5.0", "@types/crypto-js": "^4.2.2", "@types/element-resize-detector": "^1.1.6", "@types/node": "^22.14.1", @@ -41,10 +49,12 @@ "eslint-config-prettier": "^10.1.5", "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-vue": "^10.2.0", + "globals": "^16.2.0", "less": "^4.3.0", "pinia": "^3.0.2", "prettier": "^3.5.3", "typescript": "~5.7.2", + "typescript-eslint": "^8.34.0", "unplugin-auto-import": "^19.1.2", "unplugin-vue-components-secondary": "^0.24.6", "vite": "^6.3.1", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 0fa537bd..1b72c0f3 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -13,6 +13,4 @@ const elLanguage = computed(() => { - + diff --git a/frontend/src/api/auth.ts b/frontend/src/api/auth.ts index 3850463c..e44062e9 100644 --- a/frontend/src/api/auth.ts +++ b/frontend/src/api/auth.ts @@ -1,10 +1,11 @@ import { request } from '@/utils/request' export const userApi = { - pager: (pageNumber: number, pageSize: number) => request.get(`/user/pager/${pageNumber}/${pageSize}`), + pager: (pageNumber: number, pageSize: number) => + request.get(`/user/pager/${pageNumber}/${pageSize}`), add: (data: any) => request.post('/settings/terminology', data), edit: (data: any) => request.put('/settings/terminology', data), delete: (id: number) => request.delete(`/settings/terminology/${id}`), query: (id: number) => request.get(`/settings/terminology/${id}`), language: (data: any) => request.put('/user/language', data), -} \ No newline at end of file +} diff --git a/frontend/src/api/chat.ts b/frontend/src/api/chat.ts index 8660b22d..d2134377 100644 --- a/frontend/src/api/chat.ts +++ b/frontend/src/api/chat.ts @@ -1,185 +1,276 @@ -import {request} from '@/utils/request' -import {getDate} from "@/utils/utils.ts"; +import { request } from '@/utils/request' +import { getDate } from '@/utils/utils.ts' export const questionApi = { - - pager: (pageNumber: number, pageSize: number) => request.get(`/chat/question/pager/${pageNumber}/${pageSize}`), - /* add: (data: any) => new Promise((resolve, reject) => { + pager: (pageNumber: number, pageSize: number) => + request.get(`/chat/question/pager/${pageNumber}/${pageSize}`), + /* add: (data: any) => new Promise((resolve, reject) => { request.post('/chat/question', data, { responseType: 'stream', timeout: 0, onDownloadProgress: p => { resolve(p) }}).catch(e => reject(e)) }), */ - // add: (data: any) => request.post('/chat/question', data), - add: (data: any) => request.fetchStream('/chat/question', data), - edit: (data: any) => request.put('/chat/question', data), - delete: (id: number) => request.delete(`/chat/question/${id}`), - query: (id: number) => request.get(`/chat/question/${id}`) + // add: (data: any) => request.post('/chat/question', data), + add: (data: any) => request.fetchStream('/chat/question', data), + edit: (data: any) => request.put('/chat/question', data), + delete: (id: number) => request.delete(`/chat/question/${id}`), + query: (id: number) => request.get(`/chat/question/${id}`), } export interface ChatMessage { - role: 'user' | 'assistant' - create_time?: Date | string - content?: string | number - record?: ChatRecord - isTyping?: boolean - isWelcome?: boolean + role: 'user' | 'assistant' + create_time?: Date | string + content?: string | number + record?: ChatRecord + isTyping?: boolean + isWelcome?: boolean } export class ChatRecord { - id?: number - chat_id?: number - create_time?: Date | string - finish_time?: Date | string - question?: string - sql_answer?: string - sql?: string - data?: string - chart_answer?: string - chart?: string - finish?: boolean = false - error?: string - run_time: number = 0 + id?: number + chat_id?: number + create_time?: Date | string + finish_time?: Date | string + question?: string + sql_answer?: string + sql?: string + data?: string + chart_answer?: string + chart?: string + finish?: boolean = false + error?: string + run_time: number = 0 - constructor() - constructor(id: number, chat_id: number, create_time: Date | string, finish_time: Date | string | undefined, question: string, sql_answer: string | undefined, sql: string | undefined, data: string | undefined, chart_answer: string | undefined, chart: string | undefined, finish: boolean, error: string | undefined, run_time: number) - constructor(id?: number, chat_id?: number, create_time?: Date | string, finish_time?: Date | string, question?: string, sql_answer?: string, sql?: string, data?: string, chart_answer?: string, chart?: string, finish?: boolean, error?: string, run_time?: number) { - this.id = id - this.chat_id = chat_id - this.create_time = getDate(create_time) - this.finish_time = getDate(finish_time) - this.question = question - this.sql_answer = sql_answer - this.sql = sql - this.data = data - this.chart_answer = chart_answer - this.chart = chart - this.finish = finish - this.error = error - this.run_time = run_time ?? 0 - } + constructor() + constructor( + id: number, + chat_id: number, + create_time: Date | string, + finish_time: Date | string | undefined, + question: string, + sql_answer: string | undefined, + sql: string | undefined, + data: string | undefined, + chart_answer: string | undefined, + chart: string | undefined, + finish: boolean, + error: string | undefined, + run_time: number + ) + constructor( + id?: number, + chat_id?: number, + create_time?: Date | string, + finish_time?: Date | string, + question?: string, + sql_answer?: string, + sql?: string, + data?: string, + chart_answer?: string, + chart?: string, + finish?: boolean, + error?: string, + run_time?: number + ) { + this.id = id + this.chat_id = chat_id + this.create_time = getDate(create_time) + this.finish_time = getDate(finish_time) + this.question = question + this.sql_answer = sql_answer + this.sql = sql + this.data = data + this.chart_answer = chart_answer + this.chart = chart + this.finish = finish + this.error = error + this.run_time = run_time ?? 0 + } } export class Chat { - id?: number - create_time?: Date | string - create_by?: number - brief?: string - chat_type?: string - datasource?: number - engine_type?: string + id?: number + create_time?: Date | string + create_by?: number + brief?: string + chat_type?: string + datasource?: number + engine_type?: string - constructor() - constructor(id: number, create_time: Date | string, create_by: number, brief: string, chat_type: string, datasource: number, engine_type: string) - constructor(id?: number, create_time?: Date | string, create_by?: number, brief?: string, chat_type?: string, datasource?: number, engine_type?: string) { - this.id = id + constructor() + constructor( + id: number, + create_time: Date | string, + create_by: number, + brief: string, + chat_type: string, + datasource: number, + engine_type: string + ) + constructor( + id?: number, + create_time?: Date | string, + create_by?: number, + brief?: string, + chat_type?: string, + datasource?: number, + engine_type?: string + ) { + this.id = id + this.create_time = getDate(create_time) + this.create_by = create_by + this.brief = brief + this.chat_type = chat_type + this.datasource = datasource + this.engine_type = engine_type + } +} + +export class ChatInfo extends Chat { + datasource_name?: string + datasource_exists: boolean = true + records: Array = [] + + constructor() + constructor(chat: Chat) + constructor( + id: number, + create_time: Date | string, + create_by: number, + brief: string, + chat_type: string, + datasource: number, + engine_type: string, + datasource_name: string, + datasource_exists: boolean, + records: Array + ) + constructor( + param1?: number | Chat, + create_time?: Date | string, + create_by?: number, + brief?: string, + chat_type?: string, + datasource?: number, + engine_type?: string, + datasource_name?: string, + datasource_exists: boolean = true, + records: Array = [] + ) { + super() + if (param1 !== undefined) { + if (param1 instanceof Chat) { + this.id = param1.id + this.create_time = getDate(param1.create_time) + this.create_by = param1.create_by + this.brief = param1.brief + this.chat_type = param1.chat_type + this.datasource = param1.datasource + this.engine_type = param1.engine_type + } else { + this.id = param1 this.create_time = getDate(create_time) this.create_by = create_by this.brief = brief this.chat_type = chat_type this.datasource = datasource this.engine_type = engine_type + } } -} - -export class ChatInfo extends Chat { - datasource_name?: string - datasource_exists: boolean = true - records: Array = [] - - constructor() - constructor(chat: Chat) - constructor(id: number, create_time: Date | string, create_by: number, brief: string, chat_type: string, datasource: number, engine_type: string, datasource_name: string, datasource_exists: boolean, records: Array) - constructor(param1?: number | Chat, create_time?: Date | string, create_by?: number, brief?: string, chat_type?: string, datasource?: number, engine_type?: string, datasource_name?: string, datasource_exists: boolean = true, records: Array = []) { - super() - if (param1 !== undefined) { - if (param1 instanceof Chat) { - this.id = param1.id - this.create_time = getDate(param1.create_time) - this.create_by = param1.create_by - this.brief = param1.brief - this.chat_type = param1.chat_type - this.datasource = param1.datasource - this.engine_type = param1.engine_type - } else { - this.id = param1 - this.create_time = getDate(create_time) - this.create_by = create_by - this.brief = brief - this.chat_type = chat_type - this.datasource = datasource - this.engine_type = engine_type - } - } - this.datasource_name = datasource_name - this.datasource_exists = datasource_exists - this.records = records - } + this.datasource_name = datasource_name + this.datasource_exists = datasource_exists + this.records = records + } } function toChatRecord(data?: any): ChatRecord | undefined { - if (!data) { - return undefined - } - return new ChatRecord(data.id, data.chat_id, data.create_time, data.finish_time, data.question, data.sql_answer, data.sql, data.data, data.chart_answer, data.chart, data.finish, data.error, data.run_time) + if (!data) { + return undefined + } + return new ChatRecord( + data.id, + data.chat_id, + data.create_time, + data.finish_time, + data.question, + data.sql_answer, + data.sql, + data.data, + data.chart_answer, + data.chart, + data.finish, + data.error, + data.run_time + ) } function toChatRecordList(list: any = []): ChatRecord[] { - const records: Array = [] - for (let i = 0; i < list.length; i++) { - const record = toChatRecord(list[i]) - if (record) { - records.push(record) - } + const records: Array = [] + for (let i = 0; i < list.length; i++) { + const record = toChatRecord(list[i]) + if (record) { + records.push(record) } - return records + } + return records } function toChatInfo(data?: any): ChatInfo | undefined { - if (!data) { - return undefined - } - return new ChatInfo(data.id, data.create_time, data.create_by, data.brief, data.chat_type, data.datasource, data.engine_type, data.datasource_name, data.datasource_exists, toChatRecordList(data.records)) + if (!data) { + return undefined + } + return new ChatInfo( + data.id, + data.create_time, + data.create_by, + data.brief, + data.chat_type, + data.datasource, + data.engine_type, + data.datasource_name, + data.datasource_exists, + toChatRecordList(data.records) + ) } function toChatInfoList(list: any[] = []): ChatInfo[] { - const infos: Array = [] - for (let i = 0; i < list.length; i++) { - const chatInfo = toChatInfo(list[i]) - if (chatInfo) { - infos.push(chatInfo) - } + const infos: Array = [] + for (let i = 0; i < list.length; i++) { + const chatInfo = toChatInfo(list[i]) + if (chatInfo) { + infos.push(chatInfo) } - return infos + } + return infos } function list(): Promise> { - return request.get('/chat/list') + return request.get('/chat/list') } function get(id: number): Promise { - return request.get(`/chat/get/${id}`) + return request.get(`/chat/get/${id}`) } function startChat(data: any): Promise { - return request.post('/chat/start', data) + return request.post('/chat/start', data) } function renameChat(chat_id: number | undefined, brief: string): Promise { - return request.post('/chat/rename', {id: chat_id, brief: brief}) + return request.post('/chat/rename', { id: chat_id, brief: brief }) } function deleteChat(id: number | undefined): Promise { - return request.get(`/chat/delete/${id}`) + return request.get(`/chat/delete/${id}`) } export const chatApi = { - toChatRecord, - toChatRecordList, - toChatInfo, - toChatInfoList, - list, - get, - startChat, - renameChat, - deleteChat -} \ No newline at end of file + toChatRecord, + toChatRecordList, + toChatInfo, + toChatInfoList, + list, + get, + startChat, + renameChat, + deleteChat, +} diff --git a/frontend/src/api/dashboard.ts b/frontend/src/api/dashboard.ts index a7fe8fe2..f19ae1b8 100644 --- a/frontend/src/api/dashboard.ts +++ b/frontend/src/api/dashboard.ts @@ -1,13 +1,14 @@ import { request } from '@/utils/request' export const dashboardApi = { - list_resource: (params: any) => request.post('/dashboard/list_resource',params), - load_resource: (params:any) => request.post('/dashboard/load_resource',params), - create_resource: (params: any) => request.post('/dashboard/create_resource',params), - update_resource: (params: any) => request.post('/dashboard/update_resource',params), - create_canvas: (params: any) => request.post('/dashboard/create_canvas',params), - update_canvas: (params: any) => request.post('/dashboard/update_canvas',params), - check_name: (params: any) => request.post('/dashboard/check_name',params), - delete_resource: (params: any) => request.delete(`/dashboard/delete_resource/${params.id}`,params), - move_resource: (params: any) => request.delete(`/dashboard/move_resource/${params.id}`,params), -} \ No newline at end of file + list_resource: (params: any) => request.post('/dashboard/list_resource', params), + load_resource: (params: any) => request.post('/dashboard/load_resource', params), + create_resource: (params: any) => request.post('/dashboard/create_resource', params), + update_resource: (params: any) => request.post('/dashboard/update_resource', params), + create_canvas: (params: any) => request.post('/dashboard/create_canvas', params), + update_canvas: (params: any) => request.post('/dashboard/update_canvas', params), + check_name: (params: any) => request.post('/dashboard/check_name', params), + delete_resource: (params: any) => + request.delete(`/dashboard/delete_resource/${params.id}`, params), + move_resource: (params: any) => request.delete(`/dashboard/move_resource/${params.id}`, params), +} diff --git a/frontend/src/api/datasource.ts b/frontend/src/api/datasource.ts index 151faeb9..74ca09ea 100644 --- a/frontend/src/api/datasource.ts +++ b/frontend/src/api/datasource.ts @@ -5,17 +5,18 @@ export const datasourceApi = { add: (data: any) => request.post('/datasource/add', data), list: () => request.get('/datasource/list'), update: (data: any) => request.post('/datasource/update', data), - delete: (id: Number) => request.post(`/datasource/delete/${id}`), - getTables: (id: Number) => request.post(`/datasource/getTables/${id}`), + delete: (id: number) => request.post(`/datasource/delete/${id}`), + getTables: (id: number) => request.post(`/datasource/getTables/${id}`), getTablesByConf: (data: any) => request.post('/datasource/getTablesByConf', data), - getFields: (id: Number, table_name: string) => request.post(`/datasource/getFields/${id}/${table_name}`), - execSql: (id: Number, sql: string) => request.post(`/datasource/execSql/${id}/${sql}`), - chooseTables: (id: Number, data: any) => request.post(`/datasource/chooseTables/${id}`, data), - tableList: (id: Number) => request.post(`/datasource/tableList/${id}`), - fieldList: (id: Number) => request.post(`/datasource/fieldList/${id}`), + getFields: (id: number, table_name: string) => + request.post(`/datasource/getFields/${id}/${table_name}`), + execSql: (id: number, sql: string) => request.post(`/datasource/execSql/${id}/${sql}`), + chooseTables: (id: number, data: any) => request.post(`/datasource/chooseTables/${id}`, data), + tableList: (id: number) => request.post(`/datasource/tableList/${id}`), + fieldList: (id: number) => request.post(`/datasource/fieldList/${id}`), edit: (data: any) => request.post('/datasource/editLocalComment', data), - previewData: (id: Number, data: any) => request.post(`/datasource/previewData/${id}`, data), + previewData: (id: number, data: any) => request.post(`/datasource/previewData/${id}`, data), saveTable: (data: any) => request.post('/datasource/editTable', data), saveField: (data: any) => request.post('/datasource/editField', data), - getDs: (id: Number) => request.post(`/datasource/get/${id}`), -} \ No newline at end of file + getDs: (id: number) => request.post(`/datasource/get/${id}`), +} diff --git a/frontend/src/api/login.ts b/frontend/src/api/login.ts index 64c80cef..6fc486b9 100644 --- a/frontend/src/api/login.ts +++ b/frontend/src/api/login.ts @@ -1,13 +1,15 @@ import { request } from '@/utils/request' export const AuthApi = { - login: (credentials: { username: string; password: string }) => request.post<{ - data: any; token: string -}>('/login/access-token', credentials, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } - }), + login: (credentials: { username: string; password: string }) => + request.post<{ + data: any + token: string + }>('/login/access-token', credentials, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }), logout: () => request.post('/auth/logout'), - info: () => request.get('/user/info') -} \ No newline at end of file + info: () => request.get('/user/info'), +} diff --git a/frontend/src/api/setting.ts b/frontend/src/api/setting.ts index 45dc7de5..13dd64e4 100644 --- a/frontend/src/api/setting.ts +++ b/frontend/src/api/setting.ts @@ -1,9 +1,10 @@ import { request } from '@/utils/request' export const termApi = { - pager: (pageNumber: number, pageSize: number) => request.get(`/settings/terminology/pager/${pageNumber}/${pageSize}`), + pager: (pageNumber: number, pageSize: number) => + request.get(`/settings/terminology/pager/${pageNumber}/${pageSize}`), add: (data: any) => request.post('/settings/terminology', data), edit: (data: any) => request.put('/settings/terminology', data), delete: (id: number) => request.delete(`/settings/terminology/${id}`), - query: (id: number) => request.get(`/settings/terminology/${id}`) -} \ No newline at end of file + query: (id: number) => request.get(`/settings/terminology/${id}`), +} diff --git a/frontend/src/api/system.ts b/frontend/src/api/system.ts index 106fa74c..63dceff5 100644 --- a/frontend/src/api/system.ts +++ b/frontend/src/api/system.ts @@ -1,10 +1,11 @@ import { request } from '@/utils/request' export const modelApi = { - pager: (pageNumber: number, pageSize: number) => request.get(`/system/aimodel/pager/${pageNumber}/${pageSize}`), + pager: (pageNumber: number, pageSize: number) => + request.get(`/system/aimodel/pager/${pageNumber}/${pageSize}`), add: (data: any) => request.post('/system/aimodel', data), edit: (data: any) => request.put('/system/aimodel', data), delete: (id: number) => request.delete(`/system/aimodel/${id}`), query: (id: number) => request.get(`/system/aimodel/${id}`), status: (data: any) => request.patch('/system/aimodel/status', data), -} \ No newline at end of file +} diff --git a/frontend/src/components/Language-selector/index.vue b/frontend/src/components/Language-selector/index.vue index d9aaefda..5ab19f0a 100644 --- a/frontend/src/components/Language-selector/index.vue +++ b/frontend/src/components/Language-selector/index.vue @@ -1,5 +1,5 @@ diff --git a/frontend/src/components/layout/index.vue b/frontend/src/components/layout/index.vue index 8d0129f4..88960f45 100644 --- a/frontend/src/components/layout/index.vue +++ b/frontend/src/components/layout/index.vue @@ -1,6 +1,9 @@ @@ -84,15 +90,15 @@ -
-
+
+

{{ currentPageTitle }}

- + {{ t('common.system_manage') }}
@@ -108,9 +114,8 @@ Switch Layout Logout - + - @@ -120,13 +125,18 @@