<!--黄龙-->
<template>
  <div class="container-fluid">
    <div>
      <el-collapse-transition>
        <el-tabs v-model="activeName" @tab-click="handleClick" >
          <el-tab-pane label="全部消息" name="first">
            <div class="ui-icon-seek-first">
            </div>
          </el-tab-pane>
          <el-tab-pane label="小结" name="second">小结</el-tab-pane>
          <el-tab-pane label="消息" name="third">消息</el-tab-pane>
          <el-tab-pane label="@我" name="fourth">@我</el-tab-pane>
          <el-tab-pane label="评论" name="five">评论</el-tab-pane>
        </el-tabs>
      </el-collapse-transition>
    </div>
  </div>

</template>
<script>
  import _TABLE from '@/views/components/TabPagin/Table.vue'
  import _POPUP from '@/views/components/Popup/Popup.vue'
  import _BTN_FILTER from '@/views/components/Screen/btn&filterTemp.vue'
  import { getUser } from '@/config/info'
  import log from '@/log'
  import api from '@/api'
  export default {
    mounted () {
      /** 调用初始化数据 **/
      this.findAll()
    },
    data () {
      return {
        activeName: 'first',
        all: []
      }
    },
    methods: {
      handleClick (tab, event) {
        console.log(tab, event)
      },
      findAll () {
        debugger
        let params = {}
        params.userId = getUser().id
        params.beginTime = '2017-01-01'
        params.endTime = '2017-12-31'
        debugger
        api.requestJava('POST', 'system/common/topicQuery.do', params)
          .then((request) => {
            if (Number(request.data.code) === 200) {
              debugger
              this.consumption = request.data.data
              for (let i = 0; i < request.data.data.length; i++) {
                for (let j = 0; j < request.data.data[i].detailEntities.length; j++) {
                  $('.ui-icon-seek-first').append('<p align="center">' + request.data.data[i].deptname + '</p></br>' + request.data.data[i].contents + '<div class="fa fa-thumbs-o-up fa-2x" style=" float:right;"></div>' + '</br>' + '<div class="fa fa-thumbs-o-up fa-2x"></div>' + request.data.data[i].userNames + '</br>' + request.data.data[i].detailEntities[j].username + ':' + request.data.data[i].detailEntities[j].comments)
                }
              }
            } else if (Number(request.data.code) === 401) {
              this.$message('登录失效')
              this.logInvalid.dialogVisible = true
            } else {
              this.$notify.error({title: '提示', message: request.data.message})
              throw new Error(JSON.stringify(request))
            }
          })
          .catch((err) => {
            let culprit = this.$route.name
            // this.toggleLoading()
            log.work(err, culprit)
          })
      } // 查询接口
    },
    components: {
      _TABLE,
      _POPUP,
      _BTN_FILTER
    }
  }
</script>

