cnhis-design-vue 3.2.15-beta.15 → 3.2.15-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,6 @@ export declare class Print {
28
28
  private postMessage;
29
29
  messageCollect(id: string, data: AnyObject): Promise<unknown>;
30
30
  messageCollectAndNotifyFail(id: string, data: AnyObject, messageTimeout: number): Promise<unknown>;
31
- initConfigExec(): Promise<void>;
32
- listenEvent(): void;
33
- removeEvent(): void;
34
31
  destroy(): void;
35
32
  /**
36
33
  * @desc 调用实例方法打开弹窗
@@ -1 +1 @@
1
- import t from"axios";import{cloneDeep as e,isArray as i}from"lodash-es";import{IdentityVerificationDialog as s,PreviewDialog as r}from"./dialog.js";import{isIReport as n,getFileUrl as a,useBrowserPrint as o}from"./browserPrint.js";import{getCurrentInstance as l}from"vue";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{format as h}from"date-fns";import{io as d}from"socket.io-client";const u=String(navigator.platform).toLowerCase().includes("linux"),m=t.create({timeout:6e4,withCredentials:!1}),p=`${window.location.protocol}//${window.location.host}`,g=`${p}/fdp-api/print/assembly/printIReport`,w=`${p}/bi-api/reprot/print/open/client/printIReportForBase64`,v=`${p}/bi-api/reprot/print/open/client/printIReportForHex`,y=`${p}/bi-api/reprot/print/open/client/previewIReport`,f=`${p}/bi-api/reprot/print/open/client/getRemote`,P=`${p}/printService/file`;let _=null;class I{constructor(){var t,e,i;if(this.webview=null,this.dialog=new s,this.dialogPreview=new r,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._cancelCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,_)return _;_=this;const n=window;this.CMonitor=n.$CMonitor;try{this.webview=n.top?null==(t=n.top.chrome)?void 0:t.webview:null==(e=n.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(i=n.chrome)?void 0:i.webview}this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.initConfigExec())}messageHandler(t){var e,i;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.493"))||"接收到空的浏览器事件");let s;try{s=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==s?void 0:s.cmd)){console.log("打印命令执行了",s);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:i,reject:r}=e;try{if("resetprint"===(null==s?void 0:s.cmd))return void i({result:(null==s?void 0:s.res)?"success":"fail",message:(null==s?void 0:s.error)||""});i(s.res||"")}catch(t){r(t)}}else"config"===(null==s?void 0:s.exec)&&(this.downloadPath=(null==(i=s.res)?void 0:i.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=d(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="","cancel"==(null==t?void 0:t.result)?this._cancelCallbackFn&&this._cancelCallbackFn(t):this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("ihoPrint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=c();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}async initConfigExec(){var t;try{this.listenEvent(),await this.postMessage({exec:"config",data:""}),this.removeEvent()}catch(e){const i="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(i),console.log(((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.494"))||"非封装浏览器或者")+i),this.removeEvent()}}listenEvent(){this.webview&&this.currentMessageHandler&&this.webview.addEventListener("message",this.currentMessageHandler)}removeEvent(){this.webview&&this.currentMessageHandler&&this.webview.removeEventListener("message",this.currentMessageHandler)}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{m({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{m({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}async resetPrinter(t,e){var i;const s=n(t),r=this.getIReportFormatId(s,t);if(s&&(u||2==e)){return await this._testDomesticSystemConnection()?m({url:`${this.printDomesticOrigin}/resetPrint`,method:"get",withCredentials:!1,params:{formatId:r}}).then((({data:t})=>t.status?{type:"resetSuccess",result:"success",message:null==t?void 0:t.message}:{type:"resetError",result:"error",message:null==t?void 0:t.message})).catch((t=>({type:"resetError",result:"error",message:"重置打印机错误"}))):{type:"notInstalledApp",result:"error",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.496"))||"请开启ihoPrint客户端"}}if(this.webview){this.listenEvent();const t=await this.postMessage({exec:"resetprint",data:{formatID:r}});return this.removeEvent(),t}return m({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:r}}).then((({data:t})=>t))}async _queryServicesPrint(e){return this.webview?await this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}async _queryBase64ServicesPrint(t){return this.webview?await this.postMessage({exec:"print",data:{inputData:t}}):m({url:this.printOrigin+"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}async _callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?await this.postMessage({exec:"print",data:s(i)}):m({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){var s;if(!t){const t=(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.497"))||"打印命令返回空数据";return this._handleMonitorNotify(""),this.removeEvent(),null==e||e({type:"printError",message:t,result:"error",errinfo:t}),!1}if("success"!==t.result){const s=t.message||t.Message;this._handleMonitorNotify(s);const r={type:"printError",message:s,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(this.removeEvent(),i&&i({type:"printCancel",message:s,result:t.result,errinfo:t.errinfo}),!1):(this.removeEvent(),null==e||e(r),!1)}return t}_handleResultTest(t,e){var i;return!!t||(console.log("notInstalledApp"),this.removeEvent(),null==e||e({type:"notInstalledApp",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.498"))||"请打开打印服务器插件",result:"error"}),!1)}async _handleEventQueryPrintData(t,e,i,s,r){const n={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(n);return this._handleQueryPrintDataResult(a,e,r)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),this.removeEvent(),null==i||i({result:"error",type:"queryPrintDataFailure",message:e})}catch(t){this.removeEvent(),console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,svrUpdateIp:i,params:s,paramsArr:r,cmdid:n,print:a,signature:o,copies:l,printdlgshow:c="0",nobillnode:d="1",btnprint:u="1",messageTimeout:m=0}){const p={templateId:t,formatId:e,svrUpdateIp:i,params:s,cmdid:n,nobillnode:d,printdlgshow:c,btnprint:u,copies:l,messageTimeout:m,...o?{signature:o}:{}};if(r&&(p.paramsArr=r),a){try{a=JSON.parse(a)}catch(t){}p.print=a}else if(this.isRemote){const t=h(new Date,"yyyyMMddHHmmss");p.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=p,await this._queryServicesPrint(p)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:r=0}){const n={};let a={};try{a=Object.assign({},n,JSON.parse(i))}catch(t){a=n}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:r};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await m({method:"get",url:f})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=p+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await m({method:"post",url:g,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await m({method:"post",url:w,params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _queryPrintForBase16(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await m({method:"post",url:v,params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _queryPrintForPdf(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await m({method:"post",url:y,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),r=s[s.length-2],n=s[s.length-1],l=await a(`${P}/${r}/${n}`),c=o(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let s=i.length;const r=new Uint8Array(s);for(;s--;)r[s]=i.charCodeAt(s);return new Blob([r],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:s="",paramsArr:r,authorizationKey:a,signature:c,btnprint:h,messageTimeout:d=0},m,p){var g;const w=n(i),v=this.getIReportFormatId(w,i);if(w&&(u||2==t)){const t=await this._queryPrintForPdf(e,v,s,a);if(!t)return null==p?void 0:p({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"});const i=o(t,"preview");return this.instance||(this.instance=l()),this.showPreview(this.instance,i),null==m?void 0:m({result:"success",message:"",file:t})}this.listenEvent(),await this._queryProxyOrigin();const y=await this._testConnection();if(!this._handleResultTest(y,p))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:v,params:s,paramsArr:r,cmdid:this.isRemote?"7":"8",signature:c,btnprint:h,messageTimeout:d}),i=this._handleResult(t,p);if(!i)return!1;if(this.isRemote){const t=await this._browserPrint(i,"preview");this.instance||(this.instance=l()),this.showPreview(this.instance,t)}await this.getPicAndUpload(i),this.removeEvent(),null==m||m(i)}catch(t){const e=(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.499"))||"预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};this.removeEvent(),null==p||p(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){var s,r;const n=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=c(),r=await this.messageCollect(t,{exec:"printA",data:n});if(r&&Array.isArray(r)){r.some((t=>"success"===t.res.result))?null==e||e(r):(null==i||i(r),this._handleMonitorNotify(r))}else{const t=(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.500"))||"打印命令返回无效数据";this._handleMonitorNotify(r||""),null==i||i({type:"printError",message:t,result:"error",errinfo:t})}}catch(t){const e={error:t,result:"error",message:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.501"))||"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:s="",paramsArr:r,authorizationKey:a,print:o,signature:l,printdlgshow:c,nobillnode:h,copies:d,svrUpdateIp:m,isDownloadFile:p=!0,messageTimeout:g=0},w,v,y,f="printDirect"){var P,_,I;const b=n(i),S=this.getIReportFormatId(b,i);if(b&&(u||2==t)){if(!await this._testDomesticSystemConnection())return void v({type:"notInstalledApp",result:"error",message:(null==(P=window.getLanguageByCode)?void 0:P.call(window,"10010.1.496"))||"请开启ihoPrint客户端"});return void(this._initDomesticSystem((async t=>{var i;t?await this.printToHiPrint({templateId:e,formatId:S,params:s,authorizationKey:a},w,v,y):v({type:"notInstalledApp",result:"error",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.502"))||"连接ihoPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:S,params:s,authorizationKey:a},w,v,y))}this.listenEvent(),await this._queryProxyOrigin();const C=await this._testConnection();if(!this._handleResultTest(C,v))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:S,params:s,paramsArr:r,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:h,copies:d,svrUpdateIp:m,messageTimeout:g}),i=this._handleResult(t,v,y);if(!i)return!1;p&&["downloadPDF"].includes(f)&&await this._browserPrint(i,f),this.removeEvent(),null==w||w(i)}catch(t){const e="printDirect"===f?(null==(_=window.getLanguageByCode)?void 0:_.call(window,"10010.1.501"))||"打印失败":(null==(I=window.getLanguageByCode)?void 0:I.call(window,"10010.1.503"))||"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};this.removeEvent(),null==v||v(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:s},r,n,a){const o=await this._queryPrintForBase64(t,e,i,s);if(!o.success)return n({message:o.resultMsg,result:"error"});const{base64:l,formatId:c}=o.map;this.base64Fragment=l,this._successCallbackFn=r,this._errorCallbackFn=n,a&&(this._cancelCallbackFn=a),this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:c,pdf_stream:this.base64Fragment})}async _downloadPDF(t){return this.webview?await this.postMessage({exec:"pdf",data:{file:t}}):m.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,s,r){var a;const o=e(t);if(this.webview&&this.downloadPath&&(Reflect.has(o,"print")||Reflect.set(o,"print",{print:"1",type:"1"}),!o.print.filename)){const t=h(new Date,"yyyy-MM-dd"),e=c(),i=h(new Date,"yyyyMMddHHmmss")+e;o.print.filename=`${this.downloadPath}/${t}/${i}/${i}`.replace(/\\/g,"/")}const l=n(o.formatId);if(o.formatId=this.getIReportFormatId(l,o.formatId),l&&(u||2==o.iReportExecuteMode)){const t=await this._queryPrintForBase16(o.templateId||"",o.formatId,o.params||"",o.authorizationKey);return(null==t?void 0:t.success)?s({filebase64:null==(a=null==t?void 0:t.map)?void 0:a.hex,isIreport:!0}):null==r?void 0:r({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"})}this.printDirect(o,(async t=>{t||r({result:"error",message:""}),this.listenEvent();const e=this,n=await async function(t){const s=[],r=JSON.parse(t);if(!i(r))return await e._downloadPDF("");if(1===r.length)return await e._downloadPDF(r[0]||"");for(let t=0,i=r.length;t<i;t++)s.push(await e._downloadPDF(r[t]||""));return s}(t.filedir);this.removeEvent(),s(n,t)}),(t=>r(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,n);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,n);if(!l)return!1;r&&r(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(this.listenEvent(),!this._handleResultTest(a,n))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,n);return!!o&&(this.removeEvent(),r&&r(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,r){const n=await this._testConnection();if(this.listenEvent(),!this._handleResultTest(n,r))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,r);return!!o&&(this.removeEvent(),s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r=0},n,a){const o=await this._testConnection();if(this.listenEvent(),!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r}),c=this._handleResult(l,a);if(!c)return!1;this.removeEvent(),n&&n(c)}async addPrintFormat({templateId:t,params:e,token:i},s,r){const n=await this._testConnection();if(this.listenEvent(),!this._handleResultTest(n,r))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,r);if(!o)return!1;this.removeEvent(),s&&s(o)}}export{I as Print};
1
+ import t from"axios";import{cloneDeep as e,isArray as i}from"lodash-es";import{IdentityVerificationDialog as r,PreviewDialog as s}from"./dialog.js";import{isIReport as n,getFileUrl as a,useBrowserPrint as o}from"./browserPrint.js";import{getCurrentInstance as l}from"vue";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";import{io as u}from"socket.io-client";const h=String(navigator.platform).toLowerCase().includes("linux"),p=t.create({timeout:6e4,withCredentials:!1}),m=`${window.location.protocol}//${window.location.host}`,g=`${m}/fdp-api/print/assembly/printIReport`,w=`${m}/bi-api/reprot/print/open/client/printIReportForBase64`,y=`${m}/bi-api/reprot/print/open/client/printIReportForHex`,f=`${m}/bi-api/reprot/print/open/client/previewIReport`,v=`${m}/bi-api/reprot/print/open/client/getRemote`,P=`${m}/printService/file`;let _=null;class I{constructor(){var t,e,i,n;if(this.webview=null,this.dialog=new r,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._cancelCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,_)return _;_=this;const a=window;this.CMonitor=a.$CMonitor;try{this.webview=a.top?null==(t=a.top.chrome)?void 0:t.webview:null==(e=a.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(i=a.chrome)?void 0:i.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log(((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.494"))||"非封装浏览器或者")+e)}}}messageHandler(t){var e,i;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.493"))||"接收到空的浏览器事件");let r;try{r=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==r?void 0:r.cmd)){console.log("打印命令执行了",r);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:i,reject:s}=e;try{if("resetprint"===(null==r?void 0:r.cmd))return void i({result:(null==r?void 0:r.res)?"success":"fail",message:(null==r?void 0:r.error)||""});i(r.res||"")}catch(t){s(t)}}else"config"===(null==r?void 0:r.exec)&&(this.downloadPath=(null==(i=r.res)?void 0:i.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=u(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="","cancel"==(null==t?void 0:t.result)?this._cancelCallbackFn&&this._cancelCallbackFn(t):this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("ihoPrint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=c();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)})),new Promise(((e,r)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),r({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{p({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{p({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}async resetPrinter(t,e){var i;const r=n(t),s=this.getIReportFormatId(r,t);if(r&&(h||2==e)){return await this._testDomesticSystemConnection()?p({url:`${this.printDomesticOrigin}/resetPrint`,method:"get",withCredentials:!1,params:{formatId:s}}).then((({data:t})=>t.status?{type:"resetSuccess",result:"success",message:null==t?void 0:t.message}:{type:"resetError",result:"error",message:null==t?void 0:t.message})).catch((t=>({type:"resetError",result:"error",message:"重置打印机错误"}))):{type:"notInstalledApp",result:"error",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.496"))||"请开启ihoPrint客户端"}}return this.webview?this.postMessage({exec:"resetprint",data:{formatID:s}}):p({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:s}}).then((({data:t})=>t))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):p({url:this.printOrigin+"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:r(i)}):p({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[r]}).then((({data:t})=>t));function r(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){var r;if(!t){const t=(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.497"))||"打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:"error",errinfo:t}),!1}if("success"!==t.result){const r=t.message||t.Message;this._handleMonitorNotify(r);const s={type:"printError",message:r,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:r,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(s),!1)}return t}_handleResultTest(t,e){var i;return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.498"))||"请打开打印服务器插件",result:"error"}),!1)}async _handleEventQueryPrintData(t,e,i,r,s){const n={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:r},a=await this._queryServicesPrint(n);return this._handleQueryPrintDataResult(a,e,s)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({result:"error",type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,svrUpdateIp:i,params:r,paramsArr:s,cmdid:n,print:a,signature:o,copies:l,printdlgshow:c="0",nobillnode:u="1",btnprint:h="1",messageTimeout:p=0}){const m={templateId:t,formatId:e,svrUpdateIp:i,params:r,cmdid:n,nobillnode:u,printdlgshow:c,btnprint:h,copies:l,messageTimeout:p,...o?{signature:o}:{}};if(s&&(m.paramsArr=s),a){try{a=JSON.parse(a)}catch(t){}m.print=a}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");m.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=m,await this._queryServicesPrint(m)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:r,messageTimeout:s=0}){const n={};let a={};try{a=Object.assign({},n,JSON.parse(i))}catch(t){a=n}const o={templateId:t,formatId:e,cmdid:"9",token:r,params:JSON.stringify(a),messageTimeout:s};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await p({method:"get",url:v})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=m+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await p({method:"post",url:g,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:w,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return n}async _queryPrintForBase16(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:y,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return n}async _queryPrintForPdf(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:f,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return n}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,r=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),s=r[r.length-2],n=r[r.length-1],l=await a(`${P}/${s}/${n}`),c=o(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let r=i.length;const s=new Uint8Array(r);for(;r--;)s[r]=i.charCodeAt(r);return new Blob([s],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:a,signature:c,btnprint:d,messageTimeout:u=0},p,m){var g;const w=n(i),y=this.getIReportFormatId(w,i);if(w&&(h||2==t)){const t=await this._queryPrintForPdf(e,y,r,a);if(!t)return null==m?void 0:m({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"});const i=o(t,"preview");return this.instance||(this.instance=l()),this.showPreview(this.instance,i),null==p?void 0:p({result:"success",message:"",file:t})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,m))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:y,params:r,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:c,btnprint:d,messageTimeout:u}),i=this._handleResult(t,m);if(!i)return!1;if(this.isRemote){const t=await this._browserPrint(i,"preview");this.instance||(this.instance=l()),this.showPreview(this.instance,t)}await this.getPicAndUpload(i),null==p||p(i)}catch(t){const e=(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.499"))||"预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==m||m(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){var r,s;const n=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=c(),s=await this.messageCollect(t,{exec:"printA",data:n});if(s&&Array.isArray(s)){s.some((t=>"success"===t.res.result))?null==e||e(s):(null==i||i(s),this._handleMonitorNotify(s))}else{const t=(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.500"))||"打印命令返回无效数据";this._handleMonitorNotify(s||""),null==i||i({type:"printError",message:t,result:"error",errinfo:t})}}catch(t){const e={error:t,result:"error",message:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.501"))||"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:a,print:o,signature:l,printdlgshow:c,nobillnode:d,copies:u,svrUpdateIp:p,isDownloadFile:m=!0,messageTimeout:g=0},w,y,f,v="printDirect"){var P,_,I;const b=n(i),S=this.getIReportFormatId(b,i);if(b&&(h||2==t)){if(!await this._testDomesticSystemConnection())return void y({type:"notInstalledApp",result:"error",message:(null==(P=window.getLanguageByCode)?void 0:P.call(window,"10010.1.496"))||"请开启ihoPrint客户端"});return void(this._initDomesticSystem((async t=>{var i;t?await this.printToHiPrint({templateId:e,formatId:S,params:r,authorizationKey:a},w,y,f):y({type:"notInstalledApp",result:"error",message:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.502"))||"连接ihoPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:S,params:r,authorizationKey:a},w,y,f))}await this._queryProxyOrigin();const C=await this._testConnection();if(!this._handleResultTest(C,y))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:S,params:r,paramsArr:s,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:d,copies:u,svrUpdateIp:p,messageTimeout:g}),i=this._handleResult(t,y,f);if(!i)return!1;m&&["downloadPDF"].includes(v)&&await this._browserPrint(i,v),null==w||w(i)}catch(t){const e="printDirect"===v?(null==(_=window.getLanguageByCode)?void 0:_.call(window,"10010.1.501"))||"打印失败":(null==(I=window.getLanguageByCode)?void 0:I.call(window,"10010.1.503"))||"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==y||y(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:r},s,n,a){const o=await this._queryPrintForBase64(t,e,i,r);if(!o.success)return n({message:o.resultMsg,result:"error"});const{base64:l,formatId:c}=o.map;this.base64Fragment=l,this._successCallbackFn=s,this._errorCallbackFn=n,a&&(this._cancelCallbackFn=a),this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:c,pdf_stream:this.base64Fragment})}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):p.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,r,s){var a;const o=e(t);if(this.webview&&this.downloadPath&&(Reflect.has(o,"print")||Reflect.set(o,"print",{print:"1",type:"1"}),!o.print.filename)){const t=d(new Date,"yyyy-MM-dd"),e=c(),i=d(new Date,"yyyyMMddHHmmss")+e;o.print.filename=`${this.downloadPath}/${t}/${i}/${i}`.replace(/\\/g,"/")}const l=n(o.formatId);if(o.formatId=this.getIReportFormatId(l,o.formatId),l&&(h||2==o.iReportExecuteMode)){const t=await this._queryPrintForBase16(o.templateId||"",o.formatId,o.params||"",o.authorizationKey);return(null==t?void 0:t.success)?r({filebase64:null==(a=null==t?void 0:t.map)?void 0:a.hex,isIreport:!0}):null==s?void 0:s({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"})}this.printDirect(o,(async t=>{t||s({result:"error",message:""});const e=this,n=await async function(t){const r=[],s=JSON.parse(t);if(!i(s))return await e._downloadPDF("");if(1===s.length)return await e._downloadPDF(s[0]||"");for(let t=0,i=s.length;t<i;t++)r.push(await e._downloadPDF(s[t]||""));return r}(t.filedir);r(n,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:r},void 0,n);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,n);if(!l)return!1;s&&s(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this._handleEventQueryPrintData(t,e,i,r,n);return!!o&&(s&&s(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},r,s){const n=await this._testConnection();if(!this._handleResultTest(n,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(r&&r(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s=0},n,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s}),c=this._handleResult(l,a);if(!c)return!1;n&&n(c)}async addPrintFormat({templateId:t,params:e,token:i},r,s){const n=await this._testConnection();if(!this._handleResultTest(n,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;r&&r(o)}}export{I as Print};
@@ -175,9 +175,6 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
- /**
179
- * 改变弹窗大小
180
- */
181
178
  itemKey?: string | Function | undefined;
182
179
  }>, {
183
180
  move: Function;
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import"../useShadow.js";import{useCommon as a}from"../useCommon.js";import"vue";import{nearlyEqual as s,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as d,filter as p,last as m,omit as g,flatten as v}from"lodash-es";import"date-fns";import{OTHER_MENU as y}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"./useOther.js";import"../../../../../shared/utils/index.js";import{useIntervalFn as h}from"@vueuse/core";function x(x,k,L,w,P,b){const{computedX:A,computedY:C,getXValue:j,getYValue:I}=l(k),{xCellWidth:M,pointSelectionStyle:E,originX:K,endX:X,originY:V,endY:Y,event:T,scaleValues:O,xAxis:S,startTime:D,timeXCell:F,itemList:$,dialog:z,topGridOriginY:B,topGridEndY:G,extraMenuConfig:N}=k,_=new Map,J=new Set;let q=d(O),R=[],W=null;const H=new Set;o(x,k);const{getEqualXTypes:Q,handleAddPrevent:U,setPrevAndNextPoint:Z,getPointEventProps:ee}=a(x,L,k),{pause:te,resume:ne}=h((()=>{!function(){if(!H.size)return;for(const e of H)e.set("opacity",1===e.opacity?.5:1);x.value.renderAll()}()}),800);function ie(){q.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=C(t.type,t.range,i),a=n([K,r,X,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{w.point={...e||{x:a.left,y:a.top}},w.list=[`${o} ${i}${t.unit||""}`],w.show=!0})),a.on("mouseout",(()=>{w.show=!1}))),x.value.add(a)}a(i),a(o),a(l),a(r)}(t,e),ae(t,i,e))}))}))}function oe(e=[]){if(!(null==W?void 0:W.areaPos))return[];const{startPos:t,endPos:n}=W.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ve()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function le(e){var t,n,i,o;z.warning({maskClosable:!1,closeOnEsc:!1,title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.228"))||"警告",content:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.229"))||"确认删除当前选中的节点?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{e(),re()},onNegativeClick:()=>re(),onClose:()=>re()})}function re(){W&&x.value.remove(W),W=null}function ae(e,t,o){var l;const{type:r,unit:a,dataList:f=[]}=o,u=[];_.set(e.key,[]),function(e,t){H.size&&[...H].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&H.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,d){var p;let v,y,h=d;l.key&&(h=f.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:b="",key:A,type:C="circle"}=h,E=ge(d.list[c+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(y=n([...e,...E],P));const K=u[c-1],X={origin:{data:l,title:b,key:d.key,selfKey:A,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:K,rightLine:y,...k,...ee()};e&&(K||(X.leftLine=null),v=i(C,{left:e[0],top:e[1],...X}));u.push(y),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){T.hovered&&(e.on("mouseover",(()=>{pe(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{me(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&pe(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:f,origin:u}=e,c=~~(Math.abs(a-l)/M),d=a>l;if(Math.abs(a-l)>M){if(0===R.length){let a=e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r];d||(a=e.rightLine?[e.rightLine.x2,e.rightLine.y2]:[l,r]),fe(e,[...a,l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const p=M*c,m=d?l+p:l-p;if(R.every((e=>!s(e.left,m)))){const t=j(m),n=I(u.type,f);R.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:m,top:f}),fe(e,[...e.prevPointer,m,f],d)}if(R.length<c&&function(e,t,n=!0){const{originLeft:i,originTop:o,origin:l}=e;let r=1;for(;r<=t;){const t=M*r,a=n?i+t:i-t,s=R.some((e=>Math.abs(e.left-a)<=1));if(!s){let t=0;const r=R.find(((e,i)=>n?(e.left>a&&(t=i),e.left>a):(e.left<a&&(t=i),e.left<a)));if(r){const s=JSON.parse(JSON.stringify(r)),f=R[t-1]||{left:i,top:o},u=~~(Math.abs(r.left-(n?a-M:a+M))/M),c=(r.top-f.top)/u;s.top=f.top+c,s.left=a,s.data={time:j(a),value:I(l.type,s.top),...l.selfKey!==l.key?{key:l.selfKey}:{}},R.splice(t,0,s),fe(e,[f.left,f.top,s.left,s.top],n)}}r++}}(e,c,d),d&&e.nextPoint||!d&&e.prevPoint){const t=_.get(u.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=M/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{s(e.left,l)||u.index===e.origin.index||(d&&e.left>l&&e.left<a||!d&&e.left<l&&e.left>a?se(e,"#999"):se(e,e.origin.lineAttr.stroke))}))}}!function(e,t=!0){var n,i,o,l;const{left:r,originLeft:a}=e;if((null==R?void 0:R.length)>0){for(const e of J)(t&&(e.left>r||e.left<a)||!t&&(e.left<r||e.left>a))&&(e.left<r||e.left>a)&&(e.leftLine&&x.value.remove(e.leftLine),e.rightLine&&x.value.remove(e.rightLine),x.value.remove(e));if(R=R.filter((e=>t&&e.left<=r&&e.left>a||!t&&e.left>=r&&e.left<a)),0===R.length){null==(i=null==(n=e.leftLine)?void 0:n.set)||i.call(n,e.prevPoint.origin.lineAttr),null==(l=null==(o=e.rightLine)?void 0:o.set)||l.call(o,e.origin.lineAttr);for(const e of J)e.leftLine&&x.value.remove(e.leftLine),x.value.remove(e)}if(R.length>0){const t=m(R);e.prevPointer=[t.left,t.top]}}}(e,d)}(e)})),e.on("mouseup",(t=>{if(w.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:j(e.left),value:I(t,e.top)}};if(x.value.discardActiveObject(),R.length>0){const l=q.find((e=>e.type===t));let r=-1;const a=m(R).left>e.originLeft,s=R.map((e=>e.data));if(a&&e.nextPoint||!a){if(2.5!==e.scaleX)return void ce({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1&&s.splice(o,1),a||(s.reverse(),r=e.origin.index)}const f=l.dataList.findIndex((e=>e.key===n));L("add",{...g(o,["index","selfKey","lineAttr"]),dataIndex:f,key:n,data:s}),ue({...o,data:s,coincideIndex:r})}else L("change",{...g(o,["selfKey","lineAttr"]),key:n}),ue(o,"change")}}))}(v),null==(p=_.get(d.key))||p.push(v))}(ge(l,o),l,c,e)})),Promise.all(_.get(e.key)).then((t=>{const n=u.filter((e=>e));Z(t),x.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||H.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function se(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&![t,"transparent"].includes(e.rightLine.stroke)&&e.rightLine.set("stroke",t)}function fe(e,t,i=!0){const[o,,l,r]=t;e.clone((a=>{a.set({left:l,top:r,scaleX:1,scaleY:1}),e.prevPointer=[l,r];const f=n(t,e.leftLine&&s(o,e.leftLine.x1)?e.prevPoint.origin.lineAttr:e.origin.lineAttr);i?a.leftLine=f:a.rightLine=f,J.add(a),x.value.add(f,a)}))}function ue(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a,linkKey:s}=e;let{dataIndex:u}=e;const c=q.find((e=>e.type===r)),d=c.dataList.find(((e,t)=>{u=t;const n=s||l;return e.key===n}));switch(t){case"remove":d.list.splice(o,n),d.list[o-1]&&(d.list[o-1].breakpoint=!0);break;case"change":d.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,d.list,!0),n=Array.isArray(i)?i:[i];d.list.splice(t,a>-1?a-t:0,...n);break}}ce({dataIndex:u,scaleValue:c})}function ce(e){var t,n,i;if(J.size&&(null==(t=x.value)||t.remove(...de([...J]))),J.clear(),R=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=x.value)||n.remove(...de(_.get(o.key))),_.delete(o.key),ae(o,t,i)}else q=d(O),_.size&&(null==(i=x.value)||i.remove(...de(ve()))),_.clear(),ie()}function de(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function pe(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;w.point={x:e.left,y:e.top};const a=j(e.left),s=`${"hover"===t?o.value:I(i,e.top)}`;w.list=[`${n} ${s}${l||""}`,`时间 ${a.slice(-5)}`],w.sourceData=[{type:i,title:n,unit:l,key:r,time:a,value:s}],w.isTarget=!0,w.show=!0}function me(e,t=X){e.setCoords();const n=K;e.top<V&&e.set("top",V),e.top>Y&&e.set("top",Y),e.left<n&&e.set("left",n),e.left>t&&e.set("left",t)}function ge(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=c(e);return n>=D&&n<=t}(e.time)){const n=A(e.time),i=C(t.type,t.range,e.value);return[n,i<V?V:i>Y?Y:i]}}function ve(){return v(Array.from(_.values()))}return ie(),function(){if(!T.evented)return;let n=!1,i={x:0,y:0};x.value.on("mouse:up",(e=>{if(3===e.button&&function(e){w.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=X&&n>=V&&n<=Y)if(e.target){if("main"!==e.target.__type)return;const t=e.target;i({x:t.left,y:t.top},e.target,[]),P.list=p(y,(e=>"edit"!==e.type)).map((e=>({...e,renderItem:()=>e.label,type:e.key||e.type,pointer:{x:t.left,y:t.top},..."add"===e.type?{}:{origin:{...t.origin}}})))}else{i(e.pointer,null,[]);const{menuList:t=[]}=N;P.list=p(y,(e=>"add"===e.type)).concat(t).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,pointer:e.pointer})))}function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=oe();e.length>0?le((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ue(n[0],"remove",n.length),n.map((e=>({...g(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);L("remove",t)})):r.emit(W)}})),x.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),x.value.on("mouse:move",(o=>{if(function(e){if(!b||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;w.movable=!1,(i<K||i>X)&&(w.show=!1);if(!t&&i>=K&&i<=X){const e=o>=V&&o<=Y,l=o>=B&&o<=G;if(e||l){const l=j(i);w.sourceData=e?q.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],w.isTarget=!!t,w.point=n,w.movable=!0}else w.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;W&&x.value.remove(W),W=new e.Rect({...t,fill:"#CAF982",opacity:.4,...E,left:l>a?a:l,top:r>s?s:r,width:Math.abs(a-l),height:Math.abs(s-r),objectCaching:!0}),W.areaPos={startPos:i,endPos:o.pointer},x.value.add(W)}))}(),{redrawPoints:ce,clickMenu:function({item:e,target:t}){var n;const{type:i,origin:o,pointer:l}=e,r={...o};o||Object.assign(r,{data:{time:j(l.x)},type:null}),p(y,(e=>"edit"!==e.type)).map((e=>e.type)).includes(i)?("remove"===i&&ue(r,"remove"),L(i,r)):null==(n=N.click)||n.call(N,i,r)},moveLimit:me,setPopup:pe,updateData:ue,getGridPoints:ve,getContainPoints:oe,showDialog:le,removeCurrentSelection:re,pauseFlickerPoint:te}}export{x as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import"../useShadow.js";import{useCommon as a}from"../useCommon.js";import"vue";import{nearlyEqual as s,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as d,filter as p,last as m,omit as g,flatten as v}from"lodash-es";import"date-fns";import{OTHER_MENU as y}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"./useOther.js";import"../../../../../shared/utils/index.js";import{useIntervalFn as h}from"@vueuse/core";function x(x,k,L,w,b,P){const{computedX:A,computedY:C,getXValue:j,getYValue:I}=l(k),{xCellWidth:M,pointSelectionStyle:E,originX:K,endX:X,originY:V,endY:Y,event:T,scaleValues:O,xAxis:S,startTime:D,timeXCell:F,itemList:$,dialog:z,topGridOriginY:B,topGridEndY:G,extraMenuConfig:N,grid:_}=k,J=new Map,q=new Set;let R=d(O),W=[],H=null;const Q=new Set;o(x,k);const{getEqualXTypes:U,handleAddPrevent:Z,setPrevAndNextPoint:ee,getPointEventProps:te}=a(x,L,k),{pause:ne,resume:ie}=h((()=>{!function(){if(!Q.size)return;for(const e of Q)e.set("opacity",1===e.opacity?.5:1);x.value.renderAll()}()}),800);function oe(){R.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=C(t.type,t.range,i),a=n([K,r,X,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{w.point={...e||{x:a.left,y:a.top}},w.list=[`${o} ${i}${t.unit||""}`],w.show=!0})),a.on("mouseout",(()=>{w.show=!1}))),x.value.add(a)}a(i),a(o),a(l),a(r)}(t,e),se(t,i,e))}))}))}function le(e=[]){if(!(null==H?void 0:H.areaPos))return[];const{startPos:t,endPos:n}=H.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ye()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function re(e){var t,n,i,o;z.warning({maskClosable:!1,closeOnEsc:!1,title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.228"))||"警告",content:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.229"))||"确认删除当前选中的节点?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{e(),ae()},onNegativeClick:()=>ae(),onClose:()=>ae()})}function ae(){H&&x.value.remove(H),H=null}function se(e,t,o){var l;const{type:r,unit:a,dataList:f=[]}=o,u=[];J.set(e.key,[]),function(e,t){Q.size&&[...Q].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&Q.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,d){var p;let v,y,h=d;l.key&&(h=f.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:b={},title:P="",key:A,type:C="circle"}=h,E=ve(d.list[c+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(!_.breakpoint||_.breakpoint&&E[0]-e[0]<=M)&&(y=n([...e,...E],b));const K=u[c-1],X={origin:{data:l,title:P,key:d.key,selfKey:A,unit:a,type:r,dataIndex:t,index:c,lineAttr:b},__type:"main",leftLine:K,rightLine:y,...k,...te()};e&&(K||(X.leftLine=null),v=i(C,{left:e[0],top:e[1],...X}));u.push(y),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){T.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ge(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&me(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:f,origin:u}=e,c=~~(Math.abs(a-l)/M),d=a>l;if(Math.abs(a-l)>M){if(0===W.length){let a=e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r];d||(a=e.rightLine?[e.rightLine.x2,e.rightLine.y2]:[l,r]),ue(e,[...a,l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const p=M*c,m=d?l+p:l-p;if(W.every((e=>!s(e.left,m)))){const t=j(m),n=I(u.type,f);W.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:m,top:f}),ue(e,[...e.prevPointer,m,f],d)}if(W.length<c&&function(e,t,n=!0){const{originLeft:i,originTop:o,origin:l}=e;let r=1;for(;r<=t;){const t=M*r,a=n?i+t:i-t,s=W.some((e=>Math.abs(e.left-a)<=1));if(!s){let t=0;const r=W.find(((e,i)=>n?(e.left>a&&(t=i),e.left>a):(e.left<a&&(t=i),e.left<a)));if(r){const s=JSON.parse(JSON.stringify(r)),f=W[t-1]||{left:i,top:o},u=~~(Math.abs(r.left-(n?a-M:a+M))/M),c=(r.top-f.top)/u;s.top=f.top+c,s.left=a,s.data={time:j(a),value:I(l.type,s.top),...l.selfKey!==l.key?{key:l.selfKey}:{}},W.splice(t,0,s),ue(e,[f.left,f.top,s.left,s.top],n)}}r++}}(e,c,d),d&&e.nextPoint||!d&&e.prevPoint){const t=J.get(u.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=M/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{s(e.left,l)||u.index===e.origin.index||(d&&e.left>l&&e.left<a||!d&&e.left<l&&e.left>a?fe(e,"#999"):fe(e,e.origin.lineAttr.stroke))}))}}!function(e,t=!0){var n,i,o,l;const{left:r,originLeft:a}=e;if((null==W?void 0:W.length)>0){for(const e of q)(t&&(e.left>r||e.left<a)||!t&&(e.left<r||e.left>a))&&(e.left<r||e.left>a)&&(e.leftLine&&x.value.remove(e.leftLine),e.rightLine&&x.value.remove(e.rightLine),x.value.remove(e));if(W=W.filter((e=>t&&e.left<=r&&e.left>a||!t&&e.left>=r&&e.left<a)),0===W.length){null==(i=null==(n=e.leftLine)?void 0:n.set)||i.call(n,e.prevPoint.origin.lineAttr),null==(l=null==(o=e.rightLine)?void 0:o.set)||l.call(o,e.origin.lineAttr);for(const e of q)e.leftLine&&x.value.remove(e.leftLine),x.value.remove(e)}if(W.length>0){const t=m(W);e.prevPointer=[t.left,t.top]}}}(e,d)}(e)})),e.on("mouseup",(t=>{if(w.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:j(e.left),value:I(t,e.top)}};if(x.value.discardActiveObject(),W.length>0){const l=R.find((e=>e.type===t));let r=-1;const a=m(W).left>e.originLeft,s=W.map((e=>e.data));if(a&&e.nextPoint||!a){if(2.5!==e.scaleX)return void de({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1&&s.splice(o,1),a||(s.reverse(),r=e.origin.index)}const f=l.dataList.findIndex((e=>e.key===n));L("add",{...g(o,["index","selfKey","lineAttr"]),dataIndex:f,key:n,data:s}),ce({...o,data:s,coincideIndex:r})}else L("change",{...g(o,["selfKey","lineAttr"]),key:n}),ce(o,"change")}}))}(v),null==(p=J.get(d.key))||p.push(v))}(ve(l,o),l,c,e)})),Promise.all(J.get(e.key)).then((t=>{const n=u.filter((e=>e));ee(t),x.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||Q.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function fe(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&![t,"transparent"].includes(e.rightLine.stroke)&&e.rightLine.set("stroke",t)}function ue(e,t,i=!0){const[o,,l,r]=t;e.clone((a=>{a.set({left:l,top:r,scaleX:1,scaleY:1}),e.prevPointer=[l,r];const f=n(t,e.leftLine&&s(o,e.leftLine.x1)?e.prevPoint.origin.lineAttr:e.origin.lineAttr);i?a.leftLine=f:a.rightLine=f,q.add(a),x.value.add(f,a)}))}function ce(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a,linkKey:s}=e;let{dataIndex:u}=e;const c=R.find((e=>e.type===r)),d=c.dataList.find(((e,t)=>{u=t;const n=s||l;return e.key===n}));switch(t){case"remove":d.list.splice(o,n),d.list[o-1]&&(d.list[o-1].breakpoint=!0);break;case"change":d.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,d.list,!0),n=Array.isArray(i)?i:[i];d.list.splice(t,a>-1?a-t:0,...n);break}}de({dataIndex:u,scaleValue:c})}function de(e){var t,n,i;if(q.size&&(null==(t=x.value)||t.remove(...pe([...q]))),q.clear(),W=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=x.value)||n.remove(...pe(J.get(o.key))),J.delete(o.key),se(o,t,i)}else R=d(O),J.size&&(null==(i=x.value)||i.remove(...pe(ye()))),J.clear(),oe()}function pe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function me(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;w.point={x:e.left,y:e.top};const a=j(e.left),s=`${"hover"===t?o.value:I(i,e.top)}`;w.list=[`${n} ${s}${l||""}`,`时间 ${a.slice(-5)}`],w.sourceData=[{type:i,title:n,unit:l,key:r,time:a,value:s}],w.isTarget=!0,w.show=!0}function ge(e,t=X){e.setCoords();const n=K;e.top<V&&e.set("top",V),e.top>Y&&e.set("top",Y),e.left<n&&e.set("left",n),e.left>t&&e.set("left",t)}function ve(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=c(e);return n>=D&&n<=t}(e.time)){const n=A(e.time),i=C(t.type,t.range,e.value);return[n,i<V?V:i>Y?Y:i]}}function ye(){return v(Array.from(J.values()))}return oe(),function(){if(!T.evented)return;let n=!1,i={x:0,y:0};x.value.on("mouse:up",(e=>{if(3===e.button&&function(e){w.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=X&&n>=V&&n<=Y)if(e.target){if("main"!==e.target.__type)return;const t=e.target;i({x:t.left,y:t.top},e.target,[]),b.list=p(y,(e=>"edit"!==e.type)).map((e=>({...e,renderItem:()=>e.label,type:e.key||e.type,pointer:{x:t.left,y:t.top},..."add"===e.type?{}:{origin:{...t.origin}}})))}else{i(e.pointer,null,[]);const{menuList:t=[]}=N;b.list=p(y,(e=>"add"===e.type)).concat(t).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,pointer:e.pointer})))}function i(e,t,n){Object.assign(b,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=le();e.length>0?re((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ce(n[0],"remove",n.length),n.map((e=>({...g(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);L("remove",t)})):r.emit(H)}})),x.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),x.value.on("mouse:move",(o=>{if(function(e){if(!P||b.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;w.movable=!1,(i<K||i>X)&&(w.show=!1);if(!t&&i>=K&&i<=X){const e=o>=V&&o<=Y,l=o>=B&&o<=G;if(e||l){const l=j(i);w.sourceData=e?R.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],w.isTarget=!!t,w.point=n,w.movable=!0}else w.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;H&&x.value.remove(H),H=new e.Rect({...t,fill:"#CAF982",opacity:.4,...E,left:l>a?a:l,top:r>s?s:r,width:Math.abs(a-l),height:Math.abs(s-r),objectCaching:!0}),H.areaPos={startPos:i,endPos:o.pointer},x.value.add(H)}))}(),{redrawPoints:de,clickMenu:function({item:e,target:t}){var n;const{type:i,origin:o,pointer:l}=e,r={...o};o||Object.assign(r,{data:{time:j(l.x)},type:null}),p(y,(e=>"edit"!==e.type)).map((e=>e.type)).includes(i)?("remove"===i&&ce(r,"remove"),L(i,r)):null==(n=N.click)||n.call(N,i,r)},moveLimit:ge,setPopup:me,updateData:ce,getGridPoints:ye,getContainPoints:le,showDialog:re,removeCurrentSelection:ae,pauseFlickerPoint:ne}}export{x as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o,drawLine as i,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as u,cloneDeep as d,omit as f,flatten as h}from"lodash-es";import{format as m}from"date-fns";import{OTHER_MENU as p}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const g=u(p,(t=>"add"!==t.type));function x(u,p,x,v,y,k,C,w,X){const{computedX:A,getXValue:b}=r(p),{getEqualXTypes:P,handleAddPrevent:E,isGridLimit:j,getPointEventProps:S}=s(u,x,p),{createShadowLines:L}=l(),{canvasWidth:M,other:z,yCellHeight:H,xCellWidth:T,endX:I,originX:W,originY:Y,endY:B,markHeight:O,event:D,topGridYCellHeight:V,extracorporealCirculationHeight:G}=p,$=new Map,K=d(z);function _(){var i;if(!(null==(i=null==K?void 0:K.horizontal)?void 0:i.length))return;const n="horizontal";$.set(n,[]);const{horizontal:r}=K;let a=Y+H/2;r.forEach(((i,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:d,showIcon:f=!0}=i;let h=null;d.forEach(((i,d)=>{const{time:m,value:p}=i,g=A(m);if(!Z(g))return;const x=[],v=f&&e(s,{...c,left:g,top:a});v&&x.push(v);const y=f?g+v.width/2+2:g,k=o([y,a],{value:p,...u,originX:"left"});x.push(k);const C=new t.Group(x,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...S()});Object.assign(C,{originLeft:g,iconHalfWidth:v?v.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:d,data:i,title:l},limitX:{x1:W,x2:I-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,Q(C),$.get(n).push(C)})),a+=H})),u.value.add(...$.get(n))}function q(){var t;if(!(null==(t=null==K?void 0:K.vertical)?void 0:t.length))return;const o="vertical";$.set(o,[]);const{vertical:i}=K;i.forEach(((t,i)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!Z(c))return;const{lineHeight:u=H}=a;let d=Y+r+u/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:d,origin:{type:"other",key:o,dataIndex:i,index:n,data:{value:t}},...S()});d+=u,Q(r),$.get(o).push(r)}));const f=$.get(o).filter((t=>t.origin.dataIndex===i)),h=Math.max(...f.map((t=>t.width))),m=c>I-h;f.forEach(((t,e,o)=>{t.siblingPoints=o.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),u.value.add(...$.get(o))}function F(t,e="add"){const{dataIndex:o,data:i,index:n,key:r,dataKey:a}=t,l=K[r],s=["mark"].includes(r)||"extracorporealCirculation"===r?l.dataList[o]:l[o];switch(e){case"remove":s.data.splice(n,1);break;case"change":"extracorporealCirculation"===r?s[a]=i:s.data[n]=i;break;default:{const t=Array.isArray(i)?i[0].time:i.time,e=c(t,s.data),o=Array.isArray(i)?i:[i];s.data.splice(e,0,...o);break}}J(t)}function J(t){var e;const{key:o}=t;switch(null==(e=u.value)||e.remove(...$.get(o)),$.delete(o),o){case"horizontal":_();break;case"vertical":q();break;case"mark":N();break;case"extracorporealCirculation":et()}}function N(){if(!(null==z?void 0:z.mark)||!O)return;const{title:t,titleStyle:i,pointAttr:n,dataList:r}=z.mark,a=o([W-5,B+O/2],{value:t,...i,originX:"right"});u.value.add(a);const l=B+O+G,s=G+B,c=[];r.forEach((t=>{const{time:o,list:i=[]}=t,r=A(o);if(!Z(r))return;let a=s;i.forEach((t=>{const{style:o}=t;let i=!1;const d=e((null==o?void 0:o.type)||"circleAndText",{...(null==o?void 0:o.pointAttr)||n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),f=d.height;a+f<=l&&a>=s?(d.set("top",a+f/2),a+=f):(i||(a=B,i=!0),d.set("top",a-f/2),a-=f),c.push(d),Q(d),u.value.add(d)}))})),function(t){const e=t=>{var e,o;return null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart},o=t.find((t=>e(t))),i=t.find((t=>!e(t)&&t.left>o.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:W,x2:I};e(t)?(r.x2=i.left,t.otherPoints=n):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(c)}function Q(t){if(D.hovered&&(t.on("mouseover",(()=>{R(t)})),t.on("mouseout",(()=>{v.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,o=["mark","horizontal"].includes(e),i=["mark","vertical"].includes(e),n="extracorporealCirculation"===e;t.on("moving",(()=>{o?function(t){const e=t.origin.key,o="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(o?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(o?-1:0));if("mark"===e){t.top<Y&&t.set("top",Y);const e=B+O-t.height/2;t.top>e&&t.set("top",e)}o&&(t.originLeft=t.left+t.iconHalfWidth)}(t):n?function(t){t.setCoords();const{left:e,limitX:o}=t,i=m(new Date,"yyyy-MM-dd HH:mm"),n=A(i);o.isCurrentTime&&o.x2<n&&n>0&&n<M&&(o.x2=n);e<o.x1&&t.set({x1:o.x1,x2:o.x1});e>o.x2&&t.set({x1:o.x2,x2:o.x2});U(t,"left"),U(t,"right")}(t):(k(t),function(t){const e=t.left+t.maxTextWidth>I?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((o=>o.setCoords().set({originX:e,left:t.left})))}(t)),D.hovered&&R(t)})),t.on("mouseup",(r=>{var a;if(v.show=!1,1===r.button){o&&function(t){var e,o;if("mark"===t.origin.key){if((null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),o=Math.min(...e);t.startPoint.limitX.x2=o}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=b(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...i?{time:e}:{data:{...t.origin.data,time:e}}};u.value.discardActiveObject(),x("change",r),n&&F(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(y.point={x:t.left,y:t.top},y.show=!0,y.target=t,y.list=g.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function R(t){v.isTarget=!0,v.show=!0;const{key:e,data:o={}}=t.origin||{};let i=o.value;const n="extracorporealCirculation"===e||"mark"===e;v.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=b(r);v.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(i=o.name),v.list.unshift(i+" ")),v.sourceData=[{type:"other",key:e,time:a,value:i}]}function U(t,e){const{shadowObjs:o,params:i}=t[`${e}ShadowBox`]||{};if(!o||!i)return;o.forEach((t=>u.value.remove(t)));i["left"===e?1:0]=t.left;const n=tt(...i);t[`${e}ShadowBox`]={shadowObjs:n,params:i}}function Z(t){return t>=W&&t<=I}function tt(...e){const[o,i,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),d=[[o,B],[i,B],[i,r],[o,r]],h=new t.Polygon(d.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),m=[];return["slash"].includes(l)&&m.push(...L(d,s.angle,s.space,c)),u.value.add(h,...m),$.get("extracorporealCirculation").push(h,...m),[h,...m]}function et(){if(!G)return;const{dataList:e,ascendAortaStyle:o,extracorporealCirculationStyle:i}=K.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";$.set(n,[]);const r=B+G;let a,l;function s(t){return t&&t>W&&t<M}function c(t){return void 0===t||""===t}e.forEach(((d,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:o,openAscendAorta:i,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),o&&(a=A(o.time)),i&&(l=A(i.time)),n&&(s=A(n.time)),[r,a,l,s]}(d);if(-1===h.findIndex((t=>t>0&&t<M)))return;let p;h.forEach(((g,x)=>{if(c(g))return;const v=h[x+1],y=h[x-1];if(s(g)||s(v)){const k=s(g)?g:W,C=s(v)?v:c(v)?null:I,w=s(y)?y:W,X={};if(x<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(x)?i:o],X.shadowObjs=tt(...X.params)),s(g)){const o=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(x),i=m(new Date,"yyyy-MM-dd HH:mm"),c=A(i),v=g<c&&s(c)?c:g,y=function(e,o){const i=new t.Line(e,{...o,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return Q(i),u.value.add(i),$.get("extracorporealCirculation").push(i),i}([g,B,g,r],{origin:{dataIndex:f,dataKey:o,key:n,data:d[o],type:"other"},limitX:{x1:0===x?null!=a?a:W:w,x2:C||v,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(x)?{leftShadowBox:p}:{},...[0,1,2].includes(x)?{rightShadowBox:X}:{}});x===h.length-1&&(a=g,l=y),0===x&&l&&(l.limitX.x2=k)}p=X}}))}))}return function(){if(!(null==z?void 0:z.longLine)||!z.longLine.time)return;const{time:t,style:e}=z.longLine,o=A(t),n=i([o,0,o,B],e);u.value.add(n)}(),function(){var t;if(!(null==(t=null==K?void 0:K.horizontal)?void 0:t.length))return;const{horizontal:o}=K,i=W-5;let n=Y+H/2;o.forEach(((t,o)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:i,top:n,origin:{defaultAddValue:l,dataIndex:o,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:i,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),j(c)?R(c):v.show=!1})),c.on("mouseup:before",(t=>{if(v.show=!1,0===t.e.button&&j(c))if(P($.get("horizontal"),c.left,"key",T).includes(c.origin.key))E("repeat"),console.log("重复节点");else{const t={data:{time:b(c.left),value:c.origin.defaultAddValue},...c.origin};x("add",f(t,["isMenu"])),F(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),u.value.add(s),n+=H}))}(),_(),q(),N(),et(),a.on((()=>{const t="horizontal",e=C($.get(t));e.length>0?w((()=>{const o=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:o}=e.origin;return t[o]=t[o]?t[o].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const o=e[t];return K.horizontal[t].data.splice(o[0].index,o.length),o})))}(e);J({key:t}),x("remove",o)})):X()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o,_type:i}=t,n={...e.origin,type:i};x(o,n),"remove"===o&&F(n,o)}}}export{x as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o,drawLine as i,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as u,cloneDeep as d,omit as f,flatten as h}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const g=u(m,(t=>"add"!==t.type));function x(u,m,x,v,y,k,C,w,X){const{computedX:b,getXValue:A}=r(m),{getEqualXTypes:j,handleAddPrevent:E,isGridLimit:P,getPointEventProps:L}=s(u,x,m),{createShadowLines:S}=l(),{canvasWidth:M,other:T,yCellHeight:z,xCellWidth:H,endX:I,originX:O,originY:W,endY:Y,markHeight:$,event:B,topGridYCellHeight:D,extracorporealCirculationHeight:_}=m,V=new Map,G=d(T);function K(){var i;if(!(null==(i=null==G?void 0:G.horizontal)?void 0:i.length))return;const n="horizontal";V.set(n,[]);const{horizontal:r}=G;let a=W+z/2;r.forEach(((i,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:d,showIcon:f=!0}=i;let h=null;d.forEach(((i,d)=>{const{time:p,value:m}=i,g=b(p);if(!Z(g))return;const x=[],v=f&&e(s,{...c,left:g,top:a});v&&x.push(v);const y=f?g+v.width/2+2:g,k=o([y,a],{value:m,...u,originX:"left"});x.push(k);const C=new t.Group(x,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...L()});Object.assign(C,{originLeft:g,iconHalfWidth:v?v.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:d,data:i,title:l},limitX:{x1:O,x2:I-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,Q(C),V.get(n).push(C)})),a+=z})),u.value.add(...V.get(n))}function q(){var t;if(!(null==(t=null==G?void 0:G.vertical)?void 0:t.length))return;const o="vertical";V.set(o,[]);const{vertical:i}=G;i.forEach(((t,i)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=b(s);if(!n||!Z(c))return;const{lineHeight:u=z}=a;let d=W+r+u/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:d,origin:{type:"other",key:o,dataIndex:i,index:n,data:{value:t}},...L()});d+=u,Q(r),V.get(o).push(r)}));const f=V.get(o).filter((t=>t.origin.dataIndex===i)),h=Math.max(...f.map((t=>t.width))),p=c>I-h;f.forEach(((t,e,o)=>{t.siblingPoints=o.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,p&&t.set("originX","right")}))})),u.value.add(...V.get(o))}function F(t,e="add"){const{dataIndex:o,data:i,index:n,key:r,dataKey:a,time:l}=t,s=G[r],u=["mark","extracorporealCirculation"].includes(r)?s.dataList[o]:s[o];switch(e){case"remove":u.data.splice(n,1);break;case"change":if("mark"===r){u.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(i):(s.dataList.push({time:l,list:[i]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?u[a]=i:u.data[n]=i;break;default:{const t=Array.isArray(i)?i[0].time:i.time,e=c(t,u.data),o=Array.isArray(i)?i:[i];u.data.splice(e,0,...o);break}}J(t)}function J(t){var e;const{key:o}=t;switch(null==(e=u.value)||e.remove(...V.get(o)),V.delete(o),o){case"horizontal":K();break;case"vertical":q();break;case"mark":N();break;case"extracorporealCirculation":et()}}function N(){if(!$)return;const{title:t,titleStyle:i,pointAttr:n,dataList:r}=G.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";V.set(a,[]);const l=o([O-5,Y+$/2],{value:t,...i,originX:"right"});u.value.add(l);const s=Y+$+_,c=Y+_;let d=0;const f={};r.forEach(((t,o)=>{const{time:i,list:r=[]}=t,l=b(i);if(!Z(l))return;let h=c+1;r.forEach(((t,i)=>{var r;const{style:p}=t,m=e((null==p?void 0:p.type)||"circleAndText",{...(null==p?void 0:p.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:o,index:i}}),g=m.height;d&&l-d<=H&&(null==(r=f[`x_${d}`])||r.forEach((([t,e])=>{h+g>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:x,startTop:v,oldStartTop:y}=function(t,e){const o={};let i;if(t>Y){const r=t+e;o.y2=t+e/2,r>=s?n(Y-1):(i=t,t=r)}else n(t);function n(n){i=n,o.y2=n-e/2;t=n-e}return{topObj:o,startTop:t,oldStartTop:i}}(h,g);h=v,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",x.y2),V.get(a).push(m),Q(m),u.value.add(m)})),d=l})),function(t){const e=t=>{var e,o;return null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart},o=t.find((t=>e(t))),i=t.find((t=>!e(t)&&t.left>o.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:O,x2:I};e(t)?(r.x2=i.left,t.otherPoints=n):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(V.get(a))}function Q(t){if(B.hovered&&(t.on("mouseover",(()=>{R(t)})),t.on("mouseout",(()=>{v.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,o=["mark","horizontal"].includes(e),i=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{o?function(t){const e=t.origin.key,o="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(o?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(o?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+_+$-t.height/2;t.top>e&&t.set("top",e)}o&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:o}=t,i=p(new Date,"yyyy-MM-dd HH:mm"),n=b(i);o.isCurrentTime&&o.x2<n&&n>0&&n<M&&(o.x2=n);e<o.x1&&t.set({x1:o.x1,x2:o.x1});e>o.x2&&t.set({x1:o.x2,x2:o.x2});U(t,"left"),U(t,"right")}(t):(k(t),function(t){const e=t.left+t.maxTextWidth>I?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((o=>o.setCoords().set({originX:e,left:t.left})))}(t)),B.hovered&&R(t)})),t.on("mouseup",(r=>{var a;if(v.show=!1,1===r.button){o&&function(t){var e,o;if("mark"===t.origin.key){if((null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),o=Math.min(...e);t.startPoint.limitX.x2=o}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=A(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...i?{time:e}:{data:{...t.origin.data,time:e}}};u.value.discardActiveObject(),x("change",r),n&&F(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(y.point={x:t.left,y:t.top},y.show=!0,y.target=t,y.list=g.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function R(t){v.isTarget=!0,v.show=!0;const{key:e,data:o={}}=t.origin||{};let i=o.value;const n="extracorporealCirculation"===e||"mark"===e;v.point={x:t.left,y:n?t.top:t.top+D/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=A(r);v.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(i=o.name),v.list.unshift(i+" ")),v.sourceData=[{type:"other",key:e,time:a,value:i}]}function U(t,e){const{shadowObjs:o,params:i}=t[`${e}ShadowBox`]||{};if(!o||!i)return;o.forEach((t=>u.value.remove(t)));i["left"===e?1:0]=t.left;const n=tt(...i);t[`${e}ShadowBox`]={shadowObjs:n,params:i}}function Z(t){return t>=O&&t<=I}function tt(...e){const[o,i,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),d=[[o,Y],[i,Y],[i,r],[o,r]],h=new t.Polygon(d.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),p=[];return["slash"].includes(l)&&p.push(...S(d,s.angle,s.space,c)),u.value.add(h,...p),V.get("extracorporealCirculation").push(h,...p),[h,...p]}function et(){if(!_)return;const{dataList:e,ascendAortaStyle:o,extracorporealCirculationStyle:i}=G.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";V.set(n,[]);const r=Y+_;let a,l;function s(t){return t&&t>O&&t<M}function c(t){return void 0===t||""===t}e.forEach(((d,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:o,openAscendAorta:i,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=b(e.time)),o&&(a=b(o.time)),i&&(l=b(i.time)),n&&(s=b(n.time)),[r,a,l,s]}(d);if(-1===h.findIndex((t=>t>0&&t<M)))return;let m;h.forEach(((g,x)=>{if(c(g))return;const v=h[x+1],y=h[x-1];if(s(g)||s(v)){const k=s(g)?g:O,C=s(v)?v:c(v)?null:I,w=s(y)?y:O,X={};if(x<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(x)?i:o],X.shadowObjs=tt(...X.params)),s(g)){const o=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(x),i=p(new Date,"yyyy-MM-dd HH:mm"),c=b(i),v=g<c&&s(c)?c:g,y=function(e,o){const i=new t.Line(e,{...o,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return Q(i),u.value.add(i),V.get("extracorporealCirculation").push(i),i}([g,Y,g,r],{origin:{dataIndex:f,dataKey:o,key:n,data:d[o],type:"other"},limitX:{x1:0===x?null!=a?a:O:w,x2:C||v,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(x)?{leftShadowBox:m}:{},...[0,1,2].includes(x)?{rightShadowBox:X}:{}});x===h.length-1&&(a=g,l=y),0===x&&l&&(l.limitX.x2=k)}m=X}}))}))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,o=b(t),n=i([o,0,o,Y],e);u.value.add(n)}(),function(){var t;if(!(null==(t=null==G?void 0:G.horizontal)?void 0:t.length))return;const{horizontal:o}=G,i=O-5;let n=W+z/2;o.forEach(((t,o)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:i,top:n,origin:{defaultAddValue:l,dataIndex:o,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:i,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),P(c)?R(c):v.show=!1})),c.on("mouseup:before",(t=>{if(v.show=!1,0===t.e.button&&P(c))if(j(V.get("horizontal"),c.left,"key",H).includes(c.origin.key))E("repeat"),console.log("重复节点");else{const t={data:{time:A(c.left),value:c.origin.defaultAddValue},...c.origin};x("add",f(t,["isMenu"])),F(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),u.value.add(s),n+=z}))}(),K(),q(),N(),et(),a.on((()=>{const t="horizontal",e=C(V.get(t));e.length>0?w((()=>{const o=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:o}=e.origin;return t[o]=t[o]?t[o].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const o=e[t];return G.horizontal[t].data.splice(o[0].index,o.length),o})))}(e);J({key:t}),x("remove",o)})):X()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o,_type:i}=t,n={...e.origin,type:i};x(o,n),"remove"===o&&F(n,o)}}}export{x as useOther};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as o,openBlock as s,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as l,createVNode as c,withCtx as u,Fragment as m,renderList as d,toDisplayString as p,createCommentVNode as g,createBlock as f,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as w,NAvatar as k,NImage as _,NIcon as C,NSpace as x,NButtonGroup as I,NTooltip as L}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import{isAudioOrVideoMessage as z,simplifyMessage as D,getAVTime as H,downloadFile as R}from"../utils/index.js";import{first as B,last as N,toString as O}from"lodash-es";import"trtc-sdk-v5";import P from"./PersonProfile.vue.js";import q from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},oe=["data-time"],se=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],le=["innerHTML"],ce=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:pe,setMsgList:ge,relayMessage:fe,setCurrentSessionItem:ve,isGroupChat:ye}=b(),he=t(),Te=t(!1),Me=t({left:0,top:0}),we=t(),ke=t(),_e={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function xe({nodes:e}){var t,n;const{_ctx:o}=null==(t=e.download)?void 0:t.children,s=o?null==(n=null==o?void 0:o.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,c(L,null,{trigger:()=>c(C,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>s&&R(s,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}async function Ie(){try{if(!_e.hasMore)return;_e.page++;const e=await E({sessionKey:pe.currentSessionItem.sessionKey,page:_e.page,lastSendTime:_e.lastSendTime});if(!Array.isArray(e)||0===e.length)return _e.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=B(e).id;_e.lastSendTime=N(e).sendTime,ge(_e.page>1?[...pe.msgList,...e]:e),1===_e.page&&pe.currentSessionItem.unreadNum&&(await S({chatType:pe.currentSessionItem.chatType,messageIdSet:[t],receiver:pe.userInfo.id,sender:pe.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Le(e,t){we.value=t,async function(e){var t,n,o,s,i,r;Te.value=!0,await T();const{clientX:a,clientY:l}=e,{width:c=0,height:u=0,left:m=0,top:d=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},p=null!=(s=null==(o=null==(n=he.value)?void 0:n.$el)?void 0:o.getBoundingClientRect().height)?s:220,g=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,f=5,v={};a<=m+c/2?v.left=a-m+f+"px":v.right=m+c-a-f+"px";l-d<p/2?v.top=g+f+"px":d+u-l<=p/2?v.bottom=Math.abs(g)+f+"px":v.top=g+l-d-p/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===pe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[A.TEXT,A.EMOJI].includes(t)}function Se(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===A.BLEND){const e=O(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[A.TEXT,A.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,o=O(n).match(/<img[^>]*>/gi);return t===A.BLEND&&o&&o.length}function Ae(e,t){var n,o;const{chatMessageType:s,messageTemplate:i}=e.content;if(s===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(o=null==i?void 0:i.setting)?void 0:o.style.id)}function ze(e){var t,n;const{chatMessageType:o,messageTemplate:s}=e;return o===A.TEMPLATE&&3==(null==(n=null==(t=null==s?void 0:s.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const o=new Date(e.sendTime).getTime(),s=null==(n=pe.msgList[t+1])?void 0:n.sendTime;if(s){return o-new Date(s).getTime()>3e5}return!0}function He(e){pe.currentReferenceMsg=e,pe.currentReferenceMsg.content.referenceContent=null,Object.assign(pe.currentReferenceMsg,{chatType:pe.currentSessionItem.chatType,receiver:pe.currentSessionItem.receiver,receiverAvatar:pe.currentSessionItem.avatar,receiverName:pe.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=ke.value)||n.click()):He(t)}function Be(e,t){const n=pe.msgList.find((e=>e.id===we.value));fe({checkedIds:e,remark:t,content:n.content})}return Q(de,(()=>{Ie()}),"top",(()=>{Te.value=!1})),o((()=>pe.id),(e=>{e&&(pe.currentReferenceMsg=null,Object.assign(_e,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Ie())}),{immediate:!0}),o((()=>pe.isAppendMsg),(e=>{e&&(ge([pe.currentMsg,...pe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),pe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>{var n;return s(),i("div",{class:r(["chat-main",{"home-bg":!a(pe).id}]),ref_key:"chatMainRef",ref:de,style:l(a(Ce))},[c(a(M),{"show-toolbar-tooltip":"","render-toolbar":xe},{default:u((()=>[(s(!0),i(m,null,d(a(pe).msgList,((e,t)=>{var n,o;return s(),i(m,{key:e.id},[je(e)?(s(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(pe).userInfo.id}])},[De(e,t)?(s(),i("p",V,p(e.__sendTime),1)):g("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(s(),i(m,{key:1},[Ae(e,"system")?(s(),f(q,{key:0,data:e},null,8,["data"])):g("v-if",!0),"WITHDRAWN"===e.status?(s(),i("p",Z,[v("span",null,p(e.sender==a(pe).userInfo.id?(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.67"))||"你":e.senderName)+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.68"))||"撤回了一条消息"),1),Ee(e)?(s(),f(a(w),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){pe.currentReEditMsg=e}(e)},{default:u((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):g("v-if",!0)])):g("v-if",!0)],64)):(s(),i("div",ee,[c(P,{"user-id":e.sender,placement:e.sender==a(pe).userInfo.id?"left":"right"},{trigger:u((()=>[c(a(k),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(s(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},p(a(ye)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(A).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(A).TEMPLATE,"template--3":ze(e.content),"audio-video":a(z)(e.content),file:e.content.chatMessageType===a(A).FILE}]),onContextmenu:h((t=>Le(t,e.id)),["prevent"])},[Se(e)?(s(),i(m,{key:0},[e.content.referenceContent?(s(),i("div",ie,[v("span",null,p(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):g("v-if",!0),e.content.chatMessageType===a(A).EMOJI?(s(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(s(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):g("v-if",!0),be(e)?(s(),i("pre",{key:1,innerHTML:e.__content},null,8,ce)):g("v-if",!0),Ae(e,"template")?(s(),f(q,{key:2,data:e},null,8,["data"])):g("v-if",!0),e.content.chatMessageType===a(A).IMAGE?(s(),f(a(_),{key:3,width:"240",src:e.__content},null,8,["src"])):g("v-if",!0),a(z)(e.content)?(s(),i(m,{key:4},[c(a(C),{class:r({"is-audio":e.content.chatMessageType===a(A).AUDIO}),component:e.content.chatMessageType===a(A).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,p(a(H)(e.__content)),1)],64)):g("v-if",!0),e.content.chatMessageType===a(A).FILE?(s(),f(a(x),{key:5,"wrap-item":!1},{default:u((()=>[c(a(C),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),c(a(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,p(e.__content),1),v("span",me,p(e.__size),1)])),_:2},1024)])),_:2},1024)):g("v-if",!0),c(a(I),{class:"quick-menu"},{default:u((()=>[a(z)(e.content)?g("v-if",!0):(s(),i(m,{key:0},[g(' <n-button quaternary size="tiny">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),c(a(w),{quaternary:"",size:"tiny",onClick:()=>He(e)},{icon:u((()=>[c(a(C),{size:"17",component:a(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),c(a(w),{quaternary:"",size:"tiny",onClick:t=>Le(t,e.id)},{icon:u((()=>[c(a(C),{size:"14",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,se)])):g("v-if",!0)]))],2)):g("v-if",!0)],64)})),128))])),_:1}),c(a(W),{ref_key:"contextmenuRef",ref:he,show:Te.value,"onUpdate:show":t[0]||(t[0]=e=>Te.value=e),position:Me.value,id:we.value,onSelect:Re},null,8,["show","position","id"]),c(U,{title:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:Be},{trigger:u((()=>{var e;return[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:ke},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1})],6)}}});export{de as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as o,openBlock as s,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as l,createVNode as c,withCtx as u,Fragment as m,renderList as d,toDisplayString as p,createCommentVNode as g,createBlock as f,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as w,NAvatar as k,NImage as _,NIcon as C,NSpace as x,NButtonGroup as I,NTooltip as L}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import{isAudioOrVideoMessage as z,simplifyMessage as D,getAVTime as H,downloadFile as R}from"../utils/index.js";import{first as B,last as N,toString as O}from"lodash-es";import"trtc-sdk-v5";import P from"./PersonProfile.vue.js";import q from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},oe=["data-time"],se=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],le=["innerHTML"],ce=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:pe,setMsgList:ge,relayMessage:fe,setCurrentSessionItem:ve,isGroupChat:ye}=b(),he=t(),Te=t(!1),Me=t({left:0,top:0}),we=t(),ke=t(),_e={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function xe({nodes:e}){var t,n;const{_ctx:o}=null==(t=e.download)?void 0:t.children,s=o?null==(n=null==o?void 0:o.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,c(L,null,{trigger:()=>c(C,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>s&&R(s,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}async function Ie(){try{if(!_e.hasMore)return;_e.page++;const e=await E({sessionKey:pe.currentSessionItem.sessionKey,page:_e.page,lastSendTime:_e.lastSendTime});if(!Array.isArray(e)||0===e.length)return _e.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=B(e).id;_e.lastSendTime=N(e).sendTime,ge(_e.page>1?[...pe.msgList,...e]:e),1===_e.page&&pe.currentSessionItem.unreadNum&&(await S({chatType:pe.currentSessionItem.chatType,messageIdSet:[t],receiver:pe.userInfo.id,sender:pe.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Le(e,t){we.value=t,async function(e){var t,n,o,s,i,r;Te.value=!0,await T();const{clientX:a,clientY:l}=e,{width:c=0,height:u=0,left:m=0,top:d=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},p=null!=(s=null==(o=null==(n=he.value)?void 0:n.$el)?void 0:o.getBoundingClientRect().height)?s:220,g=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,f=5,v={};a<=m+c/2?v.left=a-m+f+"px":v.right=m+c-a-f+"px";l-d<p/2?v.top=g+f+"px":d+u-l<=p/2?v.bottom=Math.abs(g)+f+"px":v.top=g+l-d-p/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===pe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[A.TEXT,A.EMOJI].includes(t)}function Se(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===A.BLEND){const e=O(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[A.TEXT,A.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,o=O(n).match(/<img[^>]*>/gi);return t===A.BLEND&&o&&o.length}function Ae(e,t){var n,o;const{chatMessageType:s,messageTemplate:i}=e.content;if(s===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(o=null==i?void 0:i.setting)?void 0:o.style.id)}function ze(e){var t,n;const{chatMessageType:o,messageTemplate:s}=e;return o===A.TEMPLATE&&3==(null==(n=null==(t=null==s?void 0:s.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const o=new Date(e.sendTime).getTime(),s=null==(n=pe.msgList[t+1])?void 0:n.sendTime;if(s){return o-new Date(s).getTime()>3e5}return!0}function He(e){pe.currentReferenceMsg=e,pe.currentReferenceMsg.content.referenceContent=null,Object.assign(pe.currentReferenceMsg,{chatType:pe.currentSessionItem.chatType,receiver:pe.currentSessionItem.receiver,receiverAvatar:pe.currentSessionItem.avatar,receiverName:pe.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=ke.value)||n.click()):He(t)}function Be(e,t){const n=pe.msgList.find((e=>e.id===we.value));fe({checkedIds:e,remark:t,content:n.content})}return Q(de,(()=>{Ie()}),"top",(()=>{Te.value=!1})),o((()=>pe.id),(e=>{e&&(pe.currentReferenceMsg=null,Object.assign(_e,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Ie())}),{immediate:!0}),o((()=>pe.isAppendMsg),(e=>{e&&(ge([pe.currentMsg,...pe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),pe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>{var n;return s(),i("div",{class:r(["chat-main",{"home-bg":!a(pe).id}]),ref_key:"chatMainRef",ref:de,style:l(a(Ce))},[c(a(M),{"show-toolbar-tooltip":"","render-toolbar":xe},{default:u((()=>[(s(!0),i(m,null,d(a(pe).msgList,((e,t)=>{var n,o;return s(),i(m,{key:e.id},[je(e)?(s(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(pe).userInfo.id}])},[De(e,t)?(s(),i("p",V,p(e.__sendTime),1)):g("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(s(),i(m,{key:1},[Ae(e,"system")?(s(),f(q,{key:0,data:e},null,8,["data"])):g("v-if",!0),"WITHDRAWN"===e.status?(s(),i("p",Z,[v("span",null,p(e.sender==a(pe).userInfo.id?(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.67"))||"你":e.senderName)+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.68"))||"撤回了一条消息"),1),Ee(e)?(s(),f(a(w),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){pe.currentReEditMsg=e}(e)},{default:u((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):g("v-if",!0)])):g("v-if",!0)],64)):(s(),i("div",ee,[c(P,{"user-id":e.sender,placement:e.sender==a(pe).userInfo.id?"left":"right"},{trigger:u((()=>[c(a(k),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(s(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},p(a(ye)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(A).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(A).TEMPLATE,"template--3":ze(e.content),"audio-video":a(z)(e.content),file:e.content.chatMessageType===a(A).FILE}]),onContextmenu:h((t=>Le(t,e.id)),["prevent"])},[Se(e)?(s(),i(m,{key:0},[e.content.referenceContent?(s(),i("div",ie,[v("span",null,p(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):g("v-if",!0),e.content.chatMessageType===a(A).EMOJI?(s(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(s(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):g("v-if",!0),be(e)?(s(),i("pre",{key:1,innerHTML:e.__content},null,8,ce)):g("v-if",!0),Ae(e,"template")?(s(),f(q,{key:2,data:e},null,8,["data"])):g("v-if",!0),e.content.chatMessageType===a(A).IMAGE?(s(),f(a(_),{key:3,width:"240",src:e.__content},null,8,["src"])):g("v-if",!0),a(z)(e.content)?(s(),i(m,{key:4},[c(a(C),{class:r({"is-audio":e.content.chatMessageType===a(A).AUDIO}),component:e.content.chatMessageType===a(A).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,p(a(H)(e.__content)),1)],64)):g("v-if",!0),e.content.chatMessageType===a(A).FILE?(s(),f(a(x),{key:5,"wrap-item":!1},{default:u((()=>[c(a(C),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),c(a(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,p(e.__content),1),v("span",me,p(e.__size),1)])),_:2},1024)])),_:2},1024)):g("v-if",!0),c(a(I),{class:"quick-menu"},{default:u((()=>[a(z)(e.content)?g("v-if",!0):(s(),i(m,{key:0},[g(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),c(a(w),{quaternary:"",size:"tiny",onClick:()=>He(e)},{icon:u((()=>[c(a(C),{size:"17",component:a(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),c(a(w),{quaternary:"",size:"tiny",onClick:t=>Le(t,e.id)},{icon:u((()=>[c(a(C),{size:"14",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,se)])):g("v-if",!0)]))],2)):g("v-if",!0)],64)})),128))])),_:1}),c(a(W),{ref_key:"contextmenuRef",ref:he,show:Te.value,"onUpdate:show":t[0]||(t[0]=e=>Te.value=e),position:Me.value,id:we.value,onSelect:Re},null,8,["show","position","id"]),c(U,{title:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:Be},{trigger:u((()=>{var e;return[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:ke},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1})],6)}}});export{de as default};
@@ -1 +1 @@
1
- import{createElementVNode as e,defineComponent as o,ref as t,computed as n,onBeforeUnmount as l,openBlock as i,createElementBlock as a,withDirectives as s,toDisplayString as r,unref as d,vShow as c,createVNode as u,withCtx as m,Fragment as p,renderList as v,createCommentVNode as g,createTextVNode as w,nextTick as f}from"vue";import{NButton as h,NIcon as y}from"naive-ui";import k from"./ChatAdd.vue.js";import{Close as I,Mic as b,MicOff as A,Videocam as C,VideocamOff as V,Call as M,PersonAdd as _}from"@vicons/ionicons5";import{getUserDetailApi as x}from"../api/index.js";import"@vueuse/core";import{$message as L}from"../utils/index.js";import{xorBy as R}from"lodash-es";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as T}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as B}from"../hooks/useVideo.js";import j from"trtc-sdk-v5";var S,$,H,U,z,N;const P={class:"video-wrapper video-wrapper--multiple"},D={class:"video-header"},O={key:0,class:"video-main"},Y={class:"video-main__left"},q=["data-name"],G={class:"video-bottom"},F={class:"btn-group"},J={class:"btn"},K=e("span",{class:"text"},(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.104"))||"静音",-1),Q={class:"btn"},W=e("span",{class:"text"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.105"))||"摄像头",-1),X=e("span",{class:"text"},(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.106"))||"结束会诊",-1),Z={class:"btn"},ee=e("span",{class:"text"},(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.107"))||"添加参会人",-1),oe={class:"video-main__right"},te=["id","data-name"],ne={class:"user"},le={class:"name"},ie={key:0,class:"tip"},ae={key:0,class:"calling-box"},se={key:1,class:"opt-btn"},re={class:"btn"},de=e("span",null,(null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.113"))||"拒接",-1),ce={class:"btn"},ue=e("span",null,(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.114"))||"接听",-1);var me=o({__name:"MultipleVideo",setup(o){const S=t(),$=t([]),{state:H,sendMessage:U,trtc:z,trtcProxy:N,voiceOpen:me,isAudio:pe,isCall:ve,startTimer:ge,resetTimer:we,toggleAudio:fe,messageTypeText:he,timing:ye,toggleVideo:ke,videocamOpen:Ie,installEventHandlers:be,uninstallEventHandlers:Ae}=B(),Ce=t(!1),Ve=n((()=>ve.value?H.userInfo.name:H.currentAVMsg.sendName)),Me=n((()=>{if(!Ce.value)return"";const e=ve.value?`(${$.value.length+1}/${H.currentAVMsg.checkedIds.length+1})`:"";return`${Ve.value}发起的${he.value}会诊${e} ${ye.value}`}));function _e(e){console.log("checkedIds :>> ",e),H.currentAVMsg.checkedIds.push(...e),xe()}function xe(){var e;(null==(e=H.currentAVMsg.checkedIds)?void 0:e.length)&&H.currentAVMsg.checkedIds.forEach((e=>{U({chatType:E.SINGLE,content:{msg:H.currentAVMsg.chatMessageType+","+H.currentAVMsg.strRoomId,chatMessageType:T.AV_STATUS},receiver:e})})),Ce.value||Le()}async function Le(){const e=await j.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(H.showMultipleVideo=!1);try{if(await z.enterRoom({strRoomId:H.currentAVMsg.strRoomId,sdkAppId:parseInt(H.userInfo.sdkAppID),userId:H.userInfo.id,userSig:H.userInfo.userSig,proxy:N.value}),Ce.value=!0,ge(),be({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.startLocalAudio(),pe.value)return;await z.startLocalVideo({view:S.value})}catch(e){console.log("error :>> ",e),L.error(e),H.showMultipleVideo=!1}}async function Re(){try{if(H.showMultipleVideo=!1,Ae({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.exitRoom(),await z.stopLocalAudio(),pe.value)return;await z.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Ee(e){const{userId:o,streamType:t}=e;try{t===j.TYPE.STREAM_TYPE_MAIN&&(await f(),await z.startRemoteVideo({userId:o,streamType:t,view:o}))}catch(e){console.log("error :>> ",e)}}async function Te(e){var o;const{userId:t}=e;if(t&&!(null==(o=$.value.map((e=>e.id)))?void 0:o.includes(t))){const e=await je(t);$.value.push({id:t,name:e})}}async function Be(e){const{userId:o}=e,t=await je(o);$.value.push({id:o,name:t}),ge()}async function je(e){const o=await x({userId:e});return(null==o?void 0:o.name)||""}function Se(e){console.log("event :>> 退房",e);const{userId:o}=e;$.value=R($.value,[{id:o,name:""}],"id")}function $e(e){console.log("error :>> ",e),H.showMultipleVideo=!1}return l((()=>{Re()})),(o,t)=>{var n,l,f,x,L,R;return i(),a("div",P,[e("div",D,[s(e("span",{class:"title"},r(d(Me)),513),[[c,Ce.value]]),u(d(h),{quaternary:"",circle:"",color:"#ffffffcc",onClick:Re},{icon:m((()=>[u(d(y),{component:d(I)},null,8,["component"])])),_:1})]),Ce.value?(i(),a("div",O,[e("div",Y,[e("div",{ref_key:"selfVideoRef",ref:S,class:"video-view","data-name":d(H).userInfo.name},null,8,q),e("div",G,[e("div",F,[e("div",J,[u(d(h),{text:"",color:d(me)?"#fff":"#000",onClick:d(fe)},{icon:m((()=>[u(d(y),{component:d(me)?d(b):d(A)},null,8,["component"])])),_:1},8,["color","onClick"]),K]),e("div",Q,[u(d(h),{text:"",color:d(Ie)?"#fff":"#000",disabled:d(pe),onClick:d(ke)},{icon:m((()=>[u(d(y),{component:d(Ie)?d(C):d(V)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),W]),e("div",{class:"btn",onClick:Re},[u(d(h),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:m((()=>[u(d(y),{component:d(M)},null,8,["component"])])),_:1}),X]),u(k,{onComfirm:_e},{trigger:m((()=>[e("div",Z,[u(d(h),{text:"",color:"#fff"},{icon:m((()=>[u(d(y),{component:d(_)},null,8,["component"])])),_:1}),ee])])),_:1})])])]),e("div",oe,[(i(!0),a(p,null,v($.value,(e=>(i(),a("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,te)))),128))])])):(i(),a(p,{key:1},[e("div",ne,[e("span",le,r(d(Ve))+((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.108"))||"发起的")+r(d(he))+((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.109"))||"会议"),1),d(ve)?g("v-if",!0):(i(),a("span",ie,((null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.110"))||"邀请你加入")+r(d(he))+((null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.109"))||"会议"),1))]),d(ve)?(i(),a("div",ae,[u(k,{onComfirm:_e,disabledIds:d(H).currentAVMsg.checkedIds},{trigger:m((()=>[u(d(h),{size:"large",circle:"",color:"#000"},{icon:m((()=>[u(d(y),{component:d(_)},null,8,["component"])])),_:1})])),_:1},8,["disabledIds"]),e("p",null,((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.111"))||"已邀请共")+r(d(H).currentAVMsg.checkedIds.length)+((null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.40"))||"人"),1),u(d(h),{size:"large",strong:"",round:"",type:"primary",onClick:xe},{default:m((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.112"))||"开始会诊")]})),_:1}),g(' <div class="btn-box">\r\n\t\t\t\t\t\t<n-button color="#000" round>\r\n\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t<n-icon :component="Mic" />\r\n\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t<n-button color="#000" round>\r\n\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t<n-icon :component="Videocam" />\r\n\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t</div> ')])):(i(),a("div",se,[e("div",re,[u(d(h),{circle:"",color:"#f17568",class:"btn--rotate",onClick:t[0]||(t[0]=()=>d(H).showMultipleVideo=!1)},{icon:m((()=>[u(d(y),{size:"30",component:d(M)},null,8,["component"])])),_:1}),de]),e("div",ce,[u(d(h),{circle:"",color:"#2ac98b",onClick:Le},{icon:m((()=>[u(d(y),{size:"30",component:d(M)},null,8,["component"])])),_:1}),ue])]))],64))])}}});export{me as default};
1
+ import{createElementVNode as e,defineComponent as o,ref as t,computed as n,onBeforeUnmount as l,openBlock as i,createElementBlock as a,withDirectives as s,toDisplayString as d,unref as c,vShow as r,createVNode as u,withCtx as m,Fragment as p,renderList as v,createCommentVNode as g,createTextVNode as w,nextTick as f}from"vue";import{NButton as h,NIcon as y}from"naive-ui";import k from"./ChatAdd.vue.js";import{Close as I,Mic as b,MicOff as A,Videocam as C,VideocamOff as V,Call as M,PersonAdd as _}from"@vicons/ionicons5";import{getUserDetailApi as x}from"../api/index.js";import"@vueuse/core";import{$message as L}from"../utils/index.js";import{xorBy as R}from"lodash-es";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as T}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as B}from"../hooks/useVideo.js";import j from"trtc-sdk-v5";var S,$,H,U,z,N;const P={class:"video-wrapper video-wrapper--multiple"},D={class:"video-header"},O={key:0,class:"video-main"},Y={class:"video-main__left"},q=["data-name"],G={class:"video-bottom"},F={class:"btn-group"},J={class:"btn"},K=e("span",{class:"text"},(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.104"))||"静音",-1),Q={class:"btn"},W=e("span",{class:"text"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.105"))||"摄像头",-1),X=e("span",{class:"text"},(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.106"))||"结束会诊",-1),Z={class:"btn"},ee=e("span",{class:"text"},(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.107"))||"添加参会人",-1),oe={class:"video-main__right"},te=["id","data-name"],ne={class:"user"},le={class:"name"},ie={key:0,class:"tip"},ae={key:0,class:"calling-box"},se={key:1,class:"opt-btn"},de={class:"btn"},ce=e("span",null,(null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.113"))||"拒接",-1),re={class:"btn"},ue=e("span",null,(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.114"))||"接听",-1);var me=o({__name:"MultipleVideo",setup(o){const S=t(),$=t([]),{state:H,sendMessage:U,trtc:z,trtcProxy:N,voiceOpen:me,isAudio:pe,isCall:ve,startTimer:ge,resetTimer:we,toggleAudio:fe,messageTypeText:he,timing:ye,toggleVideo:ke,videocamOpen:Ie,installEventHandlers:be,uninstallEventHandlers:Ae}=B(),Ce=t(!1),Ve=n((()=>ve.value?H.userInfo.name:H.currentAVMsg.sendName)),Me=n((()=>{if(!Ce.value)return"";const e=ve.value?`(${$.value.length+1}/${H.currentAVMsg.checkedIds.length+1})`:"";return`${Ve.value}发起的${he.value}会诊${e} ${ye.value}`}));function _e(e){console.log("checkedIds :>> ",e),H.currentAVMsg.checkedIds.push(...e),xe()}function xe(){var e;(null==(e=H.currentAVMsg.checkedIds)?void 0:e.length)&&H.currentAVMsg.checkedIds.forEach((e=>{U({chatType:E.SINGLE,content:{msg:H.currentAVMsg.chatMessageType+","+H.currentAVMsg.strRoomId,chatMessageType:T.AV_STATUS},receiver:e})})),Ce.value||Le()}async function Le(){const e=await j.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(H.showMultipleVideo=!1);try{if(await z.enterRoom({strRoomId:H.currentAVMsg.strRoomId,sdkAppId:parseInt(H.userInfo.sdkAppID),userId:H.userInfo.id,userSig:H.userInfo.userSig,proxy:N.value}),Ce.value=!0,ge(),be({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.startLocalAudio(),pe.value)return;await z.startLocalVideo({view:S.value})}catch(e){console.log("error :>> ",e),L.error(e),H.showMultipleVideo=!1}}async function Re(){try{if(H.showMultipleVideo=!1,Ae({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.exitRoom(),await z.stopLocalAudio(),pe.value)return;await z.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Ee(e){const{userId:o,streamType:t}=e;try{t===j.TYPE.STREAM_TYPE_MAIN&&(await f(),await z.startRemoteVideo({userId:o,streamType:t,view:o}))}catch(e){console.log("error :>> ",e)}}async function Te(e){var o;const{userId:t}=e;if(t&&!(null==(o=$.value.map((e=>e.id)))?void 0:o.includes(t))){const e=await je(t);$.value.push({id:t,name:e})}}async function Be(e){const{userId:o}=e,t=await je(o);$.value.push({id:o,name:t}),ge()}async function je(e){const o=await x({userId:e});return(null==o?void 0:o.name)||""}function Se(e){console.log("event :>> 退房",e);const{userId:o}=e;$.value=R($.value,[{id:o,name:""}],"id")}function $e(e){console.log("error :>> ",e),H.showMultipleVideo=!1}return l((()=>{Re()})),(o,t)=>{var n,l,f,x,L,R;return i(),a("div",P,[e("div",D,[s(e("span",{class:"title"},d(c(Me)),513),[[r,Ce.value]]),u(c(h),{quaternary:"",circle:"",color:"#ffffffcc",onClick:Re},{icon:m((()=>[u(c(y),{component:c(I)},null,8,["component"])])),_:1})]),Ce.value?(i(),a("div",O,[e("div",Y,[e("div",{ref_key:"selfVideoRef",ref:S,class:"video-view","data-name":c(H).userInfo.name},null,8,q),e("div",G,[e("div",F,[e("div",J,[u(c(h),{text:"",color:c(me)?"#fff":"#000",onClick:c(fe)},{icon:m((()=>[u(c(y),{component:c(me)?c(b):c(A)},null,8,["component"])])),_:1},8,["color","onClick"]),K]),e("div",Q,[u(c(h),{text:"",color:c(Ie)?"#fff":"#000",disabled:c(pe),onClick:c(ke)},{icon:m((()=>[u(c(y),{component:c(Ie)?c(C):c(V)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),W]),e("div",{class:"btn",onClick:Re},[u(c(h),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:m((()=>[u(c(y),{component:c(M)},null,8,["component"])])),_:1}),X]),u(k,{onComfirm:_e},{trigger:m((()=>[e("div",Z,[u(c(h),{text:"",color:"#fff"},{icon:m((()=>[u(c(y),{component:c(_)},null,8,["component"])])),_:1}),ee])])),_:1})])])]),e("div",oe,[(i(!0),a(p,null,v($.value,(e=>(i(),a("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,te)))),128))])])):(i(),a(p,{key:1},[e("div",ne,[e("span",le,d(c(Ve))+((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.108"))||"发起的")+d(c(he))+((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.109"))||"会议"),1),c(ve)?g("v-if",!0):(i(),a("span",ie,((null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.110"))||"邀请你加入")+d(c(he))+((null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.109"))||"会议"),1))]),c(ve)?(i(),a("div",ae,[u(k,{onComfirm:_e,disabledIds:c(H).currentAVMsg.checkedIds},{trigger:m((()=>[u(c(h),{size:"large",circle:"",color:"#000"},{icon:m((()=>[u(c(y),{component:c(_)},null,8,["component"])])),_:1})])),_:1},8,["disabledIds"]),e("p",null,((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.111"))||"已邀请共")+d(c(H).currentAVMsg.checkedIds.length)+((null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.40"))||"人"),1),u(c(h),{size:"large",strong:"",round:"",type:"primary",onClick:xe},{default:m((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.112"))||"开始会诊")]})),_:1}),g(' <div class="btn-box">\n\t\t\t\t\t\t<n-button color="#000" round>\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<n-icon :component="Mic" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t<n-button color="#000" round>\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<n-icon :component="Videocam" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</n-button>\n\t\t\t\t\t</div> ')])):(i(),a("div",se,[e("div",de,[u(c(h),{circle:"",color:"#f17568",class:"btn--rotate",onClick:t[0]||(t[0]=()=>c(H).showMultipleVideo=!1)},{icon:m((()=>[u(c(y),{size:"30",component:c(M)},null,8,["component"])])),_:1}),ce]),e("div",re,[u(c(h),{circle:"",color:"#2ac98b",onClick:Le},{icon:m((()=>[u(c(y),{size:"30",component:c(M)},null,8,["component"])])),_:1}),ue])]))],64))])}}});export{me as default};
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as l,computed as n,openBlock as o,createBlock as a,unref as i,withCtx as r,renderSlot as s,createElementBlock as d,Fragment as c,withDirectives as u,createElementVNode as p,createVNode as v,createCommentVNode as g,toDisplayString as m,createTextVNode as w,renderList as y,vShow as f}from"vue";import{NPopover as k,NAvatar as h,NButton as b,NIcon as C}from"naive-ui";import{ChatbubbleEllipses as j,EyeOffOutline as L,EyeOutline as B,Close as I}from"@vicons/ionicons5";import{useData as _}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as x}from"../constants/index.js";import{openSessionApi as z,getUserDetailApi as N}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";const D={class:"person-profile-main"},S={class:"left"},$={class:"profile"},E={class:"profile__text"},P={class:"right"},q={class:"right__content"},G={class:"label"},O={class:"content"};var T=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:T}){var U,A,F,H,J,K,M,Q;const R=t,{state:V,openSession:W}=_(),X=e(!1),Y=e(!1),Z=e(!1),tt=l({}),et=[{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.115"))||"机构",value:"",key:"orgName"},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.116"))||"姓名",value:"",key:"name"},{label:(null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.117"))||"归属科室",value:"",key:"deptName"},{label:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.118"))||"业务科室",value:"",key:"businessDeptNames"},{label:(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.119"))||"手机号",value:"",key:"phone"},{label:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.120"))||"岗位",value:"",key:"post"},{label:(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.121"))||"工号",value:"",key:"jobId"},{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.122"))||"性别",value:"",key:"orgName"}],lt=n((()=>(tt.id&&et.forEach((t=>{const{key:e}=t;t.value=tt[e]})),et)));async function nt(){X.value=!1;let t=V.sessionList.find((t=>t.receiver===R.userId));if(!t)try{t=await z({chatType:x.SINGLE,receiver:R.userId,sender:V.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&W(t),T("close")}async function ot(t){if(!t)return;const e=await N({userId:R.userId});(null==e?void 0:e.id)?Object.assign(tt,e):tt.id=""}function at(t){const{key:e,value:l}=t;return"phone"!==e||Z.value?l:(l||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,l)=>(o(),a(i(k),{raw:"",class:"person-profile-wrapper",show:X.value,"onUpdate:show":[l[3]||(l[3]=t=>X.value=t),ot],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:r((()=>[s(e.$slots,"trigger")])),default:r((()=>[tt.id?(o(),d(c,{key:0},[u(p("div",D,[p("div",S,[p("div",$,[v(i(h),{src:tt.avatar,bordered:"",round:"",size:100,onClickCapture:l[0]||(l[0]=t=>Y.value=!0)},null,8,["src"]),g(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",E,[p("h4",null,m(tt.name),1),p("p",null,m(tt.orgName),1)]),v(i(b),{strong:"",secondary:"",onClick:nt},{default:r((()=>[v(i(C),{size:"13",color:"#666666",component:i(j),style:{"margin-right":"6px"}},null,8,["component"]),w(" 发消息 ")])),_:1})])]),p("div",P,[p("div",q,[(o(!0),d(c,null,y(i(lt),((t,e)=>(o(),d("div",{class:"info-item",key:e},[p("span",G,m(t.label),1),p("div",O,[p("span",null,m(at(t)),1),"phone"===t.key&&at(t)?(o(),a(i(C),{key:0,size:"16",color:"#666666",component:Z.value?i(L):i(B),style:{"margin-left":"10px"},onClick:l[1]||(l[1]=t=>Z.value=!Z.value)},null,8,["component"])):g("v-if",!0)])])))),128))])])],512),[[f,!Y.value]]),u(p("div",{class:"large-avatar",onClick:l[2]||(l[2]=t=>Y.value=!1)},[v(i(b),{circle:"",size:"small",secondary:""},{icon:r((()=>[v(i(C),{size:24,component:i(I),color:"#fff"},null,8,["component"])])),_:1}),v(i(h),{size:310,round:"",src:tt.avatar},null,8,["src"])],512),[[f,Y.value]])],64)):g("v-if",!0)])),_:3},8,["show","trigger"]))}});export{T as default};
1
+ import{defineComponent as t,ref as e,reactive as l,computed as n,openBlock as o,createBlock as a,unref as i,withCtx as s,renderSlot as r,createElementBlock as d,Fragment as c,withDirectives as u,createElementVNode as p,createVNode as v,createCommentVNode as g,toDisplayString as m,createTextVNode as w,renderList as y,vShow as f}from"vue";import{NPopover as k,NAvatar as h,NButton as b,NIcon as C}from"naive-ui";import{ChatbubbleEllipses as j,EyeOffOutline as L,EyeOutline as B,Close as I}from"@vicons/ionicons5";import{useData as _}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as x}from"../constants/index.js";import{openSessionApi as z,getUserDetailApi as N}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";const D={class:"person-profile-main"},S={class:"left"},$={class:"profile"},E={class:"profile__text"},P={class:"right"},q={class:"right__content"},G={class:"label"},O={class:"content"};var T=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:T}){var U,A,F,H,J,K,M,Q;const R=t,{state:V,openSession:W}=_(),X=e(!1),Y=e(!1),Z=e(!1),tt=l({}),et=[{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.115"))||"机构",value:"",key:"orgName"},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.116"))||"姓名",value:"",key:"name"},{label:(null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.117"))||"归属科室",value:"",key:"deptName"},{label:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.118"))||"业务科室",value:"",key:"businessDeptNames"},{label:(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.119"))||"手机号",value:"",key:"phone"},{label:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.120"))||"岗位",value:"",key:"post"},{label:(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.121"))||"工号",value:"",key:"jobId"},{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.122"))||"性别",value:"",key:"orgName"}],lt=n((()=>(tt.id&&et.forEach((t=>{const{key:e}=t;t.value=tt[e]})),et)));async function nt(){X.value=!1;let t=V.sessionList.find((t=>t.receiver===R.userId));if(!t)try{t=await z({chatType:x.SINGLE,receiver:R.userId,sender:V.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&W(t),T("close")}async function ot(t){if(!t)return;const e=await N({userId:R.userId});(null==e?void 0:e.id)?Object.assign(tt,e):tt.id=""}function at(t){const{key:e,value:l}=t;return"phone"!==e||Z.value?l:(l||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,l)=>(o(),a(i(k),{raw:"",class:"person-profile-wrapper",show:X.value,"onUpdate:show":[l[3]||(l[3]=t=>X.value=t),ot],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[r(e.$slots,"trigger")])),default:s((()=>[tt.id?(o(),d(c,{key:0},[u(p("div",D,[p("div",S,[p("div",$,[v(i(h),{src:tt.avatar,bordered:"",round:"",size:100,onClickCapture:l[0]||(l[0]=t=>Y.value=!0)},null,8,["src"]),g(' <n-upload abstract accept="image/*" @change="onChange">\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\n\t\t\t\t\t\t\t\t<n-button\n\t\t\t\t\t\t\t\t\tcircle\n\t\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\n\t\t\t\t\t\t\t\t\t@click="handleClick"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t\t</n-upload-trigger>\n\t\t\t\t\t\t</n-upload> '),p("div",E,[p("h4",null,m(tt.name),1),p("p",null,m(tt.orgName),1)]),v(i(b),{strong:"",secondary:"",onClick:nt},{default:s((()=>[v(i(C),{size:"13",color:"#666666",component:i(j),style:{"margin-right":"6px"}},null,8,["component"]),w(" 发消息 ")])),_:1})])]),p("div",P,[p("div",q,[(o(!0),d(c,null,y(i(lt),((t,e)=>(o(),d("div",{class:"info-item",key:e},[p("span",G,m(t.label),1),p("div",O,[p("span",null,m(at(t)),1),"phone"===t.key&&at(t)?(o(),a(i(C),{key:0,size:"16",color:"#666666",component:Z.value?i(L):i(B),style:{"margin-left":"10px"},onClick:l[1]||(l[1]=t=>Z.value=!Z.value)},null,8,["component"])):g("v-if",!0)])])))),128))])])],512),[[f,!Y.value]]),u(p("div",{class:"large-avatar",onClick:l[2]||(l[2]=t=>Y.value=!1)},[v(i(b),{circle:"",size:"small",secondary:""},{icon:s((()=>[v(i(C),{size:24,component:i(I),color:"#fff"},null,8,["component"])])),_:1}),v(i(h),{size:310,round:"",src:tt.avatar},null,8,["src"])],512),[[f,Y.value]])],64)):g("v-if",!0)])),_:3},8,["show","trigger"]))}});export{T as default};
@@ -1 +1 @@
1
- .iho-table{height:100%;position:relative}.iho-table i{font-style:normal}.iho-table .vxe-header--column{font-weight:400;text-shadow:0 0 1px}.iho-table .vxe-body--column.col--drag{cursor:move}.iho-table .iho-table__headerHeight.vxe-header--row .vxe-header--column{height:var(--iho-table-header-height)}.iho-table .vxe-table.size--mini{font-size:14px}.iho-table .vxe-table.size--mini .vxe-body--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-footer--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-header--column:not(.col--ellipsis){padding:4px 0}.iho-table .vxe-table.size--mini .vxe-sort--asc-btn{top:-2px}.iho-table .vxe-table.size--mini .vxe-sort--desc-btn{bottom:0}.iho-table__headerWrapper{display:inline-flex;flex-wrap:nowrap}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table .vxe-table--header-wrapper,.iho-table .vxe-table.vxe-table--render-default{color:#212121}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .vxe-table--empty-content{height:100%;width:100%}.iho-table .vxe-table--empty-content>div,.iho-table .vxe-tree-cell{height:100%}.iho-table .vxe-table--header{background-color:var(--c-head-bg-color)}.iho-table .vxe-table--header .checkbox-cell--disable{border:2px solid #c0c4cc;border-radius:50%;box-sizing:border-box;cursor:not-allowed;display:inline-block;height:18px;left:-2px;position:relative;top:3px;width:18px}.iho-table .vxe-table--header .checkbox-cell--disable:before{background-color:#c0c4cc;content:"";height:16px;left:50%;position:absolute;top:-2px;transform:translate(-60%) rotate(-45deg);width:2px}.iho-table .vxe-footer--row .vxe-footer--column>.vxe-cell .vxe-cell--item{height:30px;line-height:30px}.iho-table .vxe-table--render-default .vxe-body--column.col--selected{box-shadow:inset 0 0 0 2px var(--c-primary-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--hover,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--stripe{background-color:var(--c-hover-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--stripe{background-color:var(--c-stripe-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--radio{background-color:var(--c-primary-color-opacity2);text-shadow:0 0 1px}.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--radio{background-color:var(--c-primary-color-opacity3);text-shadow:0 0 1px}.iho-table .vxe-body--expanded-column,.iho-table .vxe-table--border-line{border-color:var(--c-border-color)!important}.iho-table .vxe-table--footer-wrapper{border-top-color:var(--c-border-color)!important}.iho-table .border--default .vxe-body--column,.iho-table .border--default .vxe-footer--column,.iho-table .border--default .vxe-header--column,.iho-table .border--inner .vxe-body--column,.iho-table .border--inner .vxe-footer--column,.iho-table .border--inner .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--full .vxe-body--column,.iho-table .border--full .vxe-footer--column,.iho-table .border--full .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color)),linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--default .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--full .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--inner .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--outer .vxe-header--row:last-child .vxe-header--gutter{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .vxe-table--header-border-line{border-bottom-color:var(--c-border-color)!important}.iho-table .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .is--filter-active .vxe-cell--filter .vxe-filter--btn{color:var(--c-primary-color)}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterIcon.is-active{color:var(--c-primary-color)}.iho-table__filterTable .vxe-table--empty-placeholder{display:none!important}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;margin:8px 12px;width:280px}.iho-table__filterCheckAllWrapper{display:flex;justify-content:space-between}.iho-table__filterCheckAllWrapper>div{flex:1}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:var(--c-primary-color)}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05);overflow-x:hidden}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;padding:0 8px}.iho-table__filterListItem:hover{background:var(--c-primary-color-opacity2)}.iho-table__filterListItem .n-checkbox,.iho-table__filterListItem .n-radio{width:100%}.iho-table__filterListItem>*{padding:5px 0}.iho-table__filterListItemContent{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:190px}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table__time-picker{position:unset}.iho-table__time-picker .n-input{display:none}.iho-table__time-picker .v-binder-follower-container{height:auto;position:unset}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content{position:unset;transform:none!important}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content .n-time-picker-panel{box-shadow:none}.iho-table__scrollbar{margin:8px 8px 8px 0;max-height:255px}.iho-table .variable-height .vxe-cell,.iho-table .variable-height .vxe-cell--tree-node,.iho-table .variable-height .vxe-tree-cell{line-height:1.3;max-height:fit-content!important;white-space:break-spaces!important}.iho-table__selectMenu .n-scrollbar-rail__scrollbar{display:none!important}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar,.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{display:unset!important;height:6px;width:6px}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.iho-table__selectMenu .v-vl-items{min-width:100%;width:max-content}.iho-table__selectOption .n-base-select-option__content{overflow:visible!important;text-overflow:unset!important;word-break:keep-all!important}.iho-table__selectOptionWrapper{align-items:center;display:flex}.iho-select-menu-width{width:var(--iho-select-menu-width)!important}.iho-table .is--checked.vxe-checkbox,.iho-table .is--checked.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--checked.vxe-custom--option,.iho-table .is--checked.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--checked.vxe-export--panel-column-option,.iho-table .is--checked.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--checked.vxe-table--filter-option,.iho-table .is--checked.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-checkbox,.iho-table .is--indeterminate.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-custom--option,.iho-table .is--indeterminate.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-export--panel-column-option,.iho-table .is--indeterminate.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-table--filter-option,.iho-table .is--indeterminate.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-custom--option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-export--panel-column-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table .vxe-sort--asc-btn.sort--active,.iho-table .vxe-table .vxe-sort--desc-btn.sort--active,.iho-table .vxe-table--filter-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .vxe-cell--checkbox:not(.is--disabled):hover .vxe-checkbox--icon{color:var(--c-primary-color)}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}@font-face{font-family:iho-table-iconfont;src:url(iconfont.ttf) format("truetype")}.iho-table .iho-table--iconfont{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-table-iconfont!important;font-size:15px;font-style:normal}.iho-table .iho-table-icon-filter{display:inline-block;font-size:17px;transform:translateY(-1px);vertical-align:middle}.iho-table .iho-table-icon-filter:before{content:"\c2001"}.iho-table .iho-table-icon-date-filter{display:inline-block;transform:translateY(-1px)}.iho-table .iho-table-icon-date-filter:before{content:"\c2002"}.iho-table .row--custom{background-color:var(--row-background-color)}.iho-table__colorAndIcon{background-color:var(--color-and-icon-background-color-type);color:var(--color-and-icon-color-type)}.iho-table__htmlRender *{display:inline!important}.iho-table__ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.iho-table .vxe-grid[vertical] .vxe-table--header-wrapper.body--wrapper{background:transparent}.iho-table .vxe-grid[vertical] .vxe-cell{min-height:var(--iho-table-vertical-table-min-height,unset)}.iho-table__pagerScrollWrapper{background:#fff;height:30px;overflow:auto;position:absolute;right:1px;width:9px;z-index:3000}.iho-table__pagerScrollWrapper::-webkit-scrollbar{background-color:transparent;height:8px;width:8px}.iho-table__pagerScrollWrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:2px dashed transparent;border-radius:5px}.iho-table__pagerScrollWrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table--fixed-left,.iho-table--fixed-right{position:sticky!important;width:calc(var(--iho-table-fixed-width)*1px);z-index:5}.iho-table--fixed-left.vxe-header--column .vxe-resizable.is--line:before,.iho-table--fixed-right.vxe-header--column .vxe-resizable.is--line:before{width:2px}.iho-table--fixed-left{left:calc(var(--iho-table-fixed-left)*1px + 1px)}.iho-table--fixed-right.vxe-header--column{right:calc(var(--iho-table-fixed-right)*1px + var(--c-scrollbar-width))}.iho-table--fixed-right.vxe-body--column{right:calc(var(--iho-table-fixed-right)*1px)}.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-left.vxe-body--column,.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-right.vxe-body--column{background-color:#fff}.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-left.vxe-header--column,.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-right.vxe-header--column{background-color:var(--c-head-bg-color)}.iho-table tr.row--hover .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--stripe .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--stripe .iho-table--fixed-right.vxe-body--column{background-color:var(--c-hover-color)}.iho-table tr.row--stripe .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--stripe .iho-table--fixed-right.vxe-body--column{background-color:var(--c-stripe-color)}.iho-table tr.row--checked .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--checked .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--current .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--current .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--radio .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--radio .iho-table--fixed-right.vxe-body--column{background-color:var(--c-primary-color-opacity2)}.iho-table tr.row--hover.row--checked .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--checked .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--current .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--current .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--radio .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--radio .iho-table--fixed-right.vxe-body--column{background-color:var(--c-primary-color-opacity3)}.iho-table__fixedLeftBorderLeft{border-left:1px solid var(--c-border-color);height:calc(100% - 8px);left:0;overflow:hidden;position:absolute;width:0;z-index:5}.iho-table__fixedLeftShadow{height:calc(100% - 8px);position:absolute;top:0;width:3px;z-index:5}.iho-table__fixedLeftShadow.scrolling--middle{box-shadow:4px 3px 4px 0 rgba(0,0,0,.12)}.iho-table__fixedLeftBorderTop{background:var(--c-border-color);height:1px;left:0;position:absolute;top:0;z-index:6}.iho-table__fixedRightBorderLeft{border-left:1px solid var(--c-border-color);height:calc(100% - 8px);overflow:hidden;position:absolute;top:0;width:3px;z-index:5}.iho-table__fixedRightBorderLeft.scrolling--middle{box-shadow:-4px 3px 4px 0 rgba(0,0,0,.12)}.iho-table__fixedRightBorderTop{background:var(--c-border-color);height:1px;position:absolute;right:0;top:0;z-index:6}.iho-table__fixedRightBorderTop:after{background:var(--c-head-bg-color);content:"";height:var(--c-header-height);position:absolute;right:1px;top:1px;width:calc(var(--c-scrollbar-width) - 1px)}
1
+ .iho-table{height:100%;position:relative}.iho-table i{font-style:normal}.iho-table .vxe-header--column{font-weight:400;text-shadow:0 0 1px}.iho-table .vxe-body--column.col--drag{cursor:move}.iho-table .iho-table__headerHeight.vxe-header--row .vxe-header--column{height:var(--iho-table-header-height)}.iho-table .vxe-table.size--mini{font-size:14px}.iho-table .vxe-table.size--mini .vxe-body--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-footer--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-header--column:not(.col--ellipsis){padding:4px 0}.iho-table .vxe-table.size--mini .vxe-sort--asc-btn{top:-2px}.iho-table .vxe-table.size--mini .vxe-sort--desc-btn{bottom:0}.iho-table__headerWrapper{display:inline-flex;flex-wrap:nowrap}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table .vxe-table--header-wrapper,.iho-table .vxe-table.vxe-table--render-default{color:#212121}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .vxe-table--empty-content{height:100%;width:100%}.iho-table .vxe-table--empty-content>div,.iho-table .vxe-tree-cell{height:100%}.iho-table .vxe-table--header{background-color:var(--c-head-bg-color)}.iho-table .vxe-table--header .checkbox-cell--disable{border:2px solid #c0c4cc;border-radius:50%;box-sizing:border-box;cursor:not-allowed;display:inline-block;height:18px;left:-2px;position:relative;top:3px;width:18px}.iho-table .vxe-table--header .checkbox-cell--disable:before{background-color:#c0c4cc;content:"";height:16px;left:50%;position:absolute;top:-2px;transform:translate(-60%) rotate(-45deg);width:2px}.iho-table .vxe-footer--row .vxe-footer--column>.vxe-cell .vxe-cell--item{height:30px;line-height:30px}.iho-table .vxe-table--render-default .vxe-body--column.col--selected{box-shadow:inset 0 0 0 2px var(--c-primary-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--hover,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--stripe{background-color:var(--c-hover-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--stripe{background-color:var(--c-stripe-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--radio{background-color:var(--c-primary-color-opacity2);text-shadow:0 0 1px}.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--radio{background-color:var(--c-primary-color-opacity3);text-shadow:0 0 1px}.iho-table .vxe-body--expanded-column,.iho-table .vxe-table--border-line{border-color:var(--c-border-color)!important}.iho-table .vxe-table--footer-wrapper{border-top-color:var(--c-border-color)!important}.iho-table .border--default .vxe-body--column,.iho-table .border--default .vxe-footer--column,.iho-table .border--default .vxe-header--column,.iho-table .border--inner .vxe-body--column,.iho-table .border--inner .vxe-footer--column,.iho-table .border--inner .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--full .vxe-body--column,.iho-table .border--full .vxe-footer--column,.iho-table .border--full .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color)),linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--default .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--full .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--inner .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--outer .vxe-header--row:last-child .vxe-header--gutter{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .vxe-table--header-border-line{border-bottom-color:var(--c-border-color)!important}.iho-table .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .is--filter-active .vxe-cell--filter .vxe-filter--btn{color:var(--c-primary-color)}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterIcon.is-active{color:var(--c-primary-color)}.iho-table__filterTable .vxe-table--empty-placeholder{display:none!important}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;margin:8px 12px;min-width:280px}.iho-table__filterCheckAllWrapper{display:flex;justify-content:space-between}.iho-table__filterCheckAllWrapper>div{flex:1}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:var(--c-primary-color)}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05);overflow-x:hidden}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;padding:0 8px}.iho-table__filterListItem:hover{background:var(--c-primary-color-opacity2)}.iho-table__filterListItem .n-checkbox,.iho-table__filterListItem .n-radio{width:100%}.iho-table__filterListItem>*{padding:5px 0}.iho-table__filterListItemContent{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:190px}.iho-table__filterFooter{display:flex;gap:8px;justify-content:space-between}.iho-table__time-picker{position:unset}.iho-table__time-picker .n-input{display:none}.iho-table__time-picker .v-binder-follower-container{height:auto;position:unset}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content{position:unset;transform:none!important}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content .n-time-picker-panel{box-shadow:none}.iho-table__scrollbar{margin:8px 8px 8px 0;max-height:255px}.iho-table .variable-height .vxe-cell,.iho-table .variable-height .vxe-cell--tree-node,.iho-table .variable-height .vxe-tree-cell{line-height:1.3;max-height:fit-content!important;white-space:break-spaces!important}.iho-table__selectMenu .n-scrollbar-rail__scrollbar{display:none!important}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar,.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{display:unset!important;height:6px;width:6px}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.iho-table__selectMenu .v-vl-items{min-width:100%;width:max-content}.iho-table__selectOption .n-base-select-option__content{overflow:visible!important;text-overflow:unset!important;word-break:keep-all!important}.iho-table__selectOptionWrapper{align-items:center;display:flex}.iho-select-menu-width{width:var(--iho-select-menu-width)!important}.iho-table .is--checked.vxe-checkbox,.iho-table .is--checked.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--checked.vxe-custom--option,.iho-table .is--checked.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--checked.vxe-export--panel-column-option,.iho-table .is--checked.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--checked.vxe-table--filter-option,.iho-table .is--checked.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-checkbox,.iho-table .is--indeterminate.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-custom--option,.iho-table .is--indeterminate.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-export--panel-column-option,.iho-table .is--indeterminate.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-table--filter-option,.iho-table .is--indeterminate.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-custom--option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-export--panel-column-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table .vxe-sort--asc-btn.sort--active,.iho-table .vxe-table .vxe-sort--desc-btn.sort--active,.iho-table .vxe-table--filter-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .vxe-cell--checkbox:not(.is--disabled):hover .vxe-checkbox--icon{color:var(--c-primary-color)}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}@font-face{font-family:iho-table-iconfont;src:url(iconfont.ttf) format("truetype")}.iho-table .iho-table--iconfont{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-table-iconfont!important;font-size:15px;font-style:normal}.iho-table .iho-table-icon-filter{display:inline-block;font-size:17px;transform:translateY(-1px);vertical-align:middle}.iho-table .iho-table-icon-filter:before{content:"\c2001"}.iho-table .iho-table-icon-date-filter{display:inline-block;transform:translateY(-1px)}.iho-table .iho-table-icon-date-filter:before{content:"\c2002"}.iho-table .row--custom{background-color:var(--row-background-color)}.iho-table__colorAndIcon{background-color:var(--color-and-icon-background-color-type);color:var(--color-and-icon-color-type)}.iho-table__htmlRender *{display:inline!important}.iho-table__ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.iho-table .vxe-grid[vertical] .vxe-table--header-wrapper.body--wrapper{background:transparent}.iho-table .vxe-grid[vertical] .vxe-cell{min-height:var(--iho-table-vertical-table-min-height,unset)}.iho-table__pagerScrollWrapper{background:#fff;height:30px;overflow:auto;position:absolute;right:1px;width:9px;z-index:3000}.iho-table__pagerScrollWrapper::-webkit-scrollbar{background-color:transparent;height:8px;width:8px}.iho-table__pagerScrollWrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:2px dashed transparent;border-radius:5px}.iho-table__pagerScrollWrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table--fixed-left,.iho-table--fixed-right{position:sticky!important;width:calc(var(--iho-table-fixed-width)*1px);z-index:5}.iho-table--fixed-left.vxe-header--column .vxe-resizable.is--line:before,.iho-table--fixed-right.vxe-header--column .vxe-resizable.is--line:before{width:2px}.iho-table--fixed-left{left:calc(var(--iho-table-fixed-left)*1px + 1px)}.iho-table--fixed-right.vxe-header--column{right:calc(var(--iho-table-fixed-right)*1px + var(--c-scrollbar-width))}.iho-table--fixed-right.vxe-body--column{right:calc(var(--iho-table-fixed-right)*1px)}.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-left.vxe-body--column,.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-right.vxe-body--column{background-color:#fff}.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-left.vxe-header--column,.iho-table tr:not(.row--current,.row--hover,.row--checked,.row--radio) .iho-table--fixed-right.vxe-header--column{background-color:var(--c-head-bg-color)}.iho-table tr.row--hover .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--stripe .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--stripe .iho-table--fixed-right.vxe-body--column{background-color:var(--c-hover-color)}.iho-table tr.row--stripe .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--stripe .iho-table--fixed-right.vxe-body--column{background-color:var(--c-stripe-color)}.iho-table tr.row--checked .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--checked .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--current .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--current .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--radio .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--radio .iho-table--fixed-right.vxe-body--column{background-color:var(--c-primary-color-opacity2)}.iho-table tr.row--hover.row--checked .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--checked .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--current .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--current .iho-table--fixed-right.vxe-body--column,.iho-table tr.row--hover.row--radio .iho-table--fixed-left.vxe-body--column,.iho-table tr.row--hover.row--radio .iho-table--fixed-right.vxe-body--column{background-color:var(--c-primary-color-opacity3)}.iho-table__fixedLeftBorderLeft{border-left:1px solid var(--c-border-color);height:calc(100% - 8px);left:0;overflow:hidden;position:absolute;width:0;z-index:5}.iho-table__fixedLeftShadow{height:calc(100% - 8px);position:absolute;top:0;width:3px;z-index:5}.iho-table__fixedLeftShadow.scrolling--middle{box-shadow:4px 3px 4px 0 rgba(0,0,0,.12)}.iho-table__fixedLeftBorderTop{background:var(--c-border-color);height:1px;left:0;position:absolute;top:0;z-index:6}.iho-table__fixedRightBorderLeft{border-left:1px solid var(--c-border-color);height:calc(100% - 8px);overflow:hidden;position:absolute;top:0;width:3px;z-index:5}.iho-table__fixedRightBorderLeft.scrolling--middle{box-shadow:-4px 3px 4px 0 rgba(0,0,0,.12)}.iho-table__fixedRightBorderTop{background:var(--c-border-color);height:1px;position:absolute;right:0;top:0;z-index:6}.iho-table__fixedRightBorderTop:after{background:var(--c-head-bg-color);content:"";height:var(--c-header-height);position:absolute;right:1px;top:1px;width:calc(var(--c-scrollbar-width) - 1px)}