text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-059183ea"],{2532:function(e,t,r){"use strict";var a=r("23e7"),n=r("5a34"),o=r("1d80"),s=r("ab13");a({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~String(o(this)).indexOf(n(e),arguments.length>1?arguments[1]:void 0)}})},"44e7":function(e,t,r){var a=r("861d"),n=r("c6b6"),o=r("b622"),s=o("match");e.exports=function(e){var t;return a(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==n(e))}},"5a34":function(e,t,r){var a=r("44e7");e.exports=function(e){if(a(e))throw TypeError("The method doesn't accept regular expressions");return e}},ab13:function(e,t,r){var a=r("b622"),n=a("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(a){}}return!1}},caad:function(e,t,r){"use strict";var a=r("23e7"),n=r("4d64").includes,o=r("44d2"),s=r("ae40"),i=s("indexOf",{ACCESSORS:!0,1:0});a({target:"Array",proto:!0,forced:!i},{includes:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},f20a:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-form",{ref:"form",attrs:{model:e.form,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"数据库："}},[r("el-select",{attrs:{placeholder:"请选择数据库"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[r("el-option",{attrs:{label:"mysql",value:"mysql"}})],1)],1),r("el-form-item",{attrs:{label:"主机名/IP地址"}},[r("el-input",{model:{value:e.form.host,callback:function(t){e.$set(e.form,"host",t)},expression:"form.host"}})],1),r("el-form-item",{attrs:{label:"端口："}},[r("el-input",{model:{value:e.form.port,callback:function(t){e.$set(e.form,"port",t)},expression:"form.port"}})],1),r("el-form-item",{attrs:{label:"用户名："}},[r("el-input",{model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}})],1),r("el-form-item",{attrs:{label:"密码："}},[r("el-input",{model:{value:e.form.password,callback:function(t){e.$set(e.form,"password",t)},expression:"form.password"}})],1),r("el-form-item",{attrs:{label:"连接名："}},[r("el-input",{model:{value:e.form.database,callback:function(t){e.$set(e.form,"database",t)},expression:"form.database"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("链接库")]),r("el-button",{on:{click:e.cretedSubmit}},[e._v("创建并连接库")]),r("el-button",[e._v("取消")])],1)],1)},n=[],o=(r("caad"),r("2532"),r("96cf"),r("1da1")),s={data:function(){return{form:{user:"root",port:3306,host:"localhost"}}},methods:{verification:function(){return void 0===this.form.database||""===this.form.database?(alert("请输入连接名"),!1):void 0===this.form.password||""===this.form.database?(alert("请输入密码"),!1):void 0!==this.form.type&&""!==this.form.database||(alert("请选择数据库类型"),!1)},cretedSubmit:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!window.location.href.includes("zzf")){t.next=2;break}return t.abrupt("return",e.$alert("测试地址可直接操作数据库结构并且禁止重新链接"));case 2:if(e.verification()){t.next=4;break}return t.abrupt("return");case 4:e.$confirm("本操作会创建一个新库进行连接，请确认操作，如已有版本库，可以尝试直接链接。","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.form.create=!0,t.next=3,e.$http({url:"database/create",data:e.form});case 3:r=t.sent,200!==r.status||r.msgData?e.$alert(JSON.stringify(r.msgData),"链接失败"):alert("已成功链接数据库"),e.form.create="";case 6:case"end":return t.stop()}}),t)}))));case 5:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!window.location.href.includes("zzf")){t.next=2;break}return t.abrupt("return",e.$alert("测试地址可直接操作数据库结构并且禁止重新链接"));case 2:if(e.verification()){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,e.$http({url:"database/create",data:e.form});case 6:r=t.sent,200!==r.status||r.msgData?e.$alert(JSON.stringify(r.msgData),"链接失败"):alert("已成功链接数据库");case 8:case"end":return t.stop()}}),t)})))()}}},i=s,c=r("2877"),u=Object(c["a"])(i,a,n,!1,null,null,null);t["default"]=u.exports}}]);
  //# sourceMappingURL=chunk-059183ea.7d572ccb.js.map