徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
9.5 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-471b1025"],{"5e21":function(t,e,a){"use strict";a("6e10")},"6e10":function(t,e,a){},a20b:function(t,e,a){"use strict";a.r(e);var r=a("2f62"),o=a("8593"),n=a("d708");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=Array(e);a<e;a++)r[a]=t[a];return r}function u(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function c(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?u(Object(a),!0).forEach((function(e){m(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function m(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var r=a.call(t,e||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var f={filters:{formatWeek:function(t){return["周一","周二","周三","周四","周五","周六","周日"][t-1]}},data:function(){return{roterPre:n.a.roterPre,typeList:[{name:"N分钟",value:1},{name:"N小时",value:2},{name:"N天",value:5},{name:"每小时",value:3},{name:"每天",value:4},{name:"每星期",value:6},{name:"每月",value:7},{name:"每年",value:8}],task:{},loading:!1,formValidate:{name:"",mark:"",title:"",is_open:0,type:6,month:1,week:1,day:1,hour:1,minute:30,cycle:""}}},computed:{date:function(){switch(this.formValidate.month){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 2:return 28;default:return 30}}},watch:{date:function(t){t<this.formValidate.day&&(this.formValidate.day=t)},"formValidate.type":function(){this.formValidate.month=1,this.formValidate.week=1,this.formValidate.day=1,this.formValidate.hour=1,this.formValidate.minute=30,this.formValidate.cycle=""}},created:function(){var t=this;this.timerTask(),this.setCopyrightShow({value:!1}),this.$once("hook:beforeDestroy",(function(){t.setCopyrightShow({value:!0})})),this.$route.params.id&&this.timerInfo()},methods:c(c({},Object(r.d)("admin/layout",["setCopyrightShow"])),{},{timerTask:function(){var t=this;Object(o.cb)().then((function(e){t.task=e.data}))},timerInfo:function(){var t=this;Object(o.bb)(this.$route.params.id).then((function(e){var a=e.data,r=a.name,o=a.mark,n=a.type,i=a.cycle,s=a.title,l=a.is_open;t.formValidate.name=r,t.formValidate.mark=o,t.formValidate.title=s,t.formValidate.is_open=l,t.formValidate.type=n;var u=i.split("/");t.$nextTick((function(){switch(n){case 1:case 3:t.formValidate.minute=Number(u[0]);break;case 2:case 4:t.formValidate.hour=Number(u[0]),t.formValidate.minute=Number(u[1]);break;case 5:case 7:t.formValidate.day=Number(u[0]),t.formValidate.hour=Number(u[1]),t.formValidate.minute=Number(u[2]);break;case 6:t.formValidate.week=Number(u[0]),t.formValidate.hour=Number(u[1]),t.formValidate.minute=Number(u[2])}}))}))},handleSubmit:function(){if(!this.formValidate.name)return this.$Message.error({content:"请选择任务名称",onClose:function(){}});var t=c({},this.formValidate),e=[t.minute];switch(t.type){case 2:case 4:e=[t.hour].concat(s(e));break;case 5:case 7:e=[t.day,t.hour].concat(s(e));break;case 6:e=[t.week,t.hour].concat(s(e));break;case 8:e=[t.month,t.day,t.hour].concat(s(e))}t.cycle=e.join("/"),delete t.month,delete t.week,delete t.day,delete t.hour,delete t.minute,this.$route.params.id?this.updateTimer(t):this.saveTimer(t)},taskChange:function(t){var e=t.label,a=t.value;this.formValidate.name=e,this.formValidate.mark=a},saveTimer:function(t){var e=this;Object(o.Q)(t).then((function(t){e.$Message.success({content:t.msg,onClose:function(){e.$router.push({path:e.roterPre+"/system/crontab"})}})})).catch((function(t){e.$Message.error(t.msg)}))},updateTimer:function(t){var e=this;Object(o.db)(this.$route.params.id,t).then((function(t){e.$Message.success({content:t.msg,onClose:function(){e.$router.push({path:e.roterPre+"/system/crontab"})}})})).catch((function(t){e.$Message.error(t.msg)}))}})},d=(a("5e21"),a("2877")),p=Object(d.a)(f,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"i-layout-page-header"},[e("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/system/crontab")}}},[e("div",{staticClass:"font-sm after-line"},[e("span",{staticClass:"iconfont iconfanhui"}),e("span",{staticClass:"pl10"},[t._v("返回")])])]),e("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s(t.$route.params.id?"编辑定时任务":"添加定时任务")}})],1)])],1),e("Card",{staticClass:"ivu-mt form-card",attrs:{bordered:!1,"dis-hover":""}},[e("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":97,"label-colon":""}},[e("FormItem",{attrs:{label:"任务名称",required:""}},[e("Row",{attrs:{gutter:10}},[e("Col",{attrs:{span:"12"}},[e("Select",{attrs:{"label-in-value":""},on:{"on-change":t.taskChange},model:{value:t.formValidate.mark,callback:function(e){t.$set(t.formValidate,"mark",e)},expression:"formValidate.mark"}},t._l(t.task,(function(a,r){return e("Option",{key:r,attrs:{value:r}},[t._v(t._s(a))])})),1)],1)],1)],1),e("FormItem",{attrs:{label:"执行周期",required:""}},[e("Row",{attrs:{gutter:10}},[e("Col",{attrs:{span:"3"}},[e("Select",{model:{value:t.formValidate.type,callback:function(e){t.$set(t.formValidate,"type",e)},expression:"formValidate.type"}},t._l(t.typeList,(function(a){return e("Option",{key:a.value,attrs:{value:a.value}},[t._v(t._s(a.name))])})),1)],1),6==t.formValidate.type?e("Col",{attrs:{span:"3"}},[e("Select",{model:{value:t.formValidate.week,callback:function(e){t.$set(t.formValidate,"week",e)},expression:"formValidate.week"}},t._l(7,(function(a){return e("Option",{key:a,attrs:{value:a}},[t._v(t._s(t._f("formatWeek")(a)))])})),1)],1):t._e(),8==t.formValidate.type?e("Col",{attrs:{span:"3"}},[e("div",{staticClass:"suffix-wrapper"},[e("Select",{model:{value:t.formValidate.month,callback:function(e){t.$set(t.formValidate,"month",e)},expression:"formValidate.month"}},t._l(12,(function(a,r){return e("Option",{key:r,attrs:{value:a}},[t._v(t._s(a))])})),1),e("span",{staticClass:"suffix"},[t._v("月")])],1)]):t._e(),5==t.formValidate.type||7==t.formValidate.type||8==t.formValidate.type?e("Col",{attrs:{span:"3"}},[e("div",{staticClass:"suffix-wrapper"},[e("Select",{model:{value:t.formValidate.day,callback:function(e){t.$set(t.formValidate,"day",e)},expression:"formValidate.day"}},t._l(t.date,(function(a,r){return e("Option",{key:r,attrs:{value:a}},[t._v(t._s(a))])})),1),e("span",{staticClass:"suffix"},[t._v("日")])],1)]):t._e(),1!=t.formValidate.type&&3!=t.formValidate.type?e("Col",{attrs:{span:"3"}},[e("div",{staticClass:"suffix-wrapper"},[e("Select",{model:{value:t.formValidate.hour,callback:function(e){t.$set(t.formValidate,"hour",e)},expression:"formValidate.hour"}},t._l(24,(function(a,r){return e("Option",{key:r,attrs:{value:r}},[t._v(t._s(r))])})),1),e("span",{staticClass:"suffix"},[t._v("时")])],1)]):t._e(),e("Col",{attrs:{span:"3"}},[e("div",{staticClass:"suffix-wrapper"},[e("Select",{model:{value:t.formValidate.minute,callback:function(e){t.$set(t.formValidate,"minute",e)},expression:"formValidate.minute"}},t._l(60,(function(a,r){return e("Option",{key:r,attrs:{value:r}},[t._v(t._s(r))])})),1),e("span",{staticClass:"suffix"},[t._v("分")])],1)])],1)],1),e("FormItem",{attrs:{label:"任务说明"}},[e("Row",{attrs:{gutter:10}},[e("Col",{attrs:{span:"12"}},[e("Input",{attrs:{type:"textarea",autosize:{minRows:5,maxRows:5},placeholder:"请输入任务说明"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1)],1),e("FormItem",{attrs:{label:"是否开启"}},[e("Row",{attrs:{gutter:10}},[e("Col",{attrs:{span:"12"}},[e("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},model:{value:t.formValidate.is_open,callback:function(e){t.$set(t.formValidate,"is_open",e)},expression:"formValidate.is_open"}},[e("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1)],1)],1)],1),e("Card",{staticClass:"btn-card",attrs:{bordered:!1,padding:14,"dis-hover":""}},[e("Button",{attrs:{loading:t.loading,type:"primary"},on:{click:t.handleSubmit}},[t._v("提交")])],1)],1)}),[],!1,null,"39289f7a",null);e.default=p.exports}}]);