(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5adeb9a7"],{"1b9f":function(e,t,a){},"333d":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[a("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},r=[];a("c5f6");Math.easeInOutQuad=function(e,t,a,n){return e/=n/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function s(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,a){var n=o(),r=e-n,l=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=l;var o=Math.easeInOutQuad(u,n,r,t);s(o),u0,expression:"dataList.count > 0"}],attrs:{total:e.dataList.count,page:e.listQuery.page,limit:e.listQuery.page_size},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"page_size",t)},pagination:e.getList}}),e._v(" "),a("el-dialog",{attrs:{visible:e.dialogVisible,title:"update"===e.dialogType?"编辑":"新增"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("span",[e._v("简单配置,复杂的可以去admin后台操作")]),e._v(" "),a("el-form",{ref:"Form",attrs:{model:e.ptask,"label-width":"80px",rules:e.dynamicRules}},[a("el-form-item",{attrs:{label:"名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"名称"},model:{value:e.ptask.name,callback:function(t){e.$set(e.ptask,"name",t)},expression:"ptask.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"执行代码",prop:"task"}},[a("el-input",{attrs:{placeholder:"例:apps.system.tasks.show"},model:{value:e.ptask.task,callback:function(t){e.$set(e.ptask,"task",t)},expression:"ptask.task"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"时间策略"}},[a("el-radio-group",{model:{value:e.ptask.timetype,callback:function(t){e.$set(e.ptask,"timetype",t)},expression:"ptask.timetype"}},[a("el-radio",{attrs:{label:"interval"}},[e._v("间隔")]),e._v(" "),a("el-radio",{attrs:{label:"crontab"}},[e._v("crontab")])],1)],1),e._v(" "),"interval"==e.ptask.timetype?a("el-form-item",{attrs:{label:"每隔"}},[a("el-input-number",{attrs:{min:1},model:{value:e.ptask.interval_.every,callback:function(t){e.$set(e.ptask.interval_,"every",t)},expression:"ptask.interval_.every"}}),e._v(" "),a("el-select",{staticStyle:{width:"100px"},attrs:{placeholder:"请选择"},model:{value:e.ptask.interval_.period,callback:function(t){e.$set(e.ptask.interval_,"period",t)},expression:"ptask.interval_.period"}},e._l(e.periodOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),"crontab"==e.ptask.timetype?a("el-form-item",{attrs:{label:"分钟",prop:"crontab_.minute"}},[a("el-input",{attrs:{placeholder:'Cron Minutes to Run. Use "*" for "all". (Example: "0,30")'},model:{value:e.ptask.crontab_.minute,callback:function(t){e.$set(e.ptask.crontab_,"minute",t)},expression:"ptask.crontab_.minute"}})],1):e._e(),e._v(" "),"crontab"==e.ptask.timetype?a("el-form-item",{attrs:{label:"小时",prop:"crontab_.hour"}},[a("el-input",{attrs:{placeholder:'Cron Hours to Run. Use "*" for "all". (Example: "8,20")'},model:{value:e.ptask.crontab_.hour,callback:function(t){e.$set(e.ptask.crontab_,"hour",t)},expression:"ptask.crontab_.hour"}})],1):e._e(),e._v(" "),"crontab"==e.ptask.timetype?a("el-form-item",{attrs:{label:"每周的天",prop:"crontab_.day_of_week"}},[a("el-input",{attrs:{placeholder:'Cron Days Of The Week to Run. Use "*" for "all". (Example: "0,5")'},model:{value:e.ptask.crontab_.day_of_week,callback:function(t){e.$set(e.ptask.crontab_,"day_of_week",t)},expression:"ptask.crontab_.day_of_week"}})],1):e._e(),e._v(" "),"crontab"==e.ptask.timetype?a("el-form-item",{attrs:{label:"每月的天",prop:"crontab_.day_of_month"}},[a("el-input",{attrs:{placeholder:'Cron Days Of The Month to Run. Use "*" for "all". (Example: "1,15")'},model:{value:e.ptask.crontab_.day_of_month,callback:function(t){e.$set(e.ptask.crontab_,"day_of_month",t)},expression:"ptask.crontab_.day_of_month"}})],1):e._e(),e._v(" "),"crontab"==e.ptask.timetype?a("el-form-item",{attrs:{label:"每年的月",prop:"crontab_.month_of_year"}},[a("el-input",{attrs:{placeholder:'Cron Months Of The Year to Run. Use "*" for "all". (Example: "0,6")'},model:{value:e.ptask.crontab_.month_of_year,callback:function(t){e.$set(e.ptask.crontab_,"month_of_year",t)},expression:"ptask.crontab_.month_of_year"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"列表参数",prop:"args"}},[a("el-input",{attrs:{placeholder:'JSON encoded positional arguments,(Example: ["arg1", "arg2"])'},model:{value:e.ptask.args,callback:function(t){e.$set(e.ptask,"args",t)},expression:"ptask.args"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"字典参数",prop:"kwargs"}},[a("el-input",{attrs:{placeholder:'JSON encoded keyword arguments,(Example: {"argument": "value"})'},model:{value:e.ptask.kwargs,callback:function(t){e.$set(e.ptask,"kwargs",t)},expression:"ptask.kwargs"}})],1)],1),e._v(" "),a("span",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.confirmForm("Form")}}},[e._v("确认")])],1)],1)],1)},r=[],i=(a("96cf"),a("1da1")),s=a("b775");function o(e){return Object(s["a"])({url:"/system/ptask/",method:"get",params:e})}function l(e){return Object(s["a"])({url:"/system/ptask/",method:"post",data:e})}function u(e,t){return Object(s["a"])({url:"/system/ptask/".concat(e,"/"),method:"put",data:t})}function c(e){return Object(s["a"])({url:"/system/ptask/".concat(e,"/toggle/"),method:"put"})}function p(e){return Object(s["a"])({url:"/system/ptask/".concat(e,"/"),method:"delete"})}var d=a("333d"),m=a("e350"),f={timetype:"interval",interval_:{every:1,period:"minutes"},crontab_:{}},g={components:{Pagination:d["a"]},data:function(){return{dialogVisible:!1,dialogType:"create",ptask:f,dataList:{count:0},listLoading:!0,listQuery:{page:1,page_size:20},enabledOptions:[{key:"true",display_name:"启用"},{key:"false",display_name:"禁用"}],rule1:{name:[{required:!0,message:"请输入",trigger:"blur"}],task:[{required:!0,message:"请输入",trigger:"blur"}]},rule2:{name:[{required:!0,message:"请输入",trigger:"blur"}],task:[{required:!0,message:"请输入",trigger:"blur"}],"crontab_.minute":[{required:!0,message:"请输入",trigger:"blur"}],"crontab_.hour":[{required:!0,message:"请输入",trigger:"blur"}],"crontab_.day_of_week":[{required:!0,message:"请输入",trigger:"blur"}],"crontab_.day_of_month":[{required:!0,message:"请输入",trigger:"blur"}],"crontab_.month_of_year":[{required:!0,message:"请输入",trigger:"blur"}]},periodOptions:[{value:"days",label:"天"},{value:"hours",label:"小时"},{value:"minutes",label:"分钟"},{value:"seconds",label:"秒"}]}},computed:{dynamicRules:function(){return"interval"==this.timetype?this.rule1:this.rule2}},created:function(){this.getList()},methods:{checkPermission:m["a"],getList:function(){var e=this;this.listLoading=!0,o(this.listQuery).then((function(t){t.data&&(e.dataList=t.data),e.listLoading=!1}))},resetFilter:function(){this.listQuery={page:1,page_size:20},this.getList()},handleFilter:function(){this.listQuery.page=1,this.getList()},handleCreate:function(){var e=this;this.ptask=Object.assign({},f),this.dialogType="create",this.dialogVisible=!0,this.$nextTick((function(){e.$refs["Form"].clearValidate()}))},handleUpdate:function(e){var t=this;this.ptask=Object.assign({},e.row),this.ptask.interval_||(this.ptask.interval_={}),this.ptask.crontab_||(this.ptask.crontab_={}),this.dialogType="update",this.dialogVisible=!0,this.$nextTick((function(){t.$refs["Form"].clearValidate()}))},handleDelete:function(e){var t=this;this.$confirm("确认删除?","警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"error"}).then(Object(i["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,p(e.row.id);case 2:t.getList(),t.$message.success("成功");case 4:case"end":return a.stop()}}),a)})))).catch((function(e){console.error(e)}))},handleToggle:function(e){var t=this;c(e.row.id).then((function(e){t.$message.success("成功")})).catch((function(e){t.getList()}))},confirmForm:function(){var e=this;this.$refs["Form"].validate((function(t){if(!t)return!1;var a="update"===e.dialogType;a?u(e.ptask.id,e.ptask).then((function(){e.getList(),e.dialogVisible=!1,e.$message.success("成功")})):l(e.ptask).then((function(t){e.getList(),e.dialogVisible=!1,e.$message.success("成功")}))}))}}},b=g,h=a("2877"),_=Object(h["a"])(b,n,r,!1,null,null,null);t["default"]=_.exports},aa77:function(e,t,a){var n=a("5ca1"),r=a("be13"),i=a("79e5"),s=a("fdef"),o="["+s+"]",l="​…",u=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),p=function(e,t,a){var r={},o=i((function(){return!!s[e]()||l[e]()!=l})),u=r[e]=o?t(d):s[e];a&&(r[a]=u),n(n.P+n.F*o,"String",r)},d=p.trim=function(e,t){return e=String(r(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(c,"")),e};e.exports=p},baa8:function(e,t,a){"use strict";a("1b9f")},c5f6:function(e,t,a){"use strict";var n=a("7726"),r=a("69a8"),i=a("2d95"),s=a("5dbc"),o=a("6a99"),l=a("79e5"),u=a("9093").f,c=a("11e9").f,p=a("86cc").f,d=a("aa77").trim,m="Number",f=n[m],g=f,b=f.prototype,h=i(a("2aeb")(b))==m,_="trim"in String.prototype,k=function(e){var t=o(e,!1);if("string"==typeof t&&t.length>2){t=_?t.trim():d(t,3);var a,n,r,i=t.charCodeAt(0);if(43===i||45===i){if(a=t.charCodeAt(2),88===a||120===a)return NaN}else if(48===i){switch(t.charCodeAt(1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+t}for(var s,l=t.slice(2),u=0,c=l.length;ur)return NaN;return parseInt(l,n)}}return+t};if(!f(" 0o1")||!f("0b1")||f("+0x1")){f=function(e){var t=arguments.length<1?0:e,a=this;return a instanceof f&&(h?l((function(){b.valueOf.call(a)})):i(a)!=m)?s(new g(k(t)),a,f):k(t)};for(var v,y=a("9e1e")?u(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;y.length>w;w++)r(g,v=y[w])&&!r(f,v)&&p(f,v,c(g,v));f.prototype=b,b.constructor=f,a("2aba")(n,m,f)}},e350:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));a("6762"),a("2fdb");var n=a("4360");function r(e){if(e&&e instanceof Array&&e.length>0){var t=n["a"].getters&&n["a"].getters.perms,a=e;if(t.includes("admin"))return!0;var r=t.some((function(e){return a.includes(e)}));return!!r}return console.error("need perms! Like v-permission=\"['admin','editor']\""),!1}},fdef:function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}}]);