cnhis-design-vue 3.2.6-beta.1 → 3.2.6-beta.11

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 (114) hide show
  1. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  2. package/es/components/button-print/src/utils/print.js +1 -1
  3. package/es/components/callback/src/components/render/popupMaps.d.ts +6 -4
  4. package/es/components/default-page/index.d.ts +11 -3
  5. package/es/components/default-page/src/constants/index.d.ts +1 -0
  6. package/es/components/default-page/src/constants/index.js +1 -1
  7. package/es/components/default-page/src/index.vue.d.ts +11 -3
  8. package/es/components/default-page/src/index.vue2.js +1 -1
  9. package/es/components/default-page/style/index.css +1 -1
  10. package/es/components/expand-field/index.d.ts +1109 -321
  11. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +1109 -321
  12. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +1109 -321
  13. package/es/components/expand-field/src/components/form.vue.d.ts +1109 -321
  14. package/es/components/expand-field/src/index.vue.d.ts +1109 -321
  15. package/es/components/fabric-chart/index.d.ts +1 -0
  16. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
  17. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  19. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.d.ts +1 -0
  21. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  23. package/es/components/form-config/index.d.ts +12 -8
  24. package/es/components/form-config/src/FormConfig.vue.d.ts +12 -8
  25. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -4
  26. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -4
  27. package/es/components/form-render/index.d.ts +6 -4
  28. package/es/components/form-render/index.js +1 -1
  29. package/es/components/form-render/src/FormRender.vue.d.ts +5 -3
  30. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  31. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -4
  32. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  33. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  34. package/es/components/form-render/src/components/renderer/select.js +1 -1
  35. package/es/components/form-render/src/hooks/index.d.ts +0 -1
  36. package/es/components/form-render/src/hooks/index.js +1 -1
  37. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  38. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  39. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -0
  40. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  41. package/es/components/form-render/src/types/index.d.ts +4 -1
  42. package/es/components/iho-chat/index.d.ts +57 -27
  43. package/es/components/iho-chat/src/Index.vue.d.ts +58 -27
  44. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  45. package/es/components/iho-chat/src/api/index.js +1 -1
  46. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
  47. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +9 -26
  48. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  49. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -2
  50. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +3 -2
  51. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -1
  53. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +10 -3
  54. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  55. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  56. package/es/components/iho-chat/src/components/Video.vue.d.ts +32 -26
  57. package/es/components/iho-chat/src/components/Video.vue.js +1 -0
  58. package/es/components/iho-chat/src/components/Video.vue2.js +1 -0
  59. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  60. package/es/components/iho-chat/src/types/index.d.ts +2 -0
  61. package/es/components/iho-chat/src/utils/index.d.ts +1 -1
  62. package/es/components/iho-chat/src/utils/index.js +1 -1
  63. package/es/components/iho-chat/style/index.css +1 -1
  64. package/es/components/index.css +1 -1
  65. package/es/components/index.js +1 -1
  66. package/es/components/info-header/index.d.ts +18 -14
  67. package/es/components/info-header/src/InfoHeader.vue.d.ts +18 -14
  68. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +6 -6
  69. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +6 -6
  70. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +3 -3
  71. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +3 -3
  72. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +1 -1
  73. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +12 -10
  74. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -4
  75. package/es/components/recommend-search/index.d.ts +8 -8
  76. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  77. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  78. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  79. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  80. package/es/components/scale-view/index.d.ts +29 -1
  81. package/es/components/scale-view/src/ScaleView.vue.d.ts +29 -1
  82. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  83. package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +3 -1
  84. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  85. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +8 -0
  86. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  87. package/es/components/select-person/index.d.ts +1109 -321
  88. package/es/components/select-person/index.js +1 -1
  89. package/es/components/select-person/src/SelectPerson.vue.d.ts +4 -10
  90. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  91. package/es/components/select-person/src/SelectPersonType.vue.d.ts +314 -0
  92. package/es/components/select-person/src/SelectPersonType.vue.js +1 -0
  93. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -0
  94. package/es/components/select-person/src/components/SearchMultiple.vue.js +1 -0
  95. package/es/components/select-person/src/components/SearchOrgAndStaff.vue.js +1 -0
  96. package/es/components/select-person/src/constants/index.d.ts +2 -0
  97. package/es/components/select-person/src/constants/index.js +1 -0
  98. package/es/components/select-person/src/index.vue.d.ts +1385 -0
  99. package/es/components/select-person/src/index.vue.js +1 -0
  100. package/es/components/select-person/src/index.vue2.js +1 -0
  101. package/es/components/shortcut-setter/index.d.ts +6 -4
  102. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -4
  103. package/es/shared/hooks/useAsyncQueue/index.d.ts +3 -0
  104. package/es/shared/hooks/useAsyncQueue/index.js +1 -1
  105. package/es/shared/package.json.js +1 -1
  106. package/package.json +2 -2
  107. package/es/components/form-render/src/hooks/useAutoHidden.d.ts +0 -4
  108. package/es/components/form-render/src/hooks/useAutoHidden.js +0 -1
  109. package/es/components/select-person/src/SearchMultiple.vue.js +0 -1
  110. package/es/components/select-person/src/SearchOrgAndStaff.vue.js +0 -1
  111. /package/es/components/select-person/src/{SearchMultiple.vue.d.ts → components/SearchMultiple.vue.d.ts} +0 -0
  112. /package/es/components/select-person/src/{SearchMultiple.vue2.js → components/SearchMultiple.vue2.js} +0 -0
  113. /package/es/components/select-person/src/{SearchOrgAndStaff.vue.d.ts → components/SearchOrgAndStaff.vue.d.ts} +0 -0
  114. /package/es/components/select-person/src/{SearchOrgAndStaff.vue2.js → components/SearchOrgAndStaff.vue2.js} +0 -0
@@ -4,7 +4,7 @@ declare const _default: import("vue").DefineComponent<{}, {
4
4
  formRenderRef: import("vue").Ref<FormRenderExpose | undefined>;
5
5
  key: import("vue").Ref<number>;
6
6
  reload: () => Promise<void>;
7
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues"];
7
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
8
8
  exposed: Partial<FormRenderExpose>;
9
9
  FormRender: import("vue").DefineComponent<{
10
10
  fieldList: {
@@ -413,6 +413,10 @@ declare const _default: import("vue").DefineComponent<{}, {
413
413
  businessCollector: import("../../../components/form-render").BusinessCollector;
414
414
  formItemDepsCollector: import("../../../components/form-render").FormItemDepsCollector;
415
415
  changeContextCollector: import("../../../components/form-render").ContextCollector;
416
+ asyncQueue: import("../../../shared/hooks").AsyncQueue<import("../../../shared/hooks").FormRequestDefine.AsyncQueueItem, any, {
417
+ label: string;
418
+ value: unknown;
419
+ }[]>;
416
420
  formUUID: string;
417
421
  anchorBarRef: import("vue").Ref<{
418
422
  syncBarPosition: AnyFn;
@@ -444,13 +448,11 @@ declare const _default: import("vue").DefineComponent<{}, {
444
448
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../shared/types").AnyObject | undefined): import("../../../shared/types").AnyObject[] | Promise<import("../../../shared/types").AnyObject[]>;
445
449
  afterOptionInit(fieldKey: string, options: import("../../../shared/types").AnyObject[], payload?: import("../../../shared/types").AnyObject | undefined): void;
446
450
  }>>[T]>>;
447
- triggerAutoHidden: (field: import("@formily/core").GeneralField, includeLinebar?: boolean) => Promise<void>;
448
451
  observeFormGraph: Record<string, import("@formily/core").GeneralField>;
449
452
  setGraph: (field: import("@formily/core").GeneralField) => void;
450
453
  removeGraph: (field: import("@formily/core").GeneralField) => void;
451
454
  lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
452
455
  emitFormChange: import("vue").Ref<boolean>;
453
- isReady: boolean;
454
456
  formModel: import("@formily/core").Form<{
455
457
  [x: string]: any;
456
458
  }>;
@@ -740,7 +742,7 @@ declare const _default: import("vue").DefineComponent<{}, {
740
742
  startIncrementalRender: () => void;
741
743
  onKeydown: (event: KeyboardEvent) => Promise<void>;
742
744
  clearSpan: (uuid: string) => void;
743
- exposeEvent: Omit<FormRenderExpose, "getFieldList" | "formModel" | "reload">;
745
+ exposeEvent: Omit<FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
744
746
  useVersion: typeof import("../../../shared/hooks").useVersion;
745
747
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
746
748
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as t,openBlock as l,createBlock as a,withCtx as o,renderSlot as u,nextTick as d}from"vue";import s from"./FormRender.vue.js";var n=e({__name:"FormRenderWrapper",setup(e,{expose:n}){const i=r(),m=r(0);return n({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList","applySelectedSetting","getTextFormValues"].reduce(((e,r)=>(e[r]=(...e)=>{var t;return(null==(t=i.value)?void 0:t[r]).call(t,...e)},e)),{}),formModel:t((()=>{var e;return null==(e=i.value)?void 0:e.formModel})),reload:async function(){m.value++,await d()}}),(e,r)=>(l(),a(s,{key:m.value,ref_key:"formRenderRef",ref:i},{default:o((()=>[u(e.$slots,"default")])),_:3}))}});export{n as default};
1
+ import{defineComponent as e,ref as r,computed as t,openBlock as l,createBlock as a,withCtx as o,renderSlot as u,nextTick as d}from"vue";import n from"./FormRender.vue.js";var s=e({__name:"FormRenderWrapper",setup(e,{expose:s}){const i=r(),m=r(0);return s({...["validate","getFormValues","setFormValues","setFieldState","resetFields","queryWidget","getFieldList","applySelectedSetting","getTextFormValues","optionInited"].reduce(((e,r)=>(e[r]=(...e)=>{var t;return(null==(t=i.value)?void 0:t[r]).call(t,...e)},e)),{}),formModel:t((()=>{var e;return null==(e=i.value)?void 0:e.formModel})),reload:async function(){m.value++,await d()}}),(e,r)=>(l(),a(n,{key:m.value,ref_key:"formRenderRef",ref:i},{default:o((()=>[u(e.$slots,"default")])),_:3}))}});export{s as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m,InjectionAsyncQueue as f,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as h,createVisitedSetter as k,traverseDependKey as j}from"../../utils/schema.js";import"@formily/reactive";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as g}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const b=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const h=t(),{field:b,title:C,fieldKey:S}=g(),F=t(1),w=t(!0);const A=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(m).setContext(S.value,(()=>({labelField:A.value,valueField:H.value})));const x=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[H.value])).slice(-1).join(""),l=t.map((e=>e[A.value])).join(" / ");return a||l}catch(e){return null}}));function q(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[A.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const K=l(f);async function V(t){e.filterable?await async function(){if(!e.urlConfig||h.value&&e.requestCache)return;const t=await K.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache,payload:{field:b.value,labelKey:A.value,valueKey:H.value}});function a(e,t,o){const r=[...o,...l(e)],n={[A.value]:e[A.value],[H.value]:e[H.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),F.value=Math.max(F.value,t+1),n}function l(e){let t=[];if(p(e[A.value])&&(t=[...t,e[A.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}h.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await K.addAsync(r(s(t),i(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,q(0,0,n(t)),void(z.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&h.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&j(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[A.value]:a[A.value],[H.value]:a[H.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:h.value=l}(t),await L()}const B=`form-render__cascade--menu-${l(y)}`;async function L(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function I(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<F.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:E,injectValueWatchFromEmpty:O,injectValueBindKey:W}=v();O((()=>e.value),V),E((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(h.value=null,w.value?e.lazyRequest||(V(),w.value=!w.value):await V())}),{immediate:!0});const z=t(!1);function N(e){z.value=!!e,e&&V()}const P=a((()=>h.value||e.options||[])),R=a((()=>!e.filterable)),U=W(x);return()=>r(d,{key:U.value,remote:R.value,filterable:e.filterable,"menu-props":{class:B,onClick:L},"check-strategy":e.checkStrategy,show:!!z.value,"onUpdate:show":N,value:x.value,filter:I,"onUpdate:value":q,labelField:A.value,valueField:H.value,options:P.value,onLoad:V,onFocus:k(b)},u)}}),i({dataSource:"options"},h));export{b as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m,InjectionAsyncQueue as f,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as h,createVisitedSetter as k,traverseDependKey as j}from"../../utils/schema.js";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as g}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";const b=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const h=t(),{field:b,title:C,fieldKey:S}=g(),F=t(1),w=t(!0);const A=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(m).setContext(S.value,(()=>({labelField:A.value,valueField:H.value})));const x=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[H.value])).slice(-1).join(""),l=t.map((e=>e[A.value])).join(" / ");return a||l}catch(e){return null}}));function q(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[A.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const K=l(f);async function V(t){e.filterable?await async function(){if(!e.urlConfig||h.value&&e.requestCache)return;const t=await K.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache,payload:{field:b.value,labelKey:A.value,valueKey:H.value}});function a(e,t,o){const r=[...o,...l(e)],n={[A.value]:e[A.value],[H.value]:e[H.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),F.value=Math.max(F.value,t+1),n}function l(e){let t=[];if(p(e[A.value])&&(t=[...t,e[A.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}h.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await K.addAsync(r(s(t),i(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,q(0,0,n(t)),void(z.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&h.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&j(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[A.value]:a[A.value],[H.value]:a[H.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:h.value=l}(t),await L()}const B=`form-render__cascade--menu-${l(y)}`;async function L(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function I(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<F.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:E,injectValueWatchFromEmpty:O,injectValueBindKey:W}=v();O((()=>e.value),V),E((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(h.value=null,w.value?e.lazyRequest||(V(),w.value=!w.value):await V())}),{immediate:!0});const z=t(!1);function N(e){z.value=!!e,e&&V()}const P=a((()=>h.value||e.options||[])),R=a((()=>!e.filterable)),U=W(x);return()=>r(d,{key:U.value,remote:R.value,filterable:e.filterable,"menu-props":{class:B,onClick:L},"check-strategy":e.checkStrategy,show:!!z.value,"onUpdate:show":N,value:x.value,filter:I,"onUpdate:value":q,labelField:A.value,valueField:H.value,options:P.value,onLoad:V,onFocus:k(b)},u)}}),i({dataSource:"options"},h));export{b as SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{NSelect as i}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as p,isArray as m,isObject as d,omit as c,xor as v}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as y}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as f}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as F}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as B,assignClearBindVisited as w,createVisitedSetter as A}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const B=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:w,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,B):K(e,B),{modifyEvent:q,modifyAbleRef:E,getOptionsWithCreated:z}=y(e,{searchContent:P,labelKey:w,valueKey:x,valueRef:B,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=k(e,B),{getRecommend:U,postRecommend:D,sortedOptions:G}=R(e,N,b,w,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:p(function(e){const o=z(_.value);return m(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e)),labelField:w.value,valueField:x.value})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(B,(()=>e.lazyRequest&&X())),Y(B);const ee=$(B),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=f(e,{labelKey:w,valueKey:x,valueRef:B,showKey:V,searchContent:P}),ne=o((()=>z(E.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return B.value;const o=e.multiple&&m(B.value);return _.value.find((e=>o?B.value.includes(e[x.value]):e[x.value]===B.value))?B.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await q.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!d(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(c(n(o),["created","shouldSave"]))}))}const ce=t(F),{getSpan:ve}=g(),ye=A(J,q.focus);function fe(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.value])):[];v(t,e.value).length&&(B.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(fe),...h}),r(i,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:w.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:q.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=ve(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:B.value,valueKey:x.value,labelKey:w.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},B,w));export{x as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{NSelect as i}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as p,isArray as m,isObject as d,omit as c,xor as v}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as y}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as f}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as F}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as B,assignClearBindVisited as w,createVisitedSetter as A}from"../../utils/schema.js";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import"@formily/reactive";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const B=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:w,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,B):K(e,B),{modifyEvent:q,modifyAbleRef:E,getOptionsWithCreated:z}=y(e,{searchContent:P,labelKey:w,valueKey:x,valueRef:B,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=k(e,B),{getRecommend:U,postRecommend:D,sortedOptions:G}=R(e,N,b,w,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:p(function(e){const o=z(_.value);return m(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e)),labelField:w.value,valueField:x.value})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(B,(()=>e.lazyRequest&&X())),Y(B);const ee=$(B),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=f(e,{labelKey:w,valueKey:x,valueRef:B,showKey:V,searchContent:P}),ne=o((()=>z(E.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return B.value;const o=e.multiple&&m(B.value);return _.value.find((e=>o?B.value.includes(e[x.value]):e[x.value]===B.value))?B.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await q.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!d(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(c(n(o),["created","shouldSave"]))}))}const ce=t(F),{getSpan:ve}=g(),ye=A(J,q.focus);function fe(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.value])):[];v(t,e.value).length&&(B.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(fe),...h}),r(i,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:w.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:q.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=ve(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:B.value,valueKey:x.value,labelKey:w.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},B,w));export{x as SELECT};
@@ -1,5 +1,4 @@
1
1
  export * from './useAnchor';
2
- export * from './useAutoHidden';
3
2
  export * from './useBusinessBinding';
4
3
  export * from './useChangeContext';
5
4
  export * from './useCommonInjection';
@@ -1 +1 @@
1
- export{useAnchor}from"./useAnchor.js";export{useAutoHidden}from"./useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useCommonLog}from"./useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./useComplexOptions.js";export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFormContext}from"./useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./useFormEvent.js";export{useFormField}from"./useFormField.js";export{useFormGraph}from"./useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useFormRenderLifeCycle}from"./useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{useLowCodeEvent}from"./useLowCodeEvent.js";export{useLowCodeReactions}from"./useLowCodeReactions.js";export{useNuiThemeOverrides}from"./useNuiThemeOverrides.js";export{useOperationalForm}from"./useOperationalForm.js";export{usePresetScope}from"./usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./useWordbookSetting.js";export{useNewLowCodeReactions}from"./useNewLowCodeReactions.js";export{useSelectedSetting}from"./useSelectedSetting.js";
1
+ export{useAnchor}from"./useAnchor.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useCommonLog}from"./useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./useComplexOptions.js";export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFormContext}from"./useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./useFormEvent.js";export{useFormField}from"./useFormField.js";export{useFormGraph}from"./useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useFormRenderLifeCycle}from"./useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{useLowCodeEvent}from"./useLowCodeEvent.js";export{useLowCodeReactions}from"./useLowCodeReactions.js";export{useNuiThemeOverrides}from"./useNuiThemeOverrides.js";export{useOperationalForm}from"./useOperationalForm.js";export{usePresetScope}from"./usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./useWordbookSetting.js";export{useNewLowCodeReactions}from"./useNewLowCodeReactions.js";export{useSelectedSetting}from"./useSelectedSetting.js";
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as l}from"./useFieldNormalize.js";import{fieldKeyEscape as s,createLinebarId as a}from"../utils/schema.js";import{useFormValidator as p}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function d(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function m(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(e){return"1"===e||!0===e}function f(f,x){const{createValidatorSchema:_}=p(),h=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==x?void 0:x.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=_(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},b=e=>{var o,t,r,l,s,a,p,c,f,x,_,b,g,v;const y=h(e);e.urlConfig?m(y,e):e.autograph&&d(y,e);const w=!!e.__multiple,C=u(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=u(null!=(l=null==(r=e.componentProps)?void 0:r.selectAll)?l:e.selectAll),A=u(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=u(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(x=null==(f=e.componentProps)?void 0:f.showField)?x:e.show_key,k=null!=(b=null==(_=e.componentProps)?void 0:_.options)?b:e.option,N=null!=(v=i(e.multi_select_value))?v:null==(g=e.componentProps)?void 0:g.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,...n(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},g=e=>{var o,t;const n=h(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?m(n,e):e.autograph&&d(n,e),n},v=e=>{const t=h(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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:a(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),w=new Map([["LINEBAR",y],["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=h(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=h(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=h(e),{decimal_length:t,validate:n,allowSlash:r}=e;return!0!==r&&"1"!==r||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:i(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",b],["REMOTE_SEARCH",b],["DATE",e=>{const o=h(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=h(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{...n(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=h(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=h(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",g],["CHECKBOX",g],["SWITCH",e=>{const o=h(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=h(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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"],n(e,["wrapperStyle","display"])),o}]]),C=e=>{if(e.suffixConfig)return O(e);return(w.get(e.html_type)||v)(e)},O=o=>{if(!o.suffixConfig&&!o.prefixConfig)return C(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=h(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:s(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:A,FieldListNormalizeWaterfallHook:E}=l();function j(o,n={column:9999}){let i=null;return E.call(t(o),n).reduce(((e,o,s)=>{var a;const p=null==(a=(o=A.call(o,n)).validate)?void 0:a.obj_type;return p&&f&&f.collect(p,t(o)),"LINEBAR"===o.html_type?(e[l(o)]=r(y(o),s),i=e[l(o)].properties={}):i?i[l(o)]=r(C(o),s):(i=null,e[l(o)]=r(C(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function l(o){return o.suffixConfig?s([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{f 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{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as c}from"./useFormValidator.js";import{transformDateFormat as d}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function u(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function x(x,_){const{createValidatorSchema:h}=c(),b=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=h(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,x,_,h,v,g;const y=b(e);e.urlConfig?u(y,e):e.autograph&&m(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!=(x=null==(d=e.componentProps)?void 0:d.showField)?x: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==(v=e.componentProps)?void 0:v.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},g=e=>{var o,t;const n=b(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?u(n,e):e.autograph&&m(n,e),n},y=e=>{const t=b(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},w=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:p(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),C=new Map([["LINEBAR",w],["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=b(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=b(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=b(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=b(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:d(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=b(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:d(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=b(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=b(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=b(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",g],["CHECKBOX",g],["SWITCH",e=>{const o=b(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=b(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=b(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?k(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}]]),O=e=>{if(e.suffixConfig)return A(e);return(C.get(e.html_type)||y)(e)},A=o=>{if(!o.suffixConfig&&!o.prefixConfig)return O(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=b(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:k(n)}),i},{FieldNormalizeWaterfallHook:E,FieldListNormalizeWaterfallHook:j}=s();function k(o,i={column:9999}){let r=null;const l=j.call(t(o),i).reduce(((e,o,n)=>{var l;const a=null==(l=(o=E.call(o,i)).validate)?void 0:l.obj_type;return a&&x&&x.collect(a,t(o)),"LINEBAR"===o.html_type?(e[p(o)]=s(w(o),n),r=e[p(o)].properties={}):r?r[p(o)]=s(O(o),n):(r=null,e[p(o)]=s(O(o),n)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{if("LINEBAR"!==e["x-component"])return;e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const o=Object.keys(e.properties||{}).map((o=>`${e.name}.${o}#selfDisplay`));e["x-reactions"].push({dependencies:o,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function p(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:k}}export{x as useFieldListAdaptor};
@@ -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'>;
16
+ }): Omit<FormRenderExpose, 'formModel' | 'reload' | 'getFieldList' | 'optionInited'>;
17
17
  export declare function useFormDomEvent({ props, formRenderRef, formModel, formUUID }: {
18
18
  props: FormRenderProps;
19
19
  formRenderRef: Ref<HTMLElement | undefined>;
@@ -3,4 +3,5 @@ export declare function usePresetScope(): {
3
3
  isMobile(value: unknown): boolean;
4
4
  isEmail(value: unknown): boolean;
5
5
  isNumber(value: unknown): boolean;
6
+ hasVisible(visibleStates: string[]): boolean;
6
7
  };
@@ -1 +1 @@
1
- import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as o,isMobile as r}from"../utils/business.js";function s(){return{isIdCard:r=>i(r)&&o(r),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o)}}export{s as usePresetScope};
1
+ import{isString as i,isEmpty as o}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as s,isMobile as r}from"../utils/business.js";function e(){return{isIdCard:o=>i(o)&&s(o),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o),hasVisible:i=>!o(i)&&i.some((i=>!i||"visible"===i))}}export{e as usePresetScope};
@@ -97,9 +97,12 @@ export type FormRenderExpose = {
97
97
  /**
98
98
  * @desc 完全重置表单
99
99
  */
100
- reload(): Promise<any>;
100
+ reload(): Promise<void>;
101
101
  applySelectedSetting(settings: LowCodeTypes.selectedSettingConfig[]): void;
102
102
  getTextFormValues(): AnyObject;
103
+ optionInited(options?: Partial<{
104
+ timeout: number;
105
+ }>): Promise<void>;
103
106
  };
104
107
  export type FormChangeContext = Partial<{
105
108
  currentOption: AnyObject;
@@ -42,7 +42,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
42
42
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
43
43
  loading: import("vue").Ref<boolean>;
44
44
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
45
- showAv: import("vue").Ref<boolean>;
46
45
  state: {
47
46
  orgId: string | number;
48
47
  currentSessionItem: import("../../shared/types").AnyObject;
@@ -56,6 +55,8 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
56
55
  updateSessionItem: import("../../shared/types").AnyObject;
57
56
  isUpdateSession: boolean;
58
57
  currentReferenceMsg: import("../../shared/types").AnyObject | null;
58
+ showVideo: boolean;
59
+ currentAVMsg: import("../../shared/types").AnyObject;
59
60
  };
60
61
  reConnention: number;
61
62
  openSession: (item: import("../../shared/types").AnyObject) => Promise<void>;
@@ -268,7 +269,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
268
269
  fileRef: import("vue").Ref<any>;
269
270
  keyword: import("vue").Ref<any>;
270
271
  handleInput: () => void;
271
- currentInfo: {
272
+ pageInfo: {
272
273
  page: number;
273
274
  hasMore: boolean;
274
275
  lastSendTime: string;
@@ -325,7 +326,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
325
326
  startTime: import("vue").Ref<any>;
326
327
  endTime: import("vue").Ref<any>;
327
328
  handleInput: () => void;
328
- currentInfo: {
329
+ pageInfo: {
329
330
  page: number;
330
331
  hasMore: boolean;
331
332
  lastSendTime: string;
@@ -443,7 +444,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
443
444
  setMsgList: (list?: import("../../shared/types").AnyObject[]) => void;
444
445
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
445
446
  showMenu: import("vue").Ref<boolean>;
446
- currentInfo: {
447
+ pageInfo: {
447
448
  page: number;
448
449
  hasMore: boolean;
449
450
  lastSendTime: string;
@@ -619,30 +620,18 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
619
620
  formatTime: typeof import("./src/utils").formatTime;
620
621
  downloadFile: typeof import("./src/utils").downloadFile;
621
622
  simplifyMessage: typeof import("./src/utils").simplifyMessage;
623
+ isAudioOrVideoMessage: typeof import("./src/utils").isAudioOrVideoMessage;
622
624
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
623
625
  ChatbubbleEllipsesOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
624
626
  EllipsisHorizontal: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
625
627
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
626
- ChatFooter: import("vue").DefineComponent<{
627
- showAv: {
628
- type: BooleanConstructor;
629
- default: boolean;
630
- };
631
- }, {
632
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
633
- showAv: {
634
- type: BooleanConstructor;
635
- default: boolean;
636
- };
637
- }>> & {}>>;
628
+ ChatFooter: import("vue").DefineComponent<{}, {
638
629
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
639
630
  content: import("vue").Ref<string>;
640
631
  state: import("./src/types").IState;
641
632
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock>;
642
633
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
643
634
  showEmoji: import("vue").Ref<boolean>;
644
- showVideo: import("vue").Ref<boolean>;
645
- callMode: import("vue").Ref<string>;
646
635
  handleCall: (chatMessageType: string) => void;
647
636
  handleKeyDown: (event: KeyboardEvent) => void;
648
637
  isWrap: (event: KeyboardEvent) => boolean;
@@ -666,25 +655,26 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
666
655
  };
667
656
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
668
657
  CloseCircleOutline: 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<{}>>, {}>;
658
+ CallOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
659
+ VideocamOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
669
660
  simplifyMessage: typeof import("./src/utils").simplifyMessage;
670
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
671
- showAv: {
672
- type: BooleanConstructor;
673
- default: boolean;
674
- };
675
- }>>, {
676
- showAv: boolean;
677
- }>;
661
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
678
662
  ChatSearch: import("vue").DefineComponent<{}, {
679
663
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
664
+ listRef: import("vue").Ref<any>;
680
665
  inputRef: import("vue").Ref<any>;
681
666
  showSearch: import("vue").Ref<boolean>;
682
667
  keyword: import("vue").Ref<any>;
683
668
  userList: import("vue").Ref<any>;
684
669
  state: import("./src/types").IState;
685
670
  openSession: (item: import("../../shared/types").AnyObject) => Promise<void>;
686
- handleInput: () => Promise<void>;
671
+ pageInfo: {
672
+ page: number;
673
+ hasMore: boolean;
674
+ };
675
+ handleInput: () => void;
687
676
  handleSearch: () => Promise<void>;
677
+ resetAndSearch: () => void;
688
678
  addSession: (userId: string) => Promise<void>;
689
679
  NPopover: any;
690
680
  NButton: any;
@@ -693,6 +683,46 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
693
683
  NIcon: any;
694
684
  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<{}>>, {}>;
695
685
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
686
+ Video: import("vue").DefineComponent<{}, {
687
+ time: {
688
+ timer: any;
689
+ seconds: number;
690
+ };
691
+ state: import("./src/types").IState;
692
+ videoRef: import("vue").Ref<any>;
693
+ selfVideoRef: import("vue").Ref<any>;
694
+ tipContent: import("vue").Ref<any>;
695
+ isConnect: import("vue").Ref<boolean>;
696
+ voiceOpen: import("vue").Ref<boolean>;
697
+ messageType: import("vue").ComputedRef<any>;
698
+ callMode: import("vue").ComputedRef<any>;
699
+ info: import("vue").ComputedRef<{
700
+ sessionKey: any;
701
+ avatar: any;
702
+ name: any;
703
+ userId: any;
704
+ }>;
705
+ trtc: import("trtc-sdk-v5").default;
706
+ handleEnter: () => Promise<void>;
707
+ handleExit: () => Promise<void>;
708
+ installEventHandlers: () => void;
709
+ uninstallEventHandlers: () => void;
710
+ handleRemoteVideoAvailable: (event: any) => Promise<void>;
711
+ handleRemoteAudioAvailable: (event: any) => void;
712
+ handleRemoteUserEnter: () => void;
713
+ handleRemoteUserExit: (event: any) => void;
714
+ startTimer: () => void;
715
+ resetTimer: () => void;
716
+ formatSeconds: (seconds: number) => string;
717
+ toggleAudio: () => Promise<void>;
718
+ NButton: any;
719
+ NAvatar: any;
720
+ NIcon: any;
721
+ Call: 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<{}>>, {}>;
722
+ MicOffCircle: 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<{}>>, {}>;
723
+ Mic: 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<{}>>, {}>;
724
+ MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
725
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
696
726
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
697
727
  token: {
698
728
  type: StringConstructor;
@@ -3,6 +3,7 @@ import { ChatSock } from './utils/chatSock';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  import { MESSAGE_TYPE } from './constants';
5
5
  import { IState } from './types';
6
+ import { isAudioOrVideoMessage } from './utils';
6
7
  declare const _default: import("vue").DefineComponent<{
7
8
  token: {
8
9
  type: StringConstructor;
@@ -46,7 +47,6 @@ declare const _default: import("vue").DefineComponent<{
46
47
  cssVars: import("vue").ComputedRef<AnyObject>;
47
48
  loading: import("vue").Ref<boolean>;
48
49
  stompClient: import("vue").Ref<ChatSock | undefined>;
49
- showAv: import("vue").Ref<boolean>;
50
50
  state: {
51
51
  orgId: string | number;
52
52
  currentSessionItem: AnyObject;
@@ -60,6 +60,8 @@ declare const _default: import("vue").DefineComponent<{
60
60
  updateSessionItem: AnyObject;
61
61
  isUpdateSession: boolean;
62
62
  currentReferenceMsg: AnyObject | null;
63
+ showVideo: boolean;
64
+ currentAVMsg: AnyObject;
63
65
  };
64
66
  reConnention: number;
65
67
  openSession: (item: AnyObject) => Promise<void>;
@@ -272,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{
272
274
  fileRef: import("vue").Ref<any>;
273
275
  keyword: import("vue").Ref<any>;
274
276
  handleInput: () => void;
275
- currentInfo: {
277
+ pageInfo: {
276
278
  page: number;
277
279
  hasMore: boolean;
278
280
  lastSendTime: string;
@@ -329,7 +331,7 @@ declare const _default: import("vue").DefineComponent<{
329
331
  startTime: import("vue").Ref<any>;
330
332
  endTime: import("vue").Ref<any>;
331
333
  handleInput: () => void;
332
- currentInfo: {
334
+ pageInfo: {
333
335
  page: number;
334
336
  hasMore: boolean;
335
337
  lastSendTime: string;
@@ -447,7 +449,7 @@ declare const _default: import("vue").DefineComponent<{
447
449
  setMsgList: (list?: AnyObject[]) => void;
448
450
  setCurrentSessionItem: (item: AnyObject) => void;
449
451
  showMenu: import("vue").Ref<boolean>;
450
- currentInfo: {
452
+ pageInfo: {
451
453
  page: number;
452
454
  hasMore: boolean;
453
455
  lastSendTime: string;
@@ -623,30 +625,18 @@ declare const _default: import("vue").DefineComponent<{
623
625
  formatTime: typeof import("./utils").formatTime;
624
626
  downloadFile: typeof import("./utils").downloadFile;
625
627
  simplifyMessage: typeof import("./utils").simplifyMessage;
628
+ isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
626
629
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
627
630
  ChatbubbleEllipsesOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
628
631
  EllipsisHorizontal: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
629
632
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
630
- ChatFooter: import("vue").DefineComponent<{
631
- showAv: {
632
- type: BooleanConstructor;
633
- default: boolean;
634
- };
635
- }, {
636
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
637
- showAv: {
638
- type: BooleanConstructor;
639
- default: boolean;
640
- };
641
- }>> & {}>>;
633
+ ChatFooter: import("vue").DefineComponent<{}, {
642
634
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
643
635
  content: import("vue").Ref<string>;
644
636
  state: IState;
645
637
  stompClient: import("vue").Ref<ChatSock>;
646
638
  setCurrentSessionItem: (item: AnyObject) => void;
647
639
  showEmoji: import("vue").Ref<boolean>;
648
- showVideo: import("vue").Ref<boolean>;
649
- callMode: import("vue").Ref<string>;
650
640
  handleCall: (chatMessageType: string) => void;
651
641
  handleKeyDown: (event: KeyboardEvent) => void;
652
642
  isWrap: (event: KeyboardEvent) => boolean;
@@ -670,25 +660,26 @@ declare const _default: import("vue").DefineComponent<{
670
660
  };
671
661
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
672
662
  CloseCircleOutline: 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<{}>>, {}>;
663
+ CallOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
664
+ VideocamOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
673
665
  simplifyMessage: typeof import("./utils").simplifyMessage;
674
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
675
- showAv: {
676
- type: BooleanConstructor;
677
- default: boolean;
678
- };
679
- }>>, {
680
- showAv: boolean;
681
- }>;
666
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
682
667
  ChatSearch: import("vue").DefineComponent<{}, {
683
668
  cssVars: import("vue").ComputedRef<AnyObject>;
669
+ listRef: import("vue").Ref<any>;
684
670
  inputRef: import("vue").Ref<any>;
685
671
  showSearch: import("vue").Ref<boolean>;
686
672
  keyword: import("vue").Ref<any>;
687
673
  userList: import("vue").Ref<any>;
688
674
  state: IState;
689
675
  openSession: (item: AnyObject) => Promise<void>;
690
- handleInput: () => Promise<void>;
676
+ pageInfo: {
677
+ page: number;
678
+ hasMore: boolean;
679
+ };
680
+ handleInput: () => void;
691
681
  handleSearch: () => Promise<void>;
682
+ resetAndSearch: () => void;
692
683
  addSession: (userId: string) => Promise<void>;
693
684
  NPopover: any;
694
685
  NButton: any;
@@ -697,6 +688,46 @@ declare const _default: import("vue").DefineComponent<{
697
688
  NIcon: any;
698
689
  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<{}>>, {}>;
699
690
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
691
+ Video: import("vue").DefineComponent<{}, {
692
+ time: {
693
+ timer: any;
694
+ seconds: number;
695
+ };
696
+ state: IState;
697
+ videoRef: import("vue").Ref<any>;
698
+ selfVideoRef: import("vue").Ref<any>;
699
+ tipContent: import("vue").Ref<any>;
700
+ isConnect: import("vue").Ref<boolean>;
701
+ voiceOpen: import("vue").Ref<boolean>;
702
+ messageType: import("vue").ComputedRef<any>;
703
+ callMode: import("vue").ComputedRef<any>;
704
+ info: import("vue").ComputedRef<{
705
+ sessionKey: any;
706
+ avatar: any;
707
+ name: any;
708
+ userId: any;
709
+ }>;
710
+ trtc: import("trtc-sdk-v5").default;
711
+ handleEnter: () => Promise<void>;
712
+ handleExit: () => Promise<void>;
713
+ installEventHandlers: () => void;
714
+ uninstallEventHandlers: () => void;
715
+ handleRemoteVideoAvailable: (event: any) => Promise<void>;
716
+ handleRemoteAudioAvailable: (event: any) => void;
717
+ handleRemoteUserEnter: () => void;
718
+ handleRemoteUserExit: (event: any) => void;
719
+ startTimer: () => void;
720
+ resetTimer: () => void;
721
+ formatSeconds: (seconds: number) => string;
722
+ toggleAudio: () => Promise<void>;
723
+ NButton: any;
724
+ NAvatar: any;
725
+ NIcon: any;
726
+ Call: 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<{}>>, {}>;
727
+ MicOffCircle: 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<{}>>, {}>;
728
+ Mic: 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<{}>>, {}>;
729
+ MESSAGE_TYPE: typeof MESSAGE_TYPE;
730
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
700
731
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
701
732
  token: {
702
733
  type: StringConstructor;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as u,withCtx as d,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as v,NLayout as S,NLayoutContent as g}from"naive-ui";import b from"./components/SiderList.vue.js";import I from"./components/ChatHeader.vue.js";import y from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import j from"./components/ChatSearch.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as C,readMessageApi as L}from"./api/index.js";import{useTheme as N}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as x}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as M}from"./constants/index.js";import{InjectionIChatState as U,InjectionIChatStompClient as T,InjectionIChatEmits as w}from"./types/index.js";import{isAudioOrVideo as A}from"./utils/index.js";import{useSession as E}from"./hooks/useSession.js";const O={class:"iho-chat__header"},R={class:"toolbar"};var V=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"}},emits:["template-click","unread-message-update"],setup(e,{expose:V,emit:q}){const J=e;C.defaults.baseURL=J.baseURL,C.defaults.headers.Authorization="bearer "+J.token;const F=N(),G=s(!1),H=s(),$=s(!1),z=o({orgId:J.orgId,currentSessionItem:{},id:"",userInfo:{id:J.userId,sdkAppId:1600034888},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null});t(U,z),t(T,H),t(w,q);const{openSession:D,closeSession:W,getCurrentSession:B,setSessionList:K,setUpdateSessionItem:P}=E(z);function Q(){const e={headers:{AccessToken:J.token,UserId:J.userId},heartbeatFn(){try{H.value.send("test")}catch(e){H.value.disconnect(),Q()}},connectCb(){console.log("连接成功"),H.value.subscribe("/user/topic/single",(async({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:o,sessionVo:t}=s;switch(s.event){case M.MESSAGE:{if(s.messageVo.sender===z.userInfo.id)return;const e={receiver:o.sender,lastMessageSendTime:o.sendTime,sortTime:o.sendTime,lastMessage:o.content};o.sender===z.currentSessionItem.receiver&&(z.currentMsg=o,A(o.content)||(z.isAppendMsg=!0,await L({chatType:"SINGLE",messageIdSet:o.id,receiver:z.userInfo.id,sender:o.sender})),e.unreadNum=0),P(e),A(o.content)&&($.value=!0);break}case M.NEW_SESSION:P(t)}}catch(e){console.log(e)}})),H.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:o,sessionVos:t}=s;if(console.log("body",s),Object.assign(z.userInfo,o),!(null==t?void 0:t.length))return;K(t)}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};H.value=new _("/fdp-chat/websocket",e)}return async function(){Q()}(),r((()=>{var e;null==(e=H.value)||e.disconnect()})),V({getUnreadData:function(){return z.sessionList.filter((e=>x(e.unreadNum)&&e.unreadNum>0))},openSession:D,closeSession:W,getCurrentSession:B}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(F))},[u(c(f),{abstract:"",namespace:"iho-chat__popover"},{default:d((()=>[G.value?(n(),m(c(v),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",O,[u(j),l("div",R,[h(e.$slots,"toolbar")])]),u(c(S),{class:"iho-chat__body","has-sider":""},{default:d((()=>[u(b),u(c(g),{class:"chat-content"},{default:d((()=>[u(I),u(y),u(k,{"show-av":$.value},null,8,["show-av"])])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{V as default};
1
+ import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as g,NLayout as v,NLayoutContent as S}from"naive-ui";import b from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import k from"./components/ChatSearch.vue.js";import M from"./components/Video.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as N,readMessageApi as C}from"./api/index.js";import{useTheme as L}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as V}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as x}from"./constants/index.js";import{InjectionIChatState as A,InjectionIChatStompClient as T,InjectionIChatEmits as U}from"./types/index.js";import{isAudioOrVideoMessage as w}from"./utils/index.js";import{useSession as E}from"./hooks/useSession.js";const O={class:"iho-chat__header"},R={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"}},emits:["template-click","unread-message-update"],setup(e,{expose:q,emit:J}){const F=e;N.defaults.baseURL=F.baseURL,N.defaults.headers.Authorization="bearer "+F.token;const G=L(),H=s(!1),K=s(),$=o({orgId:F.orgId,currentSessionItem:{},id:"",userInfo:{id:F.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{}});t(A,$),t(T,K),t(U,J);const{openSession:z,closeSession:D,getCurrentSession:W,setSessionList:B,setUpdateSessionItem:P}=E($);function Q(){const e={headers:{AccessToken:F.token,UserId:F.userId},heartbeatFn(){try{K.value.send("test")}catch(e){K.value.disconnect(),Q()}},connectCb(){console.log("连接成功"),K.value.subscribe("/user/topic/single",(async({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:o,sessionVo:t}=s;switch(s.event){case x.MESSAGE:{if(s.messageVo.sender===$.userInfo.id)return;const e={receiver:o.sender,lastMessageSendTime:o.sendTime,sortTime:o.sendTime,lastMessage:o.content,avatar:o.senderAvatar,name:o.senderName,sessionKey:o.sessionKey};o.sender===$.currentSessionItem.receiver&&($.currentMsg=o,w(o.content)||($.isAppendMsg=!0,await C({chatType:"SINGLE",messageIdSet:[o.id],receiver:$.userInfo.id,sender:o.sender})),e.unreadNum=0),P(e),w(o.content)&&($.currentAVMsg.messageType=o.content.chatMessageType,$.currentAVMsg.callMode="invite",$.showVideo=!0);break}case x.NEW_SESSION:P(t)}}catch(e){console.log(e)}})),K.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:r}=s;if(console.log("body",s),Object.assign($.userInfo,t,o),!(null==r?void 0:r.length))return;B(r)}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};K.value=new _("/fdp-chat/websocket",e)}return async function(){Q()}(),r((()=>{var e;null==(e=K.value)||e.disconnect()})),q({getUnreadData:function(){return $.sessionList.filter((e=>V(e.unreadNum)&&e.unreadNum>0))},openSession:z,closeSession:D,getCurrentSession:W}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(G))},[d(c(f),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[H.value?(n(),m(c(g),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",O,[d(k),l("div",R,[h(e.$slots,"toolbar")])]),d(c(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[d(b),d(c(S),{class:"chat-content"},{default:u((()=>[d(y),d(I),d(j)])),_:1}),h(e.$slots,"external")])),_:3}),d(M)],64))])),_:3})],4))}});export{q as default};
@@ -1 +1 @@
1
- import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/toppingSession",data:e(t)})}function u(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function s(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function c(t){return o({method:"post",url:"/chat/readMessage",data:t})}function i(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,s as listUserApi,n as openSessionApi,c as readMessageApi,i as searchChatRecordApi,a as toppingSessionApi,u as uploadFileApi};
1
+ import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/toppingSession",data:e(t)})}function s(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function u(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function i(t){return o({method:"post",url:"/chat/readMessage",data:t})}function c(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,u as listUserApi,n as openSessionApi,i as readMessageApi,c as searchChatRecordApi,a as toppingSessionApi,s as uploadFileApi};