feat(WIP): processing 작업

This commit is contained in:
2021-12-18 05:02:47 +09:00
parent 6c93d2fd85
commit b4b4678e26
15 changed files with 182 additions and 100 deletions
+1 -1
View File
@@ -449,7 +449,7 @@ export default defineComponent({
if (listReqArgCommand.has(commandName)) {
document.location.href = stringifyUrl({
url: "b_processing.php",
url: "v_processing.php",
query: {
command: commandName,
turnList: turnList.join("_"),
+1 -1
View File
@@ -237,7 +237,7 @@ $(function ($) {
const $command = $('#chiefCommandList option:selected');
if ($command.data('reqarg')) {
document.location.href = stringifyUrl({
url: 'b_processing.php',
url: 'v_processing.php',
query: {
command: unwrap_any<string>($command.val()),
turnList: turnList.join('_'),
+6 -11
View File
@@ -1,15 +1,10 @@
<template>
<table style="width: 1000px; margin: auto" class="bg0">
<tr>
<td style="text-align: left">
{{title}}<br /><button
type="button"
class="btn btn-primary"
@click="back"
>돌아가기</button><br />
</td>
</tr>
</table>
<div class="bg0">
<button type="button" class="btn btn-primary back_btn" @click="back">
돌아가기
</button>
<div></div>
</div>
</template>
<script lang="ts">
+1
View File
@@ -44,6 +44,7 @@
</div>
</template>
<script lang="ts">
import "@/../css/map.css";
import { reloadWorldMap, loadMapOption, MapCityParsed } from "@/map";
import { defineComponent, onMounted, PropType, ref } from "vue";
import { v4 as uuidv4 } from "uuid";
+5 -1
View File
@@ -1,12 +1,13 @@
import axios from 'axios';
import $ from 'jquery';
import { extend, isNumber, merge } from 'lodash';
import { isNumber, merge } from 'lodash';
import { convColorValue, convertDictById, stringFormat } from '@/common_legacy';
import { InvalidResponse } from '@/defs';
import { unwrap } from "@util/unwrap";
import { convertFormData } from '@util/convertFormData';
import { exportWindow } from '@util/exportWindow';
import { htmlReady } from './util/htmlReady';
import { initTooltip } from './legacy/initTooltip';
declare const serverNick: string;
declare const serverID: string;
@@ -506,6 +507,9 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world
}
function setMouseWork(obj: MapCityDrawable) {
initTooltip($(drawTarget));
const $tooltip = $(drawTarget + ' .city_tooltip');
const $tooltip_city = $tooltip.find('.city_name');
const $tooltip_nation = $tooltip.find('.nation_name');
+32 -26
View File
@@ -1,34 +1,38 @@
<template>
<MapLegacyTemplate
:isDetailMap="false"
:clickableAll="true"
:neutralView="true"
:useCachedMap="true"
:mapTheme="mapTheme"
v-model="selectedCityObj"
/>
<div>
선택된 도시로 강행합니다.<br />
최대 3칸내 도시로만 강행이 가능합니다.<br />
목록을 선택하거나 도시를 클릭하세요.<br />
</div>
<div class="row">
<div class="col">
<CitySelect :cities="citiesMap" :modelValue="selectedCityID" />
<TopBackBar :title="commandName" />
<div class="bg0">
<MapLegacyTemplate
:isDetailMap="false"
:clickableAll="true"
:neutralView="true"
:useCachedMap="true"
:mapTheme="mapTheme"
v-model="selectedCityObj"
/>
<div>
선택된 도시로 강행합니다.<br />
최대 3칸내 도시로만 강행이 가능합니다.<br />
목록을 선택하거나 도시를 클릭하세요.<br />
</div>
<div class="col">
<b-button @click="submit">{{ commandName }}</b-button>
<div class="row">
<div class="col">
<CitySelect :cities="citiesMap" :modelValue="selectedCityID" />
</div>
<div class="col">
<b-button @click="submit">{{ commandName }}</b-button>
</div>
</div>
<CityBasedOnDistance
:citiesMap="citiesMap"
:distanceList="distanceList"
@selected="selected"
/>
</div>
<CityBasedOnDistance
:citiesMap="citiesMap"
:distanceList="distanceList"
@selected="selected"
/>
<BottomBar :title="commandName" />
</template>
<script lang="ts">
import "@/../css/map.css";
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
@@ -37,17 +41,20 @@ import CityBasedOnDistance from "@/processing/CitiesBasedOnDistance.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
declare const mapTheme: string;
declare const cities: [number, string][];
declare const currentCity: number;
declare const distanceList: Record<number, number[]>;
declare const commandName: string;
export default defineComponent({
name: "che_강행",
components: {
MapLegacyTemplate,
CitySelect,
CityBasedOnDistance,
TopBackBar,
BottomBar,
},
watch: {
selectedCityObj(city: MapCityParsed) {
@@ -55,7 +62,6 @@ export default defineComponent({
},
},
setup() {
console.log("start!");
const citiesMap = new Map<
number,
{
+104
View File
@@ -0,0 +1,104 @@
<template>
<TopBackBar :title="commandName" />
<div class="bg0">
<MapLegacyTemplate
:isDetailMap="false"
:clickableAll="true"
:neutralView="true"
:useCachedMap="true"
:mapTheme="mapTheme"
v-model="selectedCityObj"
/>
<div>
선택된 도시로 이동합니다.<br />
인접 도시로만 이동이 가능합니다.<br />
목록을 선택하거나 도시를 클릭하세요.<br />
</div>
<div class="row">
<div class="col">
<CitySelect :cities="citiesMap" :modelValue="selectedCityID" />
</div>
<div class="col">
<b-button @click="submit">{{ commandName }}</b-button>
</div>
</div>
<CityBasedOnDistance
:citiesMap="citiesMap"
:distanceList="distanceList"
@selected="selected"
/>
</div>
<BottomBar :title="commandName" />
</template>
<script lang="ts">
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import CitySelect from "@/processing/CitySelect.vue";
import CityBasedOnDistance from "@/processing/CitiesBasedOnDistance.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
declare const mapTheme: string;
declare const cities: [number, string][];
declare const currentCity: number;
declare const distanceList: Record<number, number[]>;
declare const commandName: string;
export default defineComponent({
components: {
MapLegacyTemplate,
CitySelect,
CityBasedOnDistance,
TopBackBar,
BottomBar,
},
watch: {
selectedCityObj(city: MapCityParsed) {
this.selectedCityID = city.id;
},
},
setup() {
const citiesMap = new Map<
number,
{
name: string;
info?: string;
}
>();
for (const [id, name] of cities) {
citiesMap.set(id, { name });
}
console.log(citiesMap);
const selectedCityID = ref(currentCity);
function selected(cityID: number) {
selectedCityID.value = cityID;
}
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destCityID: selectedCityID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
return {
mapTheme: ref(mapTheme),
citiesMap: ref(citiesMap),
selectedCityID,
selectedCityObj: ref(undefined as MapCityParsed | undefined),
distanceList,
commandName,
selected,
submit,
};
},
});
</script>
+2 -1
View File
@@ -1 +1,2 @@
export { default as che_강행 } from "./che_강행.vue";
export { default as che_강행 } from "./che_강행.vue";
export { default as che_이동 } from "./che_이동.vue";
+4 -4
View File
@@ -72,9 +72,6 @@ async function submitCommand<T>(isChiefTurn: boolean, turnList: number[], comman
declare const entryInfo: ['General', keyof typeof GeneralActions] | ['Nation', keyof typeof NationActions];
console.log('entry', entryInfo);
auto500px();
const app: App<Element> | undefined = (function () {
//NOTE: route를 쓴다?
const groupName = entryInfo[0];
@@ -96,7 +93,7 @@ const app: App<Element> | undefined = (function () {
console.error('알수')
return undefined;
}());
console.log(app);
if (app === undefined) {
console.error(`모듈이 지정되지 않음`, entryInfo);
}
@@ -110,3 +107,6 @@ else {
app.use(BootstrapVue3).component('v-multiselect', Multiselect).mount('#container');
}
auto500px();