<template>
  <div>
    <div style="display:flex;flex:1;flex-direction: column;overflow:hidden;">
      <div class="TimeLineDiv">
        <q-timeline color="primary">
          <q-timeline-entry v-for="(tItem,tIndex) in logData" :key="tIndex">
            <template v-slot:title>
              <div class="visit_Cont">
                <div>{{tItem.LogTitle}}</div>
                <div class="Log_Content" v-if="tItem.LogContent" v-html="tItem.LogContent"></div>
              </div>
            </template>
            <template v-slot:subtitle>
              <div class="Time_TopList">
                <div>{{ tItem.CreateTimeStr }}</div>
                <div>{{ tItem.CreateByName }}</div>
              </div>
            </template>
          </q-timeline-entry>
        </q-timeline>
      </div>
    </div>
    <div style="margin:20px 0;">
      <q-pagination class="full-width justify-end" v-model="customMsg.pageIndex" color="primary" :max="pageCount" input
        @input="changePage" />
    </div>
  </div>
</template>
<script>
  import {
    queryStudentLogPage, //日志记录
  } from '../../../api/customerstudent/customerstudent';
  export default {
    props: {
      saveObj: {
        type: Object,
        default: null
      }
    },
    meta: {
      title: ""
    },
    components: {

    },
    data() {
      return {
        customMsg: {
          pageIndex: 1,
          pageSize: 10,
          StuId: 0,
        },
        pageCount: 0,
        //日志记录信息
        logData: [],
      }
    },
    created() {
      if (this.saveObj && this.saveObj.StuId > 0) {
        this.customMsg.StuId = this.saveObj.StuId;
      }
    },
    mounted() {
      this.getStuLogPage();
    },
    methods: {
      getStuLogPage() {
        queryStudentLogPage(this.customMsg).then(res => {
          if (res.Code == 1) {
            this.logData = res.Data.PageData
            this.pageCount = res.Data.PageCount
          }
        });
      },
      changePage(val){
        this.customMsg.pageIndex = val;
        this.getStuLogPage();
      }
    },
  }
</script>