<template>
  <div class="wrap">
    <van-sticky offset-top="0">
      <LHeader :text="text"></LHeader>
    </van-sticky>
    <div class="section">
      <van-tabs v-model="activeName" color="#2980f7" animated >
        <van-tab title="固有风险信息" name="a">

        </van-tab>
        <van-tab title="现状风险" name="b">
          <van-cell-group
            inset
            v-for="(item, index) in quoRiskList"
            :key="index"
          >
            <div style="font-size: 0.45rem;padding: 5px 0;">
              {{ item.name }}
            </div>
            <van-row gutter="">
              <van-col span="17">
                <van-row gutter="">
                  <van-col span="9">创建人：</van-col>
                  <van-col span="15">{{ item.leaderUserName }}</van-col>
                </van-row>
                <van-row gutter="">
                  <van-col span="9">发起时间：</van-col>
                  <van-col span="15">{{
                    timestampToTimes(item.startTime)
                  }}</van-col>
                </van-row>
              </van-col>
              <van-col span="7">
                <van-row>
                  {{ item.state }}
                </van-row>
                <van-row>
                  <van-button
                    type="info"
                    size="mini"
                    @click="todetail(index, item)"
                    >{{ active == 2 ? "去处理" : "去审批" }}</van-button
                  >
                </van-row>
              </van-col>
            </van-row>
          </van-cell-group>
        </van-tab>
        <van-tab title="四色图" name="c">
          <drawCanvas/>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import LHeader from "@/components/header.vue";
import drawCanvas from '@/views/drawCanvas/riskView.vue'
import { getFun, postFun } from "@/service/table.js";
export default {
  name: 'taskDetail',
  data() {
    return {
      text: "固有风险列表",
      activeName: 'a',
      quoRiskList:[],//现状风险列表
      InherentRisk:[],//固有风险
      inherentId:''
    }
  },
  components: {
    LHeader,
    drawCanvas
  },
  created(){
    this.inherentId = this.$route.params.id
  },
  mounted() {
    this.getQuoRiskList(this.$route.params.id)
  },
  methods: {
    getQuoRiskList(inherentId){
      getFun(`/risk/plan/existing/list/${inherentId}`).then(res=>{
        this.quoRiskList = res.data
      })
    }
  },
}
</script>

<style scoped>
.wrap {
  height: 100vh;
  width: 100vw;
}

.section {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
</style>
