<template>
  <a-modal :title="objName + '新增整改问题'" :open="dialogTableVisible" class="custom_dialog" @cancel="dialogClose">
    <div style="text-align: center;">
      <component
        :is="curComponent"
        :objId="objId"
        :objType="objType"
        :villType="villType"
        :villCode="villCode"
        :cwsCode="cwsCode"
        :grwCode="grwCode"
        :objName="objName"
        :problData="problData"
        :regId="regId"
        :pblmDesc="pblmDesc"
        :currentObjectRgstrId="currentObjectRgstrId"
        @closeDialog="dialogClose"></component>
    </div>
  </a-modal>
</template>

<script>
import siluan from '../../duChaWenTi/addProblem/siluan.vue';
import qushuikou from './addProblemForm.vue';
export default {
  props: {
    //  1 小水库  2 人饮 3 水毁
    objType: {
      default: '2',
      // required: true
    },
    // 对象类型 0 小水库  1 行政村  2 水源地  3 饮水工程  4 水毁工程
    villType: {
      default: '1',
      // required: true
    },
    villCode: {
      default: '1',
      // required: true
    },
    // 对象id
    objId: {
      default: '',
      // required: true
    },
    // 对象名称
    objName: {
      default: '行政村',
      // required: true
    },
    // 问题中类型
    problemMiddleType: {
      default: '用水户情况',
    },
    // 问题小类型
    problemSmallType: {
      default: '水质',
    },
    cwsCode: {
      default: '',
    },
    grwCode: {
      default: '',
    },
    stationType: {
      default: '',
    },
    regId: {
      default: '',
    },
    currentObjectRgstrId: {
      default: '',
    },
    fenlei: {
      default: '',
    },
    problData: {
      default: '',
    },
    pblmDesc: {
      default: '',
    },
  },
  components: {
    qushuikou,
    siluan,
  },
  data() {
    return {
      dialogTableVisible: true,
      curComponent: '',
    };
  },
  mounted() {
    this.$nextTick(() => {
      this.curComponent = this.fenlei;
    });
  },
  methods: {
    dialogClose() {
      this.$emit('closeDialog');
    },
  },
};
</script>

<style lang='less' scoped>
.title {
  font-size: 16px;
}

.el-icon-edit {
  margin-right: 10px;
}

.custom_dialog .el-dialog {
  width: 45%;
}

.custom_dialog .el-dialog__body {
  padding: 30px 20px;
  color: #606266;
  font-size: 14px;
  height: 60vh;
  overflow: auto;
}
</style>
