1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8c82ae9a"],{"06a8":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div")},i=[],r=a("795b"),s=a.n(r),o=(a("7f7f"),a("ac6a"),a("f20c")),c=a("5cab"),l=a("f499"),u=a.n(l),d=a("8982"),f="/industryParkApi",m="/wx/data",h="/wx/public",p="/wx/dictController";function v(t){return Object(d["a"])({url:f+m+"/listBizAll/"+t,method:"post"})}function g(t){return Object(d["a"])({url:f+h+"/listProjectAll",method:"post",data:t})}function b(t){return Object(d["a"])({url:f+p+"/getByCodes",method:"post",data:t})}function x(t){var e={codes:u()(t)};return new s.a(function(t,a){b(e).then(function(e){t(e)}).catch(function(t,e){a(t,e)})})}var _=a("3089"),T={name:"BaseData",data:function(){return{currentPage:1,totalSize:0,pageSize:10,InitialLoading:!0,allLoaded:!1,bottomStatus:"",StaffData:[],StaffMap:{},BizData:[],BizMap:{},UserProject:[],ProjectData:[],ProjectMap:{},dialogImageUrl:"",dialogImageVisible:!1,dc_map:{},dc_data:{},dc_map_no_all:{},dc_data_no_all:{}}},mounted:function(){},methods:{initDict:function(t){var e=this;return t||(t=e.dc_key),x(t).then(function(t){t.data&&e.dc_key.forEach(function(a){var n=e.getDictValue(t.data,a,!0);e.dc_data[a]=n,e.dc_map[a]=e.$common.transDcMap(n);var i=e.getDictValue(t.data,a,!1);e.dc_data_no_all[a]=i,e.dc_map_no_all[a]=e.$common.transDcMap(i)})})},initDict2:function(t){var e=this;return t||(t=e.dc_key),x(t).then(function(t){t.data&&e.dc_key.forEach(function(a){var n=e.getDictValue(t.data,a,!1);e.dc_data[a]=n,e.dc_map[a]=e.$common.transDcMap(n);var i=e.getDictValue(t.data,a,!1);e.dc_data_no_all[a]=i,e.dc_map_no_all[a]=e.$common.transDcMap(i)})})},initBiz:function(){var t=this;return this.BizData=[],v(c["a"].uid()).then(function(e){e.data&&e.data.forEach(function(e){var a={label:e.businessName,value:e.id};t.BizData.push(a),t.BizMap[e.id]=e.businessName})}).catch(function(){})},initProjectData:function(){var t=this;return this.ProjectData=[],g(c["a"].uid()).then(function(e){e.data&&e.data.forEach(function(e){var a={label:e.name,value:e.id};t.ProjectData.push(a),t.ProjectMap[a.value]=e})}).catch(function(){})},pagination:function(t){var e=this.currentPage,a=this.pageSize,n=e*a-a,i=e*a;return t.slice(n,i)},getDictValue:function(t,e,a){var n=t[e]?o["a"].castEval(t[e].dictValue):[],i=[];if(n.forEach(function(t){var e={id:t.id,isSearch:t.isSearch,label:t.label,value:t.value,active:!1};i.push(e)}),a){var r={label:"全部",value:"",active:!0};i.unshift(r)}return i},confirm:function(t,e){return new s.a(function(a,n){_["Dialog"].confirm({title:e,message:t}).then(function(t){a(t)}).catch(function(t){Object(_["Toast"])("已取消"),n(t)})})},handleBottomChange:function(t){console.log("handleBottomChange:"+t),this.bottomStatus=t,"drop"===this.bottomStatus&&this.currentPage++},loadBottom:function(){var t=this,e=this;console.log("loadBottom"),setTimeout(function(){e.getData(),t.$refs.loadmore.onBottomLoaded()},500)},imgPreview:function(t){this.dialogImageUrl="/industryParkApi/wx/img/viewImg/"+t,this.dialogImageVisible=!0},imgRemove:function(t,e){var a=e.indexOf(t);e.splice(a,1)},noImg:function(){var t=event.srcElement;t.src=a("aed7"),t.onerror=null}}},k=T,w=a("2877"),D=Object(w["a"])(k,n,i,!1,null,"3fa5b905",null);e["a"]=D.exports},"0a0d":function(t,e,a){t.exports=a("e829")},"0a90":function(t,e,a){var n=a("63b6"),i=a("10ff");n(n.G+n.F*(parseFloat!=i),{parseFloat:i})},"10ff":function(t,e,a){var n=a("e53d").parseFloat,i=a("a1ce").trim;t.exports=1/n(a("e692")+"-0")!==-1/0?function(t){var e=i(String(t),3),a=n(e);return 0===a&&"-"==e.charAt(0)?-0:a}:n},"2f37":function(t,e,a){var n=a("63b6");n(n.S,"Date",{now:function(){return(new Date).getTime()}})},"45d9":function(t,e,a){"use strict";a.d(e,"d",function(){return s}),a.d(e,"c",function(){return o}),a.d(e,"b",function(){return c}),a.d(e,"e",function(){return l}),a.d(e,"f",function(){return u}),a.d(e,"g",function(){return d}),a.d(e,"a",function(){return f});var n=a("8982"),i="/industryParkApi",r="/wx/parkTrain";function s(t){return Object(n["a"])({url:i+r+"/list",method:"post",data:t})}function o(t,e){return Object(n["a"])({url:i+r+"/getTrainById?id="+t+"&userId="+e,method:"get"})}function c(t){return Object(n["a"])({url:i+r+"/clickCollect",method:"post",data:t})}function l(t){return Object(n["a"])({url:i+r+"/listRegisSignInfo",method:"post",data:t})}function u(t){return Object(n["a"])({url:i+r+"/updatePartakeNumber",method:"post",data:t})}function d(t){return Object(n["a"])({url:i+r+"/updatePublishStatus",method:"post",data:t})}function f(t){return Object(n["a"])({url:i+r+"/add",method:"post",data:t})}},"4da2":function(t,e,a){},"59ad":function(t,e,a){t.exports=a("7be7")},"5d6b":function(t,e,a){var n=a("e53d").parseInt,i=a("a1ce").trim,r=a("e692"),s=/^[-+]?0[xX]/;t.exports=8!==n(r+"08")||22!==n(r+"0x16")?function(t,e){var a=i(String(t),3);return n(a,e>>>0||(s.test(a)?16:10))}:n},"6ef8":function(t,e,a){"use strict";a.r(e);var n=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.form.trainTitle,expression:"form.trainTitle"}],attrs:{type:"text",maxlength:"50px",placeholder:"请填写培训名称"},domProps:{value:t.form.trainTitle},on:{input:function(e){e.target.composing||t.$set(t.form,"trainTitle",e.target.value)}}})])])]),a("div",{staticClass:"white-box page-2"},[a("div",{staticClass:"block-cell-item"},[a("div",{staticClass:"tit"},[a("ul",{staticClass:"custom-select-list"},t._l(t.quickList,function(e){return a("li",{key:e.value,class:[t.quickSleced.value&&e.value===t.quickSleced.value?"active":""],on:{click:function(a){return t.quickSelect(e)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t\t")])}),0),a("div",{staticClass:"block-cell-item"},[t._m(0),a("div",{staticClass:"tit"},[a("van-uploader",{attrs:{"max-count":1,"after-read":t.afterRead,"before-delete":t.beforeDelete},model:{value:t.fileList[0],callback:function(e){t.$set(t.fileList,0,e)},expression:"fileList[0]"}})],1)])])])]),a("div",{staticClass:"white-box page-3"},[a("div",{staticClass:"block-cell-item"},[t._m(1),a("div",{staticClass:"tit"},[t._l(t.videoList,function(e,n){return a("div",{key:n,staticClass:"forPreview_video"},[a("span",[t._v(t._s(e.name))]),a("van-icon",{attrs:{name:"delete"},on:{click:function(e){return e.stopPropagation(),t.delete1(n)}}})],1)}),a("van-uploader",{directives:[{name:"show",rawName:"v-show",value:t.videoList.length<1,expression:"videoList.length < 1"}],attrs:{accept:"video/*","max-count":1,"after-read":t.afterRead2,"before-delete":t.beforeDelete2}})],2)])]),a("div",{staticClass:"white-box page-4"},[t._m(2),a("div",{staticClass:"custom-white-box-content"},[a("div",{staticClass:"custom-input-box"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.form.lecturerName,expression:"form.lecturerName"}],attrs:{type:"text",maxlength:"50px",placeholder:"请填写"},domProps:{value:t.form.lecturerName},on:{input:function(e){e.target.composing||t.$set(t.form,"lecturerName",e.target.value)}}})])]),a("div",{staticClass:"custom-textarea-box"},[t._m(3),a("van-field",{attrs:{autosize:"",type:"textarea",placeholder:"请填写"},model:{value:t.form.lecturerIntroduction,callback:function(e){t.$set(t.form,"lecturerIntroduction",e)},expression:"form.lecturerIntroduction"}})],1),a("div",{staticClass:"block-cell-item"},[t._m(4),a("div",{staticClass:"tit"},[a("van-uploader",{attrs:{"max-count":1,"after-read":t.afterRead1,"before-delete":t.beforeDelete1},model:{value:t.fileList2[0],callback:function(e){t.$set(t.fileList2,0,e)},expression:"fileList2[0]"}})],1)])])]),a("div",{staticClass:"repair-bottom bottom-button"},[a("button",{staticClass:"btn",on:{click:t.submit}},[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\t主题图"),a("span",{staticClass:"tips"},[t._v("(支持图片/视频上传限20M内,最多1张)")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",{staticClass:"label"},[t._v("视频上传"),a("span",{staticClass:"tips"})])},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("讲师姓名")])])},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("讲师简介")])])},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讲师形象照"),a("span",{staticClass:"tips"},[t._v("(支持图片/视频上传限20M内,最多1张)")])])}],r=a("f499"),s=a.n(r),o=a("795b"),c=a.n(o),l=(a("7f7f"),a("ac6a"),a("ad68")),u=a("06a8"),d=a("45d9"),f=a("5cab"),m=a("bc3a"),h=a.n(m),p=a("3089"),v={mixins:[u["a"]],data:function(){return{dc_key:["trainType"],quickSleced:{},isAdd:"1",quickList:[],id:"",fileList:[],fileList2:[],fileAnnex:[],fileAnnex2:[],videoList:[],fileAnnex1:[],form:{id:"",trainTitle:"",trainType:"",lecturerName:"",lecturerIntroduction:""}}},mounted:function(){var t=this;this.initDict(this.dc_key).then(function(e){t.quickList=t.dc_data_no_all.trainType,t.isAdd=t.$route.query.isAdd,t.id=t.$route.query.id,t.getTrainById()})},methods:{getTrainById:function(){var t=this,e=this;"1"===e.isAdd&&Object(d["c"])(this.id,f["a"].currUser().id).then(function(a){a.data&&(e.form=a.data,t.quickList.forEach(function(t){t.value===e.form.trainType&&(e.quickSleced=t)}),e.fileList.push(JSON.parse('[{"url":"'+a.data.annexArray[0]+'","isImage": true}]')),e.fileAnnex=e.$common.castEval(a.data.trainAnnex),e.fileList2.push(JSON.parse('[{"url":"'+a.data.lecturerAnnexArray[0]+'","isImage": true}]')),e.fileAnnex2=e.$common.castEval(a.data.lecturerAnnex),e.fileAnnex1=e.$common.castEval(a.data.videoAnnex),e.videoList=JSON.parse('[{"url":"'+a.data.videoAnnexArray[0]+'","isImage": false,"name":"'+e.fileAnnex1[0].name+'"}]'),console.log(e.videoList))})},afterRead:function(t){this.uploadImg(t,"1")},afterRead1:function(t){this.uploadImg(t,"2")},afterRead2:function(t){this.uploadImg(t,"3")},uploadImg:function(t,e){var a=this,n=new FormData;n.append("file",t.file),console.log(n.get("file"));var i={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new c.a(function(t,r){h.a.post("/industryParkApi/wx/fileController/upload",n,i).then(function(t){if("1"===e){var n=t.data.data.substring(1,t.data.data.length);n=n.substring(0,n.length-1),a.fileAnnex.push(a.$common.castEval(n))}else if("2"===e){var i=t.data.data.substring(1,t.data.data.length);i=i.substring(0,i.length-1),a.fileAnnex2.push(a.$common.castEval(i)),console.log(a.fileAnnex2)}else{var r=t.data.data.substring(1,t.data.data.length);r=r.substring(0,r.length-1),a.fileAnnex1.push(a.$common.castEval(r)),a.videoList=JSON.parse('[{"url":"'+a.fileAnnex1[0].url+'","isImage": false,"name":"'+a.fileAnnex1[0].name+'"}]')}}).catch(function(t,e){r(t,e)})})},beforeDelete:function(t){this.fileAnnex=[];var e=this;return function(a,n){var i=n.index;e.fileAnnex[t].splice(i,1)}},beforeDelete1:function(t){this.fileAnnex2=[];var e=this;return function(a,n){var i=n.index;e.fileAnnex2[t].splice(i,1)}},beforeDelete2:function(t){this.fileAnnex1=[];var e=this;return function(a,n){var i=n.index;e.fileAnnex1[t].splice(i,1)}},delete1:function(t){this.videoList.splice(t,1),this.fileAnnex1.splice(t,1)},submit:function(){var t=this;if(0!==this.fileList.length)if(""!==this.form.trainTitle)if(""!==this.form.trainType)if(""!==this.form.lecturerName)if(0!==this.fileAnnex.length)if(0!==this.fileAnnex1.length)if(0!==this.fileAnnex2.length){var e=0;"1"===this.isAdd&&(e=this.form.partakeNumber);var a=this;Object(d["a"])({id:this.form.id,trainType:this.form.trainType,trainTitle:this.form.trainTitle,lecturerName:this.form.lecturerName,lecturerIntroduction:this.form.lecturerIntroduction,onlineOfflineStatus:"线上",partakeNumber:e,publishStatus:"2",publishDate:Object(l["a"])(new Date,"datetime"),groupId:f["a"].currUser().groupId,trainAnnex:s()(this.fileAnnex),videoAnnex:s()(this.fileAnnex1),lecturerAnnex:s()(this.fileAnnex2)}).then(function(e){Object(p["Toast"])("发布成功"),t.$router.push({path:"/trainingRelease-app",query:{trainType:a.form.trainType}})})}else Object(p["Toast"])("请上传讲师形象照");else Object(p["Toast"])("请上传视频");else Object(p["Toast"])("请上传主题图");else Object(p["Toast"])("请填写讲师姓名");else Object(p["Toast"])("请选择培训类型");else Object(p["Toast"])("请填写培训名称");else Object(p["Toast"])("请上传主题图")},quickSelect:function(t){this.quickSleced.value&&this.quickSleced.value===t.value?(this.quickSleced={},this.form.trainType=""):(this.quickSleced=t,this.form.trainType=t.value)}}},g=v,b=(a("a125"),a("2877")),x=Object(b["a"])(g,n,i,!1,null,"814984f6",null);e["default"]=x.exports},7445:function(t,e,a){var n=a("63b6"),i=a("5d6b");n(n.G+n.F*(parseInt!=i),{parseInt:i})},"7be7":function(t,e,a){a("0a90"),t.exports=a("584a").parseFloat},"7f7f":function(t,e,a){var n=a("86cc").f,i=Function.prototype,r=/^\s*function ([^ (]*)/,s="name";s in i||a("9e1e")&&n(i,s,{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},8982:function(t,e,a){"use strict";a.d(e,"a",function(){return m}),a.d(e,"b",function(){return h});var n=a("795b"),i=a.n(n),r=a("bc3a"),s=a.n(r),o=a("4328"),c=a.n(o),l=a("4360"),u=a("5cab"),d=a("a18c"),f=a("3089");function m(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,n){s()(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),n(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),n(a.errmsg);break}e(a)}else console.log(t),n(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),n(e,a)})})}function h(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,n){s.a.defaults.withCredentials=!0,s()(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),n(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),n(e.errmsg);break}a(e)}else console.log(t),n(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),n(e,a)})})}},a125:function(t,e,a){"use strict";var n=a("4da2"),i=a.n(n);i.a},a1ce:function(t,e,a){var n=a("63b6"),i=a("25eb"),r=a("294c"),s=a("e692"),o="["+s+"]",c="
",l=RegExp("^"+o+o+"*"),u=RegExp(o+o+"*$"),d=function(t,e,a){var i={},o=r(function(){return!!s[t]()||c[t]()!=c}),l=i[t]=o?e(f):s[t];a&&(i[a]=l),n(n.P+n.F*o,"String",i)},f=d.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(u,"")),t};t.exports=d},ad68:function(t,e,a){"use strict";a.d(e,"a",function(){return c});var n=a("e814"),i=a.n(n),r=a("59ad"),s=a.n(r);a("6b54"),a("a481"),a("0a0d");function o(t){return t<10?"0"+t:t}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"slash",a="";console.log(t.constructor),t.constructor===Date?a=t:(a=(s()(t)+946684800).toString(),-1!=a.indexOf("-")||-1!=a.indexOf("/")||-1!=a.indexOf(":")?(a=a.replace(/-/g,"/"),a=new Date(a)):10==a.length?a=new Date(1e3*i()(a)):13==a.length&&(a=new Date(i()(a))));var n=a.getFullYear(),r=a.getMonth()+1,c=a.getDate(),l=a.getHours(),u=a.getMinutes(),d=a.getSeconds(),f=new Date,m=Math.floor(f-a),h=Math.floor(m/60),p=Math.floor(h/60),v=Math.floor(p/24),g=Math.floor(v/30),b=(Math.floor(g/12),(new Date).getFullYear()),x=new Date;x=new Date(x.getFullYear(),x.getMonth(),x.getDate());var _=new Date(a);_=new Date(_.getFullYear(),_.getMonth(),_.getDate());var T=(_-x)/1e3/60/60/24;switch(e){case"horizontal":return n+"-"+o(r)+"-"+o(c)+" "+o(l)+":"+o(u)+":"+o(d);case"day":return n+"-"+o(r)+"-"+o(c);case"minute":var k="";return b===n?T<-1?k=o(r)+"-"+o(c)+" "+o(l)+":"+o(u):T<0?k="昨天 "+o(l)+":"+o(u):0==T&&(k=o(l)+":"+o(u)):k=n+"-"+o(r)+"-"+o(c)+" "+o(l)+":"+o(u),k;case"second":var w="";return b===n?T<-1?w=o(r)+"-"+o(c)+" "+o(l)+":"+o(u)+":"+o(d):T<0?w="昨天 "+o(l)+":"+o(u)+":"+o(d):0==T&&(w=o(l)+":"+o(u)+":"+o(d)):w=n+"-"+o(r)+"-"+o(c)+" "+o(l)+":"+o(u)+":"+o(d),w;case"spot":var D="";return D=n+"."+o(r)+"."+o(c)+" "+o(l)+":"+o(u)+":"+o(d),D;case"date":var A="";return A=n+"."+o(r)+"."+o(c),A;case"time":var y="";return y=o(l)+":"+o(u),y;case"dateTime":var C="";return C=n+"-"+o(r)+"-"+o(c)+" "+o(l)+":"+o(u),C;case"bvcTime":return o(l)+":"+o(u)+":"+o(d)+" "+o(c)+"/"+o(r)+"/"+n;default:return n+"/"+o(r)+"/"+o(c)+" "+o(l)+":"+o(u)+":"+o(d)}}},aed7:function(t,e,a){t.exports=a.p+"assets/img/no-result.b05bdcd3.jpg"},b9e9:function(t,e,a){a("7445"),t.exports=a("584a").parseInt},e692:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},e814:function(t,e,a){t.exports=a("b9e9")},e829:function(t,e,a){a("2f37"),t.exports=a("584a").Date.now}}]);
|