From dbc870e867538a54dc0c4976452a02fc073bc231 Mon Sep 17 00:00:00 2001 From: AnnyTerfect <1247470246@qq.com> Date: Thu, 2 Nov 2023 21:50:11 +0800 Subject: [PATCH] refactor(frontend): add eslint plugin vuetify --- frontend/.eslintrc.cjs | 1 + frontend/package.json | 1 + .../src/components/Dialogs/ConfirmDialog.vue | 26 +- .../src/components/Dialogs/SuccessDialog.vue | 30 +- .../src/components/User/PageUserList.vue | 2 +- .../admin/src/components/User/UserList.vue | 24 +- .../main/src/components/App/AppBar.vue | 2 +- .../main/src/components/App/NavDrawer.vue | 2 +- .../src/components/Dialogs/ConfirmDialog.vue | 4 +- .../main/src/components/Home/HowWork.vue | 2 +- .../components/Learnware/LearnwareCard.vue | 10 +- .../Learnware/PageLearnwareList.vue | 2 +- .../Specification/DescriptionInput.vue | 7 +- .../components/Specification/FileUpload.vue | 2 +- .../Specification/SpecTag/GridBtns.vue | 4 +- .../Specification/SpecTag/IconBtn.vue | 4 +- .../SpecTag/MultiSelectGridBtns.vue | 4 +- .../Specification/SpecTag/ScenarioList.vue | 4 +- .../packages/main/src/views/ClientToken.vue | 2 +- frontend/pnpm-lock.yaml | 919 ++++++------------ 20 files changed, 347 insertions(+), 705 deletions(-) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index eb5076f..b0bb7b0 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -9,6 +9,7 @@ module.exports = { "eslint:recommended", "plugin:vue/vue3-essential", "plugin:@typescript-eslint/recommended", + "plugin:vuetify/base", ], overrides: [], parser: "vue-eslint-parser", diff --git a/frontend/package.json b/frontend/package.json index 7447097..092824a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -42,6 +42,7 @@ "eslint": "^8.43.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-vue": "^9.15.0", + "eslint-plugin-vuetify": "^2.0.5", "prettier": "^2.8.8", "sass": "^1.60.0", "tsup": "^7.2.0", diff --git a/frontend/packages/admin/src/components/Dialogs/ConfirmDialog.vue b/frontend/packages/admin/src/components/Dialogs/ConfirmDialog.vue index 203bf23..201bba3 100644 --- a/frontend/packages/admin/src/components/Dialogs/ConfirmDialog.vue +++ b/frontend/packages/admin/src/components/Dialogs/ConfirmDialog.vue @@ -20,10 +20,10 @@ defineExpose({ - - diff --git a/frontend/packages/admin/src/components/Dialogs/SuccessDialog.vue b/frontend/packages/admin/src/components/Dialogs/SuccessDialog.vue index b9d645a..c5a2809 100644 --- a/frontend/packages/admin/src/components/Dialogs/SuccessDialog.vue +++ b/frontend/packages/admin/src/components/Dialogs/SuccessDialog.vue @@ -14,10 +14,10 @@ defineExpose({ - - diff --git a/frontend/packages/admin/src/components/User/PageUserList.vue b/frontend/packages/admin/src/components/User/PageUserList.vue index 05642d3..0b1a938 100644 --- a/frontend/packages/admin/src/components/User/PageUserList.vue +++ b/frontend/packages/admin/src/components/User/PageUserList.vue @@ -129,7 +129,7 @@ function handleClickSetRole(id: string, role: number): void { :key="i" class="mx-1 !px-2 !min-w-0" :color="i === page ? 'primary' : 'default'" - flat + variant="flat" @click="() => jumpPage(i)" >{{ i }} diff --git a/frontend/packages/admin/src/components/User/UserList.vue b/frontend/packages/admin/src/components/User/UserList.vue index 537bed2..94181eb 100644 --- a/frontend/packages/admin/src/components/User/UserList.vue +++ b/frontend/packages/admin/src/components/User/UserList.vue @@ -67,19 +67,19 @@ function handleClickSetRole(id: number, role: number): void {
-
+
{{ t("AllUser.Username") }}
-
+
{{ t("AllUser.Email") }}
-
+
{{ t("AllUser.Verified") }}
-
+
{{ t("AllUser.Unverified") }}
-
+
{{ t("AllUser.IsAdmin") }}
@@ -92,7 +92,7 @@ function handleClickSetRole(id: number, role: number): void {
-
+
Username: @@ -100,17 +100,17 @@ function handleClickSetRole(id: number, role: number): void {
-
Email: {{ item.email }}
-
+
Email: {{ item.email }}
+
Verified: {{ item.verified_learnware_count }}
-
+
Unverified: {{ item.unverified_learnware_count }}
-
+
IsAdmin: (