yxk_pc_mdh/gyhl/static/js/268.37e991a9ab49c110bad9.js

1 line
3.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([268],{"7ICV":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("Dd8w"),o=a.n(s),r=a("bzuE"),i=a("NYxO"),n={data:function(){return{formData:{},sexoptions:[{value:1,label:"天"},{value:0,label:"小时"}],config:r.a,btn:!0,isDisabled:!1,ruleForm:{type:[{required:!0,message:"备份时间间隔单位",trigger:"change"}],num:[{required:!0,message:"备份时间间隔",trigger:"change"}]}}},mounted:function(){this.startDetail()},methods:o()({},Object(i.d)({removeTagNav:"tagNav/removeTagNav"}),{startDetail:function(){var e=this;this.$api.backUpAPI.detail().then(function(t){0==t.code?e.formData=t.data:e.formData=""}).catch(function(e){console.log(e)})},save:function(e){var t=this;this.$refs[e].validate(function(e){if(e){var a=!0;if(0==t.formData.type){a=/^[1-9]$|^[1][0-9]$|^[2][0-3]$/.test(t.formData.num),console.log(a)}if(!a)return void t.$message({message:"当单位为小时间隔时间为1-23的整数",type:"warning"});var s=!0;if(1==t.formData.type){s=/^[1-9]$|^[1][0-9]$|^[2][0-8]$/.test(t.formData.num),console.log(a)}if(!s)return void t.$message({message:"当单位为天间隔时间为1-28的整数",type:"warning"});var o={type:t.formData.type,num:t.formData.num,filePath:t.formData.filePath};if(t.isDisabled)return;t.isDisabled=!0,t.$api.backUpAPI.save(o).then(function(e){t.isDisabled=!1,0==e.code?(t.$message({message:e.msg,type:"success"}),t.startDetail()):t.$message({message:e.msg,type:"error"})}).catch(function(e){console.log(e)})}})},copyNow:function(){var e=this;this.$api.backUpAPI.copyNow().then(function(t){0==t.code?e.$message({message:t.msg,type:"success"}):e.$message({message:t.msg,type:"error"})}).catch(function(e){console.log(e)})},close:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/home",query:{t:Date.now()}})}})},l={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.close()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.copyNow()}}},[e._v("立即备份")])],1),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[e._v("自动备份设置:")]),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"140px","inline-message":!0,model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"备份时间间隔单位",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.formData.type,callback:function(t){e.$set(e.formData,"type",t)},expression:"formData.type"}},e._l(e.sexoptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"备份时间间隔",prop:"num"}},[a("el-input",{attrs:{clearable:""},model:{value:e.formData.num,callback:function(t){e.$set(e.formData,"num",t)},expression:"formData.num"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"备份路径"}},[a("el-input",{model:{value:e.formData.filePath,callback:function(t){e.$set(e.formData,"filePath",t)},expression:"formData.filePath"}})],1)],1)])],1)],1)},staticRenderFns:[]};var c=a("VU/8")(n,l,!1,function(e){a("gOG0")},"data-v-f02278bc",null);t.default=c.exports},gOG0:function(e,t){}});