webpackJsonp([9],{OqIc:function(t,e){},RKvT:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("7+uW"),i=n("gyMJ"),o={name:"table-mgmt",data:function(){return{tables:[],add_location:{right:(window.innerWidth-1200)/2>20?Math.round((window.innerWidth-1200)/2):20,top:window.innerHeight-140}}},mounted:function(){var t=this;i.a.get("mgmt/table").then(function(e){t.tables=e.data}).catch(function(t){})},methods:{on_show_detail:function(t){var e=new(a.default.component("ShowTable"))({propsData:{table:t}});e.$mount(),this.$el.appendChild(e.$el)},on_change:function(t){var e=new(a.default.component("ChangeTable"))({propsData:{is_create:!1,data:t}});e.$mount(),this.$el.appendChild(e.$el)},on_delete:function(t){var e=this;this.$confirm("删除表将删除表中所有数据，包括修改记录和已删除记录，是否继续？","警告",{type:"warning"}).then(function(){i.b.delete("mgmt/table/"+t.name).then(function(n){e.$message.success("删除成功"),e.tables.splice(e.tables.indexOf(t),1)}).catch(function(t){t.response.data&&t.response.data.detail&&e.$message.error(String(t.response.data.detail))})})},on_add_table:function(){var t=this,e=new(a.default.component("ChangeTable"))({propsData:{is_create:!0}});e.$mount(),e.$on("add_table",function(e){t.tables.push(e)}),this.$el.appendChild(e.$el)}}},l={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{width:"1200px",margin:"0px auto"}},[n("div",{staticStyle:{"z-index":"9999",position:"fixed"},style:{right:t.add_location.right+"px",top:t.add_location.top+"px"},attrs:{id:"dg"}},[n("el-button",{attrs:{round:""},on:{click:t.on_add_table}},[n("span",{staticStyle:{"font-size":"50px"}},[t._v("+")])])],1),t._v(" "),n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tables}},[n("el-table-column",{attrs:{type:"index",width:"50"}}),t._v(" "),n("el-table-column",{attrs:{label:"表名",prop:"name"}}),t._v(" "),n("el-table-column",{attrs:{label:"别名",prop:"alias"}}),t._v(" "),n("el-table-column",{attrs:{label:"创建人",prop:"creator_username"}}),t._v(" "),n("el-table-column",{attrs:{label:"创建时间",prop:"creation_time"}}),t._v(" "),n("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{staticStyle:{padding:"4px"},attrs:{size:"mini",type:"info"},on:{click:function(n){t.on_show_detail(e.row)}}},[t._v("详情")]),t._v(" "),n("el-button",{staticStyle:{padding:"4px"},attrs:{size:"mini",type:"warning"},on:{click:function(n){t.on_change(e.row)}}},[t._v("修改")]),t._v(" "),n("el-button",{staticStyle:{padding:"4px"},attrs:{size:"mini",type:"danger"},on:{click:function(n){t.on_delete(e.row)}}},[t._v("删除")])]}}])})],1)],1)},staticRenderFns:[]};var s=n("VU/8")(o,l,!1,function(t){n("OqIc")},"data-v-4ad1ad45",null);e.default=s.exports}});
//# sourceMappingURL=9.9eee879f9f185b7cd0a9.js.map