(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-34a3b78d"],{bcca:function(e,t,s){},dfae:function(e,t,s){"use strict";s.r(t);var r=s("9ab4"),a=s("1b40"),i=s("469e"),o=s("4201");let l=class extends a.e{constructor(){super(...arguments),this.mode=o.e.ADD,this.lists=[],this.form={name:"",type:1,command:"",expression:"",status:1,remark:"",params:""},this.rules={name:[{required:!0,message:"请输入名称",trigger:"blur"}],command:[{required:!0,message:"请输入命令",trigger:"blur"}],params:[{required:!0,message:"请输入参数",trigger:"blur"}],expression:[{required:!0,message:"请输入规则",trigger:"blur"}]}}onSubmit(e){this.$refs[e].validate(e=>{if(e)switch(this.mode){case o.e.ADD:return this.handleNoticeAdd();case o.e.EDIT:return this.handleNoticeEdit()}})}blur(){""!=this.form.expression&&this.getExpressionFun()}getExpressionFun(){Object(i.d)({expression:this.form.expression}).then(e=>{this.lists=e})}handleNoticeAdd(){const e=this.form;Object(i.a)(e).then(()=>{setTimeout(()=>this.$router.go(-1),500)}).catch(()=>{this.$message.error("添加失败!")})}handleNoticeEdit(){delete this.form.status_desc,delete this.form.type_desc;const e=this.form;Object(i.c)(e).then(()=>{setTimeout(()=>this.$router.go(-1),500)}).catch(()=>{this.$message.error("修改失败!")})}initFormDataForNoticeEdit(){Object(i.b)({id:this.form.id}).then(e=>{Object.keys(e).map(t=>{this.$set(this.form,t,e[t])}),this.getExpressionFun()}).catch(()=>{this.$message.error("数据初始化失败，请刷新重载！")})}created(){const e=this.$route.query;e.mode&&(this.mode=e.mode),this.mode===o.e.EDIT&&(this.form.id=1*e.id,this.initFormDataForNoticeEdit())}};l=Object(r.a)([a.a],l);var n=l,m=(s("f726"),s("2877")),c=Object(m.a)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"substance_edit-help"},[s("div",{staticClass:"ls-card"},[s("el-page-header",{attrs:{content:"add"==this.mode?"新增定时任务":"编辑定时任务"},on:{back:function(t){return e.$router.go(-1)}}})],1),s("div",{staticClass:"ls-card m-t-16 form-container"},[s("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-width":"120px",size:"small"}},[s("el-form-item",{attrs:{label:"名称",prop:"name"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),s("el-form-item",{attrs:{label:"类型"}},[s("el-radio",{attrs:{label:1},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[e._v("定时任务")])],1),s("el-form-item",{attrs:{label:"命令",prop:"command"}},[s("el-input",{staticClass:"ls-input",attrs:{placeholder:"请输入thankphp命令，如vresion"},model:{value:e.form.command,callback:function(t){e.$set(e.form,"command",t)},expression:"form.command"}})],1),s("el-form-item",{attrs:{label:"参数"}},[s("el-input",{staticClass:"ls-input",attrs:{placeholder:"请输入参数，例:--id 8 --name 测试"},model:{value:e.form.params,callback:function(t){e.$set(e.form,"params",t)},expression:"form.params"}})],1),s("el-form-item",{attrs:{label:"状态"}},[s("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":e.styleConfig.primary,"inactive-color":"#f4f4f5"},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}})],1),s("el-form-item",{attrs:{label:"规则",prop:"expression"}},[s("el-input",{staticClass:"ls-input",attrs:{placeholder:"请输入crontab规则，例：59 * * *"},on:{blur:e.blur},model:{value:e.form.expression,callback:function(t){e.$set(e.form,"expression",t)},expression:"form.expression"}}),s("el-table",{ref:"paneTable",staticClass:"m-t-24",staticStyle:{width:"100%"},attrs:{data:e.lists,size:"mini"}},[s("el-table-column",{attrs:{prop:"time",label:"序号","min-width":"80"}}),s("el-table-column",{attrs:{prop:"date",label:"执行时间","min-width":"180"}})],1)],1),s("el-form-item",{attrs:{label:"备注"}},[s("el-input",{staticClass:"ls-input",attrs:{type:"textarea",placeholder:"请输入备注"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1)],1),s("div",{staticClass:"bg-white ls-fixed-footer"},[s("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[s("el-button",{attrs:{size:"small"},on:{click:function(t){return e.$router.go(-1)}}},[e._v("取消")]),s("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")])],1)])])}),[],!1,null,"c667e7ee",null);t.default=c.exports},f726:function(e,t,s){"use strict";s("bcca")}}]);