12.chunk.js
5.31 KB
webpackJsonp([12],{1255:function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,a=o(157),i=n(a),r=o(302),s=n(r),u=o(303),d=n(u),p=o(41),h=n(p),f=o(468),c=n(f),m=o(8),v=n(m),g=o(1),y=n(g),w=o(4),b=n(w),k=o(2),E=n(k),C=o(3),I=n(C),P=o(9),j=n(P),N=o(0),S=n(N),T=o(11),x=o(12),_=j.default.getLabel,D=(0,x.withRouter)(l=(0,T.observer)(l=function(e){function t(e){(0,y.default)(this,t);var o=(0,E.default)(this,(t.__proto__||(0,v.default)(t)).call(this,e));return o.onItemClick=function(e){o.setState({showImage:!0,index:e})},o.renderTopContent=function(e){var t=e.imgArr,n=[],l=0;if(t.length>0){var a=function(){var e=[],a="",i=0,r=!0,s=!1,u=void 0;try{for(var d,p=(0,c.default)(t);!(r=(d=p.next()).done);r=!0){var h=d.value,f={};f.id=h,f.name="",f.fileExtendName="",f.showDelete=!1,f.url="/weaver/weaver.file.FileDownload?fileid="+h,e.push(f)}}catch(e){s=!0,u=e}finally{try{!r&&p.return&&p.return()}finally{if(s)throw u}}if(1===t.length){a="100%";var m={};m.backgroundImage="url('/weaver/weaver.file.FileDownload?fileid="+t[0]+"')",m.width=a,m.paddingBottom=a,n.push(S.default.createElement("div",{className:"proj-photo-div",key:t[0]+l++},S.default.createElement("div",{className:"proj-photo-image",style:m,onClick:function(){return o.showPhotos(0,e)}})))}else if(2===t.length||4===t.length){i=2;for(var v=t.length/i,g=0;g<v;g++){a="48%";for(var y=[],w=g*i;w<g*v+i;w++)!function(n){var i={};i.backgroundImage="url('/weaver/weaver.file.FileDownload?fileid="+t[n]+"')",i.width=a,i.paddingBottom=a,g>0&&(i.marginTop="3%"),y.push(S.default.createElement("div",{className:"proj-photo-image",key:t[0]+l++,onClick:function(){return o.showPhotos(n,e)},style:i}))}(w);n.push(S.default.createElement("div",{className:"proj-photo-div",key:"both_"+g},y))}}else{i=3;for(var b=parseInt(t.length%i===0?t.length/i:t.length/i+1,10),k=0;k<b;k++){a="30%";for(var E=[],w=k*i;w<k*i+i;w++)!function(n){var i={};i.width=a,i.paddingBottom=a,k>0&&(i.marginTop="4%"),n>=t.length?E.push(S.default.createElement("div",{className:"proj-photo-image",key:t[0]+l++,onClick:function(){return o.showPhotos(n,e)},style:i})):(i.backgroundImage="url('/weaver/weaver.file.FileDownload?fileid="+t[n]+"')",E.push(S.default.createElement("div",{className:"proj-photo-image",key:t[0]+l++,onClick:function(){return o.showPhotos(n,e)},style:i})))}(w);n.push(S.default.createElement("div",{className:"proj-photo-div",key:t[0]+l++},E))}}return{v:S.default.createElement("div",null,n," ")}}();if("object"===("undefined"===typeof a?"undefined":(0,h.default)(a)))return a.v}},o.onImgChange=function(e){var t=o.props.replyStore.imageArr;t.length=0,e.forEach(function(e){t.push("<img src="+e.imgSrc+" />")})},o.showPhotos=function(e,t){o.setState({photoFiles:t,photoVisible:!0,photoIndex:e})},o.hidePhotos=function(){o.setState({photoVisible:!1,photoIndex:0})},o.state={files:[],index:"",showImage:!1,photoVisible:!1,photoIndex:0,photoFiles:[]},o}return(0,I.default)(t,e),(0,b.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,o=t.replyStore,n=t.location,l=t.sortid,a=t.discusstype,i=t.onReload;o.setRoutePath(n.pathname),l&&(o.setSortID(l),o.setDiscussType(a)),o.onReload=i,o.recordHistory(this.props.history),document.getElementsByTagName("body")[0].style.overflow="hidden",setTimeout(function(){for(var t=document.getElementsByClassName("wm-comment-content-msg"),o=[],n=[],l=0;l<t.length;l++){n=t[l].querySelectorAll("img");for(var a=0;a<n.length;a++)n[a].style.display="none",o.push(n[a])}for(var i=0;i<o.length;i++)!function(t){e.state.files.push({url:o[t].src}),o[t].onclick=function(){e.onItemClick(t)}}(i)},300)}},{key:"componentWillUnmount",value:function(){document.getElementsByTagName("body")[0].style.overflow="visible"}},{key:"render",value:function(){var e=this,t=this.props.replyStore,o=t.commentStore,n=t.reply,l=t.submitReply,a=t.source,r=this.state,u=r.files,p=r.index,h=r.showImage,f=[{type:"voice"},{type:"blog-biaoqing"},{type:"blog-tupian"},{type:"tianjia"}];return S.default.createElement("div",{className:"proj-Comment",style:{height:"100%"}},S.default.createElement(d.default,{store:o,renderTopContent:this.renderTopContent,renderRightTop:function(t){return a?null:S.default.createElement("div",{className:"active-content-proj"},S.default.createElement("span",{onClick:function(o){o&&o.stopPropagation?o.stopPropagation():window.event.cancelBubble=!0,"PP"===t.type_n?e.props.history.push("/ProjectDetails/0/"+t.prjtaskid+"/view"):e.props.history.push("/TaskDetails/0/"+t.prjtaskid)}},"PP"===t.type_n?S.default.createElement("span",null," #\u3010",_("101","\u9879\u76ee"),"\u3011"):S.default.createElement("span",null," #\u3010",_("1332","\u4efb\u52a1"),"\u3011"),t.name,"#"))}}),S.default.createElement(s.default,{options:{shareEl:!1,tapToClose:!0},items:this.state.photoFiles,index:this.state.photoIndex,visible:this.state.photoVisible,onClose:this.hidePhotos}),this.props.sortid?S.default.createElement(i.default,{wrappedComponentRef:function(t){return e.replyRef=t},store:n,leftConfig:f,visible:!1,showOutInput:!0,imgUploadUrl:"/api/doc/upload/uploadFile",onImgChange:this.onImgChange,onSubmit:function(t){l(t,e.replyRef)}}):null,S.default.createElement(s.default,{items:u,index:p,visible:h,onClose:function(){return e.setState({showImage:!1})}}))}}]),t}(N.Component))||l)||l;t.default=D}});
//# sourceMappingURL=12.chunk.js.map?v=fafbdd71