明梦爽
2022-08-10 27d35a9f1355e4a56aa1e8c1aad9c7f58002ed50
src/views/work.vue
@@ -1,47 +1,64 @@
<template>
  <div>
    <el-row type="flex" justify="space-between" class="underline">
      <span>工作动态</span>
    <el-row type="flex" justify="space-between" class="underline row-bg">
      <span class="color"><b>工作动态</b></span>
      <span @click="goMore('工作状态')" class="liPointer">更多<i class="el-icon-d-arrow-right"></i> </span>
    </el-row>
    <div>
    <div style="max-height:420px;overflow:hidden;">
      <ul>
        <li :key="index" v-for="(item, index) in workList" class="liPointer">
          <div @click="toWorkMsg(item.title)"> {{ item.title }} </div>
          <div @click="toWorkMsg(item.id)" class="bgc mart10">
            {{ item.title }}
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import { getNewsList } from '../api/api'
export default {
  name:'work',
  data(){
    return{
      workList: [
        { id:'1', title: '工作状态1' },
        { id:'2', title: '工作状态2' },
        { id:'3', title: '工作状态3' },
        { id:'4', title: '工作状态4' },
        { id:'5', title: '工作状态5' },
        { id:'6', title: '工作状态6' },
      ]
  name: 'work',
  data() {
    return {
      workList: []
    }
  },
  methods:{
    toWorkMsg(t) {
  created() {
    this.getnews()
  },
  methods: {
    //获取新闻列表
    getnews() {
      const data = {
        current: 1,
        newsCategoryId: 43,
        size: 6
      }
      getNewsList(data)
        .then(res => {
          console.log(res)
          if (res.code == 200) {
            this.workList = res.data.records
          }
        })
        .catch(error => {
          console.log(error)
        })
    },
    toWorkMsg(id) {
      this.$router.push({
        path:'/home/workMessage',
        path: '/home/news',
        query: {
          title:t
          id: id
        }
      })
    },
    goMore(val) {
      this.$router.push({
        path:'moreMessage',
        query:{
          type:val,
        path: 'moreMessage',
        query: {
          type: val
        }
      })
    }
@@ -50,7 +67,7 @@
</script>
<style lang="less" scoped>
.underline {
  border-bottom: 1px solid rgb(0, 110, 215);
  border-bottom: 1px solid rgb(1, 72, 153);
}
ul {
  padding-left: 0;
@@ -63,4 +80,9 @@
a {
  text-decoration: none;
}
</style>
.bgc {
  background: rgb(241, 241, 241);
  height: 55px;
  line-height: 55px;
}
</style>