扩展任务1:完成页面的布局设计和美化

任务指导

1、参照下图,完成页面的布局和美化设计:

2、实现思路

例如可以通过修改Style样式的方式完成布局调整,具体页面显示样式,需要学生根据自己的喜好和设计自行完成,建议每个学生的页面尽量个性化设计,不要重复。

任务实现

1、下面是一个简单的布局样式的示例,仅供参考:

  • 打开前端的gongguan_web项目,修改src/views/Home/Index.vue文件
  • 首先,在Style中定义样式类,添加 .selectWarning和 .selectSection 两个样式类

  • 然后,在template中引用 .selectWarning和 .selectSection 两个样式类,并调整布局

  • src/views/Home/Index.vue的完整代码如下:
<template>
  <div class="index">
      <el-row :gutter="30" v-show="isShow('/flight/airline')">
      <el-col :span=24 align="center">
        <AirLine/>
      </el-col>
    </el-row> 
    <el-row :gutter="30"  v-show="isShow('/flight/section')" class="selectSection">
      <el-col :span="24" align="center">
        <Section/>
      </el-col>
    </el-row>
    <el-row :gutter="30" v-show="isShow('/flight/delay')">
      <el-col :span="16" align="center">
        <Delay/>
      </el-col>
      <el-col :span="8" align="center">
        <YearWarningChart/>
      </el-col>
    </el-row>
    <el-row :gutter="30" v-show="isShow('/section/warning')" class="selectWarning">
      <el-col :span="6" align="center">
        <AirPortCountChart/>
      </el-col>
      <el-col :span="6" :offset="12" align="center">
        <WarnStatistice/>
      </el-col>
    </el-row>
    <el-row :gutter="30" v-show="isShow('/section/detail')">
      <el-col :span="16" align="center">
        <SectorFlightChart/>
      </el-col>
      <el-col :span="8" align="center">
        <SectorCallChart/>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import AirLine from "../../components/AirLine";
  import Section from "../../components/Section";
  import Delay from "../../components/Delay";
  import WarnStatistice from "../../components/WarnStatistice";
  import SectorFlightChart from "../../components/echart/SectorFlightChart";
  import SectorCallChart from "../../components/echart/SectorCallChart";
  import YearWarningChart from "../../components/echart/YearWarningChart";
  import AirPortCountChart from "../../components/echart/AirPortCountChart";
   
  import {hasPermission} from "../../utils/permission";
  export default {
    data() {
      return {
      };
    },
    mounted() {
    },
    components: {AirLine,Section,Delay,WarnStatistice,SectorFlightChart,SectorCallChart,YearWarningChart,AirPortCountChart},
    methods: {
      isShow(permission){
        return hasPermission(permission);   
      }
    }
  };
</script>

<style scoped>
  .index {
    height: 100%;
    overflow: auto;
    padding-left: 44px;
    padding-right: 44px;
    position: relative;
  }
  .index::-webkit-scrollbar {
    display: none;
  }
  .selectWarning{
    position: absolute;
    width:100%;
    height: 100%;
    top:150px;
    left:0;
  }
  .selectSection{
    position: absolute;
    width:100%;
    height: 100%;
    top:0;
    left:0;
  }
  .caseClass {
    background: url('../../assets/images/index-bg.png') no-repeat;
    background-size: cover;
    margin-top: 20px;
    height: 284px;
  }

  .el-button {
    background: transparent;
  }
</style>
  • 页面的显示效果如下:

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-09 20:32:05       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-09 20:32:05       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-09 20:32:05       57 阅读
  4. Python语言-面向对象

    2024-07-09 20:32:05       68 阅读

热门阅读

  1. 构建自己的docker基础镜像

    2024-07-09 20:32:05       22 阅读
  2. 每天10个vue面试题(一)

    2024-07-09 20:32:05       23 阅读
  3. Vue3框架搭建:vue+vite+pina+typescript

    2024-07-09 20:32:05       21 阅读
  4. R 绘图 - 饼图

    2024-07-09 20:32:05       51 阅读
  5. Spring Boot与Jenkins的集成

    2024-07-09 20:32:05       27 阅读
  6. AWS CloudWatch 权限管理指南

    2024-07-09 20:32:05       25 阅读
  7. PLSQL Day5

    2024-07-09 20:32:05       27 阅读
  8. 使用nodejs输出著作权申请所需的word版源码

    2024-07-09 20:32:05       25 阅读