Commit f52d7227 authored by Davve's avatar Davve

完善推送

parent 94a909b8
This diff is collapsed.
.createPost-container[data-v-6bd7f5cb]{position:relative}.createPost-container .createPost-main-container[data-v-6bd7f5cb]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-6bd7f5cb]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-6bd7f5cb]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-6bd7f5cb]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-6bd7f5cb]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-6bd7f5cb]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-6bd7f5cb]{display:inline-block}.createPost-container .word-counter[data-v-6bd7f5cb]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-1c46acac]{position:relative}.createPost-container .createPost-main-container[data-v-1c46acac]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-1c46acac]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-1c46acac]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-1c46acac]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-1c46acac]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-1c46acac]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-1c46acac]{display:inline-block}.createPost-container .word-counter[data-v-1c46acac]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-6bd7f5cb]{position:relative}.createPost-container .createPost-main-container[data-v-6bd7f5cb]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-6bd7f5cb]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-6bd7f5cb]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-6bd7f5cb]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-6bd7f5cb]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-6bd7f5cb]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-6bd7f5cb]{display:inline-block}.createPost-container .word-counter[data-v-6bd7f5cb]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-1c46acac]{position:relative}.createPost-container .createPost-main-container[data-v-1c46acac]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-1c46acac]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-1c46acac]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-1c46acac]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-1c46acac]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-1c46acac]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-1c46acac]{display:inline-block}.createPost-container .word-counter[data-v-1c46acac]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-6b8bfc61]{position:relative}.createPost-container .createPost-main-container[data-v-6b8bfc61]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-6b8bfc61]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-6b8bfc61]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-6b8bfc61]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-6b8bfc61]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-6b8bfc61]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-6b8bfc61]{display:inline-block}.createPost-container .word-counter[data-v-6b8bfc61]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-c7b1eb44]{position:relative}.createPost-container .createPost-main-container[data-v-c7b1eb44]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-c7b1eb44]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-c7b1eb44]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-c7b1eb44]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-c7b1eb44]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-c7b1eb44]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-c7b1eb44]{display:inline-block}.createPost-container .word-counter[data-v-c7b1eb44]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-6b8bfc61]{position:relative}.createPost-container .createPost-main-container[data-v-6b8bfc61]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-6b8bfc61]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-6b8bfc61]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-6b8bfc61]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-6b8bfc61]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-6b8bfc61]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-6b8bfc61]{display:inline-block}.createPost-container .word-counter[data-v-6b8bfc61]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-c7b1eb44]{position:relative}.createPost-container .createPost-main-container[data-v-c7b1eb44]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-c7b1eb44]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-c7b1eb44]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-c7b1eb44]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-c7b1eb44]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-c7b1eb44]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-c7b1eb44]{display:inline-block}.createPost-container .word-counter[data-v-c7b1eb44]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-0bdb1a84]{position:relative}.createPost-container .createPost-main-container[data-v-0bdb1a84]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-0bdb1a84]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-0bdb1a84]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-0bdb1a84]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-0bdb1a84]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-0bdb1a84]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-0bdb1a84]{display:inline-block}.createPost-container .word-counter[data-v-0bdb1a84]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-24d9be33]{position:relative}.createPost-container .createPost-main-container[data-v-24d9be33]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-24d9be33]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-24d9be33]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-24d9be33]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-24d9be33]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-24d9be33]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-24d9be33]{display:inline-block}.createPost-container .word-counter[data-v-24d9be33]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-0bdb1a84]{position:relative}.createPost-container .createPost-main-container[data-v-0bdb1a84]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-0bdb1a84]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-0bdb1a84]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-0bdb1a84]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-0bdb1a84]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-0bdb1a84]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-0bdb1a84]{display:inline-block}.createPost-container .word-counter[data-v-0bdb1a84]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-24d9be33]{position:relative}.createPost-container .createPost-main-container[data-v-24d9be33]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-24d9be33]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-24d9be33]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-24d9be33]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-24d9be33]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-24d9be33]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-24d9be33]{display:inline-block}.createPost-container .word-counter[data-v-24d9be33]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-01e0"],{"6cK7":function(t,e,a){"use strict";var o=a("P2sY"),i=a.n(o),s=a("fL+G"),r=a("Grqa"),n=a("uARZ"),l=a("KHd+"),c=Object(l.a)({},function(){var t=this.$createElement;return(this._self._c||t)("p",{staticClass:"warn-content",staticStyle:{"text-align":"center"}},[this._v("\n 点击生效以后,页面所有内容不可进行编辑,请谨慎操作!!\n")])},[],!1,null,null,null);c.options.__file="Warning.vue";var p=c.exports,u=(a("Yfch"),a("giwc")),m={status:"draft",title:"",content:"",icon:"",push_time:"",url:"",creator_name:"",group_topic_id:""},d=[{key:"alpha://topic_detial?topic_id=",display_name:"推送帖子"},{key:"alpha://group_detial?group_id=",display_name:"推送小组"}].reduce(function(t,e){return t[e.key]=e.display_name,t},{}),f={name:"PushDetail",components:{MDinput:r.a,Upload:s.a,Sticky:n.a,Warning:p},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:i()({},m),loading:!1,userListOptions:[],URLOptions:[{key:"alpha://topic_detial?topic_id=",display_name:"推送帖子"},{key:"alpha://group_detial?group_id=",display_name:"推送小组"}],expireTimeOption:{disabledDate:function(t){return t.getTime()<=Date.now()-864e5}},rules:{title:[{validator:e,trigger:"blur"}],content:[{validator:e,trigger:"blur"}],url:[{validator:e,trigger:"blur"}],icon:[{validator:e,trigger:"blur"}],push_time:[{validator:e,trigger:"blur"}],group_topic_id:[{validator:e,trigger:"blur"}]},tempRoute:{},uploadType:1,is_effect:!1}},computed:{contentShortLength:function(){return this.postForm.content.length}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=i()({},m);this.tempRoute=i()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(u.d)(t).then(function(t){e.postForm=t.data.data.data,e.postForm.url=d[t.data.data.data.url_prefix],e.is_effect=Boolean(t.data.data.data.is_effect)}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.postForm.creator_id=t.$store.getters.id,Object(u.a)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/push/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},effectPush:function(){var t=this;if(this.postForm.push_time<Date.now())return this.$message.error("推送时间已过期, 请重新设置!!"),!1;this.is_effect=Boolean(1);var e=this.$route.params&&this.$route.params.id;Object(u.b)(e).then(function(e){console.log(e.data.data.message),t.$message({message:e.data.data.message,type:"success"}),t.$router.go(0)}).catch(function(t){})}}},h=(a("Uvv5"),Object(l.a)(f,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[t.isEdit&&!t.is_effect?a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.effectPush}},[t._v("生效")]):t._e(),t._v(" "),t.is_effect?t._e():a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[t.isEdit?a("Warning"):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[a("MDinput",{attrs:{maxlength:100,name:"title",required:""},model:{value:t.postForm.title,callback:function(e){t.$set(t.postForm,"title",e)},expression:"postForm.title"}},[t._v("\n 推送标题\n ")])],1),t._v(" "),a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送ID:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.id,callback:function(e){t.$set(t.postForm,"id",e)},expression:"postForm.id"}})],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建时间:",prop:"create_time"}},[t.isEdit?a("el-input",{staticClass:"article-textarea",staticStyle:{width:"199px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}}):t._e()],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建用户:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.creator_name,callback:function(e){t.$set(t.postForm,"creator_name",e)},expression:"postForm.creator_name"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送落地:",prop:"url"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"协议:",clearable:""},model:{value:t.postForm.url,callback:function(e){t.$set(t.postForm,"url",e)},expression:"postForm.url"}},t._l(t.URLOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"80px",label:"推送时间:",prop:"push_time"}},[a("el-date-picker",{staticStyle:{width:"199px"},attrs:{type:"datetime",placeholder:"选择日期时间","picker-options":t.expireTimeOption},model:{value:t.postForm.push_time,callback:function(e){t.$set(t.postForm,"push_time",e)},expression:"postForm.push_time"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"135px",label:"推送(帖子/小组)ID):",prop:"group_topic_id"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text"},model:{value:t.postForm.group_topic_id,callback:function(e){t.$set(t.postForm,"group_topic_id",e)},expression:"postForm.group_topic_id"}})],1)],1)],1)],1)],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送内容:",prop:"content"}},[a("el-input",{staticClass:"article-textarea",attrs:{rows:1,type:"textarea",autosize:"",placeholder:"请输入内容"},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}}),t._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:t.contentShortLength,expression:"contentShortLength"}],staticClass:"word-counter"},[t._v(t._s(t.contentShortLength)+"字")])],1),t._v(" "),a("div",{staticStyle:{"margin-bottom":"20px"}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送头像:",prop:"icon",disabled:t.is_effect}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("Upload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.icon,callback:function(e){t.$set(t.postForm,"icon",e)},expression:"postForm.icon"}})],1)],1)],1)],1)],1)},[],!1,null,"1c46acac",null));h.options.__file="PushDetail.vue";e.a=h.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return i});var o=a("t3Un");function i(){return Object(o.a)({url:"/api/get_token",method:"get"})}},SSmq:function(t,e,a){},Uvv5:function(t,e,a){"use strict";var o=a("SSmq");a.n(o).a},Yfch:function(t,e,a){"use strict"},gB7W:function(t,e,a){"use strict";a.r(e);var o={name:"EditPush",components:{PushDetail:a("6cK7").a}},i=a("KHd+"),s=Object(i.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("push-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);s.options.__file="edit.vue";e.default=s.exports},giwc:function(t,e,a){"use strict";a.d(e,"c",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"d",function(){return r}),a.d(e,"b",function(){return n});var o=a("t3Un");function i(t){return Object(o.a)({url:"/api/push/list",method:"get",params:t})}function s(t){return Object(o.a)({url:"/api/push/create",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/push/detail",method:"get",params:{id:t}})}function n(t){return Object(o.a)({url:"/api/push/effect_push",method:"get",params:{id:t}})}}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-01e9"],{"6cK7":function(t,e,a){"use strict";var o=a("P2sY"),i=a.n(o),s=a("fL+G"),r=a("Grqa"),n=a("uARZ"),l=a("KHd+"),c=Object(l.a)({},function(){var t=this.$createElement;return(this._self._c||t)("p",{staticClass:"warn-content",staticStyle:{"text-align":"center"}},[this._v("\n 点击生效以后,页面所有内容不可进行编辑,请谨慎操作!!\n")])},[],!1,null,null,null);c.options.__file="Warning.vue";var p=c.exports,u=(a("Yfch"),a("giwc")),m={status:"draft",title:"",content:"",icon:"",push_time:"",url:"",creator_name:"",group_topic_id:""},d=[{key:"alpha://topic_detial?topic_id=",display_name:"推送帖子"},{key:"alpha://group_detial?group_id=",display_name:"推送小组"}].reduce(function(t,e){return t[e.key]=e.display_name,t},{}),f={name:"PushDetail",components:{MDinput:r.a,Upload:s.a,Sticky:n.a,Warning:p},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:i()({},m),loading:!1,userListOptions:[],URLOptions:[{key:"alpha://topic_detial?topic_id=",display_name:"推送帖子"},{key:"alpha://group_detial?group_id=",display_name:"推送小组"}],expireTimeOption:{disabledDate:function(t){return t.getTime()<=Date.now()-864e5}},rules:{title:[{validator:e,trigger:"blur"}],content:[{validator:e,trigger:"blur"}],url:[{validator:e,trigger:"blur"}],icon:[{validator:e,trigger:"blur"}],push_time:[{validator:e,trigger:"blur"}],group_topic_id:[{validator:e,trigger:"blur"}]},tempRoute:{},uploadType:1,is_effect:!1}},computed:{contentShortLength:function(){return this.postForm.content.length}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=i()({},m);this.tempRoute=i()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(u.d)(t).then(function(t){e.postForm=t.data.data.data,e.postForm.url=d[t.data.data.data.url_prefix],e.is_effect=Boolean(t.data.data.data.is_effect)}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.postForm.creator_id=t.$store.getters.id,Object(u.a)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/push/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},effectPush:function(){var t=this;if(this.postForm.push_time<Date.now())return this.$message.error("推送时间已过期, 请重新设置!!"),!1;this.is_effect=Boolean(1);var e=this.$route.params&&this.$route.params.id;Object(u.b)(e).then(function(e){console.log(e.data.data.message),t.$message({message:e.data.data.message,type:"success"}),t.$router.go(0)}).catch(function(t){})}}},h=(a("Uvv5"),Object(l.a)(f,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[t.isEdit&&!t.is_effect?a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.effectPush}},[t._v("生效")]):t._e(),t._v(" "),t.is_effect?t._e():a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[t.isEdit?a("Warning"):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[a("MDinput",{attrs:{maxlength:100,name:"title",required:""},model:{value:t.postForm.title,callback:function(e){t.$set(t.postForm,"title",e)},expression:"postForm.title"}},[t._v("\n 推送标题\n ")])],1),t._v(" "),a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送ID:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.id,callback:function(e){t.$set(t.postForm,"id",e)},expression:"postForm.id"}})],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建时间:",prop:"create_time"}},[t.isEdit?a("el-input",{staticClass:"article-textarea",staticStyle:{width:"199px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}}):t._e()],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建用户:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.creator_name,callback:function(e){t.$set(t.postForm,"creator_name",e)},expression:"postForm.creator_name"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送落地:",prop:"url"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"协议:",clearable:""},model:{value:t.postForm.url,callback:function(e){t.$set(t.postForm,"url",e)},expression:"postForm.url"}},t._l(t.URLOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"80px",label:"推送时间:",prop:"push_time"}},[a("el-date-picker",{staticStyle:{width:"199px"},attrs:{type:"datetime",placeholder:"选择日期时间","picker-options":t.expireTimeOption},model:{value:t.postForm.push_time,callback:function(e){t.$set(t.postForm,"push_time",e)},expression:"postForm.push_time"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"135px",label:"推送(帖子/小组)ID):",prop:"group_topic_id"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text"},model:{value:t.postForm.group_topic_id,callback:function(e){t.$set(t.postForm,"group_topic_id",e)},expression:"postForm.group_topic_id"}})],1)],1)],1)],1)],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送内容:",prop:"content"}},[a("el-input",{staticClass:"article-textarea",attrs:{rows:1,type:"textarea",autosize:"",placeholder:"请输入内容"},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}}),t._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:t.contentShortLength,expression:"contentShortLength"}],staticClass:"word-counter"},[t._v(t._s(t.contentShortLength)+"字")])],1),t._v(" "),a("div",{staticStyle:{"margin-bottom":"20px"}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送头像:",prop:"icon",disabled:t.is_effect}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("Upload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.icon,callback:function(e){t.$set(t.postForm,"icon",e)},expression:"postForm.icon"}})],1)],1)],1)],1)],1)},[],!1,null,"1c46acac",null));h.options.__file="PushDetail.vue";e.a=h.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return i});var o=a("t3Un");function i(){return Object(o.a)({url:"/api/get_token",method:"get"})}},SSmq:function(t,e,a){},Uvv5:function(t,e,a){"use strict";var o=a("SSmq");a.n(o).a},Yfch:function(t,e,a){"use strict"},giwc:function(t,e,a){"use strict";a.d(e,"c",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"d",function(){return r}),a.d(e,"b",function(){return n});var o=a("t3Un");function i(t){return Object(o.a)({url:"/api/push/list",method:"get",params:t})}function s(t){return Object(o.a)({url:"/api/push/create",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/push/detail",method:"get",params:{id:t}})}function n(t){return Object(o.a)({url:"/api/push/effect_push",method:"get",params:{id:t}})}},zhOR:function(t,e,a){"use strict";a.r(e);var o={name:"CreatePush",components:{PushDetail:a("6cK7").a}},i=a("KHd+"),s=Object(i.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("push-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);s.options.__file="create.vue";e.default=s.exports}}]);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-bf15"],{"6cK7":function(t,e,a){"use strict";var s=a("P2sY"),o=a.n(s),i=a("fL+G"),r=a("Grqa"),n=a("uARZ"),l=a("KHd+"),c=Object(l.a)({},function(){var t=this.$createElement;return(this._self._c||t)("p",{staticClass:"warn-content",staticStyle:{"text-align":"center"}},[this._v("\n 点击生效以后,页面所有内容不可进行编辑,请谨慎操作!!\n")])},[],!1,null,null,null);c.options.__file="Warning.vue";var p=c.exports,u=(a("Yfch"),a("giwc")),m={status:"draft",title:"",content:"",icon:"",push_time:"",url:"",creator_name:""},d={name:"PushDetail",components:{MDinput:r.a,Upload:i.a,Sticky:n.a,Warning:p},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,s){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),s(new Error(e.field+"为必传项"))):s()};return{postForm:o()({},m),loading:!1,userListOptions:[],URLOptions:[{key:"1",display_name:"推送帖子"},{key:"2",display_name:"推送小组"}],expireTimeOption:{disabledDate:function(t){return t.getTime()<=Date.now()-864e5}},rules:{title:[{validator:e,trigger:"blur"}],content:[{validator:e,trigger:"blur"}],url:[{validator:e,trigger:"blur"}],icon:[{validator:e,trigger:"blur"}],push_time:[{validator:e,trigger:"blur"}]},tempRoute:{},uploadType:1,is_effect:!1}},computed:{contentShortLength:function(){return this.postForm.content.length}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=o()({},m);this.tempRoute=o()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(u.d)(t).then(function(t){e.postForm=t.data.data.data,e.is_effect=Boolean(t.data.data.data.is_effect)}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.postForm.creator_id=t.$store.getters.id,Object(u.a)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/push/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},effectPush:function(){var t=this;if(this.postForm.push_time<Date.now())return this.$message.error("推送时间已过期, 请重新设置!!"),!1;this.is_effect=Boolean(1);var e=this.$route.params&&this.$route.params.id;Object(u.b)(e).then(function(e){console.log(e.data.data.message),t.$message({message:e.data.data.message,type:"success"}),t.$router.go(0)}).catch(function(t){})}}},f=(a("A8B4"),Object(l.a)(d,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[t.isEdit&&!t.is_effect?a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.effectPush}},[t._v("生效")]):t._e(),t._v(" "),t.is_effect?t._e():a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[t.isEdit?a("Warning"):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[a("MDinput",{attrs:{maxlength:100,name:"title",required:""},model:{value:t.postForm.title,callback:function(e){t.$set(t.postForm,"title",e)},expression:"postForm.title"}},[t._v("\n 推送标题\n ")])],1),t._v(" "),a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送ID:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.id,callback:function(e){t.$set(t.postForm,"id",e)},expression:"postForm.id"}})],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建时间:",prop:"create_time"}},[t.isEdit?a("el-input",{staticClass:"article-textarea",staticStyle:{width:"199px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}}):t._e()],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建用户:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.creator_name,callback:function(e){t.$set(t.postForm,"creator_name",e)},expression:"postForm.creator_name"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送落地:",prop:"url"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"协议:",clearable:""},model:{value:t.postForm.url,callback:function(e){t.$set(t.postForm,"url",e)},expression:"postForm.url"}},t._l(t.URLOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"80px",label:"推送时间:",prop:"push_time"}},[a("el-date-picker",{staticStyle:{width:"199px"},attrs:{type:"datetime",format:"yyyy-MM-dd HH:mm:ss",placeholder:"选择日期时间","picker-options":t.expireTimeOption},model:{value:t.postForm.push_time,callback:function(e){t.$set(t.postForm,"push_time",e)},expression:"postForm.push_time"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}})],1)],1)],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送内容:",prop:"content"}},[a("el-input",{staticClass:"article-textarea",attrs:{rows:1,type:"textarea",autosize:"",placeholder:"请输入内容"},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}}),t._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:t.contentShortLength,expression:"contentShortLength"}],staticClass:"word-counter"},[t._v(t._s(t.contentShortLength)+"字")])],1),t._v(" "),a("div",{staticStyle:{"margin-bottom":"20px"}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送头像:",prop:"icon",disabled:t.is_effect}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("Upload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.icon,callback:function(e){t.$set(t.postForm,"icon",e)},expression:"postForm.icon"}})],1)],1)],1)],1)],1)},[],!1,null,"6bd7f5cb",null));f.options.__file="PushDetail.vue";e.a=f.exports},A8B4:function(t,e,a){"use strict";var s=a("KpQy");a.n(s).a},KpQy:function(t,e,a){},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return o});var s=a("t3Un");function o(){return Object(s.a)({url:"/api/get_token",method:"get"})}},Yfch:function(t,e,a){"use strict"},giwc:function(t,e,a){"use strict";a.d(e,"c",function(){return o}),a.d(e,"a",function(){return i}),a.d(e,"d",function(){return r}),a.d(e,"b",function(){return n});var s=a("t3Un");function o(t){return Object(s.a)({url:"/api/push/list",method:"get",params:t})}function i(t){return Object(s.a)({url:"/api/push/create",method:"post",data:t})}function r(t){return Object(s.a)({url:"/api/push/detail",method:"get",params:{id:t}})}function n(t){return Object(s.a)({url:"/api/push/effect_push",method:"get",params:{id:t}})}},zhOR:function(t,e,a){"use strict";a.r(e);var s={name:"CreatePush",components:{PushDetail:a("6cK7").a}},o=a("KHd+"),i=Object(o.a)(s,function(){var t=this.$createElement;return(this._self._c||t)("push-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);i.options.__file="create.vue";e.default=i.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-bf27"],{"6cK7":function(t,e,a){"use strict";var s=a("P2sY"),o=a.n(s),i=a("fL+G"),r=a("Grqa"),n=a("uARZ"),l=a("KHd+"),c=Object(l.a)({},function(){var t=this.$createElement;return(this._self._c||t)("p",{staticClass:"warn-content",staticStyle:{"text-align":"center"}},[this._v("\n 点击生效以后,页面所有内容不可进行编辑,请谨慎操作!!\n")])},[],!1,null,null,null);c.options.__file="Warning.vue";var p=c.exports,u=(a("Yfch"),a("giwc")),m={status:"draft",title:"",content:"",icon:"",push_time:"",url:"",creator_name:""},d={name:"PushDetail",components:{MDinput:r.a,Upload:i.a,Sticky:n.a,Warning:p},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,s){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),s(new Error(e.field+"为必传项"))):s()};return{postForm:o()({},m),loading:!1,userListOptions:[],URLOptions:[{key:"1",display_name:"推送帖子"},{key:"2",display_name:"推送小组"}],expireTimeOption:{disabledDate:function(t){return t.getTime()<=Date.now()-864e5}},rules:{title:[{validator:e,trigger:"blur"}],content:[{validator:e,trigger:"blur"}],url:[{validator:e,trigger:"blur"}],icon:[{validator:e,trigger:"blur"}],push_time:[{validator:e,trigger:"blur"}]},tempRoute:{},uploadType:1,is_effect:!1}},computed:{contentShortLength:function(){return this.postForm.content.length}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=o()({},m);this.tempRoute=o()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(u.d)(t).then(function(t){e.postForm=t.data.data.data,e.is_effect=Boolean(t.data.data.data.is_effect)}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.postForm.creator_id=t.$store.getters.id,Object(u.a)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/push/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},effectPush:function(){var t=this;if(this.postForm.push_time<Date.now())return this.$message.error("推送时间已过期, 请重新设置!!"),!1;this.is_effect=Boolean(1);var e=this.$route.params&&this.$route.params.id;Object(u.b)(e).then(function(e){console.log(e.data.data.message),t.$message({message:e.data.data.message,type:"success"}),t.$router.go(0)}).catch(function(t){})}}},f=(a("A8B4"),Object(l.a)(d,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[t.isEdit&&!t.is_effect?a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.effectPush}},[t._v("生效")]):t._e(),t._v(" "),t.is_effect?t._e():a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[t.isEdit?a("Warning"):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[a("MDinput",{attrs:{maxlength:100,name:"title",required:""},model:{value:t.postForm.title,callback:function(e){t.$set(t.postForm,"title",e)},expression:"postForm.title"}},[t._v("\n 推送标题\n ")])],1),t._v(" "),a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送ID:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.id,callback:function(e){t.$set(t.postForm,"id",e)},expression:"postForm.id"}})],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建时间:",prop:"create_time"}},[t.isEdit?a("el-input",{staticClass:"article-textarea",staticStyle:{width:"199px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}}):t._e()],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:8}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"创建用户:"}},[a("el-input",{staticClass:"article-textarea",staticStyle:{width:"180px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.creator_name,callback:function(e){t.$set(t.postForm,"creator_name",e)},expression:"postForm.creator_name"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送落地:",prop:"url"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"协议:",clearable:""},model:{value:t.postForm.url,callback:function(e){t.$set(t.postForm,"url",e)},expression:"postForm.url"}},t._l(t.URLOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"80px",label:"推送时间:",prop:"push_time"}},[a("el-date-picker",{staticStyle:{width:"199px"},attrs:{type:"datetime",format:"yyyy-MM-dd HH:mm:ss",placeholder:"选择日期时间","picker-options":t.expireTimeOption},model:{value:t.postForm.push_time,callback:function(e){t.$set(t.postForm,"push_time",e)},expression:"postForm.push_time"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}})],1)],1)],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送内容:",prop:"content"}},[a("el-input",{staticClass:"article-textarea",attrs:{rows:1,type:"textarea",autosize:"",placeholder:"请输入内容"},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}}),t._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:t.contentShortLength,expression:"contentShortLength"}],staticClass:"word-counter"},[t._v(t._s(t.contentShortLength)+"字")])],1),t._v(" "),a("div",{staticStyle:{"margin-bottom":"20px"}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"推送头像:",prop:"icon",disabled:t.is_effect}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("Upload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.icon,callback:function(e){t.$set(t.postForm,"icon",e)},expression:"postForm.icon"}})],1)],1)],1)],1)],1)},[],!1,null,"6bd7f5cb",null));f.options.__file="PushDetail.vue";e.a=f.exports},A8B4:function(t,e,a){"use strict";var s=a("KpQy");a.n(s).a},KpQy:function(t,e,a){},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return o});var s=a("t3Un");function o(){return Object(s.a)({url:"/api/get_token",method:"get"})}},Yfch:function(t,e,a){"use strict"},gB7W:function(t,e,a){"use strict";a.r(e);var s={name:"EditPush",components:{PushDetail:a("6cK7").a}},o=a("KHd+"),i=Object(o.a)(s,function(){var t=this.$createElement;return(this._self._c||t)("push-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},giwc:function(t,e,a){"use strict";a.d(e,"c",function(){return o}),a.d(e,"a",function(){return i}),a.d(e,"d",function(){return r}),a.d(e,"b",function(){return n});var s=a("t3Un");function o(t){return Object(s.a)({url:"/api/push/list",method:"get",params:t})}function i(t){return Object(s.a)({url:"/api/push/create",method:"post",data:t})}function r(t){return Object(s.a)({url:"/api/push/detail",method:"get",params:{id:t}})}function n(t){return Object(s.a)({url:"/api/push/effect_push",method:"get",params:{id:t}})}}}]);
\ No newline at end of file
......@@ -156,7 +156,7 @@
</el-table>
<pagination v-show="total>0" :total="total" :page="listQuery.page" :limit="listQuery.limit"
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
style="margin-left: 250px;" @pagination="getList"/>
</div>
</el-card>
......
......@@ -55,7 +55,6 @@
<el-date-picker
v-model="postForm.push_time"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
style="width: 199px"
:picker-options="expireTimeOption"
......@@ -63,6 +62,10 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="135px" label="推送(帖子/小组)ID):" prop="group_topic_id">
<el-input :rows="1" v-model="postForm.group_topic_id" type="text" class="article-textarea"
style="width: 180px" />
</el-form-item>
</el-col>
</el-row>
</div>
......@@ -102,8 +105,20 @@ const defaultForm = {
push_time: '',
url: '',
creator_name: '',
group_topic_id: '',
}
const URLOptions = [
{'key': 'alpha://topic_detial?topic_id=', 'display_name': '推送帖子'},
{'key': 'alpha://group_detial?group_id=', 'display_name': '推送小组'},
]
const urlTypeKeyValue = URLOptions.reduce((acc, cur) => {
acc[cur.key] = cur.display_name
return acc
}, {})
export default {
name: 'PushDetail',
components: { MDinput, Upload, Sticky, Warning},
......@@ -130,8 +145,8 @@ export default {
loading: false,
userListOptions: [],
URLOptions: [
{'key': '1', 'display_name': '推送帖子'},
{'key': '2', 'display_name': '推送小组'},
{'key': 'alpha://topic_detial?topic_id=', 'display_name': '推送帖子'},
{'key': 'alpha://group_detial?group_id=', 'display_name': '推送小组'},
],
expireTimeOption: {
disabledDate(date){
......@@ -144,6 +159,7 @@ export default {
url: [{ validator: validateRequire, trigger: 'blur'}],
icon: [{ validator: validateRequire, trigger: 'blur'}],
push_time: [{ validator: validateRequire, trigger: 'blur'}],
group_topic_id: [{ validator: validateRequire, trigger: 'blur'}],
},
tempRoute: {},
uploadType: 1, // 图片类型
......@@ -169,6 +185,7 @@ export default {
fetchData(id) {
fetchPushDetail(id).then(response => {
this.postForm = response.data.data.data
this.postForm.url = urlTypeKeyValue[response.data.data.data.url_prefix]
this.is_effect = Boolean(response.data.data.data.is_effect)
}).catch(err => {
console.log(err)
......
......@@ -78,7 +78,7 @@
<el-option v-for="(item,index) in regionListOptions" :key="item+index" :label="item" :value="item"/>
</el-select>
</el-form-item>
<el-form-item style="margin-bottom: 20px;margin-left: 10px" label-width="75px" label="线:">
<el-form-item style="margin-bottom: 20px;margin-left: 10px" label-width="75px" label="是否在线:">
<el-radio-group v-model="postForm.is_online">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
......
......@@ -102,7 +102,7 @@
</div>
</el-col>
</el-row>
<el-form-item style="margin-bottom: 20px" label-width="75px" label="线:">
<el-form-item style="margin-bottom: 20px" label-width="75px" label="是否在线:">
<el-radio-group v-model="postForm.is_online">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
......@@ -283,20 +283,6 @@
import {postVideo} from '@/api/upload'
import {userSearch, groupSearch, starSearch, tagSearch} from '@/api/remoteSearch'
import {VIDEO_PREFIX} from '@/components/Upload/utils/default'
import { isInArray, removeByvale } from "@/utils";
function Assembledata(target, source) {
var region_data = []
for (var i = 0; i < target.length; i++) {
if (isInArray(source, target[i]['name'])) {
region_data.push(target[i]['id'])
removeByvale(source, target[i]['name']);
}
}
region_data.push(...source)
return JSON.stringify(region_data)
}
const VIDEO_MAX_SIZE = 100 * 1024 * 1024
const defaultForm = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment