<template>
	<div style="position: relative;" ref="firstParent">
		<div class="nav">
			    <div class="nav-left">
              <img class="GroupPic" v-if="userInfo.GroupPic!='' " :src="userInfo.GroupPic" :onerror='defaultHeadImg' />
            <!-- <i class="iconfont icon-logo"></i>			    	 -->
			    </div>
			    <div class="nav-middle">
			    	<ul class="clearfix" :style="{width:`${allWindowWidth}px`}">
                <li v-for="(item,index) in menuList" v-if="item.MenuUrl!='' && index<=maxLength" :class="{active:item.MenuId==chosenIndex}" @click="goUrl(item.MenuUrl,item.MenuId,index)" >
                  <span class="big_tittle"><i :class="[fontPub,item.icon]" ></i>{{item.MenuName}}</span>
                  <div class="hoverNote"></div>
                  <!--<div :class="{menuList_son:item.ChildMenu.length>=1}" :style="{width:item.ChildMenu.length>=1 ? ((item.ChildMenu.length*160) + 'px') : '0',left: item.ChildMenu.length>1 ? '-50%' : '0'}" @click.stop>-->
                  <div :class="{menuList_son:item.ChildMenu.length>=1}" :style="{width:item.ChildMenu.length>=1 ? '1300px' : '0',left:'50px'}" @click.stop>
                     <div class="menuList_son_item" @mousemove.stop @mouseout.stop>
                       <div v-for="(son, sIndex) in item.ChildMenu" style="width: 150px;margin-right: 20px">
                         <p class="menuList_son_one_tittle">{{son.MenuName}}</p>
                         <div v-for="(grand, gIndex) in son.NewChildMenu" class="menuList_tittle_box">
                            <p v-if="grand.GCode !== '默认'" class="menuList_son_two_tittle">{{grand.GCode}}</p>
                           <template v-for="(grandSon, gsIndex) in grand.list">
                             <p @click.stop="goUrl(grandSon.MenuUrl,grandSon.MenuId,gsIndex)" class="menuList_son_three_tittle"><i :class="[fontPub,JSON.parse(grandSon.MenuStyle).icon ? JSON.parse(grandSon.MenuStyle).icon : 'icon-guanli2']" ></i>{{grandSon.MenuName}}</p>
                           </template>
                         </div>
                       </div>
                     </div>
                  </div>
                </li>
                <li style="width:65px;height:50px;line-height: 50px;padding: 0">
                    <el-dropdown trigger="hover">
                    <span class="el-dropdown-link" style="cursor: pointer;display: block;height: 100%;width: 100%;">
                      <span style="color: #a6adb4;"><i class="iconfont icon-biaoge" style="margin-right: 5px;"></i>更多</span>
                    </span>
                    <el-dropdown-menu slot="dropdown" class="_dropdown _more_dropdown">
                      <el-dropdown-item class="clearfix _dropdown_other" v-for="(item,index) in menuList" :key="index" v-if="item.MenuUrl!='' && index>maxLength" @click.native="goUrl(item.MenuUrl,item.MenuId,index)">
                        <a target="_blank" style="color:#a6adb4;">
                          <i :class="[fontPub,item.icon]"></i>{{item.MenuName}}
                        </a>
                      </el-dropdown-item>
                      <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("知识圈")!==-1'  @click.native="zhishiquan">
                        <a href="http://we.oytour.com:8110/" target="_blank" style="color:#a6adb4;">
                          <i class="iconfont icon-menu-zhishiquan"></i>知识圈
                        </a>
                      </el-dropdown-item>
                      <el-dropdown-item class="clearfix _dropdown_other"  v-if='firstMenuList.indexOf("统计平台")!==-1'>
                        <a href="http://data.oytour.com" target="_blank" style="color:#a6adb4;">
                          <i class="iconfont icon-tongji2"></i>统计平台
                        </a>
                      </el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
                </li>
                <!--<li v-if='firstMenuList.indexOf("知识圈")'  @click.native="zhishiquan">-->
                  <!--<a href="http://we.oytour.com:8110/" target="_blank" style="color:#a6adb4;">-->
                    <!--<i class="iconfont icon-menu-zhishiquan"></i>知识圈-->
                  <!--</a>-->
                <!--</li>-->
                <!--<li v-if='firstMenuList.indexOf("统计平台")'>-->
                  <!--<a href="http://data.oytour.com" target="_blank" style="color:#a6adb4;">-->
                    <!--<i class="iconfont icon-tongji2"></i>统计平台-->
                  <!--</a>-->
                <!--</li>-->
            </ul>
			    </div>
			    <div class="nav-right">
			    	<ul>
              <li class="user_head" @click='hideIM'>
                <el-dropdown trigger="click">
                  <div class="el-dropdown-link">
                    <img v-if="userInfo.UserPhoto!='' " :src="userInfo.UserPhoto" :onerror='defaultHeadImg' />
                    <img  v-else src="../assets/img/default_head_img.jpg" />
                    <span class="name" :title="userInfo.emName">{{userInfo.emName}}</span>
                  </div>
                  <el-dropdown-menu slot="dropdown" class="_dropdown _more_dropdown">
                    <el-dropdown-item class="_dropdown_f1">
                      <p class="company"><span>{{userInfo.BranchName}} </span><span>{{userInfo.PostName}}</span> </p>
                    </el-dropdown-item>
                    <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("财务单")!==-1' @click.native="goUrlT('FinancialDocuments',3,'财务单据')">
                      <i class="iconfont icon-nav-caiwu"></i>
                      财务单
                      <el-badge class="mark" :value="NotDealCount?NotDealCount:'0'" />
                    </el-dropdown-item>
                    <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("考勤")!==-1' @click.native="goUrlT('myApproval',-1,'考勤')">
                      <i class="iconfont icon-menu-kaoqin"></i>
                      考勤
                      <el-badge class="mark" :value="MyAuditCount?MyAuditCount:'0'" />
                    </el-dropdown-item>
                    <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("企业云盘")!==-1' @click.native="goUrlT('myDocuments',-1,'企业云盘')">
                      <i class="iconfont icon-menu-yunpan"></i>
                      企业云盘
                    </el-dropdown-item>
                    <!-- <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("知识圈")'  @click.native="zhishiquan">
                      <i class="iconfont icon-menu-zhishiquan"></i>
                      知识圈
                    </el-dropdown-item> -->
                    <el-dropdown-item class="clearfix _dropdown_other" v-if='firstMenuList.indexOf("常用付款对象")'  @click.native="goUrlPayment()">
                      <i class="iconfont icon-menu-zhishiquan"></i>
                      常用付款对象
                    </el-dropdown-item>
                    <el-dropdown-item class="clearfix _dropdown_other"  @click.native="settingSys">
                      <i class="iconfont icon-menu-shezhi1"></i>
                      设置
                    </el-dropdown-item>
                    <!-- <el-dropdown-item class="clearfix _dropdown_other">
                      <i class="iconfont icon-menu-shezhi"></i>
                      设置
                    </el-dropdown-item> -->
                    <el-dropdown-item class="clearfix _dropdown_other" @click.native ="exit">
                      <i class="iconfont icon-menu-tuichu"></i>
                      退出
                    </el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
			        	<!--  -->
              </li>
			    		<li style="position: relative;">
			    			<!-- <div v-show='hasNewMsg>0' style="position: absolute; background:#E95252; width: 10px; height: 10px; border-radius: 5px; top: 50px; left: 35px;"></div> -->
			    			<i class="iconfont icon-imessage_top" :class="[hasNewMsg>0&&!IM_bodyIsShow?'animation red':'',IM_bodyIsShow?'red':'']" @click="IM_bodyIsShow=!IM_bodyIsShow"></i>
							<!--<i class="iconfont icon-imessage_top"  @click="togglebox($event)"></i>-->
						</li>
			    		<li><i class="iconfont icon-help_top"></i></li>
			    		<li>
                <el-dropdown trigger="click">
                  <span class="el-dropdown-link">
                    <i v-if="language=='zh-CN'" class="iconfont icon-language_top"></i>
                    <i v-if="language=='Japanese'" class="iconfont icon-icon-riyu"></i>
                  </span>
                  <el-dropdown-menu  class="changelanguage" slot="dropdown">
                    <el-dropdown-item @click.native="ChangeLan('Japanese')">日语 <i v-if="language=='Japanese'" class="iconfont icon-duigou"></i></el-dropdown-item>
                    <el-dropdown-item @click.native="ChangeLan('zh-CN')">简体中文 <i v-if="language=='zh-CN'" class="iconfont icon-duigou"></i></el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </li>
			    	</ul>
			    </div>
			</div>

			<div class="IM_body" id="IM_body" v-show="IM_bodyIsShow">
        <div class="IM_nav">
          <ul>
            <li @click="IM_navType=1,imToolsType=0,changeTools(0)" :class="{checked:IM_navType==1}">
              <!-- <i class="iconfont icon-imessage_top"></i> -->
              <span class="txt">
                消息
                <div class="unreadMsg" v-show="IM_navType!=1&&hasNewMsg>0">{{hasNewMsg}}</div>
              </span>
              <div class="lihoverNote"></div>

            </li>
            <li @click="IM_navType=2,imToolsType=0,changeTools(0)" :class="{checked:IM_navType==2}">
              <!-- <i class="iconfont icon-tongxunlun"></i> -->
              通讯录
              <div class="lihoverNote"></div>
            </li>
            <li @click="IM_navType=3,imToolsType=0,changeTools(0)" :class="{checked:IM_navType==3}">
              <!-- <i class="iconfont icon-ico_kongjiann"></i> -->
              空间
              <div class="lihoverNote"></div>
            </li>
          </ul>
        </div>
        <div class="IM_tool" style='top: 41px;z-index: 1;' v-if="IM_navType!==3">
          <div class="search">
            <i class='iconfont icon-search search'></i>
            <input type="text" class='s-box' placeholder='搜索' v-model="newSearchContent" @keyup.enter="searchNameV2"/>
            <i class="close iconfont icon-close" v-if='newSearchContent.length>0' @click="changeTools(0)"></i>
          </div>
        </div>
        <div v-show="imToolsType!=-1">
          <div v-show="IM_navType==1" class="IM_messageList ">
            <ul>
              <li
                    v-for="(session, index) in sysMsgList"
                    class="u-list-item"
                    @click="enterSystemChat(session),refreshSysNoteDate()"
                >
                <div style="float: left; width: 38px; height: 38px; border-radius: 19px;background: #6694DC;font-size: 14px; text-align: center; line-height: 38px; color: #fff; margin-right:10px">系统</div>
                <div class="cont">
                    <p class="name">{{session.name}}</p>
                    <p class="msg">{{session.lastMsgShow}}</p>
                </div>
                <div style="float: right; font-size: 12px; color: #999; margin: 0px 10px 0;">{{session.updateTimeShow}}</div>
                <div style="float: right; background: #E95252;font-size: 12px;color: #fff;height:17px; min-width:17px; text-align:center;border-radius:17px;vertical-align: middle;" v-show="session.unread > 0">{{session.unread}}</div>
              </li>

              <li
                v-for="(session, index) in sessionlist"
                class="u-list-item"
                :inline-desc="session.lastMsgShow"
                :key="session.id"
                :sessionId="session.id"
                @dblclick="enterChat(session)"
                v-if="session.to!=''"
                >
                <img   :src="session.avatar" width="24"/>
                            <div class="cont">
                                <p class="name">{{session.name}}</p>
                                <p class="msg">{{session.lastMsgShow}}</p>
                            </div>
                            <div style="float: right; font-size: 12px; color: #999;">
                              {{session.updateTimeShow}}&nbsp;
                               <i @click.stop="deleteSession(session)" style="color: #999; font-size: 14px!important; display: none;" class="el-icon-circle-close-outline"></i>
                            </div>
                          <div style="position: absolute; right: 19px; bottom: 16px; background: #E95252; font-size: 12px; color: #fff;height:17px; min-width:17px; text-align:center;border-radius:17px;vertical-align: middle;" v-show="session.unread > 0">{{session.unread}}</div>
              </li>
            </ul>
          </div>
        </div>
        <div v-show="imToolsType==-1" class="IM_messageList IM_searchListBox">
            <loading v-show="isLoading"></loading>
          	<ul v-show="!isLoading">
							<li v-for="item in searchList" @click="lt(item)">
                <img v-if="!item.icon" src="../assets/img/litheader.png" alt=""  width="24">
                <img v-else :src="item.icon" alt="" :onerror="defaultImg"  width="24">
                <div class="cont">
                    <p class="name">
                      {{item.name}}
                    </p>
                    <p class="msg">{{item.lastMsg}}</p>
                </div>
                <div class="tag-box">
                  <span class="tag-company">{{item.companyName}}</span>
                </div>
							</li>
						</ul>
            <div class="search-none-data" v-show="!isLoading&&searchList.length==0">
              <i class="iconfont icon-zanwushuju"></i><br/>
              抱歉,没有找到这位{{newSearchContent}}大侠
            </div>
        </div>
				<div v-show="IM_navType==1" class="IM_tool">
          <ul v-show="imToolsType==0">
            <li><i class="iconfont icon-sousuo" @click="changeTools(1)"></i></li>
            <li><i class="iconfont icon-pifu1"></i></li>
            <li><i class="iconfont icon-wuraomoshi"></i></li>
            <li><i class="iconfont icon-icon-"></i></li>
          </ul>
          <div class="search" v-show="imToolsType==1||imToolsType==-1">
            <input type="text" v-model="newSearchContent" @keyup.enter="searchNameV2"/>
            <i class="close iconfont icon-close" @click="changeTools(0)"></i>
          </div>
        </div>



				<div class='IM_contacts contact-box' v-show="IM_navType==2 && searchList.length===0">
					<!-- <div style="padding: 10px; border-bottom: 1px dashed rgba(134,142,148,.4); overflow: hidden;">
						<div class="fl" style="width: 300px; margin-right: 10px;">
							<el-input  prefix-icon="el-icon-search" placeholder='员工姓名,回车搜索' v-model='searchKey' @input='isSearchType' @keyup.enter.native="searchName"></el-input>
						</div>
						<div class="fl" style="font-size: 12px; color: #666; margin-top: 2px; text-align: center;">
							 <i class="iconfont icon-add_qunliao" @click="buildGroup" style="cursor: pointer;"></i>
							 <br/>
							 建群
						</div>
					</div> -->
          <div class="contacts-type-box">
            <div class="contacts-type-item" :class="{active:contactsType==0}" @click="changeContactGroup(0)">同事</div>
            <div class="contacts-type-item" :class="{active:contactsType==1}" @click="changeContactGroup(1)">群聊</div>
            <el-tooltip  effect="dark" content="新建群聊" placement="top-start">
              <i class="plus iconfont icon-img_jiahao_big" v-if="contactsType==1" @click="createGroup"></i>
            </el-tooltip>
          </div>
					<div v-show='contactsType==0' class="el-tree-style-div">
						<el-tree :data='webAllpartList'
							:props="defaultProps1">
							 <span class="custom-tree-node" slot-scope="{ node, data }">
							  	 <span class="fz14" v-if="data.Type==1">{{ node.label }}</span>
							  	 <!--<span v-if='data.Type==1' class="fz14">({{data.Count}})</span>-->
							  	 <span class="fz14" v-if="data.Type==2" @dblclick="lt(data)">
							  	 	<img v-if='!data.Icon' src="../assets/img/litheader.png" style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
							  	 	<img v-if='data.Icon' :onerror="defaultImg" :src='data.Icon' style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
							  	 	{{ node.label }} <span style="font-size: 12px; color: rgb(105, 105, 105);">{{data.IMAccount}}</span></span>
							  </span>
						</el-tree>
					</div>
					 <div v-show="contactsType==1" class="IM_messageList" style='top:41px'>
            <ul>
              <li
                    v-for="(session, index) in teamList"
                    class="u-list-item"
                    :inline-desc="session.lastMsgShow"
                    :key="session.id"
                    :sessionId="session.id"
                    @dblclick="enterChat(session)"
                >
                <img :src="session.avatar" width="24"/>
                <div class="cont">
                    <p class="name team" :title='session.name'>{{session.name}}</p>
                </div>
                <div style="float: right; font-size: 12px; color: #999;height: 38px;line-height: 38px;">
                  {{diaplayTime(session.updateTime)}}
                </div>
                <div style="position: absolute; right: 19px; bottom: 16px; background: #E95252; font-size: 12px; color: #fff;height:17px; min-width:17px; text-align:center;border-radius:17px;vertical-align: middle;" v-show="session.unread > 0">{{session.unread}}</div>
              </li>
            </ul>
          </div>
				</div>


				<div class='IM_contacts' v-show="IM_navType==4">
					<div style="padding: 10px; border-bottom: 1px dashed rgba(134,142,148,.4); overflow: hidden;">
						<div class="fl" style="width: 300px; margin-right: 10px;">
							<el-input  prefix-icon="el-icon-search" placeholder='员工姓名,回车搜索' v-model='searchKey' @input='isSearchType' @keyup.enter.native="searchName"></el-input>
						</div>
						<div class="fl" style="font-size: 12px; color: #1BC594; margin-top: 2px; text-align: center;">
							 <i class="iconfont icon-ico_commodity_defaul" @click="saveGroup" style="cursor: pointer;"></i>
							 <br/>
							 确定
						</div>
					</div>
					<!-- <div class="IM_groupMemberList" v-show="GroupMemberList.length>0||oldGroupMemberList.length>0">
						    <li v-for="item in oldGroupMemberList">
						  		<img v-if='!item.avatar' src="../assets/img/litheader.png" />
							  	 <img v-if='item.avatar' :onerror="defaultImg" :src='item.avatar'/>
						  		<br/>
						  		{{item.alias}}
						  		<i class="iconfont icon-quxiao" style="color: #E95252;" @click="deleteOldFriend(item)"></i>
							</li>
							<li v-for="item in GroupMemberList">
						  		<img v-if='!item.Icon' src="../assets/img/litheader.png" />
							  	 <img v-if='item.Icon' :onerror="defaultImg" :src='item.Icon'/>
						  		<br/>
						  		{{item.Name}}
						  		<i class="iconfont icon-quxiao" style="color: #E95252;" @click="deleteFriend(item)"></i>
							</li>
					</div> -->
					<div v-if='!searchType' class="el-tree-style-div">
						<el-tree :data='webAllpartList'
							:props="defaultProps1">
							  <span class="custom-tree-node" slot-scope="{ node, data }">
							  	 <span class="fz14" v-if="data.Type==1">{{ node.label }}</span><!--<span v-if='data.Type==1' class="fz14">({{data.Count}})</span>-->
							  	 <span class="fz14" v-if="data.Type==2">
							  	 	<label>
							  	    <input type="checkbox" :value="data.IMAccount" v-model="IMList" @click="addFriend(data)"/>
                      <img v-if='!data.Icon' src="../assets/img/litheader.png" style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
                      <img v-if='data.Icon' :onerror="defaultImg" :src='data.Icon' style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
                      {{ node.label }}
							  	 	</label>
							  	 </span>
							  </span>
						</el-tree>
					</div>
					<div v-if='searchType' class="IM_searchList">
						<ul>
							<li v-for="item in searchList">
								<label>
								<input type="checkbox" :value="item.imAccount"  v-model="IMList" @click="addSearchFriend(item)"/>
							  	<img v-if="!item.icon" src="../assets/img/litheader.png" alt="">
			                  	<img v-else :src="item.icon" alt="" :onerror="defaultImg">
			                  	{{item.name}}
								<el-tag v-if='item.departmentName'>{{item.departmentName}}</el-tag>
								</label>`
							</li>
						</ul>
					</div>
				</div>
				<div  v-show="IM_navType==5" class="IM_messageList">
					<div class="sysMsgDiv">系统消息<span v-show="msglist">(共{{this.msgList.length}}条)</span>
						<span class="fr">
							<i @click="deletMsg(0)" class="iconfont icon-xingzhuang"></i>
							&nbsp;
							<i class="iconfont icon-img_caidan" @click="IM_navType=1"></i>
						</span>
					</div>
					<ul class="_SysNoteDate_ul" v-loading="SystemLog">
						<li @click="LogSetReadStatus(session)"
					        v-for="(session, index) in msgList"
					        class="u-list-item"
							>
		 					<div  style="float: left; width: 38px; height: 38px; border-radius: 19px;background: #6694DC;
		 					margin: 0px 10px;	font-size: 14px; text-align: center; line-height: 38px; color: #fff;">系统</div>
              <div class="cont sys_cont">
                  <p class="name">{{session.Title}}</p>
                  <p class="msg sys_msg">{{session.Content}}</p>
              </div>
              <div style="float: right; font-size: 12px; color: #999; margin: 12px 0 0;">{{session.CreateTime}}</div>
              <div style="float: right; background: #00B5E9; margin: 2px 10px 0 0; font-size: 12px; padding:2px 7px; border-radius: 50%; color: #fff;" v-show="session.unread > 0">{{session.unread}}</div>
						</li>
            <li class="sysMsg_lod_more" @click="refreshSysNoteDate('a')">
              <p>加载更多...</p>
            </li>
					</ul>
				</div>
				<div  v-show="IM_navType==3">
				<div class="IM_myNav">
					<ul>
						<li  :class="{cked:dynamicType==1}" @click="dynamicType=1"><i class="iconfont icon-suoyoudongtai"></i>
							全部动态</li>
						<li  :class="{cked:dynamicType==2}" @click="dynamicType=2"><i class="iconfont icon-ico-wofabude"></i>
							我发布的</li>
						<li  :class="{cked:dynamicType==3}"  @click="dynamicType=3"><i class="iconfont icon-ico_yuwoxiangguan"></i>
							与我相关</li>
					</ul>
				</div>
				<div class="IM_cont"  id='allDynamic' v-show="dynamicType==1">
					<div class="IM_cont_item" v-for="(item,index) in dynamicList">
						<p class="userAndTime">
						  	<img v-if="!item.crearteEmPhoto" src="../assets/img/litheader.png" alt="">
		                  	<img v-else :src="item.crearteEmPhoto" alt="" :onerror="defaultImg">
		                  	&nbsp;
							{{item.createEmName}}
							<span class="fr" style="font-size: 12px; color: #999;">{{item.createTime|diaplayTime(item.createTime)}}</span>
						</p>
						<p class="artcleCont">{{item.content|decodeURIComponent(item.content)}}</p>
						<p class="artclePic" v-if='item.fileType==1'>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==1' v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_mfit,h_100,w_300'"/>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==2||item.files.length==4' style="margin-right: 5px;" v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_pad,w_148,h_150,color_333333'"/>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==3||item.files.length>=5' style="margin: 1px;" v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_pad,h_100,w_100,color_333333'"/>
						</p>
						<p v-if='item.fileType==2&&item.files.length==1'>
							<video :src="item.files[0]" controls="controls" style="width: 100%;">
							  your browser does not support the video tag
							</video>
						</p>
					    <p class="artcleAddress">
					    	<span  v-if="item.address!=''"><i class="iconfont icon-img_dizhi_small"></i>{{item.address}}</span>
					    	<span class="fr">
					    		<!--{{item.hasLike}}-->
					    	   <i class="iconfont icon-zan_" style="cursor: pointer;" v-if='!item.hasLike' @click="likeArticle(item.id,index)"></i>
					    	   <i class="iconfont icon-zan_" style="cursor: pointer; color: #E95252;" v-if='item.hasLike' @click="disLikeArticle(item.id,index)"></i>
					    	   <i class="iconfont icon-ico_pinglun1" style="cursor: pointer;" @click="reviewIndex=index,reviewCont=''"></i>
					    	</span>
					    </p>
					    <div class="praiseAndReview">

					    	<div class="praise" v-if='item.likeList.length>0'>
					    		<i class="iconfont icon-zan_" style="color: #FF6868; vertical-align:initial;font-size: 14px;"></i>
					    		<span v-for="i in item.likeList">{{i.empName}}、</span>
					    	</div>

					    	<div class="review" v-if="item.commentList.length>0">
					    		<span class="reviewIcon">
					    			<span class="sjx"></span>
					    		</span>
					    		<ul>
					    			<li v-for="(i,index) in item.commentList">
					    				<p v-if="i.byReplayEmpName==null"><span>{{i.empName}}</span>:{{i.content|decodeURIComponent(i.content)}}
					    				<i class="iconfont icon-ico_pinglun1" @click="reviewIndex=i.outIndex,reviewMsg.commentId=i.commentId"></i>
					    				<i v-if='userId==i.empId' class='iconfont icon-img_delete_small' @click="deleteComments(i.commentId,i.outIndex,item.id)"></i>
					    				</p>
					    				<p v-if="i.byReplayEmpName!=null">
					    					<span>{{i.empName}}</span>&nbsp;回复&nbsp; <span>{{i.byReplayEmpName}}</span>:{{i.content|decodeURIComponent(i.content)}}
					    					 <i class="iconfont icon-ico_pinglun1" @click="reviewIndex=i.outIndex,reviewMsg.commentId=i.commentId"></i>
					    					<i v-if='userId==i.empId' class='iconfont icon-img_delete_small' @click="deleteComments(i.commentId,i.outIndex,item.id)"></i>
					    				</p>
					    			</li>

					    		</ul>
					    	</div>
					    </div>

				    	<div class="reviewInput" v-if='reviewIndex==index'>
				    		  <el-input :placeholder="placeholder" maxlength='50' v-model='reviewCont'>
							    <el-button slot="append" @click='reviewArticle(item.id,index)'>确定</el-button>
							  </el-input>
				    	</div>
					</div>
				</div>

				<div class="IM_cont" id='myDynamic' v-show="dynamicType==2">
					<div class="myDynamicTop"></div>
					<div class='myDynamicItem' v-for="(item,index) in myDynamicList">
						<div class="iconOut">
							<div class="iconIn"></div>
						</div>
						<div style="position: absolute; font-size: 14px; left: -60px; top:3px; width: 50px; height: 24px; text-align: right;">{{item.createTime|diaplayTime(item.createTime)}}</div>
						<p class="artcleCont">{{item.content|decodeURIComponent(item.content)}}</p>
						<p class="artclePic" v-if='item.fileType==1'>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==1' v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_mfit,h_100,w_273'"/>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==2||item.files.length==4' style="margin-right: 5px;" v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_pad,w_130,h_120,color_333333'"/>
							<img  @click="getPic(item.files,index)" v-if='item.files.length==3||item.files.length>=5' style="margin: 1px;" v-for="(i,index) in item.files" :src="i+'?x-oss-process=image/resize,m_pad,h_80,w_90,color_333333'"/>
						</p>
						<p v-if='item.fileType==2&&item.files.length==1'>
							<video :src="item.files[0]" controls="controls" style="width: 100%;">
							your browser does not support the video tag
							</video>
						</p>
					    <p class="artcleAddress">
					    	<span  v-if="item.address!=''"><i class="iconfont icon-img_dizhi_small"></i>{{item.address}}</span>
					    	<span class="fr">
					    	   <i class="iconfont icon-zan_" style="cursor: pointer;" v-if='!item.hasLike' @click="likeArticleOne(item.id,index)"></i>
					    	   <i class="iconfont icon-zan_" style="cursor: pointer; color: #E95252;" v-if='item.hasLike' @click="disLikeArticleOne(item.id,index)"></i>
					    	   <i class="iconfont icon-ico_pinglun1" style="cursor: pointer;" @click="reviewIndex=index,reviewCont=''"></i>
					    	   <i class="iconfont icon-img_delete_small" style="cursor: pointer;" @click="deleteArticle(item.id)"></i>
					    	</span>
					    </p>

					    <div class="praiseAndReview">

					    	<div class="praise" v-if='item.likeList.length>0'>
					    		<i class="iconfont icon-zan_" style="color: #FF6868; vertical-align:initial;font-size: 14px;"></i>
					    		<span v-for="i in item.likeList">{{i.empName}}、</span>
					    	</div>

					    	<div class="review" v-if="item.commentList.length>0">
					    		<span class="reviewIcon">
					    			<span class="sjx"></span>
					    		</span>
					    		<ul>
					    			<li v-for="i in item.commentList" >
					    				<p v-if="i.byReplayEmpName==null"><span>{{i.empName}}</span>:{{i.content|decodeURIComponent(i.content)}}
					    				<i class="iconfont icon-ico_pinglun1" @click="reviewIndex=i.outIndex,reviewMsg.commentId=i.commentId"></i>
					    				<i v-if='userId==i.empId' class='iconfont icon-img_delete_small' @click="deleteCommentsOne(i.commentId,i.outIndex,item.id)"></i>
					    				</p>
					    				<p v-if="i.byReplayEmpName!=null">
					    					<span>{{i.empName}}</span>&nbsp;回复&nbsp; <span>{{i.byReplayEmpName}}</span>:{{i.content|decodeURIComponent(i.content)}}
					    					 <i class="iconfont icon-ico_pinglun1" @click="reviewIndex=i.outIndex,reviewMsg.commentId=i.commentId"></i>
					    					 <i v-if='userId==i.empId' class='iconfont icon-img_delete_small' @click="deleteCommentsOne(i.commentId,i.outIndex,item.id)"></i>
					    				</p>
					    			</li>
					    		</ul>
					    	</div>
					    </div>


				    	<div class="reviewInput" v-if='reviewIndex==index'>
				    		  <el-input :placeholder="placeholder" maxlength='50' v-model='reviewCont'>
							    <el-button slot="append" @click='reviewArticleOne(item.id,index)'>确定</el-button>
							  </el-input>
				    	</div>

					</div>


				</div>
				<div class="IM_cont" id='aboutMeDynamic' v-show="dynamicType==3">
					<div class="aboutMeDynamicItem" v-for='(item,index) in aboutMyDynamicList'>
						<div class="dynamicItemTop">
							<div class="leftDiv">
								<img :src="item.crearteEmPhoto" />
							</div>
							<div class="middleDiv">
								<p>{{item.createEmName}}</p>
								<p v-if='item.realtionType==1' style="line-height: 18px; font-size: 12px; color: #666;">{{item.commentContent|decodeURIComponent(item.commentContent)}}</p>
								<p v-if='item.realtionType==2'><i class="iconfont icon-zan_" style="color: #E95252; font-size: 12px;"></i></p>
								<p  style="line-height: 18px; font-size: 12px; color: #999;">{{item.createTime|diaplayTime(item.createTime)}}</p>
							</div>
							<div class="rightDiv" v-if='item.fileList.length>0'>
							     <img :src="item.fileList[0]"  width="60" height="60"/>
							</div>
						</div>
						<div class="dynamicItembottom"  v-if='item.realtionType==1'>
							<i class="iconfont icon-ico_pinglun1" style="cursor: pointer; font-size: 12px; color: #666;" @click="reviewIndex=index,reviewMsg.commentId=item.commentId,reviewCont=''"></i>
				    		<el-input v-if='reviewIndex==index' :placeholder="placeholder" maxlength='50' v-model='reviewCont'>
							    <el-button slot="append" @click='reviewArticleTwo(item.id,index)'>确定</el-button>
							</el-input>
						</div>
					</div>
				</div>

				<div class="IM_cont" v-show="dynamicType==4">
					<p style="line-height: 14px; height: 14px; border-left:3px solid #E95252; margin-bottom: 10px; font-size: 14px; text-indent: 10px;">发布动态</p>
					<el-input type="textarea" :rows="4" maxlength='50' placeholder="这一刻你的想法..." v-model='dynamicCont'> </el-input>
					<p style="margin: 10px 0;">
					<el-upload
					  action=""
					  :file-list="imgList"
					  :http-request="uploadImg"
					  :multiple="false"
					  :limit="9"
					  accept="image/jpeg,image/gif,image/png,image/bmp"
					  list-type="picture-card"
					  :on-remove="handleRemoveImg">
					  <i class="el-icon-plus"></i>
					</el-upload>
					</p>
					<input type="button" value="发布" class="normalBtn fr" @click="SaveDynamic"/>
				</div>

				<i v-show="dynamicType!=4" class="iconfont icon-fabu" @click="dynamicType=4" style="position: fixed; right: 10px; color: #E95252; font-size: 30px; bottom: 50px; cursor: pointer; z-index: 999999;"></i>
				<div style="width: 100%; height: 50px;"></div>
			</div>
			</div>
			<div class="listen">
				<audio ref="audio">
				 <source src="/static/music/msgMusic.mp3" type="audio/mpeg">
				</audio>
			</div>
			<div class="temDivs">
    			<router-view></router-view>
			</div>


				<div :class="{viewBigPicLayer:true,viewBigPicLayerDisplayNone:dspNone}" @click="closePicLayer">
				    <i @click="closePicLayer" class="el-icon-circle-close-outline clolseViewBigPicLayer" ></i>
				    <el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
				      <el-carousel-item v-for="(item,index) in picObj" :key="index">
				         <div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
				      </el-carousel-item>
				    </el-carousel>
				</div>

    <vue-draggable-resizable v-show="IM_Chatlayer" ref="resizeBox" class="im-box" active :parent="true" :minw="478" :minh="300" :w="boxInfo.width" :h="boxInfo.height" :x="boxInfo.x" :y="boxInfo.y"  :z="9999" :handles="['bm','br','mr']" :drag-handle="'.drag-title'" @resizestop="onResizstop" @dragstop="onDragstop">
      <div class="IM_message_box_left" v-if="openSessions.length>1">
        <ul>
          <li v-for="(item,index) in openSessions" :class="{active:item.id==currentSession.id}" @click="enterChat(item)">
            <img :src="item.avatar" v-if='item.avatar' :alt='item.name'/>
            <img src="../assets/img/litheader.png" v-if='!item.avatar' :alt='item.name'/>
            <span class="name">{{item.name}}</span>
            <i class="iconfont icon-close1" v-show="item.id==currentSession.id" @click.stop="deleteOpenSession(index)"></i>
            <div style="position: absolute; right: 5px; bottom: 16px; background: #E95252; font-size: 12px; color: #fff;height:17px; min-width:17px; text-align:center;border-radius:17px;vertical-align: middle;line-height:17px;padding: 0px 3px;" v-if="item.unread>0">{{item.unread}}</div>
          </li>
        </ul>
      </div>
      <div class="IM_message_box" :class="{right:openSessions.length>1}">
        <div class="drag-title">
          <div class="user-box">
            <img :src="currentSession.avatar" v-if='currentSession.avatar'  v-show="openSessions.length==1" />
            <img src="../assets/img/litheader.png" v-if='!currentSession.avatar'  v-show="openSessions.length==1" />
            <span class="name">{{currentSession.name}}</span>
            <span class="name arrow-down-box" @click="changeTheDown" v-if="currentSession.scene=='team'">
              {{oldGroupMemberList.length}} 人
              <span class="trans-box-down" :class="{'trans-box-down2':isDownOpen==true}">
                <i class="iconfont icon-arrow-down"></i>
              </span>
            </span>
          </div>
          <ul class="btn-box">
            <!-- <li><i class="iconfont icon-zuixiaohua"></i></li>
            <li @click="msgWindowsChange">
              <i class="iconfont icon-zuidahua" v-if="!isMax"></i>
              <i class="iconfont icon-icon-test4" v-if="isMax"></i>
            </li> -->
            <li @click="showUpdateTeam(1)" v-show="currentSession.scene=='team'">
              <i class="iconfont icon-ico_shezhi" style="color:#888"></i>
            </li>
            <li class="close" @click="closeOpenSession">
              <i class="iconfont icon-Close"></i>
            </li>
          </ul>
        </div>
        <div class="drag-body">
          <div class="team-member-box" v-if="currentSession.scene=='team'" v-show="isDownOpen">
            <ul>
              <li v-for="item in oldGroupMemberList" @dbclick="lt(item)">
                <img :src="item.avatar" />
                <span>
                  <span style="background:rgb(32, 191, 107);padding:0px 5px; border-radius:5px;color:#F1f1f1;font-size:12px;magin-right:10px;display:inline" v-if="currentSession.teamInfo.owner==item.account">群主</span>
                  {{item.alias}}
                </span>
              </li>
              <li v-if="currentSession.teamInfo.owner==userInfo.ImAccount && oldGroupMemberList.length<100">
                <div class="add" @click="addNewMember">
                  <i class="iconfont icon-mui-icon-add"></i>
                </div>
                <span style="color:rgb(30, 144, 255);margin-top: 4px;">邀请新成员</span>
              </li>
            </ul>
          </div>
          <div class="msg-content-box" id="msg-content">
            <chat-list
              type="session"
              :msglist="msglist"
              :userInfos="userInfos"
              :robotInfos="robotInfos"
              :myInfo="myInfo"
              :isRobot="isRobot"
              :canLoadMore="canLoadMore"></chat-list>
            </div>
            <div class="msg-foot-box">
               <chat-editor type="session" :isRobot="isRobot"></chat-editor>
            </div>
        </div>
      </div>
    </vue-draggable-resizable>
    <el-dialog :visible.sync="isAddGroup" class="addGroupByAlex" :modal="false">
      <div class="title">
        {{addOrUpdate==0?'邀请新成员':'新建群聊'}}
      </div>
      <div class="new-group-name" v-if="addOrUpdate==1">
        <input type="text" placeholder="请输入群名称" v-model="groupName" class="search-input" />
      </div>
      <div class="group-body">
        <div class="group-body-item">
          <input type="text" placeholder="搜索同事" v-model="newSearchContent" class="search-input" @keyup.enter="searchNameV3" @keyup="emptyChangeBox" />
          <div class="search-result-box">
            <el-tree :data='webAllpartList' v-show="groupboxSearch==0" :props="defaultProps1">
							 <span class="custom-tree-node" slot-scope="{ node, data }" :style="{'padding':data.Type==2?'5px 0':''}" >
							  	 <span class="fz14" v-if="data.Type==1">{{ node.label }}</span>
							  	 <span class="fz14" v-if="data.Type==2" @click="addFriend(0,data)">
							  	 	<img v-if='!data.Icon' src="../assets/img/litheader.png" style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
							  	 	<img v-if='data.Icon' :onerror="defaultImg" :src='data.Icon' style="width: 24px; height: 24px; border-radius: 12px; display: inline-block; vertical-align: middle;"/>
							  	 	{{ node.label }}</span>
							  </span>
						</el-tree>
            <div v-show="groupboxSearch==1" class="IM_messageList IM_searchListBox">
              <loading v-show="isLoading"></loading>
              <ul v-show="!isLoading">
                <li v-for="item in groupSearchBox" @click="addFriend(1,item)">
                  <img v-if="!item.icon" src="../assets/img/litheader.png" alt=""  width="24">
                  <img v-else :src="item.icon" alt="" :onerror="defaultImg"  width="24">
                  <div class="cont">
                      <p class="name">
                        {{item.name}}
                      </p>
                  </div>
                  <div class="tag-box">
                    <span class="tag-company">{{item.companyName}}</span>
                  </div>
                </li>
              </ul>
              <div class="search-none-data" v-show="!isLoading&&groupSearchBox.length==0">
                <i class="iconfont icon-zanwushuju"></i><br/>
                抱歉,没有找到这位无名的大侠
              </div>
            </div>
          </div>
        </div>
        <div class="group-body-item">
          <div>已选择联系人:{{GroupMemberList.length}}/100</div>
          <div class="search-result-box">
             <div class="IM_messageList IM_searchListBox">
              <ul>
                <li v-for="item in GroupMemberList">
                  <img v-if="!item.Icon" src="../assets/img/litheader.png" alt=""  width="24">
                  <img v-else :src="item.Icon" alt="" :onerror="defaultImg"  width="24">
                  <div class="cont">
                      <p class="name">
                        {{item.Name}}
                      </p>
                  </div>
                  <i class="close iconfont icon-close" @click="deleteFriend(item.IMAccount)" v-if="item.IMAccount!=userInfo.ImAccount"></i>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="group-foot" v-if="addOrUpdate==1">
        <button class="hollowFixedBtn" @click="isAddGroup=false">取消</button>
        <button class="normalBtn" @click="addNewGroup">创建</button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="isUpdateGroup" class="addGroupByAlex" :modal="false">
      <div class="title">
        修改群组信息
        <i class="iconfont icon-jiesan" @click="dismissTeam" title="解散该群" ></i>
      </div>
      <div class="cl-name">群组名称</div>
      <div class="new-group-name">
        <input type="text" placeholder="请输入群名称" v-model="currentSession.name" class="search-input" />
      </div>
      <div class="cl-name">群组成员</div>
      <div class="group-body" style="height:200px;position: relative;margin-bottom:15px;border-bottom: 1px solid #eee">
        <div class="team-member-box" v-if="currentSession.scene=='team'">
          <ul>
            <li v-for="item in oldGroupMemberList" v-if="delAccountList.indexOf(item.account)==-1">
              <img :src="item.avatar" style="border-radius:0px" />
              <span>
                {{item.alias}}
              </span>
               <i class="iconfont icon-close1" v-if="currentSession.teamInfo.owner!=item.account" @click="addDelAccount(item.account)"></i>
              <!--  -->
            </li>
          </ul>
        </div>
      </div>
      <div class="group-foot">
        <button class="hollowFixedBtn" @click="showUpdateTeam(0)">取消</button>
        <button class="normalBtn" @click="updateTeamName">保存</button>
      </div>
    </el-dialog>
    <a class="weOytour" ref="weOytour" href="http://we.oytour.com:8110/" target="view_window">Preface</a>
  </div>
</template>

<script>
import util from "../utils";
import config from "../configs";
import pageUtil from "../utils/page";
import ChatList from "./Chat/chatList";
import ChatEditor from "./Chat/ChatEditor";
//import md5 from 'js-md5'
import emojiObj from "../configs/emoji";
// import Vue from 'vue'
import loading from "./commonPage/loading";
import VueDraggableResizable from "vue-draggable-resizable";
import { setInterval, clearInterval } from 'timers';
export default {
  components: {
    ChatList,
    ChatEditor,
    loading,
    VueDraggableResizable
  },
  data() {
    return {
      language:'zh-CN',
      douTimer:null,
      defaultHeadImg:
        'this.src="' + require("../assets/img/default_head_img.jpg") + '"',
      delAccountList: [],
      isUpdateGroup: false,
      groupName: "",
      isDownOpen: false,
      isAddGroup: false,
      SystemLog: false,
      openSessions: [],
      currentSession: {},
      boxInfo: {
        width: 600,
        height: 400,
        x: 560,
        y: 280
      },
      groupboxSearch: 0,
      groupSearchBox: [],
      addOrUpdate: 0,
      //IM
      contactsType: 0,
      imToolsType: 0,
      isLoading: false,
      newSearchContent: "",
      isUpdateTeamName: false,
      editorTeam: false,
      hasNewMsg: 0,
      sysMsgList: [],
      teamName: "",
      isDrag: false,
      delSessionId: null,
      stopBubble: false,
      noticeIcon: config.noticeIcon,
      myPhoneIcon: config.myPhoneIcon,
      myGroupIcon: config.defaultGroupIcon,
      myAdvancedIcon: config.defaultAdvancedIcon,
      IM_bodyIsShow: false,
      IM_Chatlayer: false,
      sessionName: "",
      IMList: [],
      GroupMemberList: [],
      oldGroupMemberList: [],
      groupName: "",
      IMIsTeam: false,
      newGroup: true,
      hasManagePermission: false,
      hasSearched: false,
      //
      placeholder: "请输入",
      reviewIndex: "-1",
      filterText: "",
      defaultProps: {
        children: "ChildList",
        label: "DepartmentName",
        disabled: "Disabled"
      },
      defaultProps1: {
        children: "ChildList",
        label: "Name",
        disabled: "Disabled",
      },
      isAppend: true,
      isAppendOne: true,
      isAppendTwo: true,
      IM_navType: 1,
      searchType: false,
      searchKey: "",
      companyCurrentIndex: "-1",
      departmentCurrentIndex: "-1",
      userId: "",
      initialIndex: 0,
      imgList: [],
      fileList: [],
      picObj: [],
      dspNone: true,
      workFlowId: "",
      templateType: "",
      agree: true,
      outerVisible: false,
      outerVisible1: false,
      dialogTitle: "",
      dialogTitle1: "",
      IsAudit: "",
      IsCancel: "",
      IsUpdate: "",
      defaultImg: 'this.src="' + require("../assets/img/litheader.png") + '"',
      showlayer: false,
      isTransition: false,
      displayNone: true,
      dialogTitle: "",
      outerVisible: false,
      msg: {
        ParentId: 0,
        MenuStatus: "",
        MenuName: ""
      },
      appMsg: {
        WorkFlowId: "",
        TemplateType: "",
        Description: "",
        Image: []
      },
      transferMsg: {
        WorkFlowId: "",
        TemplateType: "",
        Description: "",
        CareOfEmId: "-1"
      },
      dynamicMsg: {
        groupId: "",
        pageIndex: 1,
        pageSize: 10
      },
      myDynamicMsg: {
        pageIndex: 1,
        pageSize: 10
      },
      aboutMeDynamicMsg: {
        pageIndex: 1,
        pageSize: 10
      },
      addDynamicMsg: {
        content: "",
        fileList: [],
        latAndLong: "",
        address: "",
        rB_GroupId: "-1",
        rB_BranchId: "-1",
        coverPhoto: ""
      },
      reviewMsg: {
        articleId: "",
        commentId: "0",
        content: ""
      },
      likeMsg: {
        groupId: "-1",
        articleId: ""
      },
      disLikeMsg: {
        articleId: ""
      },
      deleteMsg: {
        groupId: "-1",
        articleId: ""
      },
      allPartMsg: {
        Status: 0,
        is_show: 0,
        RB_Group_Id: "-1"
      },
      reviewCont: "",
      dynamicCont: "",
      dynamicType: "1 ",
      boxshow: false,
      userInfo: {},
      menuList: [],
      chosenIndex: 1,
      fontPub: "iconfont",
      websock: null,
      msgList: [],
      newMsg: false,
      icon: 'this.src="' + require("../assets/img/NotificationIcon.png") + '"',
      MsgCount: "",
      //返回数据
      memberList: [],
      detailList: {},
      arr: [],
      dynamicList: [],
      myDynamicList: [],
      aboutMyDynamicList: [],
      allPartList: [],
      webAllpartList: [],
      allPartOldList: [],
      searchList: [],
      isFirstLoad: true,
      unReadMsgId: [],
      isFocus: true,
      NotDealCount: "",
      MyAuditCount: "",
      sysMsgPageIndex: 1,
      firstMenuList:[],
      allSsionList:[],
      allWindowWidth: '',
      SetTimeout: null,
    };
  },
  filters: {
    decodeURIComponent(val) {
      return decodeURIComponent(val);
    },
    diaplayTime(data) {
      var str = data;
      // 将字符串转换成时间格式
      var timePublish = new Date(str);
      var timeNow = new Date();
      var minute = 1000 * 60;
      var hour = minute * 60;
      var day = hour * 24;
      var month = day * 30;
      var diffValue = timeNow - timePublish;
      var diffMonth = diffValue / month;
      var diffWeek = diffValue / (7 * day);
      var diffDay = diffValue / day;
      var diffHour = diffValue / hour;
      var diffMinute = diffValue / minute;
      var result = "";
      if (diffValue < 0) {
      } else if (diffMonth > 3) {
        result = timePublish.getFullYear() + "-";
        result += timePublish.getMonth() + "-";
        result += timePublish.getDate();
      } else if (diffMonth > 1) {
        result = parseInt(diffMonth) + "月前";
      } else if (diffWeek > 1) {
        result = parseInt(diffWeek) + "周前";
      } else if (diffDay > 1) {
        result = parseInt(diffDay) + "天前";
      } else if (diffHour > 1) {
        result = parseInt(diffHour) + "小时前";
      } else if (diffMinute > 1) {
        result = parseInt(diffMinute) + "分钟前";
      } else {
        result = "刚刚";
      }
      return result;
    }
  },
  computed: {
    sysMsgUnread() {
      let temp = this.$store.state.sysMsgUnread;
      let sysMsgUnread = temp.addFriend || 0;
      sysMsgUnread += temp.team || 0;
      let customSysMsgUnread = this.$store.state.customSysMsgUnread;
      return sysMsgUnread + customSysMsgUnread;
    },
    canLoadMore() {
      return !this.$store.state.noMoreHistoryMsgs;
    },
    userInfos() {
      return this.$store.state.userInfos;
    },
    myInfo() {
      return this.$store.state.myInfo;
    },
    myPhoneId() {
      return `${this.$store.state.userUID}`;
    },
    teamList() {
      this.$store.state.teamlist.filter(x => {
        x.avatar =
          "http://yx-web.nos.netease.com/webdoc/h5/im/default-group.png";
        x.id = "team-" + x.teamId;
        x.scene = "team";
        x.to = x.teamId;
        return x;
      });
      return this.$store.state.teamlist;
    },
    sessionlist() {
      let tempCount = 0;
      let sessionlist = this.$store.state.sessionlist.filter(item => {
        if (item.to === "684cb79fe92f46877777") return;
        if (item.unread > 0) {
          tempCount = tempCount + item.unread;
          this.openSessions.forEach(x => {
            if (x.id == item.id) x.unread = item.unread;
          });
        } else {
          this.openSessions.forEach(x => {
            if (x.id == item.id) x.unread = 0;
          });
        }
        let that = this;
        item.name = "";
        item.avatar = "";
        for (let i = 0; i < this.sysMsgList.length; i++) {
          let x = this.sysMsgList[i];
          if (x.IMID === item.to) {
            if (x.unread != item.unread) {
              // console.log(x)
              // console.log(item)
              tempCount = 1;
              // this.refreshSysNoteDate()
            }
            x.unread = item.unread;
            x.lastMsgShow = item.lastMsg.text;
            x.sessionid = item.id;
            x.updateTimeShow = item.updateTimeShow;
            return false;
          }
        }
        if (item.scene === "p2p") {
          let userInfo = null;
          if (item.to !== this.myPhoneId) {
            userInfo = this.userInfos[item.to];
          } else {
            return false;
          }
          if (userInfo) {
            item.name = util.getFriendAlias(userInfo);
            item.avatar = userInfo.avatar;
          }
        } else if (item.scene === "team") {
          let teamInfo = null;
          teamInfo = this.$store.state.teamlist.find(team => {
            return team.teamId === item.to;
          });
          if (teamInfo) {
            item.name = teamInfo.name;
            item.avatar =
              "http://yx-web.nos.netease.com/webdoc/h5/im/default-group.png";
          } else {
            item.name = "讨论组";
            item.avatar =
              "http://yx-web.nos.netease.com/webdoc/h5/im/default-group.png";
          }
          if (
            !this.$store.state.teamMembers[item.to] ||
            this.$store.state.teamMembers[item.to].length == 0
          ) {
            this.$store.dispatch("getTeamMembers", item.to);
          }
        }
        let lastMsg = item.lastMsg || {};
        if (lastMsg.type === "text") {
          item.lastMsgShow = lastMsg.text || "";
        } else if (lastMsg.type === "custom") {
          item.lastMsgShow = util.parseCustomMsg(lastMsg);
        } else if (
          lastMsg.scene === "team" &&
          lastMsg.type === "notification"
        ) {
          item.lastMsgShow = util.generateTeamSysmMsg(lastMsg);
        } else if (util.mapMsgType(lastMsg)) {
          item.lastMsgShow = `[${util.mapMsgType(lastMsg)}]`;
        } else {
          item.lastMsgShow = "";
        }
        if (item.updateTime) {
          item.updateTimeShow = util.formatDate(item.updateTime, true);
        }
        if (item.unread > 0) {
          // console.log(item)
          if (this.unReadMsgId.indexOf(item.lastMsg.idServer) == -1) {
            if (!this.isFirst) {
              this.msgGet(item);
            }
            this.unReadMsgId.push(item.lastMsg.idServer);
          }
          if(item.lastMsg.tip && item.lastMsg.tip.indexOf('抖了一下')!=-1){
            this.dou()
            this.enterChat(item)
          }
        }
        // else if(this.currentSession.id && item.lastMsg.sessionId==this.currentSession.id){
        //   if(item.lastMsg.tip && item.lastMsg.tip=='抖了一下'){
        //     this.dou()
        //   }
        // }
        // console.log(item.lastMsg)
        return item;
      });
      this.hasNewMsg = tempCount;
      this.isFirstLoad = false;
      // this.allSsionList = JSON.parse(JSON.stringify(sessionlist));
      return sessionlist;
    },
    sessionId() {
      let sessionId = this.$route.params.sessionId;
      return sessionId;
    },
    getsessionName() {
      let sessionId = this.sessionId;
      let user = null;
      if (/^p2p-/.test(sessionId)) {
        user = sessionId.replace(/^p2p-/, "");
        if (user === this.$store.state.userUID) {
          return "我的手机";
        } else if (this.isRobot) {
          return this.robotInfos[user].nick;
        } else {
          let userInfo = this.userInfos[user] || {};
          return util.getFriendAlias(userInfo);
        }
      } else if (/^team-/.test(sessionId)) {
        return "群";
      }
    },
    scene() {
      return util.parseSession(this.sessionId).scene;
    },
    to() {
      return util.parseSession(this.sessionId).to;
    },
    // 判断是否是机器人
    isRobot() {
      let sessionId = this.sessionId;
      let user = null;
      if (/^p2p-/.test(sessionId)) {
        user = sessionId.replace(/^p2p-/, "");
        if (this.robotInfos[user]) {
          return true;
        }
      }
      return false;
    },
    robotInfos() {
      return this.$store.state.robotInfos;
    },
    msglist() {
      let msgs = this.$store.state.currSessionMsgs;
      return msgs;
    }
  },
  mounted() {
    let that = this;
    this.MsgBus.$on('doudong',function(){
      that.dou()
    });
    this.MsgBus.$on('openChat',function(obj){
      that.lt(obj)
    });
    const permissionNow = Notification.requestPermission();
    var hiddenProperty =
      "hidden" in document
        ? "hidden"
        : "webkitHidden" in document
          ? "webkitHidden"
          : "mozHidden" in document
            ? "mozHidden"
            : null;
    var visibilityChangeEvent = hiddenProperty.replace(
      /hidden/i,
      "visibilitychange"
    );
    var onVisibilityChange = function() {
      if (!document[hiddenProperty]) {
        that.isFocus = true;
      } else {
        that.isFocus = false;
      }
    };
    document.addEventListener(visibilityChangeEvent, onVisibilityChange);
    // console.log('initIM',this.firstMenuList.indexOf('IM'))
    if(!localStorage.menu)
      this.$store.dispatch("connect");
    else{
      this.firstMenuList=JSON.parse(localStorage.menu)
      if(this.firstMenuList.indexOf('IM')!=-1){
        this.$store.dispatch("connect");
      }
    }
    this.userInfo = this.getLocalStorage();
    document.title=this.userInfo.GroupName
    if (this.userInfo.Icon != null) {
      this.userInfo.UserPhoto = this.userInfo.Icon;
    } else {
      this.userInfo.UserPhoto = "";
    }

    let UserInfo = this.getLocalStorage();
    this.userId = UserInfo.EmployeeId;
    this.allPartMsg.RB_Group_Id = this.deleteMsg.groupId = this.likeMsg.groupId = this.addDynamicMsg.rB_GroupId = this.dynamicMsg.groupId =
      UserInfo.RB_Group_id;
    this.addDynamicMsg.rB_BranchId = UserInfo.RB_Branch_id;
    this.getMenu();
    this.setCheckMenu();

    this.getDynamic();
    this.getMyDynamic();
    this.getAboutMeDynamic();
    this.getWebAllPart();

    document
      .getElementById("allDynamic")
      .addEventListener("scroll", function() {
        //全部动态
        if (this.scrollHeight - this.scrollTop === this.clientHeight) {
          that.isAppend = true;
          that.dynamicMsg.pageIndex =
            Math.ceil(that.dynamicList.length / 10) + 1;
          that.getDynamic();
        }
      });

    document.getElementById("myDynamic").addEventListener("scroll", function() {
      //我的动态
      if (this.scrollHeight - this.scrollTop === this.clientHeight) {
        that.isAppendOne = true;
        that.myDynamicMsg.pageIndex =
          Math.ceil(that.myDynamicList.length / 10) + 1;
        that.getMyDynamic();
      }
    });

    document
      .getElementById("aboutMeDynamic")
      .addEventListener("scroll", function() {
        //与我相关
        if (this.scrollHeight - this.scrollTop === this.clientHeight) {
          that.isAppendTwo = true;
          that.aboutMeDynamicMsg.pageIndex =
            Math.ceil(that.aboutMyDynamicList.length / 10) + 1;
          that.getAboutMeDynamic();
        }
      });
    if (
      window.localStorage.msgBoxInfo &&
      window.localStorage.msgBoxInfo != ""
    ) {
      this.boxInfo = JSON.parse(window.localStorage.msgBoxInfo);
    }
    if (this.boxInfo.x == 0) {
      this.boxInfo.x = 560;
    }
    if (this.boxInfo.y == 0) {
      this.boxInfo.y = 280;
    }
    this.Financial_post_GetNotDealCount();
    this.app_user_workflow_MyAuditCount();
    this.refreshSysNoteDate();
  },
  created() {
    //页面刚进入时开启长连接
    //  this.initWebSocket()
    let language = localStorage.language
    if (!language) {
      this.language = 'zh-CN';
      this.$i18n.locale = 'zh-CN';
    } else {
      this.language = language
      this.$i18n.locale = language;
    }
    //IM_body
    let allWindowWidth = window.innerWidth;
    this.allWindowWidth = allWindowWidth - 50 - 220 - 60;
    let maxLength = parseInt(allWindowWidth/100);
    this.maxLength = maxLength;
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    }
  },
  methods: {
    ChangeLan(str){
      this.language=str;
      this.$i18n.locale = str;
      localStorage.language = str;
    },
    settingSys: function () {
      this.MsgBus.$emit('settingOpen')
    },
    hideIM(){
      if(this.IM_bodyIsShow){
        this.IM_bodyIsShow=false
      }
    },
    dou(){
      if(!this.douTimer){
        let x=this.boxInfo.x;
        let y=this.boxInfo.y;
        let t=0;
        let c=0;
        this.douTimer = setInterval(()=>{
          // console.log('come in ..........')
          if(t==0)
            this.$refs.resizeBox._data.top=y+2
          if(t==2)
            this.$refs.resizeBox._data.top=y-2
          if(t==1)
            this.$refs.resizeBox._data.left=x-2
          if(t==3){
            this.$refs.resizeBox._data.left=x+2
            t=0
          }else{
            t++
          }
          c++
          if(c==40){
            this.$refs.resizeBox._data.top=y
            this.$refs.resizeBox._data.left=x
            clearInterval(this.douTimer)
            this.douTimer=null
          }

        },25)
      }
    },
    LogSetReadStatus(s) {
      this.apipost(
        "SystemLog_post_LogSetReadStatus",
        { LogId: s.ID },
        r => {
          if (s.Link) {
            this.goUrl(s.Link);
          }
          this.IM_bodyIsShow = false;
          this.refreshSysNoteDate();
        },
        null
      );
    },
    refreshSysNoteDate(add) {
      this.sysMsgList = [];
      if (add) {
        this.sysMsgPageIndex = this.sysMsgPageIndex + 1;
      }
      // todo 实现加载系统通知
      //获取消息列表
      let msg = {
        pageIndex: this.sysMsgPageIndex,
        pageSize: "5",
        RB_BranchId: parseInt(this.$cookie.get("RB_Branch_id")),
        IsRead: 0,
        IsSys: 1,
        Recipient: parseInt(this.$cookie.get("EmployeeId")),
        RecPlatform: 2,
        Title: "",
        Type: "1",
        ShowShortcut: "1"
      };
      this.SystemLog = true;
      this.apipost(
        "SystemLog_get_LogGetPageList",
        msg,
        res => {
          if (res.data.resultCode == 1) {
            this.MsgCount = res.data.data.count;
            if (res.data.data.count > 0) {
              let data = res.data.data.pageData;
              data.forEach(x => {
                x.CreateTime = this.$commonUtils.formatMsgTime(
                  x.CreateTime.replace("T", " ")
                );
                if (add) {
                  this.msgList.push(x);
                  // console.log(this.msgList)
                }
              });
              if (!add) {
                this.msgList = data;
              }
              let sysMsg = {
                name: "通知消息",
                updateTimeShow: "",
                unread: 0,
                lastMsgShow:  "条未读消息",
                IMID: "684cb79fe92f46888888",
                type: "system",
                dataAPI: "/components/administrative/forMyApproval",
                sessionid: ""
              };
              this.sysMsgList.push(sysMsg);
            }
          }
          this.SystemLog = false;
        },
        err => {}
      );
    },
    diaplayTime(data) {
      var str = data;
      // 将字符串转换成时间格式
      var timePublish = new Date(str);
      var timeNow = new Date();
      var minute = 1000 * 60;
      var hour = minute * 60;
      var day = hour * 24;
      var month = day * 30;
      var diffValue = timeNow - timePublish;
      var diffMonth = diffValue / month;
      var diffWeek = diffValue / (7 * day);
      var diffDay = diffValue / day;
      var diffHour = diffValue / hour;
      var diffMinute = diffValue / minute;
      var result = "";
      if (diffValue < 0) {
      } else if (diffMonth > 3) {
        result = timePublish.getFullYear() + "-";
        result += timePublish.getMonth() + "-";
        result += timePublish.getDate();
      } else if (diffMonth > 1) {
        result = parseInt(diffMonth) + "月前";
      } else if (diffWeek > 1) {
        result = parseInt(diffWeek) + "周前";
      } else if (diffDay > 1) {
        result = parseInt(diffDay) + "天前";
      } else if (diffHour > 1) {
        result = parseInt(diffHour) + "小时前";
      } else if (diffMinute > 1) {
        result = parseInt(diffMinute) + "分钟前";
      } else {
        result = "刚刚";
      }
      return result;
    },
    Financial_post_GetNotDealCount() {
      this.apipost(
        "Financial_post_GetNotDealCount",
        {},
        r => {
          if (r.data.resultCode == 1) {
            this.NotDealCount = r.data.data;
          }
        },
        null
      );
    },
    app_user_workflow_MyAuditCount() {
      this.apipost(
        "app_user_workflow_MyAuditCount",
        {},
        r => {
          if (r.data.resultCode == 1) {
            this.MyAuditCount = r.data.data;
          }
        },
        null
      );
    },
    zhishiquan() {
      this.$refs.weOytour.click();
    },
    addDelAccount(account) {
      this.delAccountList.push(account);
    },
    showUpdateTeam(type) {
      this.delAccountList = [];
      this.isUpdateGroup = type == 1;
    },
    addNewGroup() {
      if (this.groupName == "") {
        this.$message.error("请输入群名称");
        return;
      }
      if (this.GroupMemberList.length > 1) {
        let accouts = [];
        this.GroupMemberList.forEach(x => {
          accouts.push(x.IMAccount);
        });
        this.$store.dispatch("delegateTeamFunction", {
          functionName: "createTeam",
          options: {
            type: "normal",
            name: this.groupName,
            avatar: "",
            accounts: accouts,
            done: (error, obj) => {
              this.isAddGroup = false;
              this.groupName = "";
              this.s;
              if (error) {
                this.$message.error("创建群失败");
              }
              if (!error) {
                this.$store.state.teamlist.push(obj.team);
                this.newSearchContent = "";
                this.$store.dispatch("createTeam", obj);
                if (!this.$store.state.teamMembers[obj.team.teamId]) {
                  this.$store.state.teamMembers[obj.team.teamId] = [];
                }
                this.GroupMemberList.forEach(x => {
                  let memberOjb = {};
                  memberOjb.account = x.IMAccount;
                  memberOjb.active = true;
                  memberOjb.alias = x.Name;
                  memberOjb.avatar = x.Icon;
                  memberOjb.id = obj.team.teamId + "-" + x.IMAccount;
                  memberOjb.joinTime = 0;
                  memberOjb.mute = false;
                  memberOjb.nickInTeam = "";
                  memberOjb.teamId = obj.team.teamId;
                  memberOjb.type = "normal";
                  memberOjb.updateTime = 0;
                  memberOjb.valid = true;
                  this.$store.state.teamMembers[obj.team.teamId].push(
                    memberOjb
                  );
                });
                obj.team.id = "team-" + obj.team.teamId;
                this.enterTeamChat(obj.team);
              }
            }
          }
        });
      } else {
        this.$message.error("请选择群员");
      }
    },
    createGroup() {
      this.isAddGroup = true;
      this.addOrUpdate = 1;
      this.GroupMemberList = [];
      let obj = {};
      obj.Icon = this.userInfo.UserPhoto;
      obj.IMAccount = this.userInfo.ImAccount;
      obj.Name = this.userInfo.emName;
      this.GroupMemberList.push(obj);
    },
    changeContactGroup(type) {
      this.contactsType = type;
    },
    emptyChangeBox() {
      if (this.newSearchContent == "") this.groupboxSearch = 0;
    },
    addNewMember() {
      this.isAddGroup = true;
      this.addOrUpdate = 0;
      this.GroupMemberList = [];
      this.oldGroupMemberList.forEach(x => {
        //Icon:obj.Icon,IMAccount:obj.IMAccount,Name:obj.Name
        let obj = {};
        obj.Icon = x.avatar;
        obj.IMAccount = x.account;
        obj.Name = x.alias;
        this.GroupMemberList.push(obj);
      });
    },
    changeTheDown() {
      this.isDownOpen = !this.isDownOpen;
    },
    deleteOpenSession(index) {
      if (this.openSessions[index].id == this.currentSession.id) {
        this.openSessions.splice(index, 1);
        this.currentSession = this.openSessions[0];
        //this.$store.dispatch('resetCurrSession')
        this.enterChat(this.openSessions[0]);
      } else {
        this.openSessions.splice(index, 1);
      }
    },
    closeOpenSession() {
      // let i=0
      // this.openSessions.forEach((x,index)=>{
      //   if(x.id==this.currentSession.id){
      //     i=index
      //   }
      // })
      // this.openSessions.splice(i,1)
      // if(this.openSessions.length>0){
      //   this.currentSession=this.openSessions[0]
      //   this.enterChat(this.openSessions[0])
      // }else{
      //   this.IM_Chatlayer=false
      // }
      this.$store.dispatch("resetCurrSession");
      this.IM_Chatlayer = false;
      this.openSessions.splice(0, this.openSessions.length);
    },
    onResizstop(x, y, w, h) {
      this.boxInfo.x = x;
      this.boxInfo.y = y;
      this.boxInfo.width = w;
      this.boxInfo.height = h;
      window.localStorage.msgBoxInfo = JSON.stringify(this.boxInfo);
    },
    onDragstop(x, y) {
      this.boxInfo.x = x;
      this.boxInfo.y = y;
      window.localStorage.msgBoxInfo = JSON.stringify(this.boxInfo);
    },
    changeTools(index) {
      if(index==0)
        this.newSearchContent='';
      this.imToolsType = index;
      this.searchList = [];
    },
    updateTeamName() {
      if (this.currentSession.name == "") {
        this.$message.error("请输入群名称");
        return;
      }
      this.$store.dispatch("delegateTeamFunction", {
        functionName: "updateTeam",
        options: {
          teamId: this.currentSession.teamInfo.teamId,
          name: this.currentSession.name,
          done: (error, team) => {
            this.isUpdateGroup = false;
            if (error) {
              this.$message.error("失败!");
            } else {
              this.$store.state.teamlist.forEach(x => {
                if (x.teamId == this.currentSession.teamInfo.teamId) {
                  x.name = this.currentSession.name;
                }
              });

              this.delAccountList.forEach(x => {
                this.deleteFriend(x);
              });
            }
          }
        }
      });
    },
    dismissTeam() {
      let teamId = this.currentSession.id.split("-")[1];
      this.$store.dispatch("delegateTeamFunction", {
        functionName: "dismissTeam",
        options: {
          teamId: teamId,
          done: (error, team) => {
            this.openSessions.forEach((x, index) => {
              if (x.id == "team-" + teamId) {
                this.deleteOpenSession(index);
              }
            });
            let i = 0;
            this.$store.state.teamlist.forEach((x, index) => {
              if (x.teamId == teamId) {
                i = index;
              }
            });
            this.$store.state.teamlist.splice(i, 1);
          }
        }
      });
    },
    dragDiv() {
      if (this.isDrag == true) {
        document.onmousemove = function(e) {
          if (document.getElementById("IM_chatLayer").offsetWidth >= 600) {
            document.getElementById("IM_chatLayer").style.width =
              document.body.clientWidth - 360 - e.pageX + "px";
          } else {
            document.getElementById("IM_chatLayer").style.width = "600px";
          }
        };
      }
    },
    searchUsers(Accounts) {
      this.$store.dispatch("searchUsers", {
        accounts: Accounts,
        done: users => {
          this.updateTeamMember(users);
          users.forEach(x => {
            this.$store.state.userInfos[x.account] = x;
          });
        }
      });
    },
    updateTeamMember(users) {
      users.forEach(user => {
        var member = this.oldGroupMemberList.find(member => {
          return member.account === user.account;
        });
        if (member) {
          member.avatar = user.avatar;
          member.alias = member.nickInTeam || user.nick;
        }
      });
    },
    leaveTeam() {
      let that = this;
      this.editorTeam = false;
      this.$confirm("是否退群?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          that.$store.dispatch("delegateTeamFunction", {
            functionName: "leaveTeam",
            options: {
              teamId: window.localStorage.sessionId.substring(
                5,
                window.localStorage.sessionId.length
              ),
              done: (error, obj) => {
                if (!error) {
                  this.$message.success("你已经成功退群!");
                  this.IM_Chatlayer = false;
                  this.IM_navType = 1;
                  this.$store.dispatch(
                    "deleteSession",
                    window.localStorage.sessionId
                  );
                } else {
                  this.$message.error("退群失败!");
                }
              }
            }
          });
        })
        .catch(() => {
          this.$message.info("已取消!");
        });
    },
    deleteFriend(account) {
      this.GroupMemberList.forEach((item, index) => {
        if (item.IMAccount == account) {
          this.GroupMemberList.splice(index, 1);
        }
      });
      let isOld = false;
      this.oldGroupMemberList.forEach((item, index) => {
        if (item.account == account) {
          isOld = true;
        }
      });
      this.$store.dispatch("delegateTeamFunction", {
        functionName: "removeTeamMembers",
        options: {
          teamId: this.currentSession.teamInfo.teamId,
          accounts: [account],
          done: (error, obj) => {
            if (error) {
              this.$message.error("你没有该操作权限!");
            } else {
              this.oldGroupMemberList.forEach((item, index) => {
                if (item.account == account) {
                  this.oldGroupMemberList.splice(index, 1);
                }
              });

              this.$store.state.teamMembers[
                this.currentSession.teamInfo.teamId
              ] = this.oldGroupMemberList;
              //this.$message.success('移除成功!')
              this.$store.dispatch(
                "removeTeamMembers",
                obj.teamId,
                obj.account
              );
            }
          }
        }
      });
    },

    deleteOldFriend(obj) {},
    addFriend(type, obj) {
      if (obj.imAccount) {
        obj.IMAccount = obj.imAccount;
      }
      if (obj.IMAccount != null) {
        let _index = -1;
        this.GroupMemberList.forEach((item, index) => {
          if (obj.IMAccount == item.IMAccount) {
            _index = index;
          }
        });

        if (_index == -1) {
          //添加
          if (this.addOrUpdate == 0) {
            let imList = [];
            imList.push(obj.IMAccount);
            this.$store.dispatch("delegateTeamFunction", {
              functionName: "addTeamMembers",
              options: {
                teamId: this.currentSession.teamInfo.teamId,
                accounts: imList,
                done: (error, obj2) => {
                  if (!error) {
                    // this.$message.success('成功!')
                    // this.clearBuildGroup()
                    // this.IM_navType=1
                    let demoObj = {
                      Icon: obj.icon,
                      IMAccount: obj.imAccount,
                      Name: obj.name
                    };
                    this.GroupMemberList.push(demoObj);
                    let memberOjb = {};
                    memberOjb.account = obj.imAccount;
                    memberOjb.active = true;
                    memberOjb.alias = obj.name;
                    memberOjb.avatar = obj.icon;
                    memberOjb.id =
                      this.currentSession.teamInfo.teamId + "-" + obj.imAccount;
                    memberOjb.joinTime = 0;
                    memberOjb.mute = false;
                    memberOjb.nickInTeam = "";
                    memberOjb.teamId = this.currentSession.teamInfo.teamId;
                    memberOjb.type = "normal";
                    memberOjb.updateTime = 0;
                    memberOjb.valid = true;
                    this.$store.state.teamMembers[memberOjb.teamId].push(
                      memberOjb
                    );
                    this.updateFriend();
                  }
                }
              }
            });
          } else {
            let demoObj = {
              Icon: obj.icon,
              IMAccount: obj.imAccount,
              Name: obj.name
            };
            this.GroupMemberList.push(demoObj);
          }
        }
      } else {
        this.$message.warning("该员工暂时不可进群,请联系管理员!");
        if (this.IMList.findIndex(item => item === null) != -1) {
          this.IMList.splice(this.IMList.findIndex(item => item === null), 1);
        }
      }
    },
    addSearchFriend(obj) {
      if (obj.imAccount != null) {
        let _index = -1;
        this.IMList.forEach((item, index) => {
          if (obj.imAccount == item) {
            _index = index;
          }
        });
        if (_index == -1) {
          //添加
          this.GroupMemberList.push({
            Icon: obj.icon,
            IMAccount: obj.imAccount,
            Name: obj.name
          });
        } else {
          this.GroupMemberList.splice(_index, 1);
        }
      } else {
        this.$message.warning("该员工暂时不可进群,请联系管理员!");
        if (this.IMList.findIndex(item => item === null) != -1) {
          this.IMList.splice(this.IMList.findIndex(item => item === null), 1);
        }
      }
    },
    updateFriend() {
      this.newGroup = false;
      this.editorTeam = false;
      this.IMList = [];
      let userInfos = this.$store.state.userInfos;
      let teamId = window.localStorage.sessionId.substring(
        5,
        window.localStorage.sessionId.length
      );
      let members = this.$store.state.teamMembers[teamId];
      let needSearchAccounts = [];
      this.oldGroupMemberList = [];
      if (members === undefined) {
        this.$store.dispatch("getTeamMembers", teamId);
        members = this.$store.state.teamMembers[teamId];
      }
      if (members) {
        members = members.map(item => {
          this.IMList.push(item.account);
          let member = Object.assign({}, item); //重新创建一个对象,用于存储展示数据,避免对vuex数据源的修改
          //member.valid = true //被管理员移除后,标记为false
          if (
            userInfos[member.account] === undefined ||
            userInfos[member.account].avatar === undefined
          ) {
            needSearchAccounts.push(member.account);
            member.avatar = member.avatar || this.avatar;
            member.alias = member.nickInTeam || member.account;
          } else {
            member.avatar = userInfos[member.account].avatar;
            member.alias = member.nickInTeam || userInfos[member.account].nick;
          }
          return member;
        });
        if (needSearchAccounts.length > 0) {
          this.searchUsers(needSearchAccounts.splice(0, 150));
        }
        this.oldGroupMemberList = members;
      }
    },
    saveGroup() {
      if (this.newGroup) {
        if (this.IMList.length < 1) {
          //
          this.$message.warning("建群至少要有一个成员!");
          return;
        }
        this.$store.dispatch("delegateTeamFunction", {
          functionName: "createTeam",
          options: {
            type: "normal",
            name: "讨论组",
            avatar: "",
            accounts: this.IMList,
            done: (error, obj) => {
              if (error) {
                this.$message.error("创建群失败");
              }
              if (!error) {
                this.$message.success("成功!");
                this.$store.state.teamlist.push(obj.team);
                this.searchUsers(obj.accounts);

                this.clearBuildGroup();
                this.IM_navType = 1;
                this.$store.dispatch("createTeam", obj);
              }
            }
          }
        });
      } else {
        this.$store.dispatch("delegateTeamFunction", {
          functionName: "addTeamMembers",
          options: {
            teamId: window.localStorage.sessionId.substring(
              5,
              window.localStorage.sessionId.length
            ),
            accounts: this.IMList,
            done: (error, obj) => {
              if (error) {
                this.$message.error("修改成员失败!");
                return;
              }
              if (!error) {
                this.$store.dispatch(
                  "addTeamMembers",
                  window.localStorage.sessionId.substring(
                    5,
                    window.localStorage.sessionId.length
                  ),
                  this.IMList
                );
                this.$message.success("成功!");
                this.clearBuildGroup();
                this.IM_navType = 1;
              }
            }
          }
        });
      }
    },

    buildGroup() {
      this.IM_Chatlayer = false;
      this.IM_navType = 4;
      this.newGroup = true;
      this.searchKey = "";
      this.searchType = false;
      this.clearBuildGroup();
    },
    clearBuildGroup() {
      this.GroupMemberList = [];
      this.oldGroupMemberList = [];
      this.IMList = [];
    },
    enterSystemChat(session) {
      this.IM_navType = 5;
      this.IM_Chatlayer = false;
      let id = "p2p-" + session.IMID;
      session.unread = 0;
      this.$store.dispatch("setCurrSession", id);
      window.localStorage.sessionId = id;
      this.teamName = session.name;
    },
    enterChat(session) {
      this.MsgBus.$emit('imgprevclear')
      this.isDownOpen = false;
      this.clearBuildGroup();
      this.isUpdateTeamName = false;
      this.editorTeam = false;
      this.$store.dispatch("setCurrSession", session.id);
      window.localStorage.sessionId = session.id;
      this.IM_Chatlayer = true;
      this.teamName = session.name;
      if (session.scene == "team") {
        this.IMIsTeam = true;
        this.$store.dispatch(
          "getTeamMembers",
          session.id.substring(5, window.localStorage.sessionId.length)
        );
        let teamInfo = null;
        teamInfo = this.$store.state.teamlist.find(team => {
          return (
            team.teamId ===
            session.id.substring(5, window.localStorage.sessionId.length)
          );
        });
        this.teamName = teamInfo.name;
        this.$store.state.teamlist.forEach(x => {
          if (x.teamId == session.to) {
            session.teamInfo = x;
          }
        });
        this.updateFriend();
      } else {
        this.IMIsTeam = false;
      }
      let isExsit = false;
      this.openSessions.forEach(x => {
        if (x.id == session.id) {
          isExsit = true;
          x.isCurrent = true;
        } else {
          x.isCurrent = false;
        }
      });
      if (!isExsit) {
        session.isCurrent = true;
        this.openSessions.push(session);
      }
      this.currentSession = session;
      if(!session.name || session.name==''){
        setTimeout(() => {
          this.sessionlist.forEach(x=>{
            if(session.id==x.id)
              this.currentSession = x;
          })
        }, 1000);
      }
      pageUtil.scrollChatListDown();
    },
    deleteSession(session) {
      if (session.id !== null) {
        this.$store.dispatch("deleteSession", session.id);
      }
    },
    lt(obj) {
      this.MsgBus.$emit('imgprevclear')
      if (obj.account && obj.account != "") {

        obj.imAccount = obj.account;
        obj.name = obj.alias;
        obj.avatar = obj.avatar;
      } else if (obj.IMAccount && obj.IMAccount != "") {
        obj.imAccount = obj.IMAccount;
        obj.name = obj.Name;
        obj.avatar = obj.Icon;
      }
      if(!obj.avatar && obj.icon){
        obj.avatar=obj.icon
      }
      if (obj.imAccount != null) { // 判断是否有im账号
        let session = null;
        this.$store.state.sessionlist.forEach(x => { // 判断是否已在会话列表存在的会话
          if (x.id == "p2p-" + obj.imAccount) {
            session = x;   // 存在
          }
        });
        if (!session) {  // 不存在 组装数据
          session = {};
          session.id = "p2p-" + obj.imAccount;
          session.name = obj.name;
          session.avatar = obj.avatar;
        }
        this.isDownOpen = false;
        this.clearBuildGroup();
        this.isUpdateTeamName = false;
        this.editorTeam = false;
        this.$store.dispatch("setCurrSession", session.id);
        window.localStorage.sessionId = session.id;
        this.IM_Chatlayer = true;
        this.IMIsTeam = false;
        let isExsit = false;
        this.openSessions.forEach(x => {
          if (x.id == session.id) {
            isExsit = true;
            x.isCurrent = true;
          } else {
            x.isCurrent = false;
          }
        });
        if (!isExsit) {
          session.isCurrent = true;
          this.openSessions.push(session);
        }
        this.currentSession = session;
        pageUtil.scrollChatListDown();
      } else {
        this.$message.warning("该员工暂时不可聊天,请联系管理员");
      }
    },
    dbChat(obj) {
      if (obj.IMAccount != null) {
        this.teamName = obj.Name;
        this.IM_Chatlayer = true;
        pageUtil.scrollChatListDown();
      } else {
        this.$message.warning("该员工暂时不可聊天,请联系管理员");
      }
    },
    enterTeamChat(teamInfo) {
      this.MsgBus.$emit('imgprevclear')
      let session = {};
      session.id = teamInfo.id;
      session.to = teamInfo.teamId;
      session.name = teamInfo.name;
      session.teamInfo = teamInfo;
      session.scene = "team";
      session.avatar =
        "http://yx-web.nos.netease.com/webdoc/h5/im/default-group.png";
      this.isDownOpen = false;
      this.clearBuildGroup();
      this.isUpdateTeamName = false;
      this.editorTeam = false;
      this.$store.dispatch("setCurrSession", session.id);
      window.localStorage.sessionId = session.id;
      this.IM_Chatlayer = true;
      pageUtil.scrollChatListDown();
      this.teamName = session.name;

      this.$store.dispatch("getTeamMembers", session.to);
      this.$store.state.teamlist.forEach(x => {
        if (x.teamId == session.to) {
          session.teamInfo = x;
        }
      });
      this.updateFriend();
      let isExsit = false;
      this.openSessions.forEach(x => {
        if (x.id == session.id) {
          isExsit = true;
          x.isCurrent = true;
        } else {
          x.isCurrent = false;
        }
      });
      if (!isExsit) {
        session.isCurrent = true;
        this.openSessions.push(session);
      }
      this.currentSession = session;
    },
    isSearchType() {
      if (this.searchKey == "") {
        this.searchType = false;
      }
    },
    searchName() {
      if (this.searchKey != "") {
        this.searchType = true;
        this.apipost(
          "admin_Get_Chat_All_SelectEmpName",
          { EmName: this.searchKey },
          res => {
            if (res.data.resultCode == 1) {
              this.searchList = res.data.data;
            }
          },
          err => {}
        );
      }
    },
    searchNameV2() {
      if (this.newSearchContent != "") {
        this.imToolsType = -1;
        this.searchType = true;
        this.searchList = [];
        this.isLoading = true;
        this.apipost(
          "admin_Get_Chat_All_SelectEmpName",
          { EmName: this.newSearchContent },
          res => {
            if (res.data.resultCode == 1) {
              if (res.data.data.length > 1) {
                this.searchList = [];
              }
              this.searchList = res.data.data;
              this.searchList.forEach(x => {
                x.lastMsg = "没有他和你的聊天信息哦";
                if (!x.imAccount || x.imAccount == "")
                  x.lastMsg = "该同事还没有开通聊天功能呢";
                else {
                  this.sessionlist.forEach(y => {
                    if (y.id.indexOf(x.imAccount) != -1) {
                      x.lastMsg = y.lastMsgShow;
                      return false;
                    }
                  });
                }
              });
              this.searchList.forEach((x, index) => {
                this.$set(this.searchList, index, x);
              });
            }
            this.isLoading = false;
          },
          err => {}
        );
      }
    },
    searchNameV3() {
      if (this.newSearchContent != "") {
        this.groupboxSearch = 1;
        this.groupSearchBox = [];
        this.isLoading = true;
        this.apipost(
          "admin_Get_Chat_All_SelectEmpName",
          { EmName: this.newSearchContent },
          res => {
            if (res.data.resultCode == 1) {
              if (res.data.data.length > 1) {
                this.groupSearchBox = [];
              }
              this.groupSearchBox = res.data.data;
              this.groupSearchBox.forEach(x => {
                x.lastMsg = "";
                if (x.imAccount && x.imAccount != "") {
                  this.sessionlist.forEach(y => {
                    if (y.id.indexOf(x.imAccount) != -1) {
                      x.lastMsg = y.lastMsgShow;
                      return false;
                    }
                  });
                }
              });
              this.groupSearchBox.forEach((x, index) => {
                this.$set(this.groupSearchBox, index, x);
              });
            }
            this.isLoading = false;
          },
          err => {}
        );
      }
    },
    getAllpart() {
      this.apipost(
        "admin_chat_get_all_brunch_info",
        this.allPartMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.allPartList = res.data.data;
            this.allPartOldList = JSON.parse(JSON.stringify(res.data.data));
          }
        },
        err => {}
      );
    },

    getWebAllPart() {
      this.apipost(
        "admin_Get_GetCompanyDepartMentEmployeeForChar",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.webAllpartList = res.data.data;
          } else {
          }
        },
        err => {}
      );
    },

    deleteComments(id, index, aId) {
      //从全部动态删除评论
      this.isAppend = false;
      this.isAppendOne = false;
      this.dynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.apipost(
        "user_dynamic_delete_comment",
        { commentId: id },
        res => {
          if (res.data.resultCode == 1) {
            this.getDynamic(index);
            this.myDynamicList.forEach((item, index) => {
              if (item.id == aId) {
                this.getMyDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    deleteCommentsOne(id, index, aId) {
      //从我发布的删除评论
      this.isAppend = false;
      this.isAppendOne = false;
      this.myDynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.apipost(
        "user_dynamic_delete_comment",
        { commentId: id },
        res => {
          if (res.data.resultCode == 1) {
            this.getMyDynamic(index);
            this.dynamicList.forEach((item, index) => {
              if (item.id == aId) {
                this.getDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    deleteArticle(id) {
      //删除动态
      this.deleteMsg.articleId = id;
      this.$confirm("是否删除?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.apipost(
            "delete_dynamic",
            this.deleteMsg,
            res => {
              if (res.data.resultCode == 1) {
                this.$message.success(res.data.message);
                this.myDynamicList.forEach((item, index) => {
                  if (item.id == id) {
                    this.myDynamicList.splice(index, 1);
                  }
                });
              } else {
                this.$message.error(res.data.message);
              }
            },
            err => {}
          );
        })
        .catch(() => {
          this.$message.info("已取消删除!");
        });
    },
    likeArticle(id, index) {
      //从全部动态点赞
      this.isAppend = false;
      this.isAppendOne = false;
      this.dynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      //this.myDynamicMsg.pageIndex=Math.ceil((index+1)/10)
      this.likeMsg.articleId = id;
      this.apipost(
        "user_dynamic_like",
        this.likeMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.getDynamic(index);
            this.myDynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getMyDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    likeArticleOne(id, index) {
      //从我发布的点赞
      this.isAppend = false;
      this.isAppendOne = false;
      this.myDynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.likeMsg.articleId = id;
      this.apipost(
        "user_dynamic_like",
        this.likeMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.getMyDynamic(index);
            this.dynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },

    disLikeArticle(id, index) {
      //从全部取消点赞
      this.isAppend = false;
      this.isAppendOne = false;
      this.dynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.disLikeMsg.articleId = id;
      this.apipost(
        "user_dynamic_cancel_like",
        this.disLikeMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.getDynamic(index);
            this.myDynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getMyDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },

    disLikeArticleOne(id, index) {
      //从我发布的取消点赞
      this.isAppend = false;
      this.isAppendOne = false;
      this.dynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.disLikeMsg.articleId = id;
      this.apipost(
        "user_dynamic_cancel_like",
        this.disLikeMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.getMyDynamic(index);
            this.dynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getDynamic(index);
              }
            });
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },

    SaveDynamic() {
      //发布动态
      this.addDynamicMsg.content = encodeURIComponent(this.dynamicCont);
      this.apipost(
        "user_publish_dynamic",
        this.addDynamicMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.dynamicType = 1;
            this.getDynamic();
            this.getMyDynamic();
            this.$message.success(res.data.message);
          }
        },
        err => {}
      );
    },

    reviewArticle(id, index) {
      //从全部动态回复
      this.isAppend = false;
      this.isAppendOne = false;
      this.dynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      //this.myDynamicMsg.pageIndex=Math.ceil((index+1)/10)
      this.reviewMsg.articleId = id;
      this.reviewMsg.content = encodeURIComponent(this.reviewCont); //编码
      this.apipost(
        "user_dynamic_comment",
        this.reviewMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.reviewCont = "";
            this.getDynamic(index);
            this.myDynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getMyDynamic(index);
              }
            });
          }
        },
        err => {}
      );
    },

    reviewArticleOne(id, index) {
      //从我发布的回复
      this.isAppend = false;
      this.isAppendOne = false;
      //this.dynamicMsg.pageIndex=Math.ceil((index+1)/10)
      this.myDynamicMsg.pageIndex = Math.ceil((index + 1) / 10);
      this.reviewMsg.articleId = id;
      this.reviewMsg.content = encodeURIComponent(this.reviewCont); //编码
      this.apipost(
        "user_dynamic_comment",
        this.reviewMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.reviewCont = "";
            this.getMyDynamic(index);
            this.dynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getDynamic(index);
              }
            });
          }
        },
        err => {}
      );
    },

    reviewArticleTwo(id, index) {
      //从与我相关回复
      this.isAppend = false;
      this.isAppendOne = false;
      this.reviewMsg.articleId = id;
      this.reviewMsg.content = encodeURIComponent(this.reviewCont); //编码
      this.apipost(
        "user_dynamic_comment",
        this.reviewMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.reviewCont = "";
            this.dynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getDynamic(index);
              }
            });
            this.myDynamicList.forEach((item, index) => {
              if (item.id == id) {
                this.getMyDynamic(index);
              }
            });
          }
        },
        err => {}
      );
    },

    getDynamic(index) {
      //获取全部动态
      this.apipost(
        "dynamic_list",
        this.dynamicMsg,
        res => {
          if (res.data.resultCode == 1) {
            res.data.data.pageData.forEach((item, index) => {
              let i = index + (this.dynamicMsg.pageIndex - 1) * 10;
              if (item.commentList.length > 0) {
                item.commentList.forEach(x => {
                  x["outIndex"] = i;
                });
              }
            });
            if (this.isAppend) {
              //追加
              this.dynamicList = this.dynamicList.concat(
                res.data.data.pageData
              );
            } else {
              //替换
              let replaceItem = res.data.data.pageData[index % 10];
              this.dynamicList.splice(index, 1, replaceItem);
            }
          }
        },
        err => {}
      );
    },

    getMyDynamic(index) {
      //获取我的动态
      this.apipost(
        "user_web_my_dynamic_list",
        this.myDynamicMsg,
        res => {
          if (res.data.resultCode == 1) {
            res.data.data.pageData.forEach((item, index) => {
              let i = index + (this.myDynamicMsg.pageIndex - 1) * 10;
              if (item.commentList.length > 0) {
                item.commentList.forEach(x => {
                  x["outIndex"] = i;
                });
              }
            });
            if (this.isAppendOne) {
              this.myDynamicList = this.myDynamicList.concat(
                res.data.data.pageData
              );
            } else {
              let replaceItem = res.data.data.pageData[index % 10];
              this.myDynamicList.splice(index, 1, replaceItem);
            }
          }
        },
        err => {}
      );
    },
    getAboutMeDynamic() {
      this.apipost(
        "user_about_me_dynamic_list",
        this.aboutMeDynamicMsg,
        res => {
          if (res.data.resultCode == 1) {
            if (this.isAppendTwo) {
              this.aboutMyDynamicList = this.aboutMyDynamicList.concat(
                res.data.data.pageData
              );
            } else {
            }
          }
        },
        err => {}
      );
    },
    uploadImg(file) {
      //上传
      let newArr = [];
      newArr.push(file.file);
      let path = "/Upload/Temporary/";
      this.UploadSelfFileT(path, newArr, x => {
        let url = this.domainManager().ViittoFileUrl + x.data.FilePath
        this.addDynamicMsg.fileList.push(url);
        this.imgList.push({ url: url });
      });
    },
    handleRemoveImg(file) {
      //删除
      this.imgList.forEach((item, index) => {
        if (item.url == file.url) {
          this.imgList.splice(index, 1);
        }
      });
      this.addDynamicMsg.fileList.forEach((item, index) => {
        if (item == file.url) {
          this.addDynamicMsg.fileList.splice(index, 1);
        }
      });
    },
    uploadTest(file) {
      //上传
      let newArr = [];
      newArr.push(file.file);
      let path = "/Upload/Temporary/";
      this.UploadSelfFileT(path, newArr, x => {
        let src = this.domainManager().ViittoFileUrl + x.data.FilePath
        this.appMsg.Image.push(src);
        this.fileList.push({ url: src});
      });
    },
    handleRemove(file) {
      //删除
      this.fileList.forEach((item, index) => {
        if (item.url == file.url) {
          this.fileList.splice(index, 1);
        }
      });
      this.appMsg.Image.forEach((item, index) => {
        if (item == file.url) {
          this.appMsg.Image.splice(index, 1);
        }
      });
    },
    handleExceed(files, fileList) {
      this.$message.warning("最多只能上传9张图片!");
    },
    clearDialogMsg(done) {
      done();
      this.appMsg.Description = "";
      //	this.appMsg.Image=[]
    },
    btnClearDialogMsg() {
      this.outerVisible = false;
      this.appMsg.Description = "";
    },
    btnClearTransferDialog(done) {
      this.outerVisible1 = false;
      this.filterText = "";
      this.transferMsg.WorkFlowId = "";
      this.transferMsg.TemplateType = "";
      this.transferMsg.Description = "";
      this.transferMsg.CareOfEmId = "-1";
      this.$refs.tree.setCheckedKeys([]);
    },
    closePicLayer() {
      this.dspNone = true;
    },
    getPic(obj, index) {
      this.initialIndex = index;
      this.picObj = obj;
      this.dspNone = false;
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.DepartmentName.indexOf(value) !== -1;
    },
    openDialog(IsAgree, workFlowId, templateType) {
      this.agree = IsAgree;
      this.dialogTitle = "审批流程";
      this.outerVisible = true;
      this.workFlowId = workFlowId;
      this.templateType = templateType;
    },
    agreeApproval() {
      this.appMsg.WorkFlowId = this.workFlowId;
      this.appMsg.TemplateType = this.templateType;
      this.apipost(
        "WorkFlow_post_SetConsent",
        this.appMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.outerVisible = false;
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    rejectApproval() {
      this.appMsg.WorkFlowId = this.workFlowId;
      this.appMsg.TemplateType = this.templateType;
      this.apipost(
        "WorkFlow_post_SetNotConsent",
        this.appMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.outerVisible = false;
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    withdrawAapproval(workFlowId, templateType) {
      this.$confirm("是否撤回?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.apipost(
            "app_user_workflow_wndoaudit",
            { workFlowId: workFlowId, templateType: templateType },
            res => {
              if (res.data.resultCode == 1) {
                this.$message.success("撤回成功。");
                this.getList();
              }
            },
            err => {}
          );
        })
        .catch(() => {
          this.$message.info("已取消撤回。");
        });
    },
    updateAapproval(path, cmd, submitCmd, workFlowId, templateId) {
      this.$router.push({
        name: path,
        query: {
          cmd: cmd,
          submitCmd: submitCmd,
          workFlowId: workFlowId,
          templateId: templateId
        }
      });
    },
    transferDialog(workFlowId, templateType) {
      this.dialogTitle1 = "转交流程";
      this.outerVisible1 = true;
      this.workFlowId = workFlowId;
      this.templateType = templateType;
      this.apipost(
        "WorkFlow_get_GetDepartMentEmployee",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.memberList = res.data.data;
          }
        },
        err => {}
      );
    },
    clearTransferDialog() {
      this.filterText = "";
      this.transferMsg.WorkFlowId = "";
      this.transferMsg.TemplateType = "";
      this.transferMsg.Description = "";
      this.transferMsg.CareOfEmId = "-1";
      this.$refs.tree.setCheckedKeys([]);
    },
    handleNodeChange(data, checked, node) {
      if (checked) {
        if (data.DepartmentId != 0) {
          this.arr.push(data.DepartmentId);
          this.$refs.tree.setCheckedKeys([data.DepartmentId]);
          this.transferMsg.CareOfEmId = data.DepartmentId;
        }
      } else {
        if (this.arr.length == 1) {
          this.arr = [];
          this.transferMsg.CareOfEmId = "-1";
        } else {
          this.arr = this.arr.slice(this.arr.length - 1);
          this.transferMsg.CareOfEmId = this.arr[this.arr.length - 1];
        }
      }
    },

    transferApproval() {
      this.transferMsg.WorkFlowId = this.workFlowId;
      this.transferMsg.TemplateType = this.templateType;
      if (this.transferMsg.CareOfEmId == "-1") {
        this.$message.warning("请选择转交人!");
        return;
      }
      this.apipost(
        "WorkFlow_post_SetCareOf",
        this.transferMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
            this.outerVisible1 = false;
            this.getList();
          } else {
            this.$message.error(res.data.message);
          }
        },
        err => {}
      );
    },
    getDetail(title, id, link) {
      this.boxshow = false;
      this.showLayer();
      let WorkFlowId = JSON.parse(link).workFlowId;
      let TemplateType = JSON.parse(link).templateType;
      this.apipost(
        "app_user_workflow_GetAuditInfo",
        { SysLogId: id, WorkFlowId: WorkFlowId, TemplateType: TemplateType },
        res => {
          if (res.data.resultCode == 1) {
            this.detailList = res.data.data;
            this.IsAudit = res.data.data.IsAudit;
            this.IsCancel = res.data.data.IsCancel;
            this.IsUpdate = res.data.data.IsUpdate;
          }
        }
      );
    },
    showLayer() {
      this.showlayer = true;
      this.isTransition = true;
      this.displayNone = false;
    },
    closeLayer() {
      let _this = this;
      setTimeout(function() {
        _this.showlayer = false;
      }, 300);
      this.isTransition = false;
      this.displayNone = true;
    },
    goUrl(url, id, index) {
      this.chosenIndex = id;
      if(localStorage.openMode && localStorage.openMode==1)
        this.$router.push({ path: url ,query:{blank:'y'}});
      else
        this.$router.push({ path: url ,query:{}});
    },
    goUrlT(url, index, name) {
      let query={
        Conditon: index
      }
      if(localStorage.openMode && localStorage.openMode==1){
        query.tab=name
        query.blank='y'
      }
      // if (index!=-1) {
        this.$router.push({ path: url, query });
      // } else {
      //   this.$router.push({ path: url });
      // }
    },
    goUrlPayment() {
       let eid=this.getLocalStorage().EmployeeId;
        this.$router.push({ path: 'empBankAccount', query: { id: eid,type:10,blank:'y' } });
    },
    getMenu() {
      var tempList = this.getLocalStorage().UserMenu;
      tempList.forEach(x => {
        if (x.ParentId == 0) {
          let menuStyle = JSON.parse(x.MenuStyle);
          x.icon = menuStyle.icon;
          x.color = menuStyle.color;
          this.menuList.push(x);
        }
      });
    },
    //设置菜单选中
    setCheckMenu() {
      var tempMenuList = this.getLocalStorage().UserMenu;
      let path = this.$route.path.split("?")[0];
      let root = 0;
      //三级下面的子页面
      switch (path) {
        case "/leaderChedule": //领队档期
          path = "/leaderManagement";
          break;
        case "/leaderStateDetails": //领队绩效
          path = "/leaderManagement";
          break;
        case "/HotelInfo": //酒店基本信息新增修改
          path = "/HotelManagement";
          break;
        case "/HotelProductManage": //酒店房型
          path = "/HotelManagement";
          break;
        case "/HotelPrice": //酒店报价
          path = "/HotelManagement";
          break;

        case "/detailsInventory": //酒店总库存看板详情
          path = "/HotelTotalStock";
          break;
        case "/HotelSinglePrice": //酒店总库存看板(报价)详情
          path = "/HotelTotalStock";
          break;
        case "/HotelAccountInfo": //酒店核算详情
          path = "/HotelAccounting";
          break;

        case "/restaurantInfoManage": //餐厅新增修改
          path = "/restaurantList";
          break;
        case "/RestaurantPackage": //餐厅套餐新增修改
          path = "/restaurantList";
          break;
        case "/RestaurantPrice": //餐厅套餐报价新增修改
          path = "/restaurantList";
          break;
        case "/RestauranAccountingDetail": //餐厅内部核算详情
          path = "/RestauranAccounting";
          break;

        case "/scenicSpotInfoManage": //票劵新增修改
          path = "/scenicSpotList";
          break;
        case "/ticketManagement": //票劵门票新增修改
          path = "/scenicSpotList";
          break;
        case "/scenicSpotPackagePrice": //票劵门票报价新增修改
          path = "/scenicSpotList";
          break;
        case "/scenicSpotDetails": //票劵内部核算详情
          path = "/scenicSpotAccounting";
          break;

        case "/TicketAccountingDetails": //机票核算详情
          path = "/TicketAccounting";
          break;
        case "/TicketPlanInfo": //机票计划详情
          path = "/TicketPlan";
          break;
        case "/BusInfo": //新增修改车辆信息
          path = "/busManage";
          break;
        case "/BusAccountInfo": //车辆内部核算详情
          path = "/busManage";
          break;
        case "/ThroughSetting": //机票联运设置
          path = "/TicketManager";
          break;
        case "/QuotationPrice": //报价单
          path = "/quoTation";
          break;
        case "/DistributionTransport": //分销联运
          path = "/TravelControlList";
          break;
        case "/RegistrationList": //报名清单
          path = "/TravelControlList";
          break;
            case "/PassengerList": //机票名单
          path = "/TicketManager";
          break;
      }
      tempMenuList.forEach(rootItem => {
        if (rootItem.MenuUrl == path) {
          root = rootItem.MenuId;
        }
      });
      if (root <= 0) {
        //找到Root
        tempMenuList.forEach(rootItem => {
          rootItem.ChildMenu.forEach(secondItem => {
            secondItem.ChildMenu.forEach(thirdItem => {
              if (thirdItem.MenuUrl == path) {
                root = rootItem.MenuId;
              }
            });
          });
        });
      }
      this.chosenIndex = root;
    },
    exit() {
      this.$store.dispatch("logout")
      localStorage.removeItem("userInfo");
      localStorage.removeItem("previousPathInfo");
      // this.$router.push({ path: "/login" });
      location.href='/'
    },
    togglebox(e) {
      if (
        e.target.className == "box" ||
        e.target.className == "iconfont icon-imessage_top" ||
        e.target.className == "iconfont icon-imessage_top animation"
      ) {
        this.newMsg = false;
        this.boxshow = !this.boxshow;
      }
    },
    setMsgRead(id) {
      this.apipost(
        "SystemLog_post_LogSetReadStatus",
        { LogId: id },
        res => {},
        err => {}
      );
    },
    readyState() {
      var _this = this;
    },
    sleep(numberMillis) {
      var now = new Date();
      var exitTime = now.getTime() + numberMillis;
      while (true) {
        now = new Date();
        if (now.getTime() > exitTime) return;
      }
    },
    msgGet(msg) {
      if (this.isFocus) return;
      var _this = this;
      const NotificationInstance = Notification || window.Notification;

      if (!!NotificationInstance) {
        const permissionNow = NotificationInstance.permission;
        if (permissionNow === "granted") {
          //允许通知
          CreatNotification();
        } else if (permissionNow === "denied") {

        } else {
          setPermission();
        }
        function setPermission() {
          //请求获取通知权限
          NotificationInstance.requestPermission(function(PERMISSION) {
            if (PERMISSION === "granted") {
              CreatNotification();
            }
          });
        }
        function CreatNotification() {
          const n = new NotificationInstance(msg.name, {
            body: msg.lastMsgShow,
            tag: "聊天",
            icon: msg.avatar,
            silent: true,
            data: {
              session: msg
            }
          });
          n.onshow = function() {
            //console.log("通知显示了!");
          };
          n.onclick = function(e) {
            //可以直接通过实例的方式获取data内自定义的数据
            //也可以通过访问回调参数e来获取data的数据
            _that.enterChat(e.data.session);
            _that.imToolsType = 0;
            _that.IM_navType = 1;
            _that.IM_bodyIsShow = true;
            n.close();
          };
          n.onclose = function() {
            //console.log("用户点击关闭");
          };
          n.onerror = function(err) {
            //console.log("出错了,小伙子在检查一下吧");
            throw err;
          };
          setTimeout(() => {
            n.close();
          }, 5000);
        }
      }
    },
    deletMsg(type) {
      let LogStr = [],
          ContentType = [];
      this.msgList.forEach(x=>{
        LogStr.push(x.ID)
        ContentType.push(x.ContentType)
      })
      this.apipost('SystemLog_post_SetReadStatusBatch',{LogStr:LogStr,ContentType:ContentType},r=>{
        if(r.data.resultCode==1){
          this.msgList = [];
          this.MsgCount = this.msgList.length;
        }else{
          this.$message.error(r.data.message);
        }
      },null)

    }
  }
};
</script>
<style lang="less">
@import "../assets/css/main.less";
@import "../assets/css/cssReset.css";
@import "../assets/css/message.css";
.changelanguage{
  width:124px;
}
.changelanguage .el-dropdown-menu__item .icon-duigou{
  color:#000000;
  position: absolute;
  right: 10px;
  font-size: 14px;
}
.changelanguage .el-dropdown-menu__item{
  padding:0;
  padding-left:15px;
  font-size: 14px;
  position: relative;
  color:#333333;
}
.changelanguage .el-dropdown-menu__item:hover{
  background: #D9D9D9;
  color:#333333;
}
._dropdown.el-dropdown-menu {
  padding: 0;
  background-color: #1f2533 !important;
  border-radius: 4px;
  overflow: hidden;
  width: 210px;
  top: 40px !important;
}
._dropdown_f1.el-dropdown-menu__item {
  background-color: #4d515b !important;
  color: #ffffff !important;
  cursor: default;
  height: 50px;
  line-height: 50px;
}
._dropdown_f1.el-dropdown-menu__item .company {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
._dropdown_f1.el-dropdown-menu__item .company span:nth-child(2) {
  display: inline-block;
  padding: 3px 8px;
  background-color: #007eff;
  border-radius: 9px;
  line-height: 18px;
  font-size: 12px;
}
._dropdown_f1.el-dropdown-menu__item:hover,
._dropdown_f1.el-dropdown-menu__item:focus {
  background-color: #4d515b !important;
  color: #ffffff !important;
}
._dropdown_other.el-dropdown-menu__item {
  color: #a9aaad;
  position: relative;
}
._dropdown_other.el-dropdown-menu__item .el-badge {
  position: absolute;
  right: 20px;
  top: 5px;
}
._dropdown_other.el-dropdown-menu__item i {
  color: #a9aaad;
  display: inline-block;
  margin-right: 6px;
}
._dropdown_other.el-dropdown-menu__item:hover,
._dropdown_other.el-dropdown-menu__item:focus {
  background-color: #6f737b !important;
  color: #ffffff !important;
}
._dropdown .popper__arrow::after {
  border-bottom-color: transparent !important;
}
.IM_body {
  position: absolute;
  z-index: 9999;
  right: 0;
  top: 50px;
  bottom: 0;
  width: 362px;
  overflow-y: hidden;
  border: 1px solid #d9d9d9;
  border-color: rgba(0, 0, 0, 0.05);
  background-repeat: no-repeat;
  background-color: #f6f6f6;
  background-image: url("../assets/img/imbg/1.png");
  box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3);
  background-clip: content-box;
}
.myDocumentsLink {
  margin: 25px 0;
}

.myDocumentsLink > span {
  font-size: 12px;
  cursor: pointer;
  color: #e95252;
}

.myDocumentsLink > span:not(:last-of-type):hover {
  text-decoration: underline;
}

.myDocumentsLink > span:not(:last-of-type):after {
  content: ">";
  margin: 0 3px;
  color: #e95252;
  pointer-events: none;
}

.myDocumentsLink > span:last-child {
  color: #666;
  cursor: default;
}
.dsyNone {
  display: none;
}
.indexMsgLayer {
  position: fixed;
  z-index: 999;
  background: rgba(0, 0, 0, 0.2);
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}
.indexMsgLayerContent {
  width: 400px;
  background: #fff;
  z-index: 1100;
  height: 100%;
  overflow: auto;
  top: 0;
  right: -400px;
  position: absolute;
  box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.1);
  transition: right 0.5s;
}
.indexMsgLayerContent.rightZero {
  right: 0px;
}
.indexMsgLayerContent .title {
  height: 48px;
  background: #edeef0;
  line-height: 48px;
  font-size: 16px;
  color: #333;
  text-indent: 30px;
}
.indexMsgLayerContent .user {
  width: 340px;
  margin: 0 30px;
  border-bottom: 1px solid #e6e6e6;
  height: 60px;
  padding: 30px 0;
  box-sizing: content-box;
}
.indexMsgLayerContent .user > p {
  line-height: 28px;
}
.indexMsgLayerContent .user > img {
  width: 58px;
  height: 58px;
  border-radius: 29px;
  float: left;
  margin: 0 12px 0 0;
}
.indexMsgLayerContent .detail {
  width: 340px;
  margin: 0 30px;
  padding: 25px 0;
  border-bottom: 1px solid #e6e6e6;
  min-height: 120px;
}
.indexMsgLayerContent .audit {
  width: 340px;
  margin: 30px 30px 0;
  min-height: 120px;
  border-bottom: 1px solid #e6e6e6;
}
.indexMsgLayerContent .audit .auditItem {
  min-height: 80px;
  width: 320px;
  margin-left: 20px;
  border-left: 1px solid #ededed;
  position: relative;
  font-size: 14px;
}
.indexMsgLayerContent .audit .auditItem:last-child {
  border-left: none;
}
.indexMsgLayerContent .audit .auditItem > p {
  line-height: 40px;
  text-indent: 40px;
}
.indexMsgLayerContent .audit .auditItem > img {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  position: absolute;
  left: -20px;
}
.indexMsgLayerContent .send {
  width: 340px;
  margin: 30px 30px 0;
  min-height: 120px;
}
.indexMsgLayerContent .send .sentTitle {
  height: 14px;
  line-height: 14px;
  text-indent: 10px;
  border-left: 3px solid #e95252;
  font-size: 14px;
}
.indexMsgLayerContent .send .sentTitle span {
  color: #666;
  margin-left: 20px;
}
.indexMsgLayerContent .send .sendList > div {
  float: left;
  margin: 10px 10px 0 0;
  font-size: 12px;
  color: #666;
  width: 40px;
  text-align: center;
}
.indexMsgLayerContent .send .sendList > div > img {
  width: 40px;
  height: 40px;
  border-radius: 20px;
}
.indexMsgLayerContent .myApprovalTable tr {
  height: 40px;
  font-size: 14px;
}
.indexMsgLayerContent .myApprovalTable tr td:nth-child(1) {
  text-align: right;
  color: #666;
}
.indexMsgLayerContentBtn {
  position: fixed;
  bottom: 0;
  background: #fff;
  width: 100%;
  height: 40px;
  line-height: 40px;
  padding: 0 30px;
  border-top: 1px solid #f0f3fa;
}
.indexMsgLayerContentBtn input {
  margin-right: 10px;
}
.nav-right ul li.user_head .el-dropdown-link {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.nav-right ul li.user_head span.name {
  color: #99a7b3;
  font-size: 12px;
  display: inline-block;
  margin-left: 10px;
  overflow: hidden;
  width: 45px;
  height: 50px;
}
.nav-right ul li.user_head img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.nav {
  display: -webkit-box;
  .size(100%, 50px);
  .min-width(1366px);
  background: #1f2533;
}
.nav-left {
  width: 56px;
  line-height: 50px;
  color: #e73828;
  text-align: center;
}
.nav-left .GroupPic{
    width: 36px;
    height: 36px;
    -webkit-border-radius: 36px;
    margin: 7px 0px 0px 15px;

}
.nav-left i.iconfont {
  font-size: 24px;
}
.nav-left img {
  .fl();
  .size(50px;50px);
  .circle(25px);
}
.nav-left p.name {
  .fz(14px, 18px);
  color: #444;
  margin: 20px 0 5px 0;
}
.nav-left p.company {
  .fz(12px);
  color: #444;
}
.nav-middle {
  /*width: calc(100% - 140px);*/
  display: flex;
}
.nav-middle ul {
  width: 100%;
  margin: 0 auto;
  height: 100%;
  z-index: 2019128;
}
.nav-middle ul li {
  .size(100px, 100%);
  .fz(14px);
  .center(text-x);
  .hover-bg(#f1f1f1);
  color: #a6adb4;
  position: relative;
  padding: 12px 0;
  float: left;
  z-index: 2019128;
}
.nav-middle ul li i {
  font-size: 16px;
  color: #a6adb4;
}
.nav-middle ul li img {
  height: 40px;
  margin: 32px 0 14px;
}
.nav-middle ul li:hover .menuList_son{
  // display: block;
  width: 1000px;
  z-index: 999999;
  opacity: 1;
  padding: 20px 0 20px 20px;
  height: auto;
  // transition: all .5s linear .5s;
  animation:ttt .5s forwards;
}
@keyframes ttt {
    0%{
        opacity:0;
    }
    66%{ 
        opacity:0;
    }
    100%{
        opacity:1;
    }
}
.nav-middle ul li .menuList_son{
  position: fixed;
  z-index: 9000;
  background-color: #363c4a;
  top: 50px;
  // display: none;
  opacity: 0;
  padding: 0;
  overflow: hidden;
  height: 0;
}
.menuList_tittle_box{
  line-height: 30px;
  padding-top: 15px;
}
.menuList_son_one_tittle{
  color: #a6adb4;
  font-size: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid #495165;
  text-align: left;
}
.menuList_son_two_tittle{
  color: #e9ebec;
  text-align: left;
}
.menuList_son_three_tittle{
  cursor: pointer;
  transition: all linear .3s;
  text-align: left;
}
.menuList_son_three_tittle:hover{
  color: white;
}
.menuList_son_item{
  width: 100%;
  display: flex;
  justify-content: flex-start;
}
.menuList_son_item>div{

}
.hoverNote {
  width: 0;
  height: 4px;
  background: #e95252;
  position: absolute;
  left: 0;
  bottom: -2px;
}
.nav-middle ul li:hover {
  background-color: #2f384d;
}
.nav-middle ul li:hover .hoverNote {
  width: 100%;
  transition: width 0.3s;
}
.nav-middle ul li i {
  color: #a6adb4;
  display: inline-block;
  margin-right: 12px;
}
.big_tittle{
  cursor: pointer;
}
.nav-middle ul li.active .big_tittle{
  color: #ffffff;
  // background: #2f384d;
  cursor: pointer;
}

.nav-middle ul li.active .hoverNote {
  width: 100%;
}
.nav-right {
  width: 220px;
  position: absolute;
  right: 0;
}
.nav-right ul {
  display: flex;
  line-height: 50px;
  justify-content: flex-end;
}
.nav-right ul li {
  height: 50px;
  margin-right: 20px;
  text-align: center;
  justify-content: flex-end;
}
.nav-right ul li i {
  cursor: pointer;
  .fz(18px);
  color: #e4e4e4;
}
.nav-right ul li i:hover {
  color: #999;
}
.hide {
  display: none;
}
#message_box {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1889;
  font-family: "PingFangSC-fine" !important;
}
.box {
  height: 100%;
  background-color: rgba(255, 255, 255, 0);
  overflow: hidden;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 180;
  width: 100%;
}
.mybox-leave-active {
  transition: all 1s ease;
}
.mybox-enter-active {
  transition: all 0.5s ease;
}
.mybox-leave-active,
.mybox-enter {
  right: -100% !important;
}
.mybox-leave,
.mybox-enter-active {
  right: 0;
}
.noNewMsg {
  font-size: 16px;
  color: #999;
  text-align: center;
}
@keyframes zy {
  10% {
    transform: rotate(15deg);
  }
  20% {
    transform: rotate(-10deg);
  }
  30% {
    transform: rotate(5deg);
  }
  40% {
    transform: rotate(-5deg);
  }
  50%,
  100% {
    transform: rotate(0deg);
  }
}
.animation::before {
  color: #e95252;
  float: left;
  width: 18px;
  height: 27px;
  animation: zy 2.5s 0.15s linear infinite;
  -moz-animation: zy 2.5s 0.15s linear infinite; /* Firefox */
  -webkit-animation: zy 2.5s 0.15s linear infinite; /* Safari and Chrome */
  -o-animation: zy 2.5s 0.15s linear infinite; /* Opera */
}
#message_box .content {
  width: 350px;
  height: 100%;
  background-image: url("../assets/img/message_bg@3x.png");
  background-size: cover;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 200;
}
#message_box .header {
  padding: 18px 20px;
  height: 6%;
}
#message_box .header i {
  color: #e95252;
  font-size: 18px;
  cursor: pointer;
}
#message_box .header > div {
  width: 50%;
  float: left;
}
#message_box .header > div:nth-child(2) {
  text-align: right;
}
#message_box .header i.icon-img_caidan {
  font-size: 16px;
}
#message_box .header > div:nth-child(2) .icon-img_delete_small {
  display: inline-block;
  margin-right: 38px;
}
.msgItem_box {
  height: 94%;
  overflow: auto;
}
#message_box .msgItem {
  padding: 20px;
  transition: all linear 0.5s;
  cursor: pointer;
}
#message_box .msgItem:hover {
  background: rgba(0, 0, 0, 0.1);
}
#message_box .msgItem:hover .icon-ego-guanbi {
  display: inline-block;
}
.msgItem_left {
  width: 40px;
}
.msgItem_right {
  width: 250px;
}
.msgItem_right > div > div {
  float: left;
}
.msgItem_right > div > div:nth-child(2) {
  float: right;
}
.msgItem_tit {
  padding-left: 10px;
  font-size: 14px;
  color: #333333;
  max-width: 175px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msgItem_left,
.msgItem_right {
  height: 80px;
  float: left;
}
.msgItem_radius {
  height: 38px;
  width: 38px;
  line-height: 38px;
  text-align: center;
  border-radius: 50%;
  background-color: #6694dc;
  font-size: 12px;
  color: white;
}
.msgItem_time {
  font-size: 14px;
  color: #999999;
}
.icon-ego-guanbi {
  font-size: 12px;
  color: #999999;
  cursor: pointer;
  display: inline-block;
  padding-left: 20px;
  display: none;
}
.msgItem_conten {
  padding: 10px;
  font-size: 12px;
  color: #666666;
  padding-bottom: 0;
}
.icon-imessage_top {
  animation: mymove 5s infinite;
  -webkit-animation: mymove 5s infinite; /*Safari and Chrome*/
}
@keyframes mymove {
  from {
    left: 0px;
  }
  to {
    left: 200px;
  }
}
@-webkit-keyframes mymove /*Safari and Chrome*/ {
  from {
    left: 0px;
  }
  to {
    left: 200px;
  }
}
.temDivs {
  /*flex:1;margin-top: 2px;*/
  position: absolute;
  top: 50px;
  bottom: 0px;
  left: 0px;
  right: 0px;
}
.red {
  color: #e95252 !important;
}
.weOytour {
  display: none;
}
.sysMsg_lod_more {
  text-align: center;
  font-size: 12px;
  color: #999999;
}
.IM_messageList ul li.sysMsg_lod_more:hover {
  background-color: inherit;
  height: auto;
  line-height: 35px;
}
.IM_messageList ._SysNoteDate_ul li {
  height: auto;
}
._more_dropdown._dropdown.el-dropdown-menu{
  top: 50px !important;
}
</style>