Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

106 righe
3.1 KiB

  1. <template>
  2. <el-main style="width: 960px;margin: 0 auto;min-height: 500px">
  3. <el-row class="card_menu">
  4. <el-col :span="4">
  5. <el-card class="box-card" shadow="never" :body-style="{ padding: '10px 0'}">
  6. <div slot="header">
  7. <span>知识产权与标准化</span>
  8. </div>
  9. <!-- <div class="menu-item active">标准化创新基地介绍</div>
  10. <div class="menu-item">协会团标</div>
  11. <div class="menu-item">申请编写团标</div> -->
  12. <div class="menu-item" v-for="(item, index) in titleList" :key="index"
  13. :class="{'active' : (index == activeIndex)}" @click="changeType(index)">
  14. {{item.title}}</div>
  15. </el-card>
  16. </el-col>
  17. <el-col :span="20">
  18. <el-card shadow="never" style="margin: 0 10px;">
  19. <h2 style="text-align: center;color: #333">
  20. <span>协会团标</span>
  21. </h2>
  22. <el-row>
  23. <el-col :span="6" v-for="(item,index) in dataList" :key="index" >
  24. <el-card class="box-card" shadow="never" style="margin: 0 10px" :body-style="{ padding: '0px' }">
  25. <img :src="item.aboutImg" style="border-radius: 10px;margin: 10px 0" width="100%"/>
  26. <p style="color: #333">{{item.title}}</p>
  27. </el-card>
  28. </el-col>
  29. </el-row>
  30. </el-card>
  31. </el-col>
  32. </el-row>
  33. </el-main>
  34. </template>
  35. <script>
  36. import {getChannelInformationsRequest, getChannelsRequest,
  37. getChannelSecond} from "../api/data";
  38. export default {
  39. data () {
  40. return {
  41. titleList: [],
  42. activeIndex: 0,
  43. dataList: [],
  44. total: 0
  45. }
  46. },
  47. methods: {
  48. async getChannelsRequest(){
  49. let res = await getChannelsRequest({current:1,size:100})
  50. if(res.code == 200){
  51. res.data.records.map((item) => {
  52. if(item.channelName == '知识产权'){
  53. this.getChannelSecond(item.id)
  54. }
  55. })
  56. }
  57. },
  58. async getChannelSecond(id){
  59. let res = await getChannelSecond(id)
  60. if(res.code == 200){
  61. this.titleList = res.data
  62. console.log("this.titleList:"+JSON.stringify(res.data))
  63. if(this.titleList){
  64. this.getChannelInformationsRequest(this.titleList[0].id)
  65. }
  66. }
  67. },
  68. async getChannelInformationsRequest(id){
  69. let res = await getChannelInformationsRequest({channelId: id})
  70. if(res.code == 200){
  71. this.dataList = res.data.records
  72. this.total = res.data.total
  73. }
  74. },
  75. changeType(index){
  76. this.activeIndex = index;
  77. console.log(this.titleList[index].id)
  78. this.getChannelInformationsRequest(this.titleList[index].id)
  79. }
  80. },
  81. mounted() {
  82. this.getChannelsRequest()
  83. }
  84. }
  85. </script>
  86. <style>
  87. .menu-item{
  88. text-align: center;
  89. padding: 10px;
  90. width: 100%;
  91. }
  92. .card_menu .menu-item.active{
  93. border-left: 2px solid #427FCE;
  94. background: #eee;
  95. }
  96. </style>