vue3 数据可视化大屏边框组件-停车场监控看板

数据可视化大屏素材 yekong

边框由标题和主体两部分组成。背景采用背景色加角标定位,适应大部分宽高而不变形。

如果您需要设计属于自己的数据可视化大屏 请联系我们微信:17331886870

效果图

vue3 数据可视化大屏边框组件-停车场监控看板

效果演示

组件代码

组件包含了三部分:标题 主体 背景。

主体部分放了一个插槽,通过插槽将其他组件插入到当前组件中。

组件使用

<item8 title="item8停车时间"></item8>

组件代码

<template>
  <div class="pageItemBody">
    <div class="titleInfo">
      <img src="./assets/icon_zuojiantou.png" alt="">
      <span>{{ title }}</span>
      <img src="./assets/icon_youjiantou.png" alt="">
    </div>
    <div class="itemMain">
      <slot></slot>
    </div>
    <bg></bg>
  </div>
</template>

<script>
import bg from './bg.vue'

export default {
  name: "title",
  data() {
    return {}
  },
  components: {
    bg
  },
  props: {
    title: {
      type: String,
      default() {
        return '标题';
      }
    },
  },
  watch: {},
  mounted() {
    var that = this;
  },
}
</script>

<style lang="scss" scoped>
.pageItemBody {
  width: 100%;
  position: relative;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: nowrap;
  flex-direction: column;
  z-index: 1;
  align-content: flex-start;

  .titleInfo {
    font-size: 16px;
    font-family: PingFang;
    font-weight: bold;
    color: #FFFFFF;
    display: flex;
    height: 50px;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;

    span {
      font-family: PangMenZhengDao;
      padding-left: 20px;
      padding-right: 20px;
      font-size: 24px;
    }
  }
}

.itemMain {
  position: relative;
  width: 100%;
  height: calc(100% - 50px);
}
</style>

背景组件

背景图因为有一些装饰的地方不能够无限拉伸宽高,为了能够在不同宽高的区域使用,这里做了类似九宫格的处理。

/**
* @Author: 858834013@qq.com
* @Name: gridView
* @Date: 2023年05月15日21:39:52
* @Desc: 仿安卓.9图九宫格效果
*/
<template>
  <div class="gridView">
    <!--  左上角-->
    <div class="gLeftTop"></div>
    <!--  顶部中间-->
    <div class="gTopCenter"></div>
    <!--  右上角-->
    <div class="gRightTop"></div>
    <!--    中间部分-->
    <div class="gCenterMain">
      <!--  左侧中间-->
      <div class="gLeftCenter"></div>
      <!--  右侧中间-->
      <div class="gRightCenter"></div>
      <!--  中间-->
      <div class="gCenter"></div>
    </div>
    <!--  左下角-->
    <div class="gLeftBottom"></div>
    <!--  底部中间-->
    <div class="gBottomCenter"></div>
    <!--  右下角-->
    <div class="gRightBottom"></div>
  </div>
</template>

<script>

export default {
  name: "gridView"
}
</script>

<style lang="scss" scoped>
.gridView {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 80px;
  min-width: 250px;
  bottom: 0;
  right: 0;
  z-index: -1;
  pointer-events: none; //避免div层被点击
  //左上角
  .gLeftTop {
    background: url("./assets/left_top.png") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    left: 0;
    width: 36PX;
    height: 36PX;
  }

  //顶部中间
  .gTopCenter {
    width: calc(100% - 36PX - 36PX);
    left: 36PX;
    position: absolute;
    height: 3PX;
    background: url("./assets/top.png") repeat-x;
    background-size: 100% 100%;
  }

  //右上角
  .gRightTop {
    background: url("./assets/right_top.png") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    right: 0;
    top: 0;
    width: 36PX;
    height: 36PX;
  }

  //左下角
  .gLeftBottom {
    background: url("./assets/left_bottom.png") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36PX;
    height: 36PX;
  }

  //底部中间
  .gBottomCenter {
    width: calc(100% - 36PX - 36PX);
    left: 36PX;
    bottom: 0;
    position: absolute;
    height: 3PX;
    background: url("./assets/bottom.png") repeat-x;
    background-size: 100% 100%;
  }

  //右下角
  .gRightBottom {
    background: url("./assets/right_bottom.png") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36PX;
    height: 36PX;
  }

  //中间部分
  .gCenterMain {
    width: 100%;
    height: calc(100% - 36PX - 36PX);
    position: absolute;
    top: 36PX;
    bottom: 36PX;
    //左侧中间
    .gLeftCenter {
      left: 0;
      height: 100%;
      position: absolute;
      background: url("./assets/left_center.png") repeat-y;
      background-size: 100%;
      width: 3PX;
    }

    .gCenter {
      width: calc(100% - 40PX - 50PX);
      left: 40PX;
      bottom: 0;
      position: absolute;
      height: 100%;
    }

    //右侧中间
    .gRightCenter {
      height: 100%;
      position: absolute;
      right: 0;
      background: url("./assets/right_center.png");
      background-size: 100% 100%;
      width: 1PX;
    }
  }
}
</style>

更多边框组件

vue3 数据可视化大屏边框效果整理

项目应用

vue2 数据可视化大屏 停车场监控看板大屏

喜欢