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({
-
-
-
-
+
+
+
+
@@ -37,21 +37,3 @@ 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:
(
-
+
{
-
+
Pages
diff --git a/frontend/packages/main/src/components/Dialogs/ConfirmDialog.vue b/frontend/packages/main/src/components/Dialogs/ConfirmDialog.vue
index 44d7256..43e5e99 100644
--- a/frontend/packages/main/src/components/Dialogs/ConfirmDialog.vue
+++ b/frontend/packages/main/src/components/Dialogs/ConfirmDialog.vue
@@ -22,7 +22,7 @@ defineExpose({
-
+
@@ -45,7 +45,7 @@ defineExpose({
.dialog {
@apply mx-2;
- .title {
+ .my-title {
@apply flex m-2;
.icon {
diff --git a/frontend/packages/main/src/components/Home/HowWork.vue b/frontend/packages/main/src/components/Home/HowWork.vue
index a163243..200ecc2 100644
--- a/frontend/packages/main/src/components/Home/HowWork.vue
+++ b/frontend/packages/main/src/components/Home/HowWork.vue
@@ -16,7 +16,7 @@ const { t } = useI18n();
-
+
diff --git a/frontend/packages/main/src/components/Learnware/LearnwareCard.vue b/frontend/packages/main/src/components/Learnware/LearnwareCard.vue
index e3cad36..0fc6312 100644
--- a/frontend/packages/main/src/components/Learnware/LearnwareCard.vue
+++ b/frontend/packages/main/src/components/Learnware/LearnwareCard.vue
@@ -74,7 +74,7 @@ function handleClickDelete(id: string): void {
-
+
@@ -169,21 +169,21 @@ function handleClickDelete(id: string): void {
handleClickEdit(item.id)"
>
downloadLearnwareSync(item.id)"
>
jumpPage(i)"
>
{{ i }}
diff --git a/frontend/packages/main/src/components/Specification/DescriptionInput.vue b/frontend/packages/main/src/components/Specification/DescriptionInput.vue
index 6c389b9..d8463dd 100644
--- a/frontend/packages/main/src/components/Specification/DescriptionInput.vue
+++ b/frontend/packages/main/src/components/Specification/DescriptionInput.vue
@@ -140,7 +140,12 @@ watch(
-
+
mdi-plus
diff --git a/frontend/packages/main/src/components/Specification/FileUpload.vue b/frontend/packages/main/src/components/Specification/FileUpload.vue
index aef8665..ce869ac 100644
--- a/frontend/packages/main/src/components/Specification/FileUpload.vue
+++ b/frontend/packages/main/src/components/Specification/FileUpload.vue
@@ -77,7 +77,7 @@ const files = computed({
(files = [])"
>
diff --git a/frontend/packages/main/src/components/Specification/SpecTag/GridBtns.vue b/frontend/packages/main/src/components/Specification/SpecTag/GridBtns.vue
index 77ef95c..16eddd0 100644
--- a/frontend/packages/main/src/components/Specification/SpecTag/GridBtns.vue
+++ b/frontend/packages/main/src/components/Specification/SpecTag/GridBtns.vue
@@ -59,7 +59,7 @@ watch(
-
{{ title }}
+
{{ title }}
.grid-container {
- .title {
+ .my-title {
@apply mt-7 mb-5;
}
diff --git a/frontend/packages/main/src/components/Specification/SpecTag/IconBtn.vue b/frontend/packages/main/src/components/Specification/SpecTag/IconBtn.vue
index 367651f..f5a61ca 100644
--- a/frontend/packages/main/src/components/Specification/SpecTag/IconBtn.vue
+++ b/frontend/packages/main/src/components/Specification/SpecTag/IconBtn.vue
@@ -27,7 +27,7 @@ defineProps({
-
@@ -47,7 +47,7 @@ defineProps({
}
}
- .title {
+ .my-title {
@apply lg:text-1rem sm:text-sm text-xs '!leading-5';
}
}
diff --git a/frontend/packages/main/src/components/Specification/SpecTag/MultiSelectGridBtns.vue b/frontend/packages/main/src/components/Specification/SpecTag/MultiSelectGridBtns.vue
index cb4c1c4..791faa0 100644
--- a/frontend/packages/main/src/components/Specification/SpecTag/MultiSelectGridBtns.vue
+++ b/frontend/packages/main/src/components/Specification/SpecTag/MultiSelectGridBtns.vue
@@ -65,7 +65,7 @@ watch(
-
{{ title }}
+
{{ title }}
.grid-container {
- .title {
+ .my-title {
@apply mt-7 mb-5;
}
diff --git a/frontend/packages/main/src/components/Specification/SpecTag/ScenarioList.vue b/frontend/packages/main/src/components/Specification/SpecTag/ScenarioList.vue
index b7004e4..67cecd9 100644
--- a/frontend/packages/main/src/components/Specification/SpecTag/ScenarioList.vue
+++ b/frontend/packages/main/src/components/Specification/SpecTag/ScenarioList.vue
@@ -155,7 +155,7 @@ function deleteSelect(value: Scenario): void {
-
+
{{ t("Submit.SemanticSpecification.Scenario.Scenario") }}
@@ -178,7 +178,7 @@ function deleteSelect(value: Scenario): void {