| | |
| | | var mixin={ |
| | | methods:{ |
| | | connects:function(gongneng,sql,flag,num){ |
| | | $.post("../mysqlInsert/mysql.jsp", |
| | | {"gongneng":gongneng,"sql":sql,'flag':flag,'anquanma':json["anquanma"]}, |
| | | function(result){ |
| | | if(num==1){ |
| | | result=$(result).text(); |
| | | index = result.indexOf("[["); |
| | | if(index>-1){ |
| | | if(result.indexOf("[[anquanmaerr]]")>-1){ |
| | | //alert('请先登录后操作'); |
| | | window.parent.location.href='../login/index.jsp'; |
| | | }else{ |
| | | result=result.substring(index).trim() |
| | | alert(result); |
| | | window.location.reload(); |
| | | } |
| | | |
| | | }else{ |
| | | alert(gongneng+"成功!") |
| | | window.location.reload(); |
| | | } |
| | | } |
| | | |
| | | }) |
| | | .fail(function(response) { |
| | | alert('Error: ' + "服务器数据发生错误!"); |
| | | return false; |
| | | }); |
| | | let param = new URLSearchParams(); |
| | | param.append("gongneng",gongneng); |
| | | param.append("sql",sql); |
| | | param.append("flag",flag); |
| | | param.append("anquanma",json["anquanma"]); |
| | | |
| | | this.$http.post( '../mysqlInsert/mysql.jsp',param) |
| | | .then(function (response) { |
| | | if(num==1){ |
| | | result=$(response.data).text(); |
| | | index = result.indexOf("[["); |
| | | if(index>-1){ |
| | | if(result.indexOf("[[anquanmaerr]]")>-1){ |
| | | //alert('请先登录后操作'); |
| | | window.parent.location.href='../login/index.jsp'; |
| | | }else{ |
| | | result=result.substring(index).trim() |
| | | alert(result); |
| | | window.location.reload(); |
| | | } |
| | | }else{ |
| | | alert(gongneng+"成功!") |
| | | window.location.reload(); |
| | | } |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | alert('Error: ' + "服务器数据发生错误!"); |
| | | }); |
| | | |
| | | }, |
| | | loadAjxss:function(gongneng,sql,flag,vals){ |
| | | let param = new URLSearchParams(); |