function listContractProcess() { console.log("listContractProcess : "); global.wssocket.send(JSON.stringify({ action: 'listContractProcess', filters: 2 })); } function onListContractProcess(obj) { const userManTab = $("#v-pills-contractInstance-tab")[0]; const isActive = (userManTab.getAttribute("aria-selected") === "true"); if (isActive) { onListContractProcess1(obj); } else { onListContractProcess2(obj); } } function changeContractProcess(obj) { global.contractProcess = obj; // 代码管理菜单选中的合约 console.log("oooooooooooo" + global.contractProcess); //showPermissionList(global.contractProcess); } function onListContractProcess2(obj) { const data = JSON.parse(obj.data); global.contracts = data; // $("#contractProcess").editableSelect('clear'); // $("#tabdiv").html(""); global.contractName2ID = {}; //global.permissionNameMap = {}; let name = ""; let htm = ""; for (let 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; */ } function addTcpNodeUnits(data) { if (data.length > 0) { for (let i = 0; i < data.length; i++) { const unitID = data[i].key; const nodes = JSON.parse(data[i].value); addNodeUnit({ type: 'TCP', key: unitID, value: nodes }); } } } function listSelectUnits(data) { console.log(data); global.units = {}; let htm = ""; if (data.length > 0) { // data的key是创建人公钥_时间戳,value是nodes的ID for (let i = 0; i < data.length; i++) { const unitID = data[i].key; const nodes = JSON.parse(data[i].value); const at_ = data[i].key.indexOf("_"); console.log(nodes); htm += ""; global.units[unitID.substring(at_ + 1)] = nodes; } } htm += ""; htm += ""; console.log(htm); $("#selectUnits").html(htm); } function onCancelAuth(obj) { myToast("取消权限", obj.data); if (obj.data === "success") { } } function setPermission(data) { // console.log(request.resetContractName); global.wssocket.send(JSON.stringify({ resetContractProcess: data.name, closePer: data.permission, oldPer: data['oldPermission'], isOpen: data.isOpen, action: 'setPermission' })); } function onSetPermission(obj) { console.log(obj); let html = "