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

删除之前的代码

上级 7627ae0d
此差异已折叠。
<template>
<div class="export-download">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="p-title">任务列表</div>
<el-tabs v-model="listType" type="card" @tab-click="handleClick">
<el-tab-pane label="查看报告" name="2"></el-tab-pane>
<el-tab-pane label="导出列表" name="1"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" class="table-export" style="width: 100%">
<el-table-column
prop="title"
label="名称"
align="center"
min-width="150"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="time" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.time }}</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="left" min-width="30">
<template slot-scope="scope">
<span class="logo" v-bind:class="{ 'logo_0': scope.row.status == 0, 'logo_1': scope.row.status == 1, 'logo_2': scope.row.status == 2 }"></span>
<span class="text">{{ scope.row.status | exportStatus }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="70">
<template slot-scope="scope">
<el-button
:disabled="scope.row.buttonStatus"
size="small"
type="text"
v-if="scope.row.status != 2"
@click="update(scope.row)"
>{{ scope.row.buttonText }}</el-button>
<div v-if="scope.row.status == 2">-</div>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="param.pageNo"
:page-sizes="[20, 50 ,100 ,200]"
:page-size="param.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import * as commonUtil from "../../utils/utils";
import { openLoading, closeLoading } from "../../utils/utils";
import axios from "axios";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
return {
curmbFirst: "学情报告",
curmbSecond: "任务列表",
projectId: "",
tableData: [],
param: {
pageSize: 20,
pageNo: 1
},
totalRows: 0,
totalTime: 3,
queryData: {},
listType: "2"
// buttonText: "刷新",
// buttonStatus: false,
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId");
let listType = vm.getUrlSearch(window.location.href, "listType");
if(listType == null) {
vm.listType = '2';
} else {
vm.listType = listType;
}
this.search();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
handleClick(tab, event) {
vm.listType = tab.name;
vm.search()
},
setButton() {
for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i;
if (vm.tableData[i].status == 1) {
if(vm.listType == '2') {
vm.tableData[i].buttonText = "查看报告";
} else if(vm.listType == '1') {
vm.tableData[i].buttonText = "下载";
}
vm.tableData[i].buttonStatus = false;
} else if (vm.tableData[i].status == 0) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false;
} else if (vm.tableData[i].status == 2) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = true;
}
}
},
search() {
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: ""
};
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.list;
vm.totalRows = res.data.totalSize;
vm.setButton();
}
});
},
getDownLoadStatus(row) {
// let req = {
// id: row.id
// };
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: row.id
};
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData[row.index].status = res.data.list[0].status;
let updateStatus = res.data.list[0].status;
// console.log('res.data.data',res.data.data);
if (updateStatus == 1) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "下载";
if(vm.listType == '2') {
vm.tableData[row.index].buttonText = "查看报告";
} else if(vm.listType == '1') {
vm.tableData[row.index].buttonText = "下载";
}
vm.tableData[row.index].fileUrl = res.data.list[0].url;
} else if (updateStatus == 0) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
} else if (updateStatus == 2) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = true;
}
} else {
vm.$message(res.message);
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
}
});
},
downLoad(row) {
setTimeout(() => {
window.open(row.fileUrl);
}, 500);
},
exportTime(row) {
vm.$router.push("item-list-old?downloadId="+row.id);
},
update(row) {
if (vm.tableData[row.index].status == 1) {
// vm.downLoad(row);
if(vm.listType == '2') {
vm.exportTime(row);
} else if(vm.listType == '1') {
vm.downLoad(row);
}
} else {
this.$nextTick(function() {
console.log(vm.tableData[row.index]);
let nowTime = vm.totalTime;
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
vm.tableData[row.index].buttonStatus = true;
let clock = window.setInterval(() => {
nowTime--;
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
if (nowTime <= 0) {
window.clearInterval(clock);
vm.tableData[row.index].title =
vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = false; //这里重新开启
vm.getDownLoadStatus(row);
}
}, 1000);
});
}
},
// 更改数据显示数量
handleSizeChange(val) {
vm.param.pageSize = val;
vm.param.pageNo = 1;
vm.search();
},
// 换页
handleCurrentChange(val) {
vm.param.pageNo = val;
vm.search();
}
}
};
</script>
<style lang="scss">
.export-download {
.component-content {
background: #fff;
padding: 10px;
.p-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
margin-bottom: 30px;
height: 25px;
font-size: 18px;
font-weight: 600;
line-height: 25px;
color: #000000;
}
.table-export {
.logo {
margin-top: 8px;
margin-right: 6px;
float: left;
width: 6px;
height: 6px;
border-radius: 50%;
}
.logo_0 {
background: #1890ff;
}
.logo_1 {
background: #52C41A;
}
.logo_2 {
background: #F5222D;
}
.text {
float: left;
}
.el-button--text {
color: #449284;
}
.el-button.is-disabled {
background: #fff !important;
border: 0px solid #fff !important;
}
}
}
}
</style>
\ No newline at end of file
此差异已折叠。
<template>
<div class="learning-effect">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box-card" v-bind:class="{ 'box-last': index == 1 }">
<!-- <el-card class="box-card" v-bind:class="{ 'box-last': index == 1 }"> -->
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</p>
<!-- </el-card> -->
</div>
</div>
<div class="spacing"></div>
<div class="chart-title">不同学历完成项目前后正确率对比</div>
<div class="chartEdu" ref="education"></div>
<div class="chart-remarks">注:本报表数据来源仅仅统计同时包含摸底考和正式考的课程培训。</div>
<div class="spacing"></div>
<div class="chart-title">培训前后知识点掌握情况</div>
<div class="chartLearn" ref="learning"></div>
<div class="chart-remarks">注:本报表数据来源仅包括有摸底考的课程培训。</div>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import * as chartData from "../../utils/learning/chartData";
import echarts from "echarts";
let vm = null;
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
timeInfoData: {
type: Object
},
},
data() {
return {
cardData: [],
echartsData: {
chart1: {},
chart2: {}
},
timeInfoChild: {},
};
},
watch: {
timeInfoData: {
deep: true,
handler(nv, ov) {
vm.timeInfoChild = nv;
}
}
},
created() {
vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted() {
commonUtil.resizeHeight();
this.$on("search", () => {
this.search();
});
this.$on("static", () => {
vm.getStatic();
});
},
methods: {
getStatic() {
let studyEffectDto = vm.timeInfoChild.studyEffectAnalysisModel.studyEffectDto;
vm.initCard(studyEffectDto);
vm.setEducation(studyEffectDto.educationEffectList);
vm.setLearning(studyEffectDto.knowledgeEffectList);
},
updateResize() {
this.$nextTick(function() {
window.onresize = function() {
vm.echartsData.chart1.resize();
vm.echartsData.chart2.resize();
};
});
},
search() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 0 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
openLoading(vm);
// if(req.regionId == "000") {
// req.regionId = "000";
// }
// console.log("0 req", req);
vm.POST("stats/report/studyEffect", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.initCard(res.data);
setTimeout(function() {
vm.setEducation(res.data.educationEffectList);
vm.setLearning(res.data.knowledgeEffectList);
}, 20);
}
});
},
initCard(data) {
let cardData = [
{
value: "0%",
title: "培训前总正确率"
},
{
value: "0%",
title: "培训前后正确率"
}
];
cardData[0].value = (data.beforeRate*100).toFixed(2) + "%";
cardData[1].value = (data.afterRate*100).toFixed(2) + "%";
vm.cardData = cardData;
},
setEducation(data) {
let myChart = echarts.init(this.$refs.education);
let xAxisData = [];
let seriesBefore = [];
let seriesAfter = [];
for(let i = 0; i < data.length ; i++) {
xAxisData.push(data[i].classifyName);
seriesBefore.push((data[i].beforeRate*100).toFixed(2));
seriesAfter.push((data[i].afterRate*100).toFixed(2));
}
let option = chartData.educationEffect(xAxisData, seriesBefore ,seriesAfter);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
},
setLearning(data) {
let myChart = echarts.init(this.$refs.learning);
let xAxisData = [];
let seriesBefore = [];
let seriesAfter = [];
for(let i = 0; i < data.length ; i++) {
xAxisData.push(data[i].classifyName);
seriesBefore.push((data[i].beforeRate*100).toFixed(2));
seriesAfter.push((data[i].afterRate*100).toFixed(2));
}
let option = chartData.knowledgeEffect(xAxisData, seriesBefore ,seriesAfter);
myChart.setOption(option);
vm.echartsData.chart2 = myChart;
vm.updateResize();
}
}
};
</script>
<style lang='scss' rel='stylesheet/scss'>
.learning-effect {
background: #fff;
overflow: hidden;
// padding: 10px;
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.box-list {
position: relative;
height: 110px;
background: #f0f2f5;
.box-card {
position: relative;
background-color: #ffffff;
width: 49%;
margin-right: 2%;
height: 120px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.el-card__body {
padding: 0px;
}
.value {
color: #373839;
text-align: center;
margin-top: 24px;
margin-bottom: 8px;
height: 45px;
line-height: 45px;
font-size: 32px;
font-weight: 500;
}
.title {
color: #666666;
text-align: center;
font-size: 14px;
height: 20px;
line-height: 20px;
}
}
.box-last {
margin-right: 0%;
}
}
.chart-title {
position: relative;
margin-top: 30px;
margin-left: 30px;
height: 25px;
font-size:18px;
font-weight:600;
line-height: 25px;
color: #000000;
}
.chartEdu {
position: relative;
margin: 20px auto 0 auto;
width: 1064px;
height: 380px;
}
.chartLearn {
position: relative;
margin: 20px auto 0 auto;
width: 1064px;
height: 462px;
}
.chart-remarks {
position: relative;
height: 66px;
padding: 20px 0 30px 30px;
font-size: 16px;
font-weight: 400;
line-height: 16px;
color: #666666;
}
}
</style>
此差异已折叠。
<template>
<div class="part-in-wrap">
<div v-show="!showData" class="empty">
<p>"没有相关数据,请重新选择查询范围"</p>
</div>
<div v-for="(item , index) in cardData" :key="index" class>
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
</div>
<div class="box-content">
<span class="weight">{{ item.num }}</span>
</div>
</el-card>
<div class="line"></div>
</div>
<div v-if="showChart" class="charts" id="rankChart" ref="rankChart"></div>
<!-- <div class="charts" id="age" ref="age"></div> -->
<el-table
v-if="showTable"
v-show="organizationNum < 2"
:data="finishDetail"
class="project-table"
style="width: 100%;margin-bottom: 30px;"
border
>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="departmentName" label="科室" align="center"></el-table-column>
<el-table-column prop="joinStatus" label="是否参与项目" align="center">
<template slot-scope="scope">{{ scope.row.joinStatus | partJoin }}</template>
</el-table-column>
<el-table-column prop="projectStatus" label="是否完成项目" align="center">
<template slot-scope="scope">{{ scope.row.projectStatus | partFinish }}</template>
</el-table-column>
<el-table-column prop="finishTime" label="完成项目日期" align="center">
<template slot-scope="scope">{{ scope.row.finishTime }}</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
</el-table>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import echarts from "echarts";
import { setTimeout } from "timers";
let vm = null;
export default {
props: {
formInline: {
type: Object
},
activeName: {
type: String
},
organizationNum: {
type: Number
},
organizationList: {
type: Array
}
},
data() {
return {
// 只有一个机构时显示人员完成情况
projectId: "",
finishDetail: [],
cardData: [],
showChart: false,
showTable: false,
showData: false,
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "id");
},
mounted: function() {
// commonUtil.resizeHeight();
this.$on("search", () => {
this.search();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
}
});
});
this.$on("reset", () => {
this.showData = false;
this.showChart = false;
this.showTable = false;
this.finishDetail = [];
this.cardData = [];
});
// if (this.activeName == "first") {
// this.updateResize();
// }
},
methods: {
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
console.log(vm.formInline,checkAll,vm.organizationList);
let req = {
projectId: vm.projectId,
ids: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
type: operationData.getSearchType(vm.formInline,checkAll),
originalFlag: vm.formInline.checked == false ? 0 : 1
};
console.log("1 req", req);
openLoading(vm);
vm.reportGET("report/portal/getParticipateInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.getCardData(res.data);
vm.showData = true;
if(res.data.participateHospitalCount == 0 && res.data.participatePeopleCount == 0) {
vm.$message("没有相关数据,请重新选择查询范围");
}
} else {
vm.$message(res.message);
}
});
vm.reportGET("report/portal/top", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.getRank(res.data);
this.getTableData(res.data);
}
});
},
updateResize() {
this.$nextTick(function() {
let chartRank = echarts.init(document.getElementById("rankChart"));
window.onresize = function() {
chartRank.resize();
};
});
},
getTableData(data) {
if (vm.formInline.region.length >= 3 && vm.organizationNum == 1) {
vm.showTable = true;
vm.finishDetail = data.hospitalPeopleList;
} else {
vm.showTable = false;
}
},
getRank(data) {
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.top.length; i++) {
xAxisData[i] = data.top[i].name;
seriesData[i] = data.top[i].percentage;
}
if(vm.organizationNum == 1 || xAxisData.length <= 1) {
vm.showChart = false;
}
if (xAxisData.length > 1 && vm.organizationNum !=1) {
vm.showChart = true;
setTimeout(function() {
let myChart = echarts.init(vm.$refs.rankChart);
let optionValue = operationData.getRank(xAxisData, seriesData);
myChart.setOption(optionValue);
vm.updateResize();
}, 200);
}
},
getCardData(data) {
vm.cardData = [
{
title: "应参与机构数",
num: data.participateHospitalCount,
},
{
title: "已参与机构数",
num: data.hasParticipateHospitalCount,
},
{
title: "应参与人数",
num: data.participatePeopleCount,
},
{
title: "已参与人数",
num: data.hasParticipatePeopleCount,
},
{
title: data.type == 1 ? "项目完成人数" : "项目获证人数",
num: data.acquireCertificatePeopleCount,
},
];
if(data.manyCertificate != null) {
for(let i=0;i<data.manyCertificate.length;i++) {
let obj = {
title: data.manyCertificate[i].name,
num: data.manyCertificate[i].value,
}
if(obj.title != null) {
vm.cardData.push(obj);
}
}
}
// vm.cardData[0].num = data.participateHospitalCount;
// vm.cardData[1].num = data.participatePeopleCount;
// vm.cardData[2].num = data.hasParticipatePeopleCount;
// vm.cardData[3].num = data.acquireCertificatePeopleCount;
},
}
};
</script>
<style lang='scss'>
.part-in-wrap {
background: #fff;
overflow: hidden;
// padding: 10px;
.empty {
height: 300px;
line-height: 300px;
color: #FF3399;
text-align: center;
}
.el-card {
border-width: 0px;
}
.el-card.is-always-shadow {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
}
.line {
background: #e4e4e4;
height: 80px;
width: 1px;
float: left;
margin-top: 20px;
}
.box-card {
width: 13%;
margin-right: 1%;
font-size: 14px;
float: left;
.el-card__header {
border-bottom-width: 0;
}
.title {
text-align: center;
}
.box-content {
text-align: center;
height: 40px;
font-size: 15px;
}
}
.charts {
top: 20px;
margin-left: 10%;
width: 80%;
border-radius: 4px;
border: 1px solid #ebeef5;
background-color: #fff;
overflow: hidden;
color: #303133;
-webkit-transition: 0.3s;
transition: 0.3s;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
height: 600px;
background: #fff;
padding: 20px;
}
.project-table {
top: 15px;
background: #fff;
}
}
</style>
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册