feat(WIP): ReservedCommand 선택창을 vue-multiselect로 변경
- vue-select는 취소
This commit is contained in:
+2
-1
@@ -475,7 +475,8 @@ function getCommandTable(General $general){
|
|||||||
if (!$commandObj->canDisplay()) {
|
if (!$commandObj->canDisplay()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$subList[Util::getClassNameFromObj($commandObj)] = [
|
$subList[] = [
|
||||||
|
'value'=>Util::getClassNameFromObj($commandObj),
|
||||||
'compansation'=>$commandObj->getCompensationStyle(),
|
'compansation'=>$commandObj->getCompensationStyle(),
|
||||||
'possible'=>$commandObj->hasMinConditionMet(),
|
'possible'=>$commandObj->hasMinConditionMet(),
|
||||||
'title'=>$commandObj->getCommandDetailTitle(),
|
'title'=>$commandObj->getCommandDetailTitle(),
|
||||||
|
|||||||
+10
-38
@@ -132,12 +132,13 @@
|
|||||||
<v-multiselect
|
<v-multiselect
|
||||||
v-model="selectedCommand"
|
v-model="selectedCommand"
|
||||||
:allow-empty="false"
|
:allow-empty="false"
|
||||||
:options="compiledCommandList"
|
:options="commandList"
|
||||||
:group-select="true"
|
:group-select="true"
|
||||||
group-values="values"
|
group-values="values"
|
||||||
group-label="category"
|
group-label="category"
|
||||||
label="title"
|
label="title"
|
||||||
track-by="value"
|
track-by="value"
|
||||||
|
open-direction="top"
|
||||||
>
|
>
|
||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
<!--<b-form-select v-model="selectedCommand"
|
<!--<b-form-select v-model="selectedCommand"
|
||||||
@@ -173,9 +174,9 @@ import { joinYearMonth } from "./util/joinYearMonth";
|
|||||||
import { parseTime } from "./util/parseTime";
|
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 { unwrap_any } from "./util/unwrap_any";
|
|
||||||
|
|
||||||
type commandItem = {
|
type commandItem = {
|
||||||
|
value: string;
|
||||||
title: string;
|
title: string;
|
||||||
compensation: number;
|
compensation: number;
|
||||||
possible: boolean;
|
possible: boolean;
|
||||||
@@ -186,7 +187,7 @@ declare const maxTurn: number;
|
|||||||
declare const maxPushTurn: number;
|
declare const maxPushTurn: number;
|
||||||
declare const commandList: {
|
declare const commandList: {
|
||||||
category: string;
|
category: string;
|
||||||
values: Record<string, commandItem>;
|
values: commandItem[];
|
||||||
}[];
|
}[];
|
||||||
declare const serverNow: string;
|
declare const serverNow: string;
|
||||||
|
|
||||||
@@ -395,11 +396,13 @@ export default defineComponent({
|
|||||||
turnList.push(turnIdx);
|
turnList.push(turnIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listReqArgCommand.has(this.selectedCommand)) {
|
const commandName = this.selectedCommand.value;
|
||||||
|
|
||||||
|
if (listReqArgCommand.has(commandName)) {
|
||||||
document.location.href = stringifyUrl({
|
document.location.href = stringifyUrl({
|
||||||
url: "b_processing.php",
|
url: "b_processing.php",
|
||||||
query: {
|
query: {
|
||||||
command: unwrap_any<string>(this.selectedCommand),
|
command: commandName,
|
||||||
turnList: turnList.join("_"),
|
turnList: turnList.join("_"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -409,7 +412,7 @@ export default defineComponent({
|
|||||||
try {
|
try {
|
||||||
await sammoAPI("Command/ReserveCommand", {
|
await sammoAPI("Command/ReserveCommand", {
|
||||||
turnList,
|
turnList,
|
||||||
action: this.selectedCommand,
|
action: commandName,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -431,7 +434,7 @@ export default defineComponent({
|
|||||||
const pressed = Array.from<boolean>({ length: maxTurn }).fill(false);
|
const pressed = Array.from<boolean>({ length: maxTurn }).fill(false);
|
||||||
pressed[0] = true;
|
pressed[0] = true;
|
||||||
|
|
||||||
const selectedCommand = "휴식";//FIXME: 새 구성에 따르면 Object임.
|
const selectedCommand = commandList[0].values[0];
|
||||||
|
|
||||||
const emptyTurn: TurnObjWithTime[] = Array.from<TurnObjWithTime>({
|
const emptyTurn: TurnObjWithTime[] = Array.from<TurnObjWithTime>({
|
||||||
length: maxTurn,
|
length: maxTurn,
|
||||||
@@ -444,43 +447,12 @@ export default defineComponent({
|
|||||||
time: "",
|
time: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const compiledCommandList: {
|
|
||||||
category: string;
|
|
||||||
values: {
|
|
||||||
title: string;
|
|
||||||
value: null | string;
|
|
||||||
reqArg: boolean,
|
|
||||||
possible?: boolean;
|
|
||||||
compensation?: number;
|
|
||||||
}[];
|
|
||||||
}[] = [];
|
|
||||||
for (const category of commandList) {
|
|
||||||
|
|
||||||
const categoryList: (typeof compiledCommandList)[0]['values'] = [];
|
|
||||||
for (const [commandValue, commandInfo] of Object.entries(
|
|
||||||
category.values
|
|
||||||
)) {
|
|
||||||
categoryList.push({
|
|
||||||
reqArg: commandInfo.reqArg,
|
|
||||||
title: commandInfo.title,
|
|
||||||
value: commandValue,
|
|
||||||
possible: commandInfo.possible,
|
|
||||||
compensation: commandInfo.compensation,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
compiledCommandList.push({
|
|
||||||
category: category.category,
|
|
||||||
values: categoryList,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
maxTurn,
|
maxTurn,
|
||||||
flippedMaxTurn: 16,
|
flippedMaxTurn: 16,
|
||||||
viewMaxTurn: 16,
|
viewMaxTurn: 16,
|
||||||
maxPushTurn,
|
maxPushTurn,
|
||||||
commandList,
|
commandList,
|
||||||
compiledCommandList,
|
|
||||||
serverNow: formatTime(serverNowObj, "HH:mm:ss"),
|
serverNow: formatTime(serverNowObj, "HH:mm:ss"),
|
||||||
timeDiff,
|
timeDiff,
|
||||||
pressed,
|
pressed,
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"summernote": "^0.8.18",
|
"summernote": "^0.8.18",
|
||||||
"vue": "^3.2.2",
|
"vue": "^3.2.2",
|
||||||
"vue-multiselect": "^3.0.0-alpha.2",
|
"vue-multiselect": "^3.0.0-alpha.2",
|
||||||
"vue-select": "^4.0.0-beta.1",
|
|
||||||
"vue-types": "^4.1.0",
|
"vue-types": "^4.1.0",
|
||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user