<template>
    <div>
    <PageWrapper>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">控制活动库</p>
        </template>
        <template #extra>
          <a-button type="link" @click="gotoPage">标准库查询</a-button>
        </template>
        <a-space direction="vertical" :size="24" style="width:100%">
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/controlactivity/StCaMainList'" imgsrc="resource/img/控制活动.png" :menuName="'控制活动'" :menuDesc="'控制活动的维护'" :menuNow="menuInfo.stCaMain.updateDate" :menuCount="menuInfo.stCaMain.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/controlactivity/StMetricList'" imgsrc="resource/img/度量指标.png" :menuName="'度量指标'" :menuDesc="'控制活动的度量指标维护'" :menuNow="menuInfo.stMetric.updateDate" :menuCount="menuInfo.stMetric.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/controlactivity/StCaMainCheckList'" imgsrc="resource/img/检查方法.png" :menuName="'检查方法'" :menuDesc="'控制活动的检查方法维护'" :menuNow="menuInfo.stCheck.updateDate" :menuCount="menuInfo.stCheck.count" />
          </a-col>
        </a-row>
        <a-row :gutter="48">
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/controlactivity/StCaMainCollectionList'" imgsrc="resource/img/活动集合.png" :menuName="'活动集合'" :menuDesc="'控制活动集合的维护'" :menuNow="menuInfo.stCollection.updateDate" :menuCount="menuInfo.stCollection.count" />
          </a-col>
        </a-row>
        </a-space>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">合规库</p>
        </template>
        <a-space direction="vertical" :size="24" style="width:100%">
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/compliane/fl'"  imgsrc="resource/img/法律.png" :menuName="'法律'" :menuDesc="'法律文件'" :menuNow="menuInfo.stCompliane1.updateDate" :menuCount="menuInfo.stCompliane1.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/compliane/fg'" imgsrc="resource/img/法规.png" :menuName="'法规'" :menuDesc="'法规文件'" :menuNow="menuInfo.stCompliane2.updateDate" :menuCount="menuInfo.stCompliane2.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/compliane/jg'" imgsrc="resource/img/监管.png" :menuName="'监管意见'" :menuDesc="'监管意见文件'" :menuNow="menuInfo.stCompliane3.updateDate" :menuCount="menuInfo.stCompliane3.count" />
          </a-col>
        </a-row>
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/compliane/fx'" imgsrc="resource/img/风险提示.png" :menuName="'风险提示'" :menuDesc="'风险提示文件'" :menuNow="menuInfo.stCompliane4.updateDate" :menuCount="menuInfo.stCompliane4.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/compliane/cf'" imgsrc="resource/img/处罚通知.png" :menuName="'处罚通知'" :menuDesc="'处罚通知文件'" :menuNow="menuInfo.stCompliane5.updateDate" :menuCount="menuInfo.stCompliane5.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/compliane/query'" imgsrc="resource/img/合规查询.png" :menuName="'合规查询'" :menuDesc="'合规查询文件'" :menuNow="menuInfo.stCompliane.updateDate" :menuCount="menuInfo.stCompliane.count" />
          </a-col>
        </a-row>
        <a-row :gutter="48">
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/standard/StStandardList'" imgsrc="resource/img/检查方法.png" :menuName="'行业标准'" :menuDesc="'行业标准的维护'" :menuNow="menuInfo.stStandard.updateDate" :menuCount="menuInfo.stStandard.count" />
          </a-col>
        </a-row>  
        </a-space>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">内控库</p>
        </template>
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/inner/stInnerControlList'" imgsrc="resource/img/内控策略.png" :menuName="'内控策略'" :menuDesc="'内控策略维护'" :menuNow="menuInfo.stInnerControl.updateDate" :menuCount="menuInfo.stInnerControl.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/inner/stInnerControlOrderList'" imgsrc="resource/img/内控制度.png" :menuName="'内控制度'" :menuDesc="'内控制度维护'" :menuNow="menuInfo.stInnerControlOrder.updateDate" :menuCount="menuInfo.stInnerControlOrder.count" />
          </a-col>
          <a-col :span="8" :hoverable="true" v-show="false">
            <ItemMenu disabled :menuName="'内控检查'"  :menuDesc="'内控制度执行'" :menuNow="'2023-03-01 00:00'" :menuCount="0" />
          </a-col>
        </a-row>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">风险库</p>
        </template>
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/risk/StRiskScenarioList'" imgsrc="resource/img/风险场景.png" :menuName="'风险场景'" :menuDesc="'风险场景维护'" :menuNow="menuInfo.stScenario.updateDate" :menuCount="menuInfo.stScenario.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/risk/StRiskEventList'" imgsrc="resource/img/风险事件.png" :menuName="'风险事件'" :menuDesc="'风险事件维护'" :menuNow="menuInfo.stEvent.updateDate" :menuCount="menuInfo.stEvent.count" />
          </a-col>
          <a-col :span="8" :hoverable="true" v-show="false">
            <ItemMenu disabled :menuName="'风险策略配置'" :menuDesc="'风险策略配置'" :menuNow="'2023-03-01 00:00'" :menuCount="0" />
          </a-col>
        </a-row>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">行业实践</p>
        </template>
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/StBestCaseList'" imgsrc="resource/img/行业实践案例.png" :menuName="'行业实践案例'" :menuDesc="'行业实践案例维护'" :menuNow="menuInfo.stBestCase.updateDate" :menuCount="menuInfo.stBestCase.count" />
          </a-col>
          <a-col :span="8" :hoverable="true">
            <ItemMenu :menuUrl="'/standardlib/StBestPracticesList'" imgsrc="resource/img/行业实践应用.png" :menuName="'行业实践应用'" :menuDesc="'行业实践应用维护'" :menuNow="menuInfo.stBestPractices.updateDate" :menuCount="menuInfo.stBestPractices.count" />
          </a-col>
        </a-row>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">问题库</p>
        </template>
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/problem'" imgsrc="resource/img/问题.png" :menuName="'问题库'" :menuDesc="'问题库维护'" :menuNow="menuInfo.stProblem.updateDate" :menuCount="menuInfo.stProblem.count" />
          </a-col>
        </a-row>
      </Card>
      <Card :bordered="false">
        <template #title>
          <p style="font-weight: 650;font-size: 16px">基础配置</p>
        </template>
        <a-space direction="vertical" :size="24" style="width:100%">
        <a-row :gutter="48">
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/base/StLableList'" imgsrc="resource/img/标签.png" :menuName="'标签库'" :menuDesc="'标签库维护'" :menuNow="menuInfo.stLable.updateDate" :menuCount="menuInfo.stLable.count" />
          </a-col>
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/base/StDomainList'" imgsrc="resource/img/领域.png" :menuName="'领域管理'" :menuDesc="'领域维护'" :menuNow="menuInfo.stDomain.updateDate" :menuCount="menuInfo.stDomain.count" />
          </a-col>
          <a-col :span="8">
            <ItemMenu :menuUrl="'/standardlib/base/stClassifyList'" imgsrc="resource/img/分类.png" :menuName="'标签分类管理'" :menuDesc="'标签分类维护'" :menuNow="menuInfo.stClassify.updateDate" :menuCount="menuInfo.stClassify.count" />
          </a-col>
        </a-row>
      </a-space>
      </Card>
    </PageWrapper>
  </div> 
  </template>
  <script lang="ts" setup>
    import { Card } from 'ant-design-vue';
  import { onMounted, ref } from 'vue';
  import ItemMenu from './components/ItemMenu.vue';
  import { statistics } from './index.api';
  import { useRouter } from 'vue-router';
  import { PageWrapper } from '/@/components/Page';
  const router = useRouter()
    const loading = ref(true);
    const menuInfo = ref({
      stBestCase:{updateDate: '',count: 0,},
      stBestPractices:{updateDate: '',count: 0,},
      stCaMain:{updateDate: '',count: 0,},
      stCheck:{updateDate: '',count: 0,},
      stClassify:{updateDate: '',count: 0,},
      stCollection:{updateDate: '',count: 0,},
      stCompliane:{updateDate: '',count: 0,},
      stCompliane1:{updateDate: '',count: 0,},
      stCompliane2:{updateDate: '',count: 0,},
      stCompliane3:{updateDate: '',count: 0,},
      stCompliane4:{updateDate: '',count: 0,},
      stCompliane5:{updateDate: '',count: 0,},
      stDomain:{updateDate: '',count: 0,},
      stEvent:{updateDate: '',count: 0,},
      stInnerControl:{updateDate: '',count: 0,},
      stInnerControlOrder:{updateDate: '',count: 0,},
      stLable:{updateDate: '',count: 0,},
      stMetric:{updateDate: '',count: 0,},
      stProblem:{updateDate: '',count: 0,},
      stScenario:{updateDate: '',count: 0,},
      stStandard:{updateDate: '',count: 0,}
    })
    onMounted(()=>{
      loading.value = true;
      statistics().then(rep=>{
        loading.value = false;
        menuInfo.value = rep;
      })
    })
    function gotoPage(){
      router.push({path: '/standardlibquery'})
    }
    setTimeout(() => {
      loading.value = false;
    }, 500);
  </script>
  <style scoped>
  .jeecg-basic-table-form-container {
    padding: 10px;
    position: relative;
  }
  .jeecg-basic-table-form-container .stm-query {
    padding: 12px 10px 6px 10px;
    margin-bottom: 8px;
    background-color: #fff;
    border-radius: 2px;
    position: relative;
  }
  .stm-typography{
    color: #009dff;
    font-size: 18px;
  }
  </style>