feat(WIP): processing, 몰수
- 초성에서 Windows 겹받침, Mac 된소리 자음(automata 초성) - 장수 선택에에서 검은색 테마 - 양 선택기에 숫자 추가
This commit is contained in:
@@ -9,6 +9,7 @@ body {
|
|||||||
color: white;
|
color: white;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
|
|||||||
@@ -214,6 +214,25 @@ class che_몰수 extends Command\NationCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function exportJSVars(): array
|
||||||
|
{
|
||||||
|
$db = DB::db();
|
||||||
|
$nationID = $this->getNationID();
|
||||||
|
$troops = Util::convertArrayToDict($db->query('SELECT * FROM troop WHERE nation=%i', $nationID), 'troop_leader');
|
||||||
|
$destRawGenerals = $db->queryAllLists('SELECT no,name,officer_level,npc,gold,rice,leadership,strength,intel,city,crew,train,atmos,troop FROM general WHERE nation = %i ORDER BY npc,binary(name)', $nationID);
|
||||||
|
return [
|
||||||
|
'procRes' => [
|
||||||
|
'troops' => $troops,
|
||||||
|
'generals' => $destRawGenerals,
|
||||||
|
'generalsKey' => ['no', 'name', 'officerLevel', 'npc', 'gold', 'rice', 'leadership', 'strength', 'intel', 'cityID', 'crew', 'train', 'atmos', 'troopID'],
|
||||||
|
'cities' => \sammo\JSOptionsForCities(),
|
||||||
|
'minAmount' => 100,
|
||||||
|
'maxAmount' => GameConst::$maxResourceActionAmount,
|
||||||
|
'amountGuide' => GameConst::$resourceActionAmountGuide,
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function getForm(): string
|
public function getForm(): string
|
||||||
{
|
{
|
||||||
//TODO: 암행부처럼 보여야...
|
//TODO: 암행부처럼 보여야...
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ table.tb_layout {
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: repeat-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tb_layout td,
|
.tb_layout td,
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ import { parseTime } from "@util/parseTime";
|
|||||||
import { parseYearMonth } from "@util/parseYearMonth";
|
import { parseYearMonth } from "@util/parseYearMonth";
|
||||||
import { sammoAPI } from "@util/sammoAPI";
|
import { sammoAPI } from "@util/sammoAPI";
|
||||||
import { filter초성withAlphabet } from "@util/filter초성withAlphabet";
|
import { filter초성withAlphabet } from "@util/filter초성withAlphabet";
|
||||||
|
import { automata초성All } from "@util/automata초성";
|
||||||
type commandItem = {
|
type commandItem = {
|
||||||
value: string;
|
value: string;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -502,7 +502,8 @@ export default defineComponent({
|
|||||||
const [filteredTextH, filteredTextA] = filter초성withAlphabet(
|
const [filteredTextH, filteredTextA] = filter초성withAlphabet(
|
||||||
command.simpleName.replace(/\s+/g, "")
|
command.simpleName.replace(/\s+/g, "")
|
||||||
);
|
);
|
||||||
command.searchText = `${command.simpleName} ${filteredTextH} ${filteredTextA}`;
|
const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH);
|
||||||
|
command.searchText = `${command.simpleName} ${filteredTextH} ${filteredTextA} ${filteredTextHL1} ${filteredTextHL2}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
export function colorSelect(): void{
|
|
||||||
function changeNationColorPlate(){
|
|
||||||
const $this = $('#colorType');
|
|
||||||
const $option = $this.find('option:selected');
|
|
||||||
$this.css({
|
|
||||||
'background-color':$option.css('background-color'),
|
|
||||||
'color':$option.css('color')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$('#colorType').on('change', function(){
|
|
||||||
changeNationColorPlate();
|
|
||||||
});
|
|
||||||
changeNationColorPlate();
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import { reloadWorldMap } from "@/map";
|
|
||||||
|
|
||||||
declare let vueReactive_destCityID: number|undefined;
|
|
||||||
|
|
||||||
export function defaultSelectCityByMap(): void {
|
|
||||||
void reloadWorldMap({
|
|
||||||
isDetailMap: false,
|
|
||||||
clickableAll: true,
|
|
||||||
neutralView: true,
|
|
||||||
useCachedMap: true,
|
|
||||||
selectCallback: function (city) {
|
|
||||||
if(vueReactive_destCityID === undefined){
|
|
||||||
console.error('아직 초기화 되지 않음');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
vueReactive_destCityID = city.id;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import { reloadWorldMap } from "@/map";
|
|
||||||
|
|
||||||
declare let vueReactive_destNationID: number|undefined;
|
|
||||||
|
|
||||||
export function defaultSelectNationByMap(): void{
|
|
||||||
const $target = $("#destNationID");
|
|
||||||
console.log('nation', $target);
|
|
||||||
void reloadWorldMap({
|
|
||||||
isDetailMap: false,
|
|
||||||
clickableAll: true,
|
|
||||||
neutralView: true,
|
|
||||||
useCachedMap: true,
|
|
||||||
selectCallback: function (city) {
|
|
||||||
if(typeof vueReactive_destNationID === 'undefined'){
|
|
||||||
console.error('아직 초기화 되지 않음');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
vueReactive_destNationID = city.nationID;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<template>
|
||||||
|
<div class="col-10 col-md-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 30000"
|
||||||
|
@click="amount = Math.max(amount - 10000, minAmount)"
|
||||||
|
>-1만</b-button
|
||||||
|
>
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 3000"
|
||||||
|
@click="amount = Math.max(amount - 1000, minAmount)"
|
||||||
|
>-1천</b-button
|
||||||
|
>
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 300"
|
||||||
|
@click="amount = Math.max(amount - 100, minAmount)"
|
||||||
|
>-1백</b-button
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
class="form-control"
|
||||||
|
:max="maxAmount"
|
||||||
|
:min="minAmount"
|
||||||
|
v-model="amount"
|
||||||
|
placeholder="금액"
|
||||||
|
/>
|
||||||
|
<b-dropdown right text="" class="amount-dropdown" v-if="amountGuide">
|
||||||
|
<b-dropdown-item
|
||||||
|
v-for="guide in amountGuide"
|
||||||
|
:key="guide"
|
||||||
|
@click="amount = guide"
|
||||||
|
><div class="text-end">
|
||||||
|
{{ guide.toLocaleString() }}
|
||||||
|
</div></b-dropdown-item
|
||||||
|
>
|
||||||
|
</b-dropdown>
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 300"
|
||||||
|
@click="amount = Math.min(amount + 100, maxAmount)"
|
||||||
|
>+1백</b-button
|
||||||
|
>
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 3000"
|
||||||
|
@click="amount = Math.min(amount + 1000, maxAmount)"
|
||||||
|
>+1천</b-button
|
||||||
|
>
|
||||||
|
<b-button
|
||||||
|
v-if="maxAmount > 30000"
|
||||||
|
@click="amount = Math.min(amount + 10000, maxAmount)"
|
||||||
|
>+1만</b-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, PropType } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
modelValue: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
minAmount: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
maxAmount: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
amountGuide: {
|
||||||
|
type: Array as PropType<number[]>,
|
||||||
|
reqquired: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ["update:modelValue"],
|
||||||
|
watch: {
|
||||||
|
amount(val: number) {
|
||||||
|
this.$emit("update:modelValue", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
amount: this.modelValue,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.btn-group.amount-dropdown > .btn{
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-group.amount-dropdown .dropdown-menu.show {
|
||||||
|
min-width: 6rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { automata초성All } from "@/util/automata초성";
|
||||||
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
||||||
import { defineComponent, PropType } from "vue";
|
import { defineComponent, PropType } from "vue";
|
||||||
|
|
||||||
@@ -71,12 +72,13 @@ export default defineComponent({
|
|||||||
let selectedCity;
|
let selectedCity;
|
||||||
for (const [value, { name, info }] of this.cities.entries()) {
|
for (const [value, { name, info }] of this.cities.entries()) {
|
||||||
const [filteredTextH, filteredTextA] = filter초성withAlphabet(name);
|
const [filteredTextH, filteredTextA] = filter초성withAlphabet(name);
|
||||||
|
const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH);
|
||||||
const obj: SelectedCity = {
|
const obj: SelectedCity = {
|
||||||
value,
|
value,
|
||||||
title: name,
|
title: name,
|
||||||
info: info,
|
info: info,
|
||||||
simpleName: name,
|
simpleName: name,
|
||||||
searchText: `${name} ${filteredTextH} ${filteredTextA}`,
|
searchText: `${name} ${filteredTextH} ${filteredTextA} ${filteredTextHL1} ${filteredTextHL2}`,
|
||||||
};
|
};
|
||||||
if (value == this.modelValue) {
|
if (value == this.modelValue) {
|
||||||
selectedCity = obj;
|
selectedCity = obj;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-multiselect
|
<v-multiselect
|
||||||
v-model="selectedGeneral"
|
v-model="selectedGeneral"
|
||||||
|
class="selectedGeneral"
|
||||||
:allow-empty="false"
|
:allow-empty="false"
|
||||||
:options="forFind"
|
:options="forFind"
|
||||||
:group-select="false"
|
:group-select="false"
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
:searchable="searchMode"
|
:searchable="searchMode"
|
||||||
>
|
>
|
||||||
<template v-slot:option="props">
|
<template v-slot:option="props">
|
||||||
{{ props.option.title }}
|
<div v-html="props.option.title"></div>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:singleLabel="props">
|
<template v-slot:singleLabel="props">
|
||||||
{{ props.option.simpleName }}
|
{{ props.option.simpleName }}
|
||||||
@@ -25,15 +26,21 @@
|
|||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { getNpcColor } from "@/common_legacy";
|
||||||
|
import { automata초성All } from "@/util/automata초성";
|
||||||
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
||||||
import { defineComponent, PropType } from "vue";
|
import { defineComponent, PropType } from "vue";
|
||||||
import { procGeneralList, procTroopList } from './processingRes';
|
import {
|
||||||
|
procGeneralItem,
|
||||||
|
procGeneralList,
|
||||||
|
} from "./processingRes";
|
||||||
|
|
||||||
type SelectedGeneral = {
|
type SelectedGeneral = {
|
||||||
value: number;
|
value: number;
|
||||||
searchText: string;
|
searchText: string;
|
||||||
title: string;
|
title: string;
|
||||||
simpleName: string;
|
simpleName: string;
|
||||||
|
obj: procGeneralItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -46,13 +53,11 @@ export default defineComponent({
|
|||||||
type: Array as PropType<procGeneralList>,
|
type: Array as PropType<procGeneralList>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
cities: {
|
textHelper: {
|
||||||
type: Map as PropType<Map<number, { name: string; info?: string }>>,
|
type: Function as PropType<(item: procGeneralItem) => string>,
|
||||||
required: true,
|
required: false,
|
||||||
|
default: undefined,
|
||||||
},
|
},
|
||||||
troops: {
|
|
||||||
type: Object as PropType<procTroopList>,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
emits: ["update:modelValue"],
|
emits: ["update:modelValue"],
|
||||||
watch: {
|
watch: {
|
||||||
@@ -60,9 +65,9 @@ export default defineComponent({
|
|||||||
const target = this.targets.get(val);
|
const target = this.targets.get(val);
|
||||||
this.selectedGeneral = target;
|
this.selectedGeneral = target;
|
||||||
},
|
},
|
||||||
selectedGeneral(val: SelectedGeneral){
|
selectedGeneral(val: SelectedGeneral) {
|
||||||
this.$emit('update:modelValue', val.value);
|
this.$emit("update:modelValue", val.value);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const forFind = [];
|
const forFind = [];
|
||||||
@@ -71,12 +76,22 @@ export default defineComponent({
|
|||||||
let selectedGeneral;
|
let selectedGeneral;
|
||||||
|
|
||||||
for (const gen of this.generals) {
|
for (const gen of this.generals) {
|
||||||
|
|
||||||
|
const nameColor = getNpcColor(gen.npc);
|
||||||
|
const name = nameColor?`<span style="color:${nameColor}">${gen.name}</span>`:gen.name;
|
||||||
|
|
||||||
const [filteredTextH, filteredTextA] = filter초성withAlphabet(gen.name);
|
const [filteredTextH, filteredTextA] = filter초성withAlphabet(gen.name);
|
||||||
|
const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH);
|
||||||
const obj: SelectedGeneral = {
|
const obj: SelectedGeneral = {
|
||||||
value: gen.no,
|
value: gen.no,
|
||||||
title: `${gen.name}[${this.cities.get(gen.cityID)?.name}] (${gen.leadership}/${gen.leadership}/${gen.intel}) <병${gen.crew.toLocaleString()}/훈${gen.train}/사${gen.atmos}`,
|
title: this.textHelper
|
||||||
|
? this.textHelper(gen)
|
||||||
|
: `${name} (${gen.leadership}/${gen.leadership}/${
|
||||||
|
gen.intel
|
||||||
|
})`,
|
||||||
simpleName: gen.name,
|
simpleName: gen.name,
|
||||||
searchText: `${gen.name} ${filteredTextH} ${filteredTextA}`
|
searchText: `${gen.name} ${filteredTextH} ${filteredTextA} ${filteredTextHL1} ${filteredTextHL2}`,
|
||||||
|
obj: gen,
|
||||||
};
|
};
|
||||||
if (gen.no == this.modelValue) {
|
if (gen.no == this.modelValue) {
|
||||||
selectedGeneral = obj;
|
selectedGeneral = obj;
|
||||||
@@ -93,3 +108,25 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "@scss/common/variables.scss";
|
||||||
|
@import "@scss/common/bootswatch_custom_variables.scss";
|
||||||
|
@import "bootstrap/scss/bootstrap-utilities.scss";
|
||||||
|
|
||||||
|
.selectedGeneral {
|
||||||
|
$vue-multiselect-bg: $gray-700;
|
||||||
|
$vue-multiselect-color: $gray-100;
|
||||||
|
$form-select-color: $gray-100;
|
||||||
|
$text-muted: $gray-400;
|
||||||
|
$dark: $gray-100;
|
||||||
|
$light: $gray-700;
|
||||||
|
$vue-multiselect-option-selected-bg: $gray-600;
|
||||||
|
@import "@scss/common/vue-multiselect.scss";
|
||||||
|
color: $vue-multiselect-color;
|
||||||
|
|
||||||
|
input {
|
||||||
|
color: $vue-multiselect-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
<template>
|
||||||
|
<TopBackBar :title="commandName" type="chief" />
|
||||||
|
<div class="bg0">
|
||||||
|
<div>
|
||||||
|
장수의 자금이나 군량을 몰수합니다.<br />
|
||||||
|
몰수한것은 국가재산으로 귀속됩니다.<br />
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-5">
|
||||||
|
<GeneralSelect
|
||||||
|
:cities="citiesMap"
|
||||||
|
:generals="generalList"
|
||||||
|
:troops="troops"
|
||||||
|
v-model="selectedGeneralID"
|
||||||
|
:textHelper="textHelpGeneral"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<AmountSelect
|
||||||
|
:amountGuide="amountGuide"
|
||||||
|
v-model="amount"
|
||||||
|
:maxAmount="maxAmount"
|
||||||
|
:minAmount="minAmount"
|
||||||
|
/>
|
||||||
|
<div class="col-12 col-md-2 d-grid">
|
||||||
|
<b-button variant="primary" @click="submit">{{ commandName }}</b-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<BottomBar :title="commandName" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import GeneralSelect from "@/processing/GeneralSelect.vue";
|
||||||
|
import AmountSelect from "@/processing/AmountSelect.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";
|
||||||
|
import {
|
||||||
|
convertGeneralList,
|
||||||
|
procGeneralItem,
|
||||||
|
procGeneralKeyList,
|
||||||
|
procGeneralRawItemList,
|
||||||
|
procTroopList,
|
||||||
|
} from "../processingRes";
|
||||||
|
import { getNpcColor } from "@/common_legacy";
|
||||||
|
declare const commandName: string;
|
||||||
|
|
||||||
|
declare const procRes: {
|
||||||
|
distanceList: Record<number, number[]>;
|
||||||
|
cities: [number, string][];
|
||||||
|
generals: procGeneralRawItemList;
|
||||||
|
generalsKey: procGeneralKeyList;
|
||||||
|
minAmount: number;
|
||||||
|
maxAmount: number;
|
||||||
|
amountGuide: number[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
GeneralSelect,
|
||||||
|
AmountSelect,
|
||||||
|
TopBackBar,
|
||||||
|
BottomBar,
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const citiesMap = new Map<
|
||||||
|
number,
|
||||||
|
{
|
||||||
|
name: string;
|
||||||
|
info?: string;
|
||||||
|
}
|
||||||
|
>();
|
||||||
|
for (const [id, name] of procRes.cities) {
|
||||||
|
citiesMap.set(id, { name });
|
||||||
|
}
|
||||||
|
|
||||||
|
const generalList = convertGeneralList(
|
||||||
|
procRes.generalsKey,
|
||||||
|
procRes.generals
|
||||||
|
);
|
||||||
|
const amount = ref(1000);
|
||||||
|
const isGold = ref(true);
|
||||||
|
|
||||||
|
const selectedGeneralID = ref(generalList[0].no);
|
||||||
|
|
||||||
|
function textHelpGeneral(gen: procGeneralItem): string {
|
||||||
|
const nameColor = getNpcColor(gen.npc);
|
||||||
|
const name = nameColor
|
||||||
|
? `<span style="color:${nameColor}">${gen.name}</span>`
|
||||||
|
: gen.name;
|
||||||
|
return `${name} (금${gen.gold.toLocaleString()}/쌀${gen.rice.toLocaleString()}) (${
|
||||||
|
gen.leadership
|
||||||
|
}/${gen.leadership}/${gen.intel})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submit(e: Event) {
|
||||||
|
const event = new CustomEvent<Args>("customSubmit", {
|
||||||
|
detail: {
|
||||||
|
amount: amount.value,
|
||||||
|
isGold: isGold.value,
|
||||||
|
destGeneralID: selectedGeneralID.value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
unwrap(e.target).dispatchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
amount,
|
||||||
|
isGold,
|
||||||
|
selectedGeneralID,
|
||||||
|
citiesMap: ref(citiesMap),
|
||||||
|
distanceList: procRes.distanceList,
|
||||||
|
minAmount: ref(procRes.minAmount),
|
||||||
|
maxAmount: ref(procRes.maxAmount),
|
||||||
|
amountGuide: procRes.amountGuide,
|
||||||
|
generalList,
|
||||||
|
commandName,
|
||||||
|
textHelpGeneral,
|
||||||
|
submit,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -16,18 +16,19 @@
|
|||||||
목록을 선택하거나 도시를 클릭하세요.<br />
|
목록을 선택하거나 도시를 클릭하세요.<br />
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-4">
|
<div class="col-12 col-md-6">
|
||||||
<GeneralSelect
|
<GeneralSelect
|
||||||
:cities="citiesMap"
|
:cities="citiesMap"
|
||||||
:generals="generalList"
|
:generals="generalList"
|
||||||
:troops="troops"
|
:troops="troops"
|
||||||
|
:textHelper="textHelpGeneral"
|
||||||
v-model="selectedGeneralID"
|
v-model="selectedGeneralID"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4">
|
<div class="col-12 col-md-4">
|
||||||
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
|
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4">
|
<div class="col-12 col-md-2 d-grid">
|
||||||
<b-button @click="submit">{{ commandName }}</b-button>
|
<b-button @click="submit">{{ commandName }}</b-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,10 +49,12 @@ import TopBackBar from "@/components/TopBackBar.vue";
|
|||||||
import BottomBar from "@/components/BottomBar.vue";
|
import BottomBar from "@/components/BottomBar.vue";
|
||||||
import {
|
import {
|
||||||
convertGeneralList,
|
convertGeneralList,
|
||||||
|
procGeneralItem,
|
||||||
procGeneralKeyList,
|
procGeneralKeyList,
|
||||||
procGeneralRawItemList,
|
procGeneralRawItemList,
|
||||||
procTroopList,
|
procTroopList,
|
||||||
} from "../processingRes";
|
} from "../processingRes";
|
||||||
|
import { convertDictById, getNpcColor } from "@/common_legacy";
|
||||||
declare const mapTheme: string;
|
declare const mapTheme: string;
|
||||||
declare const currentCity: number;
|
declare const currentCity: number;
|
||||||
declare const commandName: string;
|
declare const commandName: string;
|
||||||
@@ -101,6 +104,13 @@ export default defineComponent({
|
|||||||
|
|
||||||
const selectedGeneralID = ref(generalList[0].no);
|
const selectedGeneralID = ref(generalList[0].no);
|
||||||
|
|
||||||
|
function textHelpGeneral(gen: procGeneralItem): string{
|
||||||
|
const troops = (!gen.troopID)?'':`,${procRes.troops[gen.troopID].name}`;
|
||||||
|
const nameColor = getNpcColor(gen.npc);
|
||||||
|
const name = nameColor?`<span style="color:${nameColor}">${gen.name}</span>`:gen.name;
|
||||||
|
return `${name} [${citiesMap.get(gen.cityID)?.name}${troops}] (${gen.leadership}/${gen.leadership}/${gen.intel}) <병${gen.crew.toLocaleString()}/훈${gen.train}/사${gen.atmos}>`;
|
||||||
|
}
|
||||||
|
|
||||||
async function submit(e: Event) {
|
async function submit(e: Event) {
|
||||||
const event = new CustomEvent<Args>("customSubmit", {
|
const event = new CustomEvent<Args>("customSubmit", {
|
||||||
detail: {
|
detail: {
|
||||||
@@ -109,6 +119,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
unwrap(e.target).dispatchEvent(event);
|
unwrap(e.target).dispatchEvent(event);
|
||||||
|
|
||||||
|
// title: `${gen.name}[${this.cities.get(gen.cityID)?.name}] (${gen.leadership}/${gen.leadership}/${gen.intel}) <병${gen.crew.toLocaleString()}/훈${gen.train}/사${gen.atmos}`,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -122,6 +135,7 @@ export default defineComponent({
|
|||||||
generalList,
|
generalList,
|
||||||
commandName,
|
commandName,
|
||||||
selectedCity,
|
selectedCity,
|
||||||
|
textHelpGeneral,
|
||||||
submit,
|
submit,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { defineComponent } from 'vue'
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export { default as che_국기변경 } from "./che_국기변경.vue";
|
export { default as che_국기변경 } from "./che_국기변경.vue";
|
||||||
export { default as che_국호변경 } from "./che_국호변경.vue";
|
export { default as che_국호변경 } from "./che_국호변경.vue";
|
||||||
export { default as che_급습 } from "./che_급습.vue";
|
export { default as che_급습 } from "./che_급습.vue";
|
||||||
|
export { default as che_몰수 } from "./che_몰수.vue";
|
||||||
export { default as che_발령 } from "./che_발령.vue";
|
export { default as che_발령 } from "./che_발령.vue";
|
||||||
export { default as che_포상 } from "./che_포상.vue";
|
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { automata초성All } from "@/util/automata초성";
|
||||||
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
import { filter초성withAlphabet } from "@/util/filter초성withAlphabet";
|
||||||
import { defineComponent, PropType } from "vue";
|
import { defineComponent, PropType } from "vue";
|
||||||
import { procNationItem } from "./processingRes";
|
import { procNationItem } from "./processingRes";
|
||||||
@@ -75,13 +76,14 @@ export default defineComponent({
|
|||||||
const [filteredTextH, filteredTextA] = filter초성withAlphabet(
|
const [filteredTextH, filteredTextA] = filter초성withAlphabet(
|
||||||
nationItem.name
|
nationItem.name
|
||||||
);
|
);
|
||||||
|
const [filteredTextHL1, filteredTextHL2] = automata초성All(filteredTextH);
|
||||||
const obj: SelectedNation = {
|
const obj: SelectedNation = {
|
||||||
value: nationItem.id,
|
value: nationItem.id,
|
||||||
title: nationItem.name,
|
title: nationItem.name,
|
||||||
info: nationItem.info,
|
info: nationItem.info,
|
||||||
simpleName: nationItem.name,
|
simpleName: nationItem.name,
|
||||||
notAvailable: nationItem.notAvailable,
|
notAvailable: nationItem.notAvailable,
|
||||||
searchText: `${nationItem.name} ${filteredTextH} ${filteredTextA}`,
|
searchText: `${nationItem.name} ${filteredTextH} ${filteredTextA} ${filteredTextHL1} ${filteredTextHL2}`,
|
||||||
};
|
};
|
||||||
if (nationItem.id == this.modelValue) {
|
if (nationItem.id == this.modelValue) {
|
||||||
selectedNation = obj;
|
selectedNation = obj;
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
const convListLevel1: Record<string, Record<string, string>> = {
|
||||||
|
'ㄱ': {
|
||||||
|
'ㅅ': 'ㄳ',
|
||||||
|
},
|
||||||
|
'ㄴ': {
|
||||||
|
'ㅈ': 'ㄵ',
|
||||||
|
'ㅎ': 'ㄶ',
|
||||||
|
},
|
||||||
|
'ㄹ': {
|
||||||
|
'ㅂ': 'ㄼ',
|
||||||
|
'ㄱ': 'ㄺ',
|
||||||
|
'ㅅ': 'ㄽ',
|
||||||
|
'ㅁ': 'ㄻ',
|
||||||
|
'ㅎ': 'ㅀ',
|
||||||
|
'ㅌ': 'ㄾ',
|
||||||
|
'ㅍ': 'ㄿ',
|
||||||
|
},
|
||||||
|
'ㅂ': {
|
||||||
|
'ㅅ': 'ㅄ',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const convListLevel2: Record<string, Record<string, string>> = {
|
||||||
|
'ㄱ': {
|
||||||
|
'ㄱ': 'ㄲ',
|
||||||
|
'ㅅ': 'ㄳ',
|
||||||
|
},
|
||||||
|
'ㄴ': {
|
||||||
|
'ㅈ': 'ㄵ',
|
||||||
|
'ㅎ': 'ㄶ',
|
||||||
|
},
|
||||||
|
'ㄷ': {
|
||||||
|
'ㄷ': 'ㄸ',
|
||||||
|
},
|
||||||
|
'ㄹ': {
|
||||||
|
'ㅂ': 'ㄼ',
|
||||||
|
'ㄱ': 'ㄺ',
|
||||||
|
'ㅅ': 'ㄽ',
|
||||||
|
'ㅁ': 'ㄻ',
|
||||||
|
'ㅎ': 'ㅀ',
|
||||||
|
'ㅌ': 'ㄾ',
|
||||||
|
'ㅍ': 'ㄿ',
|
||||||
|
},
|
||||||
|
'ㅂ': {
|
||||||
|
'ㅂ': 'ㅃ',
|
||||||
|
'ㅅ': 'ㅄ',
|
||||||
|
},
|
||||||
|
'ㅅ': {
|
||||||
|
'ㅅ': 'ㅆ',
|
||||||
|
},
|
||||||
|
'ㅈ': {
|
||||||
|
'ㅈ': 'ㅉ',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function automata초성(text: string, convList: Record<string, Record<string, string>>): string{
|
||||||
|
const result: string[] = [];
|
||||||
|
let head: undefined | string = undefined;
|
||||||
|
for (const ch of text) {
|
||||||
|
if (head === undefined) {
|
||||||
|
if(!(ch in convList)){
|
||||||
|
result.push(ch);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
head = ch;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextConv = convList[head];
|
||||||
|
if(ch in nextConv){
|
||||||
|
result.push(nextConv[ch]);
|
||||||
|
head = undefined;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push(head);
|
||||||
|
if(!(ch in convList)){
|
||||||
|
result.push(ch);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
head = ch;
|
||||||
|
}
|
||||||
|
if(head !== undefined){
|
||||||
|
result.push(head);
|
||||||
|
}
|
||||||
|
return result.join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function automata초성All(text: string): [string, string]{
|
||||||
|
return [automata초성(text, convListLevel1), automata초성(text, convListLevel2)];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function automata초성Level1(text: string): string{
|
||||||
|
return automata초성(text, convListLevel1);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function automata초성Level2(text: string): string {
|
||||||
|
return automata초성(text, convListLevel2);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
const charList = [
|
||||||
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||||
|
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
|
||||||
|
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
|
||||||
|
'u', 'v', 'w', 'x', 'y', 'z',
|
||||||
|
];
|
||||||
|
|
||||||
|
export function randStr(len: number): string {
|
||||||
|
const result = [];
|
||||||
|
const charListLen = charList.length;
|
||||||
|
let isStart = true;
|
||||||
|
|
||||||
|
while(len > 0){
|
||||||
|
const randChrIdx = Math.floor(Math.random() * charListLen);
|
||||||
|
if(isStart){
|
||||||
|
if(randChrIdx == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
isStart = false;
|
||||||
|
}
|
||||||
|
result.push(charList[randChrIdx]);
|
||||||
|
len -= 1;
|
||||||
|
}
|
||||||
|
return result.join('');
|
||||||
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
import '@scss/processing.scss';
|
import '@scss/processing.scss';
|
||||||
|
|
||||||
import $ from 'jquery';
|
|
||||||
exportWindow($, '$');
|
|
||||||
import { exportWindow } from '@util/exportWindow';
|
import { exportWindow } from '@util/exportWindow';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
|
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
|
||||||
import { convertFormData } from '@util/convertFormData';
|
import { convertFormData } from '@util/convertFormData';
|
||||||
import { InvalidResponse } from '@/defs';
|
import { InvalidResponse } from '@/defs';
|
||||||
import { unwrap } from "@util/unwrap";
|
import { unwrap } from "@util/unwrap";
|
||||||
import { defaultSelectCityByMap } from '@/defaultSelectCityByMap';
|
|
||||||
import { defaultSelectNationByMap } from '@/defaultSelectNationByMap';
|
|
||||||
import { colorSelect } from '@/colorSelect';
|
|
||||||
import { recruitCrewForm } from '@/recruitCrewForm';
|
import { recruitCrewForm } from '@/recruitCrewForm';
|
||||||
import BootstrapVue3 from 'bootstrap-vue-3'
|
import BootstrapVue3 from 'bootstrap-vue-3'
|
||||||
import Multiselect from 'vue-multiselect';
|
import Multiselect from 'vue-multiselect';
|
||||||
|
|||||||
Reference in New Issue
Block a user