diff --git a/hwe/css/common.css b/hwe/css/common.css index 0dfca57d..60be225d 100644 --- a/hwe/css/common.css +++ b/hwe/css/common.css @@ -245,11 +245,6 @@ div.bar_out div.bar_in { padding: 0; } -.commandBasic { - background-color: black; - color: white; -} - .compensatePositive { color: skyblue; } @@ -258,10 +253,6 @@ div.bar_out div.bar_in { color: orange; } -.compensateNeutral { - color: white; -} - .commandBasic.commandImpossible { background-color: red; color: white; diff --git a/hwe/func.php b/hwe/func.php index 1600a95d..f65e3cf2 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -480,6 +480,7 @@ function getCommandTable(General $general){ 'compensation'=>$commandObj->getCompensationStyle(), 'possible'=>$commandObj->hasMinConditionMet(), 'title'=>$commandObj->getCommandDetailTitle(), + 'simpleName'=>$commandObj->getName(), 'reqArg'=>$commandObj::$reqArg, ]; } diff --git a/hwe/sammo/Command/General/che_랜덤임관.php b/hwe/sammo/Command/General/che_랜덤임관.php index 6343735e..84761596 100644 --- a/hwe/sammo/Command/General/che_랜덤임관.php +++ b/hwe/sammo/Command/General/che_랜덤임관.php @@ -25,7 +25,7 @@ use sammo\MustNotBeReachedException; class che_랜덤임관 extends Command\GeneralCommand { - static protected $actionName = '랜덤임관'; + static protected $actionName = '무작위 국가로 임관'; protected function argTest(): bool { diff --git a/hwe/sammo/Command/General/che_장수대상임관.php b/hwe/sammo/Command/General/che_장수대상임관.php index 8977fc79..939e40f1 100644 --- a/hwe/sammo/Command/General/che_장수대상임관.php +++ b/hwe/sammo/Command/General/che_장수대상임관.php @@ -24,7 +24,7 @@ use sammo\CityConst; class che_장수대상임관 extends Command\GeneralCommand{ - static protected $actionName = '따라 임관'; + static protected $actionName = '장수를 따라 임관'; static public $reqArg = true; protected function argTest():bool{ diff --git a/hwe/scss/common_legacy.scss b/hwe/scss/common_legacy.scss index 9520d2af..7fd1ee0a 100644 --- a/hwe/scss/common_legacy.scss +++ b/hwe/scss/common_legacy.scss @@ -247,26 +247,26 @@ div.bar_out div.bar_in { padding: 0; } -.commandBasic { - background-color: black; - color: white; -} - .compensatePositive { - color: skyblue; + color: $cyan; + display: inline-block; + width: 1rem; } .compensateNegative { - color: orange; + color: $red; + display: inline-block; + width: 1rem; } -.compensateNeutral { - color: white; +.compensateNeutral{ + display: inline-block; + width: 1rem; } -.commandBasic.commandImpossible { - background-color: red; - color: white; +.commandImpossible { + color: $red; + text-decoration: line-through $red; } .select2-selection--single.simple-select2-align-center .select2-selection__rendered { diff --git a/hwe/scss/vue-multiselect.scss b/hwe/scss/vue-multiselect.scss index 223d410d..acbe7415 100644 --- a/hwe/scss/vue-multiselect.scss +++ b/hwe/scss/vue-multiselect.scss @@ -1,12 +1,5 @@ @use "sass:math"; - -$vue-multiselect-disabled-color: $white; -$vue-multiselect-disabled-bg: $gray-700; -$form-select-color: $white; -$vue-multiselect-bg: $black; -$vue-multiselect-color: $white; -$vue-multiselect-tag-color: $white; -$vue-multiselect-spinner-color: $white; +$vue-multiselect-disabled-bg: $gray-400; $vue-multiselect-padding-x: $form-select-padding-x !default; $vue-multiselect-padding-y: $form-select-padding-y !default; diff --git a/hwe/ts/ReservedCommand.vue b/hwe/ts/ReservedCommand.vue index c2f4d8d2..5ca6a61b 100644 --- a/hwe/ts/ReservedCommand.vue +++ b/hwe/ts/ReservedCommand.vue @@ -75,7 +75,7 @@ 'white-space': 'nowrap', 'font-size': `${Math.min( 14, - (70 / (`${turnObj.year ?? 1}`.length + 8)) * 1.8 + (75 / (`${turnObj.year ?? 1}`.length + 8)) * 1.8 )}px`, overflow: 'hidden', }" @@ -136,7 +136,7 @@ :group-select="false" group-values="values" group-label="category" - label="title" + label="searchText" track-by="value" open-direction="top" :show-labels="false" @@ -149,7 +149,34 @@ :maxHeight="400" > - + +
@@ -167,16 +194,20 @@ import { stringifyUrl } from "query-string"; import { defineComponent } from "vue"; import { formatTime } from "./util/formatTime"; import { joinYearMonth } from "./util/joinYearMonth"; +import { mb_strwidth } from "./util/mb_strwidth"; import { parseTime } from "./util/parseTime"; import { parseYearMonth } from "./util/parseYearMonth"; import { sammoAPI } from "./util/sammoAPI"; +import { filter초성 } from "./util/filter초성"; type commandItem = { value: string; title: string; compensation: number; + simpleName: string; possible: boolean; reqArg: boolean; + searchText?: string; }; declare const maxTurn: number; @@ -251,7 +282,7 @@ export default defineComponent({ this.serverNow = formatTime(serverNow, "HH:mm:ss"); setTimeout(() => { this.updateNow(); - }, 250); + }, 1000 - serverNow.getMilliseconds()); }, toggleTurn(turnIdx: number) { this.pressed[turnIdx] = !this.pressed[turnIdx]; @@ -352,14 +383,22 @@ export default defineComponent({ for (const obj of result.turn) { const [year, month] = parseYearMonth(yearMonth); - let tooltip: string | undefined = undefined; + let tooltip: string[] = []; let style: Record = {}; + + const brief = obj.brief; + if (yearMonth <= autorunLimitYearMonth) { if (obj.brief == "휴식") { obj.brief = "휴식(자율 행동)"; } style.color = "#aaffff"; - tooltip = `자율 행동 기간: ${autorunLimitYear}년 ${autorunLimitMonth}월까지`; + + tooltip.push(`자율 행동 기간: ${autorunLimitYear}년 ${autorunLimitMonth}월까지`); + } + + if(mb_strwidth(brief) > 22){ + tooltip.push(brief); } reservedCommandList.push({ @@ -367,7 +406,7 @@ export default defineComponent({ year, month, time: formatTime(nextTurnTime, "HH:mm"), - tooltip, + tooltip: tooltip.length==0?undefined:tooltip.join("\n"), style, }); @@ -423,12 +462,21 @@ export default defineComponent({ setTimeout(() => { this.updateNow(); - }, 250); + }, 1000 - serverNowObj.getMilliseconds()); const pressed = Array.from({ length: maxTurn }).fill(false); pressed[0] = true; const selectedCommand = commandList[0].values[0]; + for(const subCategory of commandList){ + for(const command of subCategory.values){ + if(command.searchText){ + continue; + } + const filteredText = filter초성(command.simpleName).replace(/\s+/g, ''); + command.searchText = `${command.simpleName} ${filteredText}` + } + } const emptyTurn: TurnObjWithTime[] = Array.from({ length: maxTurn, @@ -473,7 +521,7 @@ export default defineComponent({ .commandTable { width: 100%; display: grid; - grid-template-columns: minmax(30px, 1fr) minmax(70px, 2.5fr) minmax(40px, 1fr) 5fr; + grid-template-columns: minmax(30px, 1fr) minmax(75px, 2.5fr) minmax(40px, 1fr) 5fr; //30, 70, 37.65, 160 } @@ -481,6 +529,11 @@ export default defineComponent({ .commandPad { margin-left: 10px; + .turn_pad { + + overflow: hidden; + text-overflow: ellipsis; + } .multiselect__content-wrapper { width: 133.3%; } @@ -532,5 +585,8 @@ export default defineComponent({ .turn_pad .turn_text { display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } \ No newline at end of file diff --git a/hwe/ts/util/filter초성.ts b/hwe/ts/util/filter초성.ts new file mode 100644 index 00000000..a4c10452 --- /dev/null +++ b/hwe/ts/util/filter초성.ts @@ -0,0 +1,17 @@ +export function filter초성(text: string): string { + const 초성 = [ + "ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", + "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅉ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ" + ]; + const result: string[] = []; + for (const char of text) { + const code = (char.codePointAt(0) ?? 0) - 44032; + if (0 <= code && code < 11172) { + result.push(초성[~~(code / 588)]); + } + else { + result.push(char); + } + } + return result.join(''); +} \ No newline at end of file