publish.js 7.7 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/publish/publish"],{"08e1":function(e,n,t){"use strict";var i=t("fe40"),a=t.n(i);a.a},"377e":function(e,n,t){"use strict";(function(e){t("630e");i(t("66fd"));var n=i(t("574e"));function i(e){return e&&e.__esModule?e:{default:e}}e(n.default)}).call(this,t("f266")["createPage"])},"4ffb":function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"c",(function(){return o})),t.d(n,"a",(function(){return i}));var i={faNavbar:function(){return t.e("components/fa-navbar/fa-navbar").then(t.bind(null,"6858"))},uForm:function(){return t.e("uview-ui/components/u-form/u-form").then(t.bind(null,"3e66"))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,"8413"))},faSelects:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-selects/fa-selects")]).then(t.bind(null,"18f1"))},uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-input/u-input")]).then(t.bind(null,"b3e3"))},faUploadImage:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-upload-image/fa-upload-image")]).then(t.bind(null,"5f32"))},faTags:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-tags/fa-tags")]).then(t.bind(null,"a2de"))},faArray:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-array/fa-array")]).then(t.bind(null,"6a11"))},faArrayDownload:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-array-download/fa-array-download")]).then(t.bind(null,"a8b7"))},faCheckRadio:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-check-radio/fa-check-radio")]).then(t.bind(null,"360e"))},faSwitch:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-switch/fa-switch")]).then(t.bind(null,"6ba7"))},faSelectpages:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-selectpages/fa-selectpages")]).then(t.bind(null,"3e5f"))},uButton:function(){return t.e("uview-ui/components/u-button/u-button").then(t.bind(null,"6829"))},uPicker:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-picker/u-picker")]).then(t.bind(null,"2566"))},uCalendar:function(){return t.e("uview-ui/components/u-calendar/u-calendar").then(t.bind(null,"a7fc"))},faCitys:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-citys/fa-citys")]).then(t.bind(null,"cc0f"))},faTabbar:function(){return Promise.all([t.e("common/vendor"),t.e("components/fa-tabbar/fa-tabbar")]).then(t.bind(null,"ecd8"))}},a=function(){var e=this,n=e.$createElement,t=(e._self._c,e.showForm?e.contributefields.indexOf("channel_ids"):null),i=e.showForm?e.contributefields.indexOf("image"):null,a=e.showForm?e.contributefields.indexOf("images"):null,o=e.showForm?e.contributefields.indexOf("tags"):null,r=e.showForm?e.contributefields.indexOf("keywords"):null,s=e.showForm?e.contributefields.indexOf("description"):null,u=e.showForm?{backgroundColor:e.theme.bgColor,color:e.theme.color}:null;e._isMounted||(e.e0=function(n,t){var i=arguments[arguments.length-1].currentTarget.dataset,a=i.eventParams||i["event-params"];t=a.item;e.calendarShow=!0,e.time_field=t.name},e.e1=function(n,t){var i=arguments[arguments.length-1].currentTarget.dataset,a=i.eventParams||i["event-params"];t=a.item;e.cityShow=!0,e.city_field=t.name}),e.$mp.data=Object.assign({},{$root:{g0:t,g1:i,g2:a,g3:o,g4:r,g5:s,a0:u}})},o=[]},"574e":function(e,n,t){"use strict";t.r(n);var i=t("4ffb"),a=t("6115");for(var o in a)"default"!==o&&function(e){t.d(n,e,(function(){return a[e]}))}(o);t("08e1");var r,s=t("f0c5"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);n["default"]=u.exports},6115:function(e,n,t){"use strict";t.r(n);var i=t("87a5"),a=t.n(i);for(var o in i)"default"!==o&&function(e){t.d(n,e,(function(){return i[e]}))}(o);n["default"]=a.a},"87a5":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("a34a")),a=t("59de");function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n,t,i,a,o,r){try{var s=e[o](r),u=s.value}catch(c){return void t(c)}s.done?n(u):Promise.resolve(u).then(i,a)}function s(e){return function(){var n=this,t=arguments;return new Promise((function(i,a){var o=e.apply(n,t);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}var u={mixins:[a.formRule,a.tools],onLoad:function(e){var n=this.$Route.query||e||{};this.archives_id=n.archives_id||0,this.getChannelFields()},data:function(){return{labelPosition:"top",border:!1,errorType:["message"],showForm:!1,contributefields:[],fields:[],form:{},rules:{},secondList:[],calendarShow:!1,showPicker:!1,mode:"",time_field:"",params:{},cityShow:!1,city_field:"",archives_id:"",field_values:{},archives:{},imageList:{}}},methods:{getChannelFields:function(){var e=this;this.$api.getChannelFields({channel_id:this.vuex_channel_id,archives_id:this.archives_id}).then((function(n){if(n.code){e.secondList=n.data.secondList,e.field_values=n.data.values,e.archives=n.data.archives;var t=n.data.contributefields,i=n.data.fields,a={channel_ids:"",title:"",channel_id:e.vuex_channel_id,id:e.archives_id};for(var o in t)a[t[o]]="";var r={},s={title:[{required:!0,message:"请输入标题",trigger:["change","blur"]}]},u=[];i.map((function(n){r[n.name]=n.defaultvalue||"","number"==n.type&&u.push(n.name),s[n.name]=e.getRules(n)})),e.form=Object.assign(a,r),e.rules=s,e.contributefields=t,e.fields=i,e.setFormData(n.data.archives,n.data.values,u),e.showForm=!0,e.$nextTick((function(){e.$refs.uForm.setRules(e.rules)}))}}))},setFormData:function(e,n,t){var i=this;for(var a in this.form)n&&n[a]&&(-1!=t.indexOf(a)?this.form[a]=n[a]+"":this.form[a]=n[a]),e&&e[a]&&(this.form[a]=e[a]);if(e&&e.image&&(this.imageList.image=[{url:this.cdnurl(e.image)}]),e&&e.images){var o=e.images.split(","),r=[];o.forEach((function(e){r.push({url:i.cdnurl(e)})})),this.imageList.images=r}this.fields.forEach((function(e){if("image"==e.type&&n[e.name]&&(i.imageList[e.name]=[{url:i.cdnurl(n[e.name])}]),"images"==e.type&&n[e.name]){var t=n[e.name].split(","),a=[];t.forEach((function(e){a.push({url:i.cdnurl(e)})})),i.imageList[e.name]=a}"file"==e.type&&(i.imageList[e.name]=n[e.name]?[n[e.name]]:[]),"files"==e.type&&(i.imageList[e.name]=n[e.name]?n[e.name].split(","):[])}))},selectPicker:function(e,n){switch(this.mode=e,this.time_field=n,e){case"date":this.params={year:!0,month:!0,day:!0,hour:!1,minute:!1,second:!1};break;case"time":this.params={year:!1,month:!1,day:!1,hour:!0,minute:!0,second:!0};break;case"datetime":this.params={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0};break}this.showPicker=!0},pickerResult:function(e){switch(this.mode){case"date":this.$set(this.form,this.time_field,e.year+"-"+e.month+"-"+e.day);break;case"time":this.$set(this.form,this.time_field,e.hour+":"+e.minute+":"+e.second);break;case"datetime":this.$set(this.form,this.time_field,e.year+"-"+e.month+"-"+e.day+" "+e.hour+":"+e.minute+":"+e.second);break}},calendarResult:function(e){this.$set(this.form,this.time_field,e.startDate+" 00:00:00 - "+e.endDate+" 23:59:59")},cityResult:function(e){this.$set(this.form,this.city_field,e.province.label+"/"+e.city.label+"/"+e.area.label)},submit:function(){var e=s(i.default.mark((function e(){var n=this;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs.uForm.validate((function(e){e&&n.$api.archivesPost(n.form).then((function(e){n.$u.toast(e.msg),e.code&&setTimeout((function(){n.$Router.replace("/pages/publish/myarticle")}),1500)}))}));case 2:case"end":return e.stop()}}),e,this)})));function n(){return e.apply(this,arguments)}return n}()}};n.default=u},fe40:function(e,n,t){}},[["377e","common/runtime","common/vendor"]]]);