cnhis-design-vue 3.2.14-beta.19 → 3.2.14-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/components/big-table/src/components/input-button.vue2.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/utils/constant.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/form-config/index.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/iho-chat/index.d.ts +55 -2
- package/es/components/iho-chat/src/Index.vue.d.ts +55 -2
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +11 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +45 -0
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/template-render/src/components/index.d.ts +23 -23
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CSSProperties } from 'vue';
|
1
2
|
import { AnyObject } from '../../../../shared/types';
|
2
3
|
import { formatTime } from '../utils';
|
3
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
@@ -14,6 +15,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
14
15
|
label: string;
|
15
16
|
key: string;
|
16
17
|
}[]>;
|
18
|
+
contextmenuRef: import("vue").Ref<any>;
|
19
|
+
showMenu: import("vue").Ref<boolean>;
|
20
|
+
menuPosition: any;
|
21
|
+
sessionId: import("vue").Ref<any>;
|
17
22
|
currentFilterKey: import("vue").Ref<string>;
|
18
23
|
state: {
|
19
24
|
orgId: string | number;
|
@@ -36,16 +41,56 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
36
41
|
};
|
37
42
|
unreadTotal: import("vue").ComputedRef<number>;
|
38
43
|
openSession: (item: AnyObject) => Promise<void>;
|
44
|
+
setUpdateSessionItem: (item: AnyObject) => void;
|
39
45
|
currentWidth: import("vue").ComputedRef<number>;
|
40
46
|
sessionList: import("vue").ComputedRef<AnyObject[]>;
|
41
47
|
getLabelNum: (session: AnyObject) => number;
|
42
48
|
changeWidth: ({ distance }: AnyObject) => void;
|
43
49
|
handleFilter: (key: string) => void;
|
44
50
|
showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
|
51
|
+
handleContextmenu: (event: MouseEvent, id: string) => Promise<void>;
|
52
|
+
handleSelect: (key: string, session: AnyObject) => Promise<void>;
|
45
53
|
NSpin: any;
|
46
54
|
NBadge: any;
|
47
55
|
NAvatar: any;
|
48
56
|
NTag: any;
|
57
|
+
ContextMenu: import("vue").DefineComponent<{
|
58
|
+
type: {
|
59
|
+
type: StringConstructor;
|
60
|
+
default: string;
|
61
|
+
};
|
62
|
+
show: {
|
63
|
+
type: BooleanConstructor;
|
64
|
+
default: boolean;
|
65
|
+
};
|
66
|
+
position: {
|
67
|
+
type: import("vue").PropType<CSSProperties>;
|
68
|
+
};
|
69
|
+
id: {
|
70
|
+
type: StringConstructor;
|
71
|
+
};
|
72
|
+
}, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
73
|
+
type: {
|
74
|
+
type: StringConstructor;
|
75
|
+
default: string;
|
76
|
+
};
|
77
|
+
show: {
|
78
|
+
type: BooleanConstructor;
|
79
|
+
default: boolean;
|
80
|
+
};
|
81
|
+
position: {
|
82
|
+
type: import("vue").PropType<CSSProperties>;
|
83
|
+
};
|
84
|
+
id: {
|
85
|
+
type: StringConstructor;
|
86
|
+
};
|
87
|
+
}>> & {
|
88
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
89
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
90
|
+
}, {
|
91
|
+
type: string;
|
92
|
+
show: boolean;
|
93
|
+
}>;
|
49
94
|
vFlexibleResize: {
|
50
95
|
mounted(el: any, { value }: any): void;
|
51
96
|
beforeUnmount(el: any): void;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as t,computed as l,withDirectives as i,openBlock as n,createElementBlock as o,normalizeStyle as a,unref as s,createBlock as u,createCommentVNode as d,createElementVNode as r,Fragment as v,renderList as p,withCtx as c,createTextVNode as m,toDisplayString as g,withModifiers as f,normalizeClass as y,createVNode as w,vShow as k,nextTick as h}from"vue";import{NSpin as x,NTag as _,NAvatar as C,NBadge as b}from"naive-ui";import M from"./ContextMenu.js";import{useData as j}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as L}from"../constants/index.js";import{toppingSessionApi as B}from"../api/index.js";import{listSort as N,formatTime as R}from"../utils/index.js";import"trtc-sdk-v5";import{vFlexibleResize as S}from"../../../../shared/directive/flexibleResize.js";const T={class:"sider-list__filter box-shadow"},D=["onClick","onContextmenu"],E={class:"avatar-right"},H={class:"name"},z={class:"msg-tip"},I={class:"msg-tip__content"},K={key:0},U=["innerHTML"];var W=e({__name:"SiderList",setup(e){var W,A,V;const X="all",Y="unread",$="ended";let q=[];const F=t(300),G=t(),J=t(!1),O=t([{label:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.123"))||"全部",key:X},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.124"))||"未读",key:Y},{label:(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.77"))||"结束",key:$}]),P=t(),Q=t(!1),Z=t({left:0,top:0}),ee=t(),te=t("all"),{state:le,unreadTotal:ie,openSession:ne,setUpdateSessionItem:oe}=j(),ae=l((()=>Math.min(Math.max(F.value,240),360))),se=l((()=>N(le.sessionList)));function ue({distance:e}){F.value=F.value+e}function de(e,t=s(te)){var l;return t===X||(t===Y?q.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:t===$?e.status===L.ENDED:void 0)}async function re(e,t){if("topping"!==e);else try{await B({id:t.id,topping:!(null==t?void 0:t.topping)}),oe({...t,topping:!(null==t?void 0:t.topping)})}catch(e){}}return(e,t)=>i((n(),o("section",{class:"sider-list",style:a({width:s(ae)+"px"})},[J.value?(n(),u(s(x),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),r("div",T,[(n(!0),o(v,null,p(O.value,(e=>(n(),u(s(_),{type:te.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,te.value=t,void(t===Y&&(q=(se.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:c((()=>{return[m(g(e.label)+"("+g((t=e,t.key===$?se.value.filter((e=>e.status===L.ENDED)).length:ie.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),r("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:G},[(n(!0),o(v,null,p(s(se),(e=>{var t;return i((n(),o("div",{key:e.id,onClick:()=>s(ne)(e),onContextmenu:f((t=>async function(e,t){var l,i,n,o,a;ee.value=t,Q.value=!0,await h();const{clientX:s,clientY:u}=e,{width:d=0,height:r=0,left:v=0,top:p=0}=(null==(l=G.value)?void 0:l.getBoundingClientRect())||{},{width:c=100,height:m=80}=(null==(n=null==(i=P.value)?void 0:i.$el)?void 0:n.getBoundingClientRect())||{},g=null!=(a=null==(o=G.value)?void 0:o.scrollTop)?a:0,f={};s<v+d-(c+2)-5?f.left=s-v+5+"px":f.right=v+d-s+5+"px",p+r-u<=m+5?f.bottom=5-g+"px":f.top=u-p+g+5+"px",Z.value=f}(t,e.id)),["prevent"]),class:y(["sider-list__box__item",{active:e.id===s(le).id},e.topping?"sider-list__box__item--top":""])},[w(s(C),{round:"",size:"large",src:e.avatar},null,8,["src"]),r("div",E,[r("div",H,[r("h4",null,g(e.name),1),r("span",null,g(e.lastMessage?s(R)(e.lastMessageSendTime).siderMsgTime:""),1)]),r("div",z,[r("div",I,["WITHDRAWN"===e.lastMessageStatus?(n(),o("div",K,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(n(),o("div",{key:1,innerHTML:e.lastMessageContent},null,8,U))]),w(s(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,D)),[[k,de(e)]])})),128)),w(s(M),{ref_key:"contextmenuRef",ref:P,show:Q.value,"onUpdate:show":t[0]||(t[0]=e=>Q.value=e),type:"session",position:Z.value,id:ee.value,onSelect:re},null,8,["show","position","id"])],512)],4)),[[s(S),{mode:"VR",onMove:ue}]])}});export{W as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as a,openBlock as r,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as I,MicOffCircle as y,Call as A}from"@vicons/ionicons5";import{avFinishApi as k}from"../api/index.js";import"@vueuse/core";import"../utils/index.js";import"lodash-es";import{AV_STATUS as E,CHAT_TYPE as V}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as R}from"../hooks/useVideo.js";import S from"trtc-sdk-v5";var C,M,b,L;const T={class:"video-wrapper"},j={class:"user"},x={class:"name"},_={class:"tip"},N={class:"opt-btn"},H={class:"btn"},D=e("span",null,(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.104"))||"静音",-1),z=e("span",null,(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.113"))||"拒接",-1),B={class:"btn"},U=e("span",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.125"))||"挂断",-1),F=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.114"))||"接听",-1);var O=o({__name:"Video",setup(o){const{sendMessage:C,state:M,trtc:b,timing:L,voiceOpen:O,isAudio:G,isCall:J,startTimer:P,resetTimer:$,toggleAudio:q,messageTypeText:K,time:Q,installEventHandlers:W,uninstallEventHandlers:X}=R(),Y=n(),Z=n(),ee=n(!1);let oe=null;const ne=s((()=>{var e,o,n;return J.value?{avatar:M.currentSessionItem.avatar,name:M.currentSessionItem.name,userId:M.currentSessionItem.receiver}:{avatar:null==(e=M.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=M.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=M.currentAVMsg.currentMsg)?void 0:n.sender}})),se=s((()=>ee.value?G.value?L.value:"":J.value?"正在呼叫...":`邀请你${K.value}问诊...`)),te=s((()=>{var e,o;return null==(o=null==(e=M.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function ae(e=E.FINISHED){C({chatType:V.SINGLE,content:{msg:e===E.FINISHED?""+Q.seconds:"s",chatMessageType:M.currentAVMsg.chatMessageType,avStatus:e},receiver:ne.value.userId}),await k({recordId:M.currentAVMsg.currentMsg.id,status:e,duration:e===E.FINISHED?Q.seconds:0})}async function re(){const e=await S.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(M.showVideo=!1);try{if(await b.enterRoom({strRoomId:M.currentAVMsg.strRoomId,sdkAppId:parseInt(M.userInfo.sdkAppID),userId:M.userInfo.id,userSig:M.userInfo.userSig}),J.value||(ee.value=!0,P()),W({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await b.startLocalAudio(),G.value)return;await b.startLocalVideo({view:Z.value})}catch(e){console.log("error :>> ",e),M.showVideo=!1}}function le(){J.value&&!ee.value?ae(E.CANCELED):ae()}async function ie(){try{if(M.showVideo=!1,X({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await b.exitRoom(),await b.stopLocalAudio(),G.value)return;await b.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ce(e){const{userId:o,streamType:n}=e;try{await b.startRemoteVideo({userId:o,streamType:n,view:Y.value})}catch(e){console.log("error :>> ",e)}}function ue(e){}function de(){ee.value=!0,P()}function ve(e){console.log("event :>> 对方已挂断",e),ie()}function me(e){console.log("error :>> ",e),M.showVideo=!1}return t((()=>te.value),(e=>{M.showVideo&&(e===E.IN_CALL?async function(){J.value?re():(oe&&clearTimeout(oe),oe=setTimeout((async()=>{ee.value||ae(E.NO_RESPONSE)}),6e4))}():ie())}),{immediate:!0}),a((()=>{ie()})),(o,n)=>(r(),l("div",T,[i(e("div",{class:"video-box",ref_key:"videoRef",ref:Y},null,512),[[c,ee.value]]),i(e("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:Z},null,512),[[c,ee.value]]),i(e("div",j,[u(d(f),{size:58,round:"",src:d(ne).avatar},null,8,["src"]),e("span",x,v(d(ne).name),1),e("span",_,v(d(se)),1)],512),[[c,d(G)||!ee.value]]),e("div",N,[e("div",H,[d(J)&&!ee.value||ee.value?(r(),l(m,{key:0},[u(d(w),{circle:"",onClick:d(q),class:p({bordered:d(O)})},{icon:g((()=>[u(d(h),{size:"30",color:d(O)?"#fff":"#626262",component:d(O)?d(I):d(y)},null,8,["color","component"])])),_:1},8,["onClick","class"]),D],64)):(r(),l(m,{key:1},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:n[0]||(n[0]=()=>ae(d(E).REJECTED))},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),z],64))]),e("div",B,[d(J)&&!ee.value||ee.value?(r(),l(m,{key:0},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:le},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),U],64)):(r(),l(m,{key:1},[u(d(w),{circle:"",color:"#2ac98b",onClick:re},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),F],64))])])]))}});export{O as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as
|
1
|
+
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,sendMessage:r}=n(),d=e(""),u=e(!0),m=e(!0),c=t((()=>s.currentAVMsg.chatMessageType===a.AUDIO)),R=t((()=>"call"===s.currentAVMsg.callMode)),T=t((()=>{var e,t;return c.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),v=l.create();function A(){d.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{A()})),{state:s,sendMessage:r,trtc:v,timing:d,voiceOpen:u,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){A(),E.timer=setInterval((()=>{E.seconds++,d.value=i(E.seconds)}),1e3)},resetTimer:A,toggleAudio:async function(){await v.updateLocalAudio({mute:!u.value}),u.value=!u.value},toggleVideo:async function(){await v.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.on(l.EVENT.ERROR,e),v.on(l.EVENT.REMOTE_USER_ENTER,t),v.on(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.on(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.on(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.off(l.EVENT.ERROR,e),v.off(l.EVENT.REMOTE_USER_ENTER,t),v.off(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.off(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.off(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)}}}export{E as useVideo};
|
@@ -1 +1 @@
|
|
1
|
-
import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as
|
1
|
+
import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as o,isNumber as a,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{createDiscreteApi as u}from"naive-ui";const{message:d}=u(["message"]);function m(r){var o;const a=new Date(r);let i,s;if(e(a))i=s=t(a,"HH:mm");else{i=n(a)?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.132"))||"昨天":t(a,"MM-dd");const e=a.getFullYear(),r=(new Date).getFullYear();s=t(a,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(r){var o,a;const i=new Date(r),s=Date.now()-i.getTime();if(s<6e4)return(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.133"))||"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.136"))||"分钟前");if(e(i))return"今天 "+t(i,"HH:mm");if(n(i))return"昨天 "+t(i,"HH:mm");{const e=i.getFullYear(),n=(new Date).getFullYear();return t(i,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function g(e){return o(e||[]).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let r=n.toString();if(t===s.BLEND){const e=r.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const o=c.findEmoji(n[1]);o&&(r=r.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${o} />`))}})),r}const o=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return r=r.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(o(),"<$1 $2>").replace(o("/"),"</$1>").replace(/\n/g,"<br>"),r}function f(e){var t;if(e&&a(+e)&&!i(+e)){const t=E(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.138"))||"已取消"}function w(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:o}=e,a=v(e)?f(r):"";switch(n){case s.TEXT:return p(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${r} src=${c.findEmoji(r)}>`;case s.TEMPLATE:return null==(t=null==o?void 0:o.setting)?void 0:t.title;case s.VIDEO:return`[视频通话]${a}`;case s.AUDIO:return`[语音通话]${a}`;default:return"[消息]"}}function h(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),r=document.createElement("a");r.href=e,r.download=t,r.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function y(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const o=+n;o>1048576?n=(o/1048576).toFixed(2)+"M":o>1024?n=(o/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}async function H(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${l()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function v(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{d as $message,H as base64ToFile,h as downloadFile,E as formatSeconds,m as formatTime,f as getAVTime,y as getFileSize,v as isAudioOrVideoMessage,g as listSort,w as simplifyMessage,p as transformMessage};
|