<template>
  <div class="main">
        <Header/>
        <div class="main_t">
            <div class="main_t_t">
                <i class="main_t_t_l">当前位置：首页 &gt;</i>
                <i>工作通知</i>
            </div>
            <div class="title">{{title}}</div>
            <div class="main_t_b">
                <p v-html="content"></p>
                <div class="unit">{{company}}</div>
                <div class="time">{{createTime.substring(0,10)}}</div>
            </div>
        </div>
    </div>
</template>

<script>
import {notifyplan, onlineByBigView} from "../api/http"

import $ from 'jquery'
import * as echarts from 'echarts'
import Header from '@/components/header.vue'
export default {
  components: {
    Header
  },
  data() {
    return {
      title:'',
      company:'',
      content:'',
      createTime:'',
      codeData:'',

    }
  },
  methods: {
    back(){
      this.$router.push('/')
    },
    getAjaxData: function () {
      let _this = this;

      //工作通知
      notifyplan(_this.codeData).then((res) =>{
        let  percent2percent25 = (URI) => {
          if(URI.indexOf('%') > -1) {
            return URI.replace(/%/g,'%25')
          }else{
            return URI;
          }
        }

        if (res.code == 200) {
          let data=res.data;
          let aa=percent2percent25(data.content)
          _this.title=data.title
          _this.company=data.company
          _this.content=unescape(data.content)
          console.log(typeof ( _this.content))
          _this.createTime=data.createTime



        }
      })
    },



  },
  mounted() {
    this.codeData=this.$route.query.key
    console.log(this.codeData)
    this.getAjaxData();
  },


}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>

@function rw($px){

  @return $px*100/1920 *1vw;
}
@function rh($px){

  @return $px*100/1080 *1vh;
}
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
.main {
  width: rw(1920);
  height: rh(1080);
  /* background: url("../img/index_bg.png") no-repeat;
   background-size: 100% 100%;*/
  position: relative;
  left: 0;
  top: 0;
  z-index: 50;
  background: #062338;
  .header {
    width: 100%;
    position: absolute;
    left: rw(0);
    top: rh(0);
    z-index: 100;
    display: flex;
    justify-content: flex-start;

    .header_l {
      width: rw(182);
      height: rh(44);
      margin: rh(10) 0 0 rw(40);
    }
    .header_c {
      width: rw(1180);
      height: rh(152);
      margin-left: rw(136);
      background: url("~@/assets/image/index_icon2.png") no-repeat;
      background-size: 100% 100%;
      font-size: rh(30);
      font-family: Microsoft YaHei;
      font-weight: bold;
      color: #FFFFFF;
      line-height: rh(30);
      text-align: center;
      padding-top: rh(26);
    }
    .header_r {
      margin-left: rw(264);
      width: rw(82);
      height: rh(32);
      margin-top: rh(18);
    }
  }
  .main_t{

    width: rw(1852);
    height: rh(975);
    background: #062338;
    position: absolute;
    left: rw(34);
    top: rh(86);
    z-index: 200;
    .main_t_t{
      margin: rh(20) 0 0 rw(18);
      >i{
        font-size: rh(16);
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: #FFFFFF;
        line-height: rh(16);
      }
      >i:nth-of-type(1){

      }
      >i:nth-of-type(2){
        color: #1ED0F8;
      }
    }
    .title{
      width: 100%;
      font-size: rh(18);
      font-family: Source Han Sans CN;
      font-weight: bold;
      color: #FFFFFF;
      line-height: rh(18);
      margin-top: rh(44);
      text-align: center;
    }
    .main_t_b{
      width: rw(1852);
      height: rh(800);
      margin-top: rh(40);
      padding:0 rw(390);
      box-sizing: border-box;
      overflow-y: auto;
      >p{
        font-size: rh(16);
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #FFFFFF;
        line-height:rh(30);
        text-indent:2em;
      }
      .unit{
        font-size: rh(16);
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #FFFFFF;
        line-height: rh(16);
        margin-top: rh(38);
        text-align: right;
      }
      .time{
        font-size: rh(16);
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #FFFFFF;
        line-height: rh(16);
        margin-top: rh(22);
        text-align: right;
      }
    }
  }

}
</style>
<style lang="scss">
li{list-style:none}
i,em,b{font-style:normal;font-weight:100;}
body{margin: 0}
</style>
