feat(WIP): 내무부
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<template>
|
||||
<div>위쪽버튼</div>
|
||||
<div>외교관계</div>
|
||||
|
||||
<div>국 가 방 침 & 임관 권유 메시지</div>
|
||||
<div id="noticeForm">
|
||||
<div class="bg1" style="display: flex; justify-content: space-around">
|
||||
@@ -24,9 +27,7 @@
|
||||
<div class="bg1" style="display: flex; justify-content: space-around">
|
||||
<div style="flex: 1 1 auto">임관 권유</div>
|
||||
<div>
|
||||
<b-button
|
||||
@click="enableEditScoutMsg"
|
||||
v-if="editable && !inEditScoutMsg"
|
||||
<b-button @click="enableEditScoutMsg" v-if="editable && !inEditScoutMsg"
|
||||
>임관 권유문 수정</b-button
|
||||
>
|
||||
<b-button @click="saveScoutMsg" v-if="editable && inEditScoutMsg"
|
||||
@@ -44,81 +45,140 @@
|
||||
<TipTap v-model="scoutMsg" :editable="inEditScoutMsg" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>예산&정책</div>
|
||||
<div>추가 설정</div>
|
||||
<div>돌아가기</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import "@scss/dipcenter.scss";
|
||||
import "@scss/common_legacy.scss";
|
||||
import "@scss/editor_component.scss";
|
||||
import TipTap from "./components/TipTap.vue";
|
||||
import { defineComponent } from "vue";
|
||||
import { defineComponent, reactive, ref, toRefs } from "vue";
|
||||
import { sammoAPI } from "./util/sammoAPI";
|
||||
import { isString } from "lodash";
|
||||
declare const editable: boolean;
|
||||
declare const nationMsg: string;
|
||||
declare const scoutMsg: string;
|
||||
import { diplomacyState, NationStaticItem } from "./defs";
|
||||
|
||||
type NationItem = NationStaticItem & {
|
||||
cityCnt: number;
|
||||
diplomacy: {
|
||||
state: diplomacyState;
|
||||
term: number | null;
|
||||
};
|
||||
};
|
||||
declare const staticValues: {
|
||||
editable: boolean;
|
||||
nationMsg: string;
|
||||
scoutMsg: string;
|
||||
nationID: number;
|
||||
officerLevel: number;
|
||||
year: number;
|
||||
month: number;
|
||||
nationsList: Record<number, NationItem>;
|
||||
|
||||
gold: number;
|
||||
rice: number;
|
||||
income: {
|
||||
gold: {
|
||||
city: number;
|
||||
war: number;
|
||||
};
|
||||
rice: {
|
||||
city: number;
|
||||
wall: number;
|
||||
};
|
||||
};
|
||||
|
||||
polcy: {
|
||||
rate: number;
|
||||
bill: number;
|
||||
secretLimit: number;
|
||||
blockScout: boolean;
|
||||
blockWar: boolean;
|
||||
};
|
||||
warSettingCnt: {
|
||||
remain: number;
|
||||
inc: number;
|
||||
max: number;
|
||||
};
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
name: "PartialDipcenter",
|
||||
components: {
|
||||
TipTap,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editable,
|
||||
oldNationMsg: nationMsg,
|
||||
oldScoutMsg: scoutMsg,
|
||||
nationMsg,
|
||||
scoutMsg,
|
||||
inEditNationMsg: false,
|
||||
inEditScoutMsg: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
enableEditNationMsg() {
|
||||
this.inEditNationMsg = true;
|
||||
},
|
||||
rollbackNationMsg() {
|
||||
this.inEditNationMsg = false;
|
||||
this.nationMsg = this.oldNationMsg;
|
||||
},
|
||||
async saveNationMsg() {
|
||||
const msg = this.nationMsg;
|
||||
setup() {
|
||||
const self = reactive(staticValues);
|
||||
|
||||
let oldNationMsg = staticValues.nationMsg;
|
||||
const inEditNationMsg = ref(false);
|
||||
|
||||
function enableEditNationMsg() {
|
||||
inEditNationMsg.value = true;
|
||||
}
|
||||
|
||||
function rollbackNationMsg() {
|
||||
inEditNationMsg.value = false;
|
||||
self.nationMsg = oldNationMsg;
|
||||
}
|
||||
|
||||
async function saveNationMsg() {
|
||||
const msg = self.nationMsg;
|
||||
try {
|
||||
await sammoAPI("Nation/SetNotice", {
|
||||
msg,
|
||||
});
|
||||
this.oldNationMsg = msg;
|
||||
this.inEditNationMsg = false;
|
||||
oldNationMsg = msg;
|
||||
inEditNationMsg.value = false;
|
||||
} catch (e) {
|
||||
if (isString(e)) {
|
||||
alert(e);
|
||||
}
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
enableEditScoutMsg() {
|
||||
this.inEditScoutMsg = true;
|
||||
},
|
||||
rollbackScoutMsg() {
|
||||
this.inEditScoutMsg = false;
|
||||
this.scoutMsg = this.oldScoutMsg;
|
||||
},
|
||||
async saveScoutMsg() {
|
||||
const msg = this.scoutMsg;
|
||||
let oldScoutMsg = staticValues.scoutMsg;
|
||||
const inEditScoutMsg = ref(false);
|
||||
|
||||
function enableEditScoutMsg() {
|
||||
inEditScoutMsg.value = true;
|
||||
}
|
||||
function rollbackScoutMsg() {
|
||||
inEditScoutMsg.value = false;
|
||||
self.scoutMsg = oldScoutMsg;
|
||||
}
|
||||
async function saveScoutMsg() {
|
||||
const msg = self.scoutMsg;
|
||||
try {
|
||||
await sammoAPI("Nation/SetScoutMsg", {
|
||||
msg,
|
||||
});
|
||||
this.oldScoutMsg = msg;
|
||||
this.inEditScoutMsg = false;
|
||||
oldScoutMsg = msg;
|
||||
inEditScoutMsg.value = false;
|
||||
} catch (e) {
|
||||
if (isString(e)) {
|
||||
alert(e);
|
||||
}
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
return {
|
||||
...toRefs(self),
|
||||
inEditNationMsg,
|
||||
inEditScoutMsg,
|
||||
enableEditNationMsg,
|
||||
rollbackNationMsg,
|
||||
saveNationMsg,
|
||||
enableEditScoutMsg,
|
||||
rollbackScoutMsg,
|
||||
saveScoutMsg,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
@@ -26,7 +26,7 @@
|
||||
"v_NPCControl": "v_NPCControl.ts",
|
||||
"v_join": "v_join.ts",
|
||||
"v_main": "v_main.ts",
|
||||
"v_dipcenter": "v_dipcenter.ts",
|
||||
"v_nationStratFinan": "v_nationStratFinan.ts",
|
||||
"v_processing": "v_processing.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { createApp } from 'vue'
|
||||
import PartialDipcenter from '@/PartialDipcenter.vue';
|
||||
import BootstrapVue3 from 'bootstrap-vue-3';
|
||||
import { htmlReady } from './util/htmlReady';
|
||||
//import { activateFlip } from './legacy/activateFlip';
|
||||
//import { activateFlip } from "@/legacy/activateFlip";
|
||||
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
|
||||
//import { htmlReady } from './util/htmlReady';
|
||||
|
||||
createApp(PartialDipcenter).use(BootstrapVue3).mount('#editorForm');
|
||||
setAxiosXMLHttpRequest();
|
||||
|
||||
|
||||
htmlReady(function(){
|
||||
//activateFlip();
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
import { createApp } from 'vue'
|
||||
import PageNationStratFinan from '@/PageNationStratFinan.vue';
|
||||
import BootstrapVue3 from 'bootstrap-vue-3';
|
||||
import { auto500px } from './util/auto500px';
|
||||
|
||||
|
||||
|
||||
|
||||
auto500px();
|
||||
createApp(PageNationStratFinan).use(BootstrapVue3).mount('#container');
|
||||
Reference in New Issue
Block a user