<template>
  <el-dialog
    :title="$t1('提交内容')"
    :visible.sync="showDialog"
    :modal-append-to-body="false"
    :close-on-click-modal="false"
    :modal="false"
    custom-class="dialog-style wf-dialog"
    v-el-drag-dialog
    v-el-dialog-center
    @close="closeDialog"
  >
    <el-form ref="editForm" :model="formData">
      <div id="containt">
        <table class="table-detail">
          <tbody>
          <tr>
            <th>
                <span class="t">
                  <em class="f-red">*</em>
                  {{ $t1('内容') }}
                </span>
            </th>
            <td>
              <el-form-item prop="logContent" :rules="[{ required:true, trigger: ['blur', 'change'] }]">
                <el-input type="textarea" :rows="8" :placeholder="$t1('请输入内容')"
                          v-model="formData.logContent"></el-input>
              </el-form-item>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </el-form>
    <span slot="footer" class="dialog-footer">
          <el-button type="primary" plain class="button-sty" @click="closeDialog">
            <i class="el-icon-close el-icon"></i>
            {{ $t2('取 消', 'system.button.cancel2') }}
          </el-button>
          <el-button type="primary" @click="confirmDialog" class="button-sty">
            <i class="el-icon-check el-icon"></i>
            {{ $t2('确 定', 'system.button.confirm2') }}
          </el-button>
        </span>
  </el-dialog>
</template>
<script>
export default {
  name: "preformDialog",
  data() {
    return {
      showDialog: true,
      formData: {
        logContent: null
      }
    }
  },
  methods: {
    closeDialog() {
      this.$emit("update:visiable", false);
      this.showDialog = false;
    },
    confirmDialog() {
      this.$refs.editForm.$baseValidate(valid => {
        if (valid) {
          this.closeDialog();
          this.$emit("confirm", this.formData);
        }
      });

    }
  }
}
</script>
<style scoped>

</style>
