168 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
			
		
		
	
	
			168 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
 | 
						|
 | 
						|
<template>
 | 
						|
  <div class="system-title">
 | 
						|
    <div class="header-content">
 | 
						|
      <div class="time"><a-icon type="clock-circle" style="margin-right: 10px;" />{{ time }}</div>
 | 
						|
      <div class="tq">{{ tq }}</div>
 | 
						|
      <p class="_title" v-if="customTitle">{{ customTitle }}</p>
 | 
						|
      <p class="_title" v-else>{{ customTitle || title }}一体化平台</p>
 | 
						|
      <div class="back" v-if="showBack" @click="() => $router.go(-1)">返回</div>
 | 
						|
      <div class="btn-box">
 | 
						|
        <div class="btn" :key="btn.key" v-for="btn in btns" @click="$emit('click', btn)">
 | 
						|
          {{ btn.title }}
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import {mapState} from "vuex";
 | 
						|
import moment from "moment";
 | 
						|
export default {
 | 
						|
  name: "SystemTitle",
 | 
						|
  computed: {
 | 
						|
    ...mapState({
 | 
						|
      title: state => state.system.title,
 | 
						|
      info: state => state.system.info,
 | 
						|
    }),
 | 
						|
    tq () {
 | 
						|
      if (this.info) {
 | 
						|
        const weather = this.info?.weather || {}
 | 
						|
        return `${weather.location || ''}: ${weather.windDirection || ''};${weather.temperature || ''}℃`
 | 
						|
      }
 | 
						|
      return ''
 | 
						|
    }
 | 
						|
  },
 | 
						|
  props: {
 | 
						|
    customTitle: {
 | 
						|
      type: String,
 | 
						|
      default: ''
 | 
						|
    },
 | 
						|
    showBack: {
 | 
						|
      type: Boolean,
 | 
						|
      default: false
 | 
						|
    },
 | 
						|
    btns: {
 | 
						|
      type: Array,
 | 
						|
      default: () => []
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data () {
 | 
						|
    return {
 | 
						|
      time: moment().format('YYYY-MM-DD HH:mm:ss'),
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    setInterval(() => {
 | 
						|
      this.time = moment().format('YYYY-MM-DD HH:mm:ss')
 | 
						|
    }, 1000)
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
<style scoped lang="less">
 | 
						|
  .system-title {
 | 
						|
    width: 100%;
 | 
						|
    display: flex;
 | 
						|
    flex-flow: row;
 | 
						|
    justify-content: center;
 | 
						|
    background-size: 100% 100%;
 | 
						|
    pointer-events: auto;
 | 
						|
    z-index: 2;
 | 
						|
    .header-content {
 | 
						|
      width: 100%;
 | 
						|
      background: url("~/assets/images/new/标题.png") center top no-repeat;
 | 
						|
      background-size: 100% 100%;
 | 
						|
      height: 78px;
 | 
						|
      box-sizing: border-box;
 | 
						|
      padding-top: 5px;
 | 
						|
      position: relative;
 | 
						|
      .btn-box {
 | 
						|
        display: flex;
 | 
						|
        justify-content: center;
 | 
						|
        align-items: center;
 | 
						|
        margin-top: 20px;
 | 
						|
        position: absolute;
 | 
						|
        top: 30px;
 | 
						|
        left: 50%;
 | 
						|
        transform: translateX(-50%);
 | 
						|
        .btn {
 | 
						|
          height: 30px;
 | 
						|
          pointer-events: auto;
 | 
						|
          color: #fff;
 | 
						|
          padding: 5px 10px;
 | 
						|
          background-color: #1890ff;
 | 
						|
          cursor: pointer;
 | 
						|
          margin-left: 10px;
 | 
						|
          &:first-child {
 | 
						|
            margin-left: 0;
 | 
						|
          }
 | 
						|
        }
 | 
						|
      }
 | 
						|
 | 
						|
      .back {
 | 
						|
        position: absolute;
 | 
						|
        right: 10px;
 | 
						|
        top: 40px;
 | 
						|
        border-radius: 10px;
 | 
						|
        padding: 5px 20px;
 | 
						|
        color: #fff;
 | 
						|
        background-color: #1890ff;
 | 
						|
        cursor: pointer;
 | 
						|
      }
 | 
						|
      .time {
 | 
						|
        position: absolute;
 | 
						|
        left: 20px;
 | 
						|
        top: 5px;
 | 
						|
        /** 文本1 */
 | 
						|
        font-size: 20px;
 | 
						|
        font-weight: 400;
 | 
						|
        letter-spacing: 0px;
 | 
						|
        line-height: 23.44px;
 | 
						|
        color: rgba(255, 255, 255, 1);
 | 
						|
        text-align: left;
 | 
						|
        vertical-align: top;
 | 
						|
      }
 | 
						|
      .tq {
 | 
						|
        position: absolute;
 | 
						|
        right:  20px;
 | 
						|
        top: 5px;
 | 
						|
        /** 文本1 */
 | 
						|
        font-size: 20px;
 | 
						|
        font-weight: 400;
 | 
						|
        letter-spacing: 0px;
 | 
						|
        line-height: 23.44px;
 | 
						|
        color: rgba(255, 255, 255, 1);
 | 
						|
        text-align: left;
 | 
						|
        vertical-align: top;
 | 
						|
      }
 | 
						|
      ._title{
 | 
						|
        width: 100%;
 | 
						|
        font-family: AlimamaShuHeiTi-Bold;
 | 
						|
        font-size: 25px;
 | 
						|
        color: #D8F0FF;
 | 
						|
        letter-spacing: 7.68px;
 | 
						|
        text-align: center;
 | 
						|
        text-shadow: 0 0 11px #000000;
 | 
						|
        font-weight: 700;
 | 
						|
        margin: 0;
 | 
						|
        &.sub {
 | 
						|
          font-size: 18px;
 | 
						|
        }
 | 
						|
 | 
						|
      }
 | 
						|
      .subtitle {
 | 
						|
        width: 100%;
 | 
						|
        font-family: AlimamaShuHeiTi-Bold;
 | 
						|
        font-size: 16px;
 | 
						|
        color: #D8F0FF;
 | 
						|
        letter-spacing: 7.68px;
 | 
						|
        text-align: center;
 | 
						|
        text-shadow: 0 0 11px #000000;
 | 
						|
        font-weight: 700;
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
</style>
 |