(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{570:function(e,t,a){},920:function(e,t,a){"use strict";var s=a(570);a.n(s).a},964:function(e,t,a){"use strict";a.r(t);var s,n=a(0),r=a.n(n),i=(a(8),a(1)),c=a.n(i),l=a(203),o=a.n(l),u=(a(205),a(29),a(206)),d=(a(207),a(208)),m=(a(212),a(211)),p=(a(209),a(210)),f=(a(34),a(216),a(217)),b={props:["type","title","show"],components:(s={},o()(s,f.a.name,f.a),o()(s,p.a.name,p.a),o()(s,m.a.name,m.a),o()(s,d.a.name,d.a),o()(s,u.a.name,u.a),s),data:function(){return{dict:"",name:""}},computed:{dicts:function(){return this.$store.state.database.database}},methods:{submit:function(){var e=this;return c()(r.a.mark((function t(){var a;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.name){t.next=3;break}return e.$message({type:"warning",message:"请输入关系名称"}),t.abrupt("return");case 3:if(e.dict){t.next=6;break}return e.$message({type:"warning",message:"请先选择保存位置"}),t.abrupt("return");case 6:return t.prev=6,t.next=9,e.$store.dispatch({type:"addRelation",name:e.name,dict:e.dict,baseData:e.$store.state.relation.curRelation.svgTree,addType:e.type});case 9:a=t.sent,e.$message({type:"success",message:"保存成功"}),e.$router.push({name:"datasource-relation",params:{mode:"show",id:a.id}}),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(6),"duplicated table name"===t.t0.response.data.error.message?e.$message({type:"error",message:"文件名重复"}):e.$message({type:"error",message:"保存失败"});case 17:e.close();case 18:case"end":return t.stop()}}),t,null,[[6,14]])})))()},close:function(){this.$emit("close")}},watch:{show:{handler:function(){this.name="",this.dict=""},immediate:!0}}},h=(a(920),a(88)),w=Object(h.a)(b,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.title,visible:e.show,width:"484px","append-to-body":""},on:{close:e.close}},[a("div",{staticClass:"add"},[a("el-row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[a("span",[e._v("关系名称")]),a("el-input",{attrs:{size:"small"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1),a("el-row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[a("span",[e._v("保存位置")]),a("el-select",{attrs:{placeholder:"请选择保存文件夹",size:"small"},model:{value:e.dict,callback:function(t){e.dict=t},expression:"dict"}},e._l(e.dicts,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("template",{slot:"footer"},[a("el-button",{attrs:{size:"small",plain:""},on:{click:e.close}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.submit}},[e._v("确定")])],1)],2)}),[],!1,null,"a7f2f5b4",null);t.default=w.exports}}]);