<template>
  <div id="">
    <a-collapse v-model="activeNames" accordion >
      <a-collapse-panel v-for="(item, index) in options" :key="item.name" :header="item.title">
        <component :is="item.name" :rowData="rowData" :openType="openType" @addDiFangSuccess="addDiFangSuccess"></component>
      </a-collapse-panel>
    </a-collapse>
  </div>
</template>

<script>
import { optionsForJiangxiShuiZiYuanGuanLiJieShui } from './forDifferentProvince';
import qys_jiHuaYongShuiHeShuiZiYuanFeiZhengShou from './qys_jiHuaYongShuiHeShuiZiYuanFeiZhengShou';
import qys_quShuiJiLiangTongJi from './qys_quShuiJiLiangTongJi';
import qys_quShuiXuKe from './qys_quShuiXuKe';

export default {
  props: {
    rowData: {
      type: Object,
      default: {},
    },
    openType: {
      type: Boolean,
      default: true,
    },
  },
  components: {
    qys_quShuiXuKe,
    qys_quShuiJiLiangTongJi, // 内业-维养经费
    qys_jiHuaYongShuiHeShuiZiYuanFeiZhengShou, // 内业-维养经费
  },
  data() {
    return {
      activeNames: ['qys_quShuiXuKe'],
      options: [],
    };
  },
  computed: {
    // 监听属性 类似于data概念
    currentRlcode() {
      return localStorage.getItem('currentRlcode')
        ? localStorage.getItem('currentRlcode')
        : '';
    },
  },
  watch: {},
  mounted() {
    this.options = optionsForJiangxiShuiZiYuanGuanLiJieShui[1].childrens;
  },
  methods: {
    handleChange(val) {
      console.log(val);
    },
    addDiFangSuccess() {
      this.$emit('addDiFangSuccess');
    },
  },
};
</script>

<style lang='less' scoped>

</style>
