1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2508a4b5"],{"5a92":function(t,e,a){},8982:function(t,e,a){"use strict";a.d(e,"a",function(){return h}),a.d(e,"b",function(){return m});var s=a("795b"),i=a.n(s),n=a("bc3a"),r=a.n(n),o=a("4328"),c=a.n(o),l=a("4360"),u=a("5cab"),d=a("a18c"),f=a("3089");function h(t,e){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var a={method:t.method,url:t.url,data:c.a.stringify(t.data)};return e&&(a.data=t.data),t.headers&&(a.headers=t.headers),new i.a(function(e,s){r()(a).then(function(t){if(t&&t.data&&200===t.status){var a=t.data;switch(a.errno){case 501:Object(f["Toast"])(a.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),s(a.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(a.errmsg),s(a.errmsg);break}e(a)}else console.log(t),s(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),s(e,a)})})}function m(t){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var e={method:t.method,url:t.url};return e.data=t.data,t.headers&&(e.headers=t.headers,e.headers["MVVM-Key"]=String((new Date).getTime()),e.headers["xx"]="anything",e.headers["Content-Type"]="application/json;charset=UTF-8"),console.log("request: ",t),new i.a(function(a,s){r.a.defaults.withCredentials=!0,r()(e).then(function(t){if(console.log("response:",t),t&&t.data&&200===t.status){var e=t.data;switch(e.errno){case 501:Object(f["Toast"])(e.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),s(e.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(e.errmsg),s(e.errmsg);break}a(e)}else console.log(t),s(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),s(e,a)})})}},"9b2a":function(t,e,a){"use strict";var s=a("5a92"),i=a.n(s);i.a},cf31:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"repair-box"},[a("div",{staticClass:"repair-content fixed-page-content"},[a("div",{staticClass:"white-box page-1"},[a("div",{staticClass:"custom-white-box-content"},[a("div",{staticClass:"custom-input-box"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.detail.title,expression:"detail.title"}],attrs:{type:"text",maxlength:"50px",placeholder:"请填写标题"},domProps:{value:t.detail.title},on:{input:function(e){e.target.composing||t.$set(t.detail,"title",e.target.value)}}})])])]),a("div",{staticClass:"white-box page-2"},[a("div",{staticClass:"block-cell-item"},[a("div",{staticClass:"tit"},[a("div",{staticClass:"block-cell-item"},[t._m(0),a("div",{staticClass:"tit"},[a("van-uploader",{attrs:{multiple:!0,"max-count":6,"after-read":t.afterRead,"before-delete":t.beforeDelete},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1)])])])]),a("div",{staticClass:"block-cell-item page-3"},[a("div",{staticClass:"custom-textarea-box"},[t._m(1),a("van-field",{attrs:{rows:"8",autosize:"",type:"textarea",placeholder:"请输入","show-word-limit":""},model:{value:t.detail.content,callback:function(e){t.$set(t.detail,"content",e)},expression:"detail.content"}})],1)])]),a("div",{staticClass:"repair-bottom bottom-button"},[a("button",{staticClass:"btn",on:{click:t.submmit}},[t._v("发布")])])])},i=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",{staticClass:"label"},[t._v("\n\t\t\t\t\t\t\t图片上传"),a("span",{staticClass:"tips"},[t._v("(支持图片/视频上传限20M内,最多6张)")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-item-tit"},[a("p",{staticClass:"tit"},[t._v("通知内容")])])}],n=a("795b"),r=a.n(n),o=(a("ac6a"),a("f499")),c=a.n(o),l=a("dbeb"),u=a("bc3a"),d=a.n(u),f=a("3089"),h={data:function(){return{fileList:[],fileUrlList:[],detail:{},form:{id:"",title:"",content:"",status:"published",fileUrl:""}}},mounted:function(){this.form.id=this.$route.params.id,this.selectById()},methods:{submmit:function(){var t=this;this.form.fileUrl=c()(this.fileUrlList),this.form.title=this.detail.title,this.form.content=this.detail.content,Object(l["c"])(this.form).then(function(e){Object(f["Toast"])("发布成功"),t.$router.push({path:"/parkNotice-app"})})},selectById:function(){var t=this;Object(l["d"])({id:t.form.id}).then(function(e){var a=e.data;if(a.fileUrl&&a.fileUrl.length>2){t.fileList=[];var s=[],i=t.$common.castEval(a.fileUrl);i.forEach(function(t){s.push("https://www.idea-co-sf.com/industryParkApi"+t.url.substring(7,t.length))}),s.forEach(function(e){t.fileList.push(JSON.parse('{"url":"'+e+'","isImage": true}'))}),t.fileUrlList=i}t.detail=a})},afterRead:function(t){var e=this;t instanceof Array?t.map(function(t){e.uploadImg(t)}):this.uploadImg(t)},beforeDelete:function(t,e){var a=this;return a.fileUrlList.splice(e.index,1),function(t,s){var i=s.index;a.fileUrlList[e.index].splice(i,1)}},uploadImg:function(t){var e=this,a=new FormData;a.append("file",t.file),console.log(a.get("file"));var s={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new r.a(function(t,i){d.a.post("/industryParkApi/wx/fileController/upload",a,s).then(function(t){var a=t.data.data.substring(1,t.data.data.length);a=a.substring(0,a.length-1),e.fileUrlList.push(e.$common.castEval(a))}).catch(function(t,e){i(t,e)})})}}},m=h,p=(a("9b2a"),a("2877")),b=Object(p["a"])(m,s,i,!1,null,"7d1d23be",null);e["default"]=b.exports},dbeb:function(t,e,a){"use strict";a.d(e,"a",function(){return r}),a.d(e,"d",function(){return o}),a.d(e,"b",function(){return c}),a.d(e,"f",function(){return l}),a.d(e,"e",function(){return u}),a.d(e,"c",function(){return d});var s=a("8982"),i="/industryParkApi",n="/wx/noticePark";function r(t){return Object(s["a"])({url:i+n+"/add",method:"post",data:t})}function o(t){return Object(s["a"])({url:i+n+"/getById",method:"post",data:t})}function c(t){return Object(s["a"])({url:i+n+"/clickCollect",method:"post",data:t})}function l(t){return Object(s["a"])({url:i+n+"/updateReadStatus",method:"post",data:t})}function u(t){return Object(s["a"])({url:i+n+"/list",method:"post",data:t})}function d(t){return Object(s["a"])({url:i+n+"/edit",method:"post",data:t})}}}]);
|