mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-27 14:10:35 +00:00
1 line
7.9 KiB
JavaScript
1 line
7.9 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-8c26a816"],{"09f0":function(t,e,n){"use strict";var i=n("25b3b");n.n(i).a},"25b3b":function(t,e,n){},e2606:function(t,e,n){"use strict";n.r(e);var i=n("c964"),a=(n("a434"),n("fb6a"),n("d81d"),n("b0c0"),n("a15b"),n("96cf"),n("8593")),s=n("d708"),r=n("c276"),o={name:"systemDatabackup",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:150}],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:150}],selectionList:[],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:{},loading2:!1,loading3:!1,header:{},Token:""}},computed:{fileUrl:function(){var t=s.a.apiBaseURL.indexOf("/adminapi/");return s.a.apiBaseURL.substring(0,t)}},created:function(){this.getToken(),this.getList(),this.getfileList()},methods:{ImportFile:function(t){var e=this;Object(a.u)({part:t.part,time:t.time}).then(function(){var t=Object(i.a)(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.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 i=this;e={title:e,num:n,url:"system/backup/del_file",method:"DELETE",ids:{filename:t.time}};this.$modalSure(e).then((function(t){i.$Message.success(t.msg),i.tabList.splice(n,1)})).catch((function(t){i.$Message.error(t.msg)}))},getToken:function(){this.Token=Object(r.d)("token")},download:function(t){var e=this;t={time:t.time};Object(a.t)(t).then((function(t){t.data.key&&window.open(s.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(a.b)(this.dataList).then(function(){var e=Object(i.a)(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.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(a.v)().then(function(){var e=Object(i.a)(regeneratorRuntime.mark((function e(n){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=n.data,t.tabList=i.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(a.d)(this.dataList).then(function(){var e=Object(i.a)(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.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(a.f)(this.dataList).then(function(){var e=Object(i.a)(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.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(a.c)().then(function(){var e=Object(i.a)(regeneratorRuntime.mark((function e(n){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=n.data,t.tabList2=i.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){var e=this;this.rows=t,this.modals=!0,this.loading2=!0,t={tablename:t.name};Object(a.e)(t).then(function(){var t=Object(i.a)(regeneratorRuntime.mark((function t(n){var i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=n.data,e.tabList3=i.list,e.loading2=!1;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading2=!1,e.$Message.error(t.msg)}))}}};n("09f0"),n=n("2877"),n=Object(n.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"i-layout-page-header header-title"},[n("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.meta.title))])]),n("Card",{staticClass:"ivu-mt",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 i=e.row,a=e.index;return[n("a",{on:{click:function(e){return t.ImportFile(i)}}},[t._v("导入")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.del(i,"删除该备份",a)}}},[t._v("删除")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.download(i)}}},[t._v("下载")])]}}])})],1),n("Card",{staticClass:"ivu-mt tableBox",attrs:{bordered:!1,"dis-hover":""}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{staticClass:"ivu-pl-8 mr10"},[t._v("数据库表列表")]),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 i=e.row;return e.index,[n("a",{on:{click:function(e){return t.Info(i)}}},[t._v("详情")])]}}])})],1),n("Modal",{staticClass:"tableBox",attrs:{scrollable:"","footer-hide":"",closable:"",title:"[ "+t.rows.name+" ]"+t.rows.comment,"mask-closable":!1,width:"750"},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[n("Table",{ref:"selection",attrs:{columns:t.columns2,data:t.tabList3,loading:t.loading2,"no-data-text":"暂无数据","highlight-row":"","max-height":"600",size:"small","no-filtered-data-text":"暂无筛选结果"}})],1)],1)}),[],!1,null,"92e0f8fe",null);e.default=n.exports}}]); |