<template>
  <!-- 机器日志 -->
  <el-dialog
    title="机器日志"
    :visible.sync="logsvisible"
    :before-close="close"
    :close-on-click-modal="false"
  >
    <el-table
      :data="logsList"
      border
      height="260px"
      style="width: 100%"
      v-loading="logsloading"
      element-loading-text="加载中"
      element-loading-spinner="el-icon-loading"
    >
      <el-table-column type="index" label="序号" width="60" />
      <el-table-column prop="content" label="内容" min-width="180">
        <template slot-scope="scope">
          <span v-if="scope.row.content">
            {{ scope.row.content }}
          </span>
          <span v-else-if="scope.row.log_content">
            {{ scope.row.log_content }}
          </span>
          <span v-else>
            {{ scope.row.content }}
          </span>
        </template>
      </el-table-column>

      <el-table-column prop="truename" label="操作人">
        <template slot-scope="scope">
          <span v-if="scope.row.truename">
            {{ scope.row.truename }}({{ scope.row.username }})
          </span>
          <span v-else>
            {{ scope.row.username }}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="add_time" label="操作时间" min-width="180" />
    </el-table>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="close">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: ["logsloading", "logsvisible", "logsList"],
  data() {
    return {};
  },
  components: {},
  methods: {
    // 关闭日志
    close() {
      this.$emit("logsclose");
    },
  },
};
</script>

<style scoped lang='scss'>
</style>