106 lines
2.7 KiB
Vue
106 lines
2.7 KiB
Vue
<template>
|
|
<div class="header">
|
|
<div class="leftheader" v-if="categorylist.length > 0">
|
|
<div class="item" v-for="(item, index) in categorylist" :key="item.id" @click="clickcategory(item, index)"
|
|
:class="index == categoryindex ? 'selectitem' : ''">
|
|
<div class="name">
|
|
{{ item.propagandaTitle }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="rightheader" v-if="categorylist.length > 0">
|
|
<div class="richtext" v-html="categoryItem.propagandaContent">
|
|
</div>
|
|
</div>
|
|
<el-empty description="暂无" style="width: 100%;" v-else></el-empty>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import {
|
|
getList
|
|
} from '@/api/manage/healthEducation'
|
|
export default {
|
|
name: "healthEducation",
|
|
data() {
|
|
return {
|
|
//左侧类型选中
|
|
categoryindex: 0,
|
|
//左侧选中的item
|
|
categoryItem: {},
|
|
//左侧list
|
|
categorylist: [],
|
|
query: {
|
|
patientId: ''
|
|
}
|
|
};
|
|
},
|
|
mounted() {
|
|
this.info();
|
|
},
|
|
methods: {
|
|
clickcategory(item, index) {
|
|
this.categoryindex = index
|
|
this.categoryItem = item
|
|
},
|
|
info() {
|
|
this.query.patientId = this.$route.query.patientId
|
|
getList(this.query).then(res => {
|
|
if (res.data.length > 0) {
|
|
this.categorylist = res.data
|
|
this.categoryItem = this.categorylist[0]
|
|
}
|
|
})
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.header {
|
|
background-color: #fff !important;
|
|
padding: 0 !important;
|
|
display: flex;
|
|
|
|
.rightheader {
|
|
width: 75%;
|
|
padding-top: 20px;
|
|
border-left: 3px solid #DFE4ED;
|
|
|
|
.richtext {
|
|
overflow: scroll;
|
|
// 隐藏表头的滚动条
|
|
overflow-x: hidden !important;
|
|
width: 400px;
|
|
margin: 0 auto;
|
|
height: 450px;
|
|
border: 1px solid #CCCCCC;
|
|
}
|
|
}
|
|
|
|
.leftheader {
|
|
width: 20%;
|
|
margin-top: 20px;
|
|
height: 450px;
|
|
overflow: scroll;
|
|
// 隐藏表头的滚动条
|
|
overflow-x: hidden !important;
|
|
|
|
.selectitem {
|
|
background-color: #D2E9FC;
|
|
border-left: 2px solid #1890ff !important;
|
|
border-bottom: 1px solid #fff !important;
|
|
}
|
|
|
|
.item {
|
|
padding: 25px 10px;
|
|
position: relative;
|
|
border-left: 2px solid #fff;
|
|
border-bottom: 1px solid #E7E7E7;
|
|
|
|
.name {
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style> |