cnhis-design-vue 3.2.8-beta.2 → 3.2.8-beta.20

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 (124) hide show
  1. package/es/components/ai-chat/index.d.ts +95 -0
  2. package/es/components/ai-chat/index.js +1 -0
  3. package/es/components/ai-chat/src/Index.vue.d.ts +97 -0
  4. package/es/components/ai-chat/src/Index.vue.js +1 -0
  5. package/es/components/ai-chat/src/Index.vue2.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +14 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.js +1 -0
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatMain.d.ts +8 -0
  10. package/es/components/ai-chat/src/components/ChatMain.js +1 -0
  11. package/es/components/ai-chat/src/types/index.d.ts +28 -0
  12. package/es/components/ai-chat/src/types/index.js +1 -0
  13. package/es/components/ai-chat/style/index.css +1 -0
  14. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  15. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  16. package/es/components/button-print/index.d.ts +38 -0
  17. package/es/components/button-print/src/ButtonPrint.vue.d.ts +38 -0
  18. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  19. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +17 -0
  20. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  21. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  22. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  23. package/es/components/button-print/src/utils/print.js +1 -1
  24. package/es/components/button-print/style/index.css +1 -1
  25. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  26. package/es/components/callback/src/components/render/popupMaps.d.ts +3 -2
  27. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +1 -1
  32. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  33. package/es/components/field-set/src/FieldColor.vue.d.ts +27 -1
  34. package/es/components/field-set/src/FieldFilter.vue.d.ts +27 -1
  35. package/es/components/field-set/src/FieldSet.vue.d.ts +63 -1
  36. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  37. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  38. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  39. package/es/components/field-set/src/components/table-row.vue.d.ts +27 -1
  40. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  41. package/es/components/field-set/src/types/index.d.ts +1 -1
  42. package/es/components/field-set/src/utils/index.d.ts +1 -1
  43. package/es/components/field-set/src/utils/index.js +1 -1
  44. package/es/components/form-config/index.d.ts +6 -4
  45. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -4
  46. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  47. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -2
  48. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -2
  49. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  50. package/es/components/form-render/index.d.ts +3 -2
  51. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  52. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  53. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -2
  54. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  55. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  56. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  57. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  58. package/es/components/form-render/src/components/renderer/select.js +1 -1
  59. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  60. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  61. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  62. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  63. package/es/components/form-render/src/types/index.d.ts +1 -0
  64. package/es/components/guide/src/renderer.js +1 -1
  65. package/es/components/iho-chat/index.d.ts +14 -2
  66. package/es/components/iho-chat/src/Index.vue.d.ts +14 -2
  67. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  68. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  69. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
  70. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  71. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -1
  72. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  73. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +8 -1
  74. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  75. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +6 -0
  76. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  77. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
  78. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  79. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  80. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +6 -0
  81. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  82. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  83. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  84. package/es/components/iho-chat/src/utils/index.js +1 -1
  85. package/es/components/iho-chat/style/index.css +1 -1
  86. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  87. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  88. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  89. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  90. package/es/components/index.css +1 -1
  91. package/es/components/index.d.ts +3 -1
  92. package/es/components/index.js +1 -1
  93. package/es/components/info-header/index.d.ts +7 -4
  94. package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -4
  95. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  96. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -2
  97. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -2
  98. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  99. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  100. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  101. package/es/components/shortcut-setter/index.d.ts +3 -2
  102. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -2
  103. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  104. package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
  105. package/es/components/step-notice/src/hooks/useTheme.js +1 -1
  106. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  107. package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +3 -0
  108. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
  109. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +3 -0
  110. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +3 -0
  111. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  112. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  113. package/es/shared/assets/img/ai__avatar.png.js +1 -0
  114. package/es/shared/hooks/index.d.ts +1 -0
  115. package/es/shared/hooks/index.js +1 -1
  116. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  117. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  118. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  119. package/es/shared/hooks/useFormRequest/index.js +1 -1
  120. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  121. package/es/shared/package.json.js +1 -1
  122. package/package.json +2 -2
  123. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.d.ts +0 -0
  124. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.js +0 -0
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function x(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),v=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,g;const y=v(e);e.urlConfig?x(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=f(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=f(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=f(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=f(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?x(n,e):e.autograph&&u(n,e),n},w=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=v(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=v(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:p(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),g=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,v;const y=g(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(v=r(e.multi_select_value))?v:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=g(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=g(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=g(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=g(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=g(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=g(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=g(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=g(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=g(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=g(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=g(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:p(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return p(t)}return o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
@@ -1 +1 @@
1
- import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import"lodash-es";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionAnnotationShortcuts as j,InjectionFormGlobalProps as C,InjectionFormGlobalEmit as v}from"../constants/index.js";import{useFormRenderLifeCycle as x}from"./useFormRenderLifeCycle.js";import{usePresetScope as y}from"./usePresetScope.js";import{useBusinessBinding as q}from"./useBusinessBinding.js";import{useChangeContext as g}from"./useChangeContext.js";import{useFormItemDeps as F}from"./useFormItemDeps.js";function R(R,b){const{callLifeCycle:S}=x(R),D=s(o((()=>R.requestInstance)),o((()=>!!R.uniqueCacheData))).create(R.parallelism,{beforeRequest:(...e)=>S("beforeRequest",e)||e[1],afterRequest:(...e)=>S("afterRequest",e)||n(e[1])});t(u,D);const I=i({components:{...m,...R.components},scope:Object.assign({},y(),R.scope)}).SchemaField;t(c,I);const k=q().create(R.businessFormatter);t(p,k);const B=g().create();t(l,B);const L=F().create();t(f,L);const U=R.uuid||e();return t(d,U),t(h,o({get:()=>R.annotation?r(R.annotation):null,set(e){if(!a(R.annotation)||!a(e))return;const o=R.annotation[e.property];R.annotation[e.property]=e.value,b("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,o((()=>R.annotationShortcuts))),t(C,R),t(v,b),{asyncQueue:D,SchemaField:I,businessCollector:k,changeContextCollector:B,formItemDepsCollector:L,formUUID:U}}export{R as useFormContext};
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import"lodash-es";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionAnnotationShortcuts as j,InjectionFormGlobalProps as C,InjectionFormGlobalEmit as v}from"../constants/index.js";import{useFormRenderLifeCycle as x}from"./useFormRenderLifeCycle.js";import{usePresetScope as y}from"./usePresetScope.js";import{useBusinessBinding as g}from"./useBusinessBinding.js";import{useChangeContext as q}from"./useChangeContext.js";import{useFormItemDeps as F}from"./useFormItemDeps.js";function R(R,S){const{callLifeCycle:b}=x(R),k=s(o((()=>R.requestInstance)),o((()=>!!R.uniqueCacheData))).create(R.parallelism,{beforeRequest:(...e)=>b("beforeRequest",e)||e[1],afterRequest:(...e)=>b("afterRequest",e)||n(e[1])});t(u,k);const D=i({components:{...m,...R.components},scope:Object.assign({},y(),R.scope)}).SchemaField;t(c,D);const I=g().create(R.businessFormatter);t(p,I);const L=q().create();t(l,L);const B=F().create();t(f,B);const U=R.uuid||e();return t(d,U),t(h,o({get:()=>R.annotation?r(R.annotation):null,set(e){if(!a(R.annotation)||!a(e))return;const o=R.annotation[e.property];R.annotation[e.property]=e.value,S("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,o((()=>R.annotationShortcuts))),t(C,R),t(v,S),{asyncQueue:k,SchemaField:D,businessCollector:I,changeContextCollector:L,formItemDepsCollector:B,formUUID:U}}export{R as useFormContext};
@@ -13,7 +13,7 @@ export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID,
13
13
  operationalFormHandler: ReturnType<typeof useOperationalForm>;
14
14
  changeContextCollector: ContextCollector;
15
15
  emitFormChange: Ref<boolean>;
16
- }): Omit<FormRenderExpose, 'formModel' | 'reload' | 'getFieldList' | 'optionInited'>;
16
+ }): Omit<FormRenderExpose, 'formModel' | 'reload' | 'getFieldList' | 'optionInited' | 'updateAnchor'>;
17
17
  export declare function useFormDomEvent({ props, formRenderRef, formModel, formUUID }: {
18
18
  props: FormRenderProps;
19
19
  formRenderRef: Ref<HTMLElement | undefined>;
@@ -1 +1 @@
1
- import{arrayed as e,checkInSetupEnv as l,jsonParse as n}from"../../../../shared/utils/index.js";import"naive-ui";import{computed as o,inject as r,ref as t,watch as u,toRaw as a}from"vue";import"@vueuse/core";import"date-fns";import{uniqBy as i,isString as s,isEqual as c,omit as v,isFunction as d}from"lodash-es";import{useFormRequest as m}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import{useOptionFiltered as f}from"../../../../shared/hooks/selectHooks/useOptionFiltered.js";import{useSearchContent as y}from"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../index.js";import{InjectionAsyncQueue as p,InjectionFormLifeCycleCaller as h,InjectionFormGlobalProps as g,InjectionFormItemDepsCollector as K}from"../constants/index.js";import{useFormField as k}from"./useFormField.js";import{traverseDependKey as w}from"../utils/schema.js";import{getAbsoluteKey as C,formRenderLog as b}from"../utils/index.js";function R(e,l){const n=t();return o({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}function F(e,l,t,u,a){const s=R(e,"commonList"),c=R(e,"recentList"),{searchContent:f,optionSearchFilter:h}=y();function g(e){return n(e.itemObj)}const K=o((()=>{var e,l;return null!=(l=null==(e=s.value)?void 0:e.map(g))?l:[]})),w=o((()=>{var e,l;return null!=(l=null==(e=c.value)?void 0:e.map(g))?l:[]})),C=o((()=>{if(!e.recommend||!K.value.length&&!w.value.length)return l.value;const n=i(K.value.concat(w.value),(e=>e[a.value])),o=l.value.filter((e=>n.every((function(l){return l[a.value]!==e[a.value]}))));return[...h(n,u.value),...o]})),{getRecommendRequestInfo:b,getHttpInstance:F}=m();function O(l){const{url:n,getRecommendIds:o}=b(),r=d(o)?o():{},t=d(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},r,t)}}const{fieldKey:j,field:q}=k(),I=r(p);return{postRecommend:async function(l){if(!e.recommend)return;const n=F();if(!n)return;const{url:o,info:r}=O("post"),u=C.value.find((e=>e[a.value]===l));u&&t("postRecommend",await n.post(o,{...r,keyword:"",itemId:a.value,itemObj:JSON.stringify(u)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,s.value&&c.value&&e.recommendCache)return;const n=await I.addAsync(function(l,n){const{url:o,info:r}=O("get");return{url:o,method:"get",key:l,cache:n,params:{...r,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:q.value,labelKey:u.value,valueKey:a.value}}}(j.value,e.recommendCache)),{commonly:o,recently:r}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(v(l,["type"])):"recently"===l.type&&e.recently.push(v(l,["type"])),e)),{commonly:[],recently:[]});s.value=o.slice(0,e.commonNum),c.value=r.slice(0,e.recentNum)},sortedOptions:C}}function O(e,l,n){const r=o((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.nameKey)?n:e.labelField)?o:"text"})),t=o((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.valueKey)?n:e.valueField)?o:"value"})),u=o((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.showKey)?n:e.showField})),a=o((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.searchKey)?n:e.searchField})),{field:i}=k();return I({props:e,labelKey:r,valueKey:t,searchKey:a,showKey:u,hooks:n,valueRef:l,getConfig:()=>e.urlConfig,getParams:()=>{var l,n;const o=q(i.value,null==(l=e.urlConfig)?void 0:l.params,null==(n=e.urlConfig)?void 0:n.dependKey);return{...e.urlConfig,params:o}},getDependKeys:()=>{var l;return null==(l=e.urlConfig)?void 0:l.dependKey}})}function j(l,n,r){const t=o((()=>{var n;const o=e(null==(n=l.wordbook)?void 0:n.show_key)[0];return s(o)?o:null})),u=o((()=>{var e,n,o,r;const u=null==(n=null==(e=l.wordbook)?void 0:e.render_key)?void 0:n[0];return s(u)?u:null!=(r=null!=(o=t.value)?o:l.labelField)?r:"text"})),a=o((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.wordbook)?void 0:e.value_key)?n:l.valueField)?o:"value"})),i=o((()=>{var e;return(null==(e=l.wordbook)?void 0:e.search_key)||[]})),c=o((()=>{var e;return null!=(e=t.value)?e:l.showField})),{field:v}=k(),{getSearchRequestInfo:d}=m();return I({props:l,labelKey:u,valueKey:a,searchKey:i,showKey:c,hooks:r,valueRef:n,getConfig:()=>l.wordbook,getParams:()=>{const{wordbook:e,autograph:n}=l,o=q(v.value,{autograph:n,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1},e.queryParams);return{...d(),params:o}},getDependKeys:()=>{var e;return null==(e=l.wordbook)?void 0:e.queryParams}})}function q(e,l,n){const o={...l};return n&&w(n,((l,n,r)=>{const t=C(l,e.path),u=e.form.getValuesIn(t);if((null==r?void 0:r.required)&&null==u)throw`缺少必须的参数=>${t}`;o[n]=u})),o}function I({labelKey:e,valueKey:n,searchKey:i,showKey:v,props:d,getConfig:m,getParams:y,getDependKeys:w,hooks:C,valueRef:R}){l();const F=r(p),O=r(h),j=r(g),{remoteOptions:q,filterOptions:I,fullOptions:x,searchContent:S}=f(d,{labelKey:e,valueKey:n,searchKey:i,wordSplitFilter:o((()=>{var e;return null!=(e=d.wordSplitFilter)?e:j.wordSplitFilter}))}),{field:D,fieldKey:N}=k(),P=t(!1),_=async function(l,o,r={avoidSearchContent:!0}){if(S.value=l,!m())return q.value=null;if(!r.avoidSearchContent||null==S.value)try{P.value=!0;const l={field:D.value,labelKey:e.value,valueKey:n.value},r={params:{...y().params,...o},key:N.value,cache:d.requestCache,payload:l},t=await F.addAsync(Object.assign({},y(),r));a(q.value)!==t&&(q.value=t,O("afterOptionInit",[N.value,q.value,l]))}catch(e){s(e)&&b(e)}finally{P.value=!1}},H=r(K);return u(m,((l,o)=>{if(c(l,o))return;if(q.value=null,!l)return q.value=null;const r={fetchData:_,labelKey:e.value,valueKey:n.value},{onRequestConfigChange:t,onDepsChange:u}=C||{};H.setDeps(D.value.path,w()||[],(async e=>{q.value=null,(null==e?void 0:e.keepValue)||(R.value=null),d.lazyRequest||(u?u(r):_())})),!R.value&&d.lazyRequest||(t?t(r):_())}),{immediate:!0}),{labelKey:e,loading:P,showKey:v,valueKey:n,remoteOptions:q,filterOptions:I,fullOptions:x,fetchData:_,searchContent:S}}export{j as useAutographOptions,F as useRecommendOptions,O as useUrlConfigOptions};
1
+ import{arrayed as e,checkInSetupEnv as l,jsonParse as o}from"../../../../shared/utils/index.js";import"naive-ui";import{computed as n,inject as r,ref as t,watch as u,toRaw as a}from"vue";import"@vueuse/core";import"date-fns";import{uniqBy as i,isString as s,isEqual as c,omit as v,isFunction as d}from"lodash-es";import{useFormRequest as m}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import{useOptionFiltered as f}from"../../../../shared/hooks/selectHooks/useOptionFiltered.js";import{useSearchContent as y}from"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import"../../index.js";import{InjectionAsyncQueue as p,InjectionFormLifeCycleCaller as h,InjectionFormGlobalProps as g,InjectionFormItemDepsCollector as K}from"../constants/index.js";import{useFormField as k}from"./useFormField.js";import{traverseDependKey as w}from"../utils/schema.js";import{getAbsoluteKey as C,formRenderLog as b}from"../utils/index.js";function R(e,l){const o=t();return n({get:()=>o.value?o.value:e[l],set(e){o.value=e}})}function F(e,l,t,u,a){const s=R(e,"commonList"),c=R(e,"recentList"),{searchContent:f,optionSearchFilter:h}=y();function g(e){return o(e.itemObj)}const K=n((()=>{var e,l;return null!=(l=null==(e=s.value)?void 0:e.map(g))?l:[]})),w=n((()=>{var e,l;return null!=(l=null==(e=c.value)?void 0:e.map(g))?l:[]})),C=n((()=>{if(!e.recommend||!K.value.length&&!w.value.length)return l.value;const o=i(K.value.concat(w.value),(e=>e[a.value])),n=l.value.filter((e=>o.every((function(l){return l[a.value]!==e[a.value]}))));return[...h(o,u.value),...n]})),{getRecommendRequestInfo:b,getHttpInstance:F}=m();function j(l){const{url:o,getRecommendIds:n}=b(),r=d(n)?n():{},t=d(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:o[l],info:Object.assign({},r,t)}}const{fieldKey:O,field:q}=k(),I=r(p);return{postRecommend:async function(l){if(!e.recommend)return;const o=F();if(!o)return;const{url:n,info:r}=j("post"),u=C.value.find((e=>e[a.value]===l));u&&t("postRecommend",await o.post(n,{...r,keyword:"",itemId:a.value,itemObj:JSON.stringify(u)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,s.value&&c.value&&e.recommendCache)return;const o=await I.addAsync(function(l,o){const{url:n,info:r}=j("get");return{url:n,method:"get",key:l,cache:o,params:{...r,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:q.value,labelKey:u.value,valueKey:a.value}}}(O.value,e.recommendCache)),{commonly:n,recently:r}=o.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(v(l,["type"])):"recently"===l.type&&e.recently.push(v(l,["type"])),e)),{commonly:[],recently:[]});s.value=n.slice(0,e.commonNum),c.value=r.slice(0,e.recentNum)},sortedOptions:C}}function j(e,l,o){const r=n((()=>{var l,o,n;return null!=(n=null!=(o=null==(l=e.urlConfig)?void 0:l.nameKey)?o:e.labelField)?n:"text"})),t=n((()=>{var l,o,n;return null!=(n=null!=(o=null==(l=e.urlConfig)?void 0:l.valueKey)?o:e.valueField)?n:"value"})),u=n((()=>{var l,o;return null!=(o=null==(l=e.urlConfig)?void 0:l.showKey)?o:e.showField})),a=n((()=>{var l,o;return null!=(o=null==(l=e.urlConfig)?void 0:l.searchKey)?o:e.searchField})),{field:i}=k();return I({props:e,labelKey:r,valueKey:t,searchKey:a,showKey:u,hooks:o,valueRef:l,getConfig:()=>e.urlConfig,getParams:()=>{var l,o;const n=q(i.value,null==(l=e.urlConfig)?void 0:l.params,null==(o=e.urlConfig)?void 0:o.dependKey);return{...e.urlConfig,params:n}},getDependKeys:()=>{var l;return null==(l=e.urlConfig)?void 0:l.dependKey}})}function O(l,o,r){const t=n((()=>{var o;const n=e(null==(o=l.wordbook)?void 0:o.show_key)[0];return s(n)?n:null})),u=n((()=>{var e,o,n,r;const u=null==(o=null==(e=l.wordbook)?void 0:e.render_key)?void 0:o[0];return s(u)?u:null!=(r=null!=(n=t.value)?n:l.labelField)?r:"text"})),a=n((()=>{var e,o,n;return null!=(n=null!=(o=null==(e=l.wordbook)?void 0:e.value_key)?o:l.valueField)?n:"value"})),i=n((()=>{var e;return(null==(e=l.wordbook)?void 0:e.search_key)||[]})),c=n((()=>{var e;return null!=(e=t.value)?e:l.showField})),{field:v}=k(),{getSearchRequestInfo:d}=m();return I({props:l,labelKey:u,valueKey:a,searchKey:i,showKey:c,hooks:r,valueRef:o,getConfig:()=>l.wordbook,getParams:()=>{const{wordbook:e,autograph:o}=l,n=q(v.value,{autograph:o,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1},e.queryParams);return{...d(),params:n}},getDependKeys:()=>{var e;return null==(e=l.wordbook)?void 0:e.queryParams}})}function q(e,l,o){const n={...l};return o&&w(o,((l,o,r)=>{const t=C(l,e.path),u=e.form.getValuesIn(t);if((null==r?void 0:r.required)&&null==u)throw`缺少必须的参数=>${t}`;n[o]=u})),n}function I({labelKey:e,valueKey:o,searchKey:i,showKey:v,props:d,getConfig:m,getParams:y,getDependKeys:w,hooks:C,valueRef:R}){l();const F=r(p),j=r(h),O=r(g),{remoteOptions:q,filterOptions:I,fullOptions:S,searchContent:x}=f(d,{labelKey:e,valueKey:o,searchKey:i,wordSplitFilter:n((()=>{var e;return null!=(e=d.wordSplitFilter)?e:O.wordSplitFilter}))}),{field:D,fieldKey:N}=k(),P=t(!1),_=async function(l,n,r={avoidSearchContent:!0}){if(x.value=l,!m())return q.value=null;if(!r.avoidSearchContent||null==x.value)try{P.value=!0;const l={field:D.value,labelKey:e.value,valueKey:o.value},r={params:{...y().params,...n},key:N.value,cache:d.requestCache,payload:l},t=await F.addAsync(Object.assign({},y(),r));a(q.value)!==t&&(q.value=t,j("afterOptionInit",[N.value,q.value,l]))}catch(e){s(e)&&b(e)}finally{P.value=!1}},H=r(K);return u(m,((l,n)=>{if(c(l,n))return;if(q.value=null,!l)return q.value=null;const r={fetchData:_,labelKey:e.value,valueKey:o.value},{onRequestConfigChange:t,onDepsChange:u}=C||{};H.setDeps(D.value.path,w()||[],(async e=>{q.value=null,(null==e?void 0:e.keepValue)||(R.value=null),d.lazyRequest||(u?u(r):_())})),!R.value&&d.lazyRequest||(t?t(r):_())}),{immediate:!0}),{labelKey:e,loading:P,showKey:v,valueKey:o,remoteOptions:q,filterOptions:I,fullOptions:S,fetchData:_,searchContent:x}}export{O as useAutographOptions,F as useRecommendOptions,j as useUrlConfigOptions};
@@ -103,6 +103,7 @@ export type FormRenderExpose = {
103
103
  optionInited(options?: Partial<{
104
104
  timeout: number;
105
105
  }>): Promise<void>;
106
+ updateAnchor: () => void;
106
107
  };
107
108
  export type FormChangeContext = Partial<{
108
109
  currentOption: AnyObject;
@@ -1 +1 @@
1
- import{defineComponent as e,provide as t,createVNode as s}from"vue";import{useTheme as r}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isFunction as o,range as n}from"lodash-es";import"@vue/shared";import{widthAppend as i}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSpace as u,NButton as l}from"naive-ui";const d=e({props:{config:{type:Object,required:!0,default:()=>({})},index:{type:Number,required:!0},length:{type:Number,required:!0}},emits:["cancel","next","toNext"],setup(e,{emit:t,slots:d}){const p=r();function a(e,{skippable:r=!0,skipText:i="跳过",nextText:d="下一步",endText:p="结束引导"},a,c){var f;return s("footer",{class:"guide__stepFooter"},[null!=(f=o(e)?e():null)?f:s(u,{justify:"end",wrapItem:!1},{default:()=>[m(),r?s(l,{ghost:!0,bordered:!1,class:"guide__stepSkipBtn",textColor:"#c5c5c5",onClick:()=>t("cancel")},{default:()=>i}):null,s(l,{type:"primary",class:"guide__stepNextBtn",onClick:()=>t("next")},{default:()=>a===c-1?p:d})]})]);function m(){return s(u,{justify:"start",style:"flex:1"},{default:function(){return n(c).map((e=>s(l,{class:"guide__stepToBtn",bordered:!1,onClick:()=>t("toNext",e)},{default:()=>s("i",{class:["guide__stepToBtnContent",{guide__stepActiveBtn:e===a}]},null)})))}})}}return()=>{const{minWidth:t=240,maxWidth:r=300,pointer:n=!0}=e.config;return s("section",{class:"guide__stepContentWrapper",style:{minWidth:i(t),maxWidth:i(r),...p.value}},[n?s("div",{class:"guide__stepPointerWrapper"},[s("div",{class:"guide__stepPointer"},null),s("div",{class:"guide__stepPointerLine"},null)]):null,(l=d.header,s("header",{class:"guide__stepHeader"},[o(l)?l():null])),(u=d.body,s("section",{class:"guide__stepBody"},[o(u)?u():null])),a(d.footer,e.config,e.index,e.length)]);var u,l}}});function p(r){return r?e({setup(e,{attrs:o,slots:n}){const i=[];let u=(null==r?void 0:r.parent)&&Reflect.get(r.parent,"provides");for(;u;)Object.entries(u).forEach((([e,s])=>{i.includes(e)||(i.push(e),t(e,s))})),u=Object.getPrototypeOf(u);return()=>s(d,o,n)}}):d}export{p as createGuideStep};
1
+ import{defineComponent as e,provide as t,createVNode as s}from"vue";import{useTheme as r}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isFunction as o,range as i}from"lodash-es";import"@vue/shared";import{widthAppend as n}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSpace as u,NButton as l}from"naive-ui";import"../../../shared/hooks/useScrollLoading.js";const d=e({props:{config:{type:Object,required:!0,default:()=>({})},index:{type:Number,required:!0},length:{type:Number,required:!0}},emits:["cancel","next","toNext"],setup(e,{emit:t,slots:d}){const p=r();function a(e,{skippable:r=!0,skipText:n="跳过",nextText:d="下一步",endText:p="结束引导"},a,c){var m;return s("footer",{class:"guide__stepFooter"},[null!=(m=o(e)?e():null)?m:s(u,{justify:"end",wrapItem:!1},{default:()=>[f(),r?s(l,{ghost:!0,bordered:!1,class:"guide__stepSkipBtn",textColor:"#c5c5c5",onClick:()=>t("cancel")},{default:()=>n}):null,s(l,{type:"primary",class:"guide__stepNextBtn",onClick:()=>t("next")},{default:()=>a===c-1?p:d})]})]);function f(){return s(u,{justify:"start",style:"flex:1"},{default:function(){return i(c).map((e=>s(l,{class:"guide__stepToBtn",bordered:!1,onClick:()=>t("toNext",e)},{default:()=>s("i",{class:["guide__stepToBtnContent",{guide__stepActiveBtn:e===a}]},null)})))}})}}return()=>{const{minWidth:t=240,maxWidth:r=300,pointer:i=!0}=e.config;return s("section",{class:"guide__stepContentWrapper",style:{minWidth:n(t),maxWidth:n(r),...p.value}},[i?s("div",{class:"guide__stepPointerWrapper"},[s("div",{class:"guide__stepPointer"},null),s("div",{class:"guide__stepPointerLine"},null)]):null,(l=d.header,s("header",{class:"guide__stepHeader"},[o(l)?l():null])),(u=d.body,s("section",{class:"guide__stepBody"},[o(u)?u():null])),a(d.footer,e.config,e.index,e.length)]);var u,l}}});function p(r){return r?e({setup(e,{attrs:o,slots:i}){const n=[];let u=(null==r?void 0:r.parent)&&Reflect.get(r.parent,"provides");for(;u;)Object.entries(u).forEach((([e,s])=>{n.includes(e)||(n.push(e),t(e,s))})),u=Object.getPrototypeOf(u);return()=>s(d,o,i)}}):d}export{p as createGuideStep};
@@ -230,8 +230,12 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
230
230
  inputRef: import("vue").Ref<any>;
231
231
  groupNameEditing: import("vue").Ref<boolean>;
232
232
  groupName: import("vue").Ref<string>;
233
+ showGroupDetail: import("vue").Ref<boolean>;
234
+ isGroupLeader: import("vue").ComputedRef<boolean>;
233
235
  currentGroupUserIds: import("vue").ComputedRef<any[]>;
236
+ currentGroupUser: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
234
237
  handleTopping: (value: boolean) => Promise<void>;
238
+ handleLeaveGroup: (dissolution: boolean) => Promise<void>;
235
239
  handleToEdit: () => Promise<void>;
236
240
  submitFormData: (o: import("../../shared/types").AnyObject) => Promise<void>;
237
241
  handleGroupName: () => Promise<void>;
@@ -247,10 +251,12 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
247
251
  NButton: any;
248
252
  NUploadTrigger: any;
249
253
  NUpload: any;
254
+ NPopconfirm: any;
250
255
  ChevronForwardOutline: 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<{}>>, {}>;
251
256
  Pencil: 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<{}>>, {}>;
252
257
  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<{}>>, {}>;
253
258
  RemoveOutline: 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<{}>>, {}>;
259
+ ChevronBackOutline: 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<{}>>, {}>;
254
260
  PersonProfile: import("vue").DefineComponent<{
255
261
  userId: {
256
262
  type: StringConstructor;
@@ -472,8 +478,8 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
472
478
  NImage: any;
473
479
  NInput: any;
474
480
  NIcon: any;
481
+ NTooltip: any;
475
482
  SearchOutline: 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<{}>>, {}>;
476
- OpenOutline: 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<{}>>, {}>;
477
483
  DownloadOutline: 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<{}>>, {}>;
478
484
  downloadFile: typeof import("./src/utils").downloadFile;
479
485
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -520,6 +526,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
520
526
  startDateDisabled: (ts: number) => boolean;
521
527
  endDateDisabled: (ts: number) => boolean;
522
528
  resetInfo: () => void;
529
+ formatEndTime: () => string;
523
530
  handleCloseTag: (type: "start" | "end" | "member") => void;
524
531
  getPrefixCondition: () => (JSX.Element | null)[];
525
532
  renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
@@ -762,10 +769,15 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
762
769
  '--c-tip-top': string;
763
770
  '--c-tip-gap': string;
764
771
  }>;
772
+ renderToolbar: ({ nodes }: import("naive-ui").ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
773
+ [key: string]: any;
774
+ }>[];
765
775
  getHistoryRecord: () => Promise<void>;
766
776
  handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
767
777
  setMenuPosition: (event: MouseEvent) => Promise<void>;
768
778
  showMessage: (item: import("../../shared/types").AnyObject) => boolean;
779
+ showReferenceMsg: (item: import("../../shared/types").AnyObject) => any;
780
+ showBlendMsg: (item: import("../../shared/types").AnyObject) => any;
769
781
  showTemplateMsg: (item: import("../../shared/types").AnyObject, type: "template" | "system") => boolean | undefined;
770
782
  isTemplate3: (content: import("../../shared/types").AnyObject) => boolean;
771
783
  needShowTime: (item: import("../../shared/types").AnyObject, index: number) => boolean;
@@ -983,7 +995,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
983
995
  defaultValue: import("../../shared/types").AnyObject[];
984
996
  }>;
985
997
  btnDisabled: import("vue").ComputedRef<boolean>;
986
- handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
998
+ handleCall: (chatMessageType: string, checkedIds?: string[]) => void;
987
999
  handleKeyDown: (event: KeyboardEvent) => void;
988
1000
  isWrap: (event: KeyboardEvent) => boolean;
989
1001
  handleInput: () => void;
@@ -235,8 +235,12 @@ declare const _default: import("vue").DefineComponent<{
235
235
  inputRef: import("vue").Ref<any>;
236
236
  groupNameEditing: import("vue").Ref<boolean>;
237
237
  groupName: import("vue").Ref<string>;
238
+ showGroupDetail: import("vue").Ref<boolean>;
239
+ isGroupLeader: import("vue").ComputedRef<boolean>;
238
240
  currentGroupUserIds: import("vue").ComputedRef<any[]>;
241
+ currentGroupUser: import("vue").ComputedRef<AnyObject[]>;
239
242
  handleTopping: (value: boolean) => Promise<void>;
243
+ handleLeaveGroup: (dissolution: boolean) => Promise<void>;
240
244
  handleToEdit: () => Promise<void>;
241
245
  submitFormData: (o: AnyObject) => Promise<void>;
242
246
  handleGroupName: () => Promise<void>;
@@ -252,10 +256,12 @@ declare const _default: import("vue").DefineComponent<{
252
256
  NButton: any;
253
257
  NUploadTrigger: any;
254
258
  NUpload: any;
259
+ NPopconfirm: any;
255
260
  ChevronForwardOutline: 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<{}>>, {}>;
256
261
  Pencil: 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<{}>>, {}>;
257
262
  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<{}>>, {}>;
258
263
  RemoveOutline: 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<{}>>, {}>;
264
+ ChevronBackOutline: 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<{}>>, {}>;
259
265
  PersonProfile: import("vue").DefineComponent<{
260
266
  userId: {
261
267
  type: StringConstructor;
@@ -477,8 +483,8 @@ declare const _default: import("vue").DefineComponent<{
477
483
  NImage: any;
478
484
  NInput: any;
479
485
  NIcon: any;
486
+ NTooltip: any;
480
487
  SearchOutline: 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<{}>>, {}>;
481
- OpenOutline: 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<{}>>, {}>;
482
488
  DownloadOutline: 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<{}>>, {}>;
483
489
  downloadFile: typeof import("./utils").downloadFile;
484
490
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -525,6 +531,7 @@ declare const _default: import("vue").DefineComponent<{
525
531
  startDateDisabled: (ts: number) => boolean;
526
532
  endDateDisabled: (ts: number) => boolean;
527
533
  resetInfo: () => void;
534
+ formatEndTime: () => string;
528
535
  handleCloseTag: (type: "start" | "end" | "member") => void;
529
536
  getPrefixCondition: () => (JSX.Element | null)[];
530
537
  renderLabel: (option: AnyObject) => JSX.Element;
@@ -767,10 +774,15 @@ declare const _default: import("vue").DefineComponent<{
767
774
  '--c-tip-top': string;
768
775
  '--c-tip-gap': string;
769
776
  }>;
777
+ renderToolbar: ({ nodes }: import("naive-ui").ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
778
+ [key: string]: any;
779
+ }>[];
770
780
  getHistoryRecord: () => Promise<void>;
771
781
  handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
772
782
  setMenuPosition: (event: MouseEvent) => Promise<void>;
773
783
  showMessage: (item: AnyObject) => boolean;
784
+ showReferenceMsg: (item: AnyObject) => any;
785
+ showBlendMsg: (item: AnyObject) => any;
774
786
  showTemplateMsg: (item: AnyObject, type: "template" | "system") => boolean | undefined;
775
787
  isTemplate3: (content: AnyObject) => boolean;
776
788
  needShowTime: (item: AnyObject, index: number) => boolean;
@@ -988,7 +1000,7 @@ declare const _default: import("vue").DefineComponent<{
988
1000
  defaultValue: AnyObject[];
989
1001
  }>;
990
1002
  btnDisabled: import("vue").ComputedRef<boolean>;
991
- handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
1003
+ handleCall: (chatMessageType: string, checkedIds?: string[]) => void;
992
1004
  handleKeyDown: (event: KeyboardEvent) => void;
993
1005
  isWrap: (event: KeyboardEvent) => boolean;
994
1006
  handleInput: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as y,NSpin as g,NLayout as v,NLayoutContent as S}from"naive-ui";import b from"./components/SiderList.vue.js";import M from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import T from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import L from"./components/MultipleVideo.vue.js";import{ChatSock as N}from"./utils/chatSock.js";import{instanceAxios as w,readMessageApi as U}from"./api/index.js";import{useTheme as A}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{remove as _,isNumber as C}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{CHAT_TYPE as O,SUBSCRIBE_MESSAGE_TYPE as x,AV_STATUS as K}from"./constants/index.js";import{InjectionIChatState as R,InjectionIChatStompClient as E,InjectionIChatEmits as G}from"./types/index.js";import{isAudioOrVideoMessage as B}from"./utils/index.js";import{useSession as J}from"./hooks/useSession.js";import"trtc-sdk-v5";const P={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},chatBox:{type:Boolean,default:!1},defaultSessionKey:{type:String}},emits:["template-click","unread-message-update"],setup(e,{expose:q,emit:F}){const H=e;w.defaults.baseURL=H.baseURL,w.defaults.headers.Authorization="bearer "+H.token;const z=A(),D=s(!1),W=s(),Y=o({orgId:H.orgId,currentSessionItem:{},id:"",userInfo:{id:H.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1});t(R,Y),t(E,W),t(G,F);const{openSession:Q,closeSession:X,getCurrentSession:Z,setSessionList:ee,setUpdateSessionItem:se,setCurrentSessionItem:oe}=J(Y),te=[];function ne(){const e={headers:{AccessToken:H.token,UserId:H.userId},heartbeatFn(){try{W.value.send("test")}catch(e){W.value.disconnect(),ne()}},connectCb(){console.log("连接成功"),W.value.subscribe("/user/topic/single",(({body:e})=>ie({body:e,chatType:O.SINGLE}))),W.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:n}=s;if(console.log("body",s),Object.assign(Y.userInfo,t,o),!(null==n?void 0:n.length))return;ee(n),te.splice(0,te.length),te.push(...n.filter((e=>e.chatType===O.GROUP))),te.forEach((e=>{W.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>ie({body:e,chatType:O.GROUP})))})),function(){const e=Y.sessionList.find((e=>e.sessionKey===H.defaultSessionKey));e&&Q(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};W.value=new N("/fdp-chat/websocket",e)}async function re(e,s){if(Y.currentMsg=e,e.sessionKey===Y.currentSessionItem.sessionKey)return Y.isAppendMsg=!0,e.sender!==Y.userInfo.id&&await U({chatType:s,messageIdSet:[e.id],receiver:Y.userInfo.id,sender:e.sender}),void oe({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const o={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName};se(o)}async function ie({body:e,chatType:s}){try{console.log(JSON.parse(e),"订阅新增消息");const o=JSON.parse(e),{messageVo:t,sessionVo:n,chatAvStatusVo:r}=o;switch(o.event){case x.MESSAGE:B(t.content)?!Y.showVideo&&!Y.showMultipleVideo||t.content.avStatus!==K.IN_CALL?(Y.currentMsg=t,Object.assign(Y.currentAVMsg,{strRoomId:t.sessionKey,chatMessageType:t.content.chatMessageType,callMode:t.sender===Y.userInfo.id?"call":"invite",currentMsg:t}),Y.showVideo||Y.showMultipleVideo?re(t,s):Y.showVideo=!0):(W.value.send("/app/chat/send",{},JSON.stringify({chatType:O.SINGLE,receiver:t.sender,content:{chatMessageType:t.content.chatMessageType,avStatus:K.CALL_BUSY}})),console.log("用户忙!")):re(t,s);break;case x.AV_STATUS:Object.assign(Y.currentAVMsg,r,{callMode:r.sender===Y.userInfo.id?"call":"invite",checkedIds:[]}),Y.showVideo||Y.showMultipleVideo?console.log("用户忙!"):Y.showMultipleVideo=!0;break;case x.NEW_SESSION:if(s===O.GROUP)return;se(n);break;case x.JOIN:if(s===O.GROUP)return;se(n),W.value.subscribe(`/topic/group/${n.receiver}`,(({body:e})=>ie({body:e,chatType:O.GROUP})));break;case x.LEAVE:X(),_(Y.sessionList,(e=>e.sessionKey===n.sessionKey))}}catch(e){console.log(e)}}return async function(){ne()}(),n((()=>{var e;null==(e=W.value)||e.disconnect()})),q({getUnreadData:function(){return Y.sessionList.filter((e=>C(e.unreadNum)&&e.unreadNum>0))},openSession:Q,closeSession:X,getCurrentSession:Z}),(s,o)=>(r(),i("div",{class:"iho-chat",style:a(c(z))},[d(c(y),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[D.value?(r(),l(c(g),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[e.chatBox?f("v-if",!0):(r(),i("div",P,[d(T),d(V,{title:"发起群聊",mode:"create","default-value":[Y.userInfo]},null,8,["default-value"]),m("div",$,[h(s.$slots,"toolbar")])])),d(c(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[e.chatBox?f("v-if",!0):(r(),l(b,{key:0})),d(c(S),{class:"chat-content"},{default:u((()=>[d(M),d(I),d(k)])),_:1}),h(s.$slots,"external")])),_:3}),Y.showVideo?(r(),l(j,{key:1})):f("v-if",!0),Y.showMultipleVideo?(r(),l(L,{key:2})):f("v-if",!0)],64))])),_:3})],4))}});export{q as default};
1
+ import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as g,NSpin as y,NLayout as v,NLayoutContent as S}from"naive-ui";import b from"./components/SiderList.vue.js";import M from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import T from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import L from"./components/MultipleVideo.vue.js";import{ChatSock as N}from"./utils/chatSock.js";import{instanceAxios as w,readMessageApi as U}from"./api/index.js";import{useTheme as A}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{remove as _,isNumber as C}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{CHAT_TYPE as O,SUBSCRIBE_MESSAGE_TYPE as x,AV_STATUS as K}from"./constants/index.js";import{InjectionIChatState as R,InjectionIChatStompClient as E,InjectionIChatEmits as G}from"./types/index.js";import{isAudioOrVideoMessage as B}from"./utils/index.js";import{useSession as J}from"./hooks/useSession.js";import"trtc-sdk-v5";const P={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},chatBox:{type:Boolean,default:!1},defaultSessionKey:{type:String}},emits:["template-click","unread-message-update"],setup(e,{expose:q,emit:F}){const H=e;w.defaults.baseURL=H.baseURL,w.defaults.headers.Authorization="bearer "+H.token;const z=A(),D=s(!1),W=s(),Y=o({orgId:H.orgId,currentSessionItem:{},id:"",userInfo:{id:H.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1});t(R,Y),t(E,W),t(G,F);const{openSession:Q,closeSession:X,getCurrentSession:Z,setSessionList:ee,setUpdateSessionItem:se,setCurrentSessionItem:oe}=J(Y),te=[];function ne(){const e={headers:{AccessToken:H.token,UserId:H.userId},heartbeatFn(){try{W.value.send("test")}catch(e){W.value.disconnect(),ne()}},connectCb(){console.log("连接成功"),W.value.subscribe("/user/topic/single",(({body:e})=>ie({body:e,chatType:O.SINGLE}))),W.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:n}=s;if(console.log("body",s),Object.assign(Y.userInfo,t,o),!(null==n?void 0:n.length))return;ee(n),te.splice(0,te.length),te.push(...n.filter((e=>e.chatType===O.GROUP))),te.forEach((e=>{W.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>ie({body:e,chatType:O.GROUP})))})),function(){const e=Y.sessionList.find((e=>e.sessionKey===H.defaultSessionKey));e&&Q(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};W.value=new N("/fdp-chat/websocket",e)}async function re(e,s){if(Y.currentMsg=e,e.sessionKey===Y.currentSessionItem.sessionKey)return Y.isAppendMsg=!0,e.sender!==Y.userInfo.id&&await U({chatType:s,messageIdSet:[e.id],receiver:Y.userInfo.id,sender:e.sender}),void oe({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const o={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName};se(o)}async function ie({body:e,chatType:s}){try{console.log(JSON.parse(e),"订阅新增消息");const o=JSON.parse(e),{messageVo:t,sessionVo:n,chatAvStatusVo:r}=o;switch(o.event){case x.MESSAGE:B(t.content)?!Y.showVideo&&!Y.showMultipleVideo||t.content.avStatus!==K.IN_CALL?(Y.currentMsg=t,Object.assign(Y.currentAVMsg,{strRoomId:t.sessionKey,chatMessageType:t.content.chatMessageType,callMode:t.sender===Y.userInfo.id?"call":"invite",currentMsg:t}),Y.showVideo||Y.showMultipleVideo?re(t,s):Y.showVideo=!0):(W.value.send("/app/chat/send",{},JSON.stringify({chatType:O.SINGLE,receiver:t.sender,content:{chatMessageType:t.content.chatMessageType,avStatus:K.CALL_BUSY}})),console.log("用户忙!")):re(t,s);break;case x.AV_STATUS:Object.assign(Y.currentAVMsg,r,{callMode:r.sender===Y.userInfo.id?"call":"invite",checkedIds:[]}),Y.showVideo||Y.showMultipleVideo?console.log("用户忙!"):Y.showMultipleVideo=!0;break;case x.NEW_SESSION:if(s===O.GROUP)return;se(n);break;case x.JOIN:if(s===O.GROUP)return;se(n),W.value.subscribe(`/topic/group/${n.receiver}`,(({body:e})=>ie({body:e,chatType:O.GROUP})));break;case x.LEAVE:X(),_(Y.sessionList,(e=>e.sessionKey===n.sessionKey))}}catch(e){console.log(e)}}return async function(){ne()}(),n((()=>{var e;null==(e=W.value)||e.disconnect()})),q({getUnreadData:function(){return Y.sessionList.filter((e=>C(e.unreadNum)&&e.unreadNum>0))},openSession:Q,closeSession:X,getCurrentSession:Z}),(s,o)=>(r(),i("div",{class:"iho-chat",style:a(c(z))},[d(c(g),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[D.value?(r(),l(c(y),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[e.chatBox?f("v-if",!0):(r(),i("div",P,[d(T),d(V,{title:"发起群聊",mode:"create","default-value":[Y.userInfo]},null,8,["default-value"]),m("div",$,[h(s.$slots,"toolbar")])])),d(c(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[e.chatBox?f("v-if",!0):(r(),l(b,{key:0})),d(c(S),{class:"chat-content"},{default:u((()=>[d(M),d(I),d(k)])),_:1}),h(s.$slots,"external")])),_:3}),Y.showVideo?(r(),l(j,{key:1})):f("v-if",!0),Y.showMultipleVideo?(r(),l(L,{key:2})):f("v-if",!0)],64))])),_:3})],4))}});export{q as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as r,Fragment as o,createVNode as u,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as I,NIcon as k,NCheckbox as y,NCheckboxGroup as w,NSpace as _,NAvatar as S,NTag as x,NTooltip as U,NButton as j}from"naive-ui";import{SearchOutline as C,AddOutline as L}from"@vicons/ionicons5";import{useState as A}from"../hooks/useState.js";import{useSession as G}from"../hooks/useSession.js";import{CHAT_TYPE as R}from"../constants/index.js";import"trtc-sdk-v5";import{listSort as V}from"../utils/index.js";import{groupLeaveApi as E,groupJoinApi as N,groupCreateApi as $}from"../api/index.js";import{cloneDeep as M,union as T,unionBy as z,remove as D,isArray as P,uniqBy as q,trim as B}from"lodash-es";import{useSearchUserList as F}from"../hooks/useSearchUserList.js";const H={class:"iho-chat-dialog__content iho-chat-add-wrapper"},J={key:0,class:"input-box"},K=d("span",null,"群名称:",-1),O={class:"transfer-box"},Q={class:"transfer-box__left"},W={class:"user-list-box"},X={key:1,class:"no-data"},Y={class:"transfer-box__right"},Z={class:"checked-tag-box"};var ee=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:ee}){const ae=e,{state:le}=A(),{setCurrentSessionItem:te}=G(le),ie=a(),re=a(""),oe=a(!1),ue=a([]),se=a([]),ne=a(""),de=a([]),{userList:ve,handleInput:ce}=F({wrapperRef:ie,keywordRef:re,before:()=>{ve.value=M(se.value),Ie()},after:()=>{ve.value.forEach((e=>{var a;e.disabled=null==(a=pe.value)?void 0:a.includes(e.id)})),Ie()}}),pe=l((()=>T(ae.disabledIds,[le.userInfo.id]))),me=l((()=>{var e,a;return(null==(e=le.sessionList)?void 0:e.length)?null==(a=V(le.sessionList).filter((e=>e.chatType===R.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),fe=l((()=>ue.value.length?ue.value.map((e=>e.id)):[])),he=l((()=>"create"===ae.mode?fe.value.length<3:fe.value.length<1)),be=l({get:()=>de.value.length===ve.value.filter((e=>!e.disabled)).length,set(e){const a=ve.value.filter((e=>!e.disabled));de.value=e?a.map((e=>e.id)):[],e?ue.value=z(ue.value,a,"id"):D(ue.value,(e=>a.map((e=>e.id)).includes(e.id)))}});async function ge(){switch(ae.mode){case"create":await $({creator:le.userInfo.id,memberIdSet:fe.value,name:B(ne.value),orgId:le.orgId});break;case"join":if(await N({groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!le.currentSessionItem.defaultName){const e=ue.value.map((e=>e.name)).join(",");te({name:`${le.currentSessionItem.name},${e}`})}le.currentGroupUser.push(ve.value.filter((e=>fe.value.includes(e.value))));break;case"remove":{const e=le.currentGroupUser.length-fe.value.length<3;if(await E({dissolution:e,groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!e){if(!le.currentSessionItem.defaultName){const e=ue.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");te({name:le.currentSessionItem.name.replace(a,"")})}D(le.currentGroupUser,(e=>fe.value.includes(e.id)))}break}default:ee("comfirm",fe.value)}oe.value=!1}function Ie(){var e,a;de.value=null!=(a=null==(e=ve.value.filter((e=>fe.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function ke(e,a){if("check"===a.actionType){const e=ve.value.find((e=>e.id===a.value));ue.value.push(e)}else D(ue.value,(e=>e.id===a.value))}return t((()=>oe.value),(e=>{if(!e)return;re.value="",ne.value="";const a=P(ae.options)&&ae.options.length?ae.options:me.value;se.value=q(a,"id").map((e=>{var a;return{...e,disabled:null==(a=pe.value)?void 0:a.includes(e.id)}})),ve.value=M(se.value),P(ae.defaultValue)&&ae.defaultValue.length?(ue.value=M(ae.defaultValue),Ie()):(ue.value=[],de.value=[])})),(a,l)=>(i(),r(o,null,[u(s(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:oe.value,"onUpdate:show":l[4]||(l[4]=e=>oe.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:s(he)},onPositiveClick:ge},{default:n((()=>[d("div",H,["create"===e.mode?(i(),r("div",J,[K,u(s(I),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ne.value,"onUpdate:value":l[0]||(l[0]=e=>ne.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",O,[d("div",Q,[u(s(I),{placeholder:"搜索",clearable:"",value:re.value,"onUpdate:value":[l[1]||(l[1]=e=>re.value=e),s(ce)],valueModifiers:{trim:!0}},{prefix:n((()=>[u(s(k),{component:s(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",W,[s(ve).length>0?(i(),r(o,{key:0},[u(s(y),{label:"全选",checked:s(be),"onUpdate:checked":l[2]||(l[2]=e=>c(be)?be.value=e:null)},null,8,["checked"]),u(s(w),{ref_key:"listRef",ref:ie,value:de.value,"onUpdate:value":[l[3]||(l[3]=e=>de.value=e),ke]},{default:n((()=>[(i(!0),r(o,null,p(s(ve),(e=>(i(),m(s(y),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[u(s(_),{align:"center","wrap-item":!1},{default:n((()=>[u(s(S),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),r("div",X,"找不到相关结果"))])]),d("div",Y,[d("span",null,"已选择 "+f(s(fe).length)+" 人",1),d("div",Z,[(i(!0),r(o,null,p(ue.value,(e=>(i(),m(s(x),{key:e.id,bordered:!1,closable:e.id!==s(le).userInfo.id,disabled:s(pe).includes(e.id),onClose:()=>{return a=e.id,D(ue.value,(e=>e.id===a)),void D(de.value,(e=>e===a));var a}},{avatar:n((()=>[u(s(S),{round:"",src:e.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))])])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:l[5]||(l[5]=e=>oe.value=!0)},[b(a.$slots,"trigger",{},(()=>[u(s(U),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:n((()=>[u(s(j),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[u(s(k),{component:s(L),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))])],64))}});export{ee as default};
1
+ import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as o,Fragment as r,createVNode as s,unref as u,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as I,NIcon as k,NCheckbox as y,NCheckboxGroup as w,NSpace as _,NAvatar as S,NTag as x,NTooltip as j,NButton as U}from"naive-ui";import{SearchOutline as C,AddOutline as L}from"@vicons/ionicons5";import{useState as A}from"../hooks/useState.js";import{useSession as R}from"../hooks/useSession.js";import{CHAT_TYPE as V}from"../constants/index.js";import"trtc-sdk-v5";import{listSort as E}from"../utils/index.js";import{groupLeaveApi as G,groupJoinApi as N,groupCreateApi as $}from"../api/index.js";import{cloneDeep as M,union as T,unionBy as z,remove as D,isArray as P,uniqBy as q,trim as B}from"lodash-es";import{useSearchUserList as F}from"../hooks/useSearchUserList.js";const H={class:"iho-chat-dialog__content iho-chat-add-wrapper"},J={key:0,class:"input-box"},K=d("span",null,"群名称:",-1),O={class:"transfer-box"},Q={class:"transfer-box__left"},W={class:"user-list-box"},X={key:1,class:"no-data"},Y={class:"transfer-box__right"},Z={class:"checked-tag-box"};var ee=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:ee}){const ae=e,{state:le}=A(),{setCurrentSessionItem:te}=R(le),ie=a(),oe=a(""),re=a(!1),se=a([]),ue=a([]),ne=a(""),de=a([]),{userList:ve,handleInput:ce}=F({wrapperRef:ie,keywordRef:oe,before:()=>{ve.value=M(ue.value),Ie()},after:()=>{ve.value.forEach((e=>{var a;e.disabled=null==(a=pe.value)?void 0:a.includes(e.id)})),Ie()}}),pe=l((()=>T(ae.disabledIds,[le.userInfo.id]))),me=l((()=>{var e,a;return(null==(e=le.sessionList)?void 0:e.length)?null==(a=E(le.sessionList).filter((e=>e.chatType===V.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),fe=l((()=>se.value.length?se.value.map((e=>e.id)):[])),he=l((()=>"create"===ae.mode?fe.value.length<3:fe.value.length<1)),be=l({get:()=>de.value.length===ve.value.filter((e=>!e.disabled)).length,set(e){const a=ve.value.filter((e=>!e.disabled));de.value=e?a.map((e=>e.id)):[],e?se.value=z(se.value,a,"id"):D(se.value,(e=>a.map((e=>e.id)).includes(e.id)))}});async function ge(){switch(ae.mode){case"create":await $({creator:le.userInfo.id,memberIdSet:fe.value,name:B(ne.value),orgId:le.orgId});break;case"join":if(await N({groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!le.currentSessionItem.defaultName){const e=se.value.map((e=>e.name)).join(",");te({name:`${le.currentSessionItem.name},${e}`})}le.currentGroupUser.push(...ve.value.filter((e=>fe.value.includes(e.id))));break;case"remove":if(await G({dissolution:!1,groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!le.currentSessionItem.defaultName){const e=se.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");te({name:le.currentSessionItem.name.replace(a,"")})}D(le.currentGroupUser,(e=>fe.value.includes(e.id)));break;default:ee("comfirm",fe.value)}re.value=!1}function Ie(){var e,a;de.value=null!=(a=null==(e=ve.value.filter((e=>fe.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function ke(e,a){if("check"===a.actionType){const e=ve.value.find((e=>e.id===a.value));se.value.push(e)}else D(se.value,(e=>e.id===a.value))}return t((()=>re.value),(e=>{if(!e)return;oe.value="",ne.value="";const a=P(ae.options)&&ae.options.length?ae.options:me.value;ue.value=q(a,"id").map((e=>{var a;return{...e,disabled:null==(a=pe.value)?void 0:a.includes(e.id)}})),ve.value=M(ue.value),P(ae.defaultValue)&&ae.defaultValue.length?(se.value=M(ae.defaultValue),Ie()):(se.value=[],de.value=[])})),(a,l)=>(i(),o(r,null,[s(u(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:re.value,"onUpdate:show":l[4]||(l[4]=e=>re.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:u(he)},onPositiveClick:ge},{default:n((()=>[d("div",H,["create"===e.mode?(i(),o("div",J,[K,s(u(I),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ne.value,"onUpdate:value":l[0]||(l[0]=e=>ne.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",O,[d("div",Q,[s(u(I),{placeholder:"搜索",clearable:"",value:oe.value,"onUpdate:value":[l[1]||(l[1]=e=>oe.value=e),u(ce)],valueModifiers:{trim:!0}},{prefix:n((()=>[s(u(k),{component:u(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",W,[u(ve).length>0?(i(),o(r,{key:0},[s(u(y),{label:"全选",checked:u(be),"onUpdate:checked":l[2]||(l[2]=e=>c(be)?be.value=e:null)},null,8,["checked"]),s(u(w),{ref_key:"listRef",ref:ie,value:de.value,"onUpdate:value":[l[3]||(l[3]=e=>de.value=e),ke]},{default:n((()=>[(i(!0),o(r,null,p(u(ve),(e=>(i(),m(u(y),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[s(u(_),{align:"center","wrap-item":!1},{default:n((()=>[s(u(S),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),o("div",X,"找不到相关结果"))])]),d("div",Y,[d("span",null,"已选择 "+f(u(fe).length)+" 人",1),d("div",Z,[(i(!0),o(r,null,p(se.value,(e=>(i(),m(u(x),{key:e.id,bordered:!1,closable:e.id!==u(le).userInfo.id,disabled:u(pe).includes(e.id),onClose:()=>{return a=e.id,D(se.value,(e=>e.id===a)),void D(de.value,(e=>e===a));var a}},{avatar:n((()=>[s(u(S),{round:"",src:e.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))])])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:l[5]||(l[5]=e=>re.value=!0)},[b(a.$slots,"trigger",{},(()=>[s(u(j),{"show-arrow":!1,placement:"bottom"},{trigger:n((()=>[s(u(U),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[s(u(k),{component:u(L),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))])],64))}});export{ee as default};
@@ -45,8 +45,8 @@ declare const _default: import("vue").DefineComponent<{
45
45
  NImage: any;
46
46
  NInput: any;
47
47
  NIcon: any;
48
+ NTooltip: any;
48
49
  SearchOutline: 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<{}>>, {}>;
49
- OpenOutline: 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<{}>>, {}>;
50
50
  DownloadOutline: 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<{}>>, {}>;
51
51
  downloadFile: typeof downloadFile;
52
52
  }, unknown, {}, {}, 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 s,watch as o,openBlock as a,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as y,vShow as f,normalizeStyle as h}from"vue";import{NModal as v,NImageGroup as g,NImage as w,NInput as b,NIcon as k}from"naive-ui";import{SearchOutline as M,OpenOutline as T,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as S}from"../api/index.js";import{useScrollLoading as _}from"../hooks/useScrollLoading.js";import{format as x,isSameWeek as j,isSameMonth as A}from"date-fns";import{useState as H}from"../hooks/useState.js";import{getFileSize as D,downloadFile as C}from"../utils/index.js";import{last as z}from"lodash-es";import"trtc-sdk-v5";import{useDebounceFn as L}from"@vueuse/core";import{useTheme as U}from"../../../../shared/hooks/useTheme.js";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";const E={class:"label"},O={class:"image-box"},$={class:"file-type"},F={class:"text"},K={class:"name"},P={class:"detail"},R={class:"opt-box"};var B=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const B=e,G=U(),{state:N}=H(),q=t([]),J=t([]),Q=t(),V=t(),W=t(),X=L(ee,500),Y={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function Z(){var e;try{if(!Y.hasMore)return;Y.page++;const t=await S({orgId:N.orgId,keyword:W.value,endTime:"",startTime:"",lastSendTime:Y.lastSendTime,memberIdSet:[],page:Y.page,recordType:"image"===B.type?"IMAGE":"FILE",sessionKey:N.currentSessionItem.sessionKey,userId:N.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(Y.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let s=t||[];if(Array.isArray(t)&&t.length>0&&(s=t[0].recordList),Y.lastSendTime=null==(e=z(s))?void 0:e.sendTime,"image"===B.type){const e=function(e){const t={};e.forEach((e=>{const s=new Date(e.sendTime);let o=x(s,"yyyy年MM月");j(s,new Date)?o="本周":A(s,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(s);q.value=Y.page>1?q.value.concat(e):e}else{const e=s.map((e=>new Promise((async t=>{const s=await D(e.content.fileUrl);t({...e,size:s})})))),t=await Promise.all(e);J.value=Y.page>1?J.value.concat(t):t}}catch(e){console.log(e)}}function ee(){Object.assign(Y,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),Z()}_(Q,(()=>{Z()})),_(V,(()=>{Z()}));const te=s((()=>"image"===B.type?"聊天图片":"聊天文件"));function se(e){const{size:t,sendTime:s,senderName:o}=e;return`${t} · ${x(new Date(s),"yyyy/MM/dd HH:mm")} ${o}`}function oe(e){var t;const s=(null==(t=e.content)?void 0:t.msg)||"",o=s.lastIndexOf(".");if(-1!==o){return s.charAt(o+1).toUpperCase()}return"?"}return o((()=>B.visible),(e=>{e?ee():W.value=""})),(t,s)=>(a(),i(n(v),{preset:"dialog",title:n(te),"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{default:r((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:Q},[m(n(g),{"show-toolbar-tooltip":""},{default:r((()=>[(a(!0),p(d,null,u(q.value,(e=>(a(),p("div",{class:"image-item",key:e.label},[c("span",E,y(e.label),1),c("div",O,[(a(!0),p(d,null,u(e.list,(e=>(a(),i(n(w),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[f,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:h(n(G))},[m(n(b),{clearable:"",placeholder:"搜索文件",value:W.value,"onUpdate:value":s[0]||(s[0]=e=>W.value=e),valueModifiers:{trim:!0},onInput:n(X)},{prefix:r((()=>[m(n(k),{component:n(M)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:V},[(a(!0),p(d,null,u(J.value,((e,t)=>(a(),p("div",{class:"file-item",key:t},[c("span",$,y(oe(e)),1),c("div",F,[c("span",K,y(e.content.msg),1),c("span",P,y(se(e)),1)]),c("div",R,[m(n(k),{size:16,component:n(T)},null,8,["component"]),m(n(k),{size:16,component:n(I),onClick:()=>n(C)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])])))),128))],512)],4),[[f,"image"!==e.type]])])),_:1},8,["title"]))}});export{B as default};
1
+ import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as s,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as f,vShow as h,normalizeStyle as y,createCommentVNode as g,createTextVNode as v}from"vue";import{NModal as w,NImageGroup as b,NImage as k,NInput as M,NIcon as T,NTooltip as _}from"naive-ui";import{SearchOutline as I,DownloadOutline as S}from"@vicons/ionicons5";import{searchChatRecordApi as x}from"../api/index.js";import{useTheme as j}from"../../../../shared/hooks/useTheme.js";import{useDebounceFn as A}from"@vueuse/core";import{format as H,isSameWeek as D,isSameMonth as C}from"date-fns";import{last as O}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as z}from"../../../../shared/hooks/useScrollLoading.js";import{useState as L}from"../hooks/useState.js";import{getFileSize as U,downloadFile as E}from"../utils/index.js";import"trtc-sdk-v5";const $={class:"label"},F={class:"image-box"},P={class:"file-type"},R={class:"text"},B={class:"name"},G={class:"detail"},N={class:"opt-box"};var q=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const q=e,J=j(),{state:K}=L(),Q=t([]),V=t([]),W=t(),X=t(),Y=t(),Z=A(oe,500),ee={page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")};async function te(){var e;try{if(!ee.hasMore)return;ee.page++;const t=await x({orgId:K.orgId,keyword:Y.value,endTime:"",startTime:"",lastSendTime:ee.lastSendTime,memberIdSet:[],page:ee.page,recordType:"image"===q.type?"IMAGE":"FILE",receiver:K.currentSessionItem.receiver,userId:K.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(ee.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),ee.lastSendTime=null==(e=O(o))?void 0:e.sendTime,"image"===q.type){const e=function(e){const t={};e.forEach((e=>{const o=new Date(e.sendTime);let a=H(o,"yyyy年MM月");D(o,new Date)?a="本周":C(o,new Date)&&(a="本月"),t[a]||(t[a]=[]),t[a].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=ee.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await U(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);V.value=ee.page>1?V.value.concat(t):t}}catch(e){console.log(e)}}function oe(){Object.assign(ee,{page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")}),te()}z(W,(()=>{te()})),z(X,(()=>{te()}));const ae=o((()=>"image"===q.type?"聊天图片":"聊天文件"));function se(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${H(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function ie(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((()=>q.visible),(e=>{e?oe():Y.value=""})),(t,o)=>(s(),i(n(w),{preset:"dialog",title:n(ae),"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{default:r((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:W},[m(n(b),{"show-toolbar-tooltip":""},{default:r((()=>[(s(!0),p(d,null,u(Q.value,(e=>(s(),p("div",{class:"image-item",key:e.label},[c("span",$,f(e.label),1),c("div",F,[(s(!0),p(d,null,u(e.list,(e=>(s(),i(n(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[h,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:y(n(J))},[m(n(M),{clearable:"",placeholder:"搜索文件",value:Y.value,"onUpdate:value":o[0]||(o[0]=e=>Y.value=e),valueModifiers:{trim:!0},onInput:n(Z)},{prefix:r((()=>[m(n(T),{component:n(I)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:X},[(s(!0),p(d,null,u(V.value,((e,t)=>(s(),p("div",{class:"file-item",key:t},[c("span",P,f(ie(e)),1),c("div",R,[c("span",B,f(e.content.msg),1),c("span",G,f(se(e)),1)]),c("div",N,[g(' <n-tooltip :show-arrow="false">\r\n\t\t\t\t\t\t\t<template #trigger>\r\n\t\t\t\t\t\t\t\t<n-icon :size="16" :component="OpenOutline" />\r\n\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t转发\r\n\t\t\t\t\t\t</n-tooltip> '),m(n(_),{"show-arrow":!1},{trigger:r((()=>[m(n(T),{size:16,component:n(S),onClick:()=>n(E)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:r((()=>[v(" 下载 ")])),_:2},1024)])])))),128))],512)],4),[[h,"image"!==e.type]])])),_:1},8,["title"]))}});export{q as default};
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{}, {
18
18
  defaultValue: AnyObject[];
19
19
  }>;
20
20
  btnDisabled: import("vue").ComputedRef<boolean>;
21
- handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
21
+ handleCall: (chatMessageType: string, checkedIds?: string[]) => void;
22
22
  handleKeyDown: (event: KeyboardEvent) => void;
23
23
  isWrap: (event: KeyboardEvent) => boolean;
24
24
  handleInput: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as r,openBlock as i,createElementBlock as s,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as g,createCommentVNode as f,withCtx as p,Fragment as d,renderList as m,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as C,NUpload as I,NUploadTrigger as T}from"naive-ui";import E from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{MESSAGE_TYPE as z,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L,base64ToFile as O}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as A,VideocamOutline as V}from"@vicons/ionicons5";import{xor as K,trim as F,cloneDeep as H}from"lodash-es";import{uuidGenerator as J}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},G={class:"reference-content"},N=["innerHTML"],S={class:"tool-box"},X=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),B=l("span",null,"默认表情",-1),$={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"},ee=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var te=e({__name:"ChatFooter",setup(e){const te=t(),{state:ne,sendMessage:oe}=b(),{isGroupChat:re}=x(ne),ie=t(!1),se=t(""),ae=n((()=>({options:ne.currentGroupUser,defaultValue:[ne.userInfo]}))),ce=n((()=>!se.value.replace(/(&nbsp;|\s|<br>)+/g,"")));function le(e,t=[]){const n=J(),o=[],r=t.length>0;ne.showVideo||ne.showMultipleVideo||(r?(o.push(...K(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 ue(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),de()))}function ge(){var e;se.value=(null==(e=te.value)?void 0:e.innerHTML)||""}async function fe(e){const t=new FormData;return t.append("sender",ne.userInfo.id),t.append("file",e),await q(t)}async function pe(e,t){const{file:n,name:o}=e.file,r=await fe(n);if(!r)return console.log("上传失败");me({chatMessageType:t,msg:t===z.FILE?o:r,url:r})}async function de(){const{innerHTML:e="",innerText:t="",outerText:n=""}=te.value||{};if(ce.value)return console.log("请输入内容");let o=z.TEXT,r="";if(e){const n=e.match(/<img[^>]*>/gi),i=(n||[]).length;if(t&&0===i)r=t;else if(t||1!==i){if(o=z.BLEND,r=e,null==n?void 0:n.length)for(let e=0;e<i;e++)if(n[e].includes(`data-type="${z.EMOJI}"`)){const t=n[e].match(/data-msg="(.*?)"/);t&&t.length>1&&(r=r.replace(n[e],`[${t[1]}]`))}else{const t=n[e].match(/src\s*=\s*"([^"]*)"/);if(t&&t.length>1){const e=O(t[1]);if(e){const n=await fe(e);r=r.replace(t[1],n||"")}}}}else if(e.includes(z.EMOJI)){o=z.EMOJI;const t=e.match(/data-msg\s*=\s*"([^"]*)"/);t&&(r=t[1])}else{o=z.IMAGE;const t=e.match(/src\s*=\s*"([^"]*)"/);if(t){const e=O(t[1]);if(e){const t=await fe(e);t&&(r=t)}}}}else r=F(t);r&&me({msg:r,chatMessageType:o,origin:"btn"})}async function me(e){const{chatMessageType:t=z.TEXT,msg:n,url:o,origin:r=""}=e,i={msg:n,chatMessageType:t};t===z.FILE&&(i.fileUrl=o),"btn"===r&&(te.value.innerHTML="",se.value=""),ne.currentReferenceMsg&&(t===z.TEXT&&(i.referenceContent=H(ne.currentReferenceMsg)),ne.currentReferenceMsg=null),oe({content:i})}return o((()=>ne.currentReferenceMsg),(e=>{var t;e&&(null==(t=te.value)||t.focus())})),(e,t)=>r((i(),s("section",{class:"chat-footer",style:a({cursor:c(ne).id?"default":"not-allowed"})},[c(ne).currentReferenceMsg?(i(),s("div",U,[l("div",G,[l("span",null,u(c(ne).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ne).currentReferenceMsg.content)},null,8,N)]),g(c(M),{component:c(D),onClick:t[0]||(t[0]=()=>c(ne).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),l("div",S,[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:ie.value,"onUpdate:show":t[1]||(t[1]=e=>ie.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:p((()=>[X])),_:1})])),default:p((()=>[B,l("div",$,[(i(!0),s(d,null,m(c(R).default,(([e,t])=>(i(),h(c(_),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:()=>function(e){ie.value=!1,me({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:p((()=>[l("img",{src:t},null,8,P)])),_:2},1032,["onClick"])])),default:p((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:p((()=>[y(" 表情 ")])),_:1}),g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>me({chatMessageType:c(z).EMOJI,msg:0}))},{icon:p((()=>[Q])),_:1})])),default:p((()=>[y(" 点赞 ")])),_:1}),g(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>pe(e,c(z).IMAGE))},{default:p((()=>[g(c(T),{abstract:""},{default:p((({handleClick:e})=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:p((()=>[W])),_:2},1032,["onClick"])])),default:p((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),g(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>pe(e,c(z).FILE))},{default:p((()=>[g(c(T),{abstract:""},{default:p((({handleClick:e})=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:p((()=>[Y])),_:2},1032,["onClick"])])),default:p((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(re)?(i(),s(d,{key:0},[g(E,v(c(ae),{onComfirm:t[5]||(t[5]=e=>le(c(z).AUDIO,e))}),{trigger:p((()=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:p((()=>[g(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:p((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),g(E,v(c(ae),{onComfirm:t[6]||(t[6]=e=>le(c(z).VIDEO,e))}),{trigger:p((()=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:p((()=>[g(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:p((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(i(),s(d,{key:1},[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>le(c(z).AUDIO))},{icon:p((()=>[g(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:p((()=>[y(" 语音通话 ")])),_:1}),g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:p((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>le(c(z).VIDEO))},{icon:p((()=>[g(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:p((()=>[y(" 视频通话 ")])),_:1})],64))]),r(l("div",{ref_key:"inputRef",ref:te,class:"input-box",contenteditable:"",onKeydown:ue,onInput:ge},null,544),[[w,c(ne).id]]),l("div",Z,[ee,g(c(C),{type:"primary",round:"",disabled:c(ce),onClick:de},{default:p((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ne).id]])}});export{te as default};
1
+ import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as r,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as p,renderList as g,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as C,NUpload as I,NUploadTrigger as E}from"naive-ui";import T from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{MESSAGE_TYPE as j,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L,base64ToFile as O}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as A,VideocamOutline as V}from"@vicons/ionicons5";import{xor as H,trim as J,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},$={class:"reference-content"},G=["innerHTML"],N={class:"tool-box"},B=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),S=l("span",null,"默认表情",-1),X={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"},ee=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ne=e({__name:"ChatFooter",setup(e){const ne=n(),{state:te,sendMessage:oe}=b(),{isGroupChat:re}=x(te),se=n(!1),ie=n(""),ae=t((()=>({options:te.currentGroupUser,defaultValue:[te.userInfo]}))),ce=t((()=>!ie.value.replace(/(&nbsp;|\s|<br>)+/g,"")));function le(e,n=[]){const t=F(),o=[],r=n.length>0;te.showVideo||te.showMultipleVideo||(r?(o.push(...H(n,[te.userInfo.id])),Object.assign(te.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),te.showMultipleVideo=!0):oe({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function ue(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),pe()))}function fe(){var e;ie.value=(null==(e=ne.value)?void 0:e.innerHTML)||""}async function de(e){const n=new FormData;return n.append("sender",te.userInfo.id),n.append("file",e),await q(n)}async function me(e,n){const{file:t,name:o}=e.file,r=await de(t);if(!r)return console.log("上传失败");ge({chatMessageType:n,msg:n===j.FILE?o:r,url:r})}async function pe(){const{innerHTML:e="",innerText:n="",outerText:t=""}=ne.value||{};if(ce.value)return console.log("请输入内容");let o=j.TEXT,r="";if(e){const t=e.match(/<img[^>]*>/gi),s=(t||[]).length;if(n&&0===s)r=n;else if(n||1!==s){if(o=j.BLEND,r=e,null==t?void 0:t.length)for(let e=0;e<s;e++)if(t[e].includes(`data-type="${j.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(r=r.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=O(n[1]);if(e){const t=await de(e);r=r.replace(n[1],t||"")}}}}else if(e.includes(j.EMOJI)){o=j.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(r=n[1])}else{o=j.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=O(n[1]);if(e){const n=await de(e);n&&(r=n)}}}}else r=J(n);r&&ge({msg:r,chatMessageType:o,origin:"btn"})}async function ge(e){const{chatMessageType:n=j.TEXT,msg:t,url:o,origin:r=""}=e,s={msg:t,chatMessageType:n};n===j.FILE&&(s.fileUrl=o),"btn"===r&&(ne.value.innerHTML="",ie.value=""),te.currentReferenceMsg&&([j.TEXT,j.EMOJI,j.BLEND].includes(n)&&(s.referenceContent=K(te.currentReferenceMsg)),te.currentReferenceMsg=null),oe({content:s})}return o((()=>te.currentReferenceMsg),(e=>{var n;e&&(null==(n=ne.value)||n.focus())})),(e,n)=>r((s(),i("section",{class:"chat-footer",style:a({cursor:c(te).id?"default":"not-allowed"})},[c(te).currentReferenceMsg?(s(),i("div",U,[l("div",$,[l("span",null,u(c(te).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(te).currentReferenceMsg.content)},null,8,G)]),f(c(M),{component:c(D),onClick:n[0]||(n[0]=()=>c(te).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",N,[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:se.value,"onUpdate:show":n[1]||(n[1]=e=>se.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[B])),_:1})])),default:m((()=>[S,l("div",X,[(s(!0),i(p,null,g(c(R).default,(([e,n])=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:()=>function(e){var n;se.value=!1,null==(n=ne.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(e)} />`)}(e)},{icon:m((()=>[l("img",{src:n},null,8,P)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:m((()=>[y(" 表情 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>ge({chatMessageType:c(j).EMOJI,msg:0}))},{icon:m((()=>[Q])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),f(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>me(e,c(j).IMAGE))},{default:m((()=>[f(c(E),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[W])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),f(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>me(e,c(j).FILE))},{default:m((()=>[f(c(E),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[Y])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(re)?(s(),i(p,{key:0},[f(T,v(c(ae),{onComfirm:n[5]||(n[5]=e=>le(c(j).AUDIO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),f(T,v(c(ae),{onComfirm:n[6]||(n[6]=e=>le(c(j).VIDEO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(s(),i(p,{key:1},[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>le(c(j).AUDIO))},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>le(c(j).VIDEO))},{icon:m((()=>[f(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))]),r(l("div",{ref_key:"inputRef",ref:ne,class:"input-box",contenteditable:"",onKeydown:ue,onInput:fe},null,544),[[w,c(te).id]]),l("div",Z,[ee,f(c(C),{type:"primary",round:"",disabled:c(ce),onClick:pe},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(te).id]])}});export{ne as default};
@@ -97,8 +97,12 @@ declare const _default: import("vue").DefineComponent<{}, {
97
97
  inputRef: import("vue").Ref<any>;
98
98
  groupNameEditing: import("vue").Ref<boolean>;
99
99
  groupName: import("vue").Ref<string>;
100
+ showGroupDetail: import("vue").Ref<boolean>;
101
+ isGroupLeader: import("vue").ComputedRef<boolean>;
100
102
  currentGroupUserIds: import("vue").ComputedRef<any[]>;
103
+ currentGroupUser: import("vue").ComputedRef<AnyObject[]>;
101
104
  handleTopping: (value: boolean) => Promise<void>;
105
+ handleLeaveGroup: (dissolution: boolean) => Promise<void>;
102
106
  handleToEdit: () => Promise<void>;
103
107
  submitFormData: (o: AnyObject) => Promise<void>;
104
108
  handleGroupName: () => Promise<void>;
@@ -114,10 +118,12 @@ declare const _default: import("vue").DefineComponent<{}, {
114
118
  NButton: any;
115
119
  NUploadTrigger: any;
116
120
  NUpload: any;
121
+ NPopconfirm: any;
117
122
  ChevronForwardOutline: 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<{}>>, {}>;
118
123
  Pencil: 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<{}>>, {}>;
119
124
  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<{}>>, {}>;
120
125
  RemoveOutline: 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<{}>>, {}>;
126
+ ChevronBackOutline: 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<{}>>, {}>;
121
127
  PersonProfile: import("vue").DefineComponent<{
122
128
  userId: {
123
129
  type: StringConstructor;
@@ -339,8 +345,8 @@ declare const _default: import("vue").DefineComponent<{}, {
339
345
  NImage: any;
340
346
  NInput: any;
341
347
  NIcon: any;
348
+ NTooltip: any;
342
349
  SearchOutline: 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<{}>>, {}>;
343
- OpenOutline: 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<{}>>, {}>;
344
350
  DownloadOutline: 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<{}>>, {}>;
345
351
  downloadFile: typeof import("../utils").downloadFile;
346
352
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -387,6 +393,7 @@ declare const _default: import("vue").DefineComponent<{}, {
387
393
  startDateDisabled: (ts: number) => boolean;
388
394
  endDateDisabled: (ts: number) => boolean;
389
395
  resetInfo: () => void;
396
+ formatEndTime: () => string;
390
397
  handleCloseTag: (type: "start" | "end" | "member") => void;
391
398
  getPrefixCondition: () => (JSX.Element | null)[];
392
399
  renderLabel: (option: AnyObject) => JSX.Element;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as o,openBlock as r,createElementBlock as i,Fragment as a,unref as s,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,createTextVNode as m,normalizeProps as h,guardReactiveProps as d,createCommentVNode as v}from"vue";import{NAvatar as p,NTooltip as f,NButton as g,NIcon as w}from"naive-ui";import{useState as _}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import y from"./PersonProfile.vue.js";import j from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import k from"./ChatRecord.vue.js";import z from"./ChatAdd.vue.js";import{PersonAddOutline as S}from"@vicons/ionicons5";const q={key:0,class:"chat-header box-shadow"},U={class:"chat-header__left"},I={class:"name"},x={class:"chat-header__right"},G=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),P=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),A=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),F=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var H=e({__name:"ChatHeader",setup(e){const{state:H}=_(),{isGroupChat:R}=b(H),V=t(!1),B=t(!1),D=t("image"),E=t(!1),J=o((()=>{const e=H.currentGroupUser.map((e=>e.id));return R.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:H.currentGroupUser}}));function K(e){D.value=e,B.value=!0}return(e,t)=>(r(),i(a,null,[s(H).id?(r(),i("section",q,[n("div",U,[l(y,{"user-id":s(H).currentSessionItem.receiver,disabled:s(R),placement:"bottom"},{trigger:c((()=>[l(s(p),{round:"",size:30,src:s(H).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",I,u(s(H).currentSessionItem.name),1)]),n("div",x,[l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[0]||(t[0]=()=>K("image"))},{icon:c((()=>[G])),_:1})])),default:c((()=>[m(" 图片 ")])),_:1}),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[1]||(t[1]=()=>K("file"))},{icon:c((()=>[P])),_:1})])),default:c((()=>[m(" 文件 ")])),_:1}),l(z,h(d(s(J))),{trigger:c((()=>[l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny"},{icon:c((()=>[l(s(w),{size:"18",component:s(S)},null,8,["component"])])),_:1})])),default:c((()=>[m(" 添加成员 ")])),_:1})])),_:1},16),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>E.value=!0)},{icon:c((()=>[A])),_:1})])),default:c((()=>[m(" 聊天记录 ")])),_:1}),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[3]||(t[3]=()=>V.value=!0)},{icon:c((()=>[F])),_:1})])),default:c((()=>[m(" 聊天设置 ")])),_:1})])])):v("v-if",!0),l(j,{show:V.value,"onUpdate:show":t[4]||(t[4]=e=>V.value=e)},null,8,["show"]),l(C,{show:B.value,"onUpdate:show":t[5]||(t[5]=e=>B.value=e),type:D.value,visible:B.value},null,8,["show","type","visible"]),l(k,{show:E.value,"onUpdate:show":t[6]||(t[6]=e=>E.value=e),visible:E.value},null,8,["show","visible"])],64))}});export{H as default};
1
+ import{defineComponent as e,ref as t,computed as o,openBlock as r,createElementBlock as a,Fragment as i,unref as s,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,createTextVNode as m,normalizeProps as h,guardReactiveProps as d,createCommentVNode as p}from"vue";import{NAvatar as v,NTooltip as f,NButton as w,NIcon as g}from"naive-ui";import{useState as _}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import y from"./PersonProfile.vue.js";import j from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import k from"./ChatRecord.vue.js";import z from"./ChatAdd.vue.js";import{PersonAddOutline as S}from"@vicons/ionicons5";const q={key:0,class:"chat-header box-shadow"},U={class:"chat-header__left"},I={class:"name"},x={class:"chat-header__right"},G=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),P=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),A=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),F=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var H=e({__name:"ChatHeader",setup(e){const{state:H}=_(),{isGroupChat:R}=b(H),V=t(!1),B=t(!1),D=t("image"),E=t(!1),J=o((()=>{const e=H.currentGroupUser.map((e=>e.id));return R.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:H.currentGroupUser}}));function K(e){D.value=e,B.value=!0}return(e,t)=>(r(),a(i,null,[s(H).id?(r(),a("section",q,[n("div",U,[l(y,{"user-id":s(H).currentSessionItem.receiver,disabled:s(R),placement:"bottom"},{trigger:c((()=>[l(s(v),{round:"",size:30,src:s(H).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",I,u(s(H).currentSessionItem.name),1)]),n("div",x,[l(s(f),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(s(w),{quaternary:"",size:"tiny",onClick:t[0]||(t[0]=()=>K("image"))},{icon:c((()=>[G])),_:1})])),default:c((()=>[m(" 图片 ")])),_:1}),l(s(f),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(s(w),{quaternary:"",size:"tiny",onClick:t[1]||(t[1]=()=>K("file"))},{icon:c((()=>[P])),_:1})])),default:c((()=>[m(" 文件 ")])),_:1}),l(z,h(d(s(J))),{trigger:c((()=>[l(s(f),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(s(w),{quaternary:"",size:"tiny"},{icon:c((()=>[l(s(g),{size:"18",component:s(S)},null,8,["component"])])),_:1})])),default:c((()=>[m(" 添加成员 ")])),_:1})])),_:1},16),l(s(f),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(s(w),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>E.value=!0)},{icon:c((()=>[A])),_:1})])),default:c((()=>[m(" 聊天记录 ")])),_:1}),l(s(f),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(s(w),{quaternary:"",size:"tiny",onClick:t[3]||(t[3]=()=>V.value=!0)},{icon:c((()=>[F])),_:1})])),default:c((()=>[m(" 聊天设置 ")])),_:1})])])):p("v-if",!0),l(j,{show:V.value,"onUpdate:show":t[4]||(t[4]=e=>V.value=e)},null,8,["show"]),l(C,{show:B.value,"onUpdate:show":t[5]||(t[5]=e=>B.value=e),type:D.value,visible:B.value},null,8,["show","type","visible"]),l(k,{show:E.value,"onUpdate:show":t[6]||(t[6]=e=>E.value=e),visible:E.value},null,8,["show","visible"])],64))}});export{H as default};
@@ -1,4 +1,5 @@
1
1
  import { CSSProperties } from 'vue';
2
+ import { ImageRenderToolbarProps } from 'naive-ui';
2
3
  import { AnyObject } from '../../../../shared/types';
3
4
  import { simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
4
5
  import { MESSAGE_TYPE } from '../constants';
@@ -21,10 +22,15 @@ declare const _default: import("vue").DefineComponent<{}, {
21
22
  '--c-tip-top': string;
22
23
  '--c-tip-gap': string;
23
24
  }>;
25
+ renderToolbar: ({ nodes }: ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
26
+ [key: string]: any;
27
+ }>[];
24
28
  getHistoryRecord: () => Promise<void>;
25
29
  handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
26
30
  setMenuPosition: (event: MouseEvent) => Promise<void>;
27
31
  showMessage: (item: AnyObject) => boolean;
32
+ showReferenceMsg: (item: AnyObject) => any;
33
+ showBlendMsg: (item: AnyObject) => any;
28
34
  showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
29
35
  isTemplate3: (content: AnyObject) => boolean;
30
36
  needShowTime: (item: AnyObject, index: number) => boolean;