forked from devsam/core
fix: 메인, 사령부의 alert를 toast로 이동
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="container" class="pageChiefCenter">
|
||||
<BContainer id="container" class="pageChiefCenter" :toast="{ root: true }">
|
||||
<TopBackBar title="사령부" reloadable @reload="reloadTable" />
|
||||
|
||||
<div
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</BContainer>
|
||||
<div v-if="chiefList" id="bottomChiefBox">
|
||||
<div id="bottomChiefList" class="c-bg2">
|
||||
<template v-for="(chiefLevel, vidx) in [12, 10, 8, 6, 11, 9, 7, 5]" :key="chiefLevel">
|
||||
@@ -113,11 +113,15 @@ import { StoredActionsHelper } from "./util/StoredActionsHelper";
|
||||
import type { ChiefResponse } from "./defs/API/NationCommand";
|
||||
import { getGameConstStore, type GameConstStore } from "./GameConstStore";
|
||||
import { postFilterNationCommandGen } from "./utilGame/postFilterNationCommandGen";
|
||||
import { useToast } from "bootstrap-vue-3";
|
||||
|
||||
const props = defineProps({
|
||||
maxChiefTurn: VueTypes.number.isRequired,
|
||||
});
|
||||
|
||||
|
||||
const toasts = unwrap(useToast());
|
||||
|
||||
const asyncReady = ref<boolean>(false);
|
||||
const gameConstStore = ref<GameConstStore>();
|
||||
provide("gameConstStore", gameConstStore);
|
||||
|
||||
@@ -301,9 +301,13 @@ async function tryRefresh() {
|
||||
//TODO: 서버와 클라이언트 버전이 다르다면 갱신 필요
|
||||
} catch (e) {
|
||||
responseLock = false;
|
||||
//매우 심각한 버그
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`서버 갱신 실패: ${e}`);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ import DragSelect from "@/components/DragSelect.vue";
|
||||
import { SammoAPI } from "./SammoAPI";
|
||||
import type { CommandItem, CommandTableResponse } from "@/defs";
|
||||
import CommandSelectForm from "@/components/CommandSelectForm.vue";
|
||||
import { BButton, BButtonGroup, BDropdownItem, BDropdown, BDropdownText, BDropdownDivider } from "bootstrap-vue-3";
|
||||
import { BButton, BButtonGroup, BDropdownItem, BDropdown, BDropdownText, BDropdownDivider, useToast } from "bootstrap-vue-3";
|
||||
import { StoredActionsHelper } from "./util/StoredActionsHelper";
|
||||
import type { TurnObj } from "@/defs";
|
||||
import type { Args } from "./processing/args";
|
||||
@@ -303,6 +303,8 @@ defineExpose({
|
||||
reloadCommandList,
|
||||
})
|
||||
|
||||
const toasts = unwrap(useToast());
|
||||
|
||||
const { maxTurn, maxPushTurn } = staticValues;
|
||||
|
||||
const commandList = ref<CommandTableResponse['commandTable']>([]);
|
||||
@@ -436,8 +438,13 @@ async function repeatGeneralCommand(amount: number) {
|
||||
try {
|
||||
await SammoAPI.Command.RepeatCommand({ amount });
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
await reloadCommandList();
|
||||
@@ -447,8 +454,13 @@ async function pushGeneralCommand(amount: number) {
|
||||
try {
|
||||
await SammoAPI.Command.PushCommand({ amount });
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
await reloadCommandList();
|
||||
@@ -483,8 +495,13 @@ async function reloadCommandList() {
|
||||
try {
|
||||
result = await SammoAPI.Command.GetReservedCommand();
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -551,8 +568,13 @@ async function reserveCommandDirect(args: [number[], TurnObj][], reload = true):
|
||||
await SammoAPI.Command.ReserveBulkCommand(query);
|
||||
queryActionHelper.releaseSelectedTurnList();
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -592,8 +614,13 @@ async function reserveCommand() {
|
||||
|
||||
queryActionHelper.releaseSelectedTurnList();
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
await reloadCommandList();
|
||||
|
||||
@@ -274,13 +274,16 @@ import { QueryActionHelper, type TurnObjWithTime } from "@/util/QueryActionHelpe
|
||||
import type { Args } from "@/processing/args";
|
||||
import type { StoredActionsHelper } from "@/util/StoredActionsHelper";
|
||||
import { getNPCColor } from "@/utilGame";
|
||||
import { BButton, BDropdownItem, BDropdownText, BButtonGroup, BDropdownDivider, BDropdown } from "bootstrap-vue-3";
|
||||
import { BButton, BDropdownItem, BDropdownText, BButtonGroup, BDropdownDivider, BDropdown, useToast } from "bootstrap-vue-3";
|
||||
import CommandSelectForm from "@/components/CommandSelectForm.vue";
|
||||
import SimpleClock from "@/components/SimpleClock.vue";
|
||||
import type { ChiefResponse } from "@/defs/API/NationCommand";
|
||||
import { unwrap_err } from "@/util/unwrap_err";
|
||||
import type { GameConstStore } from "@/GameConstStore";
|
||||
import { postFilterNationCommandGen } from "@/utilGame/postFilterNationCommandGen";
|
||||
import { unwrap } from "@/util/unwrap";
|
||||
|
||||
const toasts = unwrap(useToast());
|
||||
|
||||
const props = defineProps({
|
||||
maxTurn: VueTypes.integer.isRequired,
|
||||
@@ -404,8 +407,13 @@ async function repeatNationCommand(amount: number) {
|
||||
try {
|
||||
await SammoAPI.NationCommand.RepeatCommand({ amount });
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
emit("raise-reload");
|
||||
@@ -431,8 +439,13 @@ async function pushNationCommand(amount: number) {
|
||||
try {
|
||||
await SammoAPI.NationCommand.PushCommand({ amount });
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
emit("raise-reload");
|
||||
@@ -469,8 +482,13 @@ async function reserveCommandDirect(args: [number[], TurnObj][], reload = true):
|
||||
await SammoAPI.NationCommand.ReserveBulkCommand(query);
|
||||
queryActionHelper.releaseSelectedTurnList();
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -560,8 +578,13 @@ async function reserveCommand() {
|
||||
|
||||
queryActionHelper.releaseSelectedTurnList();
|
||||
} catch (e) {
|
||||
if(isString(e)){
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
});
|
||||
}
|
||||
console.error(e);
|
||||
alert(`실패했습니다: ${e}`);
|
||||
return;
|
||||
}
|
||||
emit("raise-reload");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createApp } from 'vue'
|
||||
import PageChiefCenter from '@/PageChiefCenter.vue';
|
||||
import BootstrapVue3 from 'bootstrap-vue-3'
|
||||
import BootstrapVue3, { BToastPlugin } from 'bootstrap-vue-3'
|
||||
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
|
||||
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
|
||||
import Multiselect from 'vue-multiselect';
|
||||
@@ -20,4 +20,4 @@ htmlReady(() => {
|
||||
createApp(PageChiefCenter, {
|
||||
maxChiefTurn,
|
||||
|
||||
}).use(BootstrapVue3).component('v-multiselect', Multiselect).mount('#app')
|
||||
}).use(BootstrapVue3).use(BToastPlugin).component('v-multiselect', Multiselect).mount('#app')
|
||||
Reference in New Issue
Block a user