<template>
  <div :class="[$style.wrapHeight, $style.lawapply]">
    <a-card :bordered="false">
      <a-tabs v-model="activeKey" type="line" @change="toggleTabs">
        <a-tab-pane key="1" tab="法律审查申请">
          <!-- /sd-frame/sd-task-list?moduleId=272182905903054848&formListId=282352741653991424 -->
          <sd-task-list
            v-if="ifRouterView"
            :module-id="'272182905903054848'"
            :form-list-id="'282352741653991424'"
          ></sd-task-list>
        </a-tab-pane>
        <a-tab-pane key="2" tab="审查中">
          <!-- /sd-frame/sd-task-list?moduleId=272182905903054848&formListId=282603215548370944 -->
          <sd-task-list
            v-if="ifRouterView2"
            :module-id="'272182905903054848'"
            :form-list-id="'282603215548370944'"
          ></sd-task-list>
        </a-tab-pane>
        <a-tab-pane key="3" tab="已反馈">
          <!-- /sd-frame/sd-task-list?moduleId=272182905903054848&formListId=282607519319511040 -->
          <sd-task-list
            v-if="ifRouterView3"
            :module-id="'272182905903054848'"
            :form-list-id="'282607519319511040'"
          ></sd-task-list>
        </a-tab-pane>
      </a-tabs>
    </a-card>
  </div>
</template>

<script>
import sdBusinessList from '../../../../src/application-manage/sd-business-list.vue'
import sdTaskList from '../../../../src/application-manage/sd-task-list.vue'
import components from './_import-components/law-check-apply-list-import'

export default {
  name: 'LawCheckApplyList',
  metaInfo: {
    title: 'LawCheckApplyList',
  },
  components: {
    ...components,
    sdTaskList,
  },
  data() {
    return {
      activeKey: '1',
      ifRouterView: true,
      ifRouterView2: false,
      ifRouterView3: false,
    }
  },
  methods: {
    toggleTabs(key) {
      this.activeKey = key
      this.ifRouterView = false
      this.ifRouterView2 = false
      this.ifRouterView3 = false
      if (this.activeKey === '1') {
        this.$nextTick(() => {
          this.ifRouterView = true
        })
      } else if (this.activeKey === '2') {
        this.$nextTick(() => {
          this.ifRouterView2 = true
        })
      } else if (this.activeKey === '3') {
        this.$nextTick(() => {
          this.ifRouterView3 = true
        })
      }
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.lawapply {
  :global(.ant-tabs-bar) {
    margin-bottom: 8px;
  }
  :global(.ant-card-body) {
    padding-top: 0px;
  }
}
</style>
