filesbox/web/dist/p__User__FilesPreview.71d2b...
2024-07-26 14:10:54 +08:00

2 lines
6.1 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[68681],{70575:function(p){p.exports={dcmmodalbox:"dcmmodalbox___1brEn"}},82425:function(p,g,s){"use strict";s.r(g),s.d(g,{default:function(){return k}});var T=s(11849),H=s(34895),U=s(28216),u=s(67294),G=s(73935),A=s(68628),d=s(86618),J=s.n(d),x=s(40352),Q=s.n(x),r=s(75720),X=s.n(r),w=s(50840),j=s.n(w),I=s(82424),Y=s.n(I),D=s(34705),q=s.n(D),B=s(90505),K=s(96132),ee=s.n(K),y=s(70575),S=s.n(y),M=s(37406),o=s(85893),P,O;r.external.cornerstone=d,r.external.cornerstoneMath=x,I.external.dicomParser=D,I.external.cornerstone=d,r.external.Hammer=j();var te="https://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/Renal_Cell_Carcinoma.jpg",$={width:"100%",height:"100%",position:"relative",color:"white"},b={bottom:"5px",left:"5px",position:"absolute",color:"white"},N={bottom:"5px",right:"5px",position:"absolute",color:"white"};class z extends u.Component{constructor(e){super(e);this.state={stack:e.stack,viewport:d.getDefaultViewport(null,void 0),imageId:e.stack.imageIds[e.stack.currentImageIdIndex||0],currentImageIdIndex:e.stack.currentImageIdIndex||0,infoList:[],infoListvisible:!1},this.onImageRendered=this.onImageRendered.bind(this),this.onNewImage=this.onNewImage.bind(this),this.onWindowResize=this.onWindowResize.bind(this),window.onWindowResizex=this.onWindowResize}render(){var e=this.state,t=e.currentImageIdIndex,a=e.infoList,i=a===void 0?[]:a;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"viewportElement",style:$,ref:n=>{this.element=n},children:[(0,o.jsx)("canvas",{className:"cornerstone-canvas"}),(0,o.jsxs)("div",{style:b,children:["Zoom: ",parseInt(this.state.viewport.scale*100)+"%"]}),(0,o.jsxs)("div",{style:N,children:["WW/WC: ",this.state.viewport.voi.windowWidth," / ",this.state.viewport.voi.windowCenter]}),this.state.infoListvisible&&(0,o.jsx)("div",{className:"infoListbox",children:i.map((n,l)=>(0,o.jsxs)("div",{className:"infoli",children:[(0,o.jsxs)("div",{className:"left",children:[n.name,"\uFF1A"]}),(0,o.jsx)("div",{className:"right",children:n.text})]},l))})]}),(0,o.jsx)("div",{onClick:n=>{n.preventDefault(),n.stopPropagation(),this.setState({infoListvisible:!this.state.infoListvisible})},className:this.state.infoListvisible?"infolistbtn infolistbtnactive":"infolistbtn",children:(0,o.jsx)(A.Z,{})})]})}onWindowResize(){!this.element||d.resize(this.element)}onImageRendered(){var e=d.getViewport(this.element);this.setState({viewport:e})}onNewImage(){var e=d.getEnabledElement(this.element);this.setState({imageId:e.image.imageId})}dumpDataSet(e){for(var t=["\u60A3\u8005\u59D3\u540D","\u60A3\u8005\u7F16\u53F7","\u60A3\u8005\u51FA\u751F\u65E5\u671F","\u60A3\u8005\u6027\u522B","\u60A3\u8005\u5E74\u9F84","\u60A3\u8005\u8EAB\u9AD8","\u60A3\u8005\u4F53\u91CD","\u5185\u5BB9\u65E5\u671F","\u5185\u5BB9\u65F6\u95F4"],a=["x00100010","x00100020","x00100030","x00100040","x00101010","x00101020","x00101030","x00080023","x00080033"],i=[],n=0;n<a.length;n++){var l=a[n],f=e.elements[l],c="";if(f!==void 0){var v=e.string(l);v!==void 0&&(c=v)}i.push({name:t[n],text:c})}this.setState({infoList:i})}componentDidMount(){var e=this.element;d.enable(e),d.loadAndCacheImage(this.state.imageId).then(t=>{d.displayImage(e,t),this.dumpDataSet(t.data);var a=this.props.stack;r.addStackStateManager(e,["stack"]),r.addToolState(e,"stack",a),r.mouseInput.enable(e),r.mouseWheelInput.enable(e),r.wwwc.activate(e,1),r.pan.activate(e,2),r.zoom.activate(e,4),r.zoomWheel.activate(e),r.touchInput.enable(e),r.panTouchDrag.activate(e),r.zoomTouchPinch.activate(e),e.addEventListener("cornerstoneimagerendered",this.onImageRendered),e.addEventListener("cornerstonenewimage",this.onNewImage),window.addEventListener("resize",this.onWindowResize)})}componentWillUnmount(){var e=this.element;e.removeEventListener("cornerstoneimagerendered",this.onImageRendered),e.removeEventListener("cornerstonenewimage",this.onNewImage),window.removeEventListener("resize",this.onWindowResize),d.disable(e)}componentDidUpdate(e,t){var a=r.getToolState(this.element,"stack");if(!!a){var i=a.data[0];i.currentImageIdIndex=this.state.stack.currentImageIdIndex,i.imageIds=this.state.stack.imageIds,r.addToolState(this.element,"stack",i)}}}var E=function(e){var t=document.location.href,a=t.indexOf(e+"=");if(a==-1)return!1;var i=t.slice(e.length+a+1),n=i.indexOf("&");return n!=-1&&(i=i.slice(0,n)),i},k=(P=(0,U.$j)(h=>{var e=h.common;return{common:e}}),P(O=class extends u.PureComponent{constructor(){super(...arguments);this.state={modelZindex:100,fullScreen:!1,current:1,total:0,target:{},getInfoLoading:!1,viewUrl:"",taskId:(0,M.fW)(),psddom:"",stack:{},fileInfo:{},sourceID:E("sourceID")},this.getvideoinfo=()=>{var e=this,t=this.props,a=t.dispatch,i=t.common,n=t.f,l=this.state.sourceID;a({type:"common/getFilePreview",payload:{busType:"cloud",sourceID:l},callback:f=>{var c=f.data||{};document.title=c.name;var v=["wadouri: "+location.origin+c.downloadUrl],L={imageIds:v,currentImageIdIndex:0};e.setState({stack:L,fileInfo:c,getInfoLoading:!0})}})}}componentDidMount(){var e=this,t=e.props,a=t.dcmList,i=a===void 0?[]:a,n=t.dcmActive,l=n===void 0?0:n;E("token")&&(0,M.d8)("token",decodeURIComponent(E("token"))),e.getvideoinfo()}componentWillUnmount(){var e=this}render(){var e=this,t=e.props,a=t.dispatch,i=t.common,n=t.open,l=t.setOpenModel,f=t.videoOption,c=t.iframeUrl,v=t.iframeName,L=v===void 0?"":v,se=t.issmall,ne=t.path,ae=t.name,oe=t.fileType,ie=t.isZipModal,re=t.showIndex,W=t.dcmList,de=W===void 0?[]:W,R=t.dcmActive,le=R===void 0?0:R,me=i.sourceID,ce=i.shareCode,m=this.state,ve=m.modelZindex,C=m.fileInfo,_=C===void 0?{}:C,_e=m.fullScreen,Z=m.getInfoLoading,he=m.viewUrl,fe=m.taskId,Ie=m.psddom,F=m.stack,Ee=V=>{e.setState({modelZindex:V})};return(0,o.jsx)("div",{className:S().dcmmodalbox,style:_.fileType&&(_.fileType=="md"||_.fileType=="txt")?{background:"#fff",padding:12}:{},children:Z&&(0,o.jsxs)(o.Fragment,{children:[" ",_.fileType=="txt"?(0,o.jsx)("div",{style:{whiteSpace:"pre-wrap"},dangerouslySetInnerHTML:{__html:_.text}}):_.fileType=="md"?(0,o.jsx)(B.E,{modelValue:_.text,toolbars:[],previewOnly:!0}):(0,o.jsx)(z,{stack:(0,T.Z)({},F)})]})})}})||O)},23848:function(){}}]);