<template>
  <a-modal
    :open="dialogTableVisible"
    :title="problemMiddleType + '新增问题'"
    :footer="null"
    :mask="false"
    width="40%"
    @cancel="dialogClose">
    <div style="text-align: center;">
      <component
        :is="curComponent"
        :objId="objId"
        :objType="objType"
        :villType="villType"
        :villCode="villCode"
        :cwsCode="cwsCode"
        :objName="objName"
        :curId="curId"
        :curNm="curNm"
        :curType="curType"
        :prsnWaterId="prsnWaterId"
        :problemMiddleType="problemMiddleType"
        :currentGroupId="currentGroupId"
        :problemSmallType="problemSmallType"
        :currentObjectRgstrId="currentObjectRgstrId"
        :problData="problData"
        @closeDialog="dialogClose"
        :szRuls="szRuls">
      </component>
    </div>
  </a-modal>
</template>

<script>
import diFangTianBaoNeiYe from './addProblem/diFangTianBaoNeiYe.vue';
import difanggongchenganquanduxun from './addProblem/difanggongchenganquanduxun.vue';
import dike2022 from './addProblem/dike2022.vue';
import hehuweishi from './addProblem/hehuweishi.vue';
import nongcunyinshuianquan from './addProblem/nongcunyinshuianquan.vue';
import quShuiGongCheng from './addProblem/quShuiGongCheng.vue';
import shuikufanghong from './addProblem/shuikufanghong.vue';
import shuilitisunian from './addProblem/shuilitisunian.vue';
import shuixingzhengzhifa from './addProblem/shuixingzhengzhifa.vue';
import shuiZiYuanJieShui from './addProblem/shuiZiYuanJieShui.vue';
import shuizha from './addProblem/shuizha.vue';
import shujunshashi from './addProblem/shujunshashi.vue';
import villsaf from './addProblem/villsaf.vue';
import xiaoshuidian from './addProblem/xiaoshuidian.vue';
import xiaoshuikuwenti from './addProblem/xiaoshuiku.vue';
import xiaoshuikuBiaozhunhua from './addProblem/xiaoshuikuBiaozhunhua.vue';
import yingjibeiyongshuiyuan from './addProblem/yingjibeiyongshuiyuan.vue';
import yinShuiGongCheng from './addProblem/yinShuiGongCheng.vue';
import zhongDianShuiHuiGongCheng from './addProblem/zhongDianShuiHuiGongCheng.vue';
export default {
  props: {
    //  1 小水库  2 人饮 3 水毁  4 水文司地下水
    objType: {
      default: '2',
      // required: true
    },
    // 对象类型 0 小水库  1 行政村  2 水源地  3 饮水工程  4 水毁工程  5 地下水
    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: '',
    },
    currentObjectRgstrId: {
      default: '',
    },
    problData: {
      default: '',
    },
    curId: {
      default: '',
    },
    curNm: {
      default: '',
    },
    curType: {
      default: '',
    },
    currentGroupId: {
      default: '',
    },
    // 用水户id
    prsnWaterId: {
      default: '',
    },
    szRuls: {
      default: () => {
        return [];
      },
    },
  },
  components: {
    xiaoshuikuwenti: xiaoshuikuwenti,
    shuizha: shuizha,
    yinShuiGongCheng: yinShuiGongCheng,
    xiaoshuikuBiaozhunhua: xiaoshuikuBiaozhunhua,
    shujunshashi: shujunshashi,
    hehuweishi: hehuweishi,
    shuilitisunian: shuilitisunian,
    diFangTianBaoNeiYe,
    xiaoshuidian: xiaoshuidian,
    shuiZiYuanJieShui,
    quShuiGongCheng,
    zhongDianShuiHuiGongCheng,
    shuixingzhengzhifa,
    yingjibeiyongshuiyuan,
    shuikufanghong,
    nongcunyinshuianquan,
    difanggongchenganquanduxun,
    dike2022,
    villsaf,
  },
  data() {
    return {
      dialogTableVisible: true,
      curComponent: 'shuiyuandi',
    };
  },
  mounted() {
    if (this.villType == '3') {
      this.curComponent = 'yinShuiGongCheng';
    } else if (this.villType == '0') {
      this.curComponent = 'xiaoshuikuwenti';
    } else if (this.villType == '7') {
      this.curComponent = 'shuizha';
    } else if (this.villType == '24') {
      this.curComponent = 'xiaoshuikuBiaozhunhua';
    } else if (this.villType == '52') {
      this.curComponent = 'shujunshashi';
    } else if (this.villType == '50') {
      this.curComponent = 'hehuweishi';
    } else if (this.villType == '51') {
      this.curComponent = 'shuilitisunian';
    } else if (this.villType == '58') {
      this.curComponent = 'diFangTianBaoNeiYe';
    } else if (
      this.villType == '59' ||
      this.villType == '61' ||
      this.villType == '63' ||
      this.villType == '65'
    ) {
      this.curComponent = 'xiaoshuidian';
    } else if (this.villType == '60') {
      // 水资源管理节水
      this.curComponent = 'shuiZiYuanJieShui';
    } else if (this.villType == '64') {
      // 取水工程
      this.curComponent = 'quShuiGongCheng';
    } else if (this.villType == '66') {
      // 重点水毁工程
      this.curComponent = 'zhongDianShuiHuiGongCheng';
    } else if (this.villType == '85') {
      // 水行政执法
      this.curComponent = 'shuixingzhengzhifa';
    } else if (this.villType == '86') {
      // 水库防洪调度
      this.curComponent = 'shuikufanghong';
    } else if (this.villType == '87') {
      // 应急备用水源
      this.curComponent = 'yingjibeiyongshuiyuan';
    } else if (this.villType == '88') {
      // 农村饮水安全
      this.curComponent = 'nongcunyinshuianquan';
    } else if (this.villType == '90') {
      // 堤防工程安全度汛
      this.curComponent = 'difanggongchenganquanduxun';
    } else if (this.villType == '114') {
      // 堤防工程安全度汛
      this.curComponent = 'dike2022';
    } else if (this.villType == '117') {
      // 农村脱贫
      this.curComponent = 'villsaf';
    }
  },
  methods: {
    dialogClose() {
      this.$emit('closeDialog');
    },
  },
};
</script>

<style lang='less' scoped>

</style>
