| | |
| | | <p>王永炎院士学生目录</p> |
| | | </div> |
| | | <div class="page-main-title"> |
| | | <p |
| | | @click="changeTab('chart')" |
| | | :class="[activeTabs == 'chart' ? 'active-tab' : '']" |
| | | > |
| | | <img src="../../assets/images/directory/chartIcon.png" alt="" /> |
| | | <p @click="changeTab('chart')" :class="[activeTabs == 'chart' ? 'active-tab' : '']"> |
| | | <img :src="[activeTabs == 'chart' ? chartIcon : noChartIcon]" alt=""> |
| | | <span>图表显示</span> |
| | | </p> |
| | | <p |
| | | @click="changeTab('list')" |
| | | :class="[activeTabs == 'list' ? 'active-tab' : '']" |
| | | > |
| | | <img src="../../assets/images/directory/listIcon.png" alt="" /> |
| | | <p @click="changeTab('list')" :class="[activeTabs == 'list' ? 'active-tab' : '']"> |
| | | <img :src="[activeTabs == 'list' ? listIcon : noListIcon]" alt=""> |
| | | <span>列表显示</span> |
| | | </p> |
| | | </div> |
| | |
| | | <!-- 列表显示 --> |
| | | <div class="page-main" v-if="activeTabs == 'list'"> |
| | | <div v-for="(item, index) in universityList" :key="index"> |
| | | <div |
| | | class="table-title" |
| | | v-if="item.studentList && item.studentList.length > 0" |
| | | > |
| | | <div class="table-title" v-if="item.studentList && item.studentList.length > 0"> |
| | | <div class="table-title-left"> |
| | | <p class="table-title-name">{{ item.name }}</p> |
| | | <p class="table-title-degree">{{ item.degree }}</p> |
| | | <p class="table-title-number">{{ item.studentList.length }}人</p> |
| | | </div> |
| | | <div class="table-title-right" @click="item.isShow = !item.isShow"> |
| | | <img src="../../assets/images/directory/topIcon.png" alt="" /> |
| | | </div> |
| | | <div class="table-title-right" @click="item.isShow = !item.isShow"><img |
| | | :src="[item.isShow ? topIcon : bottomIcon]" alt=""></div> |
| | | </div> |
| | | <table |
| | | cellpadding="100" |
| | | v-if="item.studentList && item.studentList.length > 0 && item.isShow" |
| | | > |
| | | <table cellpadding="100" v-if="item.studentList && item.studentList.length > 0 && item.isShow"> |
| | | <tr class="table-heading"> |
| | | <th>姓名</th> |
| | | <th>性别</th> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | chartIcon: require("@/assets/images/directory/chartIcon.png"), |
| | | noChartIcon: require("@/assets/images/directory/noChartIcon.png"), |
| | | listIcon: require("@/assets/images/directory/listIcon.png"), |
| | | noListIcon: require("@/assets/images/directory/noListIcon.png"), |
| | | topIcon: require("@/assets/images/directory/topIcon.png"), |
| | | bottomIcon: require("@/assets/images/directory/bottomIcon.png"), |
| | | activeTabs: "chart", |
| | | universityList: [ |
| | | { |
| | |
| | | |
| | | mounted() { |
| | | this.initChart(); |
| | | |
| | | window.addEventListener("resize", this.handleResize); |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | changeTab(key) { |
| | | this.activeTabs = key; |
| | | console.log(this.activeTabs, "activeTabs"); |
| | | if (key == "chart") { |
| | | this.$nextTick(() => { |
| | | this.initChart(); |
| | | window.addEventListener("resize", this.handleResize); |
| | | }); |
| | | } |
| | | }, |
| | | initChart() { |
| | | this.chart = echarts.init(this.$refs.chart); |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: "item", |
| | |
| | | color: #333; |
| | | font-weight: bold; |
| | | ">${data.name}</span> |
| | | ${ |
| | | data.customInfo |
| | | ? `<span style=" |
| | | ${data.customInfo |
| | | ? `<span style=" |
| | | background: #ffeb3b; |
| | | padding: 2px 5px; |
| | | border-radius: 3px; |
| | | margin-left: 8px; |
| | | font-size: 12px; |
| | | ">${data.customInfo}</span>` |
| | | : "" |
| | | } |
| | | : "" |
| | | } |
| | | </div> |
| | | <div style="margin-top: 8px;"> |
| | | <div>节点值: <span style="color: #4f8ff7;">${ |
| | | data.value || 0 |
| | | }</span></div> |
| | | <div>节点值: <span style="color: #4f8ff7;">${data.value || 0 |
| | | }</span></div> |
| | | <div>描述: ${data.description || "暂无描述"}</div> |
| | | |
| | | </div> |
| | |
| | | /* 移除最后一行的下边框 */ |
| | | } |
| | | } |
| | | |
| | | .charts-main { |
| | | // background-color: #000; |
| | | } |
| | | |
| | | .table-title { |
| | | display: flex; |
| | | align-items: center; |