diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index 178fbd1f..80a97be6 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -17,8 +17,6 @@ $generalObj = General::createGeneralObjFromDB($session->generalID); <?=UniqueConst::$serverName?>: 사령부 - - diff --git a/hwe/ts/@types/jquery.redirect.d.ts b/hwe/ts/@types/jquery.redirect.d.ts deleted file mode 100644 index 81f8ab2a..00000000 --- a/hwe/ts/@types/jquery.redirect.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -type JqueryRedirectOpts = { - url: string, - values?: Record, - method?: 'GET' | 'POST', - target?: string, - traditional?: boolean - redirectTop?: boolean, -} - -interface JQueryStatic { - /** - * jQuery Redirect - * @param {string} url - Url of the redirection - * @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url. - * @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST) - * @param {string} target - (optional) The target of the form. If you set "_blank" will open the url in a new window. - * @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others. - * @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window. - */ - redirect( - url: string, - values?: Record, - method?: 'GET' | 'POST', - target?: string, traditional?: - boolean, redirectTop?: boolean - ): void; - - /** -* jQuery Redirect -* @param {string} opts - Options object -* @param {string} opts.url - Url of the redirection -* @param {Object} opts.values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url. -* @param {string} opts.method - (optional) The HTTP verb can be GET or POST (defaults to POST) -* @param {string} opts.target - (optional) The target of the form. "_blank" will open the url in a new window. -* @param {boolean} opts.traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others. -* @param {boolean} opts.redirectTop - (optional) If its called from a iframe, force to navigate the top window. -*/ - redirect(opt: JqueryRedirectOpts): void; -} \ No newline at end of file diff --git a/hwe/ts/chiefCenter.ts b/hwe/ts/chiefCenter.ts index b506d011..808ee5de 100644 --- a/hwe/ts/chiefCenter.ts +++ b/hwe/ts/chiefCenter.ts @@ -9,6 +9,7 @@ import { convertFormData } from './util/convertFormData'; import { unwrap_any } from "./util/unwrap_any"; import { parseTime } from './util/parseTime'; import { formatTime } from './util/formatTime'; +import { stringifyUrl } from 'query-string'; declare const maxChiefTurn: number; @@ -31,11 +32,11 @@ type ChiefResponse = InvalidResponse | { result: true, date: string, nationTurnBrief: { - name:string|null, - turnTime:string|null, - officerLevelText:string, - npcType:number, - turn:string + name: string | null, + turnTime: string | null, + officerLevelText: string, + npcType: number, + turn: string }[], isChief: boolean, turnTerm: number @@ -107,7 +108,7 @@ async function reloadTable() { return; } const turnTerm = data.turnTerm; - const tmpFilledChiefList:Record = {}; + const tmpFilledChiefList: Record = {}; if (data.isChief) { chiefTableObj.btns.css('visibility', 'visible'); @@ -134,7 +135,7 @@ async function reloadTable() { plateObj.officerLevelText.text(chiefInfo.officerLevelText); - let turnTimeObj: Date|undefined; + let turnTimeObj: Date | undefined; if (chiefInfo.turnTime) { turnTimeObj = parseTime(chiefInfo.turnTime); @@ -176,11 +177,11 @@ async function reloadTable() { async function reserveTurn(turnList: number[], command: string) { console.log(turnList, command); - try{ + try { const response = await axios({ url: 'j_set_chief_command.php', - responseType:'json', + responseType: 'json', method: 'post', data: convertFormData({ turnList, @@ -195,7 +196,7 @@ async function reserveTurn(turnList: number[], command: string) { } await reloadTable(); } - catch(e){ + catch (e) { console.error(e); errUnknown(); } @@ -223,7 +224,7 @@ async function pushTurn(turnCnt: number) { } } -jQuery(function ($) { +$(function ($) { chiefTableObj = genChiefTableObj(); void reloadTable(); @@ -232,12 +233,14 @@ jQuery(function ($) { const turnList = unwrap_any($('#chiefTurnSelector').val()).map(function (v) { return parseInt(v); }); const $command = $('#chiefCommandList option:selected'); if ($command.data('reqarg')) { - $.redirect( - "b_processing.php", { - command: unwrap($command.val()), - turnList: turnList.join('_'), - is_chief: true - }, "GET"); + document.location.href = stringifyUrl({ + url: 'b_processing.php', + query: { + command: unwrap_any($command.val()), + turnList: turnList.join('_'), + is_chief: true + } + }); } else { void reserveTurn(turnList, unwrap_any($command.val()));