From 43df2b3f8b67cc3a50023fb1264be0f9d8a301e4 Mon Sep 17 00:00:00 2001 From: barney <15270405776@163.com> Date: Sat, 10 Sep 2022 00:22:35 +0800 Subject: [PATCH] =?UTF-8?q?10.2=20=E5=AE=9E=E7=8E=B0AcApp=E7=AB=AF?= =?UTF-8?q?=EF=BC=88=E4=B8=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acapp/src/App.vue | 18 +- acapp/src/components/ContentField.vue | 8 +- acapp/src/components/MatchGround.vue | 4 +- acapp/src/components/PlayGround.vue | 59 +++- acapp/src/components/ResultBoard.vue | 66 +++-- acapp/src/views/MenuView.vue | 2 +- .../src/views/ranklist/RanklistIndexView.vue | 128 ++++++-- acapp/src/views/record/RecordIndexView.vue | 212 ++++++++++---- acapp/src/views/user/bot/UserBotIndexView.vue | 276 +++++++++++------- 9 files changed, 546 insertions(+), 227 deletions(-) diff --git a/acapp/src/App.vue b/acapp/src/App.vue index b541347..b24a917 100644 --- a/acapp/src/App.vue +++ b/acapp/src/App.vue @@ -1,18 +1,12 @@ \ No newline at end of file diff --git a/acapp/src/components/ResultBoard.vue b/acapp/src/components/ResultBoard.vue index 0929fd4..3bda693 100644 --- a/acapp/src/components/ResultBoard.vue +++ b/acapp/src/components/ResultBoard.vue @@ -1,23 +1,27 @@ @@ -50,29 +54,47 @@ export default { \ No newline at end of file diff --git a/acapp/src/views/MenuView.vue b/acapp/src/views/MenuView.vue index 0ca135a..ebca505 100644 --- a/acapp/src/views/MenuView.vue +++ b/acapp/src/views/MenuView.vue @@ -71,7 +71,7 @@ div.menu-item { } div.menu-item:hover { - scale: 1.2; + transform: scale(1.2); transition: 400ms; } diff --git a/acapp/src/views/ranklist/RanklistIndexView.vue b/acapp/src/views/ranklist/RanklistIndexView.vue index 38a0695..a9928f8 100644 --- a/acapp/src/views/ranklist/RanklistIndexView.vue +++ b/acapp/src/views/ranklist/RanklistIndexView.vue @@ -1,20 +1,25 @@ @@ -114,14 +120,25 @@ export default { \ No newline at end of file diff --git a/acapp/src/views/record/RecordIndexView.vue b/acapp/src/views/record/RecordIndexView.vue index efb56fc..70a7efe 100644 --- a/acapp/src/views/record/RecordIndexView.vue +++ b/acapp/src/views/record/RecordIndexView.vue @@ -1,57 +1,64 @@ @@ -159,7 +166,8 @@ export default { }) // 恢复对局的败者 - store.commit("updateRecordLoser",record.record.loser); + store.commit("updateRecordLoser",record.record.loser); + store.commit("updateRouterName","record_content"); break; } } @@ -178,12 +186,37 @@ export default { \ No newline at end of file diff --git a/acapp/src/views/user/bot/UserBotIndexView.vue b/acapp/src/views/user/bot/UserBotIndexView.vue index 9d5c6cd..f57511b 100644 --- a/acapp/src/views/user/bot/UserBotIndexView.vue +++ b/acapp/src/views/user/bot/UserBotIndexView.vue @@ -1,127 +1,124 @@ @@ -129,7 +126,6 @@ import { ref,reactive } from "vue" import $ from 'jquery' import { useStore } from "vuex" -import {Modal} from "bootstrap/dist/js/bootstrap" import ContentField from "@/components/ContentField.vue" import { VAceEditor } from 'vue3-ace-editor'; import ace from 'ace-builds'; @@ -145,6 +141,7 @@ export default { "https://cdn.jsdelivr.net/npm/ace-builds@" + require('ace-builds').version + "/src-noconflict/"); const store = useStore(); let bots = ref([]) // 定义bot列表 + let show_dialog = ref(false); const new_bot = reactive({ title: "", description: "", @@ -152,13 +149,11 @@ export default { error_msg: "", }) - const cancel_update = (bot)=> { - Modal.getInstance("#update-bot-btn-"+bot.id).hide(); + const cancel_update = ()=> { refresh_bots(); } const cancel_add = ()=> { - Modal.getInstance("#add_bot_btn").hide(); refresh_bots(); } @@ -170,6 +165,10 @@ export default { "Authorization": "Bearer " + store.state.user.token, // 任何需要登录才能显示的都要加这个验证 }, success(resp){ + for (const bot of resp) { + bot.show_update_modal = false; + } + // 将后端得到的数据传给bot bots.value = resp; } @@ -196,7 +195,7 @@ export default { new_bot.title = "", new_bot.description="", new_bot.content="", - Modal.getInstance("#add_bot_btn").hide(); + handle_click_create(false); refresh_bots(); } else { @@ -223,7 +222,6 @@ export default { }, success(resp) { if (resp.error_msg === "success") { // 更新bot成功 - Modal.getInstance("#update-bot-btn-"+bot.id).hide(); refresh_bots(); } else { @@ -252,6 +250,21 @@ export default { } }) } + const handle_click_create = is_show => { + show_dialog.value = is_show; + } + + const show_update_modal_handler = (bot_id, is_show) => { + const new_bots = []; + for (const bot of bots.value) { + if (bot.id === bot_id) { + bot.show_update_modal = is_show; + } + new_bots.push(bot); + } + bots.value = new_bots; + } + return { bots, @@ -261,6 +274,9 @@ export default { update_bot, cancel_update, cancel_add, + show_dialog, + handle_click_create, + show_update_modal_handler, } } @@ -268,12 +284,60 @@ export default { \ No newline at end of file