text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-490bfe3a","chunk-2d20ee43","chunk-2d0e53d1"],{"408b":function(e,t,r){"use strict";r("4725")},4725:function(e,t,r){},9444:function(e,t,r){"use strict";r.r(t);var n=r("a34a"),a=r.n(n),i=r("dfd8"),o=r("f121");function c(e,t,r,n,a,i,o){try{var c=e[i](o),s=c.value}catch(u){return void r(u)}c.done?t(s):Promise.resolve(s).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){c(i,n,a,o,s,"next",e)}function s(e){c(i,n,a,o,s,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),e}var p=function(){function e(){u(this,e)}return f(e,[{key:"getNotices",value:function(){var e=s(a.a.mark(function e(){var t,r,n,c=arguments;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:0,r=c.length>1&&void 0!==c[1]?c[1]:o["default"].pageSize,e.next=4,Object(i["get"])("v1/notice",{page:t,count:r,handleError:!0});case 4:return n=e.sent,e.abrupt("return",n);case 6:case"end":return e.stop()}},e)}));function t(){return e.apply(this,arguments)}return t}()},{key:"getNotice",value:function(){var e=s(a.a.mark(function e(t){var r;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["get"])("v1/notice/".concat(t),{handleError:!0});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"addNotice",value:function(){var e=s(a.a.mark(function e(t){var r;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["post"])("v1/notice",t,{handleError:!0});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"editNotice",value:function(){var e=s(a.a.mark(function e(t,r){var n;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["put"])("v1/notice/".concat(t),r,{handleError:!0});case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e)}));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"delNotice",value:function(){var e=s(a.a.mark(function e(t){var r;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["_delete"])("v1/notice",{ids:t});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"updateSingle",value:function(){var e=s(a.a.mark(function e(t){var r;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["patch"])("v1/notice/single",t);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}()}]),e}();t["default"]=new p},b0fe:function(e,t,r){"use strict";r.r(t);var n={text:"文本",video:"直播"};t["default"]=n},e9bf:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"container"},[r("div",{staticClass:"title"},[e._v("新建Notice "),r("span",{staticClass:"back",on:{click:function(t){return e.back(!1)}}},[r("i",{staticClass:"iconfont icon-fanhui"}),e._v(" 返回 ")])]),r("div",{staticClass:"wrap"},[r("el-row",[r("el-col",{attrs:{lg:16,md:20,sm:24,xs:24}},[r("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{model:e.form,"status-icon":"",rules:e.rules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"标题",prop:"title"}},[r("el-input",{attrs:{size:"medium",placeholder:"请填写标题"},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),r("el-form-item",{attrs:{label:"类型",prop:"type"}},[r("el-select",{attrs:{size:"medium",filterable:"",placeholder:"请选择类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.typeArr,function(t,n){return r("el-option",{key:n,attrs:{value:n,label:t}},[r("span",[e._v(e._s(t))])])}),1)],1),r("el-form-item",{attrs:{label:"直播房间id",prop:"room_id"}},[r("el-input",{attrs:{size:"medium",placeholder:"请填写房间id"},model:{value:e.form.room_id,callback:function(t){e.$set(e.form,"room_id",t)},expression:"form.room_id"}})],1),r("el-form-item",{attrs:{label:"直播路径",prop:"path"}},[r("el-input",{attrs:{size:"medium",placeholder:"请填写直播路径"},model:{value:e.form.path,callback:function(t){e.$set(e.form,"path",t)},expression:"form.path"}})],1),r("el-form-item",{attrs:{label:"开始日期",prop:"start_date"}},[r("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间",align:"right","picker-options":e.pickerOptions},model:{value:e.form.start_date,callback:function(t){e.$set(e.form,"start_date",t)},expression:"form.start_date"}})],1),r("el-form-item",{attrs:{label:"是否高亮",prop:"highlight"}},[r("el-switch",{attrs:{"active-color":"#3963bc"},model:{value:e.form.highlight,callback:function(t){e.$set(e.form,"highlight",t)},expression:"form.highlight"}})],1),r("el-form-item",{attrs:{label:"上线",prop:"online"}},[r("el-switch",{attrs:{"active-color":"#3963bc"},model:{value:e.form.online,callback:function(t){e.$set(e.form,"online",t)},expression:"form.online"}})],1),r("el-form-item",{attrs:{label:"排序",prop:"order"}},[r("el-input",{attrs:{size:"medium",placeholder:"请填写排序"},model:{value:e.form.order,callback:function(t){e.$set(e.form,"order",t)},expression:"form.order"}})],1),r("el-form-item",{staticClass:"submit"},[r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("form")}}},[e._v("保 存")]),r("el-button",{on:{click:function(t){return e.resetForm("form")}}},[e._v("重 置")])],1)],1)],1)],1)],1)])},a=[],i=r("a34a"),o=r.n(i),c=r("b0fe"),s=r("9444");function u(e){return u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t,r,n,a,i,o){try{var c=e[i](o),s=c.value}catch(u){return void r(u)}c.done?t(s):Promise.resolve(s).then(n,a)}function f(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){l(i,n,a,o,c,"next",e)}function c(e){l(i,n,a,o,c,"throw",e)}o(void 0)})}}var p={name:"NoticeAdd",props:{editID:Number},data:function(){return{loading:!1,typeArr:c["default"],cateData:{},spuData:[],form:{title:"",description:"",highlight:!1,order:50},rules:{},pickerOptions:{shortcuts:[{text:"今天",onClick:function(e){e.$emit("pick",new Date)}},{text:"昨天",onClick:function(e){var t=new Date;t.setTime(t.getTime()-864e5),e.$emit("pick",t)}},{text:"一周前",onClick:function(e){var t=new Date;t.setTime(t.getTime()-6048e5),e.$emit("pick",t)}}]}}},created:function(){this.getNotice()},methods:{setNumber:function(e){if(e)return Number(e)},getNotice:function(){var e=f(o.a.mark(function e(){return o.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.prev=1,e.next=4,s["default"].getNotice(this.editID);case 4:this.form=e.sent,this.form["highlight"]=!!this.form["highlight"],this.form["online"]=!!this.form["online"],e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](1),this.back(!1);case 12:this.loading=!1;case 13:case"end":return e.stop()}},e,this,[[1,9]])}));function t(){return e.apply(this,arguments)}return t}(),submitForm:function(e){var t=this;this.$refs[e].validate(function(){var r=f(o.a.mark(function r(n){var a,i,c;return o.a.wrap(function(r){while(1)switch(r.prev=r.next){case 0:if(!n){r.next=24;break}return t.loading=!0,r.prev=2,r.next=5,s["default"].editNotice(t.editID,t.form);case 5:a=r.sent,0===a.error_code&&(t.$message.success("".concat(a.msg)),t.resetForm(e),t.back()),r.next=21;break;case 9:if(r.prev=9,r.t0=r["catch"](2),i=r.t0.data.msg,!i||"object"!==u(i)){r.next=21;break}r.t1=o.a.keys(i);case 14:if((r.t2=r.t1()).done){r.next=21;break}return c=r.t2.value,t.$message.error(i[c]),r.next=19,setTimeout(function(){},1e3);case 19:r.next=14;break;case 21:t.loading=!1,r.next=26;break;case 24:return t.$message.error("请填写正确的信息"),r.abrupt("return",!1);case 26:case"end":return r.stop()}},r,null,[[2,9]])}));return function(e){return r.apply(this,arguments)}}())},resetForm:function(e){this.$refs[e].resetFields()},back:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$emit("close",e)}}},m=p,d=(r("408b"),r("2877")),h=Object(d["a"])(m,n,a,!1,null,"25ee6ec9",null);t["default"]=h.exports}}]);