<template>
  <div class="el-resource_statistics_pc_1">
    <div class="resource_statistics_pc_1">
   <div class="container">
      <div class="row">
         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="resource_statistics-body">
               <div class="row">
                  <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
                     <span class="resource_statistics-title">
                       资源库数据统计
                     </span>
                  </div>
                  <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
                     <div class="resource_statistics">
                        <ul class="clearfix">
                           <li>
                              <img src="../../theme-chalk/src/images/zyk-tongji-icon01.png" alt="">
                              <span class="sp1">{{Number(couNum.totalNum)}}门<span>课程</span></span>
                           </li>
                           <li>
                              <img src="../../theme-chalk/src/images/zyk-tongji-icon02.png" alt="">
                              <span class="sp1">{{Number(resNum.video)}}个<span>视频</span></span>
                           </li>
                           <li>
                              <img src="../../theme-chalk/src/images/zyk-tongji-icon03.png" alt="">
                              <span class="sp1">{{Number(resNum.doc)}}个<span>文档</span></span>
                           </li>

                           <li>
                              <img src="../../theme-chalk/src/images/zyk-tongji-icon05.png" alt="">
                              <span class="sp1">{{Number(resNum.audio)}}个<span>音频</span></span>
                           </li>
                        </ul>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>
  </div>
</template>

<script>
   import formMixin from '../../../src/mixins/formMixin';
  import lenye_base from 'lenye_base';
  import $ from 'fy-kit';
  import msg from "../../message";
export default {
  name: 'ElResourceStatisticsPc1',
  mixins: [formMixin],
  model: {},
  data(){
    return {
      siteId:'',
      couNum:{},
      resNum:{}
    }
   },
   components:{
    msg
   },
   created() {
      this.siteId=lenye_base.user_data.getuserData().siteId
   },
   mounted() {
     this.init();
     this.Res();
   },
   computed: {},
   methods: {
     Res(){
       $.util
        .ajax(
          lenye_base.base_data.getapiUrl() +
            "/resource-service/common/resResource/resCount.do",
          lenye_base.base_data.getformatting({
            siteId:this.siteId
          })
        )
        .then(res => {
          if (res.success == "1") {

             this.resNum = res.data;

          } else {
            msg.error(res.message);
          }
        });
     },
     init(){
        $.util
        .ajax(
          lenye_base.base_data.getapiUrl() +
            "/course-service/common/crsCourse/count.do",
          lenye_base.base_data.getformatting({
            siteId:this.siteId
          })
        )
        .then(res => {
          if (res.success == "1") {
             this.couNum = res.data;

          } else {
            msg.error(res.message);
          }
        });
     }
   },
};
</script>
