<template>
  <el-dialog title="内容审核" @close="$emit('close')" :visible="show">
      <el-form :model="auditForm">
        <el-form-item label="内容审核：" :label-width="formLabelWidth">
          <el-radio-group v-model="auditForm.status">
            <el-radio :label="1">审核通过</el-radio>
            <el-radio :label="0">审核不通过</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="反馈详情：" :label-width="formLabelWidth">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4}"
            placeholder="请输入内容"
            :maxlength="INPUTLENGTH*2" show-word-limit
            v-model="auditForm.reason">
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="$emit('close')">取 消</el-button>
        <el-button type="primary" @click="audit">确 定</el-button>
      </div>
    </el-dialog>
</template>


<script>
import { audit } from "@/configue/api";

export default {
  props:{
    id:{
      type:String || Number
    },
    show:{
      type:Boolean
    },
    type:String
  },
  data() {
    return {
      formLabelWidth: "100px",
      auditForm:{
        reason:'',
        status:1
      }
    };
  },
  methods:{
    audit(){
      let params = {
        id:this.id,
        ...this.auditForm
      }
      audit(this.type, params, () => {
        this.$alert("审核成功", "提示", {
          confirmButtonText: "确定",
          callback: () => {
            this.backList()
          },
        });
      });
    },
  }
};
</script>
