提交 10c1c0ac 编写于 作者: guangjun.yang's avatar guangjun.yang

部分组件完成

上级 08843882
<!-- 饼图 --> <!-- 饼图 -->
<template> <template>
<section class="chart-pie"> <section class="chart-pie">
<div id="chartColumnId" :style="{width: '100%', height: '320px'}"></div> <div :id="id" :style="{width: '100%', height: '320px'}"></div>
</section> </section>
</template> </template>
<script> <script>
...@@ -9,28 +9,24 @@ import { format } from "path"; ...@@ -9,28 +9,24 @@ import { format } from "path";
let vm = null; let vm = null;
export default { export default {
props: { props: {
pieData: { id: {
type: Array, type: String,
default: () => [ default: "chartlineId"
{ value: 335, name: "优秀证书" }, },
{ value: 310, name: "及格证书" },
{ value: 234, name: "未获证" }
]
}
}, },
data() { data() {
return {}; return {};
}, },
mounted() { mounted() {
vm = this; vm = this;
this.drawPie(); this.drawColumn();
}, },
methods: { methods: {
// 画 // 画
drawPie() { drawColumn() {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
let chartColumn = this.$echarts.init( let chartColumn = this.$echarts.init(
document.getElementById("chartColumnId") document.getElementById(this.id)
); );
// 绘制图表 // 绘制图表
let options = { let options = {
...@@ -147,13 +143,6 @@ export default { ...@@ -147,13 +143,6 @@ export default {
] ]
}; };
chartColumn.setOption(options); chartColumn.setOption(options);
},
fmtLengend(name) {
console.log(name);
let item = this.pieData.find(item => {
return item.name === name;
});
return (item && item.value) || "";
} }
} }
}; };
......
...@@ -19,11 +19,11 @@ import ProcessBar from "@/components/common/pica-process"; ...@@ -19,11 +19,11 @@ import ProcessBar from "@/components/common/pica-process";
export default { export default {
props: { props: {
maxDuration: { maxDuration: {
type: Number, type: Number | String,
default: 100 default: 100
}, },
avgDuration: { avgDuration: {
type: Number, type: Number | String,
default: 100 default: 100
} }
}, },
......
<!-- Tabs组件 -->
<template>
<div class="common-card" :class="{'bg': needBG}">
<ul v-for="(item, index) in cardList" :key="index">
<li :class="{'bgf': needBG}">{{item.count}}{{item.unitName}}</li>
<li :class="{'bgf': needBG}">{{item.description}}</li>
</ul>
</div>
</template>
<script>
export default {
props: {
cardList: {
type: Array,
default: () => [
{
count: 5,
unitName: "门",
description: "正式考试数"
},
{
count: 5,
unitName: "门",
description: "模拟考试数"
},
{
count: 60,
unitName: "道",
description: "所有考题数"
}
]
},
needBG: {
type: Boolean,
default: false
}
},
methods: {}
};
</script>
<style lang="scss" scoped>
.common-card {
display: flex;
margin: 30px 15px;
&.bg {
margin: 20px 15px;
padding: 30px 15px;
background: linear-gradient(
180deg,
rgba(6, 190, 182, 1) 0%,
rgba(72, 177, 191, 1) 100%
);
box-shadow: 0px 3px 10px 0px rgba(56, 179, 157, 0.3);
border-radius: 6px;
}
ul {
flex: 1;
height: 50px;
line-height: 50px;
text-align: center;
li:nth-child(1) {
height: 24px;
line-height: 24px;
font-size: 24px;
font-weight: 700;
&.bgf {
color: #fff !important;
}
color: #373839;
margin-bottom: 12px;
}
li:nth-child(2) {
height: 14px;
line-height: 14px;
font-size: 14px;
font-weight: 400;
color: #676869;
&.bgf {
color: rgba(255, 255, 255, 0.8) !important;
}
}
}
}
</style>
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
<span class="over"></span> <span class="over"></span>
<span class="border"></span> <span class="border"></span>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
cIndex: 0 cIndex: 4
}; };
}, },
props: { props: {
...@@ -29,7 +28,7 @@ export default { ...@@ -29,7 +28,7 @@ export default {
"人群分析", "人群分析",
"课程分析", "课程分析",
"考试分析", "考试分析",
"考试分析" "学习效果分析"
] ]
} }
}, },
...@@ -52,30 +51,7 @@ export default { ...@@ -52,30 +51,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
.over { .common-tabs {
display: block;
position: absolute;
bottom: 0px;
left: 0;
width: 100%;
height: 6px;
z-index: 2;
background: #fff;
// border-bottom: 1px solid red;
}
.border {
display: block;
width: 100%;
height: 1px;
bottom: -3px;
left: 0;
// padding-top: 6px;
border-bottom: 1px solid #F0F1F2;
position: absolute;
z-index: 2;
}
}
.common-tabs {
white-space: nowrap; white-space: nowrap;
overflow-x: auto; overflow-x: auto;
// height: 30px; // height: 30px;
...@@ -98,8 +74,30 @@ export default { ...@@ -98,8 +74,30 @@ export default {
color: #449284; color: #449284;
background: #e3efed; background: #e3efed;
} }
} }
margin-top: 0; margin-top: 0;
}
.over {
display: block;
position: absolute;
bottom: 0px;
left: 0;
width: 100%;
height: 6px;
z-index: 2;
background: #fff;
// border-bottom: 1px solid red;
}
.border {
display: block;
width: 100%;
height: 1px;
bottom: -3px;
left: 0;
// padding-top: 6px;
border-bottom: 1px solid #f0f1f2;
position: absolute;
z-index: 2;
}
} }
</style> </style>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
export default { export default {
props: { props: {
maxValue: { maxValue: {
type: Number, type: Number | String,
default: 100 default: 100
}, },
value: { value: {
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
default: 100 default: 100
}, },
valueDescWidth: { valueDescWidth: {
type: Number, type: Number | String,
default: 120 default: 120
}, },
barColor: { barColor: {
......
<template> <template>
<div class="container"> <section class="container">
<CommonHeader></CommonHeader> <CommonHeader></CommonHeader>
<CommonAreaSelect @areaClick="areaTabClick" @orgClick="orgTabClick"></CommonAreaSelect> <CommonAreaSelect @areaClick="areaTabClick" @orgClick="orgTabClick"></CommonAreaSelect>
<CommonTaps @tabClicked="tabClicked"></CommonTaps> <CommonTaps @tabClicked="tabClicked"></CommonTaps>
<section v-if="cIndex === 2"> <!-- 总体概况 -->
<article v-if="cIndex === 0">
<CommonSwiperItem></CommonSwiperItem> <CommonSwiperItem></CommonSwiperItem>
<CommonTitle title="证书分布情况"></CommonTitle> <CommonTitle title="证书分布情况"></CommonTitle>
<ChartPie></ChartPie> <ChartPie></ChartPie>
...@@ -18,36 +19,58 @@ ...@@ -18,36 +19,58 @@
<CommonTitle title="完成天数排名"></CommonTitle> <CommonTitle title="完成天数排名"></CommonTitle>
<RankingItemDays></RankingItemDays> <RankingItemDays></RankingItemDays>
<ShowAll></ShowAll> <ShowAll></ShowAll>
<!-- <CommonSplitLine></CommonSplitLine> -->
<CommonBottomInfo></CommonBottomInfo> <CommonBottomInfo></CommonBottomInfo>
</section> </article>
<section v-if="cIndex === 1">
<CommonTitle title="证书分布情况"></CommonTitle> <!-- 人群分析 -->
<article v-if="cIndex === 1">
<CommonTitle title="人员学历情况"></CommonTitle>
<ChartPie></ChartPie> <ChartPie></ChartPie>
<CommonSplitLine></CommonSplitLine> <CommonSplitLine></CommonSplitLine>
<CommonTitle title="证书分布情况"></CommonTitle> <CommonTitle title="人员职称情况"></CommonTitle>
<ChartPie id="ssss"></ChartPie> <ChartPie id="ssss"></ChartPie>
</section> </article>
<section v-if="cIndex === 0" style="padding-top: 4px;"> <!-- 课程分析 -->
<!-- <ProcessBar></ProcessBar> <article v-if="cIndex === 2" style="padding-top: 8px;">
<ProcessBar barColor="#FFB01A" value="80"></ProcessBar> --> <CourseTimes maxDuration="27" avgDuration="16"></CourseTimes>
<CourseTimes maxDuration="200"></CourseTimes>
<CommonSplitLine></CommonSplitLine> <CommonSplitLine></CommonSplitLine>
<CommonTitle title="课程列表"></CommonTitle> <CommonTitle title="课程列表"></CommonTitle>
<RankingItemDays></RankingItemDays> <RankingItemDays></RankingItemDays>
<CommonBottomInfo></CommonBottomInfo> <CommonBottomInfo></CommonBottomInfo>
</section> </article>
<!-- 考试分析 -->
<article v-if="cIndex === 3" style="padding-top: 4px;">
<CommonCard></CommonCard>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="完成项目考试次数情况"></CommonTitle>
<ChartColumnVertical id="chartCourseTimesId" :colors="colors"></ChartColumnVertical>
<CommonTitle title="完成项目考试分数情况"></CommonTitle>
<ChartColumnVertical id="chartCourseScoreId"></ChartColumnVertical>
<CommonTitle title="考试列表"></CommonTitle>
<RankingItemDays></RankingItemDays>
<CommonBottomInfo></CommonBottomInfo>
</article>
<!-- 学习效果分析 -->
<article v-if="cIndex === 4" style="padding-top: 4px;">
<CommonCard :needBG="needBG" :cardList="cardList"></CommonCard>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="不同学历完成项目前后正确率对比"></CommonTitle>
<ChartColumnVertical id="chartCourseTimesId" :colors="colors"></ChartColumnVertical>
<CommonTitle title="培训前后知识点掌握情况"></CommonTitle>
<ChartColumnVertical id="chartCourseScoreId"></ChartColumnVertical>
<CommonBottomInfo></CommonBottomInfo>
</article>
<PicaArea v-show="isShowArea" @confirm="areaConfirm" @cancel="areaCancel"></PicaArea> <PicaArea v-show="isShowArea" @confirm="areaConfirm" @cancel="areaCancel"></PicaArea>
<PicaOrg v-show="isShowOrg" @confirm="orgConfirm" @cancel="orgCancel"></PicaOrg> <PicaOrg v-show="isShowOrg" @confirm="orgConfirm" @cancel="orgCancel"></PicaOrg>
<CommonLoading v-show="false"></CommonLoading> <CommonLoading v-show="false"></CommonLoading>
</div> </section>
</template> </template>
<script> <script>
// import VePie from "v-charts/lib/pie";
// import VeLine from "v-charts/lib/line";
import CommonHeader from "@/components/common/common-header"; import CommonHeader from "@/components/common/common-header";
import CommonTitle from "@/components/common/common-title"; import CommonTitle from "@/components/common/common-title";
import CommonLoading from "@/components/common/common-loading"; import CommonLoading from "@/components/common/common-loading";
...@@ -60,18 +83,18 @@ import CommonBottomInfo from "@/components/common/common-bottom-info"; ...@@ -60,18 +83,18 @@ import CommonBottomInfo from "@/components/common/common-bottom-info";
import RankingItemDays from "@/components/bussiness/ranking-item-days"; import RankingItemDays from "@/components/bussiness/ranking-item-days";
import ChartPie from "@/components/bussiness/charts/chart-pie"; import ChartPie from "@/components/bussiness/charts/chart-pie";
import ChartColumn from "@/components/bussiness/charts/chart-column"; import ChartColumn from "@/components/bussiness/charts/chart-column";
import ChartColumnVertical from "@/components/bussiness/charts/chart-column-vertical";
import PicaArea from "@/components/common/pica-area"; import PicaArea from "@/components/common/pica-area";
import PicaOrg from "@/components/common/pica-org"; import PicaOrg from "@/components/common/pica-org";
import CommonAreaSelect from "@/components/common/common-area-select"; import CommonAreaSelect from "@/components/common/common-area-select";
import ProcessBar from "@/components/common/pica-process" import ProcessBar from "@/components/common/pica-process";
import CourseTimes from "@/components/bussiness/course-times" import CourseTimes from "@/components/bussiness/course-times";
import CommonCard from "@/components/common/common-card";
export default { export default {
components: { components: {
CommonHeader, CommonHeader,
CommonTitle, CommonTitle,
// VePie,
// VeLine,
CommonLoading, CommonLoading,
CommonTaps, CommonTaps,
CommonSwiperItem, CommonSwiperItem,
...@@ -86,7 +109,9 @@ export default { ...@@ -86,7 +109,9 @@ export default {
PicaOrg, PicaOrg,
CommonAreaSelect, CommonAreaSelect,
ProcessBar, ProcessBar,
CourseTimes CourseTimes,
CommonCard,
ChartColumnVertical
}, },
data() { data() {
return { return {
...@@ -117,7 +142,21 @@ export default { ...@@ -117,7 +142,21 @@ export default {
}, },
isShowArea: false, isShowArea: false,
isShowOrg: false, isShowOrg: false,
cIndex: 0 cIndex: 4,
colors: ["#39AF9A", "#FF9A4B", "#abb7bb", "#76d2d2"],
needBG: true,
cardList: [
{
count: 65,
unitName: "%",
description: "培训前正确率"
},
{
count: 80,
unitName: "%",
description: "培训后正确率"
}
]
}; };
}, },
async asyncData() { async asyncData() {
...@@ -131,7 +170,7 @@ export default { ...@@ -131,7 +170,7 @@ export default {
}, },
methods: { methods: {
tabClicked(index) { tabClicked(index) {
this.cIndex = index this.cIndex = index;
}, },
areaConfirm(selData) { areaConfirm(selData) {
console.log(selData); console.log(selData);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册