| var gt = new Gettext({ 'domain': 'gmtjs' }); | 
| var isQuerying = false; | 
|   | 
| function dosubmit() { | 
|     if (isQuerying) { | 
|         alert(gt.gettext("查询中...")); | 
|         return false; | 
|     } | 
|     isQuerying = true; | 
|     document.getElementById("submit").value = gt.gettext("查询中..."); | 
|     return true; | 
| } | 
|   | 
| function changeEventType(allEventInfo, isMixServer, getData, payOrderTypeList, moneyNameInfo) { | 
|   | 
|     // 重置参数 | 
|     var dynHtmlObj = document.getElementById("dynHtml") | 
|     var childs = dynHtmlObj.childNodes; | 
|     for (var i = childs.length - 1; i >= 0; i--) { | 
|         dynHtmlObj.removeChild(childs[i]); | 
|     } | 
|   | 
|     var eventTypeSelObj = document.getElementById("eventType"); | 
|     var eventInfo = null; | 
|     allEventInfo.forEach(element => { | 
|         if (element["EventType"] == eventTypeSelObj.value) { | 
|             eventInfo = element; | 
|         } | 
|     }); | 
|     if (!eventInfo) { | 
|         alert(gt.gettext("找不到该流向命令")); | 
|         return; | 
|     } | 
|      | 
|     document.getElementById("Permission").value = eventInfo["Permission"]; | 
|     if (eventInfo.QueryAllData && (isMixServer || eventInfo.SelectServer)) { | 
|         insHtml = gt.gettext("是否包含本次合服之前的数据") + "<input type=\"checkbox\" name=\"queryAllData\" id=\"queryAllData\" checked =\"checked\"/><br /><br />"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     // 开始日期 | 
|     if (eventInfo.StartDate != null) { | 
|         defaultValue = eventInfo.StartDate; | 
|         if (isRealNum(eventInfo.StartDate)) { | 
|             defaultValue = sumDateByDays(eventInfo.StartDate); | 
|         } | 
|         if (getData["startDate"]) { | 
|             defaultValue = getData["startDate"]; | 
|         } | 
|         insHtml = gt.gettext("开始日期") + ": " | 
|         insHtml += "<input type=\"text\" name=\"startDate\" id=\"startDate\" " + | 
|             "onclick=\"new Calendar().show(this);\" readonly value=\"" + defaultValue + "\" size=\"8\" />"; | 
|         insHtml += "<br/>"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     // 结束日期 | 
|     if (eventInfo.EndDate != null) { | 
|         defaultValue = eventInfo.EndDate; | 
|         if (isRealNum(eventInfo.EndDate)) { | 
|             defaultValue = sumDateByDays(eventInfo.EndDate); | 
|         } | 
|         if (getData["endDate"]) { | 
|             defaultValue = getData["endDate"]; | 
|         } | 
|         insHtml = gt.gettext("结束日期") + ": " | 
|         insHtml += "<input type=\"text\" name=\"endDate\" id=\"endDate\" " + | 
|             "onclick=\"new Calendar().show(this);\" readonly value=\"" + defaultValue + "\" size=\"8\" />"; | 
|         insHtml += "<br/>"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     // 账号 | 
|     if (eventInfo.FindPlayer != null) { | 
|         insHtml = gt.gettext("目标玩家") + ": "; | 
|         insHtml += "<input type=\"radio\" id=\"queryType\" name=\"queryType\" value=\"accID\" />" + gt.gettext("按账号"); | 
|         insHtml += "<input type=\"radio\" id=\"queryType\" name=\"queryType\" value=\"playerName\"  checked />" + gt.gettext("角色名"); | 
|         insHtml += "<br/><input type=\"text\" id=\"playerFind\" name=\"playerFind\" value=\"\" size=\"50\" />"; | 
|         insHtml += "<br/>"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     // 选择支付订单类型 | 
|     if (eventInfo.SelectPayOrderType != null) { | 
|         const payOrderTypeName = { | 
|             "1": gt.gettext("人民币"), "2": gt.gettext("美元"), "3": gt.gettext("越南盾"), | 
|             "4": gt.gettext("soha币"), "5": gt.gettext("金票点券"), "6": gt.gettext("代币") | 
|         }; | 
|         insHtml = "<br/>" + gt.gettext("支付订单") + ":  "; | 
|         for (let index = 0; index < payOrderTypeList.length; index++) { | 
|             const payOrderType = payOrderTypeList[index]; | 
|             let checkName = "payOrderType" + payOrderType; | 
|             let checkStr = payOrderTypeName[String(payOrderType)]; | 
|             if (!checkStr) { | 
|                 checkStr = gt.gettext("未知订单类型") + payOrderType; | 
|             } | 
|             insHtml += "<input type=\"checkbox\" name=\"" + checkName + "\" id=\"" + checkName + "\" checked =\"checked\" />" + checkStr; | 
|         } | 
|         insHtml += "<br/>"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     // 选择货币类型 | 
|     if (eventInfo.SelectMoney != null) { | 
|         insHtml = "<br/>" + gt.gettext("货币类型") + ":  "; | 
|         insHtml += "<select name=\"moneyType\">"; | 
|         for (const moneyType in moneyNameInfo) { | 
|             const moneyName = moneyNameInfo[moneyType]; | 
|             insHtml += "<option value=\"" + moneyType + "\""; | 
|             insHtml += ">" + moneyName; | 
|             insHtml += "</option>"; | 
|         } | 
|         insHtml += "</select>"; | 
|         insHtml += "<br/>"; | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     dynHtmlObj.insertAdjacentHTML("beforeEnd", "<br/>"); | 
|   | 
|     var paramList = eventInfo["Params"] | 
|     for (let index = 0; index < paramList.length; index++) { | 
|         const paramInfo = paramList[index]; | 
|         let insHtml = ""; | 
|         if (paramInfo["text"]) { | 
|             insHtml += paramInfo["text"] + ": "; | 
|         } | 
|         switch (paramInfo["type"]) { | 
|             case "input": | 
|                 insHtml += "<input type=\"text\""; | 
|                 for (const key in paramInfo["attr"]) { | 
|                     let value = paramInfo["attr"][key]; | 
|                     if (key == "value" && getData[paramInfo["attr"]["name"]]) { | 
|                         value = getData[paramInfo["attr"]["name"]]; | 
|                     } | 
|                     insHtml += " " + key + "=\"" + value + "\""; | 
|                 } | 
|                 insHtml += "/>"; | 
|                 break; | 
|             case "select": | 
|                 insHtml += "<select"; | 
|                 for (const key in paramInfo["attr"]) { | 
|                     const value = paramInfo["attr"][key]; | 
|                     insHtml += " " + key + "=\"" + value + "\""; | 
|                 } | 
|                 insHtml += ">"; | 
|                 paramInfo["option"].forEach(optionInfo => { | 
|                     insHtml += "<option value=\"" + optionInfo[1] + "\""; | 
|                     if (optionInfo.length > 2 && optionInfo[2]) { | 
|                         insHtml += " selected=\"selected\""; | 
|                     } | 
|                     insHtml += ">" + optionInfo[0]; | 
|                     insHtml += "</option>"; | 
|                 }); | 
|                 insHtml += "</select>"; | 
|                 break | 
|             case "radio": | 
|                 getParamValue = getData[paramInfo["attr"]["name"]]; | 
|                 paramInfo["option"].forEach(optionInfo => { | 
|                     insHtml += "<input type=\"radio\""; | 
|                     for (const key in paramInfo["attr"]) { | 
|                         const value = paramInfo["attr"][key]; | 
|                         insHtml += " " + key + "=\"" + value + "\""; | 
|                     } | 
|                     insHtml += " value=\"" + optionInfo[1] + "\""; | 
|                     if (getParamValue != null) { | 
|                         if (getParamValue == optionInfo[1]) { | 
|                             insHtml += " checked "; | 
|                         } | 
|                     } else if (optionInfo.length > 2 && optionInfo[2]) { | 
|                         insHtml += " checked "; | 
|                     } | 
|                     insHtml += " />" + optionInfo[0]; | 
|                 }); | 
|                 break | 
|             case "checkbox": | 
|                 insHtml += "<input type=\"checkbox\""; | 
|                 for (const key in paramInfo["attr"]) { | 
|                     const value = paramInfo["attr"][key]; | 
|                     insHtml += " " + key + "=\"" + value + "\""; | 
|                 } | 
|                 insHtml += "/>"; | 
|                 break; | 
|             default: | 
|                 continue; | 
|         } | 
|         if (paramInfo["remark"]) { | 
|             insHtml += paramInfo["remark"]; | 
|         } | 
|         if (paramInfo["br"] != false) { | 
|             insHtml += "<br/>"; | 
|         } | 
|         dynHtmlObj.insertAdjacentHTML("beforeEnd", insHtml); | 
|     } | 
|   | 
|     dynHtmlObj.insertAdjacentHTML("beforeEnd", "<br/>"); | 
|   | 
|     if (!eventInfo.SelectServer) { | 
|         document.getElementById("SelectServer").style.display = "none"; | 
|         document.getElementById("multiservers").value = ""; | 
|     } else { | 
|         document.getElementById("SelectServer").style.display = ""; | 
|         document.getElementById("multiservers").value = eventInfo.Name; | 
|     } | 
| } |