(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1f57fb08"],{"1a15":function(e,t,a){"use strict";var i=function(){var e=this,t=e._self._c;return t("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{title:e.title,visible:e.show,width:"700px"},on:{"update:visible":function(t){e.show=t}}},[t("div",{staticClass:"chat-selector"},[t("div",{staticClass:"left-box"},[t("el-input",{attrs:{placeholder:"搜索",size:"small"},model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}},[t("i",{staticClass:"el-icon-search el-input__icon",attrs:{slot:"suffix"},slot:"suffix"})]),t("tabs",{attrs:{items:e.tabItems,current:e.tabIdx},on:{change:e.onTabChange}}),0==e.tabIdx?t("virtual-scroller",{staticClass:"left-scroll-box",attrs:{items:e.showChats},scopedSlots:e._u([{key:"default",fn:function({item:a}){return[t("div",{staticClass:"chat-item",on:{click:function(t){return e.onClickChatItem(a)}}},[t("head-image",{attrs:{url:a.headImage,name:a.showName,size:42}}),t("div",{staticClass:"chat-info"},[t("div",{staticClass:"chat-name"},[e._v(e._s(a.showName)+" "),"GROUP"==a.type?t("el-tag",{attrs:{size:"mini"}},[e._v("群")]):e._e()],1),t("div",{staticClass:"chat-content",domProps:{innerHTML:e._s(e.$emo.transform(e.$str.html2Escape(a.lastContent),"emoji-small"))}})]),t("el-checkbox",{staticClass:"check-box",on:{change:function(t){return e.onChatChange(a)}},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:a.checked,callback:function(t){e.$set(a,"checked",t)},expression:"item.checked"}})],1)]}}],null,!1,3695436682)}):e._e(),1==e.tabIdx?t("virtual-scroller",{staticClass:"left-scroll-box",attrs:{items:e.showFriends},scopedSlots:e._u([{key:"default",fn:function({item:a}){return[t("friend-item",{attrs:{menu:!1,friend:a,size:"small"},nativeOn:{click:function(t){return e.onClickFriendItem(a)}}},[t("el-checkbox",{staticClass:"check-box",on:{change:function(t){return e.onFriendChange(a)}},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:a.checked,callback:function(t){e.$set(a,"checked",t)},expression:"item.checked"}})],1)]}}],null,!1,1157176375)}):e._e(),2==e.tabIdx?t("virtual-scroller",{staticClass:"left-scroll-box",attrs:{items:e.showGroups},scopedSlots:e._u([{key:"default",fn:function({item:a}){return[t("group-item",{attrs:{group:a,menu:!1,size:"small"},nativeOn:{click:function(t){return e.onClickGroupItem(a)}}},[t("el-checkbox",{staticClass:"check-box",on:{change:function(t){return e.onGroupChange(a)}},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:a.checked,callback:function(t){e.$set(a,"checked",t)},expression:"item.checked"}})],1)]}}],null,!1,3787706743)}):e._e()],1),t("div",{staticClass:"arrow el-icon-d-arrow-right"}),t("div",{staticClass:"right-box"},[t("div",{staticClass:"tip"},[e._v("已勾选"+e._s(e.checkedItems.length)+"个联系人")]),t("el-scrollbar",{staticClass:"right-scroll-box"},e._l(e.checkedItems,(function(a,i){return t("div",{key:i},[t("div",{staticClass:"checked-item"},[t("head-image",{attrs:{url:a.headImage,name:a.showName,size:36}}),t("div",{staticClass:"name"},[e._v(e._s(a.showName))]),t("div",{staticClass:"close",attrs:{title:"移除"},on:{click:function(t){return t.stopPropagation(),e.onRemoveItem(a)}}},[t("i",{staticClass:"el-icon-close"})])],1)])})),0)],1)]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){return e.close()}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.ok()}}},[e._v("发 送")])],1)])},s=[],o=(a("14d9"),a("0643"),a("2382"),a("fffc"),a("4e3e"),a("9a9a"),a("4036")),r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tabs"},e._l(e.items,(function(a,i){return t("div",{key:i,staticClass:"tab",class:e.current==i?"active":"",on:{click:function(t){return e.onClickItem(i)}}},[e._v(" "+e._s(a)+" ")])})),0)},n=[],c={name:"tabs",props:{items:{type:Array},current:{type:Number,default:0}},data(){return{}},methods:{onClickItem(e){this.current!=e&&this.$emit("change",e)}}},l=c,h=(a("4e40"),a("2877")),d=Object(h["a"])(l,r,n,!1,null,"2b404716",null),u=d.exports,f=a("7aa4"),p=a("ff36"),m=a("66d8"),g={components:{VirtualScroller:f["a"],HeadImage:o["a"],Tabs:u,FriendItem:p["a"],GroupItem:m["a"]},name:"chatSelector",props:{title:{type:String,default:""}},data(){return{show:!1,searchText:"",callback:null,tabIdx:0,tabItems:["最近聊天","好友","群聊"],chats:[],friends:[],groups:[],checkedItems:[]}},methods:{open(e){this.tabIdx=0,this.searchText="",this.show=!0,this.callback=e,this.initData()},initData(){this.checkedItems=[],this.chats=[],this.friends=[],this.groups=[],this.chatStore.chats.forEach(e=>{("PRIVATE"==e.type&&this.friendStore.isFriend(e.targetId)||"GROUP"==e.type&&this.groupStore.isGroup(e.targetId))&&this.chats.push({type:e.type,targetId:e.targetId,headImage:e.headImage,showName:e.showName,lastContent:e.lastContent,checked:!1})}),this.friendStore.friends.forEach(e=>{e.deleted||this.friends.push({id:e.id,headImage:e.headImage,showNickName:e.showNickName,checked:!1})}),this.groupStore.groups.forEach(e=>{e.quit||this.groups.push({id:e.id,headImage:e.headImage,headImageThumb:e.headImageThumb,showGroupName:e.showGroupName,checked:!1})})},close(){this.show=!1},ok(){this.close(),this.callback(this.checkedItems)},onTabChange(e){this.tabIdx=e,this.chats.forEach(e=>{e.checked=this.checkedItems.some(t=>e.type==t.type&&e.targetId==t.targetId)}),this.friends.forEach(e=>{e.checked=this.checkedItems.some(t=>"PRIVATE"==t.type&&t.targetId==e.id)}),this.groups.forEach(e=>{e.checked=this.checkedItems.some(t=>"GROUP"==t.type&&t.targetId==e.id)})},onClickChatItem(e){e.checked=!e.checked,this.onChatChange(e)},onChatChange(e){let t=this.checkedItems.findIndex(t=>t.type==e.type&&t.targetId==e.targetId);t>=0?this.checkedItems.splice(t,1):this.checkedItems.push(e)},onClickFriendItem(e){e.checked=!e.checked,this.onFriendChange(e)},onFriendChange(e){let t=this.checkedItems.findIndex(t=>"PRIVATE"==t.type&&t.targetId==e.id);if(t>=0)this.checkedItems.splice(t,1);else{let t={targetId:e.id,type:"PRIVATE",showName:e.showNickName,headImage:e.headImage};this.checkedItems.push(t)}},onClickGroupItem(e){e.checked=!e.checked,this.onGroupChange(e)},onGroupChange(e){let t=this.checkedItems.findIndex(t=>"GROUP"==t.type&&t.targetId==e.id);if(t>=0)this.checkedItems.splice(t,1);else{let t={targetId:e.id,type:"GROUP",showName:e.showGroupName,headImage:e.headImageThumb};this.checkedItems.push(t)}},onRemoveItem(e){let t=this.checkedItems.findIndex(t=>t.type==e.type&&t.targetId==e.targetId);this.checkedItems.splice(t,1);let a=this.chats.find(t=>t.type==e.type&&t.targetId==e.targetId);if(a&&(a.checked=!1),"PRIVATE"==e.type){let e=this.friends.find(e=>e.id==a.targetId);e&&(e.checked=!1)}if("GROUP"==e.type){let e=this.groups.find(e=>e.id==a.targetId);e&&(e.checked=!1)}}},computed:{showChats(){return this.chats.filter(e=>e.showName.includes(this.searchText))},showFriends(){return this.friends.filter(e=>e.showNickName.includes(this.searchText))},showGroups(){return this.groups.filter(e=>e.showGroupName.includes(this.searchText))}}},v=g,x=(a("3a92"),Object(h["a"])(v,i,s,!1,null,"1a950a0a",null));t["a"]=x.exports},"1d82":function(e,t,a){var i=a("24fb");t=i(!1),t.push([e.i,".tabs[data-v-2b404716]{height:50px;display:flex;align-items:center;background-color:#f6f7fb}.tabs[data-v-2b404716],.tabs .tab[data-v-2b404716]{border-radius:10px}.tabs .tab[data-v-2b404716]{color:var(--im-text-color-light);padding:10px;font-weight:600;flex:1;text-align:center;margin:0 3px;white-space:nowrap;cursor:pointer}.tabs .tab.active[data-v-2b404716]{color:var(--im-color-primary);background:var(--im-color-primary-light-9)}",""]),e.exports=t},"271a":function(e,t,a){"use strict";var i=a("cb2d"),s=a("e330"),o=a("577e"),r=a("d6d6"),n=URLSearchParams,c=n.prototype,l=s(c.getAll),h=s(c.has),d=new n("a=1");!d.has("a",2)&&d.has("a",void 0)||i(c,"has",(function(e){var t=arguments.length,a=t<2?void 0:arguments[1];if(t&&void 0===a)return h(this,e);var i=l(this,e);r(t,1);var s=o(a),n=0;while(n