cnhis-design-vue 3.2.15-beta.11 → 3.2.15-beta.13

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.
Files changed (32) hide show
  1. package/es/components/button-print/src/utils/print.d.ts +3 -0
  2. package/es/components/button-print/src/utils/print.js +1 -1
  3. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  4. package/es/components/iho-chat/index.d.ts +44 -22
  5. package/es/components/iho-chat/src/Index.vue.d.ts +44 -22
  6. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  7. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +0 -1
  8. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +0 -2
  9. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +0 -2
  10. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +0 -9
  11. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +0 -3
  12. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  13. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +0 -1
  14. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +0 -1
  15. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +0 -3
  16. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -2
  17. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  18. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +0 -1
  19. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  20. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -1
  21. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  22. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
  23. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  24. package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
  25. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  26. package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -1
  27. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  28. package/es/components/iho-chat/src/types/index.d.ts +13 -2
  29. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  30. package/es/env.d.ts +25 -25
  31. package/es/shared/package.json.js +1 -1
  32. package/package.json +2 -2
@@ -28,6 +28,9 @@ 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;
31
34
  destroy(): void;
32
35
  /**
33
36
  * @desc 调用实例方法打开弹窗
@@ -1 +1 @@
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};
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};
@@ -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;
@@ -35,6 +35,19 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
35
35
  type: BooleanConstructor;
36
36
  default: boolean;
37
37
  };
38
+ trtcProxy: {
39
+ type: import("vue").PropType<string | Partial<{
40
+ websocketProxy: string;
41
+ loggerProxy: string;
42
+ turnServer: {
43
+ url: string;
44
+ username?: string | undefined;
45
+ credential?: string | undefined;
46
+ credentialType?: string | undefined;
47
+ }[];
48
+ iceTransportPolicy: "all" | "relay";
49
+ }>>;
50
+ };
38
51
  }, {
39
52
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
40
53
  token: {
@@ -72,6 +85,19 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
72
85
  type: BooleanConstructor;
73
86
  default: boolean;
74
87
  };
88
+ trtcProxy: {
89
+ type: import("vue").PropType<string | Partial<{
90
+ websocketProxy: string;
91
+ loggerProxy: string;
92
+ turnServer: {
93
+ url: string;
94
+ username?: string | undefined;
95
+ credential?: string | undefined;
96
+ credentialType?: string | undefined;
97
+ }[];
98
+ iceTransportPolicy: "all" | "relay";
99
+ }>>;
100
+ };
75
101
  }>> & {
76
102
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
77
103
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
@@ -81,10 +107,11 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
81
107
  emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
82
108
  loading: import("vue").Ref<boolean>;
83
109
  data: {
110
+ filterable: import("vue").Ref<any>;
111
+ trtcProxy: import("vue").Ref<any>;
84
112
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
85
113
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
86
114
  state: {
87
- filterable: boolean;
88
115
  orgId: string | number;
89
116
  currentSessionItem: import("../../shared/types").AnyObject;
90
117
  id: string;
@@ -128,7 +155,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
128
155
  };
129
156
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
130
157
  state: {
131
- filterable: boolean;
132
158
  orgId: string | number;
133
159
  currentSessionItem: import("../../shared/types").AnyObject;
134
160
  id: string;
@@ -182,7 +208,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
182
208
  filterList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
183
209
  handleInput: () => void;
184
210
  state: {
185
- filterable: boolean;
186
211
  orgId: string | number;
187
212
  currentSessionItem: import("../../shared/types").AnyObject;
188
213
  id: string;
@@ -202,6 +227,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
202
227
  showMultipleVideo: boolean;
203
228
  };
204
229
  unreadTotal: import("vue").ComputedRef<number>;
230
+ filterable: import("vue").Ref<any>;
205
231
  openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
206
232
  setUpdateSessionItem: (item: import("../../shared/types").AnyObject) => void;
207
233
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
@@ -459,7 +485,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
459
485
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
460
486
  ChatHeader: import("vue").DefineComponent<{}, {
461
487
  state: {
462
- filterable: boolean;
463
488
  orgId: string | number;
464
489
  currentSessionItem: import("../../shared/types").AnyObject;
465
490
  id: string;
@@ -529,7 +554,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
529
554
  }>>;
530
555
  emit: (event: "close", ...args: any[]) => void;
531
556
  state: {
532
- filterable: boolean;
533
557
  orgId: string | number;
534
558
  currentSessionItem: import("../../shared/types").AnyObject;
535
559
  id: string;
@@ -596,7 +620,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
596
620
  [x: string]: unknown;
597
621
  };
598
622
  state: {
599
- filterable: boolean;
600
623
  orgId: string | number;
601
624
  currentSessionItem: import("../../shared/types").AnyObject;
602
625
  id: string;
@@ -671,7 +694,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
671
694
  }>>;
672
695
  emit: (event: "close", ...args: any[]) => void;
673
696
  state: {
674
- filterable: boolean;
675
697
  orgId: string | number;
676
698
  currentSessionItem: import("../../shared/types").AnyObject;
677
699
  id: string;
@@ -787,7 +809,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
787
809
  }>>;
788
810
  emit: (event: "comfirm", ...args: any[]) => void;
789
811
  state: {
790
- filterable: boolean;
791
812
  orgId: string | number;
792
813
  currentSessionItem: import("../../shared/types").AnyObject;
793
814
  id: string;
@@ -899,7 +920,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
899
920
  }>> & {}>>;
900
921
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
901
922
  state: {
902
- filterable: boolean;
903
923
  orgId: string | number;
904
924
  currentSessionItem: import("../../shared/types").AnyObject;
905
925
  id: string;
@@ -1007,7 +1027,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1007
1027
  }>>;
1008
1028
  emit: (event: "comfirm", ...args: any[]) => void;
1009
1029
  state: {
1010
- filterable: boolean;
1011
1030
  orgId: string | number;
1012
1031
  currentSessionItem: import("../../shared/types").AnyObject;
1013
1032
  id: string;
@@ -1125,7 +1144,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1125
1144
  };
1126
1145
  }>> & {}>>;
1127
1146
  state: {
1128
- filterable: boolean;
1129
1147
  orgId: string | number;
1130
1148
  currentSessionItem: import("../../shared/types").AnyObject;
1131
1149
  id: string;
@@ -1358,7 +1376,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1358
1376
  }>>;
1359
1377
  emit: (event: "comfirm", ...args: any[]) => void;
1360
1378
  state: {
1361
- filterable: boolean;
1362
1379
  orgId: string | number;
1363
1380
  currentSessionItem: import("../../shared/types").AnyObject;
1364
1381
  id: string;
@@ -1455,7 +1472,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1455
1472
  ChatMain: import("vue").DefineComponent<{}, {
1456
1473
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
1457
1474
  state: {
1458
- filterable: boolean;
1459
1475
  orgId: string | number;
1460
1476
  currentSessionItem: import("../../shared/types").AnyObject;
1461
1477
  id: string;
@@ -1546,7 +1562,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1546
1562
  }>>;
1547
1563
  emit: (event: "close", ...args: any[]) => void;
1548
1564
  state: {
1549
- filterable: boolean;
1550
1565
  orgId: string | number;
1551
1566
  currentSessionItem: import("../../shared/types").AnyObject;
1552
1567
  id: string;
@@ -1781,7 +1796,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1781
1796
  }>>;
1782
1797
  emit: (event: "comfirm", ...args: any[]) => void;
1783
1798
  state: {
1784
- filterable: boolean;
1785
1799
  orgId: string | number;
1786
1800
  currentSessionItem: import("../../shared/types").AnyObject;
1787
1801
  id: string;
@@ -1885,7 +1899,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1885
1899
  ChatFooter: import("vue").DefineComponent<{}, {
1886
1900
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
1887
1901
  state: {
1888
- filterable: boolean;
1889
1902
  orgId: string | number;
1890
1903
  currentSessionItem: import("../../shared/types").AnyObject;
1891
1904
  id: string;
@@ -1989,7 +2002,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1989
2002
  }>>;
1990
2003
  emit: (event: "comfirm", ...args: any[]) => void;
1991
2004
  state: {
1992
- filterable: boolean;
1993
2005
  orgId: string | number;
1994
2006
  currentSessionItem: import("../../shared/types").AnyObject;
1995
2007
  id: string;
@@ -2097,7 +2109,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2097
2109
  keyword: import("vue").Ref<string>;
2098
2110
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
2099
2111
  state: {
2100
- filterable: boolean;
2101
2112
  orgId: string | number;
2102
2113
  currentSessionItem: import("../../shared/types").AnyObject;
2103
2114
  id: string;
@@ -2257,7 +2268,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2257
2268
  }>>;
2258
2269
  emit: (event: "comfirm", ...args: any[]) => void;
2259
2270
  state: {
2260
- filterable: boolean;
2261
2271
  orgId: string | number;
2262
2272
  currentSessionItem: import("../../shared/types").AnyObject;
2263
2273
  id: string;
@@ -2355,7 +2365,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2355
2365
  receiver?: string | undefined;
2356
2366
  }) => Promise<void>;
2357
2367
  state: {
2358
- filterable: boolean;
2359
2368
  orgId: string | number;
2360
2369
  currentSessionItem: import("../../shared/types").AnyObject;
2361
2370
  id: string;
@@ -2374,6 +2383,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2374
2383
  currentGroupUser: import("../../shared/types").AnyObject[];
2375
2384
  showMultipleVideo: boolean;
2376
2385
  };
2386
+ trtcProxy: import("vue").Ref<any>;
2377
2387
  trtc: import("trtc-sdk-v5").default;
2378
2388
  timing: import("vue").Ref<string>;
2379
2389
  voiceOpen: import("vue").Ref<boolean>;
@@ -2437,7 +2447,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2437
2447
  name: string;
2438
2448
  }[]>;
2439
2449
  state: {
2440
- filterable: boolean;
2441
2450
  orgId: string | number;
2442
2451
  currentSessionItem: import("../../shared/types").AnyObject;
2443
2452
  id: string;
@@ -2462,6 +2471,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2462
2471
  receiver?: string | undefined;
2463
2472
  }) => Promise<void>;
2464
2473
  trtc: import("trtc-sdk-v5").default;
2474
+ trtcProxy: import("vue").Ref<any>;
2465
2475
  voiceOpen: import("vue").Ref<boolean>;
2466
2476
  isAudio: import("vue").ComputedRef<boolean>;
2467
2477
  isCall: import("vue").ComputedRef<boolean>;
@@ -2555,7 +2565,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2555
2565
  }>>;
2556
2566
  emit: (event: "comfirm", ...args: any[]) => void;
2557
2567
  state: {
2558
- filterable: boolean;
2559
2568
  orgId: string | number;
2560
2569
  currentSessionItem: import("../../shared/types").AnyObject;
2561
2570
  id: string;
@@ -2690,6 +2699,19 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2690
2699
  type: BooleanConstructor;
2691
2700
  default: boolean;
2692
2701
  };
2702
+ trtcProxy: {
2703
+ type: import("vue").PropType<string | Partial<{
2704
+ websocketProxy: string;
2705
+ loggerProxy: string;
2706
+ turnServer: {
2707
+ url: string;
2708
+ username?: string | undefined;
2709
+ credential?: string | undefined;
2710
+ credentialType?: string | undefined;
2711
+ }[];
2712
+ iceTransportPolicy: "all" | "relay";
2713
+ }>>;
2714
+ };
2693
2715
  }>> & {
2694
2716
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
2695
2717
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
@@ -36,6 +36,19 @@ declare const _default: import("vue").DefineComponent<{
36
36
  type: BooleanConstructor;
37
37
  default: boolean;
38
38
  };
39
+ trtcProxy: {
40
+ type: PropType<string | Partial<{
41
+ websocketProxy: string;
42
+ loggerProxy: string;
43
+ turnServer: {
44
+ url: string;
45
+ username?: string | undefined;
46
+ credential?: string | undefined;
47
+ credentialType?: string | undefined;
48
+ }[];
49
+ iceTransportPolicy: "all" | "relay";
50
+ }>>;
51
+ };
39
52
  }, {
40
53
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
41
54
  token: {
@@ -73,6 +86,19 @@ declare const _default: import("vue").DefineComponent<{
73
86
  type: BooleanConstructor;
74
87
  default: boolean;
75
88
  };
89
+ trtcProxy: {
90
+ type: PropType<string | Partial<{
91
+ websocketProxy: string;
92
+ loggerProxy: string;
93
+ turnServer: {
94
+ url: string;
95
+ username?: string | undefined;
96
+ credential?: string | undefined;
97
+ credentialType?: string | undefined;
98
+ }[];
99
+ iceTransportPolicy: "all" | "relay";
100
+ }>>;
101
+ };
76
102
  }>> & {
77
103
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
78
104
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
@@ -82,10 +108,11 @@ declare const _default: import("vue").DefineComponent<{
82
108
  emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
83
109
  loading: import("vue").Ref<boolean>;
84
110
  data: {
111
+ filterable: import("vue").Ref<any>;
112
+ trtcProxy: import("vue").Ref<any>;
85
113
  cssVars: import("vue").ComputedRef<AnyObject>;
86
114
  stompClient: import("vue").Ref<import("./utils/chatSock").ChatSock | undefined>;
87
115
  state: {
88
- filterable: boolean;
89
116
  orgId: string | number;
90
117
  currentSessionItem: AnyObject;
91
118
  id: string;
@@ -129,7 +156,6 @@ declare const _default: import("vue").DefineComponent<{
129
156
  };
130
157
  cssVars: import("vue").ComputedRef<AnyObject>;
131
158
  state: {
132
- filterable: boolean;
133
159
  orgId: string | number;
134
160
  currentSessionItem: AnyObject;
135
161
  id: string;
@@ -183,7 +209,6 @@ declare const _default: import("vue").DefineComponent<{
183
209
  filterList: import("vue").Ref<AnyObject[]>;
184
210
  handleInput: () => void;
185
211
  state: {
186
- filterable: boolean;
187
212
  orgId: string | number;
188
213
  currentSessionItem: AnyObject;
189
214
  id: string;
@@ -203,6 +228,7 @@ declare const _default: import("vue").DefineComponent<{
203
228
  showMultipleVideo: boolean;
204
229
  };
205
230
  unreadTotal: import("vue").ComputedRef<number>;
231
+ filterable: import("vue").Ref<any>;
206
232
  openSession: (session: string | AnyObject) => Promise<void>;
207
233
  setUpdateSessionItem: (item: AnyObject) => void;
208
234
  setCurrentSessionItem: (item: AnyObject) => void;
@@ -460,7 +486,6 @@ declare const _default: import("vue").DefineComponent<{
460
486
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
461
487
  ChatHeader: import("vue").DefineComponent<{}, {
462
488
  state: {
463
- filterable: boolean;
464
489
  orgId: string | number;
465
490
  currentSessionItem: AnyObject;
466
491
  id: string;
@@ -530,7 +555,6 @@ declare const _default: import("vue").DefineComponent<{
530
555
  }>>;
531
556
  emit: (event: "close", ...args: any[]) => void;
532
557
  state: {
533
- filterable: boolean;
534
558
  orgId: string | number;
535
559
  currentSessionItem: AnyObject;
536
560
  id: string;
@@ -597,7 +621,6 @@ declare const _default: import("vue").DefineComponent<{
597
621
  [x: string]: unknown;
598
622
  };
599
623
  state: {
600
- filterable: boolean;
601
624
  orgId: string | number;
602
625
  currentSessionItem: AnyObject;
603
626
  id: string;
@@ -672,7 +695,6 @@ declare const _default: import("vue").DefineComponent<{
672
695
  }>>;
673
696
  emit: (event: "close", ...args: any[]) => void;
674
697
  state: {
675
- filterable: boolean;
676
698
  orgId: string | number;
677
699
  currentSessionItem: AnyObject;
678
700
  id: string;
@@ -788,7 +810,6 @@ declare const _default: import("vue").DefineComponent<{
788
810
  }>>;
789
811
  emit: (event: "comfirm", ...args: any[]) => void;
790
812
  state: {
791
- filterable: boolean;
792
813
  orgId: string | number;
793
814
  currentSessionItem: AnyObject;
794
815
  id: string;
@@ -900,7 +921,6 @@ declare const _default: import("vue").DefineComponent<{
900
921
  }>> & {}>>;
901
922
  cssVars: import("vue").ComputedRef<AnyObject>;
902
923
  state: {
903
- filterable: boolean;
904
924
  orgId: string | number;
905
925
  currentSessionItem: AnyObject;
906
926
  id: string;
@@ -1008,7 +1028,6 @@ declare const _default: import("vue").DefineComponent<{
1008
1028
  }>>;
1009
1029
  emit: (event: "comfirm", ...args: any[]) => void;
1010
1030
  state: {
1011
- filterable: boolean;
1012
1031
  orgId: string | number;
1013
1032
  currentSessionItem: AnyObject;
1014
1033
  id: string;
@@ -1126,7 +1145,6 @@ declare const _default: import("vue").DefineComponent<{
1126
1145
  };
1127
1146
  }>> & {}>>;
1128
1147
  state: {
1129
- filterable: boolean;
1130
1148
  orgId: string | number;
1131
1149
  currentSessionItem: AnyObject;
1132
1150
  id: string;
@@ -1359,7 +1377,6 @@ declare const _default: import("vue").DefineComponent<{
1359
1377
  }>>;
1360
1378
  emit: (event: "comfirm", ...args: any[]) => void;
1361
1379
  state: {
1362
- filterable: boolean;
1363
1380
  orgId: string | number;
1364
1381
  currentSessionItem: AnyObject;
1365
1382
  id: string;
@@ -1456,7 +1473,6 @@ declare const _default: import("vue").DefineComponent<{
1456
1473
  ChatMain: import("vue").DefineComponent<{}, {
1457
1474
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
1458
1475
  state: {
1459
- filterable: boolean;
1460
1476
  orgId: string | number;
1461
1477
  currentSessionItem: AnyObject;
1462
1478
  id: string;
@@ -1547,7 +1563,6 @@ declare const _default: import("vue").DefineComponent<{
1547
1563
  }>>;
1548
1564
  emit: (event: "close", ...args: any[]) => void;
1549
1565
  state: {
1550
- filterable: boolean;
1551
1566
  orgId: string | number;
1552
1567
  currentSessionItem: AnyObject;
1553
1568
  id: string;
@@ -1782,7 +1797,6 @@ declare const _default: import("vue").DefineComponent<{
1782
1797
  }>>;
1783
1798
  emit: (event: "comfirm", ...args: any[]) => void;
1784
1799
  state: {
1785
- filterable: boolean;
1786
1800
  orgId: string | number;
1787
1801
  currentSessionItem: AnyObject;
1788
1802
  id: string;
@@ -1886,7 +1900,6 @@ declare const _default: import("vue").DefineComponent<{
1886
1900
  ChatFooter: import("vue").DefineComponent<{}, {
1887
1901
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
1888
1902
  state: {
1889
- filterable: boolean;
1890
1903
  orgId: string | number;
1891
1904
  currentSessionItem: AnyObject;
1892
1905
  id: string;
@@ -1990,7 +2003,6 @@ declare const _default: import("vue").DefineComponent<{
1990
2003
  }>>;
1991
2004
  emit: (event: "comfirm", ...args: any[]) => void;
1992
2005
  state: {
1993
- filterable: boolean;
1994
2006
  orgId: string | number;
1995
2007
  currentSessionItem: AnyObject;
1996
2008
  id: string;
@@ -2098,7 +2110,6 @@ declare const _default: import("vue").DefineComponent<{
2098
2110
  keyword: import("vue").Ref<string>;
2099
2111
  cssVars: import("vue").ComputedRef<AnyObject>;
2100
2112
  state: {
2101
- filterable: boolean;
2102
2113
  orgId: string | number;
2103
2114
  currentSessionItem: AnyObject;
2104
2115
  id: string;
@@ -2258,7 +2269,6 @@ declare const _default: import("vue").DefineComponent<{
2258
2269
  }>>;
2259
2270
  emit: (event: "comfirm", ...args: any[]) => void;
2260
2271
  state: {
2261
- filterable: boolean;
2262
2272
  orgId: string | number;
2263
2273
  currentSessionItem: AnyObject;
2264
2274
  id: string;
@@ -2356,7 +2366,6 @@ declare const _default: import("vue").DefineComponent<{
2356
2366
  receiver?: string | undefined;
2357
2367
  }) => Promise<void>;
2358
2368
  state: {
2359
- filterable: boolean;
2360
2369
  orgId: string | number;
2361
2370
  currentSessionItem: AnyObject;
2362
2371
  id: string;
@@ -2375,6 +2384,7 @@ declare const _default: import("vue").DefineComponent<{
2375
2384
  currentGroupUser: AnyObject[];
2376
2385
  showMultipleVideo: boolean;
2377
2386
  };
2387
+ trtcProxy: import("vue").Ref<any>;
2378
2388
  trtc: import("trtc-sdk-v5").default;
2379
2389
  timing: import("vue").Ref<string>;
2380
2390
  voiceOpen: import("vue").Ref<boolean>;
@@ -2438,7 +2448,6 @@ declare const _default: import("vue").DefineComponent<{
2438
2448
  name: string;
2439
2449
  }[]>;
2440
2450
  state: {
2441
- filterable: boolean;
2442
2451
  orgId: string | number;
2443
2452
  currentSessionItem: AnyObject;
2444
2453
  id: string;
@@ -2463,6 +2472,7 @@ declare const _default: import("vue").DefineComponent<{
2463
2472
  receiver?: string | undefined;
2464
2473
  }) => Promise<void>;
2465
2474
  trtc: import("trtc-sdk-v5").default;
2475
+ trtcProxy: import("vue").Ref<any>;
2466
2476
  voiceOpen: import("vue").Ref<boolean>;
2467
2477
  isAudio: import("vue").ComputedRef<boolean>;
2468
2478
  isCall: import("vue").ComputedRef<boolean>;
@@ -2556,7 +2566,6 @@ declare const _default: import("vue").DefineComponent<{
2556
2566
  }>>;
2557
2567
  emit: (event: "comfirm", ...args: any[]) => void;
2558
2568
  state: {
2559
- filterable: boolean;
2560
2569
  orgId: string | number;
2561
2570
  currentSessionItem: AnyObject;
2562
2571
  id: string;
@@ -2691,6 +2700,19 @@ declare const _default: import("vue").DefineComponent<{
2691
2700
  type: BooleanConstructor;
2692
2701
  default: boolean;
2693
2702
  };
2703
+ trtcProxy: {
2704
+ type: PropType<string | Partial<{
2705
+ websocketProxy: string;
2706
+ loggerProxy: string;
2707
+ turnServer: {
2708
+ url: string;
2709
+ username?: string | undefined;
2710
+ credential?: string | undefined;
2711
+ credentialType?: string | undefined;
2712
+ }[];
2713
+ iceTransportPolicy: "all" | "relay";
2714
+ }>>;
2715
+ };
2694
2716
  }>> & {
2695
2717
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
2696
2718
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as n,createVNode as i,withCtx as l,createBlock as u,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import g from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import _ from"./components/ChatSearch.vue.js";import b from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import C from"./components/MultipleVideo.vue.js";import{instanceAxios as x}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as B}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const H={key:0,class:"iho-chat__header"},U={class:"toolbar"};var $=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},defaultSessionId:{type:String},show:{type:Boolean,default:!0},extraParams:{type:Object,default:()=>({})},filterable:{type:Boolean,default:!1}},emits:["template-click","unread-message-update","session-change","session-close"],setup(e,{expose:$,emit:q}){const M=e;x.defaults.baseURL=M.baseURL,x.defaults.headers.Authorization="bearer "+M.token;const N=t(!1),R=L(M,q);o(V,R),B(M,R);const{cssVars:A,state:D,openSession:F,closeSession:z,getCurrentSession:E,isEnded:O}=R;return $({getUnreadData:function(){return D.sessionList.filter((e=>I(e.unreadNum)&&e.unreadNum>0))},openSession:F,closeSession:z,getCurrentSession:E}),(t,o)=>e.show?(s(),r("div",{key:0,class:"iho-chat",style:a(n(A))},[i(n(f),{abstract:"",namespace:"iho-chat__popover"},{default:l((()=>{var o;return[N.value?(s(),u(n(h),{key:0,stroke:"#5585f5"})):(s(),r(d,{key:1},[e.showHeader?(s(),r("div",H,[i(_),i(b,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.31"))||"发起群聊",mode:"create","default-value":[n(D).userInfo]},null,8,["default-value"]),m("div",U,[p(t.$slots,"toolbar")])])):c("v-if",!0),i(n(v),{class:"iho-chat__body","has-sider":""},{default:l((()=>[i(S),i(n(y),{class:"chat-content",style:a({"--c-pointer-events":n(O)?"none":"unset","--c-cursor":n(O)?"not-allowed":"unset"})},{default:l((()=>[i(g,null,{header:l((()=>[p(t.$slots,"chatHeader",{session:n(D).currentSessionItem})])),_:3}),i(k),i(j,null,{footer:l((()=>[p(t.$slots,"chatFooter",{session:n(D).currentSessionItem})])),_:3})])),_:3},8,["style"]),p(t.$slots,"external")])),_:3}),n(D).showVideo?(s(),u(w,{key:1})):c("v-if",!0),n(D).showMultipleVideo?(s(),u(C,{key:2})):c("v-if",!0)],64))]})),_:3})],4)):c("v-if",!0)}});export{$ as default};
1
+ import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as n,createVNode as i,withCtx as l,createBlock as u,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import g from"./components/ChatHeader.vue.js";import j from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import b from"./components/ChatSearch.vue.js";import _ from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import x from"./components/MultipleVideo.vue.js";import{instanceAxios as C}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as B}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const H={key:0,class:"iho-chat__header"},U={class:"toolbar"};var $=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},defaultSessionId:{type:String},show:{type:Boolean,default:!0},extraParams:{type:Object,default:()=>({})},filterable:{type:Boolean,default:!1},trtcProxy:{type:[String,Object]}},emits:["template-click","unread-message-update","session-change","session-close"],setup(e,{expose:$,emit:q}){const M=e;C.defaults.baseURL=M.baseURL,C.defaults.headers.Authorization="bearer "+M.token;const N=t(!1),R=L(M,q);o(V,R),B(M,R);const{cssVars:A,state:D,openSession:F,closeSession:O,getCurrentSession:P,isEnded:z}=R;return $({getUnreadData:function(){return D.sessionList.filter((e=>I(e.unreadNum)&&e.unreadNum>0))},openSession:F,closeSession:O,getCurrentSession:P}),(t,o)=>e.show?(s(),r("div",{key:0,class:"iho-chat",style:a(n(A))},[i(n(f),{abstract:"",namespace:"iho-chat__popover"},{default:l((()=>{var o;return[N.value?(s(),u(n(h),{key:0,stroke:"#5585f5"})):(s(),r(d,{key:1},[e.showHeader?(s(),r("div",H,[i(b),i(_,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.31"))||"发起群聊",mode:"create","default-value":[n(D).userInfo]},null,8,["default-value"]),m("div",U,[p(t.$slots,"toolbar")])])):c("v-if",!0),i(n(v),{class:"iho-chat__body","has-sider":""},{default:l((()=>[i(S),i(n(y),{class:"chat-content",style:a({"--c-pointer-events":n(z)?"none":"unset","--c-cursor":n(z)?"not-allowed":"unset"})},{default:l((()=>[i(g,null,{header:l((()=>[p(t.$slots,"chatHeader",{session:n(D).currentSessionItem})])),_:3}),i(j),i(k,null,{footer:l((()=>[p(t.$slots,"chatFooter",{session:n(D).currentSessionItem})])),_:3})])),_:3},8,["style"]),p(t.$slots,"external")])),_:3}),n(D).showVideo?(s(),u(w,{key:1})):c("v-if",!0),n(D).showMultipleVideo?(s(),u(x,{key:2})):c("v-if",!0)],64))]})),_:3})],4)):c("v-if",!0)}});export{$ as default};