im/public/assets/js/app.fa70b70c.js

1 line
156 KiB
JavaScript
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){var e={7292:function(e,t,s){"use strict";s.d(t,{Z:function(){return x}});var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"chat-main"},[t("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入关键字搜索聊天"},model:{value:e.params.keywords,callback:function(t){e.$set(e.params,"keywords",t)},expression:"params.keywords"}},[t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.searchMessage},slot:"append"})],1),t("el-tabs",{on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{attrs:{label:"全部",name:"all"}},[t("div",{staticClass:"el-tab-body-list"},[t("el-scrollbar",[e.dataList.length?e._l(e.dataList,(function(e,s){return t("ChatItem",{key:s,attrs:{data:e}})})):t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1)],2)],1)]),t("el-tab-pane",{attrs:{label:"文本",name:"text"}},[t("div",{staticClass:"el-tab-body-list"},[e.dataList.length?[t("el-scrollbar",e._l(e.dataList,(function(e,s){return t("ChatItem",{key:s,attrs:{data:e}})})),1)]:t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1)],2)]),t("el-tab-pane",{attrs:{label:"图片",name:"image"}},[t("div",{staticClass:"el-tab-body-list"},[e.dataList.length?[t("el-scrollbar",[t("el-row",{staticStyle:{}},e._l(e.dataList,(function(s,a){return t("ChatImage",{key:a,attrs:{data:s,previewUrl:e.previewList}})})),1)],1)]:t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1)],2)]),t("el-tab-pane",{attrs:{label:"视频",name:"video"}},[t("div",{staticClass:"el-tab-body-list"},[e.dataList.length?[t("el-scrollbar",e._l(e.dataList,(function(e,s){return t("ChatItem",{key:s,attrs:{data:e}})})),1)]:t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1)],2)]),t("el-tab-pane",{attrs:{label:"文件",name:"file"}},[t("div",{staticClass:"el-tab-body-list"},[e.dataList.length?[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataList,height:"450"}},[t("el-table-column",{attrs:{prop:"fileName",label:"文件",width:"300"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("div",{staticClass:"chat-file"},[t("div",[t("el-image",{staticClass:"fileExt",attrs:{fit:"cover",src:e.fileExt(s.row.fileName)}})],1),t("div",{staticClass:"fileName"},[e._v(e._s(s.row.fileName))])])]}}],null,!1,1885044645)}),t("el-table-column",{attrs:{prop:"sendTime",label:"上传时间",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.formatTime(t.row.sendTime))+" ")]}}],null,!1,349674723)}),t("el-table-column",{attrs:{prop:"fileSize",label:"大小",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.fileSize(t.row.fileSize))+" ")]}}],null,!1,3523241436)}),t("el-table-column",{attrs:{prop:"fromUser.realname",label:"上传者",width:"100"}}),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.downloadFile(s.row)}}},[e._v("下载")])]}}],null,!1,2401469366)})],1)]:t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1)],2)])],1),t("el-pagination",{attrs:{background:"","hide-on-single-page":e.singlePage,"page-size":e.params.limit,"current-page":e.params.page,layout:"prev, pager, next",total:e.total},on:{"update:pageSize":function(t){return e.$set(e.params,"limit",t)},"update:page-size":function(t){return e.$set(e.params,"limit",t)},"update:currentPage":function(t){return e.$set(e.params,"page",t)},"update:current-page":function(t){return e.$set(e.params,"page",t)},"current-change":e.handleCurrentChange}})],1)},i=[],n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"chat-list-item"},[t("div",{staticClass:"chat-list-avatar",on:{click:function(t){return e.$user(e.data.fromUser.id)}}},[t("el-avatar",{attrs:{shape:"square",size:"medium",src:e.data.fromUser.avatar}})],1),t("div",{staticClass:"chat-list-body"},[t("div",{staticClass:"chat-list-title"},[e._v(" "+e._s(e.data.fromUser.realname)+" "),t("span",{staticClass:"time"},[e._v(" "+e._s(e.formatTime(e.data.sendTime)))])]),"text"==e.data.type?t("div",{staticClass:"chat-list-text",domProps:{innerHTML:e._s(e.data.content)}}):e._e(),"text"==e.data.type?t("div",{staticClass:"chat-list-tools"},[t("el-tooltip",{attrs:{effect:"dark",content:"复制文本",placement:"top"}},[t("i",{staticClass:"el-icon-document-copy",on:{click:function(t){return e.copyText(e.data.content)}}})])],1):e._e(),"image"==e.data.type?t("div",{staticClass:"chat-list-image"},[t("el-image",{staticStyle:{"max-width":"300px"},attrs:{src:e.data.content,"z-index":3e3,"preview-src-list":[e.data.content],fit:"contain"}})],1):e._e(),"video"==e.data.type?t("div",{staticClass:"chat-list-video"},[t("video",{staticStyle:{"max-width":"300px"},attrs:{src:e.data.content,controls:""}})]):e._e(),"file"==e.data.type?t("div",{staticClass:"chat-list-file"},[t("el-card",{staticStyle:{width:"260px"},attrs:{"body-style":{padding:"10px 10px 0 10px"}}},[t("div",{staticClass:"chat-file-content"},[t("div",{staticClass:"chat-file-ext"},[t("el-image",{staticStyle:{width:"35px"},attrs:{src:e.fileExt(e.data.fileName),fit:"fill"}})],1),t("div",{staticClass:"chat-file-title"},[t("div",{staticClass:"chat-file-name"},[t("span",{staticClass:"fileName"},[e._v(e._s(e.data.fileName)+" ")]),t("span",{staticClass:"fileSize"},[e._v("("+e._s(e.fileSize(e.data.fileSize))+")")])]),t("div",{staticClass:"chat-file-remark"},[e._v(" 文件已成功发送, 文件助手永久保存 ")])])]),t("hr"),t("div",{staticClass:"bottom clearfix",attrs:{align:"right"}},[t("el-button",{staticClass:"button",attrs:{type:"text"},on:{click:function(t){return e.downloadFile(e.data)}}},[e._v("下载")]),t("el-button",{staticClass:"button",attrs:{type:"text"},on:{click:function(t){return e.onlinePreview(e.data)}}},[e._v("在线预览")])],1)])],1):e._e()])])},o=[],r=s(2325),l=s(3817),c={name:"chatItem",props:{data:{type:Object,default:{}}},computed:{formatTime(){return function(e){return e=parseInt(e/1e3),(0,r.hT)("Y/m/d H:i:s",e)}},fileSize(){return function(e){return(0,l.hR)(e)}},fileExt(){return function(e){return(0,l.AC)(e)}}},data(){return{}},methods:{copyText(e){this.$clipboard(e),this.$message({type:"success",message:"复制成功!"})},onlinePreview(e){this.$preview(e.preview)},downloadFile(e){(0,l.LR)(e.content,e.fileName)}},created(){}},d=c,u=s(1001),p=(0,u.Z)(d,n,o,!1,null,"294ef229",null),m=p.exports,h=function(){var e=this,t=e._self._c;return t("div",[t("el-col",{staticStyle:{padding:"0 12px 12px 0"},attrs:{span:6}},["image"==e.data.type?t("el-card",{attrs:{"body-style":{padding:"0px"}}},[t("el-image",{staticStyle:{width:"100%",height:"120px"},attrs:{src:e.data.content,"preview-src-list":e.previewUrl,"z-index":9999,fit:"cover"}}),t("div",{staticStyle:{padding:"10px"}},[t("div",{staticClass:"bottom clearfix"},[t("time",{staticClass:"time"},[e._v(e._s(e.data.fromUser.realname)+" 上传于 "+e._s(e.formatTime(e.data.sendTime)))])])])],1):e._e()],1)],1)},g=[],f={name:"chatImage",props:{data:{type:Object,default:{}},previewUrl:{type:Array,default:function(){return[]}}},computed:{formatTime(){return function(e){return e=parseInt(e/1e3),(0,r.hT)("Y/m/d",e)}},fileSize(){return function(e){return(0,l.hR)(e)}},fileExt(){return function(e){return(0,l.AC)(e)}}},data(){return{currentDate:new Date}},methods:{copyText(e){this.$clipboard(e),this.$message({type:"success",message:"复制成功!"})},downloadFile(e){(0,l.LR)(e.content,e.fileName)}},created(){}},v=f,b=(0,u.Z)(v,h,g,!1,null,"94e9276a",null),_=b.exports,C={name:"chatRecord",components:{ChatItem:m,ChatImage:_},props:{contact:{type:Object,default:{}}},computed:{formatTime(){return function(e){return e/=1e3,(0,r.hT)("Y/m/d H:i:s",e)}},fileSize(){return function(e){return(0,l.hR)(e)}},fileExt(){return function(e){return(0,l.AC)(e)}}},data(){return{activeName:"all",total:0,singlePage:!1,dataList:[],previewList:[],params:{toContactId:this.contact.id,is_group:this.contact.is_group,type:"all",keywords:"",page:1,limit:20}}},methods:{handleClick(e,t){this.params.page=1,this.params.type=e.name,this.getMessage()},searchMessage(){this.getMessage()},getMessage(){this.$api.imApi.getMessageListAPI(this.params).then((e=>{this.dataList=e.data,this.total=e.count,e.count<=this.params.limit?this.singlePage=!0:this.singlePage=!1,"image"==this.params.type&&(this.previewList=(0,r.Nj)(e.data,"content",!1))})).catch((e=>{console.log(e)}))},handleCurrentChange(e){this.params.page=e,this.getMessage()},downloadFile(e){(0,l.LR)(e.content,e.fileName,e.type)}},created(){this.getMessage()},mounted(){}},y=C,w=(0,u.Z)(y,a,i,!1,null,"7b6994c6",null),x=w.exports},6038:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.title,visible:e.visible,modal:!0,width:e.width,"append-to-body":""},on:{close:e.closeDialog}},[t("el-transfer",{attrs:{filterable:"",titles:e.createChatTitles,"filter-placeholder":"请输入关键词",props:e.contactsProps,data:e.allUser},model:{value:e.selectUid,callback:function(t){e.selectUid=t},expression:"selectUid"}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.comfirmChat}},[e._v("确 定")])],1)],1)},i=[],n={name:"manageGroup",props:{title:{type:String,default:"选择聊天"},visible:{type:Boolean,default:!1},width:{type:String,default:"612px"},allUser:{type:Array,default:()=>[]}},data(){return{createChatTitles:["用户列表","已选用户"],selectUid:[],contactsProps:{key:"id",label:"realname"}}},mounted(){},methods:{closeDialog(){this.$emit("update:visible",!1),this.selectUid=[]},comfirmChat(){0!==this.selectUid.length?this.$emit("selectChat",this.selectUid):this.$message.error("请选择聊天对象")}}},o=n,r=s(1001),l=(0,r.Z)(o,a,i,!1,null,null,null),c=l.exports},3007:function(e,t,s){"use strict";s.d(t,{Z:function(){return p}});var a=function(){var e=this,t=e._self._c;return t("el-container",{staticStyle:{height:"100%"}},[t("el-header",{staticClass:"file-header"},[t("div",{staticClass:"file-header-title"},[e._v("文件列表")]),t("div",{staticClass:"file-header-search"},[t("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入关键字搜索","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getFileList.apply(null,arguments)}},model:{value:e.params.keywords,callback:function(t){e.$set(e.params,"keywords",t)},expression:"params.keywords"}},[t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.getFileList},slot:"append"})],1)],1)]),t("el-container",[t("el-aside",{staticClass:"lz-flex group-box",attrs:{width:"150px"}},[t("div",{staticClass:"group-box-list"},e._l(e.fileType,(function(s){return t("div",{key:s.id,staticClass:"chat-item",class:e.params.cate==s.id?"active":"",on:{click:function(t){return e.openFolder(s)}}},[e._v(" "+e._s(s.name)+" ")])})),0)]),t("el-main",{staticClass:"lz-flex group-box group-user-box no-padding"},[e.fileList.length?t("div",{staticClass:"group-box-list"},[t("el-scrollbar",[t("div",{staticClass:"file-list"},e._l(e.fileList,(function(s,a){return t("el-tooltip",{key:a,staticClass:"item",attrs:{effect:"dark",placement:"right"}},[t("template",{slot:"content"},[t("p",{staticClass:"mb-5"},[e._v("名称:"+e._s(s.name))]),t("p",[e._v("大小:"+e._s(e.getFileSize(s.size)))])]),t("div",{staticClass:"file-item",on:{dblclick:function(t){return e.openFile(s.preview)}}},[t("div",{staticClass:"file-img"},[t("el-image",{staticClass:"img",attrs:{fit:"contain",src:s.extUrl}})],1),t("div",{staticClass:"file-name mt-5",attrs:{align:"center"}},[e._v(e._s(s.name))]),t("div",{staticClass:"file-opt"},[t("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return t.stopPropagation(),e.openFile(s.preview)}}},[e._v("查看")]),t("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return t.stopPropagation(),e.downloadFile(s)}}},[e._v("下载")]),t("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return t.stopPropagation(),e.openDialog(s)}}},[e._v("发送")])],1)])],2)})),1)])],1):t("div",{staticClass:"pd-40"},[t("el-empty")],1),e.singlePage?e._e():t("div",{staticClass:"group-box-page",attrs:{align:"center"}},[t("el-pagination",{attrs:{background:"","hide-on-single-page":e.singlePage,"current-page":e.params.page,"page-sizes":[20,50,100,200,300,400,500],"page-size":e.params.limit,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleChange,"current-change":e.getFileList,"update:currentPage":function(t){return e.$set(e.params,"page",t)},"update:current-page":function(t){return e.$set(e.params,"page",t)},"update:pageSize":function(t){return e.$set(e.params,"limit",t)},"update:page-size":function(t){return e.$set(e.params,"limit",t)}}})],1),t("ChooseDialog",{attrs:{visible:e.visible,title:"发送到聊天",allUser:e.$store.state.allContacts},on:{"update:visible":function(t){e.visible=t},selectChat:e.sendChat}})],1)],1)],1)},i=[],n=(s(7658),s(6038)),o=s(3817),r=s(2325),l={components:{ChooseDialog:n.Z},props:{isAll:{type:Number,default:0}},computed:{getFileSize(){return function(e){return o.hR(e)}}},data(){return{params:{page:1,limit:20,keywords:"",cate:0,is_all:this.isAll,role:0},visible:!1,singlePage:!0,total:0,curFile:{},fileType:[{id:0,name:"所有文件",icon:""},{id:1,name:"文档",icon:""},{id:2,name:"图片",icon:""},{id:3,name:"音频",icon:""},{id:4,name:"视频",icon:""},{id:5,name:"其他文件",icon:""}],fileList:[]}},mounted(){this.getFileList()},methods:{changeRole(e){this.params.role=e,this.getFileList()},openFolder(e){this.params.cate=e.id,this.getFileList()},getFileList(){this.$api.imApi.getFileList(this.params).then((e=>{0==e.code&&(this.fileList=e.data,this.total=e.count,this.singlePage=e.count<=this.params.limit,this.params.page=e.page)}))},handleChange(e){this.params.limit=e,this.getFileList()},openFile(e){e?this.$preview(e):this.$message.error("文件不存在")},downloadFile(e){e.download&&(window.location=e.download)},openDialog(e){this.visible=!0,this.curFile=e},sendChat(e){if(e.length>5)return this.$message.error("转发的人数不能超过5人");let t=this.$store.state.userInfo;this.forwardBox=!1;let s={type:this.curFile.msg_type,content:this.curFile.src,file_name:this.curFile.name,file_size:this.curFile.size,fromUser:{id:t.user_id,displayName:t.realname,avatar:t.avatar,account:t.account}};var a=[];e.forEach((e=>{let t=e.toString(),i=JSON.parse(JSON.stringify(s));i.id=r.NW(),i.status="successd",i.sendTime=(new Date).getTime(),i.toContactId=t,i.is_group=0,-1!=t.indexOf("group")&&(i.is_group=1),a.push(this.test(i))})),Promise.all(a).then((e=>{})).catch((e=>{console.log("error",e)})),this.$message.success("发送成功!"),this.visible=!1},fn(e){return new Promise(((t,s)=>{this.$api.imApi.sendMessageAPI(e).then((e=>{0===e.code?t(e):this.$message.error(e.msg)})).catch((e=>{}))}))},async test(e){let t=await this.fn(e);return t}}},c=l,d=s(1001),u=(0,d.Z)(c,a,i,!1,null,"2caf8634",null),p=u.exports},284:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.title,visible:e.visible,modal:!0,width:e.width,"append-to-body":""},on:{open:e.openDialog,close:e.closeDialog}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.isAdd,expression:"isAdd"}],staticClass:"mb-20"},[e._v(" 群聊名称:"),t("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入群聊名称"},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}}),e._v(" "),t("span",{staticClass:"ml-10 c-999"},[e._v(" (必填项)")])],1),t("el-transfer",{attrs:{filterable:"",titles:e.createChatTitles,"filter-placeholder":"请输入关键词",props:e.defaultProps,data:e.allUser},model:{value:e.selectUid,callback:function(t){e.selectUid=t},expression:"selectUid"}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.manageGroup}},[e._v("确 定")])],1)],1)},i=[],n={name:"manageGroup",props:{title:{type:String,default:"创建群聊"},visible:{type:Boolean,default:!1},userIds:{type:Array,default:()=>[]},isAdd:{type:Number,default:0},width:{type:String,default:"612px"},groupId:{type:String,default:""}},data(){return{createChatTitles:["用户列表","已选用户"],selectUid:[],allUser:[],groupName:"",defaultProps:{key:"user_id",label:"realname",pinyin:"name_py"}}},mounted(){},methods:{openDialog(){let e={};this.userIds.length>0&&(e.user_ids=this.userIds),this.groupId&&2==this.isAdd&&(e.group_id=this.groupId),this.getAllUser(e)},closeDialog(){this.$emit("update:visible",!1),this.selectUid=[]},manageGroup(){switch(this.isAdd){case 0:if(this.selectUid.length<1)return void this.$message.error("请选择要添加的成员");break;case 1:if(this.selectUid.length<2)return void this.$message.error("群聊人数不能少于2人");if(""==this.groupName||this.groupName.length<2||this.groupName.length>20)return void this.$message.error("请输入正确的群聊名称");break;case 2:if(1!=this.selectUid.length)return void this.$message.error("只能选择一位成员!");break}this.$emit("manageGroup",this.selectUid,this.isAdd,this.groupName)},getAllUser(e){this.$api.imApi.getAllUserAPI(e).then((e=>{const t=e.data;this.allUser=t}))}}},o=n,r=s(1001),l=(0,r.Z)(o,a,i,!1,null,null,null),c=l.exports},499:function(e,t,s){"use strict";var a=s(3032),i=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},n=[],o=(s(7658),s(4462)),r=s.n(o),l={name:"App",data(){return{msg:"Welcome to Your Vue.js App"}},created(){let e=r().get("UserInfo"),t=r().get("globalConfig");t&&(document.title=t.sysInfo.name,this.$store.commit("setGlobalConfig",t)),e&&this.$store.commit("SET_USERINFO",e),this.$store.dispatch("getSystemInfo").then((e=>{0!=e.data.sysInfo.state||this.$router.push({path:"/404",query:{msg:e.data.sysInfo.closeTips}})}))},watch:{"$store.state.globalConfig"(e){document.title=e.sysInfo.name}}},c=l,d=s(1001),u=(0,d.Z)(c,i,n,!1,null,null,null),p=u.exports,m=s(8499),h=s.n(m),g=function(){var e=this,t=e._self._c;return t("div",{staticClass:"user-card-box"},[t("el-container",{directives:[{name:"outside",rawName:"v-outside",value:e.closeDialog,expression:"closeDialog"}],staticClass:"container"},[t("el-header",{staticClass:"no-padding header",attrs:{height:"180px"}},[t("i",{staticClass:"close el-icon-error cur-handle",on:{click:e.closeDialog}}),t("div",{staticClass:"img-banner"}),t("div",{staticClass:"user-header"},[t("div",{staticClass:"avatar"},[t("div",{staticClass:"avatar-box"},[t("img",{attrs:{src:e.detail.avatar}})])]),t("div",{staticClass:"username"},[t("i",{staticClass:"iconfont icon-qianming"}),t("span",[e._v(e._s(e.detail.realname||"未设置昵称"))])])])]),t("el-main",{staticClass:"no-padding main"},[t("div",{staticClass:"user-sign"},[t("div",{staticClass:"sign-arrow"}),t("i",{staticClass:"iconfont icon-bianji"}),t("span",[e._v(e._s(e.detail.motto||"这家伙有点懒,什么都没留下!")+" ")])]),t("div",{staticClass:"card-rows no-select"},[t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v("账号")]),t("div",[e._v(e._s(e.detail.account))])]),t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v(e._s(2==e.globalConfig.sysInfo.runMode?"昵称":"姓名"))]),t("div",[e._v(e._s(e.detail.realname))])]),e.detail.friend&&2==e.globalConfig.sysInfo.runMode?t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v("备注")]),t("div",[e._v(e._s(e.detail.friend.nickname||"未设置")+" "),t("i",{staticClass:"el-icon-edit ml-10",attrs:{title:"设置备注"},on:{click:e.setNickname}})])]):e._e(),t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v("性别")]),t("div",[e._v(e._s(e._f("sex")(e.detail.sex)))])]),t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v("邮箱")]),t("div",[e._v(e._s(e.detail.email||"未设置"))])]),parseInt(e.globalConfig.sysInfo.ipregion)&&e.isFriend?t("div",{staticClass:"card-row"},[t("div",{staticClass:"label"},[e._v("IP")]),e.detail.last_login_ip?t("div",[e._v(e._s(e.detail.last_login_ip||"未知")+" "+e._s(e.detail.location||"未知")+"")]):t("div",[e._v("未知")])]):e._e()])]),t("el-footer",{staticClass:"footer"},[e.isFriend?t("el-button",{staticStyle:{width:"150px"},attrs:{type:"primary",round:""},on:{click:function(t){return e.openChat()}}},[e._v("发消息")]):e._e(),2!=e.globalConfig.sysInfo.runMode||e.detail.friend?e._e():t("el-button",{staticStyle:{width:"150px"},attrs:{type:"primary",round:""},on:{click:function(t){return e.addFriend()}}},[e._v("加好友")]),e.options.isManage?t("el-button",{staticStyle:{width:"150px"},attrs:{round:""},on:{click:e.editUser}},[e._v("编辑资料")]):e._e()],1)],1)],1)},f=[],v=s(3822),b={name:"UserCard",props:{user_id:{type:[Number,String],default:0},options:{type:Object,default:()=>({isManage:!1})}},computed:{...(0,v.rn)({userInfo:e=>e.userInfo,globalConfig:e=>e.globalConfig}),isFriend(){return this.userInfo.user_id!=this.detail.user_id&&(this.detail.friend||1==this.globalConfig.sysInfo.runMode)}},filters:{sex(e){let t=["女","男","未知"];return t[e]||"未知"}},data(){return{detail:{}}},mounted(){this.getUserDetal()},methods:{closeDialog(){this.$emit("close")},getUserDetal(){this.$api.imApi.getUserInfo({user_id:this.user_id}).then((e=>{0==e.code&&(this.detail=e.data)}))},openChat(){this.closeDialog(),this.$store.commit("openChat",this.detail.user_id)},editUser(){this.$emit("editUser",this.detail)},addFriend(){this.closeDialog(),this.$prompt("请填写验证信息,让朋友知道你!","添加好友",{confirmButtonText:"确定",cancelButtonText:"取消"}).then((({value:e})=>{if(!e)return this.$message.error("请输入验证信息"),!1;this.$api.friendApi.addFriend({user_id:this.detail.user_id,remark:e}).then((e=>{0==e.code&&this.$message.success("已发送好友申请")}))})).catch((e=>{this.$message({type:"warning",message:e})}))},setNickname(){let e=this.detail.friend.friend_id??"";if(!this.detail.friend)return this.$message.error("该用户不是您的好友"),!1;this.closeDialog();let t=this.detail.friend.nickname?this.detail.friend.nickname:this.detail.realname;this.$prompt("请填写备注信息","设置备注",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:t}).then((({value:t})=>{if(!t)return this.$message.error("请输入备注信息"),!1;this.$api.friendApi.setNickname({friend_id:e,nickname:t}).then((e=>{0==e.code&&(this.$message.success("设置成功"),this.detail.realname=t)}))})).catch((()=>{}))}}},_=b,C=(0,d.Z)(_,g,f,!1,null,"3d16bd89",null),y=C.exports,w={install(e){function t(t,s){let a=this;const i=new e({router:a.$router,store:a.$store,render(e){return e(y,{on:{close:()=>{i.$destroy(),document.body.removeChild(i.$el)},editUser:e=>{s.editDataCallbak&&s.editDataCallbak(e),i.$destroy(),document.body.removeChild(i.$el)}},props:{user_id:t,options:s}})}}).$mount();document.body.appendChild(i.$el)}e.prototype.$user=t}},x=function(){var e=this,t=e._self._c;return t("div",[t("transition",{attrs:{name:"fade-user"}},[t("div",{staticClass:"previewBox"},[t("el-button",{staticClass:"drawer-close",attrs:{type:"danger",icon:"el-icon-close",circle:""},on:{click:e.closeDrawer}}),t("iframe",{attrs:{src:e.url,frameborder:"0",width:"100%",height:"100%"}})],1)])],1)},k=[],I={name:"preview",props:{url:{type:String,default:""}},data(){return{}},methods:{closeDrawer(){this.$emit("close")}}},$=I,S=(0,d.Z)($,x,k,!1,null,"022a2c23",null),T=S.exports,A={install(e){function t(t,s){let a=this;const i=new e({router:a.$router,store:a.$store,render(e){return e(T,{on:{close:()=>{i.$destroy(),document.body.removeChild(i.$el)}},props:{url:t,options:s}})}}).$mount();document.body.appendChild(i.$el)}e.prototype.$preview=t}},M=s(7002),U=s.n(M),N=s(2631),P=function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-container"},[t("div",{staticClass:"im-title"},[t("div",{staticClass:"logo"},[t("el-image",{staticStyle:{width:"80px",height:"80px"},attrs:{src:e.$packageData.logo,fit:"cover"}})],1),t("div",{staticClass:"im-content"},[t("div",{staticClass:"im-name"},[t("div",{staticClass:"text f-36"},[e._v(e._s(e.$packageData.name))]),t("div",{staticClass:"version ml-5"},[t("el-tag",{attrs:{size:"mini",type:"primary",effect:"plain"}},[e._v("v"+e._s(e.$packageData.version))])],1)]),t("div",{staticClass:"im-des"},[e._v(e._s(e.$packageData.description))])])]),t("div",{staticClass:"code-url"},[t("div",{staticClass:"ml-15 mb-15"},[e._v(" 前端地址: "),t("a",{attrs:{href:e.$packageData.frontUrl,target:"_blank"}},[t("el-image",{attrs:{src:e.$packageData.frontUrl+"/badge/star.svg?theme=white",alt:"star"}})],1)]),t("div",{staticClass:"ml-15 mb-15"},[e._v(" 后端地址:"),t("a",{attrs:{href:e.$packageData.backstageUrl,target:"_blank"}},[t("el-image",{attrs:{src:e.$packageData.backstageUrl+"/badge/star.svg?theme=dark",alt:"star"}})],1)]),t("div",{staticClass:"ml-15 mb-15"},[t("el-button",{attrs:{type:"warning",plain:"",size:"mini",round:""}},[t("a",{attrs:{href:e.$packageData.qqGroupUrl,target:"_blank"}},[e._v("QQ交流群:336921267")])])],1)]),t("el-alert",{staticClass:"mt-15 mb-15",attrs:{"show-icon":"",title:"请仔细阅读一下文档webrtc一对一音视频通话需要自己搭建turn服务器本文底部有搭建链接。",type:"info"}}),t("el-alert",{staticClass:"mt-15 mb-15",attrs:{"show-icon":"",title:"请注意3.0 以上版本改了很多内容不兼容之前的版本旧版本无法升级如需使用只能全部替换3.0版本。",type:"error"}}),t("div",{staticClass:"tip"},[e._m(0),t("p",[e._v(" 1、"+e._s(e.$packageData.name)+"是一个"),t("b",{staticClass:"c-red"},[e._v("开源的即时通信demo主要用于学习交流为大家提供即时通讯的开发思路")]),e._v("许多功能需要自行开发开发的初衷旨在快速建立企业内部通讯系统、内网交流、社区交流。不建议用于商业用途如确有需要商用请联系作者授权自行开发代码量必须要高于原代码量的30%以上,并注明相关的版权问题。 ")]),t("p",[e._v(" 2、支持发送表情、图片、语音、视频和文件消息支持单聊、群聊、群管理、1对1音视频通话移动端目前仅支持H5和安卓APPIOS没条件测试具体功能可以看项目主页。 ")]),t("p",[e._v(" 3、目前仅开源了网页端(vue2+lemon-imui+element-ui)和后台接口TP6+workerman可以用于对接企业应用等内部聊天内网私有聊天室,社区聊天等等。 ")]),t("p",[e._v(" 4、移动端uniapp开发支持H5+APP"),t("b",{staticClass:"c-red"},[e._v("代码未开源")]),e._v("和web功能几乎无差异如有需要"),t("b",{staticClass:"c-red cur-handle",on:{click:function(t){return e.scrollTo()}}},[e._v("请查看底部说明 "),t("el-link",{attrs:{type:"primary"}},[e._v("[GO]")])],1),e._v("。 ")])]),t("div",{staticClass:"demo-btn"},[t("div",{staticClass:"flex-box-center mb-15",on:{click:function(t){return e.showMessageBox()}}},[t("el-badge",{staticClass:"item",attrs:{value:e.unread,max:99,hidden:!e.unread}},[t("el-button",[e._v("窗口模式")])],1)],1),t("div",{staticClass:"mb-15 mr-20",on:{click:function(t){return e.$router.push({path:"/chat"})}}},[t("el-button",[e._v("纯享模式")])],1),t("div",{staticClass:"mb-15 mr-20",on:{click:function(t){return e.$router.push({path:"/manage/index"})}}},[t("el-button",[e._v("管理后台")])],1),t("div",{staticClass:"mb-15 mr-20"},[t("el-tooltip",{attrs:{placement:"right-start",effect:"light"}},[t("div",{attrs:{slot:"content"},slot:"content"},[t("el-image",{staticStyle:{width:"200px"},attrs:{src:"https://emoji.raingad.com/file/h5.png"}})],1),t("el-button",[t("a",{attrs:{href:e.$packageData.mobileUrl,target:"_blank"}},[e._v("H5体验")])])],1)],1),t("div",{staticClass:"mb-15"},[t("el-tooltip",{attrs:{placement:"right-start",effect:"light"}},[t("div",{attrs:{slot:"content"},slot:"content"},[t("el-image",{staticStyle:{width:"200px"},attrs:{src:"https://emoji.raingad.com/file/app.png"}})],1),t("el-button",[t("a",{attrs:{href:"https://emoji.raingad.com/file/raingad.apk",target:"_blank"}},[e._v("安卓APP体验")])])],1)],1)]),t("div",{staticClass:"contact-main"},[e._m(1),e._l(e.allContacts,(function(s){return 0==s.is_group&&s.id<6?t("div",{key:s.id,staticClass:"contact-box"},[t("div",{staticClass:"contact-item"},[t("el-avatar",{attrs:{src:s.avatar}}),t("span",[e._v(e._s(s.realname))]),t("div",[t("el-button",{attrs:{plain:"",size:"mini",round:""},on:{click:function(t){return e.$store.commit("openChat",s.id)}}},[e._v("发消息")])],1)],1)]):e._e()}))],2),t("div",{staticClass:"tip"},[e._m(2),t("div",e._l(e.$packageData.funcList,(function(s){return t("p",{key:s.icon},[t("i",{class:s.icon}),e._v(" "+e._s(s.text))])})),0),e._m(3),t("p",[e._v(" 1、企业模式类似于企业微信初始化联系人是加载企业内的所有人员无须加好友可以直接进行对话、创建群聊等适用于企业内部通讯。 ")]),t("p",[e._v(" 2、社区模式类似于微信或QQ需要添加好友才能进行对话适用于社区交流。社区模式支持加好友、删除好友、改备注等功能。 ")]),t("p",[e._v(" 3、选择适合自己项目的模式然后在后台设置即可。社区模式体验需要自行搭建部署哦可以在项目地址中看到相关的截图。 ")]),e._m(4),t("p",[e._v(" 继续优化,完善功能! ")])]),e._m(5),t("p",[t("el-image",{staticClass:"mr-40 mb-20",staticStyle:{width:"300px"},attrs:{src:"https://emoji.raingad.com/file/wx.jpg"}}),t("el-image",{staticStyle:{width:"280px"},attrs:{src:"https://emoji.raingad.com/file/zfb.jpg"}})],1),e._m(6),t("div",{staticClass:"other-pro"},[t("h2",[e._v("其他项目")]),t("br"),t("div",{staticClass:"mb-15"},[t("el-link",{attrs:{type:"primary",href:"https://gitee.com/raingad/j-preview"}},[e._v("纯JS文件预览插件")])],1)]),t("div",{staticClass:"other-pro"},[t("h2",[e._v("其他资料")]),t("br"),t("div",{staticClass:"mb-15"},[t("el-link",{attrs:{type:"primary",href:"http://june000.gitee.io/lemon-im"}},[e._v("Lemon-IMUI使用文档")])],1),t("div",{staticClass:"mb-15"},[t("el-link",{attrs:{type:"primary",href:"https://blog.csdn.net/ruiye99/article/details/130992960"}},[e._v("WebRTC 网络中继 Coturn 服务安装及部署")])],1)]),t("Message",{ref:"Message",attrs:{dialogTableVisible:e.dialogTableVisible},on:{"update:dialogTableVisible":function(t){e.dialogTableVisible=t},"update:dialog-table-visible":function(t){e.dialogTableVisible=t}}})],1)},F=[function(){var e=this,t=e._self._c;return t("h3",{staticClass:"mb-5"},[t("b",[e._v("介绍")])])},function(){var e=this,t=e._self._c;return t("div",{staticClass:"title"},[t("b",{staticStyle:{"font-size":"24px"}},[e._v("联系人")]),e._v("(仅展示部分用于演示)")])},function(){var e=this,t=e._self._c;return t("h3",{staticClass:"mb-5"},[t("b",[e._v("功能")])])},function(){var e=this,t=e._self._c;return t("h3",{staticClass:"mb-5 mt-5"},[t("b",[e._v("模式介绍")])])},function(){var e=this,t=e._self._c;return t("h3",{staticClass:"mb-5 mt-5"},[t("b",[e._v("计划")])])},function(){var e=this,t=e._self._c;return t("div",{staticClass:"warning"},[t("p",[e._v(" 详细的使用方法在源码中基本上都有备注如果您觉得这个项目对您有帮助欢迎star如果有问题可以加QQ群交流如果您有更好的建议欢迎提出。 "),t("br"),e._v(" "),t("b",[e._v("如果觉得项目不错,不如请作者喝杯奶茶吧~")])])])},function(){var e=this,t=e._self._c;return t("div",{staticClass:"tip"},[t("h3",{staticClass:"mb-5"},[t("b",[e._v("服务介绍")])]),t("p",[e._v("开源不易,同时如果需要以下功能,作者提供付费服务,进群后咨询作者!或者进群后直接扫码支付,联系群主提供支付凭证即可!")]),t("p",{staticClass:"m-5"},[t("b",[e._v("作者8年phper前端水平一般不接外包除非价格确实高功能也不难")])]),t("p",[e._v("1. 协助部署:"),t("b",[e._v("200元/次")]),e._v("(提供远程 [todesk] 技术指导赠送API文档[编写中...]。需要自行安装好运行环境,最好是宝塔面板)")]),t("p",[e._v("2. uniapp移动端源码"),t("b",[e._v(" 388元/套。")]),e._v("(全开源,仅提供源码,有源码结构文档,不提供专业指导和部署)")])])}],L=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.dialogTableVisible,expression:"dialogTableVisible"}],staticClass:"messageBoxStyle"},[t("el-dialog",{attrs:{visible:e.dialogIsShow,modal:!1,"custom-class":"sideMenu-message","show-close":!1,width:"1000px","close-on-press-escape":!0},on:{"update:visible":function(t){e.dialogIsShow=t},close:e.closeDialog}},[t("rainagdIm",{on:{newChat:e.contactSync,close:e.closeDialog}})],1)],1)},j=[],R=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"chat-box"},[t("lemon-imui",{ref:"IMUI",staticStyle:{"min-height":"600px"},attrs:{user:e.user,width:e.curWidth,height:e.curHeight,contextmenu:e.contextmenu,"contact-contextmenu":e.contactContextmenu,theme:e.setting.theme,"hide-message-name":e.setting.hideMessageName,"hide-message-time":e.setting.hideMessageTime,avatarCricle:e.setting.avatarCricle,sendKey:e.setSendKey,wrapKey:e.wrapKey},on:{"menu-avatar-click":e.openSetting,"change-contact":e.handleChangeContact,"pull-messages":e.handlePullMessages,"message-click":e.handleMessageClick,send:e.handleSend},scopedSlots:e._u([{key:"cover",fn:function(){return[t("div",[t("div",{staticClass:"cover"},[t("i",{staticClass:"lemon-icon-message"}),t("p",[t("b",[e._v("即时聊天 Raingad")]),e._v(" IM")])])])]},proxy:!0},{key:"sidebar-message",fn:function(s){return[t("span",{staticClass:"lemon-badge lemon-contact__avatar"},[t("span",{staticClass:"lemon-avatar",class:{"lemon-avatar--circle":e.setting.avatarCricle},staticStyle:{width:"40px",height:"40px","line-height":"40px","font-size":"20px"}},[t("img",{attrs:{src:s.avatar}})]),s.unread>0&&1==s.is_notice?t("span",{staticClass:"lemon-badge__label"},[e._v(e._s(s.unread))]):e._e()]),t("div",{staticClass:"lemon-contact__inner"},[t("p",{staticClass:"lemon-contact__label"},[t("span",{staticClass:"lemon-contact__name"},[s.is_online&&0==s.is_group&&1==e.globalConfig.chatInfo.online?t("OnlineStatus",{attrs:{title:"在线",type:"success"}}):e._e(),1==s.is_group?t("el-tag",{attrs:{size:"mini"}},[e._v("群聊")]):e._e(),e._v(" "+e._s(s.displayName)+" ")],1),t("span",{staticClass:"lemon-contact__time",domProps:{textContent:e._s(e.formatTime(s.lastSendTime))}})]),t("p",{staticClass:"lemon-contact__content lemon-last-content"},[t("span",{staticClass:"lastContent"},[0==s.is_notice&&s.unread>0?t("span",[e._v("["+e._s(s.unread)+"条未读]")]):e._e(),t("span",{domProps:{innerHTML:e._s(s.lastContent)}})]),0==s.is_notice?t("span",{staticClass:"el-icon-close-notification f-16"}):e._e()])])]}},{key:"message-title",fn:function(s){return[t("div",{staticClass:"message-title-box"},[t("div",[0==e.isEdit?t("span",[1==e.is_group?t("span",{staticClass:"displayName",on:{click:function(t){e.isEdit=!0}}},[t("el-tag",{attrs:{size:"mini"}},[e._v("群聊")]),e._v(" "+e._s(s.displayName)),t("span",{staticClass:"mr-5"},[e._v("("+e._s(e.groupUserCount)+")")]),s.setting&&1==s.setting.nospeak?t("el-tag",{attrs:{size:"mini",type:"warning"}},[e._v("仅群管理员可发言")]):e._e(),s.setting&&2==s.setting.nospeak?t("el-tag",{attrs:{size:"mini",type:"danger"}},[e._v("全员禁言中")]):e._e()],1):e._e(),0==e.is_group?t("span",{staticClass:"displayName"},[e.globalConfig.chatInfo.online?t("OnlineStatus",{attrs:{type:s.is_online?"success":"info",pulse:s.is_online}}):e._e(),e._v(" "+e._s(s.displayName))],1):e._e(),parseInt(e.globalConfig.sysInfo.ipregion)&&s.last_login_ip?t("span",{staticClass:"c-999 f-12 ml-5"},[e.globalConfig.chatInfo.online&&!s.is_online?t("span",[e._v("(离线)")]):e._e(),e._v(e._s(s.last_login_ip)+" "+e._s(s.location))]):e._e()]):e._e(),1==e.isEdit?t("input",{directives:[{name:"model",rawName:"v-model",value:e.displayName,expression:"displayName"}],staticClass:"editInput",domProps:{value:e.displayName},on:{blur:function(t){return e.saveGroupName(s)},input:function(t){t.target.composing||(e.displayName=t.target.value)}}}):e._e()]),t("div",{staticClass:"message-title-tools"},[e.globalConfig.chatInfo.webrtc?[!s.is_group&&parseInt(e.globalConfig.chatInfo.webrtc)?t("i",{staticClass:"el-icon-phone-outline ml-10",attrs:{title:"语音通话"},on:{click:function(t){return e.called(0)}}}):e._e(),!s.is_group&&parseInt(e.globalConfig.chatInfo.webrtc)?t("i",{staticClass:"el-icon-video-camera ml-10",attrs:{title:"视频通话"},on:{click:function(t){return e.called(1)}}}):e._e()]:e._e(),t("i",{staticClass:"el-icon-time ml-10",attrs:{title:"消息管理器"},on:{click:e.openMessageBox}}),s.is_group?t("i",{staticClass:"iconfont icon-ico ml-10 f-22",attrs:{title:"群二维码"},on:{click:function(t){e.groupQrShow=!0}}}):e._e(),s.is_group?e._e():t("i",{staticClass:"el-icon-more ml-10",attrs:{title:"基本资料"},on:{click:function(t){return e.$user(s.id)}}}),s.is_group&&1==e.currentChat.role?t("i",{staticClass:"el-icon-more ml-10",attrs:{title:"群管理"},on:{click:function(t){return e.openGroupSetting(!1)}}}):e._e()],2)])]}},{key:"sidebar-message-fixedtop",fn:function(s){return[e.wsStatus?e._e():t("div",{staticClass:"lz-flex no-internet pd-10 mb-10 lz-space-between lz-align-items-center"},[t("div",{staticClass:"el-icon-info"}),t("div",[e._v("当前网络无法实时接收消息")]),t("div",{staticClass:"el-icon-refresh cur-handle",attrs:{title:"重新链接"},on:{click:e.reconnect}})]),t("div",{staticClass:"contact-fixedtop-box"},[t("el-input",{staticClass:"input-with-select",attrs:{placeholder:"搜索联系人","prefix-icon":"el-icon-search"},on:{blur:e.closeSearch,focus:function(t){e.searchResult=!0}},model:{value:e.keywords,callback:function(t){e.keywords=t},expression:"keywords"}}),2==e.globalConfig.sysInfo.runMode?t("div",{staticStyle:{"margin-left":"10px"}},[t("el-dropdown",{on:{command:e.handleCommand}},[t("el-button",{attrs:{icon:"el-icon-plus",circle:""}}),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"addFriend"}},[e._v("添加朋友")]),e.globalConfig.chatInfo.groupChat?t("el-dropdown-item",{attrs:{command:"addGroup"}},[e._v("创建群聊")]):e._e()],1)],1)],1):e._e(),1==e.globalConfig.sysInfo.runMode&&e.globalConfig.chatInfo.groupChat?t("div",{staticStyle:{"margin-left":"10px"}},[t("el-button",{attrs:{title:"创建群聊",icon:"el-icon-plus",circle:""},on:{click:e.openCreateGroup}})],1):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:e.searchResult,expression:"searchResult"}],staticClass:"search-list"},[e._l(e.searchList,(function(a,i){return e.searchList.length>0?t("div",{key:i,staticClass:"search-list-item"},[t("lemon-contact",{attrs:{contact:a},on:{click:function(t){return e.openChat(a.id,s)}}})],1):e._e()})),0==e.searchList.length?t("div",{staticStyle:{margin:"20px"},attrs:{align:"center"}},[e._v(" 暂无 ")]):e._e()],2)],1)]}},{key:"sidebar-message-top",fn:function(s){return[e.chatTopList.length>0?t("div",{staticClass:"chat-top-list"},e._l(e.chatTopList,(function(a,i){return t("ChatTop",{key:i,attrs:{contact:a,avatarCricle:e.setting.avatarCricle,currentId:e.currentChat.id},nativeOn:{click:function(t){return e.openChat(a.id,s)}}})})),1):e._e()]}},{key:"sidebar-contact-fixedtop",fn:function(s){return[t("div",{staticStyle:{margin:"15px 10px"}},[e._v(" 联系人 ")])]}},{key:"message-side",fn:function(s){return[1==s.is_group?t("div",{staticClass:"slot-group-list"},[t("div",{staticClass:"group-side-box"},[t("div",{staticClass:"group-notice"},[t("div",{staticClass:"group-side-title"},[t("h4",[e._v("群公告")]),t("div",[s.role<3||0==s.setting.manage?t("span",{staticClass:"el-icon-edit f-18 cur-handle",on:{click:function(t){e.noticeBox=!0}}}):e._e()])]),t("hr"),s.notice?t("div",{staticClass:"group-side-body",on:{click:e.openNotice}},[e._v(" "+e._s(s.notice)+" ")]):e._e(),s.notice?e._e():t("div",{staticClass:"group-side-body"},[e._v(" 暂无公告 ")])]),t("div",{staticClass:"group-user"},[t("div",{staticClass:"group-side-title"},[t("h4",[e._v("群成员")]),t("div",[s.role<3||1==s.setting.invite?t("span",{staticClass:"el-icon-circle-plus-outline f-18 cur-handle",on:{click:e.openAddGroupUser}}):e._e()])]),t("hr"),t("div",{staticClass:"group-user-body",style:"height:calc("+e.curHeight+" - 230px )",attrs:{id:"group-user"}},[t("el-scrollbar",{staticStyle:{height:"100%"}},e._l(e.groupUser,(function(s,a){return t("lemon-contact",{directives:[{name:"lemon-contextmenu",rawName:"v-lemon-contextmenu.contact",value:e.groupMenu,expression:"groupMenu",modifiers:{contact:!0}}],key:a,staticClass:"user-list",attrs:{contact:s}},[t("div",{staticClass:"user-avatar"},[t("el-avatar",{attrs:{size:20,src:s.userInfo.avatar}})],1),t("div",{staticClass:"user-name"},[s.userInfo.id==e.user.id?t("span",{staticClass:"fc-danger"},[e._v(e._s(s.userInfo.displayName)+"(我)")]):e._e(),s.userInfo.id!=e.user.id?t("span",[e._v(e._s(s.userInfo.displayName))]):e._e()]),t("div",{staticClass:"user-role"},[1==s.role?t("i",{staticClass:"el-icon-user-solid fc-danger",attrs:{title:"创建者"}}):e._e(),2==s.role?t("i",{staticClass:"el-icon-user-solid fc-warning",attrs:{title:"管理员"}}):e._e()])])})),1)],1)])])]):e._e()]}},{key:"message-after",fn:function(s){return[s.fromUser.id==e.user.id&&0==s.is_group?t("span",{staticStyle:{visibility:"visible"}},[s.is_read||"succeed"!=s.status?e._e():t("span",[e._v(" 未读 ")]),s.is_read&&"succeed"==s.status?t("span",{staticClass:"fc-success"},[e._v(" 已读 ")]):e._e()]):e._e()]}},{key:"editor-footer",fn:function(){return[e._v(" "+e._s(1==e.setting.sendKey?"使用 Enter 键发送消息":"使用 Ctrl + Enter 键发送消息")+" ")]},proxy:!0}])})],1),t("Group",{attrs:{visible:e.createChatBox,title:e.dialogTitle,isAdd:e.isAdd,userIds:e.userIds,groupId:e.group_id},on:{"update:visible":function(t){e.createChatBox=t},manageGroup:e.manageGroup}}),t("el-dialog",{attrs:{title:"发布公告",visible:e.noticeBox,modal:!0,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.noticeBox=t}}},[t("el-input",{attrs:{type:"textarea",rows:10,placeholder:"请输入内容"},model:{value:e.notice,callback:function(t){e.notice=t},expression:"notice"}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.noticeBox=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.publishNotice}},[e._v("确 定")])],1)],1),t("addFriend",{attrs:{visible:e.addFriendBox},on:{"update:visible":function(t){e.addFriendBox=t}}}),t("ChooseDialog",{attrs:{visible:e.forwardBox,title:"转发聊天",allUser:e.allUser},on:{"update:visible":function(t){e.forwardBox=t},selectChat:e.forwardUser}}),t("el-dialog",{attrs:{title:"消息管理器",visible:e.messageBox,modal:!0,width:"800px","append-to-body":""},on:{"update:visible":function(t){e.messageBox=t}}},[t("ChatRecord",{key:e.componentKey,attrs:{contact:e.currentChat}})],1),t("el-dialog",{attrs:{title:"群设置",visible:e.groupSetting,modal:!0,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.groupSetting=t}}},[t("ChatSet",{key:e.componentKey,attrs:{contact:e.contactSetting},on:{changeOwner:e.changeOwner}})],1),t("el-dialog",{attrs:{title:"语音录制","custom-class":"no-padding",visible:e.VoiceStatus,modal:!0,width:"500px","append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.VoiceStatus=t}}},[t("voice-recorder",{on:{send:e.sendVoice}})],1),t("group-qr",{attrs:{contact:e.currentChat,visible:e.groupQrShow},on:{"update:visible":function(t){e.groupQrShow=t}}}),t("Socket",{ref:"socket"}),t("webrtc",{key:e.componentKey,ref:"webrtc",attrs:{contact:e.currentChat,config:e.webrtcConfig,alias:e.$packageData.name,userInfo:e.user},on:{message:e.rtcMsg}})],1)},D=[],O=(s(2801),s(3408),s(4590),[{label:"表情",children:[{name:"1f600",title:"微笑",src:"https://emoji.raingad.com/72x72/1f600.png"},{name:"1f62c",title:"微笑",src:"https://emoji.raingad.com/72x72/1f62c.png"},{name:"1f601",title:"微笑",src:"https://emoji.raingad.com/72x72/1f601.png"},{name:"1f602",title:"微笑",src:"https://emoji.raingad.com/72x72/1f602.png"},{name:"1f923",title:"微笑",src:"https://emoji.raingad.com/72x72/1f923.png"},{name:"1f973",title:"微笑",src:"https://emoji.raingad.com/72x72/1f973.png"},{name:"1f603",title:"微笑",src:"https://emoji.raingad.com/72x72/1f603.png"},{name:"1f604",title:"微笑",src:"https://emoji.raingad.com/72x72/1f604.png"},{name:"1f605",title:"微笑",src:"https://emoji.raingad.com/72x72/1f605.png"},{name:"1f606",title:"微笑",src:"https://emoji.raingad.com/72x72/1f606.png"},{name:"1f607",title:"微笑",src:"https://emoji.raingad.com/72x72/1f607.png"},{name:"1f609",title:"微笑",src:"https://emoji.raingad.com/72x72/1f609.png"},{name:"1f60a",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60a.png"},{name:"1f642",title:"微笑",src:"https://emoji.raingad.com/72x72/1f642.png"},{name:"1f643",title:"微笑",src:"https://emoji.raingad.com/72x72/1f643.png"},{name:"1263a",title:"微笑",src:"https://emoji.raingad.com/72x72/263a.png"},{name:"1f60b",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60b.png"},{name:"1f60c",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60c.png"},{name:"1f60d",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60d.png"},{name:"1f970",title:"微笑",src:"https://emoji.raingad.com/72x72/1f970.png"},{name:"1f618",title:"微笑",src:"https://emoji.raingad.com/72x72/1f618.png"},{name:"1f617",title:"微笑",src:"https://emoji.raingad.com/72x72/1f617.png"},{name:"1f619",title:"微笑",src:"https://emoji.raingad.com/72x72/1f619.png"},{name:"1f61a",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61a.png"},{name:"1f61c",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61c.png"},{name:"1f92a",title:"微笑",src:"https://emoji.raingad.com/72x72/1f92a.png"},{name:"1f928",title:"微笑",src:"https://emoji.raingad.com/72x72/1f928.png"},{name:"1f9d0",title:"微笑",src:"https://emoji.raingad.com/72x72/1f9d0.png"},{name:"1f61d",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61d.png"},{name:"1f61b",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61b.png"},{name:"1f911",title:"微笑",src:"https://emoji.raingad.com/72x72/1f911.png"},{name:"1f913",title:"微笑",src:"https://emoji.raingad.com/72x72/1f913.png"},{name:"1f60e",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60e.png"},{name:"1f929",title:"微笑",src:"https://emoji.raingad.com/72x72/1f929.png"},{name:"1f921",title:"微笑",src:"https://emoji.raingad.com/72x72/1f921.png"},{name:"1f920",title:"微笑",src:"https://emoji.raingad.com/72x72/1f920.png"},{name:"1f917",title:"微笑",src:"https://emoji.raingad.com/72x72/1f917.png"},{name:"1f60f",title:"微笑",src:"https://emoji.raingad.com/72x72/1f60f.png"},{name:"1f636",title:"微笑",src:"https://emoji.raingad.com/72x72/1f636.png"},{name:"1f610",title:"微笑",src:"https://emoji.raingad.com/72x72/1f610.png"},{name:"1f611",title:"微笑",src:"https://emoji.raingad.com/72x72/1f611.png"},{name:"1f612",title:"微笑",src:"https://emoji.raingad.com/72x72/1f612.png"},{name:"1f644",title:"微笑",src:"https://emoji.raingad.com/72x72/1f644.png"},{name:"1f914",title:"微笑",src:"https://emoji.raingad.com/72x72/1f914.png"},{name:"1f925",title:"微笑",src:"https://emoji.raingad.com/72x72/1f925.png"},{name:"1f92d",title:"微笑",src:"https://emoji.raingad.com/72x72/1f92d.png"},{name:"1f92b",title:"微笑",src:"https://emoji.raingad.com/72x72/1f92b.png"},{name:"1f92c",title:"微笑",src:"https://emoji.raingad.com/72x72/1f92c.png"},{name:"1f92f",title:"微笑",src:"https://emoji.raingad.com/72x72/1f92f.png"},{name:"1f633",title:"微笑",src:"https://emoji.raingad.com/72x72/1f633.png"},{name:"1f61e",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61e.png"},{name:"1f61f",title:"微笑",src:"https://emoji.raingad.com/72x72/1f61f.png"},{name:"1f620",title:"微笑",src:"https://emoji.raingad.com/72x72/1f620.png"},{name:"1f621",title:"微笑",src:"https://emoji.raingad.com/72x72/1f621.png"}]},{label:"收藏",children:[{name:"1f62c",title:"微笑",src:"https://emoji.raingad.com/72x72/1f62c.png"},{name:"1f621",title:"微笑",src:"https://emoji.raingad.com/72x72/1f621.png"}]}]),B=s(2325),z=function(){var e=this;e._self._c;return e._m(0)},E=[function(){var e=this,t=e._self._c;return t("div",[t("audio",{attrs:{id:"chatAudio"}},[t("source",{attrs:{src:s(1315),type:"audio/ogg"}}),t("source",{attrs:{src:s(444),type:"audio/mpeg"}}),t("source",{attrs:{src:s(8611),type:"audio/wav"}})])])}],V={name:"socket",data(){return{is_open_socket:!1,websocket:null,pingInterval:30,connectNum:1,manMade:!0,timeout:3e4,heartbeatInterval:null,reconnectTimeOut:null}},methods:{getWsUrl(){let e={NODE_ENV:"production",BASE_URL:""}.VUE_APP_BASE_API,t=window.location.protocol,s="ws://";e=window.location.host,"https:"==t&&(s="wss://");const a=s+e+"/wss";return a},initWebSocket(){const e=this.getWsUrl();this.websocket=new WebSocket(e),this.start(),this.is_open_socket=!0,this.websocket.onmessage=this.websocketOnMessage,this.websocket.onclose=this.websocketClose,a["default"].prototype.$websocket=this.websocket,this.$store.state.wsStatus=!0},websocketOnMessage(e){const t=JSON.parse(e.data);let s=r().get("UserInfo"),a=r().get("authToken");switch(t["type"]){case"ping":this.websocketSend({type:"pong"});break;case"init":r().set("client_id",t["client_id"]),this.$api.commonApi.bindClientIdAPI({client_id:t["client_id"],user_id:s.user_id}).then((e=>{this.websocketSend({type:"bindUid",user_id:s.user_id,token:a}),console.log(t["client_id"],"消息服务启动成功")})).catch((e=>{console.log("连接失败")}));break;default:this.$store.commit("catchSocketAction",t);break}},websocketClose(e){if(console.log("websocket连接关闭"),this.is_open_socket=!1,clearInterval(this.heartbeatInterval),clearInterval(this.reconnectTimeOut),this.connectNum<3)return this.manMade=!1,this.reconnect(),void(this.connectNum+=1);this.$store.state.wsStatus=!1,this.connectNum=1,this.websocket=null;let t=r().get("UserInfo");this.$api.commonApi.offlineAPI({user_id:t.user_id}).then((t=>{console.log("connection closed ("+e.code+")")}))},start(){this.heartbeatInterval=setInterval((()=>{this.websocketSend({type:"ping"})}),this.timeout)},websocketSend(e){var t=JSON.stringify(e);this.checkStatus&&this.websocket.send(t)},checkStatus(){return!(!this.websocket||[2,3].includes(this.websocket.readyState))||(console.log("未链接!"),!1)},close(){this.is_open_socket&&this.websocket.close()},reconnect(){console.log("正在重连..."),clearInterval(this.heartbeatInterval),this.is_open_socket||0!=this.manMade||(console.log("5秒后重新连接..."),this.reconnectTimeOut=setInterval((()=>{this.initWebSocket()}),5e3))},playAudio(){const e=document.getElementById("chatAudio");e.currentTime=0,e.play()}},created(){this.initWebSocket()}},G=V,Z=(0,d.Z)(G,z,E,!1,null,null,null),q=Z.exports,W=s(7292),H=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"group-item"},[t("div",{staticClass:"group-avatar"},[t("el-avatar",{attrs:{shape:"square",src:e.contact.avatar}})],1),t("div",{staticClass:"group-content"},[t("div",{staticClass:"group-title"},[e._v(e._s(e.contact.displayName)+" "),t("span",[e._v("("+e._s(e.groupInfo.groupUserCount)+")")])]),t("div",{staticClass:"group-user"},[e._v("群主:"+e._s(e.groupInfo.ownerName))])])]),t("div",{staticClass:"setting-item"},[t("div",{staticClass:"setting-title"},[e._v("群管理:")]),t("div",{staticClass:"setting-option"},[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:e.groupSetting},model:{value:e.setting.manage,callback:function(t){e.$set(e.setting,"manage",t)},expression:"setting.manage"}})],1),e._m(0)]),t("div",{staticClass:"setting-item"},[t("div",{staticClass:"setting-title"},[e._v("群成员邀请:")]),t("div",{staticClass:"setting-option"},[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:e.groupSetting},model:{value:e.setting.invite,callback:function(t){e.$set(e.setting,"invite",t)},expression:"setting.invite"}})],1),e._m(1)]),t("div",{staticClass:"setting-item"},[t("div",{staticClass:"setting-title"},[e._v("群禁言:")]),t("div",{staticClass:"setting-option"},[t("el-radio-group",{attrs:{size:"mini"},on:{change:e.groupSetting},model:{value:e.setting.nospeak,callback:function(t){e.$set(e.setting,"nospeak",t)},expression:"setting.nospeak"}},[t("el-radio-button",{attrs:{label:"0"}},[e._v("关闭")]),t("el-radio-button",{attrs:{label:"1"}},[e._v("仅管理员可发言")]),t("el-radio-button",{attrs:{label:"2"}},[e._v("仅群主可发言")])],1)],1)]),t("div",{staticClass:"setting-item"},[t("div",{staticClass:"setting-title"},[e._v("转让群主:")]),t("div",{staticClass:"setting-option"},[t("el-button",{attrs:{size:"mini"},on:{click:e.changeOwner}},[e._v("转让")])],1)])])},K=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting-description"},[t("div",{staticClass:"des-title"},[e._v("仅群主和群管理员可以管理")]),t("div",{staticClass:"des-comment"},[e._v("启用后,其他成员不能修改群名称,编辑公告等")])])},function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting-description"},[t("div",{staticClass:"des-title"},[e._v("允许群成员邀请")]),t("div",{staticClass:"des-comment"},[e._v("启用后,其他成员可以邀请其他人加入群聊")])])}],J={name:"chatSet",props:{contact:{type:Object,default:{}}},data(){return{setting:{},groupInfo:{}}},methods:{groupSetting(){this.$api.imApi.groupSettingAPI({id:this.contact.id,setting:this.setting})},changeOwner(){this.$emit("changeOwner",this.contact.id)}},created(){this.$api.imApi.getGroupInfoAPI({group_id:this.contact.id}).then((e=>{var t=e.data;this.groupInfo=t,this.setting=t.setting}))}},Y=J,Q=(0,d.Z)(Y,H,K,!1,null,"3ab330ec",null),X=Q.exports,ee=function(){var e=this,t=e._self._c;return t("div",{staticClass:"chatTop"},[t("el-tooltip",{attrs:{content:e.contact.displayName,placement:"top-start",effect:"light"}},[t("div",{staticClass:"top-item",class:e.currentId==e.contact.id?"active":""},[t("div",{staticClass:"avatar"},[t("el-avatar",{attrs:{shape:e.avatarCricle?"circle":"square",size:"small",src:e.contact.avatar}})],1),t("div",{staticClass:"username"},[e._v(" "+e._s(e.contact.displayName)+" ")])])])],1)},te=[],se={name:"chatTop",props:{contact:{type:Object,default:{}},currentId:[String,Number],avatarCricle:{type:Boolean,default:!1}},data(){return{}},methods:{},created(){}},ae=se,ie=(0,d.Z)(ae,ee,te,!1,null,"069c0360",null),ne=ie.exports,oe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"lum-dialog-mask animated fadeIn"},[t("el-container",{staticClass:"lum-dialog-box"},[t("el-main",{staticClass:"no-padding mian"},[t("div",{staticClass:"music"},[t("span",{staticClass:"line line1",class:{"line-ani":e.animation}}),t("span",{staticClass:"line line2",class:{"line-ani":e.animation}}),t("span",{staticClass:"line line3",class:{"line-ani":e.animation}}),t("span",{staticClass:"line line4",class:{"line-ani":e.animation}}),t("span",{staticClass:"line line5",class:{"line-ani":e.animation}})]),t("div",{staticStyle:{"margin-top":"35px",color:"#676262","font-weight":"300"}},[0==e.recorderStatus?[t("p",{staticStyle:{"font-size":"13px","margin-top":"5px"}},[t("span",[e._v("语音消息,让聊天更简单方便 ...")])])]:1==e.recorderStatus||2==e.recorderStatus||3==e.recorderStatus?[t("p",[e._v(e._s(e.datetime))]),t("p",{staticStyle:{"font-size":"13px","margin-top":"5px"}},[1==e.recorderStatus?t("span",[e._v("正在录音...")]):2==e.recorderStatus?t("span",[e._v("已暂停录音")]):3==e.recorderStatus?t("span",[e._v("录音时长")]):e._e()])]:4==e.recorderStatus||5==e.recorderStatus||6==e.recorderStatus?[t("p",[e._v(e._s(e.formatPlayTime))]),t("p",{staticStyle:{"font-size":"13px","margin-top":"5px"}},[4==e.recorderStatus?t("span",[e._v("正在播放")]):5==e.recorderStatus?t("span",[e._v("已暂停播放")]):6==e.recorderStatus?t("span",[e._v("播放已结束")]):e._e()])]:e._e()],2)]),t("el-footer",{staticClass:"footer",attrs:{height:"60px"}},[t("el-button",{directives:[{name:"show",rawName:"v-show",value:0==e.recorderStatus,expression:"recorderStatus == 0"}],attrs:{type:"primary",size:"small",round:"",icon:"el-icon-microphone"},on:{click:e.startRecorder}},[e._v("开始录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:1==e.recorderStatus,expression:"recorderStatus == 1"}],attrs:{type:"warning",size:"small",round:"",icon:"el-icon-video-pause"},on:{click:e.pauseRecorder}},[e._v("暂停录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:2==e.recorderStatus,expression:"recorderStatus == 2"}],attrs:{type:"primary",size:"small",round:"",icon:"el-icon-microphone"},on:{click:e.resumeRecorder}},[e._v("继续录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:(2==e.recorderStatus||1==e.recorderStatus)&&e.duration>1,expression:"(recorderStatus == 2 || recorderStatus == 1) && duration>1"}],attrs:{type:"danger",size:"small",round:"",icon:"el-icon-microphone"},on:{click:e.stopRecorder}},[e._v("结束录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:3==e.recorderStatus||6==e.recorderStatus,expression:"recorderStatus == 3 || recorderStatus == 6"}],attrs:{type:"success",size:"small",round:"",icon:"el-icon-video-play"},on:{click:e.playRecorder}},[e._v("播放录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:3==e.recorderStatus||5==e.recorderStatus||6==e.recorderStatus,expression:"\n recorderStatus == 3 || recorderStatus == 5 || recorderStatus == 6\n "}],attrs:{type:"warning",size:"small",round:"",icon:"el-icon-refresh-right"},on:{click:e.startRecorder}},[e._v("重新录音 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:4==e.recorderStatus,expression:"recorderStatus == 4"}],attrs:{type:"info",size:"small",round:"",icon:"el-icon-video-pause"},on:{click:e.pausePlayRecorder}},[e._v("暂停播放 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:5==e.recorderStatus,expression:"recorderStatus == 5"}],attrs:{type:"success",size:"small",round:"",icon:"el-icon-video-play"},on:{click:e.resumePlayRecorder}},[e._v("继续播放 ")]),t("el-button",{directives:[{name:"show",rawName:"v-show",value:3==e.recorderStatus||5==e.recorderStatus||6==e.recorderStatus,expression:"\n recorderStatus == 3 || recorderStatus == 5 || recorderStatus == 6\n "}],attrs:{type:"primary",size:"small",round:""},on:{click:e.submit}},[e._v("立即发送 ")])],1)],1)],1)},re=[],le=s(7362),ce=s.n(le),de={name:"voiceRecorder",data(){return{recorder:null,duration:0,playTime:0,animation:!1,recorderStatus:0,playTimeout:null}},computed:{datetime(){let e=parseInt(this.duration/60/60%24),t=parseInt(this.duration/60%60),s=parseInt(this.duration%60);return e<10&&(e=`0${e}`),t<10&&(t=`0${t}`),s<10&&(s=`0${s}`),`${e}:${t}:${s}`},formatPlayTime(){let e=parseInt(this.playTime/60/60%24),t=parseInt(this.playTime/60%60),s=parseInt(this.playTime%60);return e<10&&(e=`0${e}`),t<10&&(t=`0${t}`),s<10&&(s=`0${s}`),`${e}:${t}:${s}`}},destroyed(){this.recorder&&this.destroyRecorder()},methods:{closeBox(){null!=this.recorder?(1==this.recorderStatus?this.stopRecorder():4==this.recorderStatus&&this.pausePlayRecorder(),this.destroyRecorder((()=>{this.$emit("close",!1)}))):this.$emit("close",!1)},startRecorder(){let e=this;this.recorder=new(ce()),this.recorder.onprocess=t=>{t=parseInt(t),e.duration=t},this.recorder.start().then((()=>{this.recorderStatus=1,this.animation=!0}),(e=>{console.log(`${e.name} : ${e.message}`)}))},pauseRecorder(){this.recorder.pause(),this.recorderStatus=2,this.animation=!1},resumeRecorder(){this.recorderStatus=1,this.recorder.resume(),this.animation=!0},stopRecorder(){this.recorderStatus=3,this.recorder.stop(),this.animation=!1},playRecorder(){this.recorderStatus=4,this.recorder.play(),this.playTimeouts(),this.animation=!0},pausePlayRecorder(){this.recorderStatus=5,this.recorder.pausePlay(),clearInterval(this.playTimeout),this.animation=!1},resumePlayRecorder(){this.recorderStatus=4,this.recorder.resumePlay(),this.playTimeouts(),this.animation=!0},destroyRecorder(e){this.recorder.destroy().then((()=>{this.recorder=null,e&&e()}))},recorderSize(){return this.recorder.fileSize},playTimeouts(){this.playTimeout=setInterval((()=>{let e=parseInt(this.recorder.getPlayTime());this.playTime=e,e==this.duration&&(clearInterval(this.playTimeout),this.animation=!1,this.recorderStatus=6)}),100)},submit(){let e=this.recorder.getWAVBlob(),t=new File([e],"在线录音.wav",{type:e.type,lastModified:Date.now()});this.$emit("send",this.duration,t)}}},ue=de,pe=(0,d.Z)(ue,oe,re,!1,null,"dcd1bb58",null),me=pe.exports,he=s(284),ge=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"群二维码分享",visible:e.visible,modal:!0,width:"340px","append-to-body":""},on:{close:e.closeDialog}},[t("el-image",{staticStyle:{width:"300px",height:"432px"},attrs:{src:e.image}},[t("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[t("i",{staticClass:"el-icon-picture-outline f-20"}),t("p",{staticClass:"ml-10 f-18"},[e._v("二维码生成中...")])])]),t("div",{staticClass:"mt-20",attrs:{align:"center"}},[t("el-button",{on:{click:e.saveBase64Image}},[e._v("保存到电脑")])],1),t("vue-canvas-poster",{staticStyle:{display:"none"},attrs:{widthPixels:1e3,painting:e.painting},on:{success:e.success,fail:e.fail}})],1)},fe=[],ve=s(2484),be={components:{VueCanvasPoster:ve.VueCanvasPoster},props:{contact:{type:Object,default:()=>({})},visible:{type:Boolean,default:!1}},data(){return{painting:{width:"500px",height:"720px",background:"#ffffff",views:[]},image:""}},watch:{visible(e){e&&this.getGroupUserInfo()}},methods:{success(e){this.image=e},fail(e){},closeDialog(){this.$emit("update:visible",!1),this.image=""},saveBase64Image(){var e=document.createElement("a");e.href=this.image,e.download=this.contact.displayName+".png",e.click()},getGroupUserInfo(){this.$api.imApi.getGroupInfoAPI({group_id:this.contact.id}).then((e=>{var t=e.data;this.painting.views=[{type:"image",url:t.avatar,css:{top:"40px",left:"200px",borderRadius:"8px",width:"100px",height:"100px"}},{type:"text",text:"群聊:"+t.name,css:{top:"160px",left:"50px",width:"400px",maxLines:1,fontSize:"30px",textAlign:"center",color:"#000000",fontWeight:"bloder"}},{type:"qrcode",content:t.qrUrl,css:{top:"240px",left:"70px",color:"#000",width:"360px",height:"360px"}},{type:"text",text:"该二维码7天内"+t.qrExpire+"前)有效",css:{top:"640px",left:"50px",width:"400px",maxLines:1,fontSize:"20px",textAlign:"center",color:"#999"}}]}))}}},_e=be,Ce=(0,d.Z)(_e,ge,fe,!1,null,null,null),ye=Ce.exports,we=s(6038),xe=function(){var e=this,t=e._self._c;return t("el-container",[t("el-header",{staticClass:"slider-aside"},[t("el-tabs",{staticClass:"tab-diy",attrs:{"tab-position":"bottom"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{attrs:{label:"所有文件",name:"all"}}),t("el-tab-pane",{attrs:{label:"我发送的",name:"send"}}),t("el-tab-pane",{attrs:{label:"我收到的",name:"receive"}})],1)],1),t("el-main",{staticClass:"no-padding"},[t("fileItems",{ref:"fileItem"})],1)],1)},ke=[],Ie=s(3007),$e={name:"files",components:{fileItems:Ie.Z},props:{title:{type:String,default:"创建群聊"}},data(){return{selectUid:[],allUser:[],activeName:"all"}},methods:{handleClick(e){"all"==e.name?this.$refs.fileItem.changeRole(0):"send"==e.name?this.$refs.fileItem.changeRole(1):"receive"==e.name&&this.$refs.fileItem.changeRole(2)}}},Se=$e,Te=(0,d.Z)(Se,xe,ke,!1,null,"37188710",null),Ae=Te.exports,Me=function(){var e=this,t=e._self._c;return t("el-tabs",{staticStyle:{height:"100%"},attrs:{"tab-position":"left"}},[t("el-tab-pane",{staticClass:"pd-20",attrs:{label:"账号设置"}},[t("div",{staticClass:"user-center"},[t("div",{staticClass:"user-avatar"},[t("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{multiple:!1,action:e.getUrl,"show-file-list":!1,data:{type:1},headers:e.getToken,"on-success":e.handleAvatarSuccess,"auto-upload":!1,"on-change":e.change,"before-upload":e.before,"http-request":e.request}},[t("el-image",{staticClass:"m-20",staticStyle:{width:"160px","border-radius":"8px",overflow:"hidden"},attrs:{src:e.user.avatar}}),t("el-button",{staticClass:"replace-picture-button mab-30",attrs:{size:"mini"}},[e._v("更换头像")])],1),t("el-dialog",{attrs:{title:"头像剪裁","close-on-click-modal":!1,visible:e.cropperDialogVisible,width:"580","append-to-body":!0,"show-close":!0},on:{"update:visible":function(t){e.cropperDialogVisible=t},closed:function(t){return e.$refs.upload.clearFiles()}},scopedSlots:e._u([{key:"footer",fn:function(){return[t("el-button",{on:{click:function(t){e.cropperDialogVisible=!1,e.$refs.upload.clearFiles()}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.cropperSave}},[e._v("确 定")])]},proxy:!0}])},[t("Cropper",{key:e.componentsKey,ref:"cropper",attrs:{src:e.cropperImg,compress:e.compress,aspectRatio:e.aspectRatio}})],1),t("div",{staticClass:"mt-20"},[t("el-button",{attrs:{type:"warning"},on:{click:function(t){return e.editInfo(1)}}},[e._v("修改密码")])],1)],1),t("div",{staticClass:"user-info"},[t("el-form",{ref:"userinfo",attrs:{model:e.user,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"登陆账号",prop:"account"}},[e._v(" "+e._s(e.user.account)+" "),t("span",{staticClass:"fc-primary ml-10 cur-handle",on:{click:function(t){return e.editInfo(0)}}},[e._v("修改")])]),1==e.$store.state.globalConfig.sysInfo.runMode?t("el-form-item",{attrs:{label:"姓名"}},[e._v(" "+e._s(e.user.realname)+" ")]):t("el-form-item",{attrs:{label:"昵称"}},[t("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入昵称",maxlength:"20"},model:{value:e.user.realname,callback:function(t){e.$set(e.user,"realname",t)},expression:"user.realname"}})],1),t("el-form-item",{attrs:{label:"e-mail"}},[t("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入邮箱地址",maxlength:"120"},model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}})],1),t("el-form-item",{attrs:{label:"性别"}},[t("el-radio-group",{model:{value:e.user.sex,callback:function(t){e.$set(e.user,"sex",t)},expression:"user.sex"}},[t("el-radio",{attrs:{label:2,border:""}},[e._v("未知")]),t("el-radio",{attrs:{label:1,border:""}},[e._v("男")]),t("el-radio",{attrs:{label:0,border:""}},[e._v("女")])],1)],1),t("el-form-item",{attrs:{label:"个性签名"}},[t("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",rows:3,maxlength:"100","show-word-limit":""},model:{value:e.user.motto,callback:function(t){e.$set(e.user,"motto",t)},expression:"user.motto"}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm()}}},[e._v("保存")])],1)],1)],1)]),t("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialog,modal:!0,width:"400px","append-to-body":""},on:{"update:visible":function(t){e.dialog=t}}},[t("el-form",{attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"当前账号"}},[e._v(" "+e._s(e.user.account)+" ")]),t("el-alert",{staticClass:"mb-20",attrs:{title:"验证账户的真实性,绑定后请使用新账户来重新登录!",type:"warning"}}),e.user.is_auth?t("el-form-item",{attrs:{label:"验证码"}},[t("el-input",{staticStyle:{width:"260px"},attrs:{placeholder:"请输入验证码",maxlength:"6"},model:{value:e.code,callback:function(t){e.code=t},expression:"code"}},[t("el-button",{attrs:{slot:"append",loading:e.loading},on:{click:function(t){return e.sendCode(!0)}},slot:"append"},[e._v("发送验证码")])],1)],1):e._e(),!e.editPass||e.globalConfig.sysInfo.regauth&&e.user.is_auth?e._e():t("el-form-item",{attrs:{label:"原密码"}},[t("el-input",{attrs:{"show-password":"",placeholder:"请输入原来的密码"},model:{value:e.originalPassword,callback:function(t){e.originalPassword=t},expression:"originalPassword"}})],1),e.editPass?e._e():t("el-form-item",{attrs:{label:"新账号"}},[t("el-input",{attrs:{placeholder:"请输入新的账号"},model:{value:e.account,callback:function(t){e.account=t},expression:"account"}})],1),e.editPass?e._e():t("el-form-item",{attrs:{label:"新账号验证码"}},[t("el-input",{staticStyle:{width:"260px"},attrs:{placeholder:"请输入新账号验证码",maxlength:"6"},model:{value:e.newCode,callback:function(t){e.newCode=t},expression:"newCode"}},[t("el-button",{attrs:{slot:"append",loading:e.loading},on:{click:function(t){return e.sendCode(!1)}},slot:"append"},[e._v("发送验证码")])],1)],1),e.editPass?t("el-form-item",{attrs:{label:"新密码"}},[t("el-input",{attrs:{"show-password":"",placeholder:"请输入密码"},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1):e._e(),e.editPass?t("el-form-item",{attrs:{label:"重复密码"}},[t("el-input",{attrs:{"show-password":"",placeholder:"请输入重复输入密码"},model:{value:e.repass,callback:function(t){e.repass=t},expression:"repass"}})],1):e._e(),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.editPassword()}}},[e._v("保存")])],1)],1)],1),t("div",{staticClass:"mt-40",attrs:{align:"center"}},[t("el-button",{staticStyle:{width:"150px"},attrs:{type:"danger",plain:"",round:""},on:{click:e.logout}},[e._v("退出登录")])],1)],1),t("el-tab-pane",{staticClass:"pd-20",attrs:{label:"通用设置"}},[t("el-form",{ref:"form",attrs:{model:e.setting,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"发送消息:"}},[t("el-radio-group",{model:{value:e.setting.sendKey,callback:function(t){e.$set(e.setting,"sendKey",t)},expression:"setting.sendKey"}},[t("el-radio-button",{attrs:{label:"1"}},[e._v("Enter")]),t("el-radio-button",{attrs:{label:"2"}},[e._v("Ctrl + Enter")])],1)],1),t("el-form-item",{attrs:{label:"系统主题:"}},[t("el-radio-group",{model:{value:e.setting.theme,callback:function(t){e.$set(e.setting,"theme",t)},expression:"setting.theme"}},[t("el-radio-button",{attrs:{label:"default"}}),t("el-radio-button",{attrs:{label:"blue"}})],1)],1)],1),t("div",{staticClass:"setting-switch"},[t("el-switch",{model:{value:e.setting.isVoice,callback:function(t){e.$set(e.setting,"isVoice",t)},expression:"setting.isVoice"}}),e._v(" 开启新消息声音提醒 ")],1),t("div",{staticClass:"setting-switch"},[t("el-switch",{model:{value:e.setting.avatarCricle,callback:function(t){e.$set(e.setting,"avatarCricle",t)},expression:"setting.avatarCricle"}}),e._v(" 开启聊天圆形头像(需要刷新) ")],1),t("div",{staticClass:"setting-switch"},[t("el-switch",{model:{value:e.setting.hideMessageName,callback:function(t){e.$set(e.setting,"hideMessageName",t)},expression:"setting.hideMessageName"}}),e._v(" 是否隐藏聊天窗口内的联系人名字 ")],1),t("div",{staticClass:"setting-switch"},[t("el-switch",{model:{value:e.setting.hideMessageTime,callback:function(t){e.$set(e.setting,"hideMessageTime",t)},expression:"setting.hideMessageTime"}}),e._v(" 是否隐藏聊天窗口内的消息发送时间 ")],1)],1),1==parseInt(e.globalConfig.demon_mode)?t("el-tab-pane",{staticClass:"pd-20",attrs:{label:"关于 IM"}},[t("div",{staticClass:"about-logo"},[t("el-avatar",{attrs:{src:e.$packageData.logo,size:50}}),t("br"),t("br"),t("p",[t("span",{staticClass:"fc-primary"},[e._v(" "+e._s(e.$packageData.name)+" ")]),e._v("for "+e._s(e.$packageData.version)+" ")])],1),t("div",{staticClass:"setting-version"},[t("b",[e._v(" 已经支持功能:")]),e._l(e.$packageData.funcList,(function(s){return t("p",{key:s.icon},[t("i",{class:s.icon}),e._v(" "+e._s(s.text))])}))],2)]):e._e(),1==parseInt(e.globalConfig.demon_mode)?t("el-tab-pane",{staticClass:"pd-20",attrs:{label:"开源"}},[t("div",{staticClass:"about-logo"},[t("el-avatar",{attrs:{src:e.$packageData.logo,size:50}}),t("br"),t("br"),t("p",[t("span",{staticClass:"fc-primary"},[e._v(" "+e._s(e.$packageData.name)+" ")]),e._v("for "+e._s(e.$packageData.version)+" ")])],1),t("div",{staticClass:"setting-version"},[t("p",[e._v(" 前端地址:"),t("a",{staticClass:"fc-primary",attrs:{href:e.$packageData.frontUrl,target:"_blank"}},[e._v("[链接] im-chat-front")])]),t("p",[e._v(" 后端地址:"),t("a",{staticClass:"fc-primary",attrs:{href:e.$packageData.backstageUrl,target:"_blank"}},[e._v("[链接] im-instant-chat")])])]),t("div",{staticClass:"setting-version",staticStyle:{color:"#a6a6a6"}},[t("p",[e._v("前端技术栈vue+Lemon-IMUI+element-UI")]),t("p",[e._v("后端技术栈thinkphp6+workerman")])]),t("div",{staticClass:"setting-version"},[t("p",[e._v(" QQ交流群 "),t("a",{staticClass:"fc-primary",attrs:{href:e.$packageData.qqGroupUrl,target:"_blank"}},[e._v("336921267")])])])]):e._e()],1)},Ue=[],Ne=function(){var e=this,t=e._self._c;return t("div",{staticClass:"sc-cropper"},[t("div",{staticClass:"sc-cropper__img"},[t("img",{ref:"img",attrs:{src:e.src}})]),t("div",{staticClass:"sc-cropper__preview"},[t("h4",[e._v("图像预览")]),t("div",{ref:"preview",staticClass:"sc-cropper__preview__img"})])])},Pe=[],Fe=s(255),Le=s.n(Fe),je={props:{src:{type:String,default:""},compress:{type:Number,default:1},aspectRatio:{type:Number,default:NaN}},data(){return{crop:null}},watch:{aspectRatio(e){this.crop.setAspectRatio(e)}},mounted(){this.init()},methods:{init(){this.crop=new(Le())(this.$refs.img,{viewMode:2,dragMode:"move",responsive:!1,aspectRatio:this.aspectRatio,preview:this.$refs.preview})},setAspectRatio(e){this.crop.setAspectRatio(e)},getCropData(e,t="image/jpeg"){e(this.crop.getCroppedCanvas().toDataURL(t,this.compress))},getCropBlob(e,t="image/jpeg"){this.crop.getCroppedCanvas().toBlob((t=>{e(t)}),t,this.compress)},getCropFile(e,t="fileName.jpg",s="image/jpeg"){this.crop.getCroppedCanvas().toBlob((a=>{let i=new File([a],t,{type:s});e(i)}),s,this.compress)}}},Re=je,De=(0,d.Z)(Re,Ne,Pe,!1,null,"c7313a98",null),Oe=De.exports;r().get("UserInfo");var Be={name:"manageGroup",props:{},components:{Cropper:Oe},data(){return{componentsKey:1,maxSize:5,compress:1,aspectRatio:1,cropperDialogVisible:!1,cropper:!0,cropperImg:"",tempImg:"",dialogVisible:!1,dialog:!1,dialogTitle:"修改密码",editPass:1,originalPassword:"",account:"",password:"",repass:"",code:"",newCode:"",loading:!1}},computed:{...(0,v.rn)({setting:e=>e.setting,user:e=>e.userInfo,globalConfig:e=>e.globalConfig}),getUrl(){return window.BASE_URL+"/common/upload/uploadAvatar"},getToken(){const e=r().get("authToken");return{Authorization:e}}},watch:{setting:{handler(e,t){this.$api.imApi.settingAPI(e);let s=r().get("UserInfo");s.setting=e,r().set("UserInfo",s)},deep:!0},editPass(e){this.dialogTitle=1==e?"修改密码":"修改账号"}},methods:{logout(){this.$confirm("确定退出登录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$store.dispatch("LogOut").then((()=>{this.$router.push("/login")}))})).catch((()=>{}))},submitForm(){if(""==this.user.realname)return this.$message.error("请输入昵称"),!1;let e={realname:this.user.realname,email:this.user.email,sex:this.user.sex,motto:this.user.motto};this.$api.imApi.updateUserInfo(e).then((e=>{if(0==e.code){this.$message.success("修改成功");let e=JSON.parse(JSON.stringify(this.user));this.$store.commit("SET_USERINFO",e)}}))},isImg(e){var t="(.jpg|.png|.gif|.jpeg)$",s=new RegExp(t);s.test(e.toLowerCase())?this.fileIsImg=!0:this.fileIsImg=!1},change(e){if(this.cropper&&"ready"==e.status){if(this.isImg(e.name),!this.fileIsImg)return this.$message.error("选择的文件非图像类文件"),!1;this.componentsKey++,this.cropperDialogVisible=!0,this.cropperImg=URL.createObjectURL(e.raw)}},before(e){e=this.cropper?this.cropperUploadFile:e;const t=e.size/1024/1024<this.maxSize;if(!t)return this.$message.warning(`上传文件大小不能超过 ${this.maxSize}MB!`),!1;this.isImg(e.name),this.tempImg=URL.createObjectURL(e)},request(e){const t=this.$loading({lock:!0,text:"Loading"}),s=new FormData;var a=this.cropper?this.cropperUploadFile:e.file;s.append("file",a),s.append("type",1),this.$api.commonApi.uploadAvatar(s).then((s=>{this.cropperImg="",t.close(),this.handleAvatarSuccess(s),e.onSuccess(s)})).catch((s=>{t.close(),e.onError(s)}))},cropperSave(){var e=this.$refs.upload.uploadFiles[0].raw;this.$refs.cropper.getCropFile((e=>{this.cropperUploadFile=e,this.$refs.upload.submit(),this.cropperDialogVisible=!1}),e.name,e.type)},handleAvatarSuccess(e,t){let s=this.$store.state.userInfo;this.$set(s,"avatar",e.data),this.$store.commit("SET_USERINFO",s)},editInfo(e){this.dialog=!0,this.editPass=e},editPassword(){if(""==this.code&&this.user.is_auth)return this.$message({message:"请输入验证码",type:"warning"}),!1;if(this.editPass){if(""==this.password||this.password.length<6||this.password.length>16)return this.$message({message:"请输入6-16个字符串的密码",type:"warning"}),!1;if(this.password!=this.repass)return this.$message({message:"两次密码不一致",type:"warning"}),!1;if(!this.originalPassword)return this.$message({message:"请输入原密码",type:"warning"}),!1;let e={password:this.password,code:this.code,originalPassword:this.originalPassword};this.$api.imApi.editPassword(e).then((e=>{0==e.code&&(this.dialog=!1,this.password="",this.repass="",this.$message({message:e.msg,type:"success"}))}))}else{if(""==this.account)return this.$message({message:"请输入账号",type:"warning"}),!1;if(""==this.newCode)return this.$message({message:"请输入新账户验证码",type:"warning"}),!1;let e={account:this.account,code:this.code,newCode:this.newCode};this.$api.imApi.editAccount(e).then((e=>{0==e.code&&(this.dialog=!1,this.account="",this.code="",this.newCode="",this.$message({message:e.msg,type:"success"}),this.$store.dispatch("LogOut").then((()=>{this.$router.push("/login")})))}))}},sendCode(e){let t=e?this.user.account:this.account,s=this.editPass?3:4;if(""==t)return this.$message({message:"请输入新的账号",type:"warning"}),!1;this.loading=!0,this.$store.dispatch("sendCode",{type:s,account:t}).then((e=>{this.$message.success("发送成功"),this.loading=!1})).catch((()=>{this.loading=!1}))}}},ze=Be,Ee=(0,d.Z)(ze,Me,Ue,!1,null,"691e79b6",null),Ve=Ee.exports,Ge=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"添加好友",visible:e.visible,modal:!0,width:e.width,"append-to-body":""},on:{close:e.closeDialog}},[t("div",{staticClass:"mb-20"},[t("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入账号进行搜索","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleChange.apply(null,arguments)}},model:{value:e.keywords,callback:function(t){e.keywords=t},expression:"keywords"}},[t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.handleChange},slot:"append"})],1)],1),t("div",{staticClass:"dialog-main"},[t("div",{staticClass:"member-list"},e._l(e.list,(function(s){return t("div",{key:s.user_id,staticClass:"member-item",on:{click:function(t){return e.$user(s.user_id)}}},[t("div",{staticClass:"member-avatar"},[t("img",{attrs:{src:s.avatar,alt:"avatar"}})]),t("div",{staticClass:"member-content"},[t("div",{staticClass:"member-header"},[t("span",{staticClass:"member-name"},[e._v(e._s(s.realname))]),t("span",{staticClass:"member-account"},[e._v(e._s(s.account))])]),t("div",{staticClass:"member-actions"},[t("el-button",{attrs:{type:"primary",size:"mini"}},[e._v("查看")])],1)])])})),0),0==e.list.length?t("el-empty"):e._e()],1)])},Ze=[],qe={name:"addFriend",props:{visible:{type:Boolean,default:!1},width:{type:String,default:"612px"}},data(){return{keywords:"",list:[]}},mounted(){},methods:{closeDialog(){this.$emit("update:visible",!1),this.selectUid=[]},handleChange(){this.keywords&&this.$api.imApi.searchUser({keywords:this.keywords}).then((e=>{this.list=e.data}))}}},We=qe,He=(0,d.Z)(We,Ge,Ze,!1,null,"18f3aea4",null),Ke=He.exports,Je=function(){var e=this,t=e._self._c;return t("span",{staticClass:"sc-state",class:[{"sc-status-processing":e.pulse},"sc-state-bg--"+e.type]})},Ye=[],Qe={props:{type:{type:String,default:"primary"},pulse:{type:[Boolean,Number],default:!0}}},Xe=Qe,et=(0,d.Z)(Xe,Je,Ye,!1,null,"bf2f9cfc",null),tt=et.exports,st=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.status,expression:"status"}],staticClass:"webrtc-box"},[e._m(0),e._m(1),t("video",{directives:[{name:"show",rawName:"v-show",value:e.localStream&&e.is_video,expression:"localStream && is_video"}],ref:"localvideo",staticClass:"localvideo",attrs:{autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}}),t("video",{directives:[{name:"show",rawName:"v-show",value:e.remoteStream&&e.is_video,expression:"remoteStream && is_video"}],ref:"remotevideo",staticClass:"remotevideo",attrs:{autoplay:"",playsinline:""}}),t("div",[e.caller?t("div",{staticClass:"call-user"},[2==e.status&&e.is_video?e._e():t("img",{staticClass:"avatar",attrs:{src:e.caller.avatar,alt:""}}),t("div",{staticClass:"text"},[e.is_video||2!=e.status?e._e():t("b",[e._v(e._s(e.caller.displayName))]),2!=e.status?t("span",[e.isReceived?t("span",[e._v(" "+e._s(e.caller.displayName)+" 正在请求与您"+e._s(e.is_video?"视频":"语音")+"通话")]):t("span",[e._v("您正对 "),t("b",[e._v(e._s(e.caller.displayName))]),e._v(" 发起"+e._s(e.is_video?"视频":"语音")+"通话")])]):e._e()]),e.callTime&&2==e.status?t("div",{staticClass:"call-time"},[e._v(" "+e._s(e.setCallTime())+" ")]):e._e()]):e._e(),t("div",{staticClass:"calling-button"},[e.caller&&3==e.status?t("div",{staticClass:"button"},[t("img",{staticClass:"image",attrs:{src:"https://im.file.raingad.com/static/image/jieting.png"},on:{click:function(t){return e.answer()}}}),t("div",{staticClass:"text"},[e._v("接听")])]):e._e(),2==e.status?t("div",{staticClass:"button"},[t("img",{staticClass:"image-icon",attrs:{src:"https://im.file.raingad.com/static/image/voice"+(e.voiceStatus?"":"-off")+".png"},on:{click:function(t){return e.switchVoice()}}})]):e._e(),e.caller&&0!=e.status?t("div",{staticClass:"button"},[t("img",{staticClass:"image",attrs:{src:"https://im.file.raingad.com/static/image/guaduan.png"},on:{click:function(t){return e.hangup(!0)}}}),t("div",{staticClass:"text"},[e._v("挂断")])]):e._e(),2==e.status?t("div",{staticClass:"button"},[e.is_video?t("img",{staticClass:"image-icon",attrs:{src:"https://im.file.raingad.com/static/image/camera"+(e.videoStatus?"":"-off")+".png"},on:{click:function(t){return e.switchVideo()}}}):t("div",{staticClass:"image-icon"})]):e._e()])])])},at=[function(){var e=this,t=e._self._c;return t("audio",{attrs:{id:"music1"}},[t("source",{attrs:{src:"//im.file.raingad.com/static/voice/calling.mp3"}})])},function(){var e=this,t=e._self._c;return t("audio",{attrs:{id:"music2"}},[t("source",{attrs:{src:"//im.file.raingad.com/static/voice/guaduan.mp3"}})])}],it={name:"webrtc",props:{contact:{type:Object,default:{}},userInfo:{type:Object,default:{}},config:{type:Object,default:{}},alias:{type:String,default:"raingad"}},data(){return{pc:null,status:0,localVideo:"",remoteVideo:"",remoteStream:null,localStream:null,caller:null,is_video:1,isReceived:!1,videoStatus:!0,voiceStatus:!0,cutdown:40,timer:null,offerParams:{},callTime:0,timerIntervalId:null}},mounted(){this.localVideo=this.$refs.localvideo,this.remoteVideo=this.$refs.remotevideo},methods:{initPeer(e){let t=this.config,s={iceServers:[{urls:["stun:stun.xten.com","stun:stun.l.google.com:19302","stun:stun1.l.google.com:19302","stun:stun2.l.google.com:19302","stun:stun3.l.google.com:19302","stun:stun4.l.google.com:19302"]},{urls:t.stun?[t.stun]:["stun:stun.callwithus.com"],username:t.stunUser??null,credential:t.stunPass??null}]};this.pc=new RTCPeerConnection(s),this.pc.ontrack=e=>{this.localVideo&&(this.remoteStream=e.streams[0],this.remoteVideo.srcObject=e.streams[0])},this.localStream=e,e.getTracks().forEach((t=>{this.pc.addTrack(t,e)})),this.localVideo.srcObject=this.localStream},initLocalStream(e,t){this.offerParams=t?{offerToRecieveAudio:1,offerToRecieveVideo:1}:{offerToRecieveAudio:1,offerToRecieveVideo:0};let s=1==t;var a=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;a({video:s,audio:{echoCancellation:!0}},(t=>{this.initPeer(t),e?(this.$emit("message",{event:"calling"}),this.status=1,this.timer=setInterval((()=>{this.cutdown--,0==this.cutdown&&this.hangup(!0)}),1e3)):(this.$emit("message",{event:"acceptRtc",code:904}),this.startTime())}),(e=>{this.hangup(!0);let s=1==t?"视频":"语音";this.$message.error("请连接"+s+"设备,并开启"+s+"权限")}))},called(e){if(this.status||this.caller)return!1;this.is_video=e,this.caller=this.contact,this.initLocalStream(!0,e),this.playMusicCall("state")},answer(){this.status=2,this.initLocalStream(!1,this.is_video),this.playMusicCall("close")},startTime(){this.timerIntervalId=setInterval((()=>{this.callTime++}),1e3)},setCallTime(){let e=this.callTime;const t=Math.floor(e/3600),s=Math.floor((e-3600*t)/60),a=e-3600*t-60*s;return`${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`},hangup(e){clearInterval(this.timer),clearInterval(this.timerIntervalId),2!=this.status&&this.playMusicCall("close");let t=902;2==this.status?t=906:3==this.status?t=903:4==this.status&&(t=907),this.status&&(this.status=0,this.closeLocalMedia(),this.remoteStream=null,this.playMusicHandup(),this.isReceived=!1,this.caller=null,this.voiceStatus=!0,this.videoStatus=!0),this.$emit("message",{event:"hangup",code:t,isbtn:e,callTime:this.callTime}),this.callTime=0},closeLocalMedia(){this.localStream&&this.localStream.getTracks()&&this.localStream.getTracks().forEach((e=>{e.stop()})),this.localStream=null},switchVoice(){if(null==this.localStream)return alert("请打开音视频"),!1;const e=this.localStream.getTracks();this.voiceStatus?(e.forEach((e=>{"audio"===e.kind&&(e.enabled=!1)})),this.voiceStatus=!1):(e.forEach((e=>{"audio"===e.kind&&(e.enabled=!0)})),this.voiceStatus=!0)},switchVideo(){if(null==this.localStream)return alert("请打开音视频"),!1;const e=this.localStream.getTracks();this.videoStatus?(e.forEach((e=>{"video"===e.kind&&(e.enabled=!1)})),this.videoStatus=!1):(e.forEach((e=>{"video"===e.kind&&(e.enabled=!0)})),this.videoStatus=!0)},webrtcAction(e){let t=e.extends;switch(t.event){case"calling":this.caller=e.fromUser,this.is_video=parseInt(t.type),this.status=3,this.isReceived=!0,this.playMusicCall("state");break;case"hangup":this.hangup(!1);break;case"busy":this.status=4,this.hangup(!1);break;case"acceptRtc":this.status=2,clearInterval(this.timer),this.startTime(),this.playMusicCall("close"),this.createOffer(),this.onicecandidate();break;case"turndown":break;case"answer":this.pc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:t.sdp}));break;case"iceCandidate":setTimeout((()=>{"object"===typeof t.iceCandidate?this.pc.addIceCandidate(new RTCIceCandidate(t.iceCandidate)):this.pc.addIceCandidate(new RTCIceCandidate(JSON.parse(t.iceCandidate)))}),100);break;case"offer":this.pc.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:t.sdp})),this.createAnswer();break}},createOffer(){this.pc.createOffer(this.offerParams).then((e=>{this.pc.setLocalDescription(e),this.$emit("message",{event:"offer",sdp:e.sdp})}))},createAnswer(){this.pc.createAnswer(this.offerParams).then((e=>{this.pc.setLocalDescription(e),this.$emit("message",{event:"answer",sdp:e.sdp}),this.onicecandidate()}))},onicecandidate(){this.pc.onicecandidate=e=>{var t=e.candidate;t&&this.$emit("message",{event:"iceCandidate",iceCandidate:JSON.parse(JSON.stringify(t))})}},playMusicCall(e){var t=document.getElementById("music1");if("close"===e)return t.pause();t.loop="state"===e,t.paused?t.play():t.pause()},playMusicHandup(){var e=document.getElementById("music2");e.play()}}},nt=it,ot=(0,d.Z)(nt,st,at,!1,null,"5b411a52",null),rt=ot.exports,lt=function(){var e=this,t=e._self._c;return t("el-container",[t("el-header",{staticClass:"slider-aside"},[t("el-tabs",{staticClass:"tab-diy",attrs:{"tab-position":"bottom"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{attrs:{label:"我收到的",name:"receive"}}),t("el-tab-pane",{attrs:{label:"我发送的",name:"send"}})],1)],1),t("el-main",{staticClass:"no-padding"},[t("div",{staticClass:"apply-list"},[t("div",{staticClass:"apply-list-main"},[t("el-scrollbar",[t("el-alert",{staticClass:"mt-10 mb-10",attrs:{"show-icon":"",title:"未处理的邀请消息会在每次初始化或者页面刷新时会重新提示!",type:"warning"}}),e._l(e.list,(function(s,a){return t("div",{key:a,staticClass:"apply-list-item"},[t("div",{staticClass:"avatar"},[e.params.is_mine?e._e():t("el-avatar",{attrs:{src:s.create_user_info.avatar}}),e.params.is_mine?t("el-avatar",{attrs:{src:s.user_id_info.avatar}}):e._e()],1),t("div",{staticClass:"main"},[e.params.is_mine?e._e():t("div",{on:{click:function(t){return e.$user(s.create_user_info.user_id)}}},[t("span",{staticClass:"fc-primary cur-handle"},[e._v(e._s(s.create_user_info.realname))]),e._v(" 申请添加为好友 "),1==s.status?t("el-tag",{attrs:{type:"success"}},[e._v("已同意")]):e._e()],1),e.params.is_mine?t("div",{on:{click:function(t){return e.$user(s.user_id_info.user_id)}}},[e._v(" 请求添加 "),t("span",{staticClass:"fc-primary cur-handle"},[e._v(e._s(s.user_id_info.realname))]),e._v(" 为好友 "),1==s.status?t("el-tag",{attrs:{type:"success"}},[e._v("已同意")]):e._e()],1):e._e(),t("div",{staticClass:"f-12 c-999"},[e._v(e._s(s.remark))])]),e.params.is_mine?t("div",{staticClass:"option"},[1==s.status?t("span",{staticClass:"fc-primary cur-handle",on:{click:function(t){return e.$store.commit("openChat",s.user_id_info.user_id)}}},[e._v("发消息")]):e._e(),2==s.status?t("el-tag",{attrs:{type:"warning"}},[e._v("待同意")]):e._e(),0==s.status?t("el-tag",{attrs:{type:"danger"}},[e._v("已拒绝")]):e._e()],1):t("div",{staticClass:"option"},[2==s.status?t("el-popconfirm",{attrs:{title:"您确定接受该好友的申请吗?"},on:{confirm:function(t){return e.acceptApply(s.friend_id,!0)}}},[t("el-button",{attrs:{slot:"reference",type:"success",circle:"",plain:"",icon:"el-icon-check"},slot:"reference"})],1):e._e(),2==s.status?t("el-popconfirm",{staticClass:"ml-15",attrs:{title:"您确定拒绝该好友的申请吗?"},on:{confirm:function(t){return e.acceptApply(s.friend_id,!1)}}},[t("el-button",{attrs:{slot:"reference",type:"danger",circle:"",plain:"",icon:"el-icon-close"},slot:"reference"})],1):e._e(),1==s.status?t("span",{staticClass:"fc-primary cur-handle",on:{click:function(t){return e.$store.commit("openChat",s.create_user_info.user_id)}}},[e._v("发消息")]):e._e(),0==s.status?t("el-tag",{attrs:{type:"danger"}},[e._v("已拒绝")]):e._e()],1)])})),0==e.list.length?t("div",[t("el-empty",{attrs:{description:"暂无数据"}})],1):e._e()],2)],1),e.singlePage?e._e():t("div",{staticClass:"apply-list-page",attrs:{align:"center"}},[t("el-pagination",{attrs:{background:"","hide-on-single-page":e.singlePage,"current-page":e.params.page,"page-sizes":[20,50,100,200,300,400,500],"page-size":e.params.limit,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleChange,"current-change":e.getList,"update:currentPage":function(t){return e.$set(e.params,"page",t)},"update:current-page":function(t){return e.$set(e.params,"page",t)},"update:pageSize":function(t){return e.$set(e.params,"limit",t)},"update:page-size":function(t){return e.$set(e.params,"limit",t)}}})],1)])])],1)},ct=[],dt={name:"apply",data(){return{singlePage:!0,total:0,list:[],activeName:"receive",params:{page:1,limit:20,is_mine:0}}},mounted(){this.getList()},methods:{handleClick(e){"send"==e.name?this.params.is_mine=1:"receive"==e.name&&(this.params.is_mine=0),this.params.page=1,this.getList()},acceptApply(e,t){let s=t?1:0;this.$api.friendApi.acceptFriend({friend_id:e,status:s}).then((e=>{this.$message.success("操作成功"),this.getList()}))},getList(){this.$api.friendApi.getApplyList(this.params).then((e=>{this.list=e.data,this.total=e.count,this.singlePage=this.total<=this.params.limit}))},handleChange(e){this.params.limit=e,this.getList()}}},ut=dt,pt=(0,d.Z)(ut,lt,ct,!1,null,"5aced73a",null),mt=pt.exports,ht=s.p+"assets/img/invite.108c2fc8.png",gt=s(2176);const ft=()=>(new Date).getTime(),vt=r().get("UserInfo");var bt={name:"app",components:{Socket:q,ChatRecord:W.Z,ChatSet:X,ChatTop:ne,VoiceRecorder:me,webrtc:rt,Group:he.Z,groupQr:ye,Files:Ae,addFriend:Ke,Setting:Ve,ChooseDialog:we.Z,OnlineStatus:tt,Apply:mt},props:{width:{type:String,default:"1000px"},height:{type:String,default:"640px"},fullScreen:{type:Boolean,default:!1}},data(){const e=this.$createElement;var t=this;let s=this.$store.state.globalConfig.chatInfo;return{noSimpleTips:"系统已关闭单聊,或者群已开启禁言,无法发送消息",isFullscreen:!1,curWidth:this.width,curHeight:this.height,unread:0,webrtcConfig:s,wsData:null,webrtcLock:!1,caller:"",is_video:1,curFile:null,componentKey:1,searchResult:!1,addFriendBox:!1,createChatBox:!1,forwardBox:!1,noticeBox:!1,messageBox:!1,webrtcBox:!1,groupSetting:!1,VoiceStatus:!1,groupQrShow:!1,contactSetting:{},groupUserCount:0,dialogTitle:"创建群聊",isAdd:1,userIds:[],notice:"",searchList:[],keywords:"",displayName:"",oldName:"",isEdit:!1,user:{id:vt.user_id,displayName:vt.realname,avatar:vt.avatar,account:vt.account},params:{page:1,limit:10},is_group:0,group_id:"",contacts:[],allUser:[],groupUser:[],currentChat:{},currentMessage:{},chatTopList:[],playAudio:null,groupMenu:[{text:"发送消息",click:(e,t,s)=>{const{IMUI:a,contact:i}=t;a.changeContact(i.user_id),s()},visible:e=>e.contact.user_id!=this.user.id&&1==this.globalConfig.sysInfo.runMode},{text:"设置管理员",click:(e,t,s)=>{const{IMUI:a,contact:i}=t;s(),this.$confirm("确定设置该成员为管理员吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$api.imApi.setManagerAPI({id:this.group_id,user_id:i.user_id,role:2}),this.$message({type:"success",message:"设置成功!"})}))},visible:e=>3==e.contact.role&&this.currentChat.owner_id==this.user.id},{text:"取消管理员",click:(e,t,s)=>{const{IMUI:a,contact:i}=t;s(),this.$confirm("确定取消该成员的管理员权限吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$api.imApi.setManagerAPI({id:this.group_id,user_id:i.user_id,role:3}),this.$message({type:"success",message:"取消成功!"})}))},visible:e=>2==e.contact.role&&this.currentChat.owner_id==this.user.id},{text:"查看资料",click:(e,t,s)=>{const{IMUI:a,contact:i}=t;s(),this.$user(i.user_id)}},{text:"移出群聊",color:"red",click:(e,t,s)=>{const{IMUI:a,contact:i}=t;s(),this.$confirm("确定移除该成员吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$api.imApi.removeUserAPI({id:this.group_id,user_id:i.user_id})}))},visible:e=>e.contact.user_id!=this.user.id&&this.currentChat.owner_id!=e.contact.user_id&&this.currentChat.role<=2}],contactContextmenu:[{click(e,s,a){const{IMUI:i,contact:n}=s;t.$user(n.user_id),a()},icon:"el-icon-tickets",text:"查看资料",visible:e=>0==e.contact.is_group},{icon:"el-icon-upload2",text:"置顶聊天",click:(e,s,a)=>{const{IMUI:i,contact:n}=s;t.$api.imApi.setChatTopAPI({id:n.id,is_top:1,is_group:n.is_group}).then((e=>{if(0==e.code){i.updateContact({id:n.id,is_top:1}),n.is_top=1;const e=t.chatTopList.filter((e=>e.id==n.id));e.length||t.chatTopList.push(n)}})),a()},visible:e=>0==e.contact.is_top},{icon:"el-icon-download",text:"取消置顶",click:(e,s,a)=>{const{IMUI:i,contact:n}=s;t.$api.imApi.setChatTopAPI({id:n.id,is_top:0,is_group:n.is_group}).then((e=>{0==e.code&&(i.updateContact({id:n.id,is_top:0}),B.pH(this.chatTopList,"id",n.id))})),a()},visible:e=>1==e.contact.is_top},{click(e,s,a){const{IMUI:i,contact:n}=s;a(),t.$api.imApi.isNoticeAPI({id:n.id,is_notice:0,is_group:n.is_group}),i.updateContact({id:n.id,is_notice:0})},icon:"el-icon-bell",text:"消息免打扰",visible:e=>1==e.contact.is_notice&&"system"!=e.contact.id},{click(e,s,a){const{IMUI:i,contact:n}=s;a(),t.$api.imApi.isNoticeAPI({id:n.id,is_notice:1,is_group:n.is_group}),i.updateContact({id:n.id,is_notice:1})},icon:"el-icon-close-notification",text:"取消免打扰",visible:e=>0==e.contact.is_notice&&"system"!=e.contact.id},{click(e,s,a){const{IMUI:i,contact:n}=s;a(),t.$confirm("确定删除该好友吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{t.$api.friendApi.delFriend({id:n.id}).then((e=>{0==e.code&&(t.$message({type:"success",message:"删除成功!"}),t.removeContact(n.id))}))})).catch((()=>{}))},icon:"el-icon-delete",color:"red",text:"删除好友",visible:e=>2==t.globalConfig.sysInfo.runMode&&0==e.contact.is_group},{click(e,s,a){const{IMUI:i,contact:n}=s;a(),t.$confirm("确定解散该群聊吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{t.$api.imApi.removeGrouprAPI({id:n.id})})).catch((()=>{}))},icon:"el-icon-delete",color:"red",text:"解散群聊",visible:e=>e.contact.owner_id==t.user.id&&1==e.contact.is_group},{click(e,s,a){const{IMUI:i,contact:n}=s;a(),t.$confirm("确定退出该群聊吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{t.$api.imApi.removeUserAPI({id:n.id,user_id:t.user.id}).then((e=>{0==e.code&&(t.$message({type:"success",message:"退出成功!"}),t.removeContact(n.id))}))})).catch((()=>{}))},icon:"el-icon-remove-outline",color:"red",text:"退出群聊",visible:e=>e.contact.owner_id!=t.user.id&&1==e.contact.is_group}],contextmenu:[{click:(t,s,a)=>{const{IMUI:i,message:n}=s;this.$api.imApi.undoMessageAPI({id:n.id}).then((t=>{const s={id:n.id,type:"event",content:e("div",[e("span",["你撤回了一条消息"," ",e("span",{directives:[{name:"show",value:"text"==n.type}],style:"color:#409EFF;cursor:pointer",attrs:{content:n.content},on:{click:e=>{i.setEditorValue(e.target.getAttribute("content"))}}},["重新编辑"])])]),toContactId:n.toContactId,sendTime:ft()};i.updateMessage(s)})).catch((e=>{this.$message.error("发生错误")})),a()},visible:e=>e.message.fromUser.id==this.user.id&&ft()-e.message.sendTime<12e4,text:"撤回消息"},{text:"转发",click:(e,t,s)=>{this.currentMessage=t.message;const{IMUI:a}=this.$refs,i=a.getContacts(),n=a.getCurrentContact();this.allUser=B.L4(i,"id",n.id),s(),this.forwardBox=!0}},{visible:e=>"text"==e.message.type,text:"复制文字",click:(e,t,s)=>{this.$clipboard(t.message.content),this.$message({type:"success",message:"复制成功!"}),s()}},{visible:e=>"image"==e.message.type,text:"下载图片",click:(e,t,s)=>{const{message:a}=t;s(),a.download&&(window.location=a.download)}},{visible:e=>"file"==e.message.type,text:"下载文件",click:(e,t,s)=>{const{message:a}=t;window.open(a.download),s()}}]}},computed:{...(0,v.rn)({wsStatus:e=>e.wsStatus,socketAction:e=>e.socketAction,contactId:e=>e.toContactId,contactSync:e=>e.contactSync,setting:e=>e.setting,userInfo:e=>e.userInfo,globalConfig:e=>e.globalConfig}),formatTime(){return function(e){return B.i$(e)}}},watch:{wsStatus(e){console.log("🚀 ~ file: index.vue:895 ~ wsStatus ~ val:",e)},isFullscreen(e){r().set("isFullscreen",e),this.curWidth=e?"100vw":this.width,this.curHeight=e?"100vh":this.height},playAudio(e){if(e&&this.currentMessage){let e=this.currentMessage;var t=this;const{IMUI:s}=this.$refs;this.playAudio.addEventListener("ended",(function(){console.log("声音停止"),t.playAudio=null,t.currentMessage=null,s.updateMessage({id:e.id,status:"successd",isPlay:0})}),!1)}},contactSync(e){this.$emit("newChat",e);const{IMUI:t}=this.$refs;t.changeContact(this.contactId)},unread(e){this.$store.commit("updateUnread",e)},keywords(){const{IMUI:e}=this.$refs,t=e.getContacts();this.searchContact(t)},socketAction(e){const t=this.$createElement;let s=e.data;const{IMUI:a}=this.$refs;let i=r().get("client_id");switch(e.type){case"isOnline":a.updateContact({id:s.id,is_online:s.is_online});break;case"offline":s.id!=this.user.id||s.client_id==i||s.isMobile||(this.$message.error="您的账号在其他地方登录,已被迫下线!",this.$store.dispatch("LogOut").then((()=>{this.$router.push({path:"/login"})})));break;case"simple":case"group":if(s.fromUser.id!=this.user.id){var n=this.getContact(s.toContactId);this.setting.isVoice&&1==n.is_notice&&this.popNotice(s)}this.recieveMsg(s);break;case"undoMessage":a.updateMessage(s);break;case"setChatTop":if(a.updateContact({id:s.id,is_top:s.is_top}),1==s.is_top){const e=this.getContact(s.id),t=this.chatTopList.filter((e=>e.id==s.id));t.length||this.chatTopList.push(e)}else B.pH(this.chatTopList,"id",s.id);break;case"setIsNotice":a.updateContact({id:s.id,is_notice:s.is_notice});break;case"editGroupName":a.updateContact({id:s.id,displayName:s.displayName});const e={id:B.NW(),type:"event",content:t("div",[t("span",[s.editUserName," 修改了群名为 ",s.displayName])]),toContactId:s.id,sendTime:ft()};a.appendMessage(e,!0);break;case"isRead":this.setLocalMsgIsRead(s);break;case"readAll":let o=a.getMessages(s.toContactId);o.forEach((e=>{if(0==e.is_read){const t={id:e.id,is_read:1,status:"succeed",content:e.content+" "};a.updateMessage(t)}}));break;case"addGroup":s.owner_id!=this.user.id&&a.appendContact(s),this.$api.commonApi.bindGroupAPI({client_id:i,group_id:s.id});break;case"setManager":case"addGroupUser":case"removeUser":s.group_id==this.group_id&&this.getGroupUserList(s.group_id),a.updateContact({id:s.group_id,avatar:s.avatar});break;case"removeGroup":this.removeContact(s.group_id);break;case"setNotice":a.updateContact({id:s.group_id,notice:s.notice}),a.appendMessage({id:B.NW(),type:"event",content:t("div",[t("span",["管理员 发布了公告: ",s.notice])]),toContactId:s.group_id,sendTime:ft()},!0);break;case"groupSetting":a.updateContact({id:s.group_id,setting:s.setting});break;case"appendContact":a.appendContact(s);break;case"webrtc":if(s.fromUser.id==this.user.id){let e=s.extends,t=r().get("wsData");return[902,903,905,906,907].includes(parseInt(e.code))&&(t.content=s.content,a.updateMessage(t),this.webrtcLock=!1),0==e.isMobile||"calling"==e.event?void("calling"==e.event&&(r().set("wsData",s),this.recieveMsg(s))):void("otherOpt"==e.event&&(t.content=s.content,a.updateMessage(t),this.wsData=null,this.caller="",this.webrtcLock=!1,this.$refs.webrtc.hangup(!1)))}if(this.wsData&&this.wsData.id!=s.id)this.$api.imApi.sendToMsg({toContactId:s.fromUser.user_id,type:s.extends.type,event:"busy",status:s.extends.status,code:907,id:s.id,msg_id:s.msg_id});else{if("calling"==s.extends.event)this.recieveMsg(s),this.wsData=s,r().set("wsData",s),this.caller=s.fromUser;else if("offer"==s.extends.event||"answer"==s.extends.event)this.webrtcLock=!0;else if("hangup"==s.extends.event){let e=r().get("wsData");e.content=s.content,a.updateMessage(e),this.webrtcLock=!1}this.wsData&&this.wsData.id==s.id&&this.$refs.webrtc.webrtcAction(JSON.parse(JSON.stringify(s)))}break}}},created(){let e=this.$store.state.userInfo;e&&(this.user={id:e.user_id,displayName:e.realname,avatar:e.avatar,account:e.account}),window.Notification?"granted"==Notification.permission?console.log("允许通知"):"denied"!=Notification.permission&&(console.log("需要通知权限"),Notification.requestPermission((e=>{}))):console.error("浏览器不支持Notification")},mounted(){this.fullScreen&&(this.isFullscreen=r().get("isFullscreen")),this.searchResult&&document.addEventListener("click",(function(e){that.$refs.configforms.contains(e.target)||(that.searchResult=!1)})),this.getSimpleChat()},methods:{called(e){if(!parseInt(this.globalConfig.chatInfo.webrtc))return this.$message.error("当前系统未开启音视频通话功能");this.webrtcLock?this.$message.error("其他端正在通话中"):(this.webrtcBox=!0,this.is_video=e,this.caller=this.currentChat,this.$refs.webrtc.called(e))},getSimpleChat(e){const t=this.$createElement;this.$nextTick((()=>{const s=this.$refs.IMUI;this.IMUI=s,s.setLastContentRender("voice",(e=>"[语音]")),s.setLastContentRender("video",(e=>"[视频]")),s.setLastContentRender("webrtc",(e=>"[音视频通话]"));let a=[{name:"emoji"},{name:"screenShot",title:"发送截屏",click:()=>{this.shotScreen()},render:()=>t("i",{class:"el-icon el-icon-scissors f-18",style:"vertical-align: middle;font-weight: 600;"})},{name:"uploadImage",title:"发送图片"},{name:"sendVoice",title:"发送语音",click:()=>{this.VoiceStatus=!0},render:()=>t("i",{class:"el-icon el-icon-microphone f-18",style:"vertical-align: middle;font-weight: 600;"})},{name:"uploadVideo",title:"发送视频",click:()=>{var e=this.$refs.uploadVideo;e.click()},render:()=>t("i",{class:"el-icon el-icon-video-play f-18",style:"vertical-align: middle;font-weight: 600;"},[t("input",{style:"display:none",attrs:{type:"file",accept:"video/*"},ref:"uploadVideo",on:{change:e=>{this.uploadVideo(e)}}})])},{name:"uploadFile",title:"发送文件"}];s.initEditorTools(a),s.initEmoji(O),this.$api.imApi.getContactsAPI().then((a=>{const i=a.data;this.contacts=i;var n={};if(i.forEach(((t,a)=>{t.type&&(n.type=t.type,n.content=t.lastContent,i[a]["lastContent"]=s.lastContentRender(n)),t.unread&&!e&&(this.unread+=t.unread)})),2==this.globalConfig.sysInfo.runMode){const e={id:"system",displayName:"新邀请",avatar:ht,index:"[1]系统消息",click(e){e()},renderContainer:()=>t(mt),lastSendTime:a.page,lastContent:a.page?"新的申请":"",unread:parseInt(a.count),is_notice:1};this.unread+=a.count,i.push({...e})}this.$store.commit("initContacts",i),this.getChatTop(i),s.initContacts(i),this.initMenus(s)}))}))},shotScreen(){new gt.Z({enableWebRtc:!0,level:999999,completeCallback:this.callback,closeCallback:this.closeShotScreen})},closeShotScreen(){console.log("关闭截图")},callback(e){let t=new Image;t.src=e.base64,t.onload=()=>{let e=this.convertImageToCanvas(t),s=e.toDataURL("image/jpeg"),a=window.atob(s.split(",")[1]),i=new ArrayBuffer(a.length),n=new Uint8Array(i);for(let t=0;t<a.length;t++)n[t]=a.charCodeAt(t);let o=new File([i],"screenShot"+B.NW()+".jpg",{type:"image/jpeg"});this.$confirm("<img src="+t.src+' style="width:390px;height:100%;max-height:360px;object-fit:contain">',"发送截图",{dangerouslyUseHTMLString:!0,confirmButtonText:"发送",showCancelButton:!0,callback:(e,t)=>{if("confirm"==e){let e={content:URL.createObjectURL(o),fromUser:this.user,id:B.NW(),sendTime:ft(),status:"going",toContactId:this.currentChat.id,type:"image"};this.diySendMessage(e,o)}else t.close()}})}},convertImageToCanvas(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},initMenus(e){const t=this.$createElement;let s=[{name:"messages",unread:this.unread},{name:"contacts"},{name:"files",title:"文件",unread:0,render:e=>t("i",{class:"el-icon-folder"}),renderContainer:()=>t(Ae,{attrs:{title:this.dialogTitle}})},{name:"setting",title:"设置",unread:0,render:e=>t("i",{class:"el-icon-setting"}),renderContainer:()=>t(Ve),isBottom:!0}];this.fullScreen&&s.push({name:"fullscrren",title:"全屏/窗口",unread:0,click:()=>{this.isFullscreen=!this.isFullscreen},render:e=>t("i",{class:"el-icon-full-screen"})}),(vt.role>0||this.globalConfig.demon_mode)&&s.push({name:"manage",title:"后台管理",unread:0,click:()=>{this.$route.path.indexOf("manage")>-1?this.$emit("close"):this.$router.push("/manage/index")},render:e=>t("i",{class:"el-icon-s-operation"}),isBottom:!0}),e.initMenus(s)},getChatTop(){for(var e=this.contacts,t=[],s=0;s<e.length;s++)1==e[s].is_top&&t.push(e[s]);this.chatTopList=t},getContact(e){const{IMUI:t}=this.$refs,s=t.getContacts();for(var a=0;a<s.length;a++)if(s[a].id==e)return s[a]},wrapKey(e){return 1==this.setting.sendKey?13==e.keyCode&&e.ctrlKey:13==e.keyCode&&!e.ctrlKey&&!e.shiftKey},setSendKey(e){return 1==this.setting.sendKey?13==e.keyCode&&!e.ctrlKey&&!e.shiftKey:13==e.keyCode&&e.ctrlKey},handleMessageClick(e,t,s,a){if("status"==t)return a.updateMessage({id:s.id,status:"going"}),s.status="going",void this.diySendMessage(s,this.curFile);if("avatar"!=t){if("voice"==s.type){if(!this.playAudio)return this.currentMessage=s,this.playVoice(s,a);this.playAudio.pause(),this.playAudio=null,a.updateMessage({id:this.currentMessage.id,status:"successd",isPlay:0}),s.id!=this.currentMessage.id&&(this.currentMessage=s,this.playVoice(s,a))}var i=["image","file","video"];if(i.includes(s.type)){if(!s.preview)return this.$message.error("没有配置预览接口");this.$preview(s.preview)}else"webrtc"==s.type&&this.called(parseFloat(s.extends.type))}else this.$user(s.fromUser.id)},playVoice(e,t){this.playAudio=new Audio(e.content),this.playAudio.play(),t.updateMessage({id:e.id,status:"succeed",isPlay:1})},openChat(e,t){this.keywords="",t.changeContact(e)},handleChangeContact(e,t){t.updateContact({id:e.id,unread:0}),this.unread-=e.unread;const{IMUI:s}=this.$refs;this.initMenus(s),this.params.page=1,this.displayName=e.displayName,this.oldName=e.displayName,this.currentChat=e,1==e.is_group&&this.group_id!=e.id&&this.getGroupUserList(e.id),this.is_group=e.is_group,1==this.is_group&&(this.group_id=e.id,this.notice=e.notice);for(var a=[],i=s.getMessages(e.id),n=0;i.length>n;n++)0==i[n].is_read&&i[n].fromUser.id!=this.user.id&&a.push(i[n]);a.length>0&&this.$api.imApi.setMsgIsReadAPI({is_group:e.is_group,toContactId:e.id,messages:a,fromUser:e.id}).then((e=>{0==e.code&&this.setLocalMsgIsRead(a)})),t.closeDrawer()},uploadVideo(e){if(!this.globalConfig.chatInfo.simpleChat&&0==this.is_group||!this.nospeak())return this.$message.error(this.noSimpleTips),!1;let t,s=e.srcElement.files[0],a=URL.createObjectURL(s),i=new Audio(a);i.addEventListener("loadedmetadata",(function(e){t=i.duration}));let n={content:a,fromUser:this.user,id:B.NW(),sendTime:ft(),status:"going",toContactId:this.currentChat.id,type:"video",extends:{duration:t}};this.diySendMessage(n,s),this.$refs.uploadVideo.value=""},sendVoice(e,t){if(!this.globalConfig.chatInfo.simpleChat&&0==this.is_group||!this.nospeak())return this.$message.error(this.noSimpleTips),!1;let s={content:URL.createObjectURL(t),fromUser:this.user,id:B.NW(),sendTime:ft(),status:"going",toContactId:this.currentChat.id,type:"voice",isPlay:0,extends:{duration:e}};this.VoiceStatus=!1,this.diySendMessage(s,t)},removeContact(e){const{IMUI:t}=this.$refs,s=t.getCurrentContact();s.id==e&&t.changeContact(null),t.removeContact(e)},diySendMessage(e,t){const{IMUI:s}=this.$refs;s.appendMessage(e,!0),this.handleSend(e,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{status:"succeed"};s.updateContact({id:e.toContactId,lastContent:s.lastContentRender(e),lastSendTime:e.sendTime}),s.CacheDraft.remove(e.toContactId),s.updateMessage(Object.assign(e,t))}),t)},nospeak(){return!(1==this.is_group&&this.currentChat.setting.nospeak>0)||(1==this.currentChat.setting.nospeak&&2==this.currentChat.role||2==this.currentChat.setting.nospeak&&1==this.currentChat.role)},handleSend(e,t,s){const{IMUI:a}=this.$refs;if(e.is_group=this.is_group,this.curFile=s,1!=this.globalConfig.chatInfo.simpleChat&&0==this.is_group||!this.nospeak())return a.removeMessage(e.id),this.$message.error(this.noSimpleTips),!1;let i=new FormData;if(s){if(s.size>1024*this.globalConfig.fileUpload.size*1024)return a.removeMessage(e.id),this.$message.error("上传的内容不等大于"+this.globalConfig.fileUpload.size+"MB");i.append("file",s),i.append("message",JSON.stringify(e)),this.$api.imApi.sendFileAPI(i).then((e=>{0==e.code?(a.setEditorValue(""),a.updateMessage(e.data),t()):t({status:"failed"})})).catch((e=>{t({status:"failed"})}))}else this.$api.imApi.sendMessageAPI(e).then((e=>{0==e.code?(a.setEditorValue(""),a.updateMessage(e.data),t()):t({status:"failed"})})).catch((e=>{t({status:"failed"})}))},handlePullMessages(e,t,s){let a=this.params,i=s.getMessages(e.id);return i.length>0&&(a.last_id=i[0].msg_id,a.page=1),a.toContactId=e.id,a.is_group=e.is_group,this.$api.imApi.getMessageListAPI(a).then((e=>{this.params.page++;let s=!1,a=e.data;a.length<this.params.limit&&(s=!0),t(a,s)})).catch((e=>{t([],!0)})),!0},publishNotice(){this.noticeBox=!1,this.$api.imApi.setNoticeAPI({id:this.group_id,notice:this.notice}).then((e=>{0==e.code&&this.$message({type:"success",message:"发布成功!"})}))},openNotice(){var e="<div style='white-space: pre;'>"+this.notice+"</div>";this.$alert(e,"群公告",{confirmButtonText:"确定",dangerouslyUseHTMLString:!0})},openCreateGroup(){this.isAdd=1,this.dialogTitle="创建群聊",this.createChatBox=!0},changeOwner(){this.isAdd=2,this.dialogTitle="转让群聊",this.createChatBox=!0},openAddGroupUser(){var e=B.Nj(this.groupUser,"user_id");this.isAdd=0,this.userIds=e,this.dialogTitle="添加群成员",this.createChatBox=!0},manageGroup(e,t,s){this.createChatBox=!1;let a=this.globalConfig.chatInfo.groupUserMax;if(0==t){if(e.length+this.groupUser.length>a&&a>0)return this.$message.error("群成员不能大于"+a+"人!");this.$api.imApi.addGroupUserAPI({user_ids:e,id:this.group_id})}else if(1==t){if(e.length>a&&a>0)return this.$message.error("群成员不能大于"+a+"人!");this.$api.imApi.addGroupAPI({user_ids:e,name:s}).then((e=>{const t=e.data,{IMUI:s}=this.$refs;0==e.code&&(s.appendContact(t),s.changeContact(t.id))}))}else this.$api.imApi.changeOwnerAPI({user_id:e[0],id:this.group_id}).then((t=>{const{IMUI:s}=this.$refs;0==t.code&&(this.$message({type:"success",message:t.msg}),this.groupSetting=!1,s.updateContact({id:this.group_id,role:3,owner_id:e[0]}),s.changeContact(null))}))},forwardUser(e){if(e.length>5)return this.$message.error("转发的人数不能超过5人");this.forwardBox=!1;var t=this.currentMessage;this.$api.imApi.forwardMessageAPI({user_ids:e,msg_id:t.msg_id})},getGroupUserList(e){this.$api.imApi.groupUserListAPI({group_id:e}).then((e=>{if(0==e.code){var t=e.data;this.groupUser=t,this.groupUserCount=t.length}}))},saveGroupName(e){if(this.displayName.length<1)return this.$notify({title:"警告",message:"名称不能为空!",type:"warning"}),this.isEdit=!1,!1;if(this.displayName!=this.oldName){const{IMUI:t}=this.$refs;this.$api.imApi.editGroupNameAPI({id:e.id,displayName:this.displayName}).then((s=>{t.updateContact({id:e.id,displayName:this.displayName})}))}this.isEdit=!1},openGroupSetting(e){this.groupSetting=!0,this.contactSetting=e||this.currentChat,this.componentKey++},closeSearch(){var e=this;setTimeout((function(){e.searchResult=!1}),300)},searchContact(e){""!=this.keywords&&(this.searchList=B.iu(e,["displayName","name_py"],this.keywords))},setLocalMsgIsRead(e){const{IMUI:t}=this.$refs;for(let s=0;e.length>s;s++){const a={id:e[s]["id"],is_read:1,status:"succeed",content:e[s]["content"]+" "};t.updateMessage(a)}},popNotice(e){let t=this;const{IMUI:s}=this.$refs;if("granted"==Notification.permission){let a=e.fromUser.displayName||e.fromUser.realname,i=s.lastContentRender(e),n=new Notification("收到一条新消息",{body:a+""+i,icon:e.fromUser.avatar});n.onclick=function(e){t.$nextTick((()=>{setTimeout((()=>{}),500)})),window.focus(),n.close()}}else{const e=document.getElementById("chatAudio");e.currentTime=0,e.play()}},recieveMsg(e){const{IMUI:t}=this.$refs,s=t.getCurrentContact();if(s.id==e.toContactId&&"system"!=s.id){var a=[];a.push(e),this.$api.imApi.setMsgIsReadAPI({toContactId:s.id,is_group:s.is_group,messages:a,fromUser:e.fromUser.id})}else this.user.id!=e.fromUser.id&&(this.unread++,this.initMenus(t));this.user.id==e.toContactId&&(e.toContactId=e.toUser),"system"==e.toContactId&&t.updateContact({id:e.toContactId,lastContent:t.lastContentRender(e),lastSendTime:e.sendTime,unread:"+1"}),t.appendMessage(e,!0)},openMessageBox(){this.messageBox=!0,this.componentKey+=1},openSetting(){const{IMUI:e}=this.$refs;e.changeMenu("setting")},handleCommand(e){"addGroup"==e?this.openCreateGroup():this.addFriendBox=!0},rtcMsg(e){let t="",s="",a="";this.wsData&&(s=this.wsData.msg_id??"",a=this.wsData.id??"");let i=!0;switch(e.event){case"calling":a=B.NW();break;case"hangup":907==e.code&&this.$message.error("对方忙线中"),e.isbtn||(i=!1),this.wsData="",this.webrtcLock=!1;break;case"iceCandidate":let s={};s["candidate"]=e["iceCandidate"]["candidate"],s["sdpMLineIndex"]=e["iceCandidate"]["sdpMLineIndex"],s["sdpMid"]=e["iceCandidate"]["sdpMid"],t=JSON.stringify(s);break;case"mediaDevices":i=!1;break}i&&this.$api.imApi.sendToMsg({id:a,msg_id:s,toContactId:this.caller.id,type:this.is_video?1:0,event:e.event,status:e.status??"",code:e.code??"",callTime:e.callTime??"",sdp:e.sdp??"",iceCandidate:t}).then((t=>{0==t.code&&"calling"==e.event&&(this.wsData=t.data,r().set("wsData",t.data),this.recieveMsg(t.data)),"907"==t.data.extends.code&&this.$message.error("对方不在线")}))},reconnect(){this.$refs.socket.initWebSocket()},closeSocket(){this.$refs.socket.close()},logout(){this.$confirm("你确定要退出聊天室吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$store.dispatch("LogOut").then((()=>{this.$router.push({path:"/login"})}))})).catch((()=>{this.$message({type:"info",message:"已取消退出"})}))}}},_t=bt,Ct=(0,d.Z)(_t,R,D,!1,null,"44b2238c",null),yt=Ct.exports;var wt={name:"app",components:{rainagdIm:yt},props:{dialogTableVisible:{type:Boolean,default:!1}},data(){return{unread:0,dialogIsShow:!0}},computed:{formatTime(){return function(e){return timeFormat(e)}}},watch:{dialogTableVisible(e){e&&this.$nextTick((()=>{this.dialogIsShow=e}))}},created(){},mounted(){},methods:{closeDialog(){this.appList=!1,this.$nextTick((()=>{this.$emit("update:dialogTableVisible",!1)}))},contactSync(e){this.dialogIsShow=!0,this.$emit("update:dialogTableVisible",!0)}}},xt=wt,kt=(0,d.Z)(xt,L,j,!1,null,"6e7fdceb",null),It=kt.exports,$t={name:"Index",components:{Message:It},data(){return{dialogTableVisible:!1,unread:0,allContacts:[]}},computed:{...(0,v.rn)({chatSocket:e=>e.unread,getContacts:e=>e.allContacts})},watch:{chatSocket(e){this.unread=e},getContacts(e){this.allContacts=e}},methods:{showMessageBox(){this.dialogTableVisible?this.dialogTableVisible=!1:this.dialogTableVisible=!0},scrollTo(){window.scrollTo(0,document.body.scrollHeight)}}},St=$t,Tt=(0,d.Z)(St,P,F,!1,null,"2db4013e",null),At=Tt.exports,Mt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-container",style:"background-image:url("+e.Background+")"},[t("raingadIm",{attrs:{fullScreen:!0}})],1)},Ut=[],Nt=s.p+"assets/img/login-background.4d69904c.jpg",Pt={name:"app",components:{raingadIm:yt},data(){return{Background:Nt}}},Ft=Pt,Lt=(0,d.Z)(Ft,Mt,Ut,!1,null,"f0e47f02",null),jt=Lt.exports,Rt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"login-wrapper",style:"background-image:url("+e.Background+")"},[t("div",{staticClass:"form-box"},[t("div",{staticClass:"form-title"},[t("img",{attrs:{src:e.globalConfig.sysInfo.logo?e.globalConfig.sysInfo.logo:e.$packageData.logo,width:"100",alt:"icon"}})]),t("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"label-width":"0px"}},[t("el-form-item",{attrs:{prop:"account"}},[t("el-input",{ref:"account",attrs:{type:"text","auto-complete":"off",placeholder:"请输入账号","prefix-icon":"el-icon-user"},model:{value:e.loginForm.account,callback:function(t){e.$set(e.loginForm,"account",t)},expression:"loginForm.account"}})],1),t("el-form-item",{directives:[{name:"show",rawName:"v-show",value:!e.forget,expression:"!forget"}],attrs:{prop:"password"}},[t("el-input",{attrs:{type:"password","auto-complete":"off",placeholder:"请输入密码","prefix-icon":"el-icon-lock"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin.apply(null,arguments)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),t("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.forget,expression:"forget"}],attrs:{prop:"code"}},[t("el-input",{attrs:{placeholder:"请输入验证码",maxlength:"6"},model:{value:e.loginForm.code,callback:function(t){e.$set(e.loginForm,"code",t)},expression:"loginForm.code"}},[t("el-button",{attrs:{slot:"append",loading:e.coding},on:{click:function(t){return e.sendCode()}},slot:"append"},[e._v("发送验证码")])],1)],1),e.globalConfig.demon_mode?t("div",{staticClass:"c-666",staticStyle:{"font-size":"12px"}},[e._v("演示账号13800000002~13800000020密码:123456")]):e._e(),t("el-form-item",[t("div",{staticClass:"remenber"},[t("el-checkbox",{model:{value:e.loginForm.rememberMe,callback:function(t){e.$set(e.loginForm,"rememberMe",t)},expression:"loginForm.rememberMe"}},[e._v("记住我")]),t("el-button",{attrs:{type:"text"},on:{click:function(t){e.forget=!e.forget}}},[e._v(e._s(e.forget?"密码登陆":"忘记密码"))])],1)]),t("el-form-item",[t("el-button",{staticStyle:{width:"100%"},attrs:{loading:e.loading,size:"small",type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin.apply(null,arguments)}}},[e.loading?t("span",[e._v("登 录 中...")]):t("span",[e._v("登 录")])])],1),1==e.globalConfig.sysInfo.regtype?t("el-form-item",[t("el-button",{staticStyle:{width:"100%"},attrs:{size:"small",plain:""},on:{click:function(t){return e.$router.push("/register")}}},[e._v(" 注册 ")])],1):e._e(),t("div",{staticClass:"c-999",attrs:{align:"center"}},[e._v(e._s(e.globalConfig.sysInfo.name)+" for "+e._s(e.$packageData.version))])],1)],1)])},Dt=[],Ot={name:"Login",data(){return{Background:Nt,forget:!1,loginForm:{account:"",password:"",code:"",rememberMe:!0},loginRules:{account:[{required:!0,trigger:"blur",message:"用户名不能为空"}],password:[{required:!0,trigger:"blur",message:"密码不能为空"}]},loading:!1,coding:!1,redirect:void 0}},computed:{...(0,v.rn)({globalConfig:e=>e.globalConfig})},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0},forget(e){e&&(this.loginForm.password="123456")}},mounted(){this.$nextTick((()=>{if(this.globalConfig.demon_mode){const e=Math.floor(19*Math.random()+2);this.loginForm.account=138e8+e,this.loginForm.password="123456",this.$refs.account.focus()}const e=r().get("LoginAccount");e&&(this.loginForm.account=e.account,this.loginForm.password=e.password,this.loginForm.rememberMe=!0,this.$refs.account.focus())}))},methods:{handleLogin(){!this.forget||this.loginForm.code?this.$refs.loginForm.validate((e=>{const t={account:this.loginForm.account,password:this.loginForm.password,code:this.loginForm.code};this.loginForm.rememberMe?r().set("LoginAccount",t):r().rm("LoginAccount"),e&&(this.loading=!0,this.$store.dispatch("Login",t).then((e=>{window.location.reload()})).catch((()=>{this.loading=!1})))})):this.$message.error("请输入验证码")},sendCode(){if(!this.loginForm.account)return void this.$message.error("请输入账号");this.coding=!0;let e={account:this.loginForm.account,type:1};this.$store.dispatch("sendCode",e).then((e=>{this.$message.success("发送成功"),this.coding=!1})).catch((()=>{this.coding=!1}))}}},Bt=Ot,zt=(0,d.Z)(Bt,Rt,Dt,!1,null,null,null),Et=zt.exports,Vt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"login-wrapper",style:"background-image:url("+e.Background+")"},[t("div",{staticClass:"form-box"},[t("div",{staticClass:"form-title"},[t("div",{staticClass:"f-14 cur-handle",on:{click:function(t){return e.$router.push("/login")}}},[t("i",{staticClass:"el-icon-back"},[e._v("返回")])]),e._m(0),t("div")]),t("el-form",{ref:"regForm",staticClass:"login-form",attrs:{model:e.regForm,rules:e.loginRules,"label-width":"0px"}},[t("el-form-item",{attrs:{prop:"account"}},[t("el-input",{ref:"account",attrs:{type:"text","auto-complete":"off",placeholder:"请输入账号:手机/邮箱","prefix-icon":"el-icon-user"},on:{input:e.handleInput},model:{value:e.regForm.account,callback:function(t){e.$set(e.regForm,"account",t)},expression:"regForm.account"}})],1),t("el-form-item",{attrs:{prop:"realname"}},[t("el-input",{ref:"realname",attrs:{type:"text","auto-complete":"off",placeholder:"请输入用户名/昵称","prefix-icon":"el-icon-user"},model:{value:e.regForm.realname,callback:function(t){e.$set(e.regForm,"realname",t)},expression:"regForm.realname"}})],1),0!=e.globalConfig.sysInfo.regauth?t("el-form-item",{attrs:{prop:"code"}},[t("el-input",{attrs:{placeholder:"请输入验证码",maxlength:"6"},model:{value:e.regForm.code,callback:function(t){e.$set(e.regForm,"code",t)},expression:"regForm.code"}},[t("el-button",{attrs:{slot:"append",loading:e.loading},on:{click:function(t){return e.sendCode(!0)}},slot:"append"},[e._v("发送验证码")])],1)],1):e._e(),t("el-form-item",{attrs:{prop:"password"}},[t("el-input",{attrs:{type:"password","show-password":"","auto-complete":"off",placeholder:"请输入密码","prefix-icon":"el-icon-lock"},model:{value:e.regForm.password,callback:function(t){e.$set(e.regForm,"password",t)},expression:"regForm.password"}})],1),t("el-form-item",{attrs:{prop:"password"}},[t("el-input",{attrs:{type:"password","show-password":"","auto-complete":"off",placeholder:"请再次输入密码","prefix-icon":"el-icon-lock"},model:{value:e.regForm.repass,callback:function(t){e.$set(e.regForm,"repass",t)},expression:"regForm.repass"}})],1),t("el-form-item",[t("el-button",{staticStyle:{width:"100%"},attrs:{loading:e.loading,size:"small",type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleRegist.apply(null,arguments)}}},[e.loading?t("span",[e._v("注 册 中...")]):t("span",[e._v("注册")])])],1),t("div",{staticClass:"c-999",attrs:{align:"center"}},[e._v(e._s(e.globalConfig.sysInfo.name)+" for "+e._s(e.$packageData.version))])],1)],1)])},Gt=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-40"},[t("b",[e._v("注册用户")])])}],Zt={name:"Register",data(){return{Background:Nt,regForm:{account:"",realname:"",password:"",repass:"",code:""},loginRules:{account:[{min:4,max:32,message:"长度在 4 到 32 个字符",trigger:"blur"}],realname:[{required:!0,message:"请输入用户名/昵称",trigger:"blur"},{min:2,max:16,message:"长度在 2 到 16 个字符",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,max:16,message:"长度在 6 到 16 个字符",trigger:"blur"}]},loading:!1,redirect:void 0}},computed:{...(0,v.rn)({globalConfig:e=>e.globalConfig})},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},mounted(){let e=this.globalConfig.sysInfo.regauth??0,t="请输入账号4-32个字符";switch(parseInt(e)){case 1:t="请输入正确的手机号";break;case 2:t="请输入正确的邮箱";break;case 3:t="请输入正确的手机号或者邮箱";break;default:t="请输入正确的账号"}let s={required:!0,message:t,trigger:"blur"};this.loginRules.account.push(s);let a={type:"email",message:t,trigger:"blur",validator:this.validateContact},i={type:"phone",message:t,trigger:"blur",validator:this.validateContact};1==e?this.loginRules.account.push(i):2==e?this.loginRules.account.push(a):3==e&&(this.loginRules.account.push(a),this.loginRules.account.push(i))},methods:{handleInput(e){const t=e.replace(/[\u4e00-\u9fa5]/g,"");this.regForm.account=t},validateContact(e,t,s){t?/^1[3456789]\d{9}$/.test(t)||/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(t)?s():s(new Error("请输入正确的手机号或邮箱")):s()},handleRegist(){this.$refs.regForm.validate((e=>{if(this.regForm.password!=this.regForm.repass)return this.$message.error("两次密码不一致"),!1;const t={account:this.regForm.account,realname:this.regForm.realname,password:this.regForm.password,code:this.regForm.code,inviteCode:this.$route.query.inviteCode??""};if(!e)return this.$message.error("请检查输入项");this.loading=!0,this.$api.commonApi.register(t).then((e=>{this.loading=!1,0===e.code&&(this.$message.success("注册成功"),this.$router.push("/login"))})).catch((e=>{this.loading=!1}))}))},sendCode(){if(!this.regForm.account)return void this.$message.error("请输入账号");this.coding=!0;let e={account:this.regForm.account,type:2};this.$store.dispatch("sendCode",e).then((e=>{this.$message.success("发送成功"),this.coding=!1})).catch((()=>{this.coding=!1}))}}},qt=Zt,Wt=(0,d.Z)(qt,Vt,Gt,!1,null,"9eb25bc4",null),Ht=Wt.exports,Kt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-container"},[t("el-container",{staticStyle:{height:"100vh",border:"1px solid #eee"}},[t("el-header",{staticStyle:{"text-align":"right","font-size":"12px","border-bottom":"1px solid #e6e6e6"}},[t("el-row",{style:{height:"60px"},attrs:{type:"flex",justify:"space-between",align:"middle"}},[t("el-col",{staticClass:"logo",attrs:{span:8}},[t("div",{staticClass:"image"},[t("img",{attrs:{src:e.globalConfig.sysInfo.logo,alt:"logo"}})]),t("div",{staticClass:"f-20 ml-5"},[e._v(e._s(e.globalConfig.sysInfo.name)+" 管理中心")])]),t("el-col",{staticClass:"text-right",attrs:{span:16}},[t("div",{staticClass:"user"},[t("span",{staticClass:"message"},[t("router-link",{attrs:{to:"/chat"}},[t("el-button",[e._v(" 进入聊天 ")])],1)],1),t("span",{staticClass:"message",on:{click:function(t){return e.showMessageBox()}}},[t("el-badge",{attrs:{value:e.unread,max:99,hidden:!e.unread}},[t("i",{staticClass:"el-icon-chat-line-round f-24",attrs:{circle:""}})])],1),t("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleCommand}},[t("div",{staticClass:"lz-flex lz-align-items-center cur-handle"},[t("span",{staticClass:"avatar"},[t("img",{attrs:{src:e.$store.state.userInfo.avatar,alt:"avatar"}})]),t("span",{staticClass:"username"},[e._v(e._s(e.$store.state.userInfo.realname))]),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"profile"}},[e._v("个人信息")]),t("el-dropdown-item",{attrs:{command:"logout"}},[e._v("退出登录")])],1)],1)],1)])],1)],1),t("el-container",[t("el-aside",{staticClass:"main-aside",style:{width:e.asideWidth}},[t("div",{staticClass:"aside-menu"},[t("el-scrollbar",[t("el-menu",{staticClass:"el-menu-vertical-demo",staticStyle:{border:"none"},attrs:{"default-active":e.active,mode:"vertical","ext-color":"#fff",collapse:e.isCollapse},on:{select:e.handleMenuSelect}},[e._l(e.routes,(function(s,a){return[t("el-menu-item",{key:a,attrs:{index:s.path}},[t("i",{class:s.meta.icon}),t("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(s.meta.title))])])]}))],2)],1)],1),t("div",{staticClass:"aside-bottom",on:{click:e.handleCollapse}},[t("span",{staticClass:"el-icon-s-fold f-18"})])]),t("el-main",{staticStyle:{"background-color":"#f5f5f5",padding:"0"}},[t("el-scrollbar",[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view",{key:e.key})],1)],1)],1)],1)],1),t("Message",{ref:"Message",attrs:{dialogTableVisible:e.dialogTableVisible},on:{"update:dialogTableVisible":function(t){e.dialogTableVisible=t},"update:dialog-table-visible":function(t){e.dialogTableVisible=t}}})],1)},Jt=[],Yt={name:"Index",components:{Message:It},data(){return{dialogTableVisible:!1,unread:0,allContacts:[],isCollapse:!1,asideWidth:"200px",active:"",routes:[]}},computed:{...(0,v.rn)({chatSocket:e=>e.unread,getContacts:e=>e.allContacts,globalConfig:e=>e.globalConfig}),key(){return this.$route.path}},watch:{chatSocket(e){this.unread=e},getContacts(e){this.allContacts=e},isCollapse(e){this.asideWidth=e?"65px":"200px"}},mounted(){this.isCollapse=r().get("isCollapse")||!1,this.active=this.$route.path;const e=this.$router.options.routes.filter((e=>"manage"==e.name));this.routes=e[0].children,window.addEventListener("resize",this.handleResize)},methods:{handleResize(){window.innerWidth<900?this.isCollapse=!0:this.isCollapse=!1},handleMenuSelect(e){this.active=e,this.$route.path!=e&&this.$router.push(e)},showMessageBox(){this.dialogTableVisible?this.dialogTableVisible=!1:this.dialogTableVisible=!0},handleCommand(e){"profile"==e?this.$user(this.$store.state.userInfo.user_id):this.$confirm("你确定要退出聊天室吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$store.dispatch("LogOut").then((()=>{this.$router.push({path:"/login"})}))})).catch((()=>{this.$message({type:"info",message:"已取消退出"})}))},handleCollapse(){this.isCollapse=!this.isCollapse,r().set("isCollapse",this.isCollapse)}}},Qt=Yt,Xt=(0,d.Z)(Qt,Kt,Jt,!1,null,"482b879c",null),es=Xt.exports,ts=[{path:"/manage",name:"manage",component:es,meta:{title:"管理"},icon:"el-icon-s-tools",children:[{path:"/manage/index",name:"index",component:()=>s.e(142).then(s.bind(s,3142)),meta:{title:"概况",icon:"el-icon-data-line"}},{path:"/manage/setting",name:"setting",component:()=>s.e(716).then(s.bind(s,9716)),meta:{title:"设置",icon:"el-icon-setting"}},{path:"/manage/user",name:"user",component:()=>s.e(584).then(s.bind(s,3584)),meta:{title:"成员",icon:"el-icon-user"}},{path:"/manage/group",name:"group",component:()=>s.e(173).then(s.bind(s,4173)),meta:{title:"群聊",icon:"el-icon-chat-dot-square"}},{path:"/manage/files",name:"files",component:()=>s.e(567).then(s.bind(s,7567)),meta:{title:"文件",icon:"el-icon-folder-opened"}}]}];a["default"].use(N.ZP);const ss=[{path:"/",name:"home",component:jt,meta:{title:"聊天"}},{path:"/chat",name:"chat",component:jt,meta:{title:"聊天演示页"}},{path:"/demo",name:"demo",component:At,meta:{title:"演示页"}},{path:"/login",name:"login",component:Et,meta:{title:"登录"}},{path:"/register",name:"register",component:Ht,meta:{title:"注册"}},{path:"*",redirect:"/404",hidden:!0},{path:"/404",component:()=>s.e(133).then(s.bind(s,4133)),hidden:!0}],as=()=>new N.ZP({mode:"hash",scrollBehavior:()=>({y:0}),routes:[...ss,...ts]}),is=as();function ns(){const e=as();is.matcher=e.matcher}var os=is,rs=s(6265),ls=s.n(rs);const cs={loadingCache:function(){if(r().get("authToken")&&!ls().defaults.headers.authToken){const e=r().get("UserInfo");e&&As.commit("SET_USERINFO",e)}As.commit("SET_APPNAME",r().get("systemName")),As.commit("SET_APPLOGO",r().get("systemLogo"))},updateAxiosCache:function(){ls().defaults.headers.authToken=r().get("authToken"),ls().defaults.headers.sessionId=r().get("sessionId")},updateAxiosHeaders:function(){ls().defaults.headers.authToken=r().get("authToken"),ls().defaults.headers.sessionId=r().get("sessionId")},rmAxiosCache:function(){r().rm("authToken"),r().rm("sessionId")}};var ds=cs;function us(){return new Promise(((e,t)=>{ds.rmAxiosCache(),delete ls().defaults.headers.authToken,delete ls().defaults.headers.sessionId,e(!0)}))}function ps(e,t){return new Promise(((s,a)=>{ls().defaults.headers.authToken=e,ls().defaults.headers.sessionId=t,s(!0)}))}function ms(){return r().get("authToken")&&!ls().defaults.headers.authToken&&ds.updateAxiosCache(),!!r().get("authToken")}var hs=s(5410),gs=s.n(hs),fs=s(9070);const vs=(0,fs.debounce)(500,(()=>{us().then((()=>{location.reload()})).catch((()=>{location.reload()}))})),bs=(0,fs.debounce)(500,((e,t="error")=>{(0,m.Message)({message:e,duration:1500,type:t})})),_s=(0,fs.debounce)(1e3,(e=>{m.MessageBox.confirm(e,"提示",{confirmButtonText:"确定",showCancelButton:!1,type:"warning"}).then((()=>{vs()})).catch((()=>{}))}));ls().defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";let Cs=[];Cs=-1!=window.location.href.indexOf("index.html")?window.location.href.split("index.html"):window.location.href.split("#");const ys=Cs.length>0?Cs[0]:window.location.href;window.location.protocol;window.BASE_URL=ys+"/";const ws=ls().create({baseURL:window.BASE_URL,timeout:6e4});ws.baseURL=window.BASE_URL,ws.interceptors.request.use((e=>{const t=r().get("sessionId"),s=r().get("authToken");t&&s&&(e.headers["sessionId"]=t,e.headers["Authorization"]=s);const a=e.headers["Content-Type"]&&-1!==e.headers["Content-Type"].indexOf("application/json");if(a)void 0!==e.data&&null!==e.data||(e.data={});else{const t=e.headers["Content-Type"]&&-1!==e.headers["Content-Type"].indexOf("multipart/form-data");e.data=t?e.data:gs().stringify(e.data)}return e}),(e=>Promise.reject(e))),ws.interceptors.response.use((e=>{const t=e.data;if(200!==e.status||"blob"!==e.config.responseType)return 0!==t.code?(-1===t.code?_s(t.msg):[400,402,403,404,405,502,500].includes(t.code)?bs(t.msg,"warning"):bs(t.msg),t):t;if(e.headers["content-disposition"]||e.headers["content-type"]&&-1!=e.headers["content-type"].indexOf("application/pdf"))return e;{const t=new Blob([e.data],{type:"application/json"}),s=new FileReader;s.onload=function(){const e=JSON.parse(this.result);e.msg&&bs(e.msg,1==e.code?"success":"error")},s.readAsText(t)}}),(e=>{if(e.response){const t=e.response;500==t.status?bs("网络错误,请检查您的网络"):t.data&&t.data.msg&&bs(t.data.msg)}return Promise.reject(e)}));var xs=ws;const ks={loginAPI:e=>xs({url:"common/pub/login",method:"post",data:e}),logoutAPI:()=>xs({url:"common/pub/logout",method:"post"}),bindClientIdAPI:e=>xs({url:"common/pub/bindUid",method:"post",data:e}),offlineAPI:e=>xs({url:"common/pub/offline",method:"post",data:e}),bindGroupAPI:e=>xs({url:"common/pub/bindGroup",method:"post",data:e}),sendCode:e=>xs({url:"common/pub/sendCode",method:"post",data:e}),getSystemInfo:e=>xs({url:"common/pub/getSystemInfo",method:"post",data:e}),register:e=>xs({url:"common/pub/register",method:"post",data:e}),uploadAvatar:e=>xs({url:"common/upload/uploadAvatar",method:"post",data:e,headers:{"Content-Type":"multipart/form-data"}})};var Is=ks;a["default"].use(v.ZP);const $s={userInfo:null,allAuth:null,socketAction:"",contactSync:"",toContactId:0,unread:0,allContacts:[],globalConfig:[],wsStatus:!0,setting:{sendKey:"1",theme:"default",isVoice:!0,avatarCricle:!1,hideMessageName:!1,hideMessageTime:!1}},Ss={SET_USERINFO:(e,t)=>{r().set("UserInfo",t),e.userInfo=t,t.setting&&(e.setting=t.setting)},SET_AUTH:(e,t)=>{const s=t.authToken,a=t.sessionId;r().set("authToken",s),r().set("sessionId",a),ps(s,a)},catchSocketAction(e,t){e.socketAction=t},updateUnread:(e,t)=>{e.unread=parseInt(t)},initContacts:(e,t)=>{e.allContacts=t},openChat:(e,t)=>{e.toContactId=t,e.contactSync=Math.random().toString(36).substr(-8)},updateSetting(e,t){e.userInfo.setting=t,e.setting=t},setGlobalConfig(e,t){e.globalConfig=t}},Ts={Login({commit:e,dispatch:t},s){return new Promise(((a,i)=>{Is.loginAPI(s).then((t=>{const s=t.data||s;e("SET_AUTH",s),e("SET_USERINFO",s.userInfo),a(t)})).catch((e=>{t("LogOut"),i(e)}))}))},LogOut({commit:e}){return new Promise(((e,t)=>{Is.logoutAPI().then((()=>{r().rm("authToken"),r().rm("sessionId"),r().rm("UserInfo"),us(),ns(),e()})).catch((e=>{t(e)}))}))},getSystemInfo({commit:e}){return new Promise(((t,s)=>{Is.getSystemInfo().then((s=>{0==s.code&&(r().set("globalConfig",s.data),e("setGlobalConfig",s.data),t(s))})).catch((e=>{s(e)}))}))},sendCode({commit:e},t){return new Promise(((e,s)=>{Is.sendCode(t).then((t=>{e(t)})).catch((e=>{s(e)}))}))}};var As=new v.ZP.Store({state:$s,mutations:Ss,actions:Ts}),Ms=s(5602),Us=s.n(Ms),Ns=s(1081);a["default"].directive("outside",Ns.Z);var Ps=s(530),Fs=s.n(Ps);const Ls=["/login","/register"],js=["/","/demo","/chat"];os.beforeEach(((e,t,s)=>{if(e.meta.disabled)s(!1);else if(Fs().start(),ms()){let t=r().get("globalConfig"),a=t.demon_mode,i="";a&&(i="/demo");let n=r().get("UserInfo");Ls.includes(e.path)||"/"==e.path&&i?(s({path:i}),Fs().done()):js.includes(e.path)&&0==t.sysInfo.state?(n&&n.role>0||a?s({path:"/manage/index"}):s({path:"/404",query:{msg:t.sysInfo.closeTips}}),Fs().done()):-1!==e.path.indexOf("manage")?n&&n.role>0||a?s():(m.Message.error("您没有权限访问该页面"),s(!1),Fs().done()):s()}else-1!==Ls.indexOf(e.path)?s():(s("/login"),Fs().done())})),os.afterEach((()=>{Fs().done()})),os.onError((e=>{const t=/Loading chunk (\d)+ failed/g,s=e.message.match(t),a=os.history.pending.fullPath;s&&os.replace(a)}));var Rs,Ds,Os,Bs,zs,Es,Vs=JSON.parse('{"name":"Raingad-IM","version":"3.0.4","description":"一款基于vue2.0的即时聊天工具","logo":"https://im.file.raingad.com/logo/logo.png","frontUrl":"https://gitee.com/raingad/im-chat-front","backstageUrl":"https://gitee.com/raingad/im-instant-chat","mobileUrl":"https://im.raingad.com/h5","author":"Raingad","license":"Apache2.0","qqGroupUrl":"https://jq.qq.com/?_wv=1027&k=jMQAt9lh","private":true,"funcList":[{"icon":"el-icon-chat-line-round","text":"支持单聊和群聊,支持发送表情、图片、语音、视频和文件消息"},{"icon":"el-icon-potato-strips","text":"单聊支持消息已读未读的状态显示,在线状态显示"},{"icon":"el-icon-user","text":"群聊创建、删除和群成员管理、群公告、群禁言等"},{"icon":"el-icon-ice-cream-round","text":"支持置顶联系人,消息免打扰;支持设置新消息声音提醒,浏览器通知"},{"icon":"el-icon-video-camera","text":"支持一对一音视频通话已打通web端和移动端"},{"icon":"el-icon-milk-tea","text":"支持文件、图片和绝大部分媒体文件在线预览"},{"icon":"el-icon-mobile-phone","text":"支持移动端H5、APP和小程序部分功能不兼容支持简易后台管理"},{"icon":"el-icon-coffee-cup","text":"全新支持企业模式和社区模式,社区模式支持注册、添加好友功能"}],"scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build","lint":"vue-cli-service lint"},"dependencies":{"axios":"^0.21.4","core-js":"^3.8.3","cropperjs":"^1.5.13","element-ui":"^2.15.13","js-audio-recorder":"^1.0.7","js-web-screen-shot":"^1.9.8-rc.3","lemon-imui":"^1.7.7","lockr":"^0.8.5","nprogress":"^0.2.0","v-clipboard":"^2.2.3","vue":"^2.6.14","vue-canvas-poster":"^1.2.1","vue-qr":"^4.0.9","vue-router":"^3.5.1","vuex":"^3.6.2"},"devDependencies":{"@babel/core":"^7.12.16","@babel/eslint-parser":"^7.12.16","@vue/cli-plugin-babel":"~5.0.0","@vue/cli-plugin-eslint":"~5.0.0","@vue/cli-plugin-router":"~5.0.0","@vue/cli-plugin-vuex":"~5.0.0","@vue/cli-service":"~5.0.0","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-vue":"^8.0.3","prettier":"^2.4.1","sass":"^1.32.7","sass-loader":"^12.0.0","vue-template-compiler":"^2.6.14"},"rules":{"generator-star-spacing":"off","no-tabs":"off","no-unused-vars":"off","no-console":"off","no-irregular-whitespace":"off","no-debugger":"off"}}'),Gs=s(8701),Zs=s.n(Gs),qs={name:"lemonMessageVoice",inheritAttrs:!1,inject:["IMUI"],render(){const e=arguments[0];return e("lemon-message-basic",Zs()([{class:"lemon-message-voice"},{props:{...this.$attrs}},{attrs:{reverse:this.$attrs.reverse,message:this.$attrs.message,hideName:this.$attrs.hideName,hideTime:this.$attrs.hideTime},scopedSlots:{content:t=>e("div",{class:["voice-card lz-flex lz-justify-content-start lz-align-items-center",{"im-rows-reverse":this.$attrs.reverse}],style:{width:3*t.extends.duration+"px"}},[e("div",{class:["iconfont icon-im-yuyin f-16",{"voice-icon":t.isPlay},{rotate180:this.$attrs.reverse}]}),"  ",e("div",[t.extends.duration,'"'])])}}]))}},Ws=qs,Hs=(0,d.Z)(Ws,Rs,Ds,!1,null,null,null),Ks=Hs.exports,Js={name:"lemonMessageVideo",inheritAttrs:!1,inject:["IMUI"],render(){const e=arguments[0];return e("lemon-message-basic",Zs()([{class:"lemon-message-video"},{props:{...this.$attrs}},{attrs:{reverse:this.$attrs.reverse,message:this.$attrs.message,hideName:this.$attrs.hideName,hideTime:this.$attrs.hideTime},scopedSlots:{content:t=>e("div",{class:["video-card"],style:{}},[e("el-image",{style:"max-height: 200px",attrs:{src:t.extends.poster,fit:"cover"}},[e("div",{slot:"error",class:"image-slot"},[e("i",{class:"el-icon-picture-outline"})])]),e("div",{class:"video-shadow"},[e("div",{class:"el-icon el-icon-video-play c-white f-28 video-icon"})])])}}]))}},Ys=Js,Qs=(0,d.Z)(Ys,Os,Bs,!1,null,null,null),Xs=Qs.exports,ea={name:"lemonMessageWebrtc",inheritAttrs:!1,inject:["IMUI"],render(){const e=arguments[0];return e("lemon-message-basic",Zs()([{class:"lemon-message-webrtc"},{props:{...this.$attrs}},{attrs:{reverse:this.$attrs.reverse,message:this.$attrs.message,hideName:this.$attrs.hideName,hideTime:this.$attrs.hideTime},scopedSlots:{content:t=>e("div",{class:["voice-card lz-flex lz-justify-content-start lz-align-items-center",{"im-rows-reverse":this.$attrs.reverse}],style:""},[e("div",{class:["el-icon f-16",{"el-icon-phone-outline":0==t.extends.type},{"el-icon-video-camera":1==t.extends.type},{rotate180:this.$attrs.reverse}]}),"  ",e("div",[t.content])])}}]))}},ta=ea,sa=(0,d.Z)(ta,zs,Es,!1,null,null,null),aa=sa.exports;const ia={getTaskList:e=>xs({url:"/manage/Task/getTaskList",method:"post",data:e}),startTask:e=>xs({url:"/manage/Task/startTask",method:"post",data:e}),stopTask:e=>xs({url:"/manage/Task/stopTask",method:"post",data:e}),getTaskLog:e=>xs({url:"/manage/Task/getTaskLog",method:"post",data:e}),clearTaskLog:e=>xs({url:"/manage/Task/clearTaskLog",method:"post",data:e})};var na=ia;const oa={setConfig:e=>xs({url:"manage/config/setConfig",method:"post",data:e}),getConfig:e=>xs({url:"manage/config/getConfig",method:"post",data:e}),getAllConfig:e=>xs({url:"manage/config/getAllConfig",method:"post",data:e}),getInviteLink:e=>xs({url:"manage/config/getInviteLink",method:"post",data:e}),sendTestEmail:e=>xs({url:"manage/config/sendTestEmail",method:"post",data:e})};var ra=oa;const la={getUserList:e=>xs({url:"/manage/User/index",method:"post",data:e}),addUser:e=>xs({url:"/manage/User/add",method:"post",data:e}),editUser:e=>xs({url:"/manage/User/edit",method:"post",data:e}),delUser:e=>xs({url:"/manage/User/del",method:"post",data:e}),getUserDetail:e=>xs({url:"/manage/User/detail",method:"post",data:e}),editPassword:e=>xs({url:"/manage/User/editPassword",method:"post",data:e}),setStatus:e=>xs({url:"/manage/User/setStatus",method:"post",data:e}),setRole:e=>xs({url:"/manage/User/setRole",method:"post",data:e})};var ca=la;const da={getGroupList:e=>xs({url:"/manage/Group/index",method:"post",data:e}),addGroupUser:e=>xs({url:"/manage/Group/addGroupUser",method:"post",data:e}),delGroupUser:e=>xs({url:"/manage/Group/delGroupUser",method:"post",data:e}),changeOwner:e=>xs({url:"/manage/Group/changeOwner",method:"post",data:e}),setManager:e=>xs({url:"/manage/Group/setManager",method:"post",data:e}),delGroup:e=>xs({url:"/manage/Group/del",method:"post",data:e})};var ua=da;const pa={getContactsAPI:e=>xs({url:"enterprise/im/getContacts",method:"post",data:e}),sendMessageAPI:e=>xs({url:"enterprise/im/sendMessage",method:"post",data:e}),forwardMessageAPI:e=>xs({url:"enterprise/im/forwardMessage",method:"post",data:e}),sendToMsg:e=>xs({url:"enterprise/im/sendToMsg",method:"post",data:e})};pa.forwardMessageAPI=e=>xs({url:"enterprise/im/forwardMessage",method:"post",data:e}),pa.sendFileAPI=e=>xs({url:"common/upload/uploadFile",method:"post",data:e,headers:{"Content-Type":"multipart/form-data"}}),pa.getMessageListAPI=e=>xs({url:"enterprise/im/getMessageList",method:"post",data:e}),pa.setMsgIsReadAPI=e=>xs({url:"enterprise/im/setMsgIsRead",method:"post",data:e}),pa.undoMessageAPI=e=>xs({url:"enterprise/im/undoMessage",method:"post",data:e}),pa.removeMessageAPI=e=>xs({url:"enterprise/im/removeMessage",method:"post",data:e}),pa.settingAPI=e=>xs({url:"enterprise/im/setting",method:"post",data:e}),pa.editGroupNameAPI=e=>xs({url:"enterprise/group/editGroupName",method:"post",data:e}),pa.groupUserListAPI=e=>xs({url:"enterprise/group/groupuserlist",method:"post",data:e}),pa.getAllUserAPI=e=>xs({url:"enterprise/group/getAllUser",method:"post",data:e}),pa.addGroupAPI=e=>xs({url:"enterprise/group/add",method:"post",data:e}),pa.setManagerAPI=e=>xs({url:"enterprise/group/setManager",method:"post",data:e}),pa.removeUserAPI=e=>xs({url:"enterprise/group/removeUser",method:"post",data:e}),pa.addGroupUserAPI=e=>xs({url:"enterprise/group/addGroupUser",method:"post",data:e}),pa.removeGrouprAPI=e=>xs({url:"enterprise/group/removeGroup",method:"post",data:e}),pa.setNoticeAPI=e=>xs({url:"enterprise/group/setNotice",method:"post",data:e}),pa.groupSettingAPI=e=>xs({url:"enterprise/group/groupSetting",method:"post",data:e}),pa.getGroupInfoAPI=e=>xs({url:"enterprise/group/groupInfo",method:"post",data:e}),pa.changeOwnerAPI=e=>xs({url:"enterprise/group/changeOwner",method:"post",data:e}),pa.isNoticeAPI=e=>xs({url:"enterprise/im/isNotice",method:"post",data:e}),pa.setChatTopAPI=e=>xs({url:"enterprise/im/setChatTop",method:"post",data:e}),pa.getUserInfo=e=>xs({url:"enterprise/im/getUserInfo",method:"post",data:e}),pa.getFileList=e=>xs({url:"enterprise/files/index",method:"post",data:e}),pa.updateUserInfo=e=>xs({url:"enterprise/im/updateUserInfo",method:"post",data:e}),pa.editAccount=e=>xs({url:"enterprise/im/editAccount",method:"post",data:e}),pa.editPassword=e=>xs({url:"enterprise/im/editpassword",method:"post",data:e}),pa.searchUser=e=>xs({url:"enterprise/im/searchUser",method:"post",data:e});var ma=pa;const ha={getApplyList:e=>xs({url:"enterprise/friend/index",method:"post",data:e}),addFriend:e=>xs({url:"enterprise/friend/add",method:"post",data:e}),delFriend:e=>xs({url:"enterprise/friend/del",method:"post",data:e}),acceptFriend:e=>xs({url:"enterprise/friend/update",method:"post",data:e}),setNickname:e=>xs({url:"enterprise/friend/setNickname",method:"post",data:e}),getApplyMsg:e=>xs({url:"enterprise/friend/getApplyMsg",method:"post",data:e})};var ga=ha,fa={taskApi:na,configApi:ra,userApi:ca,groupApi:ua,imApi:ma,commonApi:Is,friendApi:ga};a["default"].use(w),a["default"].use(A),a["default"].use(h(),{size:"small"}),a["default"].use(U()),a["default"].use(As),a["default"].use(Us()),a["default"].config.productionTip=!1,a["default"].prototype.$packageData=Vs,a["default"].component(Xs.name,Xs),a["default"].component(Ks.name,Ks),a["default"].component(aa.name,aa),a["default"].prototype.$api=fa,new a["default"]({el:"#app",router:os,store:As,components:{App:p},template:"<App/>"})},3817:function(e,t,s){"use strict";function a(e){let t=new Array(" B"," KB"," MB"," GB"," TB"),s=e+"B";for(let a=0;e>=1024&&a<4;a++)e/=1024,s=e.toFixed(2)+t[a+1];return s}function i(e){var t="https://file.lcoce.com/ext/",s=e.split("."),a=s[s.length-1],i=a.toUpperCase(),n=["jpg","jpeg","png","bmp","gif","pdf","mp3","wav","wmv","amr","mp4","3gp","avi","m2v","mkv","mov","webp","ppt","pptx","doc","docx","xls","xlsx","pdf"];return n.includes(i)?t+i+".png":t+"icon/document.svg"}function n(e,t){let s=document.createElement("a"),a=e.split(".").pop(),i=["jpg","jpeg","png","bmp","gif","pdf","mp3","wav","wmv","amr","mp4","3gp","avi","m2v","mkv","mov","webp"];-1!==i.indexOf(a)?s.download=t||"pic":s.download=t||"file",s.href=e,s.click()}s.d(t,{AC:function(){return i},LR:function(){return n},hR:function(){return a}})},2325:function(e,t,s){"use strict";s.d(t,{L4:function(){return o},NW:function(){return c},Nj:function(){return i},hT:function(){return l},i$:function(){return r},iu:function(){return a},pH:function(){return n}});s(2801),s(7658),s(3408),s(4590);function a(e,t,s){if("object"!==typeof e)return!1;for(var a=[],i=0;e.length>i;i++)if("object"==typeof t)for(var n=0;t.length>n;n++){var o=t[n],r=e[i][o];if(-1!=r.indexOf(s)){a.push(e[i]);break}}else{r=e[i][t];-1!=r.indexOf(s)&&a.push(e[i])}return a}function i(e,t,s){s="undefined"!==typeof s&&s;for(var a=[],i=0;i<e.length;i++)a.push(e[i][t]);return!0===s?a.join(","):a}function n(e,t,s){for(var a=0;a<e.length;a++)e[a][t]==s&&e.splice(a,1);return e}function o(e,t,s){for(var a=0;a<e.length;a++)e[a]["disabled"]=!1,e[a][t]==s&&(e[a]["disabled"]=!0);return e}function r(e){const t=new Date,s=new Date(e),a=new Date(t.getFullYear(),t.getMonth(),t.getDate()),i=new Date(a-864e5),n=new Date(a-24*(a.getDay()-1)*60*60*1e3),o=new Date(t.getFullYear(),0,1);if(s>=a)return l("H:i",e/1e3);if(s>=i&&s<a)return"昨天";if(s>=n&&s<i){const e=["周日","周一","周二","周三","周四","周五","周六"],t=e[s.getDay()];return t}return l(s>=o&&s<n?"m-d":"Y-m-d",e/1e3)}function l(e,t){var s=t?new Date(1e3*t):new Date,a=function(e,t){return(e+="").length<t?new Array(++t-e.length).join("0")+e:e},i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"},o=["","January","February","March","April","May","June","July","August","September","October","November","December"],r={d:function(){return a(r.j(),2)},D:function(){return r.l().substr(0,3)},j:function(){return s.getDate()},l:function(){return i[r.w()]},N:function(){return r.w()+1},S:function(){return n[r.j()]?n[r.j()]:"th"},w:function(){return s.getDay()},z:function(){return(s-new Date(s.getFullYear()+"/1/1"))/864e5>>0},W:function(){var e,t=r.z(),a=364+r.L()-t,i=(new Date(s.getFullYear()+"/1/1").getDay()||7)-1;return a<=2&&(s.getDay()||7)-1<=2-a?1:t<=2&&i>=4&&t>=6-i?(e=new Date(s.getFullYear()-1+"/12/31"),l("W",Math.round(e.getTime()/1e3))):1+(i<=3?(t+i)/7:(t-(7-i))/7)>>0},F:function(){return o[r.n()]},m:function(){return a(r.n(),2)},M:function(){return r.F().substr(0,3)},n:function(){return s.getMonth()+1},t:function(){var e;return 2===(e=s.getMonth()+1)?28+r.L():1&e&&e<8||!(1&e)&&e>7?31:30},L:function(){var e=r.Y();return 3&e||!(e%100)&&e%400?0:1},Y:function(){return s.getFullYear()},y:function(){return(s.getFullYear()+"").slice(2)},a:function(){return s.getHours()>11?"pm":"am"},A:function(){return r.a().toUpperCase()},B:function(){var e=60*(s.getTimezoneOffset()+60),t=3600*s.getHours()+60*s.getMinutes()+s.getSeconds()+e,a=Math.floor(t/86.4);return a>1e3&&(a-=1e3),a<0&&(a+=1e3),1===String(a).length&&(a="00"+a),2===String(a).length&&(a="0"+a),a},g:function(){return s.getHours()%12||12},G:function(){return s.getHours()},h:function(){return a(r.g(),2)},H:function(){return a(s.getHours(),2)},i:function(){return a(s.getMinutes(),2)},s:function(){return a(s.getSeconds(),2)},O:function(){var e=a(Math.abs(s.getTimezoneOffset()/60*100),4);return e=s.getTimezoneOffset()>0?"-"+e:"+"+e,e},P:function(){var e=r.O();return e.substr(0,3)+":"+e.substr(3,2)},c:function(){return r.Y()+"-"+r.m()+"-"+r.d()+"T"+r.h()+":"+r.i()+":"+r.s()+r.P()},U:function(){return Math.round(s.getTime()/1e3)}};let c="";return e.replace(/[\\]?([a-zA-Z])/g,(function(e,t){return c=e!==t?t:r[t]?r[t]():t,c}))}function c(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var s=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?s:3&s|8).toString(16)}));return t}},444:function(e,t,s){"use strict";e.exports=s.p+"assets/media/notify.3d49176d.mp3"},1315:function(e,t,s){"use strict";e.exports=s.p+"assets/media/notify.7668dd76.ogg"},8611:function(e,t,s){"use strict";e.exports=s.p+"assets/media/notify.e6953ff1.wav"},4654:function(){}},t={};function s(a){var i=t[a];if(void 0!==i)return i.exports;var n=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=e,function(){s.amdO={}}(),function(){var e=[];s.O=function(t,a,i,n){if(!a){var o=1/0;for(d=0;d<e.length;d++){a=e[d][0],i=e[d][1],n=e[d][2];for(var r=!0,l=0;l<a.length;l++)(!1&n||o>=n)&&Object.keys(s.O).every((function(e){return s.O[e](a[l])}))?a.splice(l--,1):(r=!1,n<o&&(o=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,i,n]}}(),function(){s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,{a:t}),t}}(),function(){s.d=function(e,t){for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,a){return s.f[a](e,t),t}),[]))}}(),function(){s.u=function(e){return"assets/js/"+e+"."+{133:"3a1dfa9e",142:"e41fdf4c",173:"7d7d9a09",567:"9401aef7",584:"ee3c939b",716:"8e7f0ce2"}[e]+".js"}}(),function(){s.miniCssF=function(e){return"assets/css/"+e+"."+{133:"7f9367b6",142:"44e0da9b",173:"fc941ab9",567:"08ec972a",584:"265b8ce0",716:"e408d166"}[e]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="Raingad-IM:";s.l=function(a,i,n,o){if(e[a])e[a].push(i);else{var r,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==a||u.getAttribute("data-webpack")==t+n){r=u;break}}r||(l=!0,r=document.createElement("script"),r.charset="utf-8",r.timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack",t+n),r.src=a),e[a]=[i];var p=function(t,s){r.onerror=r.onload=null,clearTimeout(m);var i=e[a];if(delete e[a],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((function(e){return e(s)})),t)return t(s)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}}}(),function(){s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){s.p=""}(),function(){var e=function(e,t,s,a){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css";var n=function(n){if(i.onerror=i.onload=null,"load"===n.type)s();else{var o=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=r,i.parentNode.removeChild(i),a(l)}};return i.onerror=i.onload=n,i.href=t,document.head.appendChild(i),i},t=function(e,t){for(var s=document.getElementsByTagName("link"),a=0;a<s.length;a++){var i=s[a],n=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(n===e||n===t))return i}var o=document.getElementsByTagName("style");for(a=0;a<o.length;a++){i=o[a],n=i.getAttribute("data-href");if(n===e||n===t)return i}},a=function(a){return new Promise((function(i,n){var o=s.miniCssF(a),r=s.p+o;if(t(o,r))return i();e(a,r,i,n)}))},i={143:0};s.f.miniCss=function(e,t){var s={133:1,142:1,173:1,567:1,584:1,716:1};i[e]?t.push(i[e]):0!==i[e]&&s[e]&&t.push(i[e]=a(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}(),function(){var e={143:0};s.f.j=function(t,a){var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)a.push(i[2]);else{var n=new Promise((function(s,a){i=e[t]=[s,a]}));a.push(i[2]=n);var o=s.p+s.u(t),r=new Error,l=function(a){if(s.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var n=a&&("load"===a.type?"missing":a.type),o=a&&a.target&&a.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+o+")",r.name="ChunkLoadError",r.type=n,r.request=o,i[1](r)}};s.l(o,l,"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,n,o=a[0],r=a[1],l=a[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(i in r)s.o(r,i)&&(s.m[i]=r[i]);if(l)var d=l(s)}for(t&&t(a);c<o.length;c++)n=o[c],s.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return s.O(d)},a=self["webpackChunkRaingad_IM"]=self["webpackChunkRaingad_IM"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=s.O(void 0,[998],(function(){return s(499)}));a=s.O(a)})();