cnhis-design-vue 3.2.15-beta.2 → 3.2.15-beta.8
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.
- package/README.md +87 -87
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/branch-notice/index.d.ts +393 -6
- package/es/components/branch-notice/src/BranchNotice.vue.d.ts +369 -6
- package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -1
- package/es/components/branch-notice/src/canstants.d.ts +2 -1
- package/es/components/branch-notice/src/canstants.js +1 -1
- package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +168 -44
- package/es/components/branch-notice/src/components/NoticeItem.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItem.vue2.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +74 -5
- package/es/components/branch-notice/src/components/NoticeItemAside.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItemAside.vue2.js +1 -0
- package/es/components/branch-notice/src/components/NoticeOperationList.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeOperationList.vue2.js +1 -0
- package/es/components/branch-notice/src/drawLine.js +1 -1
- package/es/components/branch-notice/src/hooks/useTheme.d.ts +1 -0
- package/es/components/branch-notice/src/hooks/useTheme.js +1 -0
- package/es/components/branch-notice/src/types.d.ts +22 -4
- package/es/components/branch-notice/style/index.css +1 -1
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/fabric-chart/src/hooks/{temperature/useShadow.d.ts → useShadow.d.ts} +2 -2
- package/es/components/fabric-chart/src/hooks/useShadow.js +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +261 -27
- package/es/components/iho-chat/src/Index.vue.d.ts +261 -27
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +11 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +34 -34
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +4 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +2 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +203 -4
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/components/userItemRender.d.ts +18 -0
- package/es/components/iho-chat/src/components/userItemRender.js +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +2 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/template-render/src/components/index.d.ts +23 -23
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/hooks/temperature/useShadow.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as d,createVNode as c,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as w,createTextVNode as y}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as T}from"@vueuse/core";import{format as x,isSameWeek as S,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as z,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";import E from"./ChatAdd.vue.js";const O={class:"label"},$={class:"image-box"},F={class:"file-type"},P={class:"text"},R={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=T(ae,500),te={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),te.lastSendTime=null==(e=B(o))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{var o,a;const n=new Date(e.sendTime);let i=x(n,"yyyy年MM月");S(n,new Date)?i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=te.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await z(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}D(X,(()=>{oe()})),D(Y,(()=>{oe()}));const ne=o((()=>{var e,t;return"image"===V.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${x(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",a=o.lastIndexOf(".");if(-1!==a){return o.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,o)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(d("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[c(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[d("span",O,g(e.label),1),d("div",$,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(d("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:w(r(q))},[c(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":o[0]||(o[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[c(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),d("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var o;return n(),m("div",{class:"file-item",key:t},[d("span",F,g(re(e)),1),d("div",P,[d("span",R,g(e.content.msg),1),d("span",G,g(ie(e)),1)]),d("div",N,[c(E,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.
|
1
|
+
import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as d,createVNode as c,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as w,createTextVNode as y}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as T}from"@vueuse/core";import{format as x,isSameWeek as S,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as z,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";import E from"./ChatAdd.vue.js";const O={class:"label"},$={class:"image-box"},F={class:"file-type"},P={class:"text"},R={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=T(ae,500),te={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),te.lastSendTime=null==(e=B(o))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{var o,a;const n=new Date(e.sendTime);let i=x(n,"yyyy年MM月");S(n,new Date)?i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=te.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await z(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}D(X,(()=>{oe()})),D(Y,(()=>{oe()}));const ne=o((()=>{var e,t;return"image"===V.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${x(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",a=o.lastIndexOf(".");if(-1!==a){return o.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,o)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(d("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[c(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[d("span",O,g(e.label),1),d("div",$,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(d("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:w(r(q))},[c(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":o[0]||(o[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[c(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),d("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var o;return n(),m("div",{class:"file-item",key:t},[d("span",F,g(re(e)),1),d("div",P,[d("span",R,g(e.content.msg),1),d("span",G,g(ie(e)),1)]),d("div",N,[c(E,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:(t,o)=>r(K)({content:e.content,checkedIds:t,remark:o})},{trigger:s((()=>[c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(j)},null,8,["component"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发")]})),_:1})])),_:2},1032,["onComfirm"]),c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(I),onClick:()=>r(U)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载")]})),_:2},1024)])])})),128))],512)],4),[[v,"image"!==e.type]])]})),_:1},8,["title"]))}});export{V as default};
|
@@ -6,6 +6,7 @@ import { FileOptions } from '../types';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
inputRef: Ref<HTMLDivElement | undefined>;
|
8
8
|
state: {
|
9
|
+
filterable: boolean;
|
9
10
|
orgId: string | number;
|
10
11
|
currentSessionItem: AnyObject;
|
11
12
|
id: string;
|
@@ -109,6 +110,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
109
110
|
}>>;
|
110
111
|
emit: (event: "comfirm", ...args: any[]) => void;
|
111
112
|
state: {
|
113
|
+
filterable: boolean;
|
112
114
|
orgId: string | number;
|
113
115
|
currentSessionItem: AnyObject;
|
114
116
|
id: string;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
3
|
state: {
|
4
|
+
filterable: boolean;
|
4
5
|
orgId: string | number;
|
5
6
|
currentSessionItem: AnyObject;
|
6
7
|
id: string;
|
@@ -70,6 +71,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
70
71
|
}>>;
|
71
72
|
emit: (event: "close", ...args: any[]) => void;
|
72
73
|
state: {
|
74
|
+
filterable: boolean;
|
73
75
|
orgId: string | number;
|
74
76
|
currentSessionItem: AnyObject;
|
75
77
|
id: string;
|
@@ -88,7 +90,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
88
90
|
currentGroupUser: AnyObject[];
|
89
91
|
showMultipleVideo: boolean;
|
90
92
|
};
|
91
|
-
openSession: (
|
93
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
92
94
|
showUserDetail: import("vue").Ref<boolean>;
|
93
95
|
showLargeAvatar: import("vue").Ref<boolean>;
|
94
96
|
showPhone: import("vue").Ref<boolean>;
|
@@ -136,6 +138,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
136
138
|
[x: string]: unknown;
|
137
139
|
};
|
138
140
|
state: {
|
141
|
+
filterable: boolean;
|
139
142
|
orgId: string | number;
|
140
143
|
currentSessionItem: AnyObject;
|
141
144
|
id: string;
|
@@ -210,6 +213,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
210
213
|
}>>;
|
211
214
|
emit: (event: "close", ...args: any[]) => void;
|
212
215
|
state: {
|
216
|
+
filterable: boolean;
|
213
217
|
orgId: string | number;
|
214
218
|
currentSessionItem: AnyObject;
|
215
219
|
id: string;
|
@@ -228,7 +232,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
228
232
|
currentGroupUser: AnyObject[];
|
229
233
|
showMultipleVideo: boolean;
|
230
234
|
};
|
231
|
-
openSession: (
|
235
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
232
236
|
showUserDetail: import("vue").Ref<boolean>;
|
233
237
|
showLargeAvatar: import("vue").Ref<boolean>;
|
234
238
|
showPhone: import("vue").Ref<boolean>;
|
@@ -325,6 +329,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
325
329
|
}>>;
|
326
330
|
emit: (event: "comfirm", ...args: any[]) => void;
|
327
331
|
state: {
|
332
|
+
filterable: boolean;
|
328
333
|
orgId: string | number;
|
329
334
|
currentSessionItem: AnyObject;
|
330
335
|
id: string;
|
@@ -436,6 +441,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
436
441
|
}>> & {}>>;
|
437
442
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
438
443
|
state: {
|
444
|
+
filterable: boolean;
|
439
445
|
orgId: string | number;
|
440
446
|
currentSessionItem: AnyObject;
|
441
447
|
id: string;
|
@@ -543,6 +549,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
543
549
|
}>>;
|
544
550
|
emit: (event: "comfirm", ...args: any[]) => void;
|
545
551
|
state: {
|
552
|
+
filterable: boolean;
|
546
553
|
orgId: string | number;
|
547
554
|
currentSessionItem: AnyObject;
|
548
555
|
id: string;
|
@@ -660,6 +667,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
660
667
|
};
|
661
668
|
}>> & {}>>;
|
662
669
|
state: {
|
670
|
+
filterable: boolean;
|
663
671
|
orgId: string | number;
|
664
672
|
currentSessionItem: AnyObject;
|
665
673
|
id: string;
|
@@ -892,6 +900,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
892
900
|
}>>;
|
893
901
|
emit: (event: "comfirm", ...args: any[]) => void;
|
894
902
|
state: {
|
903
|
+
filterable: boolean;
|
895
904
|
orgId: string | number;
|
896
905
|
currentSessionItem: AnyObject;
|
897
906
|
id: string;
|
@@ -6,6 +6,7 @@ import { MESSAGE_TYPE } from '../constants';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
8
8
|
state: {
|
9
|
+
filterable: boolean;
|
9
10
|
orgId: string | number;
|
10
11
|
currentSessionItem: AnyObject;
|
11
12
|
id: string;
|
@@ -96,6 +97,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
96
97
|
}>>;
|
97
98
|
emit: (event: "close", ...args: any[]) => void;
|
98
99
|
state: {
|
100
|
+
filterable: boolean;
|
99
101
|
orgId: string | number;
|
100
102
|
currentSessionItem: AnyObject;
|
101
103
|
id: string;
|
@@ -114,7 +116,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
114
116
|
currentGroupUser: AnyObject[];
|
115
117
|
showMultipleVideo: boolean;
|
116
118
|
};
|
117
|
-
openSession: (
|
119
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
118
120
|
showUserDetail: import("vue").Ref<boolean>;
|
119
121
|
showLargeAvatar: import("vue").Ref<boolean>;
|
120
122
|
showPhone: import("vue").Ref<boolean>;
|
@@ -330,6 +332,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
330
332
|
}>>;
|
331
333
|
emit: (event: "comfirm", ...args: any[]) => void;
|
332
334
|
state: {
|
335
|
+
filterable: boolean;
|
333
336
|
orgId: string | number;
|
334
337
|
currentSessionItem: AnyObject;
|
335
338
|
id: string;
|
@@ -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">\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.70"))||"转发消息",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.98"))||"转发",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">\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,52 +1,37 @@
|
|
1
|
-
import { PropType } from 'vue';
|
2
|
-
import { AnyObject } from '../../../../shared/types';
|
3
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
4
2
|
listRef: import("vue").Ref<any>;
|
5
3
|
inputRef: import("vue").Ref<any>;
|
6
4
|
showSearch: import("vue").Ref<boolean>;
|
7
5
|
keyword: import("vue").Ref<string>;
|
8
|
-
cssVars: import("vue").ComputedRef<AnyObject>;
|
6
|
+
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
9
7
|
state: {
|
8
|
+
filterable: boolean;
|
10
9
|
orgId: string | number;
|
11
|
-
currentSessionItem: AnyObject;
|
10
|
+
currentSessionItem: import("../../../../shared/types").AnyObject;
|
12
11
|
id: string;
|
13
|
-
userInfo: AnyObject;
|
14
|
-
msgList: AnyObject[];
|
15
|
-
currentMsg: AnyObject;
|
12
|
+
userInfo: import("../../../../shared/types").AnyObject;
|
13
|
+
msgList: import("../../../../shared/types").AnyObject[];
|
14
|
+
currentMsg: import("../../../../shared/types").AnyObject;
|
16
15
|
isAppendMsg: boolean;
|
17
|
-
sessionList: AnyObject[];
|
16
|
+
sessionList: import("../../../../shared/types").AnyObject[];
|
18
17
|
isChangeSession: boolean;
|
19
|
-
updateSessionItem: AnyObject;
|
18
|
+
updateSessionItem: import("../../../../shared/types").AnyObject;
|
20
19
|
isUpdateSession: boolean;
|
21
|
-
currentReferenceMsg: AnyObject | null;
|
22
|
-
currentReEditMsg: AnyObject | null;
|
20
|
+
currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
|
21
|
+
currentReEditMsg: import("../../../../shared/types").AnyObject | null;
|
23
22
|
showVideo: boolean;
|
24
|
-
currentAVMsg: AnyObject;
|
25
|
-
currentGroupUser: AnyObject[];
|
23
|
+
currentAVMsg: import("../../../../shared/types").AnyObject;
|
24
|
+
currentGroupUser: import("../../../../shared/types").AnyObject[];
|
26
25
|
showMultipleVideo: boolean;
|
27
26
|
};
|
28
|
-
|
29
|
-
userList: import("vue").Ref<AnyObject[]>;
|
27
|
+
userList: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
|
30
28
|
handleInput: () => void;
|
31
29
|
currentTabValue: import("vue").Ref<string>;
|
32
|
-
|
33
|
-
item: {
|
34
|
-
type: PropType<AnyObject>;
|
35
|
-
default: () => {};
|
36
|
-
};
|
37
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
38
|
-
item: {
|
39
|
-
type: PropType<AnyObject>;
|
40
|
-
default: () => {};
|
41
|
-
};
|
42
|
-
}>>, {
|
43
|
-
item: AnyObject;
|
44
|
-
}>;
|
45
|
-
groupList: import("vue").ComputedRef<AnyObject[]>;
|
30
|
+
groupList: import("vue").ComputedRef<import("../../../../shared/types").AnyObject[]>;
|
46
31
|
showNoData: import("vue").ComputedRef<boolean>;
|
47
32
|
showAllNoData: import("vue").ComputedRef<boolean>;
|
48
33
|
showGroupNoData: import("vue").ComputedRef<boolean>;
|
49
|
-
|
34
|
+
handleClose: () => void;
|
50
35
|
NPopover: any;
|
51
36
|
NButton: any;
|
52
37
|
NInput: any;
|
@@ -61,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
61
46
|
default: string;
|
62
47
|
};
|
63
48
|
config: {
|
64
|
-
type: PropType<AnyObject>;
|
49
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
65
50
|
default: () => {
|
66
51
|
title: string;
|
67
52
|
content: string;
|
@@ -74,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
74
59
|
default: string;
|
75
60
|
};
|
76
61
|
config: {
|
77
|
-
type: PropType<AnyObject>;
|
62
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
78
63
|
default: () => {
|
79
64
|
title: string;
|
80
65
|
content: string;
|
@@ -98,7 +83,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
98
83
|
default: string;
|
99
84
|
};
|
100
85
|
config: {
|
101
|
-
type: PropType<AnyObject>;
|
86
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
102
87
|
default: () => {
|
103
88
|
title: string;
|
104
89
|
content: string;
|
@@ -108,7 +93,22 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
108
93
|
onReloadPage?: ((...args: any[]) => any) | undefined;
|
109
94
|
}, {
|
110
95
|
type: string;
|
111
|
-
config: AnyObject;
|
96
|
+
config: import("../../../../shared/types").AnyObject;
|
112
97
|
}>>;
|
98
|
+
userItemRender: import("vue").DefineComponent<{
|
99
|
+
item: {
|
100
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
101
|
+
default: () => {};
|
102
|
+
};
|
103
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
104
|
+
item: {
|
105
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
106
|
+
default: () => {};
|
107
|
+
};
|
108
|
+
}>> & {
|
109
|
+
"onItem-click"?: ((...args: any[]) => any) | undefined;
|
110
|
+
}, {
|
111
|
+
item: import("../../../../shared/types").AnyObject;
|
112
|
+
}>;
|
113
113
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
114
114
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as o,openBlock as i,createBlock as u,unref as r,normalizeStyle as s,withCtx as d,createVNode as c,createTextVNode as v,createElementBlock as p,Fragment as g,renderList as f,normalizeClass as w,createCommentVNode as m,withDirectives as y,vShow as h}from"vue";import{NPopover as k,NButton as C,NIcon as L,NInput as _,NTabs as B,NTabPane as j,NDivider as x}from"naive-ui";import{SearchOutline as I}from"@vicons/ionicons5";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import"../api/index.js";import{isGroup as R}from"../utils/index.js";import{trim as U}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as z}from"../hooks/useSearchUserList.js";import D from"../../../default-page/index.js";import S from"./userItemRender.js";var V,$;const q=e("div",{class:"title"},(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.510"))||"联系人",-1),A=e("div",{class:"title"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.575"))||"我的群组",-1),E={class:"user-list-wrapper"};var F=l({__name:"ChatSearch",setup(l){const V=t(),$=t(),F=t(!1),G=t(""),{cssVars:H,state:J}=b(),{userList:K,handleInput:M}=z({wrapperRef:V,keywordRef:G}),N=t("all"),O=n((()=>(G.value||"").replace(/^\s+|\s+$/g,"")?J.sessionList.filter((e=>R(e)&&(null==e?void 0:e.name.includes(G.value)))):[])),P=n((()=>!K.value.length&&!!U(G.value||""))),Q=n((()=>!K.value.length&&!O.value.length&&!!U(G.value||""))),T=n((()=>!O.value.length&&!!U(G.value||"")));function W(){F.value=!1}return a((()=>F.value),(async e=>{var l;e&&(await o(),null==(l=$.value)||l.focus())})),(l,t)=>(i(),u(r(k),{raw:"","content-class":"search-content",class:"search-wrapper",style:s(r(H)),show:F.value,"onUpdate:show":t[4]||(t[4]=e=>F.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:d((()=>[c(r(C),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:d((()=>[c(r(L),{component:r(I),color:"#ffffff80"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.80"))||"搜索联系人")]})),_:1})])),default:d((()=>[c(r(_),{ref_key:"inputRef",ref:$,size:"small",clearable:"",autofocus:"",value:G.value,"onUpdate:value":[t[0]||(t[0]=e=>G.value=e),r(M)]},{prefix:d((()=>[c(r(L),{color:"#ffffff80",component:r(I)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),c(r(B),{type:"line",animated:"",value:N.value,"onUpdate:value":t[3]||(t[3]=e=>N.value=e)},{default:d((()=>{var l,n,a;return[c(r(j),{name:"all",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.571"))||"综合","display-directive":"show",style:{padding:"0 10px 10px"}},{default:d((()=>{var e;return[r(K).length>0?(i(),p(g,{key:0},[q,(i(!0),p(g,null,f(r(K),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(K).length<4?l===r(K).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(K).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[1]||(t[1]=()=>N.value="user")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.573"))||"查看更多联系人")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),r(K).length&&r(O).length?(i(),u(r(x),{key:1})):m("v-if",!0),r(O).length>0?(i(),p(g,{key:2},[A,(i(!0),p(g,null,f(r(O),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(O).length<4?l===r(O).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(O).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[2]||(t[2]=()=>N.value="group")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.574"))||"查看更多群组")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),y(c(r(D),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(Q)]])]})),_:1}),c(r(j),{name:"user",tab:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.510"))||"联系人","display-directive":"show"},{default:d((()=>{var l;return[e("div",{class:"user-list-wrapper",ref_key:"listRef",ref:V},[(i(!0),p(g,null,f(r(K),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(P)]])],512)]})),_:1}),c(r(j),{name:"group",tab:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.572"))||"群组","display-directive":"show"},{default:d((()=>{var l;return[e("div",E,[(i(!0),p(g,null,f(r(O),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(T)]])])]})),_:1})]})),_:1},8,["value"])])),_:1},8,["style","show"]))}});export{F as default};
|
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
[x: string]: unknown;
|
6
6
|
};
|
7
7
|
state: {
|
8
|
+
filterable: boolean;
|
8
9
|
orgId: string | number;
|
9
10
|
currentSessionItem: AnyObject;
|
10
11
|
id: string;
|
@@ -79,6 +80,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
79
80
|
}>>;
|
80
81
|
emit: (event: "close", ...args: any[]) => void;
|
81
82
|
state: {
|
83
|
+
filterable: boolean;
|
82
84
|
orgId: string | number;
|
83
85
|
currentSessionItem: AnyObject;
|
84
86
|
id: string;
|
@@ -97,7 +99,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
97
99
|
currentGroupUser: AnyObject[];
|
98
100
|
showMultipleVideo: boolean;
|
99
101
|
};
|
100
|
-
openSession: (
|
102
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
101
103
|
showUserDetail: import("vue").Ref<boolean>;
|
102
104
|
showLargeAvatar: import("vue").Ref<boolean>;
|
103
105
|
showPhone: import("vue").Ref<boolean>;
|
@@ -194,6 +196,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
194
196
|
}>>;
|
195
197
|
emit: (event: "comfirm", ...args: any[]) => void;
|
196
198
|
state: {
|
199
|
+
filterable: boolean;
|
197
200
|
orgId: string | number;
|
198
201
|
currentSessionItem: AnyObject;
|
199
202
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as o,withDirectives as i,createVNode as s,vShow as n,isVNode as a}from"vue";import{NButtonGroup as l,NButton as r,NIcon as d}from"naive-ui";import{CopyOutline as c,OpenOutline as u,ChatbubbleEllipsesOutline as p,ReturnDownBack as m,DownloadOutline as w}from"@vicons/ionicons5";import{onClickOutside as g}from"@vueuse/core";import{useData as y}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as f,MESSAGE_TYPE as v}from"../constants/index.js";import{recallMessageApi as h}from"../api/index.js";import{isAudioOrVideoMessage as T,$message as b,downloadFile as I}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{emojis as E}from"../utils/emoji.js";import{format as j}from"date-fns";var k=e({name:"PopupMenu",inheritAttrs:!1,props:{type:{type:String,default:"message"},show:{type:Boolean,default:!1},position:{type:Object},id:{type:String}},emits:["update:show","select"],setup(e,{attrs:k,slots:M,emit:L}){var D,x,S,A,B;const{state:C,setCurrentSessionItem:O}=y(),W=[{icon:c,label:(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.97"))||"复制",key:"copy"},{icon:u,label:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.
|
1
|
+
import{defineComponent as e,ref as t,computed as o,withDirectives as i,createVNode as s,vShow as n,isVNode as a}from"vue";import{NButtonGroup as l,NButton as r,NIcon as d}from"naive-ui";import{CopyOutline as c,OpenOutline as u,ChatbubbleEllipsesOutline as p,ReturnDownBack as m,DownloadOutline as w}from"@vicons/ionicons5";import{onClickOutside as g}from"@vueuse/core";import{useData as y}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as f,MESSAGE_TYPE as v}from"../constants/index.js";import{recallMessageApi as h}from"../api/index.js";import{isAudioOrVideoMessage as T,$message as b,downloadFile as I}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{emojis as E}from"../utils/emoji.js";import{format as j}from"date-fns";var k=e({name:"PopupMenu",inheritAttrs:!1,props:{type:{type:String,default:"message"},show:{type:Boolean,default:!1},position:{type:Object},id:{type:String}},emits:["update:show","select"],setup(e,{attrs:k,slots:M,emit:L}){var D,x,S,A,B;const{state:C,setCurrentSessionItem:O}=y(),W=[{icon:c,label:(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.97"))||"复制",key:"copy"},{icon:u,label:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.45"))||"转发",key:"relay"},{icon:p,label:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.99"))||"回复",key:"reply"},{icon:m,label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.101"))||"撤回",key:"withdraw"},{icon:w,label:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.102"))||"下载",key:"download"}],$=[{label:"置顶会话",key:"topping"},{label:"移除会话",key:"remove"}],H=t(null),J=o((()=>("message"===e.type?C.msgList:C.sessionList).find((({id:t})=>t===e.id)))),N=o((()=>{var t;if(!e.id)return[];if(!(null==J?void 0:J.value))return[];if("session"===e.type){const e=[...$];return e[0].label=(null==(t=J.value)?void 0:t.topping)?"取消置顶":"置顶会话",J.value.status===f.ENDED&&e.pop(),e}const{content:o={},sendTime:i,sender:s}=J.value,{chatMessageType:n}=o,a=[];return(s!==C.userInfo.id||n===v.TEMPLATE||s===C.userInfo.id&&Date.now()-new Date(i).getTime()>2592e5)&&a.push("withdraw"),[v.TEXT,v.EMOJI,v.BLEND].includes(n)?a.push("download"):T(o)?a.push("copy","relay","reply","download"):n===v.FILE?a.push("copy"):[v.FORWARD,v.TEMPLATE].includes(n)&&a.push("copy","download"),a.length?W.filter((e=>!a.includes(e.key))):W}));return g(H,(e=>{L("update:show",!1)})),()=>{let t;return e.id&&N.value?i(s("div",{class:"contextmenu-wrapper",ref:H,style:e.position},[s(l,{vertical:!0},(o=t=N.value.map((t=>s(r,{key:t.key,onClick:()=>async function(t){L("update:show",!1);const{content:o={},sendTime:i,sender:s}=J.value||{},{chatMessageType:n}=o;switch(t){case"copy":if(!o.msg)return console.log("复制内容为空!");if(!navigator||!("clipboard"in navigator))return console.log("当前浏览器版本不支持复制!");try{if(n===v.TEXT)await navigator.clipboard.writeText(o.msg);else{let e;if([v.EMOJI,v.IMAGE].includes(n)){const t=n===v.EMOJI?E.findEmoji(o.msg):o.msg;e=`<img data-msg=${o.msg} data-type=${n} class=${n===v.EMOJI?"emoji--min":""} src=${t} />`}else e=o.msg;await navigator.clipboard.write([new window.ClipboardItem({"text/html":new Blob([e],{type:"text/html"})})])}}catch(e){console.log("复制失败!")}return;case"download":{let{fileUrl:e,msg:t}=o;return n===v.IMAGE&&(e=t,t=t.match(/\/([^\/?#]+)$/)[1]),void I(e,t)}case"withdraw":try{const t=C.msgList.findIndex((({id:t})=>t===e.id)),o=0===t;if(await h({chatType:C.currentSessionItem.chatType,messageIdSet:[e.id],receiver:C.currentSessionItem.receiver,sender:C.userInfo.id,isLastMessage:o}),C.msgList[t].status="WITHDRAWN",o){const e=j(new Date,"yyyy-MM-dd HH:mm:ss");O({lastMessageStatus:"WITHDRAWN",lastMessageSendTime:e,sortTime:e,updatedTime:e})}}catch(e){b.error("撤回失败")}return}L("select",t,J.value)}(t.key),quaternary:!0},{default:()=>t.label,icon:()=>t.icon?s(d,{component:t.icon},null):null}))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!a(o)?t:{default:()=>[t]}))]),[[n,e.show]]):null;var o}}});export{k as default};
|
@@ -7,6 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
7
7
|
name: string;
|
8
8
|
}[]>;
|
9
9
|
state: {
|
10
|
+
filterable: boolean;
|
10
11
|
orgId: string | number;
|
11
12
|
currentSessionItem: AnyObject;
|
12
13
|
id: string;
|
@@ -124,6 +125,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
124
125
|
}>>;
|
125
126
|
emit: (event: "comfirm", ...args: any[]) => void;
|
126
127
|
state: {
|
128
|
+
filterable: boolean;
|
127
129
|
orgId: string | number;
|
128
130
|
currentSessionItem: AnyObject;
|
129
131
|
id: string;
|
@@ -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
|
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 L}from"../api/index.js";import"@vueuse/core";import{$message as x}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 D={class:"video-wrapper video-wrapper--multiple"},O={class:"video-header"},P={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,voiceOpen:N,isAudio:me,isCall:pe,startTimer:ve,resetTimer:ge,toggleAudio:we,messageTypeText:fe,timing:he,toggleVideo:ye,videocamOpen:ke,installEventHandlers:Ie,uninstallEventHandlers:be}=B(),Ae=t(!1),Ce=n((()=>pe.value?H.userInfo.name:H.currentAVMsg.sendName)),Ve=n((()=>{if(!Ae.value)return"";const e=pe.value?`(${$.value.length+1}/${H.currentAVMsg.checkedIds.length+1})`:"";return`${Ce.value}发起的${fe.value}会诊${e} ${he.value}`}));function Me(e){console.log("checkedIds :>> ",e),H.currentAVMsg.checkedIds.push(...e),_e()}function _e(){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})})),Ae.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}),Ae.value=!0,ve(),Ie({handleError:Se,handleRemoteUserEnter:Te,handleRemoteAudioAvailable:Ee,handleRemoteUserExit:je,handleRemoteVideoAvailable:Re}),await z.startLocalAudio(),me.value)return;await z.startLocalVideo({view:S.value})}catch(e){console.log("error :>> ",e),x.error(e),H.showMultipleVideo=!1}}async function xe(){try{if(H.showMultipleVideo=!1,be({handleError:Se,handleRemoteUserEnter:Te,handleRemoteAudioAvailable:Ee,handleRemoteUserExit:je,handleRemoteVideoAvailable:Re}),await z.exitRoom(),await z.stopLocalAudio(),me.value)return;await z.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Re(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 Ee(e){var o;const{userId:t}=e;if(t&&!(null==(o=$.value.map((e=>e.id)))?void 0:o.includes(t))){const e=await Be(t);$.value.push({id:t,name:e})}}async function Te(e){const{userId:o}=e,t=await Be(o);$.value.push({id:o,name:t}),ve()}async function Be(e){const o=await L({userId:e});return(null==o?void 0:o.name)||""}function je(e){console.log("event :>> 退房",e);const{userId:o}=e;$.value=R($.value,[{id:o,name:""}],"id")}function Se(e){console.log("error :>> ",e),H.showMultipleVideo=!1}return l((()=>{xe()})),(o,t)=>{var n,l,f,L,x,R;return i(),a("div",D,[e("div",O,[s(e("span",{class:"title"},r(d(Ve)),513),[[c,Ae.value]]),u(d(h),{quaternary:"",circle:"",color:"#ffffffcc",onClick:xe},{icon:m((()=>[u(d(y),{component:d(I)},null,8,["component"])])),_:1})]),Ae.value?(i(),a("div",P,[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(N)?"#fff":"#000",onClick:d(we)},{icon:m((()=>[u(d(y),{component:d(N)?d(b):d(A)},null,8,["component"])])),_:1},8,["color","onClick"]),K]),e("div",Q,[u(d(h),{text:"",color:d(ke)?"#fff":"#000",disabled:d(me),onClick:d(ye)},{icon:m((()=>[u(d(y),{component:d(ke)?d(C):d(V)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),W]),e("div",{class:"btn",onClick:xe},[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:Me},{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(Ce))+((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.108"))||"发起的")+r(d(fe))+((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.109"))||"会议"),1),d(pe)?g("v-if",!0):(i(),a("span",ie,((null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.110"))||"邀请你加入")+r(d(fe))+((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.109"))||"会议"),1))]),d(pe)?(i(),a("div",ae,[u(k,{onComfirm:Me,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==(x=window.getLanguageByCode)?void 0:x.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:_e},{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};
|
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
24
|
}>>;
|
25
25
|
emit: (event: "close", ...args: any[]) => void;
|
26
26
|
state: {
|
27
|
+
filterable: boolean;
|
27
28
|
orgId: string | number;
|
28
29
|
currentSessionItem: AnyObject;
|
29
30
|
id: string;
|
@@ -42,7 +43,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
42
43
|
currentGroupUser: AnyObject[];
|
43
44
|
showMultipleVideo: boolean;
|
44
45
|
};
|
45
|
-
openSession: (
|
46
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
46
47
|
showUserDetail: import("vue").Ref<boolean>;
|
47
48
|
showLargeAvatar: import("vue").Ref<boolean>;
|
48
49
|
showPhone: import("vue").Ref<boolean>;
|
@@ -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
|
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};
|