| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <template>
- <div class="ArtPanel-group-box" :style="{height:height}">
- <div class="group-title">
- {{ title }}
- <el-link @click="showMoreArt(dataList,'最新动态');">更多 <i class="el-icon-caret-right" /></el-link>
- </div>
- <vuescroll v-if="dataList" :ops="ops" style="height: calc(100% - 40px)">
- <div class="art_list_block">
- <div
- v-for="(item, index) in dataList"
- :key="index"
- class="item"
- @click="showDetail(item)"
- >
- <div class="icon">
- <i class="el-icon-s-comment" />
- </div>
- <div class="info">
- <div class="lf clearfix">
- <h4>{{ item.artTitle }}</h4>
- </div>
- <div class="rt">
- <div class="el-tag-time">
- <span style="padding-left:0;color:#c4c1c1;font-size: 10px;">{{ item.issuedAt }}</span>
- </div>
- <div class="el-tag-art">
- <el-tag v-if="item.artCatId>=10 && item.artCatId <20" size="mini" class="custom-tag tag-1">平安医院</el-tag>
- <el-tag v-if="item.artCatId>=20 && item.artCatId <30" size="mini" class="custom-tag tag-2">质量医院</el-tag>
- <el-tag v-if="item.artCatId>=31 && item.artCatId <40" size="mini" class="custom-tag tag-3">满意医院</el-tag>
- <el-tag v-if="item.artCatId>=40 && item.artCatId <50" size="mini" class="custom-tag tag-4">智慧医院</el-tag>
- <el-tag v-if="item.artCatId>=50 && item.artCatId <60" size="mini" class="custom-tag tag-5">健康医院</el-tag>
- <el-tag v-if="item.artCatId>=60 && item.artCatId <69" size="mini" class="custom-tag tag-6">节约型医院</el-tag>
- </div>
- </div>
- </div>
- </div>
- </div>
- </vuescroll>
- <ArtDetail ref="ArtDetail" />
- </div>
- </template>
- <script>
- import vuescroll from 'vuescroll'
- import { getRecentArtByList } from '@/api/system/artApi'
- import ArtDetail from '@/views/system/art/components/ArtDetail'
- export default {
- name: 'ArtPanel',
- components: {
- vuescroll,
- ArtDetail
- },
- props: {
- title: {
- type: [String],
- default: '最新动态'
- },
- artCatId: {
- type: [String, Number],
- default: undefined
- },
- artCatList: {
- type: [String, Number],
- default: undefined
- },
- more: {
- type: [String],
- default: undefined
- },
- height: {
- type: [String],
- default: 'calc(100vh - 85px)'
- }
- },
- data() {
- return {
- ops: {
- bar: {
- keepShow: false,
- background: 'rgba(144, 147, 153, 0.4)',
- onlyShowBarOnScroll: false
- }
- },
- listLoading: false,
- dataList: [],
- conditions: {
- artCatId: this.artCatId,
- artCatList: this.artCatList
- }
- }
- },
- mounted() {
- this.getData()
- },
- methods: {
- getData() {
- getRecentArtByList(this.conditions).then((resp) => {
- const { code, msg, data } = resp
- if (code === 200) {
- this.dataList = data
- } else {
- this.$message.error(msg)
- }
- }).catch((error) => {
- console.log(error)
- })
- },
- showMoreArt(data, title) {
- let path = '/hos/news/index'
- if (this.more) {
- path = this.more
- }
- this.$router.push({
- path
- })
- },
- showDetail(item) {
- const { artId } = item
- this.$refs.ArtDetail.showModel(artId)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .ArtPanel-group-box {
- width: calc(100% - 15px);
- border-top: 4px solid #1F3C51;
- background-color: #0C3242;
- border-radius: 5px 5px 0 0;
- padding: 15px;
- .group-title {
- font-size: 16px;
- color: #FFF;
- margin-bottom: 15px;
- font-weight: bold;
- .el-link {
- float: right;
- font-size: 14px;
- color: #C1C6C8;
- -webkit-text-fill-color: #C1C6C8;
- }
- }
- .group-content{
- height: 80%;
- overflow: auto;
- }
- .art_list_block{
- margin-top: 20px;
- .item{
- display: flex;
- justify-content: flex-start;
- line-height: 1;
- margin-bottom: 15px;
- position: relative;
- cursor: pointer;
- .info{
- width: 100%;
- .lf{
- float: left;
- }
- .rt{
- margin-top: 20px;
- .el-tag-time{
- text-align: left;
- float: left;
- }
- .el-tag-art{
- float: right;
- text-align: right;
- .custom-tag{
- color:#fff;
- border-color:#eaeaea;
- background-color:transparent;
- &.tag-1{color: #b97741;border-color:#b97741;}
- &.tag-2{color: #97cd38;border-color:#97cd38;}
- &.tag-3{color: #dc5a2c;border-color:#dc5a2c;}
- &.tag-4{color: #414ab9;border-color:#414ab9;}
- &.tag-5{color: #c13ac9;border-color:#c13ac9;}
- &.tag-6{color: #29c761;border-color:#29c761;}
- }
- }
- }
- }
- .tag{
- height: 24px;
- display: inline-block;
- position: absolute;
- right: 0;
- top: 0;
- padding: 0px 4px;
- line-height: 24px;
- font-size: 12px;
- color: #fff;
- border-radius: 4px;
- box-sizing: border-box;
- white-space: nowrap;
- border: 1px solid #d9d0c8;
- &.none{
- background-color: transparent;
- border-color: transparent;
- }
- }
- p,h4{
- margin: 0;
- font-size: 14px;
- }
- p{
- padding-top: 6px;
- font-size: 8px;
- color: #f5f5f5;
- }
- h4{
- .status{
- font-size: 12px;
- }
- }
- .custom-tag{
- color:#fff;
- border-color:#eaeaea;
- background-color:transparent;
- &.tag-2{color: #b97741;border-color:#b97741;}
- &.tag-3{color: #97cd38;border-color:#97cd38;}
- &.tag-4{color: #dc5a2c;border-color:#dc5a2c;}
- &.tag-5{color: #414ab9;border-color:#414ab9;}
- &.tag-6{color: #c13ac9;border-color:#c13ac9;}
- &.tag-7{color: #29c761;border-color:#29c761;}
- }
- .icon{
- width: 45px;
- height: 45px;
- font-size: 26px;
- }
- }
- }
- }
- </style>
|