当前位置: 首页 > news >正文

板卡常用前端 数据表操作

两年前写的,现在看,有点想吐, 数据操作表,调试设备用

采用外挂的方法,以前设备的接口命令,简易,换个UI展示很容易

自己写着玩的,公司部分产品再用,前端展示,不涉密

index.html

<!doctype html>
<html><head><meta charset="UTF-8" /><title>Device Dashboard</title><link rel="stylesheet" type="text/css" href="themes/gray/easyui.css" /><link rel="stylesheet" type="text/css" href="themes/icon.css" /><link rel="stylesheet" type="text/css" href="www/demo.css" /><script type="text/javascript" src="jquery.min.js"></script><script type="text/javascript" src="jquery.easyui.min.js"></script><script type="text/javascript" src="www/js/dataGrid.js"></script><script type="text/javascript" src="www/js/cgiOperator.js"></script><script type="text/javascript" src="www/js/index.js"></script></head><body><br /><div class="easyui-layout" fit="true"><div id="tb" style="height: auto"><aid="refresh"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="reload()">Refresh</a><aid="save"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-save',plain:true"onclick="edit()">Save</a><aid="cancel"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-undo',plain:true"onclick="cancel()">Cancel</a><aid="view"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-search',plain:true"onclick="getChanges()">View changes</a><ahref="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="chinese()">中文</a><ahref="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="english()">ENGLISH</a></div><br /><divclass="easyui-layout"style="width: 1300px; height: 960px"fit="true"><divdata-options="region:'west',title:'Menu directory'"style="width: 250px"border="false"border="false"><ul id="tt" class="easyui-tree"><li data-options="state:'open'"><span class="dev_info">Device Information</span><ul><li><a id="SystemInfo">Base Information</a></li></ul></li><li data-options="state:'open'"><span class="dev_status">Device Status</span><ul><li><a id="MiscInfo">Misc Status</a></li><li><a id="AlarmInfo">Alarm Status</a></li></ul></li><li data-options="state:'open'"><span class="dev_setup">Device Setup</span><ul><li><a id="NetWorkConfig">Network Setup</a></li><li><a id="RadioConfigCommon">RF Common Setup</a></li><li data-options="state:'open'"><span id="5G setup">5G NR Setup</span><ul><li><a id="CarrierConfigOne">Band 1 Slots Setup</a></li><li><a id="CarrierConfigTwo">Band 2 Slots Setup</a></li></ul></li></ul></li><li data-options="state:'open'"><span class="Factorty">Factory Calibration</span><ul><li><a id="FactorySetup">Calibration Setup</a></li></ul></li></ul></div><divid="CenterBlock"data-options="region:'center',title:'Access Unit Equipment'"><divid="HomeIndex"class="easyui-tabs"style="width: auto; height: 800px"><div title="Home" style="padding: 10px"><tableid="dg"class="easyui-datagrid"style="width: auto; height: 720px"data-options="checkOnSelect:false,selectOnCheck:false,onClickCell: onClickCell,"><thead><tr><thdata-options="field:'selectRows',width:40,align:'center',checkbox:true"></th><thdata-options="field:'paramsName',width:400,align:'left'">name</th><thdata-options="field:'paramsValue',width:200,align:'left',editor:{type:'textbox'}">value</th><thdata-options="field:'UpdateTime',width:280,align:'center'">update time</th></tr></thead></table></div></div></div></div></div></body>
</html>

index.js

//cgi request url information tag is directions ajax
var cacheDataParaList = undefined;
var cacheDataParaListArray = new Array();
var cacheData = undefined;
var cacheDataArray = new Array();
var DEBUG = 0;
var ZH_TABLE = undefined;
var TableType = undefined;var NetWorkConfigArgs = new Array();
var NetWorkConfigFilterIndex = [1];var SystemInfoArgs = new Array();
var SystemFilterIndex = [0];var AlarmInfoArgs = new Array();
var AlarmFilterIndex = [100];var AlarmConfigArgs = new Array();
var AlarmConfigFilterIndex = [99];var CarrierConfigOneArgs = new Array();
var CarrierConfigOneFilterIndex = [2];var CarrierConfigTwoArgs = new Array();
var CarrierConfigTwoFilterIndex = [3];var RadioConfigCommonArgs = new Array();
var RadioConfigCommonFilterIndex = [4];var RadioConfigOneArgs = new Array();
var RadioConfigOneFilterIndex = [5];var RadioConfigTwoArgs = new Array();
var RadioConfigTwoFilterIndex = [6];var RadioConfigThreeArgs = new Array();
var RadioConfigThreeFilterIndex = [7];var RadioConfigFourArgs = new Array();
var RadioConfigFourFilterIndex = [8];var OptInfoArgs = new Array();
var OptInfoFilterIndex = [9];var MiscInfoArgs = new Array();
var MiscInfoFilterIndex = [0xa];var FactorySetupArgs = new Array();
var FactorySetupFilterIndex = [0x2b];var cgi_config = "cgi-bin/wsgi.py";function FilterIndex(IndexArray, index) {for (var i = 0; i < IndexArray.length; i++) {if (index == IndexArray[i]) {return true;}}return false;
}function ajaxPost(url_t, msg, func) {$.ajax({url: url_t,type: "POST", //对数据的请求指令使用post的请求方式data: msg,async: false,success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");func(data, status);},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}function RequestFromBoaParaList() {ajaxPost(cgi_config, "cmd=para_list&nodata", function(data, status) {cacheDataParaList = data;});
}function ajaxJson(url_t) {$.ajax({url: url_t,type: "GET", //对数据的请求指令使用post的请求方式async: false,dataType: "json",success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");ZH_TABLE = data;},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}function ajaxJsonPost(url_t, msg, func) {$.ajax({url: url_t,type: "POST", //对数据的请求指令使用post的请求方式data: msg,async: false,dataType: json,success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");func(data, status);},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}var DevList = undefined;function RequestDeviceList() {ajaxPost(cgi_config, "cmd=device_list&nodata", function(data, status) {console.log("REQUESTDEVICELIST: " + status);DevList = data;});
}function TreeNodeAdd() {var data = [{ text: "DeviceList", children: [{ text: "LocalDevice" }] }];var data_leaf = data[0].children;RequestDeviceList();if (DevList != undefined) {console.log(DevList);let tmp = DevList.split("&");for (var i = 1; i < tmp.length - 1; i++) {console.log(tmp[i]);data_leaf.push({ text: tmp[i] });}}console.log(data_leaf);// init tree for every node$("#ptt").tree({ data: data });
}function RequestFromBoaReadPara() {ajaxPost(cgi_config, "cmd=read&nodata", function(data, status) {console.log("RequestFromBoaReadPara: " + status);cacheData = data;});
}//may payload some data from client
function RequestFromBoaWritePara(WriteCmd, Error) {ajaxPost(cgi_config, "cmd=write&" + WriteCmd, function(data, status) {Error = data;});
}function ParaListData2Params(RemoteDataArray, ParamsDataArray) {var tmp = undefined;var tmpCOMMA = undefined;var tmpArrayEQ = new Array();var tmpArrayCOMMA = new Array();for (var i = 1; i < RemoteDataArray.length; i++) {if (RemoteDataArray[i] === "") {continue;}tmp = RemoteDataArray[i];tmpArrayEQ = tmp.split("=");ParamsDataArray[i].index = tmpArrayEQ[0];tmpCOMMA = tmpArrayEQ[1];tmpArrayCOMMA = tmpCOMMA.split(",");ParamsDataArray[i].name = tmpArrayCOMMA[0];ParamsDataArray[i].type = tmpArrayCOMMA[1];ParamsDataArray[i].coff = tmpArrayCOMMA[2];ParamsDataArray[i].attr = tmpArrayCOMMA[3];ParamsDataArray[i].len = tmpArrayCOMMA[4];}
}function ParaRead2Params(RemoteDataArray, ParamsDataArray) {var tmp = undefined;var tmpArrayEQ = new Array();for (var i = 1; i < RemoteDataArray.length; i++) {tmp = RemoteDataArray[i];tmpArrayEQ = tmp.split("=");ParamsDataArray[i].index = tmpArrayEQ[0];ParamsDataArray[i].value = tmpArrayEQ[1];}
}function clearCacheGlobData() {cacheData = undefined;cacheDataArray = null;cacheDataParaList = undefined;cacheDataParaListArray = null;
}function ParamsType() {var tmp_index = undefined;OptInfoArgs.length = 0;SystemInfoArgs.length = 0;AlarmInfoArgs.length = 0;AlarmConfigArgs.length = 0;NetWorkConfigArgs.length = 0;RadioConfigCommonArgs.length = 0;RadioConfigFourArgs.length = 0;RadioConfigOneArgs.length = 0;RadioConfigTwoArgs.length = 0;RadioConfigThreeArgs.length = 0;CarrierConfigOneArgs.length = 0;CarrierConfigTwoArgs.length = 0;MiscInfoArgs.length = 0;FactorySetupArgs.length = 0;for (var i = 0; i < ParamsDataArray.length; i++) {tmp_index = parseInt(ParamsDataArray[i].attr);if (FilterIndex(SystemFilterIndex, tmp_index)) {SystemInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(OptInfoFilterIndex, tmp_index)) {OptInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(AlarmFilterIndex, tmp_index)) {AlarmInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(AlarmConfigFilterIndex, tmp_index)) {AlarmConfigArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigCommonFilterIndex, tmp_index)) {RadioConfigCommonArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigOneFilterIndex, tmp_index)) {RadioConfigOneArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigTwoFilterIndex, tmp_index)) {RadioConfigTwoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigThreeFilterIndex, tmp_index)) {RadioConfigThreeArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigFourFilterIndex, tmp_index)) {RadioConfigFourArgs.push(ParamsDataArray[i]);} else if (FilterIndex(CarrierConfigOneFilterIndex, tmp_index)) {CarrierConfigOneArgs.push(ParamsDataArray[i]);} else if (FilterIndex(CarrierConfigTwoFilterIndex, tmp_index)) {CarrierConfigTwoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(NetWorkConfigFilterIndex, tmp_index)) {NetWorkConfigArgs.push(ParamsDataArray[i]);} else if (FilterIndex(MiscInfoFilterIndex, tmp_index)) {MiscInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(FactorySetupFilterIndex, tmp_index)) {FactorySetupArgs.push(ParamsDataArray[i]);}}
}var ParamsDataArray = new Array();$(function() {clearCacheGlobData();clearDataTable();RequestFromBoaParaList();cacheDataParaListArray = cacheDataParaList.split("&");console.log(cacheDataParaListArray);RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);if (cacheDataParaListArray.length != cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "SUCCESSFULL");}for (var i = 0; i < cacheDataArray.length; i++) {ParamsDataArray.push(new ParamsData("0", "0", "0", "0", "0", "0", "0"));}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);//default zhajaxJson("zhTable.json");//reload with chineseif (ZH_TABLE != undefined) {console.log("ZH_TABLE");console.log(ZH_TABLE);}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].name == 0) {continue;}if (ParamsDataArray[i].index === ZH_TABLE[i].ID) {ParamsDataArray[i].name = ZH_TABLE[i].NAME;console.log(ZH_TABLE[i].NAME);}if (DEBUG) {console.log(ParamsDataArray[i].NAME);}}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type == "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type != "str" && ParamsDataArray[i].coff != 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type == "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();console.log(ParamsDataArray);var DeviceInfo = new Object();DeviceInfo.SystemInfo = new CenterBlockClass("#SystemInfo","SystemInfoTable",SystemInfoArgs,);DeviceInfo.AlarmInfo = new CenterBlockClass("#AlarmInfo","AlarmInfoTable",AlarmInfoArgs,);DeviceInfo.OptInfo = new CenterBlockClass("#OptInfo","OptInfoTable",OptInfoArgs,);var DeviceConfig = new Object();DeviceConfig.NetWorkConfig = new CenterBlockClass("#NetWorkConfig","NetConfigTable",NetWorkConfigArgs,);DeviceConfig.AlarmConfig = new CenterBlockClass("#AlarmConfig","AlarmConfigTable",AlarmConfigArgs,);DeviceConfig.RadioConfigCommon = new CenterBlockClass("#RadioConfigCommon","RadioConfigCommonTable",RadioConfigCommonArgs,);DeviceConfig.RadioConfigOne = new CenterBlockClass("#RadioConfigOne","RadioConfigOneTable",RadioConfigOneArgs,);DeviceConfig.RadioConfigTwo = new CenterBlockClass("#RadioConfigTwo","RadioConfigTwoTable",RadioConfigTwoArgs,);DeviceConfig.RadioConfigThree = new CenterBlockClass("#RadioConfigThree","RadioConfigThreeTable",RadioConfigThreeArgs,);DeviceConfig.RadioConfigFour = new CenterBlockClass("#RadioConfigFour","RadioConfigFourTable",RadioConfigFourArgs,);DeviceConfig.CarrierConfigOne = new CenterBlockClass("#CarrierConfigOne","CarrierConfigOneTable",CarrierConfigOneArgs,);DeviceConfig.CarrierConfigTwo = new CenterBlockClass("#CarrierConfigTwo","CarrierConfigTwoTable",CarrierConfigTwoArgs,);DeviceConfig.MiscInfo = new CenterBlockClass("#MiscInfo","MiscInfoTable",MiscInfoArgs,);DeviceConfig.FactorySetup = new CenterBlockClass("#FactorySetup","FactorySetupTable",FactorySetupArgs,);var CenterBlockEvent = new Array();CenterBlockEvent["SystemInfo"] = DeviceInfo.SystemInfo;CenterBlockEvent["AlarmInfo"] = DeviceInfo.AlarmInfo;CenterBlockEvent["OptInfo"] = DeviceInfo.OptInfo;CenterBlockEvent["NetWorkConfig"] = DeviceConfig.NetWorkConfig;CenterBlockEvent["AlarmConfig"] = DeviceConfig.AlarmConfig;CenterBlockEvent["RadioConfigCommon"] = DeviceConfig.RadioConfigCommon;CenterBlockEvent["RadioConfigOne"] = DeviceConfig.RadioConfigOne;CenterBlockEvent["RadioConfigTwo"] = DeviceConfig.RadioConfigTwo;CenterBlockEvent["RadioConfigThree"] = DeviceConfig.RadioConfigThree;CenterBlockEvent["RadioConfigFour"] = DeviceConfig.RadioConfigFour;CenterBlockEvent["CarrierConfigOne"] = DeviceConfig.CarrierConfigOne;CenterBlockEvent["CarrierConfigTwo"] = DeviceConfig.CarrierConfigTwo;CenterBlockEvent["MiscInfo"] = DeviceConfig.MiscInfo;CenterBlockEvent["FactorySetup"] = DeviceConfig.FactorySetup;$("#tt").tree({onClick: function(node) {var index = node.text;var ack_index = index.split('"');var txt = ack_index[2];var tmp_txt = txt.split(">");$("#HomeIndex").tabs("select", FirstTmp);var tab = $("#HomeIndex").tabs("getSelected");$("#HomeIndex").tabs("update", {tab: tab,options: {title: tmp_txt,},});do {if (ack_index[1] == undefined) {break;}FirstTmp = txt;clearDataTable();TableType = CenterBlockEvent[ack_index[1]].type;DrawTable(CenterBlockEvent[ack_index[1]].args);} while (0);},});
});

dataGrid.js

var editIndex = undefined;
var SystemInfoData = undefined;
var AlarmInfoData = undefined;
var NetWorkConfigData = undefined;
var RadioConfigData = undefined;
var checked = undefined;function AddDataGrid(ParamsData) {$("#dg").datagrid("appendRow", {paramsIndex: ParamsData.index,paramsName: ParamsData.name,paramsCoff: ParamsData.coff,paramsAttr: ParamsData.attr,paramsType: ParamsData.type,paramsValue: ParamsData.value,paramsLength: ParamsData.len,UpdateTime:new Date().getFullYear() +"-" +(new Date().getMonth() + 1) +"-" +new Date().getDate() +" " +new Date().getHours() +":" +new Date().getMinutes() +":" +new Date().getSeconds(),});
}function endEditing() {if (editIndex == undefined) {return true;}if ($("#dg").datagrid("validateRow", editIndex)) {$("#dg").datagrid("endEdit", editIndex);editIndex = undefined;return true;} else {return false;}
}function onClickCell(index, field) {if (editIndex != index) {if (endEditing()) {$("#dg").datagrid("selectRow", index).datagrid("beginEdit", index);var ed = $("#dg").datagrid("getEditor", { index: index, field: field });if (ed) {($(ed.target).data("textbox")? $(ed.target).textbox("textbox"): $(ed.target)).focus();}editIndex = index;} else {setTimeout(function() {$("#dg").datagrid("selectRow", editIndex);}, 0);}}
}// 更新客户端数据库
function cancel() {$.messager.confirm("Info:", "Whether to cancel the check?", function(r) {if (r) {$(":checked").removeAttr("checked");}});
}// 更新客户端数据库
function edit() {endEditing();$.messager.confirm("Info:","Please confirm the submission configuration?",function(r) {if (r) {checked = $("#dg").datagrid("getChecked");console.log(checked);var CmdWrite = "";var tmp = 0;for (var i = 0; i < checked.length; i++) {if (checked[i].paramsType == "uint1" && checked[i].paramsLength > 1) {console.log("FilterArray: ");console.log(checked[i]);tmp = checked[i].paramsValue;CmdWrite += checked[i].paramsIndex + "=" + tmp + "&";continue;}if (checked[i].paramsType != "str") {tmp =parseFloat(checked[i].paramsCoff) *parseFloat(checked[i].paramsValue);} else {tmp = checked[i].paramsValue;}CmdWrite += checked[i].paramsIndex + "=" + tmp + "&";}console.log(CmdWrite);var err = undefined;RequestFromBoaWritePara(CmdWrite, err);} else {$(":checked").removeAttr("checked");}},);
}
function zhBar() {$("#SystemInfo").text("系统基本信息");$("#MiscInfo").text("基础状态");$("#AlarmInfo").text("告警状态");$("#dev setup").text("设备初始化");$("#NetWorkConfig").text("网络设置");$("#RadioConfigCommon").text("射频常用设置");$("#CarrierConfigOne").text("载波 一");$("#CarrierConfigTwo").text("载波 二");$("#FactorySetup").text("工厂初始化设置");
}function enBar() {$("#SystemInfo").text("Base Infomation");$("#MiscInfo").text("Misc Info");$("#AlarmInfo").text("Alarm Info");$("#dev setup").text("Device Setup");$("#NetWorkConfig").text("NetWorkConfig");$("#RadioConfigCommon").text("RadioConfigCommon");$("#CarrierConfigOne").text("CarrierConfigOne");$("#CarrierConfigTwo").text("CarrierConfigTwo");$("#FactorySetup").text("FactorySetup");
}CH = true;
EN = false;
function chinese() {zhBar();RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);CH = true;EN = false;if (cacheDataParaListArray.length !== cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "Get the full parameter list");}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);ajaxJson("zhTable.json");//reload with chineseif (ZH_TABLE != undefined) {console.log("CHINESE ZH_TABLE");console.log(ZH_TABLE);}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].name == 0) {continue;}if (ParamsDataArray[i].index === ZH_TABLE[i].ID) {ParamsDataArray[i].name = ZH_TABLE[i].NAME;console.log(ZH_TABLE[i].NAME);}if (DEBUG) {console.log(ParamsDataArray[i].NAME);}}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type === "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type !== "str" && ParamsDataArray[i].coff !== 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type === "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();var TableTmp = undefined;if (TableType == "SystemInfoTable") {TableTmp = SystemInfoArgs;} else if (TableType == "AlarmInfoTable") {TableTmp = AlarmInfoArgs;} else if (TableType == "OptInfoTable") {TableTmp = OptInfoArgs;} else if (TableType == "NetConfigTable") {TableTmp = NetWorkConfigArgs;} else if (TableType == "AlarmConfigTable") {TableTmp = AlarmConfigArgs;} else if (TableType == "RadioConfigCommonTable") {TableTmp = RadioConfigCommonArgs;} else if (TableType == "RadioConfigOneTable") {TableTmp = RadioConfigOneArgs;} else if (TableType == "RadioConfigTwoTable") {TableTmp = RadioConfigTwoArgs;} else if (TableType == "RadioConfigThreeTable") {TableTmp = RadioConfigThreeArgs;} else if (TableType == "RadioConfigFourTable") {TableTmp = RadioConfigFourArgs;} else if (TableType == "CarrierConfigOneTable") {TableTmp = CarrierConfigOneArgs;} else if (TableType == "CarrierConfigTwoTable") {TableTmp = CarrierConfigTwoArgs;} else if (TableType == "MiscInfoTable") {TableTmp = MiscInfoArgs;} else if (TableType == "FactorySetupTable") {TableTmp = FactorySetupArgs;}//coef calc for valueconsole.log(TableTmp);clearDataTable();DrawTable(TableTmp);
}function english() {enBar();RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);CH = false;EN = true;if (cacheDataParaListArray.length != cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "Get the full parameter list");}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type == "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type != "str" && ParamsDataArray[i].coff != 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type == "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();var TableTmp = undefined;if (TableType === "SystemInfoTable") {TableTmp = SystemInfoArgs;} else if (TableType === "AlarmInfoTable") {TableTmp = AlarmInfoArgs;} else if (TableType === "OptInfoTable") {TableTmp = OptInfoArgs;} else if (TableType === "NetConfigTable") {TableTmp = NetWorkConfigArgs;} else if (TableType === "AlarmConfigTable") {TableTmp = AlarmConfigArgs;} else if (TableType === "RadioConfigCommonTable") {TableTmp = RadioConfigCommonArgs;} else if (TableType === "RadioConfigOneTable") {TableTmp = RadioConfigOneArgs;} else if (TableType == "RadioConfigTwoTable") {TableTmp = RadioConfigTwoArgs;} else if (TableType == "RadioConfigThreeTable") {TableTmp = RadioConfigThreeArgs;} else if (TableType == "RadioConfigFourTable") {TableTmp = RadioConfigFourArgs;} else if (TableType == "CarrierConfigOneTable") {TableTmp = CarrierConfigOneArgs;} else if (TableType == "CarrierConfigTwoTable") {TableTmp = CarrierConfigTwoArgs;} else if (TableType == "MiscInfoTable") {TableTmp = MiscInfoArgs;} else if (TableType == "FactorySetupTable") {TableTmp = FactorySetupArgs;}//coef calc for valueconsole.log(TableTmp);clearDataTable();DrawTable(TableTmp);
}function reload() {if (CH) {chinese();} else if (EN) {english();}
}function getChanges() {$.messager.show({title: "Modified data that has been submitted",height: 400,width: 800,msg: JSON.stringify(checked),showType: "slide",timeout: 5000000000,style: {right: "",bottom: "",},});
}function clearDataTable() {$("#dg").datagrid("loadData", { total: 0, rows: [] });
}//add data table
function DrawTable(ParamsDataArrayN) {for (var i = 0; i < ParamsDataArrayN.length; i++) {if (ParamsDataArrayN[i].name != "0") {AddDataGrid(ParamsDataArrayN[i]);}}
}

cgiOperator.js

class ParamsData {constructor(index, name, coff, attr, type, value, len) {this.index = index;this.name = name;this.coff = coff;this.attr = attr;this.type = type;this.value = value;this.len = len;this.time = (new Date()).getHours()+":"+(new Date()).getMinutes()+":"+(new Date()).getSeconds();}
}class CenterBlockClass {constructor(index, type, args) {this.index = index;this.type = type;this.args = args;}
}var FirstTmp = "Home";
function setCenterBlockEvent(CenterBlockClass) {$(CenterBlockClass.index).click(function () {var txt = $(this).text();$("#HomeIndex").tabs("select", FirstTmp);var tab = $("#HomeIndex").tabs("getSelected");$("#HomeIndex").tabs("update", {tab: tab,options: {title: txt,},});FirstTmp = txt;clearDataTable();TableType = CenterBlockClass.type;DrawTable(CenterBlockClass.args);});
}

显示看很勉强

在这里插入图片描述
在这里插入图片描述

现在看尴尬的扣脚,勉强可用

python -m http.server 5090

python server 验证 网页

cgi 还挺容易的,都可以动态修改,看到显示的变化

相关文章:

板卡常用前端 数据表操作

两年前写的&#xff0c;现在看,有点想吐, 数据操作表,调试设备用 采用外挂的方法&#xff0c;以前设备的接口命令,简易&#xff0c;换个UI展示很容易 自己写着玩的,公司部分产品再用,前端展示,不涉密 index.html <!doctype html> <html><head><meta chars…...

基于AVR128单片机世界电子时钟的设计

一、系统方案 上电初始化完成系统初始化&#xff0c;液晶滚动显示北京、莫斯科、东京、伦敦、巴黎、纽约等六个城市的标准时间&#xff0c;显示的内容包括地区名及相应地区的年、月、日、星期、时、分、秒。 使用K1按键控制滚动显示或稳定显示某个地区的时间。 使用K3、K4、K5按…...

Electron学习2 使用Electron-vue和Vuetify UI库

Electron学习2 使用Electron-vue和Vuetify UI库 一、Electron-vue简介二、安装yarn三、创建Electron-vue项目1. 关于 electron-builder2. 安装脚手架3. 运行4. 打包应用程序 四、background.js说明1. 引入模块和依赖&#xff1a;2. 注册协议&#xff1a;3. 创建窗口函数&#x…...

Java“牵手”根据商品分类ID获取速卖通商品分类详情页面数据获取方法,速卖通API实现批量商品数据抓取示例

速卖通商城是一个网上购物平台&#xff0c;售卖各类商品&#xff0c;包括服装、鞋类、家居用品、美妆产品、电子产品等。要获取速卖通商品分类详情和商品列表和商品详情页面数据&#xff0c;您可以通过开放平台的接口或者直接访问速卖通商城的网页来获取商品分类详情信息。以下…...

QT 使用图表

目录 1、概念 1.1 坐标轴-QAbstractAxis 1.2 系列-QAbstractSeries 1.3 图例-Legend 1.4 图表-QChart 1.5 视图-QChartView 2、 QT 折线图 2.1 Qt 折线图介绍 2.2 Qt 折线图实现 Qt 图表是专门用来数据可视化的控件 Qt 图表包含折线、饼图、棒图、散点图、范围图等。…...

SSRF 服务器端请求伪造

文章目录 SSRF(curl)网址访问通过file协议访问本地文件dict协议扫描内网主机开放端口 SSRF(file_get_content)网站访问http协议请求内网资源通过file协议访问本地文件 SSRF(Server-Side Request Forgery:服务器端请求伪造) 其形成的原因大都是由于服务端提供了从其他服务器应用…...

shell 05(shell索引数组变量)

一、数组 shell 支持数组 (Array)&#xff0c;数组是若干数据的集合&#xff0c;其中的每一份数据都称为数组的元素. 注意Bash shell 只支持一维数组&#xff0c;不支持多维数组。 在 Shell 中&#xff0c;用括号( )来表示数组&#xff0c;数组元素之间用空格来分隔. 语法为&…...

爬虫异常处理:异常捕获与容错机制设计

作为一名专业的爬虫程序员&#xff0c;每天使用爬虫IP面对各种异常情况是我们每天都会遇到的事情。 在爬取数据的过程中&#xff0c;我们经常会遇到网络错误、页面结构变化、被反爬虫机制拦截等问题。在这篇文章中&#xff0c;我将和大家分享一些关于如何处理爬虫异常情况的经…...

Python自动化小技巧21——实现PDF转word功能(程序制作)

案例背景 为什么这个年代PDF转word&#xff0c;某wps居然还要收费.....很多软件都可以实现这个功能&#xff0c;但是效果都有好有坏&#xff0c;而且有的还付费&#xff0c;很麻烦。 那就用python实现这个功能吧&#xff0c;然后把代码打包为.exe的程序&#xff0c;这样随便在…...

Vue使用Element的表格Table显示树形数据,多选框全选无法选中全部节点

使用Element的组件Table表格&#xff0c;当使用树形数据再配合上多选框&#xff0c;如下&#xff1a; 会出现一种问题&#xff0c;点击左上方全选&#xff0c;只能够选中一级树节点&#xff0c;子节点无法被选中&#xff0c;如图所示&#xff1a; 想要实现点击全选就选中所有的…...

SpringBoot生成和解析二维码完整工具类分享(提供Gitee源码)

前言&#xff1a;在日常的开发工作当中可能需要实现一个二维码小功能&#xff0c;我参考了网上很多关于SpringBoot生成二维码的教程&#xff0c;最终还是自己封装了一套完整生成二维码的工具类&#xff0c;可以支持基础的黑白二维码、带颜色的二维码、带Logo的二维码、带颜色和…...

Redis的基本知识(偏八股)

前言 本文篇概念&#xff0c;着重介绍Redis的执行效率、功能作用、数据类型、 执行效率 江湖上都流传这Redis的执行效率是挺快的&#xff0c;那为什么说它快呢&#xff1f;有以下几个原因&#xff1a; 基于内存单线程模型高效数据结构非阻塞I/O 基于内存: 内存的读写效率是…...

react使用antd的table组件,实现点击弹窗显示对应列的内容

特别提醒&#xff1a;不能在table的columns的render里面设置弹窗组件渲染&#xff0c;因为这会导致弹窗显示的始终是最后一行的内容&#xff0c;因为这样渲染的结果是每一行都会重新渲染一遍这个弹窗并且会给传递一个content的值&#xff0c;渲染到最后一行的时候&#xff0c;就…...

c++代码代码逻辑走查

自助生物采集代码 C部分流程...

CSS scoped 属性的原理

scoped 一、scoped 是什么&#xff1f;二、实现原理 一、scoped 是什么&#xff1f; 在 Vue 组件中&#xff0c;为了使样式私有化&#xff08;模块化&#xff09;&#xff0c;不对全局造成污染&#xff0c;可以在 style 标签上添加 scoped 属性以表示它的只属于当下的模块&am…...

git 查看某个分支是从哪个分支拉出来的

原文链接&#xff1a;https://blog.csdn.net/allanGold/article/details/102478157 git reflog show 分支名git reflog --datelocal | grep 分支名git reflog --datelocal | grep 分支名 $ git reflog --datelocal | grep release3 5c50761 HEAD{Thu Jun 29 12:53:45 2023}: c…...

vue helloworld.vue 点击按钮弹出 dialog,并给dialog传值

1 DataAnalysisVue.Vue -->应该组件文件名和 name: 的名字一致 <template><div><el-dialog :title"dataAnalysisMsg" :visible.sync"dataAnalysisvalue" :before-close"handleClose"><span>{{ dataAnalysisMsg }}&l…...

html动态爱心代码【三】(附源码)

目录 前言 特效 内容修改 完整代码 总结 前言 七夕马上就要到了&#xff0c;为了帮助大家高效表白&#xff0c;下面再给大家带来了实用的HTML浪漫表白代码(附源码)背景音乐&#xff0c;可用于520&#xff0c;情人节&#xff0c;生日&#xff0c;表白等场景&#xff0c;可直…...

mmseg——报错解决:RuntimeError: CUDA error: an illegal memory access was encountered

可能解决方法汇总 GitHub issue相关汇总RuntimeError: CUDA error while trainingCUDA error: an illegal memory access was encountered记录使用mmseg时在计算交叉熵损失遇到的RuntimeError问题与解决方案...

AWS复制EC2文件到S3,g4dn.2xlarge没有NVIDIA GPU 驱动问题

1、给instances权限 action > Security > modify IAM role 把提前创建好的role给这个instance即可 2、复制到bucket aws s3 cp gogo.tar.gz s3://ee547finalbucket不需要手动安装GPU驱动 如果要自己安装&#xff0c;参考https://docs.aws.amazon.com/AWSEC2/latest/U…...

Go语言GIN框架安装与入门

Go语言GIN框架安装与入门 文章目录 Go语言GIN框架安装与入门1. 创建配置环境2. 配置环境3. 下载最新版本Gin4. 编写第一个接口5. 静态页面和资源文件加载6. 各种传参方式6.1 URL传参6.2 路由形式传参6.3 前端给后端传递JSON格式6.4 表单形式传参 7. 路由和路由组8. 项目代码mai…...

低代码系列——初步认识低代码

低代码系列目录 一、初步认识低代码 二、低代码是什么 三、低代码平台的概念和分类 01.无代码开发平台 02.低代码应用平台(LCAP) 03.多重体验开发平台(MXDP) 04.智能业务流程管理套件(iBPMS) 四、低代码的能力指标 五、低代码平台jnpf 表单 报表 流程 权限 一、初步认识低代码 …...

从陌生到熟练使用string类

&#x1f388;个人主页:&#x1f388; :✨✨✨初阶牛✨✨✨ &#x1f43b;推荐专栏1: &#x1f354;&#x1f35f;&#x1f32f;C语言初阶 &#x1f43b;推荐专栏2: &#x1f354;&#x1f35f;&#x1f32f;C语言进阶 &#x1f511;个人信条: &#x1f335;知行合一 &#x1f…...

ERP规划

ERP规划是指一个组织或企业在实施企业资源计划&#xff08;ERP&#xff09;系统之前&#xff0c;对其整体目标、需求和资源进行评估和规划的过程。以下是ERP规划的一般步骤和要点&#xff1a; 制定目标&#xff1a;明确组织对ERP系统的期望和目标&#xff0c;例如提高经营效率、…...

统计学作业啊啊啊啊

题目1 一个制药公司宣称其新药可以将病患的恢复时间从10天降至8天。为了验证这一声明&#xff0c;您从服用新药的病患中抽取了一个样本&#xff0c;发现样本均值为9天&#xff0c;样本标准差为2天&#xff0c;样本量为30。使用0.05的显著性水平进行假设检验&#xff0c;判断公…...

CAM实现的流程--基于Pytorch实现

CAM实现的流程 CAM类激活映射CAM是什么CAM与CNN CAM类激活映射 CAM是什么 可视化CNN的工具&#xff0c; CAM解释网络特征变化&#xff0c;CAM使得弱监督学习发展成为可能&#xff0c;可以慢慢减少对人工标注的依赖&#xff0c;能降低网络训练的成本。通过可视化&#xff0c;就…...

FL Studio2023最新版本21.1中文水果音乐编曲工具

虚拟乐器和真实乐器的区别&#xff1f;真实乐器指的是现实中需要乐手演奏的乐器&#xff0c;而虚拟乐器是计算机音乐制作中编曲师使用的数字乐器。FL Studio虚拟乐器插件有哪些&#xff1f;下文将给大家介绍几款FL Studio自带的强大虚拟乐器。 一、虚拟乐器和真实乐器的区别 …...

数据库概述SQL基本语法

基本概念 数据库DB database简称DB: 存储数据的仓库&#xff0c;是以某种结构存储数据的文件。指长期保存在计算机的存储设备上&#xff0c;按照一定规则阻止起来&#xff0c;可以被用户或应用共享的数据集合。 数据库管理系统DBMS 用于创建&#xff0c;维护&#xff0c;使…...

【面试】一文讲清组合逻辑中的竞争与冒险

竞争的定义&#xff1a;组合逻辑电路中&#xff0c;输入信号的变化传输到电路的各级逻辑门&#xff0c;到达的时间有先后&#xff0c;也就是存在时差&#xff0c;称为竞争。 冒险的定义&#xff1a;当输入信号变化时&#xff0c;由于存在时差&#xff0c;在输出端产生错误&…...

无涯教程-PHP - 性能优化

根据Zend小组的说明,以下插图显示了PHP 7与PHP 5.6和基于流行的基于PHP的应用程序上的HHVM 3.7。 Magento 1.9 与执行Magento事务的PHP 5.6相比&#xff0c;PHP 7的运行速度证明是其两倍。 Drupal 7 在执行Drupal事务时&#xff0c;与PHP 5.6相比&#xff0c;PHP 7的运行速度…...

阿里云备案网站备案域名购买/百度推广账号登录入口

本文力图解析以下几个问题什么是装饰器装饰器的原理装饰器与闭包的关系装饰器的执行顺序什么是装饰器装饰器模式是一种允许动态或者静态向一个对象添加新的行为而不会影响到其他对象的一种设计模式。Python提供了一种更为自然的方式来装饰一个函数&#xff0c;这种方法通过在被…...

sanitize_user wordpress/公众号引流推广平台

为什么80%的码农都做不了架构师&#xff1f;>>> 软硬件环境 Intel 酷睿i5 480M&#xff0c;2.66GHz&#xff08;笔记本&#xff09; 5400转硬盘 6G内存 Win10 64 位操作系统 PHP version: 7.0.6 Server version: 5.7.10 - MySQL Community Server (GPL) PDO事务占位…...

银川网站建设就找湖海/营销策略都有哪些

2.4、依赖注入的三种方式 我们在Spring配置文件中引入的bean初始值是空的&#xff0c;依赖注入就是给他们赋值。这里主要介绍三种常用的方式。 1、setter注入 <bean id"student" class"com.lu.Spring.pojo.Student"><property name"id"…...

网站建设免费空间哪里有/南宁网络推广有限公司

文章目录在mathtype上写latex公式word自动设置公式编号没想到&#xff0c;学院这就开始组织开题报告了&#xff0c;所以不可避免地又要开始敲公式了&#xff0c;然而今时已不同往日&#xff0c;俺已经是个CSDN小博主啦&#xff0c;肯定不能继续用mathtype那种可视化方法打公式啦…...

有没有专门做中考卷子的网站/wordpress免费建站

这里我们以Post方式请求Serclet为例 1.找到中的URL地址 Form表单的Post请求HelloServlet&#xff08;Action"HelloServlet"&#xff09;发起时&#xff0c; Action"HelloServlet"这个URL地址会定向到Servlet中的.XML文件&#xff0c; .XML文件中会有与之匹…...

wordpress数据库查询数据库名/现代营销手段有哪些

基于改进遗传算法的AGV路径规划孙波;姜平;周根荣;董殿永【期刊名称】《计算机工程与设计》【年(卷),期】2020(041)002【摘要】为解决基本遗传算法在规划AGV运行路径时存在早熟收敛的问题,对基本遗传算法进行改进优化.用模拟退火法进行种群选择,提高种群的差异性;改进交叉、变异…...