refac: vue 파일 구조 변경

This commit is contained in:
2021-12-12 21:48:48 +09:00
parent 8a899c9afe
commit 3c09e77fba
19 changed files with 156 additions and 146 deletions
+40 -37
View File
@@ -1,39 +1,42 @@
module.exports = {
root: true,
parser: "vue-eslint-parser",
parserOptions: {
"project": "./tsconfig.json"
},
ignorePatterns: ['*.test.ts', '.eslintrc.cjs', 'webpack.config.cjs', '*.js'],
overrides: [{
files: ['*.ts', '*.tsx', "*.vue"],
}],
plugins: [
"@typescript-eslint",
root: true,
parser: "vue-eslint-parser",
"env": {
"browser": true,
"es2021": true
},
ignorePatterns: ['*.test.ts', '.eslintrc.cjs', 'webpack.config.cjs', '*.js'],
overrides: [{
files: ['*.ts', '*.tsx', "*.vue"],
}],
plugins: [
"@typescript-eslint"
],
],
extends: [
"eslint:recommended",
'plugin:vue/essential',
'@vue/typescript',
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
rules: {
'@typescript-eslint/no-floating-promises': 'error',
"vue/no-multiple-template-root": "off",
"vue/no-v-for-template-key": "off",
"vue/multi-word-component-names": "off",//TODO: 삭제
},
settings: {
'import/resolver': {
alias: {
map: [
['@', './hwe/ts'],
['@util', './hwe/ts/util'],
['@scss', './hwe/scss'],
]
}
}
},
}
extends: [
"eslint:recommended",
"plugin:vue/vue3-essential",
"plugin:@typescript-eslint/recommended"
],
parserOptions: {
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaVersion": 2021,
"parser": "@typescript-eslint/parser",
extraFileExtensions: ['.vue']
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
},
settings: {
'import/resolver': {
alias: {
map: [
['@', './hwe/ts'],
['@util', './hwe/ts/util'],
['@scss', './hwe/scss'],
]
}
}
},
};
+10 -51
View File
@@ -54,17 +54,15 @@ $nationStor->cacheValues(['notice', 'scout_msg', 'available_war_setting_cnt']);
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?= UniqueConst::$serverName ?>: 내무부</title>
<script>
var editable = <?= (($me['officer_level'] >= 5 || $permission == 4) ? 'true' : 'false') ?>;
var storedData = <?= Json::encode([
"nationMsg" => $nationStor->notice ?? '',
"scoutMsg" => $nationStor->scout_msg ?? ''
]) ?>;
</script>
<?= WebUtil::printStaticValues([
'editable' => ($me['officer_level'] >= 5 || $permission == 4),
'nationMsg' => $nationStor->notice ?? '',
'scoutMsg' => $nationStor->scout_msg ?? '',
]) ?>
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
<?= WebUtil::printCSS('../d_shared/common.css') ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
<?= WebUtil::printDist('ts', ['common', 'dipcenter']) ?>
<?= WebUtil::printDist('vue', 'v_dipcenter', true) ?>
</head>
<body>
@@ -170,51 +168,12 @@ $nationStor->cacheValues(['notice', 'scout_msg', 'available_war_setting_cnt']);
}
?>
<table width=1000 class='tb_layout bg0' style='margin:auto;'>
<div class='tb_layout bg0' style='margin:auto;width: 1000px;' id="editorForm">
</div>
<table class="tb_layout bg0" style="margin:auto;">
<form name=form1 method=post action=c_dipcenter.php>
<tr>
<td colspan=2 height=10></td>
</tr>
<tr>
<td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메시지</td>
</tr>
<tr>
<td colspan='2'>
<div id='noticeForm'>
<div class='bg1' style="display: flex; justify-content: space-around">
<div style='flex: 1 1 auto;'>
국가 방침
</div>
<div>
<input type='submit' class='submit' name=btn value='국가방침 수정'><input type='button' class='cancel_edit' value='취소'>
</div>
</div>
<input type='hidden' class='input_form' name='msg' data-global='nationMsg'>
<div class='edit_form viewer'></div>
</div>
</td>
</tr>
<tr>
<td colspan='2'>
<div id='scoutMsgForm'>
<div class='bg1' style="display: flex; justify-content: space-around">
<div style='flex: 1 1 auto;'>
임관 권유
</div>
<div>
<input type='submit' class='submit' name=btn value='임관 권유문 수정'><input type='button' class='cancel_edit' value='취소'>
</div>
</div>
<div style='border-bottom:solid gray 0.5px;'>870px x 200px를 넘어서는 내용은 표시되지 않습니다.</div>
<input type='hidden' class='input_form' name='scoutMsg' data-global='scoutMsg'>
<div style="width:870px;margin-left:auto;">
<div class='edit_form viewer'></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td colspan=2 align=center bgcolor=green>예 산 &amp; 정 책</td>
</tr>
-2
View File
@@ -1,6 +1,4 @@
@import '@scss/common/bootstrap5.scss';
@import 'summernote/dist/summernote-bs5.css';
#scoutMsgForm .viewer{
max-height:200px;
+1 -1
View File
@@ -102,7 +102,7 @@ export type BoardCommentItem = {
};
export default defineComponent({
name: "Board",
name: "PageBoard",
components: {
TopBackBar,
BoardArticle,
@@ -246,13 +246,12 @@
</div>
</div>
<div class="row" v-for="(log, idx) in lastInheritPointLogs" :key="idx">
<div class="col a-right" style="max-width:20ch">
<small class="text-muted tnum">[{{log.date}}]</small>
<div class="col a-right" style="max-width: 20ch">
<small class="text-muted tnum">[{{ log.date }}]</small>
</div>
<div class="col a-left">
{{log.text}}
{{ log.text }}
</div>
</div>
</div>
</template>
@@ -273,7 +272,7 @@ type InheritanceType =
| "max_belong"
| "max_domestic_critical"
| "active_action"
// | "snipe_combat"
// | "snipe_combat"
| "combat"
| "sabotage"
| "unifier"
@@ -284,11 +283,11 @@ type InheritanceType =
type InheritanceViewType = InheritanceType | "sum" | "new";
declare const lastInheritPointLogs: {
server_id: string,
year: number,
month: number,
date: string,
text: string,
server_id: string;
year: number;
month: number;
date: string;
text: string;
}[];
declare const items: Record<InheritanceType, number>;
@@ -323,9 +322,9 @@ const inheritanceViewText: Record<
},
active_action: {
title: "능동 행동 수",
info: "장수 동향에 본인의 이름이 직접 나타난 수입니다.<br>일부 사령턴은 제외됩니다."
info: "장수 동향에 본인의 이름이 직접 나타난 수입니다.<br>일부 사령턴은 제외됩니다.",
},
/* snipe_combat: {
/* snipe_combat: {
title: "병종 상성 우위 횟수",
info: "유리한 상성을 가지고 전투했습니다.",
},*/
@@ -440,7 +439,7 @@ declare const availableUnique: Record<
>;
export default defineComponent({
name: "InheritPoint",
name: "PageInheritPoint",
data() {
const inheritBuff = {} as Record<inheritBuffType, number>;
for (const buffKey of Object.keys(
@@ -701,7 +700,7 @@ export default defineComponent({
text-align: right;
}
.tnum{
font-feature-settings: 'tnum';
.tnum {
font-feature-settings: "tnum";
}
</style>
+1 -1
View File
@@ -389,7 +389,7 @@ type APIArgs = {
};
export default defineComponent({
name: "Join",
name: "PageJoin",
components: {
TopBackBar,
CTable,
@@ -511,7 +511,7 @@ declare const lastSetters: {
};
export default defineComponent({
name: "NPCControl",
name: "PageNPCControl",
components: {
TopBackBar,
NumberInputWithInfo,
+53
View File
@@ -0,0 +1,53 @@
<template>
<div> &amp; 임관 권유 메시지</div>
<div id="noticeForm"></div>
<!--<b-button>국가방침 수정</b-button><b-button>취소</b-button>-->
<!--<div id="noticeForm">
<div class="bg1" style="display: flex; justify-content: space-around">
<div style="flex: 1 1 auto">국가 방침</div>
<div>
<b-button>국가방침 수정</b-button><b-button>취소</b-button>
</div>
</div>
<div class="edit_form viewer"></div>
</div>
<div id="scoutMsgForm">
<div class="bg1" style="display: flex; justify-content: space-around">
<div style="flex: 1 1 auto">임관 권유</div>
<div>
<b-button>임관 권유문 수정</b-button><b-button>취소</b-button>
</div>
</div>
<div style="border-bottom: solid gray 0.5px">
870px x 200px를 넘어서는 내용은 표시되지 않습니다.
</div>
<div style="width: 870px; margin-left: auto">
<div class="edit_form viewer"></div>
</div>
</div>!-->
</template>
<script lang="ts">
import "@scss/dipcenter.scss";
import "@scss/common_legacy.scss";
import { defineComponent } from "vue";
declare const editable: boolean;
declare const nationMsg: string;
declare const scoutMsg: string;
export default defineComponent({
name: "PartialDipcenter",
components: {},
data() {
console.log(editable, ",", nationMsg, ",", scoutMsg);
return {
editable,
nationMsg,
scoutMsg,
};
},
/*methods: {},*/
});
</script>
@@ -287,7 +287,7 @@ function isDropdownChildren(e?: Event): boolean {
const searchModeKey = `sammo_${serverID}_searchMode`;
export default defineComponent({
name: "ReservedCommand",
name: "PartialReservedCommand",
methods: {
updateNow() {
+3 -2
View File
@@ -13,7 +13,6 @@
"bossInfo": "bossInfo.ts",
"myPage": "myPage.ts",
"extExpandCity": "extExpandCity.ts",
"dipcenter": "dipcenter.ts",
"diplomacy": "diplomacy.ts",
"currentCity": "currentCity.ts",
"hallOfFame": "hallOfFame.ts",
@@ -27,6 +26,8 @@
"v_board": "v_board.ts",
"v_NPCControl": "v_NPCControl.ts",
"v_join": "v_join.ts",
"v_main": "v_main.ts"
"v_main": "v_main.ts",
"v_dipcenter": "v_dipcenter.ts"
}
}
+1 -1
View File
@@ -50,7 +50,7 @@
</table>
</template>
<script lang="ts">
import { BoardArticleItem } from "@/Board.vue";
import { BoardArticleItem } from "@/PageBoard.vue";
import BoardComment from "@/components/BoardComment.vue";
import { defineComponent, PropType } from "vue";
import axios from "axios";
+1 -1
View File
@@ -7,7 +7,7 @@
</tr>
</template>
<script lang="ts">
import { BoardCommentItem } from "@/Board.vue";
import { BoardCommentItem } from "@/PageBoard.vue";
import { defineComponent, PropType } from "vue";
export default defineComponent({
+1 -1
View File
@@ -1,7 +1,7 @@
import "@scss/common/bootstrap5.scss";
import { createApp } from 'vue'
import NPCControl from '@/NPCControl.vue';
import NPCControl from '@/PageNPCControl.vue';
import BootstrapVue3 from 'bootstrap-vue-3'
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
+2 -2
View File
@@ -1,5 +1,5 @@
import { createApp } from 'vue'
import Board from '@/Board.vue';
import PageBoard from '@/PageBoard.vue';
import BootstrapVue3 from 'bootstrap-vue-3'
import "@scss/common/bootstrap5.scss";
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
@@ -9,6 +9,6 @@ declare const isSecretBoard: boolean;
setAxiosXMLHttpRequest();
createApp(Board, {
createApp(PageBoard, {
isSecretBoard
}).use(BootstrapVue3).mount('#app')
+15 -18
View File
@@ -1,24 +1,22 @@
import '@scss/dipcenter.scss'
import $ from 'jquery';
exportWindow($, 'jquery');
import { createApp } from 'vue'
import 'bootstrap';
import 'summernote/dist/summernote-bs5';
import '@/summernote-image-flip';
import '@/summernote-ko-KR';
import { activateFlip } from "@/legacy/activateFlip";
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 { exportWindow } from './util/exportWindow';
//import { htmlReady } from './util/htmlReady';
createApp(PartialDipcenter).use(BootstrapVue3).mount('#editorForm');
setAxiosXMLHttpRequest();
declare const editable: boolean;
htmlReady(function(){
//activateFlip();
})
declare const storedData: {
nationMsg: string,
scoutMsg: string,
}
$(function ($) {
setAxiosXMLHttpRequest();
/*
function guiEditorInit($obj: JQuery<HTMLElement>, editable: boolean) {
const $submitBtn = $obj.find('.submit');
const $noticeInput = $obj.find('.input_form');
@@ -148,5 +146,4 @@ $(function ($) {
guiEditorInit($('#noticeForm'), editable);
guiEditorInit($('#scoutMsgForm'), editable);
activateFlip();
})
*/
+2 -2
View File
@@ -1,7 +1,7 @@
import "@scss/common/bootstrap5.scss";
import { createApp } from 'vue'
import InheritPoint from '@/inheritPoint.vue';
import PageInheritPoint from '@/PageInheritPoint.vue';
import BootstrapVue3 from 'bootstrap-vue-3'
createApp(InheritPoint).use(BootstrapVue3).mount('#app');
createApp(PageInheritPoint).use(BootstrapVue3).mount('#app');
+2 -2
View File
@@ -1,7 +1,7 @@
import { createApp } from 'vue'
import Join from '@/Join.vue';
import PageJoin from '@/PageJoin.vue';
import BootstrapVue3 from 'bootstrap-vue-3'
import "@scss/common/bootstrap5.scss";
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
createApp(Join).use(BootstrapVue3).mount('#app')
createApp(PageJoin).use(BootstrapVue3).mount('#app')
+2 -2
View File
@@ -6,7 +6,7 @@ exportWindow(scrollHardTo, 'scrollHardTo');
import { exportWindow } from '@util/exportWindow';
import { scrollHardTo } from '@util/scrollHardTo';
import { createApp } from 'vue'
import ReservedCommand from '@/ReservedCommand.vue';
import PartialReservedCommand from '@/PartialReservedCommand.vue';
import BootstrapVue3 from 'bootstrap-vue-3'
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
import Multiselect from 'vue-multiselect';
@@ -16,6 +16,6 @@ import { auto500px } from './util/auto500px';
setAxiosXMLHttpRequest();
createApp(ReservedCommand).use(BootstrapVue3).component('v-multiselect', Multiselect).mount('#reservedCommandList');
createApp(PartialReservedCommand).use(BootstrapVue3).component('v-multiselect', Multiselect).mount('#reservedCommandList');
auto500px();
+6 -6
View File
@@ -23,7 +23,7 @@
"@types/downloadjs": "^1.4.2",
"@types/linkifyjs": "^2.1.4",
"@types/select2": "^4.0.54",
"@types/summernote": "^0.8.6",
"@vueup/vue-quill": "^1.0.0-beta.7",
"async-validator": "^4.0.7",
"axios": "^0.24.0",
"bootstrap": "^5.1.3",
@@ -38,7 +38,6 @@
"lodash": "^4.17.21",
"query-string": "^7.0.1",
"select2": "^4.0",
"summernote": "^0.8.20",
"vue": "^3.2.2",
"vue-multiselect": "^3.0.0-alpha.2",
"vue-types": "^4.1.1",
@@ -55,22 +54,23 @@
"@types/node": "^16.11.12",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"@vue/compiler-sfc": "^3.2.24",
"@vue/compiler-sfc": "^3.2.26",
"@vue/eslint-config-typescript": "^9.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-preset-modern-browsers": "^15.0.2",
"bootswatch": "^5.1.3",
"clean-terminal-webpack-plugin": "^3.0.0",
"css-loader": "^6.5.1",
"esbuild-loader": "^2.16.0",
"esbuild-loader": "^2.17.0",
"eslint": "^8.4.1",
"eslint-plugin-vue": "^8.2.0",
"file-loader": "^6.2.0",
"mini-css-extract-plugin": "^2.4.5",
"pre-commit": "^1.2.2",
"sass": "^1.44.0",
"sass": "^1.45.0",
"sass-loader": "^12.4.0",
"style-loader": "^3.3.1",
"typescript": "^4.5.2",
"typescript": "^4.5.3",
"url-loader": "^4.1.1",
"vue-eslint-parser": "^8.0.1",
"vue-loader": "^16.5.0",