cnhis-design-vue 3.1.47-beta.6 → 3.1.47-beta.8
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/es/components/button-print/src/utils/print.d.ts +5 -3
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/multi-chat/index.d.ts +1023 -0
- package/es/components/multi-chat/index.js +1 -0
- package/es/components/multi-chat/src/MultiChat.vue.d.ts +1005 -0
- package/es/components/multi-chat/src/MultiChat.vue.js +1 -0
- package/es/components/multi-chat/src/MultiChat.vue2.js +1 -0
- package/es/components/multi-chat/src/api/index.d.ts +8 -0
- package/es/components/multi-chat/src/api/index.js +1 -0
- package/es/components/multi-chat/src/components/ChatFooter.vue.d.ts +17 -0
- package/es/components/multi-chat/src/components/ChatFooter.vue.js +1 -0
- package/es/components/multi-chat/src/components/ChatFooter.vue2.js +1 -0
- package/es/components/multi-chat/src/components/ChatHeader.vue.d.ts +7 -0
- package/es/components/multi-chat/src/components/ChatHeader.vue.js +1 -0
- package/es/components/multi-chat/src/components/ChatHeader.vue2.js +1 -0
- package/es/components/multi-chat/src/components/ChatMain.vue.d.ts +13 -0
- package/es/components/multi-chat/src/components/ChatMain.vue.js +1 -0
- package/es/components/multi-chat/src/components/ChatMain.vue2.js +1 -0
- package/es/components/multi-chat/src/components/SiderList.vue.d.ts +41 -0
- package/es/components/multi-chat/src/components/SiderList.vue.js +1 -0
- package/es/components/multi-chat/src/components/SiderList.vue2.js +1 -0
- package/es/components/multi-chat/src/utils/chatSock.d.ts +28 -0
- package/es/components/multi-chat/src/utils/chatSock.js +1 -0
- package/es/components/multi-chat/style/index.css +1 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./MultiChat.vue2.js";import e from"../../../_virtual/_plugin-vue_export-helper.js";var r=e(t,[["__file","MultiChat.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as s,reactive as t,provide as n,openBlock as o,createBlock as r,unref as i,withCtx as a,createVNode as c}from"vue";import{NSpin as u,NLayout as d,NLayoutSider as m,NLayoutContent as l}from"naive-ui";import f from"./components/SiderList.vue.js";import p from"./components/ChatHeader.vue.js";import g from"./components/ChatMain.vue.js";import S from"./components/ChatFooter.vue.js";import{promiseTimeout as I}from"@vueuse/shared";import{ChatSock as h}from"./utils/chatSock.js";import{accessApi as b,readMessageApi as y}from"./api/index.js";import{format as v}from"date-fns";var C=e({__name:"MultiChat",props:{data:{type:Object,default:()=>({})},baseURL:{type:String,defalut:()=>"/"}},setup(e){const C=e,_=s(!1),M=s(!1);let w;const L=t({reConnention:0,currentSessionItem:{},currentSessionId:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});function j(){const e={heartbeatFn:()=>{try{null==w||w.send("test")}catch(e){null==w||w.disconnect(),j()}},connectCb:()=>{console.log("连接成功"),L.reConnention>0&&(L.reConnention=0),w.subscribe(`/user/${L.userInfo.username}/message`,(e=>{try{const s=JSON.parse(e.body),{body:t,from:n,id:o,fromName:r,readStatus:i,createdTime:a,sessionId:c}=s;if(c!==L.currentSessionId)return;N({createdTime:a,readStatus:i,content:t,fromId:n,id:o,fromName:r,senderFlag:1}),O(!0),async function(){await y({sessionId:L.currentSessionId,from:L.userInfo.username,id:L.currentMsg.id})}()}catch(e){console.log(e)}})),w.subscribe(`/user/${L.userInfo.username}/sessionList`,(e=>{var s;try{const t=JSON.parse(e.body),n={__time:v(new Date(t.sendTime),"MM/dd HH:mm"),__lastContent:(null==(s=t.lastContent)?void 0:s.content)||"",id:t.sessionId};if(0==t.opt){const e=t.name||t.fromName||t.toName;U([{...t,name:e,__name:e.slice(-2),...n},...L.sessionList])}else 1==t.opt&&(L.updateSessionItem={...t,...n},k(!0))}catch(e){console.log(e)}})),w.subscribe(`/user/${L.userInfo.username}/msgReadStatus`,(e=>{try{if(!L.currentSessionId)return;const s=JSON.parse(e.body);if(s.sessionId!==L.currentSessionId)return;const t=(null==s?void 0:s.readStatus)||{};if(Object.keys(t).length<1)return}catch(e){console.log(e)}}))},errorCb:(e,s)=>{L.reConnention=s,console.log("断线了,正在重连...")}};w=new h(`${C.baseURL}/stomp`,e)}function N(e){L.currentMsg=e}function O(e){L.isAppendMsg=e}function U(e){L.sessionList=e}function k(e){L.isUpdateSession=e}async function H(e){e||await I(300),_.value=e}return n("state",L),n("setCurrentSessionItem",(function(e){if(Object.assign(L.currentSessionItem,e),L.currentSessionId===L.currentSessionItem.id)return;L.currentSessionId=L.currentSessionItem.id,L.msgList=[]})),n("setMsgList",(function(e=[]){L.msgList=e.map((e=>{var s;return{...e,__time:v(new Date(e.createdTime),"MM/dd HH:mm"),__content:null==(s=e.content)?void 0:s.content,__left:1==e.senderFlag}}))})),n("setCurrentMsg",N),n("setIsAppendMsg",O),n("setSessionList",U),n("setIsChangeSession",(function(e){L.isChangeSession=e})),n("setIsUpdateSession",k),async function(){await async function(){if(Object.values(C.data).some((e=>!String(e))))return console.log("缺少参数");try{M.value=!0;const e=await b(C.data);L.userInfo=e}catch(e){console.log(e)}finally{M.value=!1}}(),j()}(),(e,s)=>M.value?(o(),r(i(u),{key:0,stroke:"#5585f5"})):(o(),r(i(d),{key:1,class:"c-multi-chat","has-sider":""},{default:a((()=>[c(i(m),{"collapse-mode":"width","collapsed-width":100,width:300,"show-trigger":"arrow-circle","content-style":"padding: 20px;",bordered:"","onUpdate:collapsed":H},{default:a((()=>[c(f,{collapsed:_.value},null,8,["collapsed"])])),_:1}),c(i(l),{class:"chat-wrapper"},{default:a((()=>[c(p),c(g),c(S)])),_:1})])),_:1}))}});export{C as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
export declare function accessApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
3
|
+
export declare function getMySessionListApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
4
|
+
export declare function accessSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
5
|
+
export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
6
|
+
export declare function sendMessageApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
7
|
+
export declare function readMessageApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
8
|
+
export declare function createSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"axios";const e=t.create({withCredentials:!0,timeout:5e3,baseURL:"/dev_chat"});function s(t){return e({method:"post",url:"/basic/access",data:t})}function a(t){return e({method:"get",url:"/basic/getMySessionList",params:t})}function r(t){return e({method:"post",url:"/basic/accessSession",data:t})}function o(t){return e({method:"get",url:"/basic/historyRecord",params:t})}function n(t){return e({method:"post",url:"/basic/sendMessage",data:t})}function i(t){return e({method:"post",url:"/basic/readMessage",data:t})}function c(t){return e({method:"post",url:"/basic/createSession",data:t})}e.interceptors.response.use((t=>{var e,s;if(null==(e=t.data)?void 0:e.success)return null==(s=t.data)?void 0:s.data;console.log("请求错误")}));export{s as accessApi,r as accessSessionApi,c as createSessionApi,o as getHistoryRecordApi,a as getMySessionListApi,i as readMessageApi,n as sendMessageApi};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
3
|
+
inputRef: import("vue").Ref<HTMLDivElement | undefined>;
|
|
4
|
+
state: AnyObject;
|
|
5
|
+
setCurrentMsg: Function;
|
|
6
|
+
setIsAppendMsg: Function;
|
|
7
|
+
setCurrentSessionItem: Function;
|
|
8
|
+
setIsChangeSession: Function;
|
|
9
|
+
content: import("vue").Ref<string>;
|
|
10
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
11
|
+
isWrap: (event: KeyboardEvent) => boolean;
|
|
12
|
+
handleInput: () => void;
|
|
13
|
+
handleMsgSend: () => void;
|
|
14
|
+
sendMessage: () => Promise<void>;
|
|
15
|
+
NButton: any;
|
|
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"./ChatFooter.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","ChatFooter.vue"]]);export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as n,inject as t,openBlock as s,createElementBlock as r,normalizeStyle as o,unref as a,withDirectives as i,createElementVNode as u,vShow as l,createVNode as c,withCtx as d,createTextVNode as f}from"vue";import{NButton as m}from"naive-ui";import{sendMessageApi as p}from"../api/index.js";import{format as v}from"date-fns";const y={class:"btn-box"},g=u("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var I=e({__name:"ChatFooter",setup(e){const I=n(),S=t("state"),M=t("setCurrentMsg"),_=t("setIsAppendMsg"),b=t("setCurrentSessionItem"),C=t("setIsChangeSession"),h=n("");function w(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),K()))}function x(){var e,n;h.value=(null==(n=null==(e=I.value)?void 0:e.innerText)?void 0:n.trim())||""}function K(){if(!(h.value.length>2e3))return h.value?void async function(){const e={content:h.value,type:0};I.value.innerHTML="",h.value="";const n=Date.now();M({content:e,fromName:S.userInfo.username,sessionId:S.currentSessionItem.id,id:"",createdTime:n,sending:!0,fail:!1}),_(!0),b({__time:v(new Date(n),"MM/dd HH:mm"),__lastContent:e.content}),C(!0);try{const n=await p({sessionId:S.currentSessionId,from:S.userInfo.username,source:2,body:JSON.stringify(e)});M({...S.currentMsg,id:n.messageId,fail:!1,readStatus:n.readStatus})}catch(e){M({...S.currentMsg,fail:!0})}finally{M({...S.currentMsg,sending:!1})}}():console.log("请输入内容");console.log("请控制在2000字以内")}return(e,n)=>(s(),r("section",{class:"chat-footer",style:o({cursor:a(S).currentSessionId?"default":"not-allowed"})},[i(u("div",{ref_key:"inputRef",ref:I,class:"input-box",contenteditable:"",onKeydown:w,onInput:x},null,544),[[l,a(S).currentSessionId]]),u("div",y,[g,c(a(m),{type:"primary",round:"",disabled:!h.value,onClick:K},{default:d((()=>[f("发送")])),_:1},8,["disabled"])])],4))}});export{I as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
3
|
+
state: AnyObject;
|
|
4
|
+
username: import("vue").ComputedRef<any>;
|
|
5
|
+
NAvatar: any;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./ChatHeader.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var a=r(e,[["__file","ChatHeader.vue"]]);export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,inject as s,computed as a,openBlock as t,createElementBlock as r,createElementVNode as n,withDirectives as l,createVNode as o,unref as i,withCtx as u,createTextVNode as c,toDisplayString as d,vShow as m,createCommentVNode as v}from"vue";import{NAvatar as p}from"naive-ui";const h={class:"chat-header"},f={class:"chat-header__left"},_={class:"name"};var I=e({__name:"ChatHeader",setup(e){const I=s("state"),S=a((()=>I.currentSessionItem.name));return(e,s)=>(t(),r("section",h,[n("div",f,[l(o(i(p),{round:"",size:"large"},{default:u((()=>{var e,s;return[c(d((null==(s=null==(e=i(S))?void 0:e.slice)?void 0:s.call(e,-2))||""),1)]})),_:1},512),[[m,i(I).currentSessionId]]),n("span",_,d(i(S)),1)]),v(' <span v-show="state.currentSessionId">{{ statusTitle }}</span> ')]))}});export{I as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
3
|
+
state: AnyObject;
|
|
4
|
+
setMsgList: Function;
|
|
5
|
+
setIsAppendMsg: Function;
|
|
6
|
+
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
|
7
|
+
getHistoryRecord: () => Promise<void>;
|
|
8
|
+
accessSession: (lastSessionId: string) => Promise<void>;
|
|
9
|
+
isNeedShowTime: (item: AnyObject, index: number) => boolean;
|
|
10
|
+
setScrollToButtom: () => Promise<void>;
|
|
11
|
+
NAvatar: any;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./ChatMain.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var a=r(e,[["__file","ChatMain.vue"]]);export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,inject as s,ref as n,nextTick as t,watch as i,openBlock as r,createElementBlock as a,Fragment as o,renderList as l,unref as c,toDisplayString as u,createCommentVNode as m,createVNode as d,withCtx as f,createTextVNode as g,createElementVNode as v}from"vue";import{NAvatar as p}from"naive-ui";import{useInfiniteScroll as _}from"@vueuse/core";import{getHistoryRecordApi as y,accessSessionApi as L}from"../api/index.js";const M={key:0,class:"time"},I={key:1,class:"message-box left"},h={class:"content"},T=["innerHTML"],k={key:2,class:"message-box right"},H={class:"content"},w=["innerHTML"];var x=e({__name:"ChatMain",setup(e){const x=s("state"),A=s("setMsgList"),S=s("setIsAppendMsg"),b=n();async function z(){var e,s;try{const n=null==(s=null==(e=x.msgList)?void 0:e[0])?void 0:s.id,t=await y({mergeType:1,sessionId:x.currentSessionId,from:x.userInfo.username,source:2,id:n});if(!Array.isArray(t))return;if(n&&0===t.length)return console.log("没有更多消息了");A(n?[...t,...x.msgList]:t),n||j()}catch(e){console.log(e)}}function N(e,s){return+(e.createdTime||Date.now())-+(0==s?0:x.msgList[s-1].createdTime)>18e4}async function j(){var e,s,n;await t();const i=null!=(s=null==(e=b.value)?void 0:e.scrollHeight)?s:0;null==(n=b.value)||n.scrollTo({top:i,behavior:"instant"})}return _(b,(()=>{z()}),{distance:20,direction:"top"}),i((()=>x.currentSessionId),((e,s)=>{e&&(!async function(e){await L({sessionId:x.currentSessionId,lastSessionId:e,from:x.userInfo.username})}(s),z())}),{immediate:!0}),i((()=>x.isAppendMsg),(e=>{e&&(A([...x.msgList,x.currentMsg]),S(!1),j())}),{immediate:!0}),(e,s)=>(r(),a("div",{class:"chat-main",ref_key:"chatMainRef",ref:b},[(r(!0),a(o,null,l(c(x).msgList,((e,s)=>(r(),a("div",{class:"message-item",key:s},[N(e,s)?(r(),a("p",M,u(e.__time),1)):m("v-if",!0),e.__left?(r(),a("div",I,[d(c(p),{round:"",size:"large"},{default:f((()=>[g(u(e.fromName.slice(-2)),1)])),_:2},1024),v("div",h,[v("p",{innerHTML:e.__content},null,8,T)])])):(r(),a("div",k,[v("div",H,[v("p",{innerHTML:e.__content},null,8,w)]),d(c(p),{round:"",size:"large"},{default:f((()=>[g(u(e.fromName.slice(-2)),1)])),_:2},1024)]))])))),128))],512))}});export{x as default};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
collapsed: {
|
|
4
|
+
type: BooleanConstructor;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
collapsed: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>> & {}>>;
|
|
14
|
+
state: AnyObject;
|
|
15
|
+
setCurrentSessionItem: Function;
|
|
16
|
+
setSessionList: Function;
|
|
17
|
+
setIsChangeSession: Function;
|
|
18
|
+
setIsUpdateSession: Function;
|
|
19
|
+
listBoxRef: import("vue").Ref<HTMLElement | undefined>;
|
|
20
|
+
keyword: import("vue").Ref<string>;
|
|
21
|
+
sessionList: import("vue").Ref<AnyObject[]>;
|
|
22
|
+
loading: import("vue").Ref<boolean>;
|
|
23
|
+
pageNum: number;
|
|
24
|
+
init: () => void;
|
|
25
|
+
handleSearch: () => void;
|
|
26
|
+
getMySessionList: () => Promise<void>;
|
|
27
|
+
entrySession: (item: AnyObject) => void;
|
|
28
|
+
sessionChange: (sessionItem: AnyObject) => void;
|
|
29
|
+
NSpin: any;
|
|
30
|
+
NBadge: any;
|
|
31
|
+
NAvatar: any;
|
|
32
|
+
NInput: any;
|
|
33
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
+
collapsed: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
}>>, {
|
|
39
|
+
collapsed: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./SiderList.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var i=r(e,[["__file","SiderList.vue"]]);export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,inject as s,ref as n,watch as t,openBlock as i,createElementBlock as a,createBlock as l,unref as o,withKeys as u,createElementVNode as r,Fragment as d,renderList as v,normalizeClass as c,createVNode as m,withCtx as _,createTextVNode as p,toDisplayString as f}from"vue";import{NSpin as g,NInput as S,NAvatar as y,NBadge as h}from"naive-ui";import{format as C}from"date-fns";import{getMySessionListApi as k}from"../api/index.js";const L={class:"sider-list"},I=["onClick"],x={class:"name"},H={class:"msg-tip"},M={class:"msg-tip__content"},T=["innerHTML"];var w=e({__name:"SiderList",props:{collapsed:{type:Boolean,default:!1}},setup(e){const w=e,U=s("state"),b=s("setCurrentSessionItem"),z=s("setSessionList"),B=s("setIsChangeSession"),K=s("setIsUpdateSession"),N=n(),j=n(""),D=n([]),E=n(!1);function J(){D.value=U.sessionList.filter((e=>e.name.includes(j.value)||!j.value));const e=D.value.find((e=>e.id===U.currentSessionId));e&&O(e)}function O(e){D.value.forEach((e=>e.__active=!1)),e.__active=!0,e.msgCount=0,b(e)}function R(e){const s=U.sessionList.map((s=>e.id===s.id?{...s,...e}:s));z(s),D.value=U.sessionList.filter((e=>D.value.find((s=>s.id===e.id))))}return async function(){var e;try{E.value=!0;const s=await k({username:U.userInfo.username,onlineType:1,readStatus:"Y",pageNum:1,pageSize:10,keyword:j.value.trim()});if(!(null==(e=null==s?void 0:s.list)?void 0:e.length))return;const n=null==s?void 0:s.list.map((e=>({...e,__name:e.name.slice(-2),__time:C(new Date(e.lastTime),"MM/dd HH:mm"),__lastContent:JSON.parse(e.lastContent||"{}").content||""})));D.value=n,z(n)}catch(e){console.log(e)}finally{E.value=!1}}(),t([()=>U.isChangeSession,()=>U.isUpdateSession],(([e,s])=>{e&&(R(U.currentSessionItem),B(!1)),s&&(R(U.updateSessionItem),K(!1))}),{immediate:!0}),t((()=>U.sessionList.length),(()=>{J()})),(e,s)=>(i(),a("section",L,[E.value?(i(),l(o(g),{key:0,stroke:"#5585f5"})):(i(),l(o(S),{key:1,placeholder:"输入用户名模糊搜索",value:j.value,"onUpdate:value":s[0]||(s[0]=e=>j.value=e),onKeyup:u(J,["enter"])},null,8,["value","onKeyup"])),r("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:N},[(i(!0),a(d,null,v(D.value,((e,s)=>(i(),a("div",{key:s,onClick:()=>O(e),class:c(["sider-list__box__item",{active:e.__active}])},[m(o(y),{round:"",size:"large"},{default:_((()=>[p(f(e.__name),1)])),_:2},1024),r("div",{class:c(["avatar-right",{hidden:w.collapsed}])},[r("div",x,[r("h4",null,f(e.name),1),r("span",null,f(e.__time),1)]),r("div",H,[r("div",M,[r("div",{innerHTML:e.__lastContent},null,8,T)]),m(o(h),{value:e.msgCount},null,8,["value"])])],2)],10,I)))),128))],512)]))}});export{w as default};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
|
+
export declare class ChatSock {
|
|
3
|
+
private stompClient;
|
|
4
|
+
private reconnectTimer;
|
|
5
|
+
private reconnectionCount;
|
|
6
|
+
private heartbeatTimer;
|
|
7
|
+
private options;
|
|
8
|
+
private url;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {String} url 请求地址
|
|
12
|
+
* @param {Object} options 配置项
|
|
13
|
+
* @param {Object} options.headers 请求头参数
|
|
14
|
+
* @param {Number} options.heartbeatRate 心跳频率
|
|
15
|
+
* @param {Function} options.heartbeatFn 心跳
|
|
16
|
+
* @param {Function} options.connectCb 连接成功
|
|
17
|
+
* @param {Function} options.errorCb 连接失败
|
|
18
|
+
* @param {Array} options.subscribeCbs 订阅列表
|
|
19
|
+
* @param {Number} options.reconnectMaxCount 重连最大次数
|
|
20
|
+
*/
|
|
21
|
+
constructor(url: string, options: AnyObject);
|
|
22
|
+
connection(): void;
|
|
23
|
+
disconnect(): void;
|
|
24
|
+
reconnect(): void;
|
|
25
|
+
subscribe(...args: any[]): any;
|
|
26
|
+
startHeartbeat(): void;
|
|
27
|
+
send(...args: any[]): any;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"stompjs";import i from"sockjs-client/dist/sockjs.min.js";class s{constructor(t,i){this.reconnectionCount=0,this.options={},this.url="",this.url=t,this.options=i,this.connection()}connection(){if(!this.url)return;const s=new i(this.url);this.stompClient=t.over(s),this.stompClient.connect(this.options.headers||{},(()=>{const{connectCb:t}=this.options;t&&t(this.reconnectionCount>0),this.startHeartbeat(),this.subscribe(this.options.subscribeCbs),this.reconnectionCount=0}),(t=>{const i=this.reconnectionCount,{errorCb:s,reconnectMaxCount:e=60}=this.options;s&&s(t,i),i<=e&&this.reconnect()}))}disconnect(){var t;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.reconnectTimer&&clearTimeout(this.reconnectTimer),null==(t=this.stompClient)||t.disconnect(),this.stompClient=void 0}reconnect(){this.reconnectionCount++,this.disconnect(),this.reconnectTimer=setTimeout((()=>{this.connection()}),1e3)}subscribe(...t){const i=this.stompClient;if(i){if(1!==t.length||!Array.isArray(t[0]))return 2===t.length?i.subscribe(...t):void 0;t[0].forEach((t=>{this.subscribe(t.action,t.cb)}))}}startHeartbeat(){const t=this.options.heartbeatFn;if(!t)return;const i=this.options.heartbeatRate||1e4;this.heartbeatTimer=setTimeout((()=>{t(),this.startHeartbeat()}),i)}send(...t){var i;return null==(i=this.stompClient)?void 0:i.send(...t)}}export{s as ChatSock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-multi-chat *{box-sizing:border-box}.c-multi-chat .n-avatar{background-color:#5585f5}.c-multi-chat .n-spin-body{margin:auto}.c-multi-chat .sider-list__box{margin-top:15px}.c-multi-chat .sider-list__box__item{background-color:#fff;border-bottom:1px solid #ebebeb;display:flex;padding:12px 5px}.c-multi-chat .sider-list__box__item.active,.c-multi-chat .sider-list__box__item:active,.c-multi-chat .sider-list__box__item:focus,.c-multi-chat .sider-list__box__item:hover{background-color:#ebebeb}.c-multi-chat .sider-list__box__item .avatar-right{flex:1;margin-left:10px}.c-multi-chat .sider-list__box__item .avatar-right.hidden{display:none}.c-multi-chat .sider-list__box__item .avatar-right .name{display:flex}.c-multi-chat .sider-list__box__item .avatar-right .name h4{flex:1}.c-multi-chat .sider-list__box__item .avatar-right .msg-tip{display:flex}.c-multi-chat .sider-list__box__item .avatar-right .msg-tip__content{flex:1;width:0}.c-multi-chat .sider-list__box__item .avatar-right .msg-tip__content>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.c-multi-chat .sider-list__box__item .avatar-right .msg-tip p,.c-multi-chat .sider-list__box__item .avatar-right .name span{color:#999}.c-multi-chat .chat-wrapper .n-layout-scroll-container{display:flex;flex-flow:column nowrap;overflow:hidden}.c-multi-chat .chat-header{height:60px;padding:0 10px}.c-multi-chat .chat-header,.c-multi-chat .chat-header__left{align-items:center;display:flex}.c-multi-chat .chat-header__left .name{margin-left:10px}.c-multi-chat .chat-main{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex:1;overflow-y:scroll;padding:0 10px}.c-multi-chat .chat-main::-webkit-scrollbar{width:5px}.c-multi-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.c-multi-chat .chat-main .message-item{margin-bottom:16px}.c-multi-chat .chat-main .message-item .time{color:#666;margin-bottom:16px;text-align:center}.c-multi-chat .chat-main .message-item .message-box{display:flex}.c-multi-chat .chat-main .message-item .message-box .content{background:#ebebeb;border-radius:8px;color:#000;font-size:14px;line-height:20px;margin:0;max-width:500px;padding:10px;text-align:left;word-break:break-word}.c-multi-chat .chat-main .message-item .message-box .content p{margin:0}.c-multi-chat .chat-main .message-item .message-box.left{justify-content:flex-start}.c-multi-chat .chat-main .message-item .message-box.left .content{border-top-left-radius:0;margin-left:10px}.c-multi-chat .chat-main .message-item .message-box.right{justify-content:flex-end}.c-multi-chat .chat-main .message-item .message-box.right .content{border-top-right-radius:0;margin-right:10px}.c-multi-chat .chat-footer{height:170px;position:relative}.c-multi-chat .chat-footer .input-box{cursor:text;height:114px;outline:none;overflow-x:hidden;overflow-y:scroll;padding:10px 16px;word-break:break-word}.c-multi-chat .chat-footer .input-box::-webkit-scrollbar{width:5px}.c-multi-chat .chat-footer .btn-box{align-items:center;bottom:0;display:flex;height:56px;justify-content:flex-end;padding-right:20px;position:absolute;right:0}.c-multi-chat .chat-footer .btn-box .tip{color:#a6a6a6;margin-right:20px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,toRefs as l,ref as n,watch as o,openBlock as s,createElementBlock as i,normalizeStyle as r,unref as a,normalizeClass as p,createElementVNode as d,Fragment as u,renderList as c,createCommentVNode as m,withDirectives as f,renderSlot as
|
|
1
|
+
import{defineComponent as e,computed as t,toRefs as l,ref as n,watch as o,openBlock as s,createElementBlock as i,normalizeStyle as r,unref as a,normalizeClass as p,createElementVNode as d,Fragment as u,renderList as c,createCommentVNode as m,withDirectives as f,renderSlot as h,toDisplayString as v,vShow as I,createBlock as g,withCtx as x,createVNode as y}from"vue";import{NTooltip as w,NEmpty as B}from"naive-ui";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import{defaultCssVars as T}from"./constants/index.js";const M={class:"stepBox"},b=["title"],k=["onMouseenter","onMouseleave"],_=["onMouseenter","onMouseleave"],C=["title"],R=["title"],N=["title"],$={key:0,style:{height:"48px"}},L={key:1},V={key:1};var j=e({__name:"StepsWheel",props:{stepInfo:{type:Object,default:()=>({list:[],cols:6})},currentStep:{type:Number,default:1},toolTipShow:{type:Boolean,default:!0},lastNodeRender:{type:Boolean,default:!1},nextNodeRender:{type:Boolean,default:!1},noDataMsg:{type:String,default:"暂无节点数据"},placement:{type:String,default:"center"}},setup(e){const j=e,D=S(T,"StepsWheel"),O=t((()=>Math.ceil(q.value.length/j.stepInfo.cols))),A=t((()=>j.lastNodeRender)),{noDataMsg:E,nextNodeRender:P}=l(j),W=n(null),F=t((()=>{var e;let t=72;if(null==(e=null==W?void 0:W.value)?void 0:e.length){let e=W.value[0],l=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;t=isNaN(parseInt(l["min-width"]))?72:parseInt(l["min-width"])}return`${20+j.stepInfo.cols*t}px`})),q=n([]),z=n([]),G=e=>{e.tipVisible=!0},H=e=>{e.tipVisible=!1},J=e=>{if(z.value.length){if(e.rowIndex===z.value.length)return!0;if(e.rowIndex<z.value.length)return z.value[e.rowIndex].some((e=>null==e?void 0:e.title))}return!1},K=e=>{const{list:t=[]}=j.stepInfo;return e.rowIndex%2==0&&"frist"==e.nodeType&&e.nodeIndex!==t.length},Q=e=>{const{list:t=[]}=j.stepInfo;return e.rowIndex%2!=0&&"last"==e.nodeType&&e.nodeIndex!==t.length},U=(e,t)=>P.value?e.rowIndex%2==0?j.currentStep>=t+(j.stepInfo.cols-2*e.sort)-1:j.currentStep>=t+1:e.rowIndex%2==0?j.currentStep>=t+(j.stepInfo.cols-2*e.sort):j.currentStep>=t+2,X=(e,t)=>{let l=e.length,n=l%t==0?l/t:Math.floor(l/t+1),o=[];for(let l=0;l<n;l++){let n=e.slice(l*t,l*t+t);o.push(n)}return o},Y=e=>{const{cols:t}=j.stepInfo;let l=X(q.value,t),n=l[l.length-1].filter((e=>e));return O.value%2==0?e!=n[n.length-1].nodeIndex-(t-2*n[n.length-1].sort):e!=n[n.length-1].nodeIndex-1},Z=e=>{const{cols:t}=j.stepInfo;let l=X(q.value,t),n=l[l.length-1].filter((e=>e));return O.value%2==0?A.value&&e==n[0].nodeIndex-(t-2*n[0].sort):A.value&&e==n[n.length-1].nodeIndex-1},ee=(e,t)=>{const{cols:l}=j.stepInfo;let n=X(q.value,l),o=n[n.length-1].filter((e=>e));return O.value%2==0?"circle"===t?A.value&&e==o[0].nodeIndex-(l-2*o[0].sort)-l:A.value&&e==o[0].nodeIndex-(l-2*o[0].sort):"circle"===t?A.value&&e==o[o.length-1].nodeIndex-1-l:A.value&&e==o[o.length-1].nodeIndex-2};return o((()=>j.stepInfo),(e=>{var t;(null==(t=null==e?void 0:e.list)?void 0:t.length)&&((e,t)=>{let l=e.length+1,n=Math.ceil(e.length/t),o=!0,s=[];for(var i=0;i<n;i++)s[i]=new Array(t),s[i].fill(null);let r=0,a=0;for(let n=1;n<l;n++)s[r][a]=Object.assign(e[n-1],{nodeIndex:n,rowIndex:r+1}),o?n%t!=0?a++:(o=!o,r++):n%t!=0?a--:(o=!o,r++);let p=[];s.map((e=>{e.map(((e,t)=>{e&&(e.sort=t,!e.hasOwnProperty("tipVisible")&&(e.tipVisible=!1))})),e[0]&&(e[0].nodeType="frist"),e[e.length-1]&&(e[e.length-1].nodeType="last"),p=[...p,...e]})),q.value=p,z.value=s})(e.list,e.cols)}),{immediate:!0,deep:!0}),(t,l)=>(s(),i("div",{class:"step-wheel-box",style:r({minWidth:a(F),...a(D)})},[q.value.length?(s(),i("div",{key:0,class:p(["stepOut",{placementLeft:"left"===e.placement,placementRight:"right"===e.placement}])},[d("ul",M,[(s(!0),i(u,null,c(q.value,((l,n)=>(s(),i("li",{ref_for:!0,ref_key:"stepItemRef",ref:W,key:(null==l?void 0:l.stepId)||n,class:p(["stepItem",{[`stepItem_${n+1}`]:!0,[`${null==l?void 0:l.stepId}`]:!!(null==l?void 0:l.stepId)}])},[l?(s(),i(u,{key:0},[m(" 步骤头部信息 "),f(d("div",{class:p(["stepTopBox",{activeTitle:e.currentStep>=l.nodeIndex,finished:Z(n),stepTopBox_right:"right"===e.placement,stepTopBox_left:"left"===e.placement}])},[h(t.$slots,"stepTopBox",{stepItem:l},(()=>[d("span",{title:l.title},v(l.title),9,b)]))],2),[[I,l.title]]),m(" 步骤条的节点,此处为圆圈 "),e.toolTipShow&&l.tipShow?(s(),g(a(w),{key:0,placement:"top",delay:0,"show-arrow":!0,show:l.tipVisible,trigger:"manual",style:r({opacity:"0.88"}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},{trigger:x((()=>[d("div",{class:p(["icon",{active:e.currentStep>=l.nodeIndex,finished:Z(n)}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},null,42,k)])),default:x((()=>[h(t.$slots,"nodeTipBox",{stepItem:l,stepId:l.stepId})])),_:2},1032,["show","style","onMouseenter","onMouseleave"])):(s(),i("div",{key:1,class:p(["icon",{active:e.currentStep>=l.nodeIndex,finished:Z(n)}])},null,2)),m(" 步骤条连接线,动态显示 "),"last"!==l.nodeType?f((s(),i("div",{key:2,class:p(["line",{lineActive:U(l,n),finished:ee(n)}])},null,2)),[[I,Y(n)]]):m("v-if",!0),m(" 步骤条弯曲连线,动态渲染 "),K(l)||Q(l)?(s(),i("div",{key:3,class:p({lineCircleActive:a(P)?e.currentStep>=l.nodeIndex:e.currentStep>l.nodeIndex,lineCircleFinished:ee(n,"circle"),lineCircleRight:Q(l),lineCircleLeft:K(l),lineCirclePlacementRight:Q(l)&&"right"===e.placement,lineCirclePlacementLeft:K(l)&&"left"===e.placement})},null,2)):m("v-if",!0),m(" 步骤底部信息 "),d("div",{class:p(["stepBottomBox",{stepBottomBox_right:"right"===e.placement,stepBottomBox_left:"left"===e.placement}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},[h(t.$slots,"stepBottomBox",{stepItem:l},(()=>[m(" 步骤名称 "),f(d("p",{class:p(["stepLabel",{labelFinsh:Z(n),stepLabel_right:"right"===e.placement,stepLabel_left:"left"===e.placement}]),title:l.label},v(l.label),11,C),[[I,l.label]]),d("div",{class:p({stepBottomCustomBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement})},[h(t.$slots,"stepBottomCustomBox",{stepItem:l},(()=>[d("div",{class:p({stepBottomDefaultBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement}),style:{width:"100%",display:"flex",flexDirection:"column"}},[f(d("p",{class:"stepExtra",title:l.person},v(l.person),9,R),[[I,l.person]]),m(" 步骤时间 "),f(d("p",{class:"statusTime",title:l.statusTime},v(l.statusTime),9,N),[[I,l.statusTime]])],2)]))],2)])),J(l)?(s(),i("div",$)):m("v-if",!0)],42,_)],64)):(s(),i("div",L,[m("null元素占位")]))],2)))),128))])],2)):(s(),i("div",V,[y(a(B),{description:a(E)},null,8,["description"])]))],4))}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.47-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.47-beta.8",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.47-beta.8",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.47-beta.
|
|
3
|
+
"version": "3.1.47-beta.8",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -42,8 +42,10 @@
|
|
|
42
42
|
"min-dom": "^3.2.1",
|
|
43
43
|
"moment": "^2.29.1",
|
|
44
44
|
"naive-ui": "^2.30.0",
|
|
45
|
+
"sockjs-client": "^1.6.1",
|
|
45
46
|
"sortablejs": "^1.15.0",
|
|
46
47
|
"spark-md5": "^3.0.2",
|
|
48
|
+
"stompjs": "^2.3.3",
|
|
47
49
|
"tiny-svg": "^2.2.4",
|
|
48
50
|
"v-viewer": "^3.0.10",
|
|
49
51
|
"video.js": "^7.19.2",
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
"iOS 7",
|
|
62
64
|
"last 3 iOS versions"
|
|
63
65
|
],
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9e4f58e9bb744091947572878573e3e9303831a4"
|
|
65
67
|
}
|