cnhis-design-vue 3.2.3-release.3 → 3.2.3-release.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/es/components/biunique-chat/index.d.ts +31 -2
  2. package/es/components/biunique-chat/src/Index.vue.d.ts +31 -2
  3. package/es/components/biunique-chat/src/Index.vue2.js +1 -1
  4. package/es/components/biunique-chat/src/api/index.d.ts +2 -1
  5. package/es/components/biunique-chat/src/api/index.js +1 -1
  6. package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +3 -1
  7. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  8. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +0 -1
  9. package/es/components/biunique-chat/src/components/ChatSearch.vue.d.ts +17 -0
  10. package/es/components/biunique-chat/src/components/ChatSearch.vue.js +1 -0
  11. package/es/components/biunique-chat/src/components/ChatSearch.vue2.js +1 -0
  12. package/es/components/biunique-chat/src/types/index.d.ts +1 -0
  13. package/es/components/biunique-chat/style/index.css +1 -1
  14. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  15. package/es/components/classification/src/index.vue.d.ts +3 -0
  16. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  19. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  20. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  21. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  22. package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
  23. package/es/components/index.css +1 -1
  24. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  25. package/es/env.d.ts +25 -25
  26. package/es/shared/directive/flexibleResize.js +1 -1
  27. package/es/shared/package.json.js +1 -1
  28. package/es/shared/types/business.d.ts +1 -0
  29. package/package.json +2 -2
@@ -4,6 +4,10 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
4
4
  type: StringConstructor;
5
5
  required: true;
6
6
  };
7
+ orgId: {
8
+ type: (NumberConstructor | StringConstructor)[];
9
+ required: true;
10
+ };
7
11
  userId: {
8
12
  type: StringConstructor;
9
13
  required: true;
@@ -18,6 +22,10 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
18
22
  type: StringConstructor;
19
23
  required: true;
20
24
  };
25
+ orgId: {
26
+ type: (NumberConstructor | StringConstructor)[];
27
+ required: true;
28
+ };
21
29
  userId: {
22
30
  type: StringConstructor;
23
31
  required: true;
@@ -35,6 +43,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
35
43
  loading: import("vue").Ref<boolean>;
36
44
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
37
45
  state: {
46
+ orgId: string | number;
38
47
  currentSessionItem: import("../../shared/types").AnyObject;
39
48
  id: string;
40
49
  userInfo: import("../../shared/types").AnyObject;
@@ -1146,7 +1155,6 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1146
1155
  hasMore: boolean;
1147
1156
  };
1148
1157
  getHistoryRecord: () => Promise<void>;
1149
- accessSession: () => Promise<void>;
1150
1158
  showMessage: (item: import("../../shared/types").AnyObject) => boolean;
1151
1159
  showTemplateMsg: (item: import("../../shared/types").AnyObject, type: "template" | "system") => boolean | undefined;
1152
1160
  isTemplate3: (content: import("../../shared/types").AnyObject) => boolean;
@@ -1494,10 +1502,12 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1494
1502
  state: import("./src/types").IState;
1495
1503
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock>;
1496
1504
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
1505
+ showEmoji: import("vue").Ref<boolean>;
1497
1506
  handleKeyDown: (event: KeyboardEvent) => void;
1498
1507
  isWrap: (event: KeyboardEvent) => boolean;
1499
1508
  handleInput: () => void;
1500
- onChange: (options: {
1509
+ selectEmoji: (index: string | number) => void;
1510
+ fileChange: (options: {
1501
1511
  file: import("naive-ui").UploadFileInfo;
1502
1512
  fileList: import("naive-ui").UploadFileInfo[];
1503
1513
  }, chatMessageType: import("./src/constants").MESSAGE_TYPE) => Promise<void>;
@@ -1520,11 +1530,30 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1520
1530
  alt: string[];
1521
1531
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
1522
1532
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1533
+ ChatSearch: import("vue").DefineComponent<{}, {
1534
+ showSearch: import("vue").Ref<boolean>;
1535
+ keyword: import("vue").Ref<any>;
1536
+ userList: import("vue").Ref<any>;
1537
+ state: import("./src/types").IState;
1538
+ entrySession: (item: import("../../shared/types").AnyObject) => void;
1539
+ handleSearch: () => Promise<void>;
1540
+ openSession: (userId: string) => Promise<void>;
1541
+ NPopover: any;
1542
+ NButton: any;
1543
+ NAvatar: any;
1544
+ NInput: any;
1545
+ NIcon: any;
1546
+ 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<{}>>, {}>;
1547
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1523
1548
  }, 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<{
1524
1549
  token: {
1525
1550
  type: StringConstructor;
1526
1551
  required: true;
1527
1552
  };
1553
+ orgId: {
1554
+ type: (NumberConstructor | StringConstructor)[];
1555
+ required: true;
1556
+ };
1528
1557
  userId: {
1529
1558
  type: StringConstructor;
1530
1559
  required: true;
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
7
7
  type: StringConstructor;
8
8
  required: true;
9
9
  };
10
+ orgId: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ required: true;
13
+ };
10
14
  userId: {
11
15
  type: StringConstructor;
12
16
  required: true;
@@ -21,6 +25,10 @@ declare const _default: import("vue").DefineComponent<{
21
25
  type: StringConstructor;
22
26
  required: true;
23
27
  };
28
+ orgId: {
29
+ type: (NumberConstructor | StringConstructor)[];
30
+ required: true;
31
+ };
24
32
  userId: {
25
33
  type: StringConstructor;
26
34
  required: true;
@@ -38,6 +46,7 @@ declare const _default: import("vue").DefineComponent<{
38
46
  loading: import("vue").Ref<boolean>;
39
47
  stompClient: import("vue").Ref<ChatSock | undefined>;
40
48
  state: {
49
+ orgId: string | number;
41
50
  currentSessionItem: AnyObject;
42
51
  id: string;
43
52
  userInfo: AnyObject;
@@ -1149,7 +1158,6 @@ declare const _default: import("vue").DefineComponent<{
1149
1158
  hasMore: boolean;
1150
1159
  };
1151
1160
  getHistoryRecord: () => Promise<void>;
1152
- accessSession: () => Promise<void>;
1153
1161
  showMessage: (item: AnyObject) => boolean;
1154
1162
  showTemplateMsg: (item: AnyObject, type: "template" | "system") => boolean | undefined;
1155
1163
  isTemplate3: (content: AnyObject) => boolean;
@@ -1497,10 +1505,12 @@ declare const _default: import("vue").DefineComponent<{
1497
1505
  state: IState;
1498
1506
  stompClient: import("vue").Ref<ChatSock>;
1499
1507
  setCurrentSessionItem: (item: AnyObject) => void;
1508
+ showEmoji: import("vue").Ref<boolean>;
1500
1509
  handleKeyDown: (event: KeyboardEvent) => void;
1501
1510
  isWrap: (event: KeyboardEvent) => boolean;
1502
1511
  handleInput: () => void;
1503
- onChange: (options: {
1512
+ selectEmoji: (index: string | number) => void;
1513
+ fileChange: (options: {
1504
1514
  file: import("naive-ui").UploadFileInfo;
1505
1515
  fileList: import("naive-ui").UploadFileInfo[];
1506
1516
  }, chatMessageType: import("./constants").MESSAGE_TYPE) => Promise<void>;
@@ -1523,11 +1533,30 @@ declare const _default: import("vue").DefineComponent<{
1523
1533
  alt: string[];
1524
1534
  MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
1525
1535
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1536
+ ChatSearch: import("vue").DefineComponent<{}, {
1537
+ showSearch: import("vue").Ref<boolean>;
1538
+ keyword: import("vue").Ref<any>;
1539
+ userList: import("vue").Ref<any>;
1540
+ state: IState;
1541
+ entrySession: (item: AnyObject) => void;
1542
+ handleSearch: () => Promise<void>;
1543
+ openSession: (userId: string) => Promise<void>;
1544
+ NPopover: any;
1545
+ NButton: any;
1546
+ NAvatar: any;
1547
+ NInput: any;
1548
+ NIcon: any;
1549
+ 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<{}>>, {}>;
1550
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1526
1551
  }, 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<{
1527
1552
  token: {
1528
1553
  type: StringConstructor;
1529
1554
  required: true;
1530
1555
  };
1556
+ orgId: {
1557
+ type: (NumberConstructor | StringConstructor)[];
1558
+ required: true;
1559
+ };
1531
1560
  userId: {
1532
1561
  type: StringConstructor;
1533
1562
  required: true;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as t,provide as o,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 S,NLayout as v,NLayoutContent as b}from"naive-ui";import g from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import{ChatSock as I}from"./utils/chatSock.js";import{instanceAxios as _}from"./api/index.js";import{useTheme as L}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as U}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 M,InjectionIChatStompClient as C,InjectionIChatEmits as N}from"./types/index.js";import"./utils/emoji.js";import{useSession as q}from"./hooks/useSession.js";const T={class:"c-biunique-chat__header"},A={class:"toolbar"};var E=e({__name:"Index",props:{token:{type:String,required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:E,emit:O}){const V=e;_.defaults.baseURL=V.baseURL+"/chat",_.defaults.headers.Authorization="bearer"+V.token;const w=L(),J=s(!1),R=s(),F=t({currentSessionItem:{},id:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});o(M,F),o(C,R),o(N,O);const{entrySession:H,setSessionList:$}=q(F);function z(){const e={headers:{AccessToken:V.token,UserId:V.userId},heartbeatFn:()=>{try{R.value.send("test")}catch(e){R.value.disconnect(),z()}},connectCb:()=>{console.log("连接成功"),R.value.subscribe("/user/topic/single",(({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:t,sessionVo:o}=s;switch(s.event){case x.MESSAGE:if(s.messageVo.sender===F.userInfo.id)return;t.sender===F.currentSessionItem.receiver&&(F.currentMsg=t,F.isAppendMsg=!0),F.updateSessionItem={receiver:t.sender,lastMessageSendTime:t.sendTime,sortTime:t.sendTime,lastMessage:t.content},F.isUpdateSession=!0;break;case x.NEW_SESSION:F.updateSessionItem=o,F.isUpdateSession=!0}}catch(e){console.log(e)}})),R.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:t,sessionVos:o}=s;if(F.userInfo=t,!(null==o?void 0:o.length))return;$(o)}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};R.value=new I("/fdp-chat/websocket",e)}return async function(){z()}(),r((()=>{var e;null==(e=R.value)||e.disconnect()})),E({getUnreadData:function(){return F.sessionList.filter((e=>U(e.unreadNum)&&e.unreadNum>0))},entrySession:H}),(e,s)=>(n(),i("div",{class:"c-biunique-chat",style:a(c(w))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:d((()=>[J.value?(n(),m(c(S),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",T,[l("div",A,[h(e.$slots,"toolbar")])]),u(c(v),{class:"c-biunique-chat__body","has-sider":""},{default:d((()=>[u(g),u(c(b),{class:"chat-content"},{default:d((()=>[u(y),u(k),u(j)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{E as default};
1
+ import{defineComponent as e,ref as s,reactive as t,provide as o,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 S,NLayout as v,NLayoutContent as g}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{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as L}from"./api/index.js";import{useTheme as U}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 C}from"./constants/index.js";import{InjectionIChatState as M,InjectionIChatStompClient as N,InjectionIChatEmits as q}from"./types/index.js";import"./utils/emoji.js";import{useSession as T}from"./hooks/useSession.js";const A={class:"c-biunique-chat__header"},E={class:"toolbar"};var O=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:O,emit:V}){const w=e;L.defaults.baseURL=w.baseURL,L.defaults.headers.Authorization="bearer "+w.token;const J=U(),R=s(!1),F=s(),H=t({orgId:w.orgId,currentSessionItem:{},id:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});o(M,H),o(N,F),o(q,V);const{entrySession:$,setSessionList:z}=T(H);function D(){const e={headers:{AccessToken:w.token,UserId:w.userId},heartbeatFn:()=>{try{F.value.send("test")}catch(e){F.value.disconnect(),D()}},connectCb:()=>{console.log("连接成功"),F.value.subscribe("/user/topic/single",(({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:t,sessionVo:o}=s;switch(s.event){case C.MESSAGE:if(s.messageVo.sender===H.userInfo.id)return;t.sender===H.currentSessionItem.receiver&&(H.currentMsg=t,H.isAppendMsg=!0),H.updateSessionItem={receiver:t.sender,lastMessageSendTime:t.sendTime,sortTime:t.sendTime,lastMessage:t.content},H.isUpdateSession=!0;break;case C.NEW_SESSION:H.updateSessionItem=o,H.isUpdateSession=!0}}catch(e){console.log(e)}})),F.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:t,sessionVos:o}=s;if(H.userInfo=t,!(null==o?void 0:o.length))return;z(o)}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};F.value=new _("/fdp-chat/websocket",e)}return async function(){D()}(),r((()=>{var e;null==(e=F.value)||e.disconnect()})),O({getUnreadData:function(){return H.sessionList.filter((e=>x(e.unreadNum)&&e.unreadNum>0))},entrySession:$}),(e,s)=>(n(),i("div",{class:"c-biunique-chat",style:a(c(J))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:d((()=>[R.value?(n(),m(c(S),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",A,[u(k),l("div",E,[h(e.$slots,"toolbar")])]),u(c(v),{class:"c-biunique-chat__body","has-sider":""},{default:d((()=>[u(b),u(c(g),{class:"chat-content"},{default:d((()=>[u(y),u(I),u(j)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{O as default};
@@ -1,6 +1,7 @@
1
1
  import { AnyObject } from '../../../../shared/types';
2
2
  export declare const instanceAxios: import("axios").AxiosInstance;
3
- export declare function accessSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
3
+ export declare function openSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
4
4
  export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
5
5
  export declare function toppingSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
6
6
  export declare function uploadFileApi(params: FormData): import("axios").AxiosPromise<any>;
7
+ export declare function listUserApi(params: AnyObject): import("axios").AxiosPromise<any>;
@@ -1 +1 @@
1
- import o from"axios";function t(o){const t=[];for(const e in o){const n=o[e];Array.isArray(n)?n.forEach((o=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(o)}`)})):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(n)}`)}return t.join("&")}const e=o.create({withCredentials:!0,timeout:5e3});function n(o){return e({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/openSession",data:t(o)})}function r(o){return e({method:"get",url:"/recordList",params:o})}function a(o){return e({method:"post",url:"/toppingSession",data:o})}function s(o){return e({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/uploadFile",data:o})}e.interceptors.response.use((o=>{var t,e;if(null==(t=o.data)?void 0:t.result)return null==(e=o.data)?void 0:e.data;console.log("请求错误")}));export{n as accessSessionApi,r as getHistoryRecordApi,e as instanceAxios,a as toppingSessionApi,s 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:"/chat/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({method:"post",url:"/chat/toppingSession",data: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})}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,o as instanceAxios,u as listUserApi,n as openSessionApi,a as toppingSessionApi,s as uploadFileApi};
@@ -7,10 +7,12 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  state: import("../types").IState;
8
8
  stompClient: import("vue").Ref<import("../utils/chatSock").ChatSock>;
9
9
  setCurrentSessionItem: (item: AnyObject) => void;
10
+ showEmoji: import("vue").Ref<boolean>;
10
11
  handleKeyDown: (event: KeyboardEvent) => void;
11
12
  isWrap: (event: KeyboardEvent) => boolean;
12
13
  handleInput: () => void;
13
- onChange: (options: {
14
+ selectEmoji: (index: number | string) => void;
15
+ fileChange: (options: {
14
16
  file: UploadFileInfo;
15
17
  fileList: Array<UploadFileInfo>;
16
18
  }, chatMessageType: MESSAGE_TYPE) => Promise<void>;
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as c,withCtx as r,createCommentVNode as u,Fragment as d,renderList as f,createBlock as p,createTextVNode as m,toDisplayString as g,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as x}from"naive-ui";import{format as C}from"date-fns";import{useState as T}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=T(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=C(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i,sortTime:a}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[c(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:r((()=>[j])),default:r((()=>[l("div",L,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,f(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),p(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:r((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:r((()=>[m(" "+g(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),c(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),c(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,c(o(x),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:r((()=>[m("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
1
+ import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as r,withCtx as c,createCommentVNode as u,Fragment as d,renderList as f,createBlock as p,createTextVNode as m,toDisplayString as g,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as x}from"naive-ui";import{format as C}from"date-fns";import{useState as T}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as w,alt as E}from"../utils/emoji.js";import{MESSAGE_TYPE as I}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],U={class:"btn-box"},X=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var z=t({__name:"ChatFooter",setup(t){const z=e(),B=e(""),{state:R,stompClient:q}=T(),{setCurrentSessionItem:P}=b(R),Q=e(!1);function V(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Z()))}function W(){var t,e;B.value=(null==(e=null==(t=z.value)?void 0:t.innerText)?void 0:e.trim())||""}async function Y(t,e){console.log(Y,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",R.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");$({chatMessageType:e,msg:e===I.FILE?s:a,url:a})}function Z(){if(!(B.value.length>2e3))return B.value?void $({msg:B.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function $(t){const{chatMessageType:e=I.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===I.FILE&&(i.fileUrl=s),[I.TEXT,I.BLEND].includes(e)&&(z.value.innerHTML="",B.value="");const a=C(new Date,"yyyy-MM-dd HH:mm:ss");R.currentMsg={content:i,sender:R.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},R.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i,sortTime:a}),R.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:R.currentSessionItem.receiver})),R.currentMsg={...R.currentMsg,fail:!1}}catch(t){R.currentMsg={...R.currentMsg,fail:!0}}finally{R.currentMsg={...R.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(R).id?"default":"not-allowed"})},[l("div",S,[r(o(v),{show:Q.value,"onUpdate:show":e[0]||(e[0]=t=>Q.value=t),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:c((()=>[j])),default:c((()=>[l("div",L,[u(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,f(o(w),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),p(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:c((()=>[l("i",{onClick:()=>function(t){Q.value=!1,$({chatMessageType:I.EMOJI,msg:t})}(e)},[l("img",{src:t},null,8,H)],8,D)])),default:c((()=>[m(" "+g(o(E)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1},8,["show"]),l("span",{onClick:e[1]||(e[1]=()=>$({chatMessageType:o(I).EMOJI,msg:0}))},J),r(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[2]||(e[2]=t=>Y(t,o(I).IMAGE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),r(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[3]||(e[3]=t=>Y(t,o(I).FILE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:z,class:"input-box",contenteditable:"",onKeydown:V,onInput:W},null,544),[[h,o(R).id]]),l("div",U,[X,r(o(x),{type:"primary",round:"",disabled:!B.value,onClick:Z},{default:c((()=>[m("发送")])),_:1},8,["disabled"])])],4)),[[h,o(R).id]])}});export{z as default};
@@ -9,7 +9,6 @@ declare const _default: import("vue").DefineComponent<{}, {
9
9
  hasMore: boolean;
10
10
  };
11
11
  getHistoryRecord: () => Promise<void>;
12
- accessSession: () => Promise<void>;
13
12
  showMessage: (item: AnyObject) => boolean;
14
13
  showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
15
14
  isTemplate3: (content: AnyObject) => boolean;
@@ -0,0 +1,17 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ declare const _default: import("vue").DefineComponent<{}, {
3
+ showSearch: import("vue").Ref<boolean>;
4
+ keyword: import("vue").Ref<any>;
5
+ userList: import("vue").Ref<any>;
6
+ state: import("../types").IState;
7
+ entrySession: (item: AnyObject) => void;
8
+ handleSearch: () => Promise<void>;
9
+ openSession: (userId: string) => Promise<void>;
10
+ NPopover: any;
11
+ NButton: any;
12
+ NAvatar: any;
13
+ NInput: any;
14
+ NIcon: any;
15
+ 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<{}>>, {}>;
16
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
17
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./ChatSearch.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var a=r(e,[["__file","ChatSearch.vue"]]);export{a as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,openBlock as a,createBlock as s,unref as n,withCtx as r,createVNode as l,createTextVNode as t,createElementVNode as i,withKeys as c,withModifiers as u,createElementBlock as p,Fragment as d,renderList as v,toDisplayString as f}from"vue";import{NPopover as m,NButton as h,NIcon as w,NInput as y,NAvatar as g}from"naive-ui";import{SearchOutline as k}from"@vicons/ionicons5";import{useState as S}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import{listUserApi as I,openSessionApi as j}from"../api/index.js";import{isArray as x}from"lodash-es";const C={class:"popover-search"},b={class:"user-list-wrapper"},z=["onClick"],K={class:"user-info"},U=i("span",null,"职务",-1),E=i("span",null,"部门",-1);var G=e({__name:"ChatSearch",setup(e){const G=o(!1),L=o(),N=o(),{state:T}=S(),{entrySession:q}=_(T);async function A(){const e=await I({orgId:T.orgId,keyword:L.value});x(e)&&(N.value=e)}return(e,o)=>(a(),s(n(m),{show:G.value,"onUpdate:show":o[1]||(o[1]=e=>G.value=e),placement:"top",trigger:"click","show-arrow":!1,overlap:""},{trigger:r((()=>[l(n(h),{color:"#d8dce34f",class:"search-trigger-btn"},{icon:r((()=>[l(n(w),{component:n(k),color:"#ffffff80"},null,8,["component"])])),default:r((()=>[t(" 搜索联系人 ")])),_:1})])),default:r((()=>[i("div",C,[l(n(y),{placeholder:"",size:"small",clearable:"",autofocus:"","passively-activated":"",delay:0,onKeydown:c(u(A,["prevent"]),["enter"]),value:L.value,"onUpdate:value":o[0]||(o[0]=e=>L.value=e)},{prefix:r((()=>[l(n(w),{component:n(k)},null,8,["component"])])),_:1},8,["onKeydown","value"]),i("div",b,[(a(!0),p(d,null,v(N.value,(e=>(a(),p("div",{class:"user-item",key:e.id,onClick:()=>async function(e){G.value=!1;const o=await j({chatType:"SINGLE",receiver:e,sender:T.userInfo.id});q(o)}(e.id)},[l(n(g),{round:"",size:32,src:e.avatar},null,8,["src"]),i("div",K,[i("span",null,f(e.name),1),U,E])],8,z)))),128))])])])),_:1},8,["show"]))}});export{G as default};
@@ -2,6 +2,7 @@ import { InjectionKey, Ref } from 'vue';
2
2
  import { AnyObject } from '../../../../shared/types';
3
3
  import { ChatSock } from '../utils/chatSock';
4
4
  export declare type IState = {
5
+ orgId: number | string;
5
6
  currentSessionItem: AnyObject;
6
7
  id: string;
7
8
  userInfo: AnyObject;