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 line
7.8 KiB
1 line
7.8 KiB
1 year ago
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0231a1ce"],{ac7b:function(t,e,a){},baee:function(t,e,a){"use strict";a("ac7b")},f164:function(t,e,a){"use strict";a.r(e);var i=a("c7eb"),r=a("1da1"),s=a("5530"),o=(a("d9e2"),a("14d9"),a("2f62")),l=a("b0e7"),n=a("a069"),c=a("1336");l={name:"addArticle",components:{uploadPictures:l.a,WangEditor:n.a},data:function(){var t=this;return{dialog:{},isChoice:"单选",grid:{xl:8,lg:8,md:12,sm:24,xs:24},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},loading:!1,formValidate:{id:0,title:"",author:"",image_input:"",content:"",synopsis:"",url:"",is_hot:0,is_banner:0,cid:"",visit:0},content:"",ruleValidate:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],cid:[{required:!0,validator:function(e,a,i){t.formValidate.cid?i():i(new Error("请选择文章分类"))},trigger:"change",type:"number"}],image_input:[{required:!0,validator:function(e,a,i){t.formValidate.image_input?i():i(new Error("请上传图文封面"))},trigger:"change"}],content:[{required:!0,message:"请输入文章内容",trigger:"change"}]},value:"",modalPic:!1,template:!1,treeData:[],schoolData:[],formValidate2:{type:1},myConfig:{autoHeightEnabled:!1,initialFrameHeight:500,initialFrameWidth:"100%",UEDITOR_HOME_URL:"/UEditor/",serverUrl:""}}},computed:Object(s.a)(Object(s.a)({},Object(o.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"100px"},labelPosition:function(){return this.isMobile?"top":"right"}}),watch:{$route:function(t,e){this.$route.params.id?this.getDetails():this.formValidate={id:0,title:"",author:"",image_input:"",content:"",synopsis:"",url:"",is_hot:0,is_banner:0}}},methods:{getEditorContent:function(t){this.content=t},modalPicTap:function(){this.modalPic=!0},getPic:function(t){this.formValidate.image_input=t.att_dir,this.modalPic=!1},getClass:function(){var t=this;Object(c.d)().then(function(){var e=Object(r.a)(Object(i.a)().mark((function e(a){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.treeData=a.data;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.msg)}))},onsubmit:function(t){var e=this;this.formValidate.content=this.content,this.$refs[t].validate((function(t){if(!t)return!1;Object(c.e)(e.formValidate).then(function(){var t=Object(r.a)(Object(i.a)().mark((function t(a){return Object(i.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$message.success(a.msg),setTimeout((function(){e.$router.push({path:e.$routeProStr+"/cms/article/index"})}),500);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.msg)}))}))},getDetails:function(){var t=this;Object(c.g)(this.$route.params.id||0).then(function(){var e=Object(r.a)(Object(i.a)().mark((function e(a){var r;return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.data,r=r.info,t.formValidate={id:r.id,title:r.title,author:r.author,image_input:r.image_input,content:r.content,synopsis:r.synopsis,url:r.url,is_hot:r.is_hot,is_banner:r.is_banner,cid:r.cid,visit:r.visit,school_id:r.school_id};case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$message.error(e.msg)}))}},mounted:function(){var t=this;this.$route.params.id&&this.getDetails(),Object(c.h)(this.$route.params.id||0).then(function(){var e=Object(r.a)(Object(i.a)().mark((function e(a){return Object(i.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.schoolData=a.data;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.msg)}))},created:function(){this.getClass()}},a("baee"),n=a("2877"),s=Object(n.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"article-manager"},[e("pages-header",{ref:"pageHeader",attrs:{title:t.$route.params.id?"编辑文章":"添加文章",backUrl:t.$routeProStr+"/cms/article/index"}}),e
|