<template>
  <div>
      <el-dialog
        v-dialogDrag
        :visible.sync="showDetailModal"
        title="打印模板表详情"
      >
      <div class="maxHeight">
        <table class="tableClass">
          <tbody>
            <tr>
              <th>模块名称</th>
              <td>{{obj.moduleId}}</td>
            </tr>
            <tr>
              <th>执行 SQL</th>
              <td>{{obj.sql}}</td>
            </tr>
            <tr>
              <th>模板 HTML</th>
              <td>
                <el-input
                  v-model="obj.html"
                  type="textarea"
                  :autosize="{maxRows: 6}"/>
              </td>
            </tr>
            <tr>
              <th>创建时间</th>
              <td>{{$dateformat(obj.ctime, "yyyy-mm-dd HH:MM")}}</td>
            </tr>
          </tbody>
        </table>
      </div>
      </el-dialog>
  </div>
</template>
<script>
/**
 * 打印模板表详情
 */
import { printTemplate } from '../../../api'

export default {
  data() {
    return {
      obj: {},
      showDetailModal: false
    }
  },
  methods: {
    _open: async function(id) {
      this.showDetailModal = true
      const result = await printTemplate.getById(id)
      this.obj = result
    }
  }
}
</script>
