text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22c0b3"],{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),r("p",[e._v("请根据需求使用：")]),r("p",[e._v("链接库：您现在有数据库，并且尝试进行链接")]),r("p",[e._v("创建并连接库：没有这个数据库，我会先创建一个数据库在进行链接")])],1)},o=[],n=(r("96cf"),r("1da1")),s={data:function(){return{form:{user:"root",port:3306,host:"localhost"}}},created:function(){this.$root.webpageView&&this.$alert("本网站所有数据均为本地cookies缓存，不会存储您任何数据库信息，请放心使用，如实属不放心，您可以尝试下载本地开源版本（gitee.com/zzf0529/Dave），开源不易，欢迎start")},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(n["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.verification()){t.next=2;break}return t.abrupt("return");case 2:e.$confirm("本操作会创建一个新库进行连接，请确认操作，如已有版本库，可以尝试直接链接。","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(n["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.$root.webpageView&&e.loc.set("index",e.form)),e.form.create="";case 6:case"end":return t.stop()}}),t)}))));case 3:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;return Object(n["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.verification()){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.$http({url:"database/create",data:e.form});case 4:r=t.sent,e.$root.webpageView&&e.loc.set("index",e.form),200!==r.status||r.msgData?e.$alert(JSON.stringify(r.msgData),"链接失败"):alert("已成功链接数据库");case 7:case"end":return t.stop()}}),t)})))()}}},i=s,l=r("2877"),c=Object(l["a"])(i,a,o,!1,null,null,null);t["default"]=c.exports}}]);
  //# sourceMappingURL=chunk-2d22c0b3.f45ab316.js.map