项目平台之项目首页编码设计(五)

在这里插入图片描述


一、页面成果图展示

在这里插入图片描述
在这里插入图片描述

二、滚动条组件的使用

当内容超过屏幕高度时自动产生滚动条

<template>
<!-- 当内容超过屏幕高度时自动产生滚动条 -->
  <el-scrollbar>
	...
	...
	... 
  </el-scrollbar>
</template>

三、页面设计

1、需要4个盒子

在这里插入图片描述

在这里插入图片描述

2、项目名称样式设计

<!-- 项目名称 -->
<!-- 通过proinfo和pro中都可以获取项目的信息 -->
<div class="pro_title">{{pro.name}}</div>
/* 项目标题样式 */
	.pro_title{
		height: 50px;  行高
		background: #ececeb;  背景
		text-align: center;   居中
		font: bold 28px/50px '微软雅黑';  字体加粗、大小/行高、字体
		color: rgb(21, 192, 135);
	}

3、对基本信息、bug统计、执行记录进行样式设计

/* 小标题样式 */
	.title{
		/* 加粗 */
		font-weight: bold;
		line-height: 40px;
		color: #363636;
	}

4、基本信息

element-plus中描述列表使用
在这里插入图片描述

element-plus中卡片组件使用
在这里插入图片描述

从后端接口的返回值可以看到,前端不必要定义所有的字段
在这里插入图片描述
描述列表中label指定描述列表的名字,后面的值对应接口返回的值
在这里插入图片描述
通过v-for实现

<div class="title">【基本信息】</div>
	<el-card body-style="padding:0">
		<el-descriptions border column="4">
		<el-descriptions-item label="创建人">{{pro.leader}}</el-descriptions-item>
		<el-descriptions-item label="创建时间">{{pro.create_time}}</el-descriptions-item>
		<el-descriptions-item v-for='(item,index) in proinfo.info' :key="index" :label="item.name">{{item.value}}</el-descriptions-item>
  		</el-descriptions>
	</el-card>

结果展示
在这里插入图片描述

element-plus中layout布局的使用
在这里插入图片描述

<div class="title">【基本信息】</div>
	<el-card body-style="padding:0">
		<el-descriptions border column="4">
		<el-descriptions-item label="创建人">{{pro.leader}}</el-descriptions-item>
		<el-descriptions-item label="创建时间">{{pro.create_time}}</el-descriptions-item>
		<el-descriptions-item v-for='(item,index) in proinfo.info' :key="index" :label="item.name">{{item.value}}</el-descriptions-item>
  		</el-descriptions>

		<el-row :gutter="20">
			<el-col :span="4" v-for="(item,index) in proinfo.info" :key="index">
				<div class="info_chart">
					<el-progress type="dashboard" :percentage="100" color="#00aa7f">
						<template #default>
							<span class="percentage-value">
								<b style="color:#00aa7f">{{item.value}}</b>
								<span></span>
							</span>
							<span class="percentage-label">{{item.name}}</span>
						</template>
					</el-progress>
				</div>
			</el-col>
			<el-col :span="4"><div class="info_chart" /></el-col>
			
		</el-row>

在这里插入图片描述

5、bug统计

<div class="title">【bug统计】</div>
	<el-card body-style="padding:0">
		<el-descriptions border column="4">
		<el-descriptions-item v-for='(item,index) in proinfo.bugs' :key="index" :label="item.name">{{item.value}}</el-descriptions-item>
  		</el-descriptions>
	</el-card>

在这里插入图片描述

<div class="title">【bug统计】</div>
	<el-card body-style="padding:0">
		<el-descriptions border column="4">
		<el-descriptions-item v-for='(item,index) in proinfo.bugs' :key="index" :label="item.name">{{item.value}}</el-descriptions-item>
  		</el-descriptions>

		<el-row :gutter="20">
			<el-col :span="6" v-for="(item,index) in proinfo.bugs" :key="index">
				<div class="info_chart">
					<el-progress type="circle" :percentage="100" color="#87CEFA">
						<template #default>
							<span class="percentage-value">
								<b style="color:#00aa7f">{{item.value}}</b>
								<span></span>
							</span>
							<span class="percentage-label">{{item.name}}</span>
						</template>
					</el-progress>
				</div>
			</el-col>
			<el-col :span="4"><div class="info_chart" /></el-col>
			
		</el-row>
	</el-card>

在这里插入图片描述

<style scpped>
	/* 项目标题样式 */
	.pro_title{
		height: 50px;
		background: #ececeb;
		text-align: center;
		font: bold 28px/50px '微软雅黑';
		color: rgb(21, 192, 135);
	}
	/* 小标题样式 */
	.title{
		/* 加粗 */
		font-weight: bold;
		line-height: 40px;
		color: #363636;
	}
	/* 图表的样式 */
	.info_chart{
		background: rgb(255, 255, 255);
		/* height: 150px; */
		margin: 5px;
		text-align: center;
		padding: 10px,0px;
	}

	.percentage-value {
		display: block;
		margin-top: 10px;
		font-size: 20px;
		}
		.percentage-label {
		display: block;
		margin-top: 10px;
		font-size: 12px;
	}
</style>

四、echarts使用

1、安装

在这里插入图片描述

2、折线图的使用

// 编写图表工具函数
import * as echarts from 'echarts';
import { useFormLabelWidth } from 'element-plus/es/components/form/src/utils';

export default{
    // 折线图
    chart1(ele,label,datas){
        // ele:渲染图标的元素(盒子)
        // label:x轴的刻度文字
        // datas:数据
        // 初始化一个图表对象
        const myChart = echarts.init(ele);
        const option={
            // 编写图标的配置
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: label
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                data: datas,
                type: 'line',
                areaStyle: {}
                }
            ]
        };
        // 渲染图表
        option && myChart.setOption(option);

    },

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

敲代码敲到头发茂密

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值