refac: linter 관련 설정 변경 및 적용, map_theme 변수 제거

- eslint에 prettier 조합
- prettierrc에 width 120, tabWidth 2
- gameStor->map_theme 제거
- map_theme, mapTheme를 GameConst::$mapName으로 대체
- eslint에서 vue/vue3-essential 대신 vue3-recommended 적용
  - vue/max-attributes-per-line 완화
  - vue/v-on-event-hyphenation 해제
  - vue/attribute-hyphenation 해제
- 일부 tsc import type warning 해결
- 일부 vue template type warning 해결
- 일부 vue SFC를 script setup으로 변경
  - TipTap
  - TopBackBar
  - BottomBackBar
  - BoardArticle
  - ProcessCity
This commit is contained in:
2022-03-29 02:06:47 +09:00
parent e569ffe8f4
commit 4f4533e533
79 changed files with 4541 additions and 3020 deletions
+12 -11
View File
@@ -1,8 +1,8 @@
<template>
<div
v-for="(officer, _idx) in [chiefList[chiefLevel]]"
:key="_idx"
:class="[`chiefBox${chiefLevel}`, 'subRows']"
v-for="(officer, idx) in [chiefList[chiefLevel]]"
:key="idx"
:style="style"
@click="$emit('click', this)"
>
@@ -13,21 +13,22 @@
textDecoration: isMe ? 'underline' : undefined,
}"
>
{{ officer?(officer?.name ?? "-"):'' }}
{{ officer ? officer?.name ?? "-" : "" }}
</div>
<div class="bg1 center row gx-0">
<div class="col">{{ officer?.officerLevelText }}</div>
<div class="col">{{ officer?((officer?.turnTime ?? " - ").slice(-5)):'' }}</div>
<div class="col">
{{ officer?.officerLevelText }}
</div>
<div class="col">
{{ officer ? (officer?.turnTime ?? " - ").slice(-5) : "" }}
</div>
</div>
<div
class="tableCell align-self-center turn_pad"
v-for="(turn, idx) in officer?.turn??[]"
v-for="(turn, idx) in officer?.turn ?? []"
:key="idx"
class="tableCell align-self-center turn_pad"
:style="{
fontSize:
mb_strwidth(turn.brief) > 28
? `${28 / mb_strwidth(turn.brief)}em`
: undefined,
fontSize: mb_strwidth(turn.brief) > 28 ? `${28 / mb_strwidth(turn.brief)}em` : undefined,
}"
>
{{ turn.brief }}
+33 -25
View File
@@ -1,30 +1,39 @@
<template>
<div style="position:relative">
<div style="position: relative">
<DragSelect
v-slot="{ selected }"
:class="['subRows', 'chiefCommand']"
:style="style"
:disabled="!props.officer || !isEditMode"
attribute="turnIdx"
@dragStart="dragStart()"
@dragDone="dragDone(...$event)"
v-slot="{ selected }"
>
<div class="bg1 center row gx-0" style="font-size: 1.2em">
<div
class="col-5 align-self-center text-end"
>{{ officer ? `${officer.officerLevelText} : ` : "" }}</div>
<div class="col-5 align-self-center text-end">
{{ officer ? `${officer.officerLevelText} : ` : "" }}
</div>
<div
class="col-7 align-self-center"
:style="{
color: getNpcColor(officer?.npcType ?? 0),
}"
>{{ officer?.name }}</div>
>
{{ officer?.name }}
</div>
</div>
<div :turnIdx="vidx" class="row c-bg2 gx-0" v-for="vidx in maxTurn" :key="vidx">
<div v-for="vidx in maxTurn" :key="vidx" :turnIdx="vidx" class="row c-bg2 gx-0">
<div
:class="['col-2', 'time_pad', 'f_tnum', ((isDragToggle || isCopyButtonShown) && selected.has(vidx.toString())) ? 'inverted' : undefined]"
>{{ turnTimes[vidx - 1] }}</div>
<div class="center" v-if="!officer || (!officer.turn) || !(vidx - 1 in officer.turn)"></div>
:class="[
'col-2',
'time_pad',
'f_tnum',
(isDragToggle || isCopyButtonShown) && selected.has(vidx.toString()) ? 'inverted' : undefined,
]"
>
{{ turnTimes[vidx - 1] }}
</div>
<div v-if="!officer || !officer.turn || !(vidx - 1 in officer.turn)" class="center" />
<div
v-else
class="tableCell align-self-center col-10 center turn_pad"
@@ -34,7 +43,9 @@
? `${28 / mb_strwidth(officer.turn[vidx - 1].brief)}em`
: undefined,
}"
>{{ officer.turn[vidx - 1].brief }}</div>
>
{{ officer.turn[vidx - 1].brief }}
</div>
</div>
</DragSelect>
<BButton
@@ -47,7 +58,9 @@
}"
@blur="isCopyButtonShown = false"
@click="tryCopy()"
>복사하기</BButton>
>
복사하기
</BButton>
</div>
</template>
<script setup lang="ts">
@@ -65,21 +78,21 @@ import DragSelect from "@/components/DragSelect.vue";
import { BButton } from "bootstrap-vue-3";
import { QueryActionHelper } from "@/util/QueryActionHelper";
const props = defineProps({
style: VueTypes.object.isRequired,
officer: {
type: Object as PropType<ChiefResponse["chiefList"][0]>,
default: undefined,
},
turnTerm: VueTypes.integer.isRequired,
maxTurn: VueTypes.integer.isRequired,
})
});
const btnPos = ref(0);
const btnCopy = ref<InstanceType<typeof BButton> | null>(null);
const storedActionsHelper = inject<StoredActionsHelper>('storedNationActionsHelper');
const isEditMode = (storedActionsHelper?.isEditMode) ?? ref(false);
const storedActionsHelper = inject<StoredActionsHelper>("storedNationActionsHelper");
const isEditMode = storedActionsHelper?.isEditMode ?? ref(false);
const isDragToggle = ref(false);
const isCopyButtonShown = ref(false);
@@ -91,16 +104,15 @@ onMounted(() => {
if (props.officer === undefined) {
return;
}
queryActionHelper.reservedCommandList.value = props.officer.turn.map(rawTurn => {
queryActionHelper.reservedCommandList.value = props.officer.turn.map((rawTurn) => {
return {
...rawTurn,
time: '',
}
time: "",
};
});
console.log(queryActionHelper.reservedCommandList.value);
});
function dragStart() {
isDragToggle.value = true;
}
@@ -139,7 +151,6 @@ function dragDone(...rawSelectedTurn: string[]) {
}
function tryCopy() {
const actions = queryActionHelper.extractQueryActions();
isCopyButtonShown.value = false;
@@ -160,10 +171,7 @@ if (!props.officer || !props.officer.turnTime) {
const baseTurnTime = parseTime(props.officer.turnTime);
for (const idx of range(props.officer.turn.length)) {
turnTimes.value.push(
formatTime(
addMinutes(baseTurnTime, idx * props.turnTerm),
props.turnTerm >= 5 ? "HH:mm" : "mm:ss"
)
formatTime(addMinutes(baseTurnTime, idx * props.turnTerm), props.turnTerm >= 5 ? "HH:mm" : "mm:ss")
);
}
}