| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-b499cd6c"],{9438:function(t,e,n){},d1d3:function(t,e,n){"use strict";var r=n("9438");n.n(r).a},e2606:function(t,e,n){"use strict";n.r(e),n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("159b"),n("131a");var r=n("0122"),i=n("c964"),a=(n("b0c0"),n("a434"),n("fb6a"),n("d81d"),n("a15b"),n("8593")),o=n("d708"),c=n("c276");function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(e){u=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a,o,c,s;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),r=new x(r||[]);return i(e,"_invoke",{value:(a=t,o=n,c=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return O()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n&&(n=function t(e,n){var r=n.method,i=e.iterator[r];return void 0===i?(n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d):(r=f(i,e.iterator,n.arg),"throw"===r.type?(n.method="throw",n.arg=r.arg,n.delegate=null,d):(i=r.arg,i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)))}(n,c),n)){if(n===d)continue;return n}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);if(s="executing",n=f(a,o,c),"normal"===n.type){if(s=c.done?"completed":"suspendedYield",n.arg===d)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(s="completed",c.method="throw",c.arg=n.arg)}})}),e}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var d={};function p(){}function m(){}function g(){}a={};var v=(u(a,o,(function(){return this})),Object.getPrototypeOf),y=(v=v&&v(v(M([]))),v&&v!==e&&n.call(v,o)&&(a=v),g.prototype=p.prototype=Object.create(a));function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){var a;i(this,"_invoke",{value:function(i,o){function c(){return new e((function(a,c){!function i(a,o,c,s){var l;a=f(t[a],t,o);if("throw"!==a.type)return(o=(l=a.arg).value)&&"object"==Object(r.a)(o)&&n.call(o,"__await")?e.resolve(o.__await).then((function(t){i("next",t,c,s)}),(function(t){i("throw",t,c,s)})):e.resolve(o).then((function(t){l.value=t,c(l)}),(function(t){return i("throw",t,c,s)}));s(a.arg)}(i,o,a,c)}))}return a=a?a.then(c,c):c()}})}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function M(t){if(t){var e,r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(r=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r}).next=r}return{next:O}}function O(){return{value:void 0,done:!0}}return i(y,"constructor",{value:m.prototype=g,configurable:!0}),i(g,"constructor",{value:m,configurable:!0}),m.displayName=u(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,l,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(k.prototype),u(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new k(h(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(y),u(y,l,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=M,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;0<=i;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}var o=(a=a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc?null:a)?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,L(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}var l={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"},{title:"操作",slot:"action",fixed:"right",minWidth:60}],rows:{},dataList:{},loading2:!1,loading3:!1,markModal:!1,mark:"",header:{},Token:"",changeMarkData:{table:"",mark:"",type:"",field:""}}},computed:{fileUrl:function(){var t=o.a.apiBaseURL.indexOf("/adminapi/");return o.a.apiBaseURL.substring(0,t)}},created:function(){this.getToken(),this.getList(),this.getfileList()},methods:{editMark:function(t,e){this.changeMarkData.table=t.name||t.TABLE_NAME,this.changeMarkData.field=t.COLUMN_NAME||"",this.changeMarkData.type=t.COLUMN_TYPE||"",this.changeMarkData.is_field=e,this.markModal=!0},ok:function(){var t=this;this.changeMarkData.mark=this.mark,Object(a.ib)(this.changeMarkData).then((function(e){t.$Message.success(e.msg),t.changeMarkData.is_field?t.Info({name:t.changeMarkData.table}):t.getList()}))},cancel:function(){this.mark=""},ImportFile:function(t){var e=this;Object(a.v)({part:t.part,time:t.time}).then(function(){var t=Object(i.a)(s().mark((function t(n){return s().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 r=this;e={title:e,num:n,url:"system/backup/del_file",method:"DELETE",ids:{filename:t.time}};this.$modalSure(e).then((function(t){r.$Message.success(t.msg),r.tabList.splice(n,1)})).catch((function(t){r.$Message.error(t.msg)}))},getToken:function(){this.Token=Object(c.c)("token")},download:function(t){var e=this;t={time:t.time};Object(a.u)(t).then((function(t){t.data.key&&window.open(o.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)(s().mark((function e(n){return s().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.w)().then(function(){var e=Object(i.a)(s().mark((function e(n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.tabList=r.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)(s().mark((function e(n){return s().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)(s().mark((function e(n){return s().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)(s().mark((function e(n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.tabList2=r.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)(s().mark((function t(n){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,e.tabList3=r.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("d1d3"),n=n("2877"),n=Object(n.a)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Card",{staticClass:"ivu-mt listbox",attrs:{bordered:!1,"dis-hover":""}},[n("Tabs",{staticClass:"mb30"},[n("TabPane",{attrs:{label:"数据库列表"}},[n("Card",{staticClass:"tableBox mt10",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 r=e.row;return[n("a",{on:{click:function(e){return t.editMark(r,0)}}},[t._v("备注")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.Info(r)}}},[t._v("详情")])]}}])})],1),n("Drawer",{attrs:{closable:!1,closable:"",width:"740",title:"[ "+t.rows.name+" ]"+t.rows.comment},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":"暂无筛选结果"},scopedSlots:t._u([{key:"action",fn:function(e){var r=e.row;return[n("a",{on:{click:function(e){return t.editMark(r,1)}}},[t._v("备注")])]}}])})],1)],1),n("TabPane",{attrs:{label:"备份列表"}},[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 r=e.row,i=e.index;return[n("a",{on:{click:function(e){return t.ImportFile(r)}}},[t._v("导入")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.del(r,"删除该备份",i)}}},[t._v("删除")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.download(r)}}},[t._v("下载")])]}}])})],1)],1)],1)],1),n("Modal",{attrs:{title:"修改备注"},on:{"on-ok":t.ok,"on-cancel":t.cancel,"on-visible-change":t.cancel},model:{value:t.markModal,callback:function(e){t.markModal=e},expression:"markModal"}},[n("Input",{model:{value:t.mark,callback:function(e){t.mark=e},expression:"mark"}})],1)],1)}),[],!1,null,"1892e608",null);e.default=n.exports}}]);
|