cnhis-design-vue 3.2.7-beta.0 → 3.2.7-beta.10

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 (137) hide show
  1. package/README.md +87 -87
  2. package/es/components/classification/index.d.ts +39 -0
  3. package/es/components/classification/src/components/search-filter/index.vue.d.ts +39 -0
  4. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  5. package/es/components/classification/src/components/set-classification/index.vue.d.ts +39 -0
  6. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  7. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  8. package/es/components/classification/src/index.vue.d.ts +39 -0
  9. package/es/components/date-picker/index.d.ts +13 -0
  10. package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
  11. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  12. package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
  13. package/es/components/fabric-chart/src/constants/index.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
  16. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  18. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  21. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  23. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
  27. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  29. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  30. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  31. package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
  32. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  33. package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
  34. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
  35. package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
  36. package/es/components/form-config/index.d.ts +3 -3
  37. package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
  38. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
  39. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  40. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  41. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  42. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  43. package/es/components/form-render/src/utils/schema.d.ts +1 -1
  44. package/es/components/form-render/src/utils/schema.js +1 -1
  45. package/es/components/iho-chat/index.d.ts +160 -45
  46. package/es/components/iho-chat/src/Index.vue.d.ts +160 -45
  47. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  48. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +25 -10
  49. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  50. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +29 -10
  51. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +39 -11
  53. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  54. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +21 -5
  55. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  56. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
  57. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  58. package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
  59. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  60. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +25 -10
  61. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  62. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  63. package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
  64. package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
  65. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  66. package/es/components/iho-chat/style/index.css +1 -1
  67. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
  70. package/es/components/index.css +1 -1
  71. package/es/components/quick-search/src/index.vue2.js +1 -1
  72. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  73. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  74. package/es/components/shortcut-setter/index.d.ts +1 -1
  75. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  76. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  77. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  78. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
  79. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
  80. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
  81. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
  82. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +26 -0
  83. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
  84. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
  85. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  86. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +26 -0
  87. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +26 -0
  88. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
  89. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
  90. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
  91. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
  92. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
  93. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  94. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  95. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +52 -0
  96. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +52 -0
  97. package/es/components/time-picker/index.d.ts +20 -2
  98. package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
  99. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  100. package/es/env.d.ts +25 -25
  101. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  102. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  103. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  104. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  105. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  106. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  107. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  108. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  109. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  110. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  111. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  112. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  113. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  114. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  115. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  116. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  117. package/es/shared/assets/img/failure.png.js +1 -1
  118. package/es/shared/assets/img/no-permission.png.js +1 -1
  119. package/es/shared/assets/img/nodata.png.js +1 -1
  120. package/es/shared/assets/img/notfound.png.js +1 -1
  121. package/es/shared/assets/img/qr.png.js +1 -1
  122. package/es/shared/assets/img/success.png.js +1 -1
  123. package/es/shared/assets/img/table_style_2.png.js +1 -1
  124. package/es/shared/assets/img/video.png.js +1 -1
  125. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  126. package/es/shared/assets/img/xb_big.png.js +1 -1
  127. package/es/shared/assets/img/xb_small.png.js +1 -1
  128. package/es/shared/package.json.js +1 -1
  129. package/es/shared/utils/business.js +1 -1
  130. package/package.json +2 -2
  131. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  132. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  133. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  134. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  135. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  136. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  137. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as o,createElementBlock as r,Fragment as i,createVNode as s,unref as n,withCtx as u,createElementVNode as d,createCommentVNode as c,renderSlot as p}from"vue";import{NModal as v,NInput as f,NTransfer as m,NButton as h,NIcon as b,NAvatar as g,NTag as y}from"naive-ui";import{AddOutline as I}from"@vicons/ionicons5";import{useState as k}from"../hooks/useState.js";import"date-fns";import{isArray as w,uniqBy as x,xorBy as S}from"lodash-es";import"../utils/emoji.js";import{groupJoinApi as _,groupCreateApi as j}from"../api/index.js";import"trtc-sdk-v5";const C={class:"iho-chat-dialog__content iho-chat-add-wrapper"},A={key:0,class:"input-box"},U=d("span",null,"群名称:",-1),V={class:"transfer-box"};var z=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:z}){const D=e,{state:G}=k(),L=t(!1),M=t([]),O=t([]),P=t(""),$=a((()=>"create"===D.mode?M.value.length<3:M.value.length<1));async function q(){switch(D.mode){case"create":await j({creator:G.userInfo.id,memberIdSet:M.value,name:P.value,orgId:G.orgId});break;case"join":await _({groupId:G.currentSessionItem.receiver,operator:G.userInfo.id,memberIdSet:M.value}),G.currentGroupUser.push(O.value.filter((e=>M.value.includes(e.value))));break;default:z("comfirm",M.value)}L.value=!1}function B({option:e}){return s("div",{style:"display: flex;align-items: center"},[s(g,{src:e.avatar,round:!0,size:32},null),s("span",{style:"margin-left: 10px"},[e.name])])}function E(e){const{onCheck:t,checkedOptions:a,pattern:l}=e;return a.length>0?s("div",{class:"checked-tag-box"},[a.map((e=>s(y,{bordered:!1,closable:e.id!==G.userInfo.id,onClose:()=>t(S(a,[e],"id").map((e=>e.id)))},{avatar:()=>s(g,{round:!0,src:e.avatar},null),default:()=>e.name})))]):null}return l((()=>L.value),(e=>{if(!e)return;const t=w(D.options)&&D.options.length?D.options:G.userList;O.value=x(t,"id").map((e=>{var t;return{...e,label:e.name,value:e.id,disabled:e.id===G.userInfo.id||(null==(t=D.disabledIds)?void 0:t.includes(e.id))}})),w(D.defaultValue)&&D.defaultValue.length?M.value=D.defaultValue:M.value=[]})),(t,a)=>(o(),r(i,null,[s(n(v),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog",show:L.value,"onUpdate:show":a[2]||(a[2]=e=>L.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:n($)},onPositiveClick:q},{default:u((()=>[d("div",C,["create"===e.mode?(o(),r("div",A,[U,s(n(f),{clearable:"",placeholder:"取个群名称方便后续搜索",value:P.value,"onUpdate:value":a[0]||(a[0]=e=>P.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):c("v-if",!0),d("div",V,[s(n(m),{size:"large",value:M.value,"onUpdate:value":a[1]||(a[1]=e=>M.value=e),"virtual-scroll":"",options:O.value,"render-source-label":B,"render-target-list":E,"source-filterable":""},null,8,["value","options"])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:a[3]||(a[3]=e=>L.value=!0)},[p(t.$slots,"trigger",{},(()=>[s(n(h),{color:"#ffffff4D",class:"add-btn"},{icon:u((()=>[s(n(b),{component:n(I),color:"#fff"},null,8,["component"])])),_:1})]))])],64))}});export{z as default};
1
+ import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as i,createElementBlock as n,Fragment as o,createVNode as u,unref as r,withCtx as s,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as f,resolveDynamicComponent as m,toDisplayString as h,renderSlot as b}from"vue";import{NModal as g,NInput as I,NCheckbox as k,NCheckboxGroup as x,NButton as y,NIcon as _,NSpace as w,NAvatar as S,NTag as j}from"naive-ui";import{AddOutline as U}from"@vicons/ionicons5";import{useState as A}from"../hooks/useState.js";import{listSort as C}from"../utils/index.js";import{union as V,unionBy as L,remove as G,isArray as T,uniqBy as z,cloneDeep as D}from"lodash-es";import{CHAT_TYPE as E}from"../constants/index.js";import{groupJoinApi as M,groupCreateApi as N}from"../api/index.js";import"trtc-sdk-v5";const O={class:"iho-chat-dialog__content iho-chat-add-wrapper"},P={key:0,class:"input-box"},$=d("span",null,"群名称:",-1),q={class:"transfer-box"},B={class:"transfer-box__left"},F={class:"user-list-box"},H={class:"transfer-box__right"},J={class:"checked-tag-box"};var K=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:K}){const Q=e,{state:R}=A(),W=t(!1),X=t([]),Y=t([]),Z=t(""),ee=t([]),te=a((()=>V(Q.disabledIds,[R.userInfo.id]))),ae=a((()=>{var e,t;return(null==(e=R.sessionList)?void 0:e.length)?null==(t=C(R.sessionList).filter((e=>e.chatType===E.SINGLE)))?void 0:t.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),le=a((()=>X.value.length?X.value.map((e=>e.id)):[])),ie=a((()=>"create"===Q.mode?le.value.length<3:le.value.length<1)),ne=a({get:()=>ee.value.length===Y.value.filter((e=>!e.disabled)).length,set(e){const t=Y.value.filter((e=>!e.disabled));ee.value=e?t.map((e=>e.id)):[],e?X.value=L(X.value,t,"id"):G(X.value,(e=>t.map((e=>e.id)).includes(e.id)))}});async function oe(){switch(Q.mode){case"create":await N({creator:R.userInfo.id,memberIdSet:le.value,name:Z.value,orgId:R.orgId});break;case"join":await M({groupId:R.currentSessionItem.receiver,operator:R.userInfo.id,memberIdSet:le.value}),R.currentGroupUser.push(Y.value.filter((e=>le.value.includes(e.value))));break;default:K("comfirm",le.value)}W.value=!1}function ue(e,t){if("check"===t.actionType){const e=Y.value.find((e=>e.id===t.value));X.value.push(e)}else G(X.value,(e=>e.id===t.value))}function re(){return X.value.length>0?X.value.map((e=>u(j,{bordered:!1,closable:e.id!==R.userInfo.id,disabled:te.value.includes(e.id),onClose:()=>{return t=e.id,G(X.value,(e=>e.id===t)),void G(ee.value,(e=>e===t));var t}},{avatar:()=>u(S,{round:!0,src:e.avatar},null),default:()=>e.name}))):null}return l((()=>W.value),(e=>{if(!e)return;const t=T(Q.options)&&Q.options.length?Q.options:ae.value;Y.value=z(t,"id").map((e=>{var t;return{...e,disabled:null==(t=te.value)?void 0:t.includes(e.id)}})),T(Q.defaultValue)&&Q.defaultValue.length?X.value=D(Q.defaultValue):X.value=[]})),(t,a)=>(i(),n(o,null,[u(r(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog",show:W.value,"onUpdate:show":a[3]||(a[3]=e=>W.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:r(ie)},onPositiveClick:oe},{default:s((()=>[d("div",O,["create"===e.mode?(i(),n("div",P,[$,u(r(I),{clearable:"",placeholder:"取个群名称方便后续搜索",value:Z.value,"onUpdate:value":a[0]||(a[0]=e=>Z.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",q,[d("div",B,[v(' <n-input placeholder="搜索">\r\n\t\t\t\t\t\t<template #prefix>\r\n\t\t\t\t\t\t\t<n-icon :component="SearchOutline" />\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</n-input> '),d("div",F,[u(r(k),{label:"全选",checked:r(ne),"onUpdate:checked":a[1]||(a[1]=e=>c(ne)?ne.value=e:null)},null,8,["checked"]),u(r(x),{value:ee.value,"onUpdate:value":[a[2]||(a[2]=e=>ee.value=e),ue]},{default:s((()=>[(i(!0),n(o,null,p(Y.value,(e=>(i(),f(r(k),{key:e.id,value:e.id,disabled:e.disabled},{default:s((()=>[(i(),f(m((()=>function({option:e}){return u(w,{align:"center",wrapItem:!1},{default:()=>[u(S,{src:e.avatar,round:!0,size:32},null),u("span",null,[e.name])]})}({option:e})))))])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])])]),d("div",H,[d("span",null,"已选择 "+h(r(le).length)+" 人",1),d("div",J,[(i(),f(m((()=>re()))))])])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:a[4]||(a[4]=e=>W.value=!0)},[b(t.$slots,"trigger",{},(()=>[u(r(y),{color:"#ffffff4D",class:"add-btn"},{icon:s((()=>[u(r(_),{component:r(U),color:"#fff"},null,8,["component"])])),_:1})]))])],64))}});export{K as default};
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<{}, {
17
17
  }) => Promise<void>;
18
18
  isGroupChat: import("vue").ComputedRef<boolean>;
19
19
  showEmoji: import("vue").Ref<boolean>;
20
+ chatAddProps: import("vue").ComputedRef<{
21
+ options: AnyObject[];
22
+ defaultValue: AnyObject[];
23
+ }>;
20
24
  handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
21
25
  handleKeyDown: (event: KeyboardEvent) => void;
22
26
  isWrap: (event: KeyboardEvent) => boolean;
@@ -45,9 +49,10 @@ declare const _default: import("vue").DefineComponent<{}, {
45
49
  };
46
50
  disabledIds: {
47
51
  type: import("vue").PropType<string[]>;
52
+ default: () => never[];
48
53
  };
49
54
  defaultValue: {
50
- type: import("vue").PropType<string[]>;
55
+ type: import("vue").PropType<AnyObject[]>;
51
56
  };
52
57
  }, {
53
58
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -64,9 +69,10 @@ declare const _default: import("vue").DefineComponent<{}, {
64
69
  };
65
70
  disabledIds: {
66
71
  type: import("vue").PropType<string[]>;
72
+ default: () => never[];
67
73
  };
68
74
  defaultValue: {
69
- type: import("vue").PropType<string[]>;
75
+ type: import("vue").PropType<AnyObject[]>;
70
76
  };
71
77
  }>> & {
72
78
  onComfirm?: ((...args: any[]) => any) | undefined;
@@ -74,24 +80,35 @@ declare const _default: import("vue").DefineComponent<{}, {
74
80
  emit: (event: "comfirm", ...args: any[]) => void;
75
81
  state: import("../types").IState;
76
82
  showModal: import("vue").Ref<boolean>;
77
- checkedIds: import("vue").Ref<(string | number)[]>;
83
+ checkedOptions: import("vue").Ref<AnyObject[]>;
78
84
  options: import("vue").Ref<AnyObject[]>;
79
85
  groupName: import("vue").Ref<string>;
86
+ checkedSourceIds: import("vue").Ref<(string | number)[]>;
87
+ _disabledIds: import("vue").ComputedRef<any[]>;
88
+ defaultOptions: import("vue").ComputedRef<{
89
+ id: any;
90
+ name: any;
91
+ avatar: any;
92
+ }[]>;
93
+ checkedIds: import("vue").ComputedRef<any[]>;
80
94
  btnDisabled: import("vue").ComputedRef<boolean>;
95
+ allChecked: import("vue").WritableComputedRef<boolean>;
81
96
  handlePositiveClick: () => Promise<void>;
97
+ updateSourceIds: (value: (string | number)[], meta: {
98
+ actionType: "check" | "uncheck";
99
+ value: string | number;
100
+ }) => void;
82
101
  renderSourceLabel: ({ option }: {
83
102
  option: AnyObject;
84
103
  }) => JSX.Element;
85
- renderTargetList: (props: {
86
- onCheck: (checkedValueList: (string | number)[]) => void;
87
- checkedOptions: AnyObject[];
88
- pattern: string;
89
- }) => JSX.Element | null;
104
+ closeTag: (id: string) => void;
105
+ renderTargetList: () => JSX.Element[] | null;
90
106
  NModal: any;
91
107
  NButton: any;
92
- NTransfer: any;
93
108
  NIcon: any;
94
109
  NInput: any;
110
+ NCheckbox: any;
111
+ NCheckboxGroup: any;
95
112
  AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
96
113
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
114
  title: {
@@ -107,15 +124,17 @@ declare const _default: import("vue").DefineComponent<{}, {
107
124
  };
108
125
  disabledIds: {
109
126
  type: import("vue").PropType<string[]>;
127
+ default: () => never[];
110
128
  };
111
129
  defaultValue: {
112
- type: import("vue").PropType<string[]>;
130
+ type: import("vue").PropType<AnyObject[]>;
113
131
  };
114
132
  }>> & {
115
133
  onComfirm?: ((...args: any[]) => any) | undefined;
116
134
  }, {
117
135
  mode: string;
118
136
  title: string;
137
+ disabledIds: string[];
119
138
  }>;
120
139
  emojis: {
121
140
  default: string[][];
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as n,withDirectives as o,openBlock as i,createElementBlock as s,normalizeStyle as r,unref as a,createElementVNode as l,toDisplayString as c,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as y,vShow as h}from"vue";import{NIcon as v,NPopover as M,NButton as k,NTooltip as C,NUpload as _,NUploadTrigger as x}from"naive-ui";import I from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as T,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as E}from"../utils/index.js";import{emojis as j}from"../utils/emoji.js";import{uploadFileApi as R}from"../api/index.js";import{CloseCircleOutline as q,CallOutline as L,VideocamOutline as D}from"@vicons/ionicons5";import{xor as O,cloneDeep as A}from"lodash-es";import{uuidGenerator as U}from"../../../../shared/utils/index.js";const V={key:0,class:"reference-content-box"},F={class:"reference-content"},K=["innerHTML"],G={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),H={class:"emoji-box"},N=l("span",null,"默认表情",-1),J={class:"list-box"},X=["src"],B=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),P=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),W={class:"btn-box"},Y=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Z=e({__name:"ChatFooter",setup(e){const Z=t(),$=t(""),{state:ee,sendMessage:te}=b(),{isGroupChat:ne}=w(ee),oe=t(!1);function ie(e,t=[]){const n=U(),o=[],i=t.length>0;ee.showVideo||ee.showMultipleVideo||(i?(o.push(...O(t,[ee.userInfo.id])),Object.assign(ee.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ee.showMultipleVideo=!0):te({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function se(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),le()))}function re(){var e,t;$.value=(null==(t=null==(e=Z.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ae(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ee.userInfo.id),i.append("file",n);const s=await R(i);if(!s)return console.log("上传失败");ce({chatMessageType:t,msg:t===T.FILE?o:s,url:s})}function le(){if(!($.value.length>2e3))return $.value?void ce({msg:$.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function ce(e){const{chatMessageType:t=T.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===T.FILE&&(i.fileUrl=o),[T.TEXT,T.BLEND].includes(t)&&(Z.value.innerHTML="",$.value=""),ee.currentReferenceMsg&&(i.referenceContent=A(ee.currentReferenceMsg),ee.currentReferenceMsg=null),te({content:i})}return n((()=>ee.currentReferenceMsg),(e=>{var t;e&&(null==(t=Z.value)||t.focus())})),(e,t)=>o((i(),s("section",{class:"chat-footer",style:r({cursor:a(ee).id?"default":"not-allowed"})},[a(ee).currentReferenceMsg?(i(),s("div",V,[l("div",F,[l("span",null,c(a(ee).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:a(E)(a(ee).currentReferenceMsg.content)},null,8,K)]),u(a(v),{component:a(q),onClick:t[0]||(t[0]=()=>a(ee).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",G,[u(a(M),{show:oe.value,"onUpdate:show":t[1]||(t[1]=e=>oe.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[S])),_:1})])),default:f((()=>[l("div",H,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),N,l("div",J,[(i(!0),s(p,null,m(a(j).default,(([e,t])=>(i(),g(a(C),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny",onClick:()=>function(e){oe.value=!1,ce({chatMessageType:T.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,X)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+c(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),u(a(k),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>ce({chatMessageType:a(T).EMOJI,msg:0}))},{icon:f((()=>[B])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ae(e,a(T).IMAGE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[P])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ae(e,a(T).FILE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),_:1})])),_:1}),a(ne)?(i(),s(p,{key:0},[u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[5]||(t[5]=e=>ie(a(T).AUDIO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"]),u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[6]||(t[6]=e=>ie(a(T).VIDEO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"])],64)):(i(),s(p,{key:1},[u(a(k),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ie(a(T).AUDIO))},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1}),u(a(k),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ie(a(T).VIDEO))},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})],64))]),o(l("div",{ref_key:"inputRef",ref:Z,class:"input-box",contenteditable:"",onKeydown:se,onInput:re},null,544),[[h,a(ee).id]]),l("div",W,[Y,u(a(k),{type:"primary",round:"",disabled:!$.value,onClick:le},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[h,a(ee).id]])}});export{Z as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as d,createCommentVNode as f,withCtx as m,Fragment as p,renderList as g,createBlock as y,createTextVNode as h,mergeProps as v,vShow as M}from"vue";import{NIcon as k,NPopover as C,NButton as _,NTooltip as x,NUpload as I,NUploadTrigger as b}from"naive-ui";import w from"./ChatAdd.vue.js";import{useState as T}from"../hooks/useState.js";import{useSession as z}from"../hooks/useSession.js";import{MESSAGE_TYPE as E,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as R}from"../utils/index.js";import{emojis as q}from"../utils/emoji.js";import{uploadFileApi as L}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as O,VideocamOutline as V}from"@vicons/ionicons5";import{xor as A,cloneDeep as F}from"lodash-es";import{uuidGenerator as K}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},S={class:"reference-content"},G=["innerHTML"],H={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),J={class:"emoji-box"},X=l("span",null,"默认表情",-1),B={class:"list-box"},P=["src"],Q=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Y=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Z={class:"btn-box"},$=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var ee=e({__name:"ChatFooter",setup(e){const ee=t(),te=t(""),{state:ne,sendMessage:oe}=T(),{isGroupChat:ie}=z(ne),se=t(!1),re=n((()=>({options:ne.currentGroupUser,defaultValue:[ne.userInfo]})));function ae(e,t=[]){const n=K(),o=[],i=t.length>0;ne.showVideo||ne.showMultipleVideo||(i?(o.push(...A(t,[ne.userInfo.id])),Object.assign(ne.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ne.showMultipleVideo=!0):oe({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ce(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),de()))}function le(){var e,t;te.value=(null==(t=null==(e=ee.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ue(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ne.userInfo.id),i.append("file",n);const s=await L(i);if(!s)return console.log("上传失败");fe({chatMessageType:t,msg:t===E.FILE?o:s,url:s})}function de(){if(!(te.value.length>2e3))return te.value?void fe({msg:te.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function fe(e){const{chatMessageType:t=E.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===E.FILE&&(i.fileUrl=o),[E.TEXT,E.BLEND].includes(t)&&(ee.value.innerHTML="",te.value=""),ne.currentReferenceMsg&&(i.referenceContent=F(ne.currentReferenceMsg),ne.currentReferenceMsg=null),oe({content:i})}return o((()=>ne.currentReferenceMsg),(e=>{var t;e&&(null==(t=ee.value)||t.focus())})),(e,t)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ne).id?"default":"not-allowed"})},[c(ne).currentReferenceMsg?(s(),r("div",U,[l("div",S,[l("span",null,u(c(ne).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(R)(c(ne).currentReferenceMsg.content)},null,8,G)]),d(c(k),{component:c(D),onClick:t[0]||(t[0]=()=>c(ne).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),l("div",H,[d(c(C),{show:se.value,"onUpdate:show":t[1]||(t[1]=e=>se.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[N])),_:1})])),default:m((()=>[l("div",J,[f(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),X,l("div",B,[(s(!0),r(p,null,g(c(q).default,(([e,t])=>(s(),y(c(x),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny",onClick:()=>function(e){se.value=!1,fe({chatMessageType:E.EMOJI,msg:e})}(e)},{icon:m((()=>[l("img",{src:t},null,8,P)])),_:2},1032,["onClick"])])),default:m((()=>[h(" "+u(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),d(c(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>fe({chatMessageType:c(E).EMOJI,msg:0}))},{icon:m((()=>[Q])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,c(E).IMAGE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[W])),_:2},1032,["onClick"])])),_:1})])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,c(E).FILE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[Y])),_:2},1032,["onClick"])])),_:1})])),_:1}),c(ie)?(s(),r(p,{key:0},[d(w,v(c(re),{onComfirm:t[5]||(t[5]=e=>ae(c(E).AUDIO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1})])),_:1},16),d(w,v(c(re),{onComfirm:t[6]||(t[6]=e=>ae(c(E).VIDEO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),_:1},16)],64)):(s(),r(p,{key:1},[d(c(_),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ae(c(E).AUDIO))},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1}),d(c(_),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ae(c(E).VIDEO))},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:ee,class:"input-box",contenteditable:"",onKeydown:ce,onInput:le},null,544),[[M,c(ne).id]]),l("div",Z,[$,d(c(_),{type:"primary",round:"",disabled:!te.value,onClick:de},{default:m((()=>[h("发送")])),_:1},8,["disabled"])])],4)),[[M,c(ne).id]])}});export{ee as default};
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{}, {
12
12
  defaultValue?: undefined;
13
13
  } | {
14
14
  mode: string;
15
- defaultValue: any[];
15
+ defaultValue: AnyObject[];
16
16
  disabledIds?: undefined;
17
17
  }>;
18
18
  handleOpenChatFile: (type: string) => void;
@@ -294,6 +294,10 @@ declare const _default: import("vue").DefineComponent<{}, {
294
294
  allowedInvalidValue: {
295
295
  type: StringConstructor;
296
296
  };
297
+ to: {
298
+ type: import("vue").PropType<string | false | HTMLElement>;
299
+ default: string;
300
+ };
297
301
  }, {
298
302
  attrs: {
299
303
  [x: string]: unknown;
@@ -314,6 +318,10 @@ declare const _default: import("vue").DefineComponent<{}, {
314
318
  allowedInvalidValue: {
315
319
  type: StringConstructor;
316
320
  };
321
+ to: {
322
+ type: import("vue").PropType<string | false | HTMLElement>;
323
+ default: string;
324
+ };
317
325
  }>> & {
318
326
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
319
327
  }>>;
@@ -350,10 +358,15 @@ declare const _default: import("vue").DefineComponent<{}, {
350
358
  allowedInvalidValue: {
351
359
  type: StringConstructor;
352
360
  };
361
+ to: {
362
+ type: import("vue").PropType<string | false | HTMLElement>;
363
+ default: string;
364
+ };
353
365
  }>> & {
354
366
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
355
367
  }, {
356
368
  updateUnchangedValue: boolean;
369
+ to: string | false | HTMLElement;
357
370
  }>>;
358
371
  formatTime: typeof import("../utils").formatTime;
359
372
  MESSAGE_TYPE: typeof import("../constants").MESSAGE_TYPE;
@@ -382,9 +395,10 @@ declare const _default: import("vue").DefineComponent<{}, {
382
395
  };
383
396
  disabledIds: {
384
397
  type: import("vue").PropType<string[]>;
398
+ default: () => never[];
385
399
  };
386
400
  defaultValue: {
387
- type: import("vue").PropType<string[]>;
401
+ type: import("vue").PropType<AnyObject[]>;
388
402
  };
389
403
  }, {
390
404
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -401,9 +415,10 @@ declare const _default: import("vue").DefineComponent<{}, {
401
415
  };
402
416
  disabledIds: {
403
417
  type: import("vue").PropType<string[]>;
418
+ default: () => never[];
404
419
  };
405
420
  defaultValue: {
406
- type: import("vue").PropType<string[]>;
421
+ type: import("vue").PropType<AnyObject[]>;
407
422
  };
408
423
  }>> & {
409
424
  onComfirm?: ((...args: any[]) => any) | undefined;
@@ -411,24 +426,35 @@ declare const _default: import("vue").DefineComponent<{}, {
411
426
  emit: (event: "comfirm", ...args: any[]) => void;
412
427
  state: import("../types").IState;
413
428
  showModal: import("vue").Ref<boolean>;
414
- checkedIds: import("vue").Ref<(string | number)[]>;
429
+ checkedOptions: import("vue").Ref<AnyObject[]>;
415
430
  options: import("vue").Ref<AnyObject[]>;
416
431
  groupName: import("vue").Ref<string>;
432
+ checkedSourceIds: import("vue").Ref<(string | number)[]>;
433
+ _disabledIds: import("vue").ComputedRef<any[]>;
434
+ defaultOptions: import("vue").ComputedRef<{
435
+ id: any;
436
+ name: any;
437
+ avatar: any;
438
+ }[]>;
439
+ checkedIds: import("vue").ComputedRef<any[]>;
417
440
  btnDisabled: import("vue").ComputedRef<boolean>;
441
+ allChecked: import("vue").WritableComputedRef<boolean>;
418
442
  handlePositiveClick: () => Promise<void>;
443
+ updateSourceIds: (value: (string | number)[], meta: {
444
+ actionType: "check" | "uncheck";
445
+ value: string | number;
446
+ }) => void;
419
447
  renderSourceLabel: ({ option }: {
420
448
  option: AnyObject;
421
449
  }) => JSX.Element;
422
- renderTargetList: (props: {
423
- onCheck: (checkedValueList: (string | number)[]) => void;
424
- checkedOptions: AnyObject[];
425
- pattern: string;
426
- }) => JSX.Element | null;
450
+ closeTag: (id: string) => void;
451
+ renderTargetList: () => JSX.Element[] | null;
427
452
  NModal: any;
428
453
  NButton: any;
429
- NTransfer: any;
430
454
  NIcon: any;
431
455
  NInput: any;
456
+ NCheckbox: any;
457
+ NCheckboxGroup: any;
432
458
  AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
433
459
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
434
460
  title: {
@@ -444,15 +470,17 @@ declare const _default: import("vue").DefineComponent<{}, {
444
470
  };
445
471
  disabledIds: {
446
472
  type: import("vue").PropType<string[]>;
473
+ default: () => never[];
447
474
  };
448
475
  defaultValue: {
449
- type: import("vue").PropType<string[]>;
476
+ type: import("vue").PropType<AnyObject[]>;
450
477
  };
451
478
  }>> & {
452
479
  onComfirm?: ((...args: any[]) => any) | undefined;
453
480
  }, {
454
481
  mode: string;
455
482
  title: string;
483
+ disabledIds: string[];
456
484
  }>;
457
485
  PersonAddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
458
486
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as s,Fragment as a,unref as n,createElementVNode as r,createVNode as l,withCtx as c,toDisplayString as u,normalizeProps as m,guardReactiveProps as h,createCommentVNode as d}from"vue";import{NAvatar as v,NButton as p,NIcon as f}from"naive-ui";import{useState as y}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import j from"./PersonProfile.vue.js";import w from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import b from"./ChatRecord.vue.js";import g from"./ChatAdd.vue.js";import{PersonAddOutline as k}from"@vicons/ionicons5";const z={key:0,class:"chat-header box-shadow"},S={class:"chat-header__left"},q={class:"name"},I={class:"chat-header__right"},U=r("i",{class:"chat--iconfont chat--icon-image"},null,-1),x=r("i",{class:"chat--iconfont chat--icon-folder"},null,-1),G=r("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),P=r("i",{class:"chat--iconfont chat--icon-set"},null,-1);var A=e({__name:"ChatHeader",setup(e){const{state:A}=y(),{isGroupChat:F}=_(A),H=o(!1),R=o(!1),V=o("image"),B=o(!1),D=i((()=>{const e=A.currentGroupUser.map((e=>e.id));return F.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:e}}));function E(e){V.value=e,R.value=!0}return(e,o)=>(t(),s(a,null,[n(A).id?(t(),s("section",z,[r("div",S,[l(j,{"user-id":n(A).currentSessionItem.receiver,disabled:n(F)},{trigger:c((()=>[l(n(v),{round:"",size:30,src:n(A).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),r("span",q,u(n(A).currentSessionItem.name),1)]),r("div",I,[l(n(p),{quaternary:"",size:"tiny",onClick:o[0]||(o[0]=()=>E("image"))},{icon:c((()=>[U])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[1]||(o[1]=()=>E("file"))},{icon:c((()=>[x])),_:1}),l(g,m(h(n(D))),{trigger:c((()=>[l(n(p),{quaternary:"",size:"tiny"},{icon:c((()=>[l(n(f),{size:"18",component:n(k)},null,8,["component"])])),_:1})])),_:1},16),l(n(p),{quaternary:"",size:"tiny",onClick:o[2]||(o[2]=()=>B.value=!0)},{icon:c((()=>[G])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[3]||(o[3]=()=>H.value=!0)},{icon:c((()=>[P])),_:1})])])):d("v-if",!0),l(w,{show:H.value,"onUpdate:show":o[4]||(o[4]=e=>H.value=e)},null,8,["show"]),l(C,{show:R.value,"onUpdate:show":o[5]||(o[5]=e=>R.value=e),type:V.value,visible:R.value},null,8,["show","type","visible"]),l(b,{show:B.value,"onUpdate:show":o[6]||(o[6]=e=>B.value=e),visible:B.value},null,8,["show","visible"])],64))}});export{A as default};
1
+ import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as s,Fragment as a,unref as r,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,normalizeProps as m,guardReactiveProps as h,createCommentVNode as d}from"vue";import{NAvatar as v,NButton as p,NIcon as f}from"naive-ui";import{useState as y}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import j from"./PersonProfile.vue.js";import w from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import b from"./ChatRecord.vue.js";import g from"./ChatAdd.vue.js";import{PersonAddOutline as k}from"@vicons/ionicons5";const z={key:0,class:"chat-header box-shadow"},S={class:"chat-header__left"},q={class:"name"},U={class:"chat-header__right"},I=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),G=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),x=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),P=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var A=e({__name:"ChatHeader",setup(e){const{state:A}=y(),{isGroupChat:F}=_(A),H=o(!1),R=o(!1),V=o("image"),B=o(!1),D=i((()=>{const e=A.currentGroupUser.map((e=>e.id));return F.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:A.currentGroupUser}}));function E(e){V.value=e,R.value=!0}return(e,o)=>(t(),s(a,null,[r(A).id?(t(),s("section",z,[n("div",S,[l(j,{"user-id":r(A).currentSessionItem.receiver,disabled:r(F)},{trigger:c((()=>[l(r(v),{round:"",size:30,src:r(A).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",q,u(r(A).currentSessionItem.name),1)]),n("div",U,[l(r(p),{quaternary:"",size:"tiny",onClick:o[0]||(o[0]=()=>E("image"))},{icon:c((()=>[I])),_:1}),l(r(p),{quaternary:"",size:"tiny",onClick:o[1]||(o[1]=()=>E("file"))},{icon:c((()=>[G])),_:1}),l(g,m(h(r(D))),{trigger:c((()=>[l(r(p),{quaternary:"",size:"tiny"},{icon:c((()=>[l(r(f),{size:"18",component:r(k)},null,8,["component"])])),_:1})])),_:1},16),l(r(p),{quaternary:"",size:"tiny",onClick:o[2]||(o[2]=()=>B.value=!0)},{icon:c((()=>[x])),_:1}),l(r(p),{quaternary:"",size:"tiny",onClick:o[3]||(o[3]=()=>H.value=!0)},{icon:c((()=>[P])),_:1})])])):d("v-if",!0),l(w,{show:H.value,"onUpdate:show":o[4]||(o[4]=e=>H.value=e)},null,8,["show"]),l(C,{show:R.value,"onUpdate:show":o[5]||(o[5]=e=>R.value=e),type:V.value,visible:R.value},null,8,["show","type","visible"]),l(b,{show:B.value,"onUpdate:show":o[6]||(o[6]=e=>B.value=e),visible:B.value},null,8,["show","visible"])],64))}});export{A as default};
@@ -1,5 +1,6 @@
1
+ import { CSSProperties } from 'vue';
1
2
  import { AnyObject } from '../../../../shared/types';
2
- import { formatTime, downloadFile, simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
3
+ import { downloadFile, simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
3
4
  import { MESSAGE_TYPE } from '../constants';
4
5
  declare const _default: import("vue").DefineComponent<{}, {
5
6
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -7,7 +8,10 @@ declare const _default: import("vue").DefineComponent<{}, {
7
8
  setMsgList: (list?: AnyObject[]) => void;
8
9
  setCurrentSessionItem: (item: AnyObject) => void;
9
10
  isGroupChat: import("vue").ComputedRef<boolean>;
11
+ contextmenuRef: import("vue").Ref<any>;
10
12
  showMenu: import("vue").Ref<boolean>;
13
+ menuPosition: any;
14
+ menuMsgId: import("vue").Ref<any>;
11
15
  pageInfo: {
12
16
  page: number;
13
17
  hasMore: boolean;
@@ -18,6 +22,8 @@ declare const _default: import("vue").DefineComponent<{}, {
18
22
  '--c-tip-gap': string;
19
23
  }>;
20
24
  getHistoryRecord: () => Promise<void>;
25
+ handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
26
+ setMenuPosition: (event: MouseEvent) => Promise<void>;
21
27
  showMessage: (item: AnyObject) => boolean;
22
28
  showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
23
29
  isTemplate3: (content: AnyObject) => boolean;
@@ -188,25 +194,35 @@ declare const _default: import("vue").DefineComponent<{}, {
188
194
  type: BooleanConstructor;
189
195
  default: boolean;
190
196
  };
191
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickMenu" | "update:show")[], "clickMenu" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
197
+ position: {
198
+ type: import("vue").PropType<CSSProperties>;
199
+ };
200
+ msgId: {
201
+ type: StringConstructor;
202
+ };
203
+ }, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
192
204
  show: {
193
205
  type: BooleanConstructor;
194
206
  default: boolean;
195
207
  };
208
+ position: {
209
+ type: import("vue").PropType<CSSProperties>;
210
+ };
211
+ msgId: {
212
+ type: StringConstructor;
213
+ };
196
214
  }>> & {
197
- onClickMenu?: ((...args: any[]) => any) | undefined;
215
+ onSelect?: ((...args: any[]) => any) | undefined;
198
216
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
199
217
  }, {
200
218
  show: boolean;
201
219
  }>;
202
- formatTime: typeof formatTime;
203
220
  downloadFile: typeof downloadFile;
204
221
  simplifyMessage: typeof simplifyMessage;
205
222
  isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
206
223
  getAVTime: typeof getAVTime;
207
224
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
208
225
  ChatbubbleEllipsesOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
209
- EllipsisHorizontal: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
210
226
  CallOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
211
227
  VideocamOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
212
228
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as a,unref as r,normalizeStyle as c,createVNode as l,withCtx as m,Fragment as u,renderList as p,toDisplayString as d,createCommentVNode as v,createBlock as f,createElementVNode as y,withModifiers as g}from"vue";import{NImageGroup as T,NAvatar as h,NImage as M,NIcon as k,NButtonGroup as _,NButton as I}from"naive-ui";import{format as S}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as j}from"../api/index.js";import{useState as L}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import"trtc-sdk-v5";import{formatTime as C,isAudioOrVideoMessage as b,simplifyMessage as H,getAVTime as w,downloadFile as O}from"../utils/index.js";import{first as z,last as D,isNumber as P}from"lodash-es";import q from"./PersonProfile.vue.js";import N from"./MessageTemplate.vue.js";import{emojis as U}from"../utils/emoji.js";import R from"./ContextMenu.js";import{useScrollLoading as G}from"../hooks/useScrollLoading.js";import{CallOutline as J,VideocamOutline as K,ChatbubbleEllipsesOutline as F,EllipsisHorizontal as X}from"@vicons/ionicons5";const B={key:0,class:"time"},Q={key:2,class:"message-box"},V={key:0,class:"content-box"},W={class:"name-box"},Y=["data-time"],Z={key:0,class:"reference-content"},$=["innerHTML"],ee=["innerHTML"],te=["src"],ne={style:{"margin-left":"8px"}},se=["href","onClick"],oe=y("i",{class:"chat--iconfont chat--icon-face"},null,-1);var ie=e({__name:"ChatMain",setup(e){const ie=t(),{state:ae,setMsgList:re}=L(),{setCurrentSessionItem:ce,isGroupChat:le}=x(ae),me=t(!1),ue={page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")},pe=n((()=>({"--c-tip-top":le.value?"1px":"-20px","--c-tip-gap":le.value?"10px":"0px"})));async function de(){try{if(!ue.hasMore)return;ue.page++;const e=await E({sessionKey:ae.currentSessionItem.sessionKey,page:ue.page,lastSendTime:ue.lastSendTime});if(!Array.isArray(e)||0===e.length)return ue.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=z(e).id;ue.lastSendTime=D(e).sendTime,re(ue.page>1?[...e,...ae.msgList]:e),1===ue.page&&ae.currentSessionItem.unreadNum&&(await j({chatType:ae.currentSessionItem.chatType,messageIdSet:[t],receiver:ae.userInfo.id,sender:ae.currentSessionItem.receiver}),ce({unreadNum:0}))}catch(e){console.log(e)}}function ve(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function fe(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function ye(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===A.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function ge(e,t){var n;const s=P(e.sendTime)?e.sendTime:Date.parse(e.sendTime),o=null==(n=ae.msgList[t-1])?void 0:n.sendTime;return s-(0===t?0:P(o)?o:Date.parse(o))>3e5}return G(ie,(()=>{de()}),"top"),s((()=>ae.id),(e=>{e&&(Object.assign(ue,{page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")}),de())}),{immediate:!0}),s((()=>ae.isAppendMsg),(e=>{e&&(re([...ae.msgList,ae.currentMsg]),ae.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ie.value)?void 0:e.scrollHeight)?t:0;null==(n=ie.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(ae).id}]),ref_key:"chatMainRef",ref:ie,style:c(r(pe))},[l(r(T),{"show-toolbar-tooltip":""},{default:m((()=>[(o(!0),i(u,null,p(r(ae).msgList,((e,n)=>(o(),i(u,{key:n},[ve(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(ae).userInfo.id}])},[ge(e,n)?(o(),i("p",B,d(r(C)(e.sendTime).recordTime),1)):v("v-if",!0),fe(e,"system")?(o(),f(N,{key:1,data:e},null,8,["data"])):(o(),i("div",Q,[l(q,{"user-id":e.sender},{trigger:m((()=>[l(r(h),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(o(),i("div",V,[y("div",W,[y("span",{class:"name","data-time":e.__time},d(r(le)?e.senderName:""),9,Y)]),y("div",{class:a(["content",{emoji:e.content.chatMessageType===r(A).EMOJI,template:e.content.chatMessageType===r(A).TEMPLATE,"template--3":ye(e.content),"audio-video":r(b)(e.content)}]),onContextmenu:t[0]||(t[0]=g((e=>me.value=!0),["prevent"]))},[e.content.chatMessageType===r(A).TEXT?(o(),i(u,{key:0},[e.content.referenceContent?(o(),i("div",Z,[y("span",null,d(e.content.referenceContent.senderName)+":",1),y("pre",{innerHTML:r(H)(e.content.referenceContent.content)},null,8,$)])):v("v-if",!0),y("pre",{innerHTML:e.__content},null,8,ee)],64)):v("v-if",!0),e.content.chatMessageType===r(A).EMOJI?(o(),i("img",{key:1,src:r(U).findEmoji(e.__content)},null,8,te)):v("v-if",!0),fe(e,"template")?(o(),f(N,{key:2,data:e},null,8,["data"])):v("v-if",!0),e.content.chatMessageType===r(A).IMAGE?(o(),f(r(M),{key:3,width:"240",src:e.__content},null,8,["src"])):v("v-if",!0),r(b)(e.content)?(o(),i(u,{key:4},[l(r(k),{class:a({"is-audio":e.content.chatMessageType===r(A).AUDIO}),component:e.content.chatMessageType===r(A).AUDIO?r(J):r(K)},null,8,["class","component"]),y("span",ne,d(r(w)(e.__content)),1)],64)):v("v-if",!0),e.content.chatMessageType===r(A).FILE?(o(),i("a",{key:5,href:e.content.fileUrl,onClick:g((()=>r(O)(e.content.fileUrl,e.__content)),["prevent"])},d(e.__content),9,se)):v("v-if",!0),v(' <div class="quick-menu">\n\t\t\t\t\t\t\t\t\t<n-icon :component="AddCircleOutline" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="ChatbubbleEllipsesOutline" @click="() => setReferenceMsg(item)" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="EllipsisHorizontal" />\n\t\t\t\t\t\t\t\t</div> '),l(r(_),{class:"quick-menu"},{default:m((()=>[l(r(I),{quaternary:"",size:"tiny"},{icon:m((()=>[oe])),_:1}),l(r(I),{quaternary:"",size:"tiny",onClick:()=>{return t=e,ae.currentReferenceMsg=t,void Object.assign(ae.currentReferenceMsg,{chatType:ae.currentSessionItem.chatType,receiver:ae.currentSessionItem.receiver,receiverAvatar:ae.currentSessionItem.avatar,receiverName:ae.currentSessionItem.name});var t}},{icon:m((()=>[l(r(k),{size:"17",component:r(F)},null,8,["component"])])),_:2},1032,["onClick"]),l(r(I),{quaternary:"",size:"tiny"},{icon:m((()=>[l(r(k),{component:r(X)},null,8,["component"])])),_:1})])),_:2},1024)],34)])):v("v-if",!0)]))],2)):v("v-if",!0)],64)))),128))])),_:1}),l(r(R),{show:me.value,"onUpdate:show":t[1]||(t[1]=e=>me.value=e)},null,8,["show"])],6))}});export{ie as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as a,unref as r,normalizeStyle as c,createVNode as l,withCtx as m,Fragment as u,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as v,createElementVNode as y,withModifiers as g}from"vue";import{NImageGroup as T,NAvatar as h,NImage as M,NIcon as k,NButtonGroup as _,NButton as I}from"naive-ui";import{format as S}from"date-fns";import{getHistoryRecordApi as x,readMessageApi as j}from"../api/index.js";import{useState as E}from"../hooks/useState.js";import{useSession as L}from"../hooks/useSession.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as C,simplifyMessage as b,getAVTime as w,downloadFile as H}from"../utils/index.js";import{first as z,last as D}from"lodash-es";import O from"./PersonProfile.vue.js";import P from"./MessageTemplate.vue.js";import{emojis as N}from"../utils/emoji.js";import U from"./ContextMenu.js";import{useScrollLoading as q}from"../hooks/useScrollLoading.js";import{CallOutline as R,VideocamOutline as G,ChatbubbleEllipsesOutline as J}from"@vicons/ionicons5";const K={key:0,class:"time"},F={key:2,class:"message-box"},X={key:0,class:"content-box"},B={class:"name-box"},Q=["data-time"],V=["onContextmenu"],W={key:0,class:"reference-content"},Y=["innerHTML"],Z=["innerHTML"],$=["src"],ee={style:{"margin-left":"8px"}},te=["href","onClick"];var ne=e({__name:"ChatMain",setup(e){const ne=t(),{state:se,setMsgList:oe}=E(),{setCurrentSessionItem:ie,isGroupChat:ae}=L(se),re=t(),ce=t(!1),le=t({left:0,top:0}),me=t(),ue={page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")},pe=n((()=>({"--c-tip-top":ae.value?"1px":"-20px","--c-tip-gap":ae.value?"10px":"0px"})));async function de(){try{if(!ue.hasMore)return;ue.page++;const e=await x({sessionKey:se.currentSessionItem.sessionKey,page:ue.page,lastSendTime:ue.lastSendTime});if(!Array.isArray(e)||0===e.length)return ue.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=z(e).id;ue.lastSendTime=D(e).sendTime,oe(ue.page>1?[...e,...se.msgList]:e),1===ue.page&&se.currentSessionItem.unreadNum&&(await j({chatType:se.currentSessionItem.chatType,messageIdSet:[t],receiver:se.userInfo.id,sender:se.currentSessionItem.receiver}),ie({unreadNum:0}))}catch(e){console.log(e)}}function fe(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function ve(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function ye(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===A.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function ge(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=se.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}return q(ne,(()=>{de()}),"top",(()=>{ce.value=!1})),s((()=>se.id),(e=>{e&&(Object.assign(ue,{page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")}),de())}),{immediate:!0}),s((()=>se.isAppendMsg),(e=>{e&&(oe([...se.msgList,se.currentMsg]),se.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ne.value)?void 0:e.scrollHeight)?t:0;null==(n=ne.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(se).id}]),ref_key:"chatMainRef",ref:ne,style:c(r(pe))},[l(r(T),{"show-toolbar-tooltip":""},{default:m((()=>[(o(!0),i(u,null,p(r(se).msgList,((e,t)=>(o(),i(u,{key:e.id},[fe(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(se).userInfo.id}])},[ge(e,t)?(o(),i("p",K,d(e.__sendTime),1)):f("v-if",!0),ve(e,"system")?(o(),v(P,{key:1,data:e},null,8,["data"])):(o(),i("div",F,[l(O,{"user-id":e.sender},{trigger:m((()=>[l(r(h),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(o(),i("div",X,[y("div",B,[y("span",{class:"name","data-time":e.__time},d(r(ae)?e.senderName:""),9,Q)]),y("div",{class:a(["content",{emoji:e.content.chatMessageType===r(A).EMOJI,template:e.content.chatMessageType===r(A).TEMPLATE,"template--3":ye(e.content),"audio-video":r(C)(e.content)}]),onContextmenu:g((t=>async function(e,t){}(0,e.id)),["prevent"])},[e.content.chatMessageType===r(A).TEXT?(o(),i(u,{key:0},[e.content.referenceContent?(o(),i("div",W,[y("span",null,d(e.content.referenceContent.senderName)+":",1),y("pre",{innerHTML:r(b)(e.content.referenceContent.content)},null,8,Y)])):f("v-if",!0),y("pre",{innerHTML:e.__content},null,8,Z)],64)):f("v-if",!0),e.content.chatMessageType===r(A).EMOJI?(o(),i("img",{key:1,src:r(N).findEmoji(e.__content)},null,8,$)):f("v-if",!0),ve(e,"template")?(o(),v(P,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===r(A).IMAGE?(o(),v(r(M),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),r(C)(e.content)?(o(),i(u,{key:4},[l(r(k),{class:a({"is-audio":e.content.chatMessageType===r(A).AUDIO}),component:e.content.chatMessageType===r(A).AUDIO?r(R):r(G)},null,8,["class","component"]),y("span",ee,d(r(w)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===r(A).FILE?(o(),i("a",{key:5,href:e.content.fileUrl,onClick:g((()=>r(H)(e.content.fileUrl,e.__content)),["prevent"])},d(e.__content),9,te)):f("v-if",!0),l(r(_),{class:"quick-menu"},{default:m((()=>[f(' <n-button quaternary size="tiny">\r\n\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<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t</n-button> '),l(r(I),{quaternary:"",size:"tiny",onClick:()=>{return t=e,se.currentReferenceMsg=t,void Object.assign(se.currentReferenceMsg,{chatType:se.currentSessionItem.chatType,receiver:se.currentSessionItem.receiver,receiverAvatar:se.currentSessionItem.avatar,receiverName:se.currentSessionItem.name});var t}},{icon:m((()=>[l(r(k),{size:"17",component:r(J)},null,8,["component"])])),_:2},1032,["onClick"]),f(' <n-button quaternary size="tiny">\r\n\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<n-icon :component="EllipsisHorizontal" />\r\n\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t</n-button> ')])),_:2},1024)],42,V)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(r(U),{ref_key:"contextmenuRef",ref:re,show:ce.value,"onUpdate:show":t[0]||(t[0]=e=>ce.value=e),position:le.value,"msg-id":me.value},null,8,["show","position","msg-id"])],6))}});export{ne as default};
@@ -60,6 +60,10 @@ declare const _default: import("vue").DefineComponent<{
60
60
  allowedInvalidValue: {
61
61
  type: StringConstructor;
62
62
  };
63
+ to: {
64
+ type: PropType<string | false | HTMLElement>;
65
+ default: string;
66
+ };
63
67
  }, {
64
68
  attrs: {
65
69
  [x: string]: unknown;
@@ -80,6 +84,10 @@ declare const _default: import("vue").DefineComponent<{
80
84
  allowedInvalidValue: {
81
85
  type: StringConstructor;
82
86
  };
87
+ to: {
88
+ type: PropType<string | false | HTMLElement>;
89
+ default: string;
90
+ };
83
91
  }>> & {
84
92
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
85
93
  }>>;
@@ -116,10 +124,15 @@ declare const _default: import("vue").DefineComponent<{
116
124
  allowedInvalidValue: {
117
125
  type: StringConstructor;
118
126
  };
127
+ to: {
128
+ type: PropType<string | false | HTMLElement>;
129
+ default: string;
130
+ };
119
131
  }>> & {
120
132
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
121
133
  }, {
122
134
  updateUnchangedValue: boolean;
135
+ to: string | false | HTMLElement;
123
136
  }>>;
124
137
  formatTime: typeof formatTime;
125
138
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"no-data"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"no-data"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
1
+ import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"no-data"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"no-data"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:ge.value||U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
@@ -1,15 +1,28 @@
1
+ import { PropType, CSSProperties } from 'vue';
1
2
  declare const _default: import("vue").DefineComponent<{
2
3
  show: {
3
4
  type: BooleanConstructor;
4
5
  default: boolean;
5
6
  };
6
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickMenu" | "update:show")[], "clickMenu" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ position: {
8
+ type: PropType<CSSProperties>;
9
+ };
10
+ msgId: {
11
+ type: StringConstructor;
12
+ };
13
+ }, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
14
  show: {
8
15
  type: BooleanConstructor;
9
16
  default: boolean;
10
17
  };
18
+ position: {
19
+ type: PropType<CSSProperties>;
20
+ };
21
+ msgId: {
22
+ type: StringConstructor;
23
+ };
11
24
  }>> & {
12
- onClickMenu?: ((...args: any[]) => any) | undefined;
25
+ onSelect?: ((...args: any[]) => any) | undefined;
13
26
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
14
27
  }, {
15
28
  show: boolean;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,withDirectives as t,createVNode as l,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as i,NIcon as c}from"naive-ui";import{CopyOutline as p,OpenOutline as u,ChatbubbleEllipsesOutline as s,ReorderFourOutline as m,ReturnDownBack as y,DownloadOutline as f}from"@vicons/ionicons5";import{onClickOutside as b}from"@vueuse/core";var d=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1}},emits:["update:show","clickMenu"],setup(e,{attrs:d,slots:v,emit:w}){const k=[{icon:p,label:"复制",key:"copy"},{icon:u,label:"转发",key:"relay"},{icon:s,label:"回复",key:"reply"},{icon:m,label:"多选",key:"multiSelect"},{icon:y,label:"撤回",key:"withdraw"},{icon:f,label:"下载",key:"download"}],h=o(null);return b(h,(e=>{w("update:show",!1)})),()=>{let o;return t(l("div",{class:"contextmenu-wrapper",ref:h},[l(a,{vertical:!0},(p=o=k.map((e=>l(i,{quaternary:!0},{default:()=>e.label,icon:()=>l(c,{component:e.icon},null)}))),"function"==typeof p||"[object Object]"===Object.prototype.toString.call(p)&&!r(p)?o:{default:()=>[o]}))]),[[n,e.show]]);var p}}});export{d as default};
1
+ import{defineComponent as e,ref as t,computed as o,withDirectives as n,createVNode as s,vShow as i,isVNode as l}from"vue";import{NButtonGroup as r,NButton as a,NIcon as p}from"naive-ui";import{CopyOutline as u,OpenOutline as c,ChatbubbleEllipsesOutline as d,ReorderFourOutline as m,ReturnDownBack as y,DownloadOutline as f}from"@vicons/ionicons5";import{onClickOutside as h}from"@vueuse/core";import{useState as v}from"../hooks/useState.js";import{isAudioOrVideoMessage as w}from"../utils/index.js";import"lodash-es";import{MESSAGE_TYPE as b}from"../constants/index.js";import"../api/index.js";import"trtc-sdk-v5";import{isSameMonth as k}from"date-fns";var g=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},position:{type:Object},msgId:{type:String}},emits:["update:show","select"],setup(e,{attrs:g,slots:j,emit:E}){const{state:T,setMsgList:I}=v(),L=[{icon:u,label:"复制",key:"copy"},{icon:c,label:"转发",key:"relay"},{icon:d,label:"回复",key:"reply"},{icon:m,label:"多选",key:"multiSelect"},{icon:y,label:"撤回",key:"withdraw"},{icon:f,label:"下载",key:"download"}],M=t(null),x=o((()=>T.msgList.find((({id:t})=>t===e.msgId)))),O=o((()=>{if(!e.msgId)return[];if(!(null==x?void 0:x.value))return[];const{content:t={},sendTime:o,sender:n}=x.value,{chatMessageType:s}=t,i=[];return(n!==T.userInfo.id&&k(new Date(o),new Date)||s===b.TEMPLATE)&&i.push("withdraw"),[b.TEXT,b.EMOJI,b.BLEND].includes(s)?i.push("download"):w(t)?i.push("copy","relay","download"):s===b.FILE?i.push("copy"):[b.FORWARD,b.TEMPLATE].includes(s)&&i.push("copy","download"),i.length?L.filter((e=>!i.includes(e.key))):L}));return h(M,(e=>{E("update:show",!1)})),()=>{let t;return e.msgId&&O.value?n(s("div",{class:"contextmenu-wrapper",ref:M,style:e.position},[s(r,{vertical:!0},(o=t=O.value.map((e=>s(a,{onClick:()=>{return t=e.key,E("update:show",!1),x.value,void E("select",t);var t},quaternary:!0},{default:()=>e.label,icon:()=>s(p,{component:e.icon},null)}))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!l(o)?t:{default:()=>[t]}))]),[[i,e.show]]):null;var o}}});export{g as default};