<template>
  <el-dialog title="详情" append-to-body :modelValue="openShow" width="40%" @close="closeDialog">
    <!-- <avue-form :option="option"></avue-form> -->
    <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" @on-load="onLoad">
      <template #menu-left> </template>
      <template #menu-right> </template>
      <template #menu="{ row }"> </template>

      <template #heatTreat="scope"> </template>
    </avue-crud>
    <!-- <template #footer>
      <span class="dialog-footer">
        <el-button @click="closeDialog">取 消</el-button>
        <el-button type="primary" @click="submit">确 定</el-button>
      </span>
    </template> -->
  </el-dialog>
</template>
<script>
import { getDetail } from '@/api/processManagement/inPlantProcess';
export default {
  props: {
    showDialog: {
      type: Boolean,
      default: false,
    },
    rowData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      openShow: false,
      data: [],
      loading: false,
      option: {
        columnSort: true,
        tip: false,
        // height: 'auto',
        calcHeight: 32,
        simplePage: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchIcon: true,
        searchIndex: 3,
        tree: false,
        border: true,
        index: true,
        selection: false,
        addBtn: false,
        editBtn: false,
        viewBtn: false,
        delBtn: false,
        editBtnText: '修改',
        labelWidth: 120,
        menuWidth: 80,
        dialogWidth: 900,
        dialogClickModal: false,
        searchEnter: true,
        excelBtn: false,
        filterBtn: true,
        searchShowBtn: false,
        excelBtn: true,
        showOverflowTooltip: true,
        addBtnIcon: ' ',
        viewBtnIcon: ' ',
        delBtnIcon: ' ',
        editBtnIcon: ' ',
        gridBtn: false,
        searchLabelPosition: 'left',
        searchGutter: 24,
        searchSpan: 6,
        menuAlign: 'left',
        gridBtn: false,
        searchMenuPosition: 'right',
        align: 'center',
        header: false,
        menu: false,
        column: [
          {
            label: '事项',
            prop: 'matter',
            search: false,
            sortable: true,
            span: 12,
          },
          {
            label: '描述',
            prop: 'process',
            search: false,
            sortable: true,
            span: 12,
          },
        ],
      },
    };
  },
  mounted() {
    this.openShow = this.showDialog;
  },
  methods: {
    closeDialog() {
      this.openShow = false;
      this.$emit('closeDialog');
    },
    submit() {
      this.$refs.form.validate(async valid => {
        if (valid) {
          let params = {
            id: this.$route.query.id,
            approvalStatus: '',

            // status: this.option.column[0].value,
            // reason: this.option.column[1].value,
          };
          //   updateProcess(params).then((res) => {
          //     if (res.code == 200) {
          //       this.$message.success('操作成功');
          //       this.closeDialog();
          //     }
          //   });
        }
      });
    },
    onLoad() {
      this.loading = true;
      getDetail({ busId: this.rowData.id }).then(res => {
        this.data = res.data.data;
        this.loading = false;
      });
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep(.el-dialog .el-dialog__body) {
  padding-bottom: 20px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}
</style>
