var listContractProcess = function() { console.log("listContractProcess : "); var request = {}; request.action = "listContractProcess"; global.wssocket.send(JSON.stringify(request)); }; var onListContractProcess = function(obj) { var userManTab = $("#v-pills-contractInstance-tab")[0]; var isActive = (userManTab.getAttribute("aria-selected") == "true"); if (isActive) { onListContractProcess1(obj); } else { onListContractProcess2(obj); } }; var changeContractProcess = function(obj) { global.contractProcess = obj; // 代码管理菜单选中的合约 console.log("oooooooooooo" + global.contractProcess); //showPermissionList(global.contractProcess); }; var onListContractProcess2 = function(obj) { var data = JSON.parse(obj.data); global.contracts = data; // $("#contractProcess").editableSelect('clear'); // $("#tabdiv").html(""); global.contractName2ID = {}; //global.permissionNameMap = {}; var name = ""; var htm = ""; for (var i = 0; i < data.length; i++) { // htm += ""; htm += ""; global.contractName2ID[data[i].name] = data[i].id; //global.permissionNameMap[data[i].name] = data[i].contractPermission; console.log(htm); name = data[i].name; } //showPermissionList(name); console.log(htm); $("#contractProcess").html(htm); /* * $("#contractProcess").editableSelect({ effects: 'slide', * //可选参数default、fade filter: true //false 不过滤,否则选中后其它选项消失 }); */ /* * if(data.length > 0){ for (var i = 0; i < data.length; i++) { * console.log(i); $("#contractProcess").editableSelect('add', * data[i].name); global.contractName2ID[data[i].name] = data[i].id; // * $("#tabdiv").append( // $("").attr("value", * data[i].id).text( // data[i].id)); } } if (data.length > 0) * $("#contractProcess").editableSelect()[0].value = data[0].name; */ }; var addTcpNodeUnits = function(data) { if (data.length > 0) { for (var i = 0; i < data.length; i++) { var unitID = data[i].key; var nodes = JSON.parse(data[i].value); var json = {}; json.type = "TCP"; json.key = unitID; json.value = nodes; addNodeUnit(json); } } }; var listSelectUnits = function(data) { console.log(data); global.units = {}; var htm = ""; if (data.length > 0) { // data的key是创建人公钥_时间戳,value是nodes的ID for (var i = 0; i < data.length; i++) { var unitID = data[i].key; var nodes = JSON.parse(data[i].value); var at_ = data[i].key.indexOf("_"); console.log(nodes); htm += ""; global.units[unitID.substring(at_ + 1)] = nodes; } } htm += ""; htm += ""; console.log(htm); $("#selectUnits").html(htm); } var onCancelAuth = function(obj) { myToast("取消权限", obj.data); if (obj.data == "success") { } }; var setPermission = function(data) { var request = {}; request.resetContractProcess = data.name; console.log(request.resetContractName); request.closePer = data.permission; request.oldPer = data.oldPermission; request.isOpen = data.isOpen; request.action = "setPermission"; global.wssocket.send(JSON.stringify(request)); }; var onSetPermission = function(obj) { console.log(obj); var html = "