cbma_expert/ce_server/static/js/chunk-5adeb9a7.65008bce.js

1 line
16 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

(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),u<t?i(e):a&&"function"===typeof a&&a()};c()}var u={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[12,24,36,48]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&l(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&l(0,800)}}},c=u,p=(a("baa8"),a("2877")),d=Object(p["a"])(c,n,r,!1,null,"2424f858",null);t["a"]=d.exports},"4baa":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",[a("el-select",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"是否启用",clearable:""},on:{change:e.handleFilter},model:{value:e.listQuery.enabled,callback:function(t){e.$set(e.listQuery,"enabled",t)},expression:"listQuery.enabled"}},e._l(e.enabledOptions,(function(e){return a("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1),e._v(" "),a("el-input",{staticClass:"filter-item",staticStyle:{width:"300px"},attrs:{placeholder:"任务名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.listQuery.search,callback:function(t){e.$set(e.listQuery,"search",t)},expression:"listQuery.search"}}),e._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search",size:"small"},on:{click:e.handleFilter}},[e._v("搜索")]),e._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-refresh-left",size:"small"},on:{click:e.resetFilter}},[e._v("重置")])],1),e._v(" "),a("div",{staticStyle:{"margin-top":"6px"}},[e.checkPermission(["task_create"])?a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.handleCreate}},[e._v("新增")]):e._e()],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"},{name:"el-height-adaptive-table",rawName:"v-el-height-adaptive-table",value:{bottomOffset:50},expression:"{ bottomOffset: 50 }"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:e.dataList.results,"highlight-current-row":"","row-key":"id",height:"100",stripe:"",border:""}},[a("el-table-column",{attrs:{type:"index",width:"50"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name)+" ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"执行代码"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.task)+" ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"定时策略"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.schedule)+" ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"header-center",label:"已执行次数"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.total_run_count))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"header-center",label:"最后执行时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.last_run_at))]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"是否启用"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{disabled:!e.checkPermission(["task_update"])},on:{change:function(a){return e.handleToggle(t)}},model:{value:t.row.enabled,callback:function(a){e.$set(t.row,"enabled",a)},expression:"scope.row.enabled"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary",size:"small",disabled:!e.checkPermission(["task_update"])},on:{click:function(a){return e.handleUpdate(t)}}},[e._v("编辑")]),e._v(" "),a("el-button",{attrs:{type:"danger",size:"small",disabled:!e.checkPermission(["task_delete"])},on:{click:function(a){return e.handleDelete(t)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.dataList.count>0,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;u<c;u++)if(s=l.charCodeAt(u),s<48||s>r)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"}}]);