<template>
  <div>
    <div style="margin:2% 0;display: inline-block;">
      <span>用户昵称:</span>
      <el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入用户昵称" v-model="nickName">
      </el-input>
    </div>
    <div style="display: inline-block;">
      <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询</el-button>
      <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置</el-button>
    </div>
    <el-table v-loading="tableDataLoading" :data="tableData.list">
      <el-table-column fixed prop="chatConversationId" label="id" width="80">
      </el-table-column>
      <el-table-column prop="userName" label="用户昵称" width="150">
        <template slot-scope="scope">
          <div style="color: #4f9dec;cursor: pointer;"
            @click="updates(scope.row.userId)">{{scope.row.userName ? scope.row.userName : '未绑定'}}</div>
          <div style="color: #4f9dec;cursor: pointer;"
            @click="updates(scope.row.byUserId)">{{scope.row.byUserName ? scope.row.byUserName : '未绑定'}}</div>
        </template>
      </el-table-column>
      <el-table-column prop="picture" label="用户头像">
        <template slot-scope="scope">
          <div v-if="scope.row.avatar == null || scope.row.avatar == ''">
            暂无图片
          </div>
          <div v-else>
            <el-popover placement="top-start" title="" trigger="hover">
              <img style="width: 50px; height: 50px" :src="scope.row.avatar" alt="" slot="reference">
              <img style="width: 200px; height: 200px" :src="scope.row.avatar" alt="">
            </el-popover>
          </div>
          <div v-if="scope.row.byAvatar == null || scope.row.byAvatar == ''">
            暂无图片
          </div>
          <div v-else style="margin-top: 5px;">
            <el-popover placement="top-start" title="" trigger="hover">
              <img style="width: 50px; height: 50px" :src="scope.row.byAvatar" alt="" slot="reference">
              <img style="width: 200px; height: 200px" :src="scope.row.byAvatar" alt="">
            </el-popover>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="content" label="最新聊天内容">
        <template slot-scope="scope">
          <div v-if="scope.row.messageType==1">{{scope.row.content}}</div>
          <div  v-if="scope.row.messageType==2">
            <el-popover placement="top-start" title="" trigger="hover">
              <img style="width: 50px; height: 50px" :src="scope.row.content" alt="" slot="reference">
              <img style="width: 200px; height: 200px" :src="scope.row.content" alt="">
            </el-popover>
          </div>
			<!-- 表情 -->
			<div class="center-item-info_wrapper" v-if="scope.row.messageType==3">
				<div class="center-item-tip">
					<div v-html="scope.row.content"></div>
				</div>
			</div>
<!--          <div v-if="scope.row.messageType==3">-->
<!--            <audio :src="scope.row.content" type="audio/wav" controls="controls"></audio>-->
<!--          </div>-->
          <div  v-if="scope.row.messageType==4">
            <el-popover placement="top-start" title="" trigger="hover">
              <img style="width: 50px; height: 50px" :src="'https://taskshop.xianmxkj.com/emoji/'+scope.row.content" alt="" slot="reference">
              <img style="width: 200px; height: 200px" :src="'https://taskshop.xianmxkj.com/emoji/'+scope.row.content" alt="">
            </el-popover>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="updateTime" label="创建时间" width="160">
      </el-table-column>
      <!-- <el-table-column fixed='right' prop="contentCount" label="状态" width="100">
        <template slot-scope="scope">
          <span style="color: #4f9dec;" v-if="scope.row.contentCount==0 ">未读</span>
          <span v-if="scope.row.contentCount == 1 ">已读</span>
        </template>
      </el-table-column> -->
      <el-table-column fixed='right' label="操作" width="150">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" @click="complainDetails(scope.row)">聊天内容
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="text-align: center;margin-top: 10px;">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page" layout="total,sizes, prev, pager, next"
        :total="tableData.totalCount">
      </el-pagination>
    </div>
    <!-- 聊天内容 -->
    <el-dialog title="聊天内容" :visible.sync="dialogFormVisible" center>
      <div style="margin:2% 0;display: inline-block;">
        <span>内容:</span>
        <el-input style="width: 150px;" @keydown.enter.native="select1" clearable placeholder="请输入聊天内容" v-model="content">
        </el-input>
      </div>
      <div style="display: inline-block;">
        <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select1">查询</el-button>
        <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans1">重置</el-button>
      </div>
      <el-table v-loading="tableDataLoading" :data="userData.list">
        <el-table-column prop="chatContentId" label="编号" width="80">
        </el-table-column>
        <el-table-column prop="userName" label="用户昵称">
          <template slot-scope="scope">
            <div style="color: #4f9dec;cursor: pointer;"
              @click="updates(scope.row.userId)">{{scope.row.userName ? scope.row.userName : '未绑定'}}</div>
          </template>
        </el-table-column>
        <el-table-column prop="title" label="用户头像">
          <template slot-scope="scope">
            <div v-if="scope.row.avatar == null || scope.row.avatar == ''">
              暂无图片
            </div>
            <div v-else>
              <el-popover placement="top-start" title="" trigger="hover">
                <img style="width: 50px; height: 50px" :src="scope.row.avatar" alt="" slot="reference">
                <img style="width: 200px; height: 200px" :src="scope.row.avatar" alt="">
              </el-popover>
            </div>
          </template>

        </el-table-column>
        <el-table-column prop="content" label="信息内容" width="280">
          <template slot-scope="scope">
            <div v-if="scope.row.messageType==1">{{scope.row.content}}</div>
            <div  v-if="scope.row.messageType==2">
              <el-popover placement="top-start" title="" trigger="hover">
                <img style="width: 50px; height: 50px" :src="scope.row.content" alt="" slot="reference">
                <img style="width: 200px; height: 200px" :src="scope.row.content" alt="">
              </el-popover>
            </div>
			  <!-- 表情 -->
			  <div class="center-item-info_wrapper" v-if="scope.row.messageType==3">
				  <div class="center-item-tip">
					  <div v-html="scope.row.content"></div>
				  </div>
			  </div>
<!--            <div v-if="scope.row.messageType==3">-->
<!--              <audio :src="scope.row.content" type="audio/wav" controls="controls"></audio>-->
<!--            </div>-->

            <div  v-if="scope.row.messageType==4">
              <!-- <img style="width: 50px; height: 50px" :src="'https://taskshop.xianmxkj.com/emoji/'+scope.row.content" alt="" slot="reference"> -->
              <el-popover placement="top-start" title="" trigger="hover">
                <img style="width: 50px; height: 50px" :src="'https://taskshop.xianmxkj.com/emoji/'+scope.row.content" alt="" slot="reference">
                <img style="width: 200px; height: 200px" :src="'https://taskshop.xianmxkj.com/emoji/'+scope.row.content" alt="">
              </el-popover>
            </div>

          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" width="150">
        </el-table-column>
		<el-table-column prop="createTime" label="操作" width="100" fixed="right">
			<template slot-scope="scope">
				<el-button size = "mini" type = "danger" :disabled = "!isAuth('chatRecord:delete')" @click = "deleteuser(scope.row)">删除</el-button>
			</template>
		</el-table-column>

      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
          :page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
          layout="total,sizes, prev, pager, next" :total="userData.totalCount">
        </el-pagination>
      </div>
    </el-dialog>
    <!-- 处理任务 -->
    <el-dialog title="处理任务" :visible.sync="dialogFormVisible1" center>
      <div style="margin-bottom: 10px;">
        <span style="width: 200px;display: inline-block;text-align: right;">任务状态：</span>
        <el-radio-group v-model="state">
          <el-radio :label="2">下架</el-radio>
          <el-radio :label="3">不下架</el-radio>
        </el-radio-group>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="complainTo()">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        limit: 10,
        page: 1,
        userId: '',
        content: '',
        nickName:'',
        form: {
          id: '',
          content: '',
          picture: '',
          state: ''
        },
        state: '',
        imgs: [],
        formLabelWidth: '200px',
        activeName: 'first',
        tableDataLoading: false,
        dialogFormVisible: false,
        dialogFormVisible1: false,
        tableData: {},
        userData:{},
        chatConversationId:'',
		  emojiList:[
			  [{"url":"100.gif",alt:"[微笑]"},{"url":"101.gif",alt:"[伤心]"},{"url":"102.gif",alt:"[美女]"},{"url":"103.gif",alt:"[发呆]"},{"url":"104.gif",alt:"[墨镜]"},{"url":"105.gif",alt:"[哭]"},{"url":"106.gif",alt:"[羞]"},{"url":"107.gif",alt:"[哑]"},{"url":"108.gif",alt:"[睡]"},{"url":"109.gif",alt:"[哭]"},{"url":"110.gif",alt:"[囧]"},{"url":"111.gif",alt:"[怒]"},{"url":"112.gif",alt:"[调皮]"},{"url":"113.gif",alt:"[笑]"},{"url":"114.gif",alt:"[惊讶]"},{"url":"115.gif",alt:"[难过]"},{"url":"116.gif",alt:"[酷]"},{"url":"117.gif",alt:"[汗]"},{"url":"118.gif",alt:"[抓狂]"},{"url":"119.gif",alt:"[吐]"},{"url":"120.gif",alt:"[笑]"},{"url":"121.gif",alt:"[快乐]"},{"url":"122.gif",alt:"[奇]"},{"url":"123.gif",alt:"[傲]"}],
			  [{"url":"124.gif",alt:"[饿]"},{"url":"125.gif",alt:"[累]"},{"url":"126.gif",alt:"[吓]"},{"url":"127.gif",alt:"[汗]"},{"url":"128.gif",alt:"[高兴]"},{"url":"129.gif",alt:"[闲]"},{"url":"130.gif",alt:"[努力]"},{"url":"131.gif",alt:"[骂]"},{"url":"132.gif",alt:"[疑问]"},{"url":"133.gif",alt:"[秘密]"},{"url":"134.gif",alt:"[乱]"},{"url":"135.gif",alt:"[疯]"},{"url":"136.gif",alt:"[哀]"},{"url":"137.gif",alt:"[鬼]"},{"url":"138.gif",alt:"[打击]"},{"url":"139.gif",alt:"[bye]"},{"url":"140.gif",alt:"[汗]"},{"url":"141.gif",alt:"[抠]"},{"url":"142.gif",alt:"[鼓掌]"},{"url":"143.gif",alt:"[糟糕]"},{"url":"144.gif",alt:"[恶搞]"},{"url":"145.gif",alt:"[什么]"},{"url":"146.gif",alt:"[什么]"},{"url":"147.gif",alt:"[累]"}],
			  [{"url":"148.gif",alt:"[看]"},{"url":"149.gif",alt:"[难过]"},{"url":"150.gif",alt:"[难过]"},{"url":"151.gif",alt:"[坏]"},{"url":"152.gif",alt:"[亲]"},{"url":"153.gif",alt:"[吓]"},{"url":"154.gif",alt:"[可怜]"},{"url":"155.gif",alt:"[刀]"},{"url":"156.gif",alt:"[水果]"},{"url":"157.gif",alt:"[酒]"},{"url":"158.gif",alt:"[篮球]"},{"url":"159.gif",alt:"[乒乓]"},{"url":"160.gif",alt:"[咖啡]"},{"url":"161.gif",alt:"[美食]"},{"url":"162.gif",alt:"[动物]"},{"url":"163.gif",alt:"[鲜花]"},{"url":"164.gif",alt:"[枯]"},{"url":"165.gif",alt:"[唇]"},{"url":"166.gif",alt:"[爱]"},{"url":"167.gif",alt:"[分手]"},{"url":"168.gif",alt:"[生日]"},{"url":"169.gif",alt:"[电]"},{"url":"170.gif",alt:"[炸弹]"},{"url":"171.gif",alt:"[刀子]"}],
			  [{"url":"172.gif",alt:"[足球]"},{"url":"173.gif",alt:"[瓢虫]"},{"url":"174.gif",alt:"[翔]"},{"url":"175.gif",alt:"[月亮]"},{"url":"176.gif",alt:"[太阳]"},{"url":"177.gif",alt:"[礼物]"},{"url":"178.gif",alt:"[抱抱]"},{"url":"179.gif",alt:"[拇指]"},{"url":"180.gif",alt:"[贬低]"},{"url":"181.gif",alt:"[握手]"},{"url":"182.gif",alt:"[剪刀手]"},{"url":"183.gif",alt:"[抱拳]"},{"url":"184.gif",alt:"[勾引]"},{"url":"185.gif",alt:"[拳头]"},{"url":"186.gif",alt:"[小拇指]"},{"url":"187.gif",alt:"[拇指八]"},{"url":"188.gif",alt:"[食指]"},{"url":"189.gif",alt:"[ok]"},{"url":"190.gif",alt:"[情侣]"},{"url":"191.gif",alt:"[爱心]"},{"url":"192.gif",alt:"[蹦哒]"},{"url":"193.gif",alt:"[颤抖]"},{"url":"194.gif",alt:"[怄气]"},{"url":"195.gif",alt:"[跳舞]"}],
			  [{"url":"196.gif",alt:"[发呆]"},{"url":"197.gif",alt:"[背着]"},{"url":"198.gif",alt:"[伸手]"},{"url":"199.gif",alt:"[耍帅]"},{"url":"200.png",alt:"[微笑]"},{"url":"201.png",alt:"[生病]"},{"url":"202.png",alt:"[哭泣]"},{"url":"203.png",alt:"[吐舌]"},{"url":"204.png",alt:"[迷糊]"},{"url":"205.png",alt:"[瞪眼]"},{"url":"206.png",alt:"[恐怖]"},{"url":"207.png",alt:"[忧愁]"},{"url":"208.png",alt:"[眨眉]"},{"url":"209.png",alt:"[闭眼]"},{"url":"210.png",alt:"[鄙视]"},{"url":"211.png",alt:"[阴暗]"},{"url":"212.png",alt:"[小鬼]"},{"url":"213.png",alt:"[礼物]"},{"url":"214.png",alt:"[拜佛]"},{"url":"215.png",alt:"[力量]"},{"url":"216.png",alt:"[金钱]"},{"url":"217.png",alt:"[蛋糕]"},{"url":"218.png",alt:"[彩带]"},{"url":"219.png",alt:"[礼物]"},]
		  ],
		  //表情图片图床名称 ，由于我上传的第三方图床名称会有改变，所以有此数据来做对应，您实际应用中应该不需要
		  onlineEmoji:{"100.gif":"AbNQgA.gif","101.gif":"AbN3ut.gif","102.gif":"AbNM3d.gif","103.gif":"AbN8DP.gif","104.gif":"AbNljI.gif","105.gif":"AbNtUS.gif","106.gif":"AbNGHf.gif","107.gif":"AbNYE8.gif","108.gif":"AbNaCQ.gif","109.gif":"AbNN4g.gif","110.gif":"AbN0vn.gif","111.gif":"AbNd3j.gif","112.gif":"AbNsbV.gif","113.gif":"AbNwgs.gif","114.gif":"AbNrD0.gif","115.gif":"AbNDuq.gif","116.gif":"AbNg5F.gif","117.gif":"AbN6ET.gif","118.gif":"AbNcUU.gif","119.gif":"AbNRC4.gif","120.gif":"AbNhvR.gif","121.gif":"AbNf29.gif","122.gif":"AbNW8J.gif","123.gif":"AbNob6.gif","124.gif":"AbN5K1.gif","125.gif":"AbNHUO.gif","126.gif":"AbNIDx.gif","127.gif":"AbN7VK.gif","128.gif":"AbNb5D.gif","129.gif":"AbNX2d.gif","130.gif":"AbNLPe.gif","131.gif":"AbNjxA.gif","132.gif":"AbNO8H.gif","133.gif":"AbNxKI.gif","134.gif":"AbNzrt.gif","135.gif":"AbU9Vf.gif","136.gif":"AbUSqP.gif","137.gif":"AbUCa8.gif","138.gif":"AbUkGQ.gif","139.gif":"AbUFPg.gif","140.gif":"AbUPIS.gif","141.gif":"AbUZMn.gif","142.gif":"AbUExs.gif","143.gif":"AbUA2j.gif","144.gif":"AbUMIU.gif","145.gif":"AbUerq.gif","146.gif":"AbUKaT.gif","147.gif":"AbUmq0.gif","148.gif":"AbUuZV.gif","149.gif":"AbUliF.gif","150.gif":"AbU1G4.gif","151.gif":"AbU8z9.gif","152.gif":"AbU3RJ.gif","153.gif":"AbUYs1.gif","154.gif":"AbUJMR.gif","155.gif":"AbUadK.gif","156.gif":"AbUtqx.gif","157.gif":"AbUUZ6.gif","158.gif":"AbUBJe.gif","159.gif":"AbUdIO.gif","160.gif":"AbU0iD.gif","161.gif":"AbUrzd.gif","162.gif":"AbUDRH.gif","163.gif":"AbUyQA.gif","164.gif":"AbUWo8.gif","165.gif":"AbU6sI.gif","166.gif":"AbU2eP.gif","167.gif":"AbUcLt.gif","168.gif":"AbU4Jg.gif","169.gif":"AbURdf.gif","170.gif":"AbUhFS.gif","171.gif":"AbU5WQ.gif","172.gif":"AbULwV.gif","173.gif":"AbUIzj.gif","174.gif":"AbUTQs.gif","175.gif":"AbU7yn.gif","176.gif":"AbUqe0.gif","177.gif":"AbUHLq.gif","178.gif":"AbUOoT.gif","179.gif":"AbUvYF.gif","180.gif":"AbUjFU.gif","181.gif":"AbaSSJ.gif","182.gif":"AbUxW4.gif","183.gif":"AbaCO1.gif","184.gif":"Abapl9.gif","185.gif":"Aba9yR.gif","186.gif":"AbaFw6.gif","187.gif":"Abaiex.gif","188.gif":"AbakTK.gif","189.gif":"AbaZfe.png","190.gif":"AbaEFO.gif","191.gif":"AbaVYD.gif","192.gif":"AbamSH.gif","193.gif":"AbaKOI.gif","194.gif":"Abanld.gif","195.gif":"Abau6A.gif","196.gif":"AbaQmt.gif","197.gif":"Abal0P.gif","198.gif":"AbatpQ.gif","199.gif":"Aba1Tf.gif","200.png":"Aba8k8.png","201.png":"AbaGtS.png","202.png":"AbaJfg.png","203.png":"AbaNlj.png","204.png":"Abawmq.png","205.png":"AbaU6s.png","206.png":"AbaaXn.png","207.png":"Aba000.png","208.png":"AbarkT.png","209.png":"AbastU.png","210.png":"AbaB7V.png","211.png":"Abafn1.png","212.png":"Abacp4.png","213.png":"AbayhF.png","214.png":"Abag1J.png","215.png":"Aba2c9.png","216.png":"AbaRXR.png","217.png":"Aba476.png","218.png":"Abah0x.png","219.png":"Abdg58.png"},
      }
    },
    methods: {
		checkBrackets(data) {
			// 正则表达式，用于匹配包含中括号的字符串
			const regex = /\[|\]/;

			// 使用正则表达式的test方法检查数据
			return regex.test(data);
		},
		//替换表情符号为图片
		replaceEmoji(str){
			let replacedStr = str.replace(/\[([^(\]|\[)]*)\]/g,(item, index)=>{
				console.log("item: " + item);
				for(let i=0;i<this.emojiList.length;i++){
					let row = this.emojiList[i];
					for(let j=0;j<row.length;j++){
						let EM = row[j];
						if(EM.alt==item){
							//在线表情路径，图文混排必须使用网络路径，请上传一份表情到你的服务器后再替换此路径
							//比如你上传服务器后，你的100.gif路径为https://www.xxx.com/emoji/100.gif 则替换onlinePath填写为https://www.xxx.com/emoji/
							let onlinePath = 'https://s2.ax1x.com/2019/04/12/'
							let imgstr = '<img src="'+onlinePath+this.onlineEmoji[EM.url]+'">';
							return imgstr;
						}
					}
				}
			});
			return '<div style="display: flex;align-items: center;word-wrap:break-word;">'+replacedStr+'</div>';
		},
      handleSizeChange(val) {
        this.limit = val;
        this.dataSelect()
      },
      handleCurrentChange(val) {
        this.page = val;
        this.dataSelect()
      },
      handleSizeChange1(val) {
        this.limit = val;
        this.neirongSelect(this.chatConversationId)
      },
      handleCurrentChange1(val) {
        this.page = val;
        this.neirongSelect(this.chatConversationId)
      },
      // 用户详情跳转
      updates(userid) {
        this.$router.push({
          path: '/userDetail',
          query: {
            userId: userid
          }
        })
      },
      //删除任务投诉
      deleteStair(row) {
        let delid = row.id
        this.$confirm(`确定删除此条信息?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http({
            url: this.$http.adornUrl(`helpClassify/deleteClassifyById/?id=${delid}`),
            method: 'post',
            data: this.$http.adornData({})
          }).then(({
            data
          }) => {
            this.$message({
              message: '删除成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.name = '';
                this.classifySelect()
              }
            })
          })
        }).catch(() => {})
      },
      // 查询
      select() {
        this.dataSelect()
      },
      // 重置
      cleans() {
        this.content = ''
        this.dataSelect()
      },
      // 聊天内容
      complainDetails(row) {
        this.chatConversationId = row.chatConversationId
        this.neirongSelect(this.chatConversationId)
        this.dialogFormVisible = true
      },
      select1(){
        this.page = 1
        this.neirongSelect(this.chatConversationId)
      },
      // 重置
      cleans1() {
        this.content = ''
         this.page = 1
        this.neirongSelect(this.chatConversationId)
      },
      // 处理
      amendNoticeTo() {
        this.dialogFormVisible1 = true
      },
      // 处理投诉
      complainTo() {
        this.$http({
          url: this.$http.adornUrl(`/helpComplaint/solveHelpComplaint/${this.form.id}/${this.state}`),
          method: 'post',
          data: this.$http.adornData({})
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisible = false
                this.dialogFormVisible1 = false
                this.dataSelect()
              }
            })
          }
        })
      },
      // 获取聊天会话列表
      dataSelect() {
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('chat/selectChatConversationPage'),
          method: 'get',
          params: this.$http.adornParams({
            'page': this.page,
            'limit': this.limit,
            // 'userId': this.userId
            'nickName': this.nickName
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false;
          let returnData = data.data;
          this.tableData = returnData;
			this.tableData.list.forEach(d => {
				var sf=this.checkBrackets(d.content)
				if(sf==true){
					var sss=this.replaceEmoji(d.content);
					d.content=sss;
					d.messageType=3;
				}
			});
        })
      },
      // 获取聊天内容列表
      neirongSelect(chatConversationId) {
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('chat/selectChatContent'),
          method: 'get',
          params: this.$http.adornParams({
            'page': this.page,
            'limit': this.limit,
            'chatConversationId': this.chatConversationId,
            'content': this.content
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.data;
          this.userData = returnData;
			this.userData.list.forEach(d => {
				var sf=this.checkBrackets(d.content)
				if(sf==true){
					var sss=this.replaceEmoji(d.content);
					d.content=sss;
					d.messageType=3;
				}
			});
        })
      },
	  //删除聊天
	  deleteuser (row) {
	  	// let delid = row.userId
	  	this.$confirm(`确定删除此条信息?`, '提示', {
	  		confirmButtonText: '确定',
	  		cancelButtonText: '取消',
	  		type: 'warning'
	  	}).then(() => {
	  		this.$http({
	  			url: this.$http.adornUrl('chat/deleteChatContentById?chatContentId='+row.chatContentId),
	  			method: 'post',
	  			params: this.$http.adornData({})
	  		}).then(({data}) => {
	  			if(data.code==0){
	  				this.$message({
	  					message: '删除成功',
	  					type: 'success',
	  					duration: 1500,
	  					onClose: () => {
	  						this.neirongSelect(this.chatConversationId)
	  					}
	  				})
	  			}else{
	  				this.$message({
	  					message: data.msg,
	  					type: 'warning',
	  					duration: 1500,
	  					onClose: () => {
	  					}
	  				})
	  			}
	  		})
	  	})
	  },
    },
    mounted() {
      this.dataSelect()
    }
  };
</script>

<style lang="scss">
.el-popover {
	height: 200px;
	width: 400px;
	overflow: scroll;
	overflow-x: auto;
	font-size: 20px;
}
</style>
