chunk-d5773926.9de8726b.js 8.6 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d5773926"],{"28c7":function(t,e,n){"use strict";var a=n("45b1");n.n(a).a},"45b1":function(t,e,n){},7754:function(t,e,n){"use strict";var a=n("c0b0");n.n(a).a},c0b0:function(t,e,n){},e260:function(t,e,n){"use strict";n.r(e);var a=n("a34a"),i=n.n(a),s=n("8593"),r=n("d708");function o(t,e,n,a,i,s,r){try{var o=t[s](r),c=o.value}catch(t){return void n(t)}o.done?e(c):Promise.resolve(c).then(a,i)}var c={name:"dataDetails",data:function(){return{modals:!1,tablename:"表",tabList3:[],columns2:[{title:"字段名",key:"COLUMN_NAME"},{title:"数据类型",key:"COLUMN_TYPE"},{title:"默认值",key:"COLUMN_DEFAULT"},{title:"允许非空",key:"IS_NULLABLE"},{title:"自动递增",key:"EXTRA"},{title:"备注",key:"COLUMN_COMMENT"}],rows:{},dataList:{}}},methods:{getDetails:function(t){var e=this;this.tablename=t.comment+"["+t.name+"]";var n={tablename:t.name};Object(s.e)(n).then(function(){var t,n=(t=i.a.mark((function t(n){var a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.data,e.tabList3=a.list;case 2:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(a,i){var s=t.apply(e,n);function r(t){o(s,a,i,r,c,"next",t)}function c(t){o(s,a,i,r,c,"throw",t)}r(void 0)}))});return function(t){return n.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))}}},l=(n("7754"),n("2877"));function u(t,e,n,a,i,s,r){try{var o=t[s](r),c=o.value}catch(t){return void n(t)}o.done?e(c):Promise.resolve(c).then(a,i)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(a,i){var s=t.apply(e,n);function r(t){u(s,a,i,r,o,"next",t)}function o(t){u(s,a,i,r,o,"throw",t)}r(void 0)}))}}var f={name:"systemDatabackup",components:{dataDetails:Object(l.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Drawer",{attrs:{closable:!1,width:"840",title:t.tablename},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[n("Table",{ref:"selection",attrs:{columns:t.columns2,data:t.tabList3,"no-data-text":"暂无数据","highlight-row":"",size:"small","no-filtered-data-text":"暂无筛选结果"}})],1)],1)}),[],!1,null,null,null).exports},data:function(){return{modals:!1,loading:!1,tabList:[],columns4:[{title:"备份名称",key:"filename",minWidth:200,sortable:!0},{title:"part",key:"part",minWidth:100},{title:"大小",key:"size",minWidth:150},{title:"compress",key:"compress",minWidth:100},{title:"时间",key:"backtime",minWidth:150},{title:"操作",slot:"action",fixed:"right",minWidth:100}],tabList2:[],columns:[{type:"selection",width:60,align:"center"},{title:"表名称",key:"name",minWidth:200,sortable:!0},{title:"备注",key:"comment",minWidth:200},{title:"类型",key:"engine",minWidth:130,sortable:!0},{title:"大小",key:"data_length",minWidth:130,sortable:!0},{title:"更新时间",key:"update_time",minWidth:150,sortable:!0},{title:"行数",key:"rows",minWidth:100,sortable:!0},{title:"操作",slot:"action",fixed:"right",minWidth:60}],selectionList:[],rows:{},dataList:{},loading2:!1,loading3:!1,header:{},Token:""}},computed:{fileUrl:function(){var t=r.a.apiBaseURL.indexOf("/adminapi/");return r.a.apiBaseURL.substring(0,t)}},created:function(){this.getToken(),this.getList(),this.getfileList()},methods:{ImportFile:function(t){var e=this;Object(s.r)({part:t.part,time:t.time}).then(function(){var t=d(i.a.mark((function t(n){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(n.msg),e.getfileList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$Message.error(t.msg)}))},del:function(t,e,n){var a=this,i={title:e,num:n,url:"system/backup/del_file",method:"DELETE",ids:{filename:t.time}};this.$modalSure(i).then((function(t){a.$Message.success(t.msg),a.tabList.splice(n,1)})).catch((function(t){a.$Message.error(t.msg)}))},getToken:function(){var t=this;this.$store.dispatch("admin/db/database",{user:!0}).then((function(e){t.Token=e.get("TOKEN").value()}))},download:function(t){var e=this,n={time:t.time};Object(s.q)(n).then((function(t){t.data.key&&window.open(r.a.apiBaseURL+"/download?key="+t.data.key)})).catch((function(t){e.$Message.error(t)}))},exportData:function(){var t=this.columns.slice(1,7);this.$refs.selection.exportCsv({filename:"导出",columns:t,data:this.tabList2})},onSelectTab:function(t){this.selectionList=t;var e=[];this.selectionList.map((function(t){e.push(t.name)})),this.dataList={tables:e.join(",")}},getBackup:function(){var t=this;if(0===this.selectionList.length)return this.$Message.warning("请选择表");Object(s.b)(this.dataList).then(function(){var e=d(i.a.mark((function e(n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$Message.success(n.msg),t.getfileList();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},getfileList:function(){var t=this;this.loading3=!0,Object(s.s)().then(function(){var e=d(i.a.mark((function e(n){var a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.data,t.tabList=a.list,t.loading3=!1;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading3=!1,t.$Message.error(e.msg)}))},getOptimize:function(){var t=this;if(0===this.selectionList.length)return this.$Message.warning("请选择表");Object(s.d)(this.dataList).then(function(){var e=d(i.a.mark((function e(n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$Message.success(n.msg);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},getRepair:function(){var t=this;if(0===this.selectionList.length)return this.$Message.warning("请选择表");Object(s.f)(this.dataList).then(function(){var e=d(i.a.mark((function e(n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$Message.success(n.msg);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},getList:function(){var t=this;this.loading=!0,Object(s.c)().then(function(){var e=d(i.a.mark((function e(n){var a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.data,t.tabList2=a.list,t.loading=!1;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},Info:function(t){this.$refs.dataDetails.modals=!0,this.$refs.dataDetails.activeName="datainfo",this.$refs.dataDetails.getDetails(t)}}},h=(n("28c7"),Object(l.a)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Card",{staticClass:"ivu-mt",attrs:{"dis-hover":""}},[n("div",{staticClass:"new_tab"},[n("Tabs",{attrs:{value:"name1"}},[n("TabPane",{attrs:{label:"数据库列表",name:"name1"}},[n("Card",{attrs:{bordered:!1,"dis-hover":""}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.getBackup}},[t._v("备份")]),n("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.getOptimize}},[t._v("优化表")]),n("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.getRepair}},[t._v("修复表")]),n("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:function(e){return t.exportData(1)}}},[t._v("导出文件")])],1),n("Table",{ref:"selection",attrs:{columns:t.columns,data:t.tabList2,loading:t.loading,"highlight-row":"","no-data-text":"暂无数据",size:"small","no-filtered-data-text":"暂无筛选结果"},on:{"on-selection-change":t.onSelectTab},scopedSlots:t._u([{key:"action",fn:function(e){var a=e.row;return e.index,[n("a",{on:{click:function(e){return t.Info(a)}}},[t._v("详情")])]}}])}),n("data-details",{ref:"dataDetails"})],1)],1),n("TabPane",{attrs:{label:"备份列表",name:"name2"}},[n("Card",{attrs:{bordered:!1,"dis-hover":""}},[n("Table",{ref:"selection",attrs:{columns:t.columns4,data:t.tabList,loading:t.loading3,"no-data-text":"暂无数据","highlight-row":"",size:"small","no-filtered-data-text":"暂无筛选结果"},scopedSlots:t._u([{key:"action",fn:function(e){var a=e.row,i=e.index;return[n("a",{on:{click:function(e){return t.ImportFile(a)}}},[t._v("导入")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.del(a,"删除该备份",i)}}},[t._v("删除")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.download(a)}}},[t._v("下载")])]}}])})],1)],1)],1)],1)])],1)}),[],!1,null,"bdb99832",null));e.default=h.exports}}]);