webpackJsonp([32],{"6ugD":function(e,t){},MKq3:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),o=a.n(r),s=(a("ftAF"),{created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/dataSourceInfo/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(e.formData=t.data)})},data:function(){return{saving:!1,formData:{databaseType:"Mysql"},rules:{code:[{required:!0,message:"请输入 code",trigger:"blur"}],databaseType:[{required:!0,message:"请输入 数据库类型",trigger:"blur"}],url:[{required:!0,message:"请输入 链接",trigger:"blur"}],username:[{required:!0,message:"请输入 用户名",trigger:"blur"}],password:[{required:!0,message:"请输入 密码",trigger:"blur"}],databaseName:[{required:!0,message:"请输入 名称",trigger:"blur"}]}}},methods:{onSave:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.submit()})},submit:function(){var e=this,t=JSON.parse(o()(this.formData));this.$http.post({url:this.formData.id?"/dataSourceInfo/update":"/dataSourceInfo/save",data:t}).then(function(t){t.success?(e.$message.success("成功"),e.$router.go(-1)):e.$message.warning("失败")})},onDelete:function(){var e=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return e.$http.post({url:"/dataSourceInfo/del",data:{id:e.formData.id}})}).then(function(){e.$message.success("删除成功"),e.$router.go(-1)}).catch(function(t){"cancel"===t?e.$message.info("删除取消"):e.$message.error("删除失败")})}}}),n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:e.formData,rules:e.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"databaseType",label:"类型"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"数据库",size:"small"},model:{value:e.formData.databaseType,callback:function(t){e.$set(e.formData,"databaseType",t)},expression:"formData.databaseType"}},[a("el-option",{attrs:{label:"Mysql",value:"Mysql"}}),e._v(" "),a("el-option",{attrs:{label:"SqlServer",value:"SqlServer"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"code",label:"code"}},[a("el-input",{model:{value:e.formData.code,callback:function(t){e.$set(e.formData,"code",t)},expression:"formData.code"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"databaseName",label:"名称"}},[a("el-input",{model:{value:e.formData.databaseName,callback:function(t){e.$set(e.formData,"databaseName",t)},expression:"formData.databaseName"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"url",label:"链接"}},[a("el-input",{model:{value:e.formData.url,callback:function(t){e.$set(e.formData,"url",t)},expression:"formData.url"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"username",label:"用户名"}},[a("el-input",{model:{value:e.formData.username,callback:function(t){e.$set(e.formData,"username",t)},expression:"formData.username"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"password",label:"密码"}},[a("el-input",{model:{value:e.formData.password,callback:function(t){e.$set(e.formData,"password",t)},expression:"formData.password"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:e.$store.state.fetchingData,type:"primary"},on:{click:e.onSave}},[e._v("保存")]),e._v(" "),e.formData.id?a("el-button",{attrs:{type:"danger"},on:{click:e.onDelete}},[e._v("删除")]):e._e(),e._v(" "),a("el-button",{on:{click:function(t){e.$router.go(-1)}}},[e._v("取消")])],1)],1)],1)},staticRenderFns:[]};var i=a("VU/8")(s,n,!1,function(e){a("6ugD")},"data-v-4b2caafd",null);t.default=i.exports},ftAF:function(e,t,a){"use strict";t.a={phone:{validator:function(e,t,a){t&&(/^1[3-9]\d{9}$/.test(t)?a():a(new Error("请输入正确的手机号")))},trigger:"blur"},number:{validator:function(e,t,a){t&&(/(^[0-9]*$)|(^[0-9]*\.[0-9]*$)/.test(t)?a():a(new Error("请输入正确的数值")))},trigger:"blur"},url:{validator:function(e,t,a){t&&(/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/.test(t)?a():a(new Error("请输入正确的网址")))},trigger:"blur"},email:{validator:function(e,t,a){t&&(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)?a():a(new Error("请输入正确的邮箱地址")))},trigger:"blur"},idCard:{validator:function(e,t,a){t&&(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/.test(t)?a():a(new Error("请输入正确的身份证")))},trigger:"blur"},english:{validator:function(e,t,a){t&&(/[A-Za-z]/.test(t)?a():a(new Error("请输入正确的英文字符")))},trigger:"blur"}}},mvHQ:function(e,t,a){e.exports={default:a("qkKv"),__esModule:!0}},qkKv:function(e,t,a){var r=a("FeBl"),o=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}}});