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

代码优化、接口请求优化等

上级 97a26759
......@@ -56,9 +56,10 @@ export default {
},
},
filters: {
// 将秒转换成分钟
convert: function (value, unitName = '分钟') {
if(!value) return 0 + unitName;
return Math.ceil(value / 60)
if(!value) return 0;
return Math.ceil(value / 60);
},
},
components: {
......
......@@ -59,20 +59,20 @@ export default {
height: 100%;
left: 0;
top: 0;
z-index: 2110;
z-index: 10000001;
font-size: 20px;
.mask {
position: absolute;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 2111;
z-index: 10000002;
}
.content {
position: absolute;
left: 50%;
top: 50%;
z-index: 2112;
z-index: 10000003;
width: 300px;
// height: 185px;
margin: -150px 0 0 -150px;
......
<!-- Tabs组件 -->
<template>
<div class="common-process">
<span class="bar" :style="{'width': maxPocessWidth, 'background': barColor}"></span><span class="desc">{{value}}</span>
<span class="bar" :style="{'width': maxPocessWidth, 'background': barColor}"></span><span class="desc">{{value}}{{unitName}}</span>
</div>
</template>
<script>
......
<template>
<section class="container">
<CommonHeader :title="projectInfo.projectName | shortName"></CommonHeader>
<CommonAreaSelect
@areaClick="areaTabClick"
@orgClick="orgTabClick"
:areaName="areaName"
:orgName="orgName"
:showArea="isShowArea"
:showOrg="isShowOrg">
</CommonAreaSelect>
<CommonTaps :projectInfo="projectInfo" @tabClicked="tabClicked"></CommonTaps>
<!-- 总体概况 -->
<article v-show="cIndex === 0">
<CommonSwiperItem
:isSingleOrg="isSingleOrg"
:percentData="allData.percentData || {}"
:certFlag="projectInfo.certFlag"
@tipsClick="tipsSwiperClick"
></CommonSwiperItem>
<div v-show="!isSingleOrg">
<CommonTitle v-if="projectInfo.certFlag" title="证书分布情况"></CommonTitle>
<ChartPie v-if="projectInfo.certFlag" :certFlag="projectInfo.certFlag" id="certPieId2" :pieData="(allData && allData.certData)"></ChartPie>
<CommonTitle v-if="projectInfo.certFlag" title="证书级别按学历分布情况"></CommonTitle>
<ChartColumnStack v-if="projectInfo.certFlag" :certFlag="projectInfo.certFlag" :echartsData="echartsData"></ChartColumnStack>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="项目情况排名"></CommonTitle>
<RankingList :certFlag="projectInfo.certFlag" :rankList="studyRankList.slice(0, 5)"></RankingList>
<ShowAll v-show="studyRankList.length > 5" @action="gotoPage('/rankedu', true)"></ShowAll>
<CommonSplitLine></CommonSplitLine>
<CommonTitleWithWhat @tipsClick="tipsRankingItemClick" title="完成天数排名"></CommonTitleWithWhat>
<RankingItemDays :rankList="costRankList.slice(0, 5)"></RankingItemDays>
<ShowAll v-show="costRankList.length > 5" @action="gotoPage('/rankdays')"></ShowAll>
</div>
<div v-show="isSingleOrg">
<CommonTitle title="培训机构情况"></CommonTitle>
<OrgDoctorList
@orgDoctorTabChange="orgDoctorTabChange"
:certUserList="orgDoctorTabData.certUserList"
:noCertUserList="orgDoctorTabData.noCertUserList"
:noJoinList="orgDoctorTabData.noJoinList"
:certFlag="projectInfo.certFlag"
:containOfficialFlag="projectInfo.containOfficialFlag"
></OrgDoctorList>
</div>
<CommonBottomInfo></CommonBottomInfo>
</article>
<!-- 人群分析 -->
<article v-show="cIndex === 1">
<CommonTitleWithBtn title="人员学历情况" @btnClick="analysisEduClick"></CommonTitleWithBtn>
<ChartPieEdu :dataList="analysisEduData"></ChartPieEdu>
<CommonSplitLine></CommonSplitLine>
<CommonTitleWithBtn title="人员职称情况" @btnClick="analysisTitleClick"></CommonTitleWithBtn>
<ChartPieTitle :dataList="analysisTitleData"></ChartPieTitle>
<CommonBottomInfo></CommonBottomInfo>
</article>
<!-- 课程分析 -->
<article v-show="(cIndex === 2) && (projectInfo.existCourse == 1)" style="padding-top: 8px;">
<CourseTimesStat :totalSize="courseInfo.totalSize" :maxDuration="courseInfo.pCourseTotalTime" :avgDuration="courseInfo.pCourseAvg" :processDataObj="processDataObj"></CourseTimesStat>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="课程列表"></CommonTitle>
<CourseTimesList :dataList="courseInfo.pCourseList"></CourseTimesList>
<CommonBottomInfo></CommonBottomInfo>
</article>
<!-- 考试分析 -->
<article v-show="(cIndex === 3) && (projectInfo.existExam == 1)">
<CommonCard :cardList="examCardList"></CommonCard>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="完成项目考试次数情况"></CommonTitle>
<ChartColumnVerticalTimes :dataList="(generalExamData.examTimesList || []).slice(0, 5)" id="chartCourseTimesId" :colors="colors"></ChartColumnVerticalTimes>
<ShowAll v-show="generalExamData && generalExamData.examTimesList.length > 5" @action="gotoPage('/examtimes')" class="mt-10"></ShowAll>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="完成项目考试分数情况"></CommonTitle>
<ChartColumnVerticalScore id="chartCourseScoreId" :dataList="generalExamData.examScoreList"></ChartColumnVerticalScore>
<ShowAll @action="gotoPage('/examscore')" class="mt-10"></ShowAll>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="考试列表"></CommonTitle>
<ExamList :dataList="examInfoList"></ExamList>
<CommonBottomInfo></CommonBottomInfo>
</article>
<!-- 学习效果分析 -->
<article v-show="(cIndex === 4) && (projectInfo.existEffect == 1)">
<CommonCard :needBG="needBG" :cardList="effectCardList"></CommonCard>
<CommonSplitLine></CommonSplitLine>
<CommonTitle title="不同学历培训前后正确率对比"></CommonTitle>
<ChartColumnVerticalTC :dataList="studyEffect.educationEffectList" id="chartColumnVerticalTC"></ChartColumnVerticalTC>
<CommonSplitLine style="margin-top: 10px;"></CommonSplitLine>
<CommonTitle title="培训前后知识点掌握情况"></CommonTitle>
<ChartColumnHorizontalTC :dataList="studyEffect.knowledgeEffectList" id="ChartColumnVerticalTC2"></ChartColumnHorizontalTC>
<ShowAll @action="gotoPage('/klgpoint')" class="mt-10"></ShowAll>
<CommonBottomInfo></CommonBottomInfo>
</article>
<PicaArea
v-show="isShowArea"
@confirm="areaConfirm"
@cancel="areaCancel"
:projectId="projectId"
:token="token"
></PicaArea>
<PicaOrg v-show="isShowOrg" @confirm="orgConfirm" @cancel="orgCancel"></PicaOrg>
<CommonLoading v-show="false"></CommonLoading>
<PopTips :tipsContent="tipsContent" @clickTips="clickTips" v-show="isShowTips"></PopTips>
</section>
</template>
<script>
const cookies = require("cookie-universal")();
import { goPageByNative } from "@/utils";
import { mapGetters, mapActions } from "vuex";
import {
getProvinceList,
getUserAnalysis,
getHospitalsCNT,
getGeneralPersonal,
getGeneralCourse,
getGeneralExam,
getProjectInfo,
getGeneralExamList,
getStudyEffect
} from "@/service";
import CommonHeader from "@/components/common/common-header";
import CommonTitle from "@/components/common/common-title";
import CommonTitleWithWhat from "@/components/common/common-title-with-what";
import CommonTitleWithBtn from "@/components/common/common-title-with-btn";
import CommonLoading from "@/components/common/common-loading";
import CommonTaps from "@/components/common/common-tabs";
import CommonSwiperItem from "@/components/common/common-swiper-item";
import CommonSplitLine from "@/components/common/common-split-line";
import RankingList from "@/components/bussiness/ranking-item";
import ShowAll from "@/components/common/common-show-all";
import CommonBottomInfo from "@/components/common/common-bottom-info";
import RankingItemDays from "@/components/bussiness/ranking-item-days";
import ChartPie from "@/components/bussiness/charts/chart-pie";
import ChartPieEdu from "@/components/bussiness/charts/chart-pie-edu";
import ChartPieTitle from "@/components/bussiness/charts/chart-pie-title";
import ChartColumnStack from "@/components/bussiness/charts/chart-column-stack";
import ChartColumnVerticalTimes from "@/components/bussiness/charts/chart-column-vertical-times";
import ChartColumnVerticalScore from "@/components/bussiness/charts/chart-column-vertical-score";
import ChartColumnVerticalTC from "@/components/bussiness/charts/chart-column-vertical-tc";
import ChartColumnHorizontalTC from "@/components/bussiness/charts/chart-column-horizontal-tc";
import PicaArea from "@/components/common/pica-area";
import PicaOrg from "@/components/common/pica-org";
import CommonAreaSelect from "@/components/common/common-area-select";
import ProcessBar from "@/components/common/pica-process";
import CourseTimesStat from "@/components/bussiness/course-times-stat";
import CourseTimesList from "@/components/bussiness/course-times-list";
import OrgDoctorList from "@/components/bussiness/org-doctor-list";
import ExamList from "@/components/bussiness/exam-list";
import PopTips from "@/components/bussiness/pop-tips";
import CommonCard from "@/components/common/common-card";
import { getGeneralData } from "@/service/index";
export default {
components: {
CommonHeader,
CommonTitle,
CommonLoading,
CommonTaps,
CommonSwiperItem,
CommonSplitLine,
RankingList,
ChartPie,
ChartPieEdu,
ChartPieTitle,
ShowAll,
CommonBottomInfo,
RankingItemDays,
ChartColumnStack,
PicaArea,
PicaOrg,
CommonAreaSelect,
ProcessBar,
CourseTimesStat,
CourseTimesList,
CommonCard,
ExamList,
// ChartColumnVertical,
ChartColumnVerticalTC,
ChartColumnHorizontalTC,
CommonTitleWithBtn,
OrgDoctorList,
ChartColumnVerticalTimes,
ChartColumnVerticalScore,
PopTips,
CommonTitleWithWhat,
},
data() {
return {
isShowArea: false,
isShowOrg: false,
isShowTips: false,
isShowRankingItemTips: false,
tipsContent: '',
areaName: '全部',
orgName: '全部机构',
cIndex: 0,
colors: ["#39AF9A", "#FF9A4B", "#abb7bb", "#76d2d2"],
needBG: true,
effectCardList: [
{
count: 65,
unitName: "%",
description: "培训前正确率"
},
{
count: 80,
unitName: "%",
description: "培训后正确率"
}
],
allData: {},
studyRankList: [],
costRankList: [],
projectId: "",
token:
"BACBEEBBAE2247DBBD7CD0E15FE0CE93" ||
"A220943B006347799F277CC524EBB662",
isOrgStat: false,
// 区域选择通用接口参数
queryParams: {
projectId: 374,
regionId: ""
},
// 查询概况数据
queryGDParams: {
beginDate: "",
endDate: "",
hospitalIdList: [],
originalFlag: 1, // 默认值0:0不查看原始数据
projectId: 374,
regionId: "",
timeFlag: 1,
pageNo: 0,
pageSize: 0,
sourceType: 1,
pageCfg: {
type: 1
}
},
echartsData: null,
analysisData: {
eduList: { join: [], finish: []},
titleList: { join: [], finish: []},
},
analysisEduData: [],
analysisTitleData: [],
CNTParams: {
projectId: 374,
regionId: ""
},
hospitalCnt: 2,
isSingleOrg: false,
orgDoctorTabData: {
certUserList: [],
noCertUserList: [],
noJoinList: []
},
projectInfo: {
projectName: '项目名称',
certFlag: 0, // 项目证书情况 0:无证;1:单证书;2:多证书
existCourse: 2, // 是否显示课程分析 1:显示 2:不显示
existEffect: 2, // 是否显示学习效果分析 1:显示 2:不显示
existExam: 2, // 是否显示考试分析 1:显示 2:不显示
roleType: 0, // 0:普通人 1:内部管理员 2:项目负责人 3:次级负责人
status: 0, // 是否显示查看原始数据 1:显示 2:不显示
containOfficialFlag: 0 // 0: 无正式考考试 1: 有正式考考试
},
courseInfo: {
pCourseTotalTime: 100,
pCourseAvg: 50,
pCourseList: []
},
generalExamData: {
beforeExamCount: 4,
afterExamCount: 4,
examTitleCount: 800,
examTimesList: [],
examScoreList: [],
fiveExamScoreList: [],
tenExamScoreList: []
},
examCardList: [],
examInfoList: [],
studyEffect: {
beforeRate: 0,
afterRate: 0,
educationEffectList: [],
knowledgeEffectList: []
},
processDataObj: {
}
};
},
filters: {
shortName: function (value, length = 15, append = '...') {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
}
}
},
computed: {
...mapGetters({
orgList: "orgList",
areaDegree: "areaDegree"
}),
},
async asyncData() {
return {};
},
created() {
if (process.client) {
this.projectId = (this.$router && this.$route.query && this.$route.query.projectId) || 374;
this.queryGDParams.projectId = this.projectId;
this.CNTParams.projectId = this.projectId;
this.queryParams.projectId = this.projectId;
if (this.$rocNative.isWeb) {
this.setUserToken(this.token);
cookies.set("lreporttoken", this.token);
this.setProjectId(this.projectId);
} else {
this.getUserInfo();
}
}
// this.$store.dispatch('searchHospital', { name: '测试' });
},
mounted() {
if (this.$rocNative.isWeb) {
this.getProjectInfo(this.queryParams);
}
},
methods: {
// 切换机构人员列表中的tabs
orgDoctorTabChange(index) {
this.queryGDParams.pageCfg.type = index + 1;
this.getGeneralPersonal(this.queryGDParams);
},
// 查询用户信息和权限
getProjectInfo(params) {
getProjectInfo({ projectId: this.projectId }).then(res => {
if (res.code === "000000") {
this.projectInfo = res.data;
getProvinceList(params).then(res => {
if (res.code === "000000") {
this.queryGDParams.regionId = (res.data && res.data.list[0] && res.data.list[0].id) || '';
this.CNTParams.regionId = (res.data && res.data.list[0] && res.data.list[0].id) || '';
this.setProvinceList(res.data.list);
this.getHospitalsCNT(this.CNTParams);
}
});
}
});
},
// 异步延迟调用其它Tabs接口(除了数据概述)
otherInterface() {
setTimeout(() => {
this.getGeneralExam(this.queryGDParams);
this.getUserAnalysis(this.queryGDParams);
this.getGeneralCourse(this.queryGDParams);
this.getStudyEffect(this.queryGDParams);
}, 100);
},
// 根据地区查询地区下是否有机构
getHospitalsCNT(params) {
getHospitalsCNT(params).then(res => {
if (res.code === "000000") {
this.hospitalCnt = res.data.hospitalCnt;
this.isSingleOrg = res.data.hospitalCnt === 1;
if (this.isSingleOrg) {
// 只有一个机构,则调用另外一个接口(机构下人员)
this.queryGDParams.hospitalIdList = [];
this.queryGDParams.hospitalIdList.push(res.data.list[0].hospitalId);
this.getGeneralPersonal(this.queryGDParams);
} else {
this.getGeneralData(this.queryGDParams);
}
this.otherInterface();
}
});
},
// 请求单个机构下的数据(总体概述的数据)
getGeneralPersonal(params) {
getGeneralPersonal(params).then(res => {
if (res.code === "000000") {
this.allData = res.data;
this.studyRankList = this.allData.studyRank || [];
this.costRankList = this.allData.costRank || [];
if (params.pageCfg.type === 1) {
this.orgDoctorTabData.certUserList = res.data.personData;
} else if (params.pageCfg.type === 2) {
this.orgDoctorTabData.noCertUserList = res.data.personData;
} else {
this.orgDoctorTabData.noJoinList = res.data.personData;
}
}
});
},
// 请求多个机构下的数据
async getGeneralData(queryData) {
await getGeneralData(queryData).then(res => {
if (res.code === "000000") {
this.allData = res.data;
this.studyRankList = this.allData.studyRank || []
this.costRankList = this.allData.costRank || [];
this.echartsData = res.data.eduData;
}
});
},
// 人群分析
async getUserAnalysis(queryData) {
await getUserAnalysis(queryData).then(res => {
if (res.code === "000000") {
this.analysisData = res.data;
this.analysisEduData = res.data.eduList.join;
this.analysisTitleData = res.data.titleList.join;
}
});
},
// 考试分析
async getGeneralExam(queryData) {
// 上面三个图标数据
await getGeneralExam(queryData).then(res => {
if (res.code === "000000") {
this.generalExamData = res.data;
this.setExamTimesList(res.data.examTimesList)
this.setExamScoreList(res.data.examScoreList)
this.examCardList = [
{
count: res.data.afterExamCount,
unitName: "门",
description: "正式考试数"
},
{
count: res.data.beforeExamCount,
unitName: "门",
description: "模拟考试数"
},
{
count: res.data.examTitleCount,
unitName: "道",
description: "所有考题数"
}
];
}
});
// 下面一个列表数据
await getGeneralExamList(queryData).then(res => {
if (res.code === "000000") {
this.examInfoList = res.data.examInfoList || []
}
});
},
// 课程数据
async getGeneralCourse(params) {
await getGeneralCourse(params).then(res => {
if (res.code === "000000") {
this.processDataObj = {
maxDuration: res.data.pCourseTotalTime,
avgDuration: res.data.pCourseAvg
}
this.processDataObj.maxDuration = res.data.pCourseTotalTime;
this.processDataObj.avgDuration = res.data.pCourseAvg;
// :totalSize="courseInfo.totalSize" :maxDuration="courseInfo.pCourseTotalTime"
this.courseInfo = res.data;
}
});
},
// 学习效果分析
async getStudyEffect(params) {
await getStudyEffect(params).then(res => {
if (res.code === "000000") {
this.studyEffect = res.data;
this.effectCardList[0].count = (res.data.beforeRate * 100).toFixed(1);
this.effectCardList[1].count = (res.data.afterRate * 100).toFixed(1);
}
});
},
tabClicked(index) {
this.cIndex = index;
},
// 清空参数
clearParams() {
this.orgName = '全部机构';
this.queryGDParams.hospitalIdList = [];
// this.setOrgList([]);
// this.setRegionId
},
// 确认选择区域
areaConfirm(selData) {
this.clearParams();
this.queryGDParams.regionId = selData.regionId;
this.CNTParams.regionId = selData.regionId;
this.getHospitalsCNT(this.CNTParams);
this.isShowArea = false;
this.setAreaDegree(selData.areaDegree);
if(selData.townName || selData.countyName || selData.cityName || selData.provinceName) {
this.areaName = this.shortName(selData.townName || selData.countyName || selData.cityName || selData.provinceName, 6)
}
},
// 取消选择区域
areaCancel() {
this.isShowArea = false;
},
// 确认选择机构
orgConfirm(selData) {
let hospitalIds = [];
let hospitalNames = [];
let orgName = '';
selData.forEach(org => {
if (org.selected) {
hospitalIds.push(org.hospitalId);
hospitalNames.push(org.hospitalName);
}
});
// 如果没有选择机构,则重新获取所有数据
this.isShowOrg = false;
this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6);
if(hospitalIds.length == 0) {
this.getHospitalsCNT(this.CNTParams);
return;
}
this.queryGDParams.hospitalIdList = hospitalIds;
if (hospitalIds.length === 1) {
// this.hospitalCnt = 1
this.isSingleOrg = true;
this.getGeneralPersonal(this.queryGDParams);
} else {
this.isSingleOrg = false;
this.getGeneralData(this.queryGDParams);
}
setTimeout(() => {
this.getUserAnalysis(this.queryGDParams);
this.projectInfo.existCourse == 1 && this.getGeneralCourse(this.queryGDParams);
this.projectInfo.existExam == 1 && this.getGeneralExam(this.queryGDParams);
this.projectInfo.existEffect == 1 && this.getStudyEffect(this.queryGDParams);
}, 100);
},
// 取消选择机构
orgCancel() {
this.isShowOrg = false;
},
// 弹出选择区域控件
areaTabClick() {
if(this.isShowOrg) {
this.isShowOrg = false;
}
this.isShowArea = !this.isShowArea;
},
// 弹出选择机构控件
orgTabClick() {
if(this.areaDegree !== 3 && this.areaDegree !== 4) {
this.$toast('选择区/县后才可选择机构');
return;
}
if(this.orgList.length === 0) {
this.$toast('此区域下无机构');
return;
}
this.isShowOrg = !this.isShowOrg;
},
// 通用跳转页面
gotoPage(subUrl, hasCert) {
let subUrlAndParams = `${subUrl}?token=${this.token}&projectId=${this.queryGDParams.projectId}&regionId=${this.queryGDParams.regionId}&hospitalIdList=${this.queryGDParams.hospitalIdList.join(',')}`
if(hasCert) {
subUrlAndParams += `&certFlag=${this.projectInfo.certFlag}`
}
if (this.$rocNative.isWeb) {
this.$router.push(subUrlAndParams);
} else {
let nativeUrl = `/lreport_ssr${subUrlAndParams}`
goPageByNative(this, nativeUrl);
}
},
// 人员学历情况切换按钮
analysisEduClick(index) {
this.analysisEduData = this.analysisData.eduList[
index ? "finish" : "join"
] || [];
this.$forceUpdate();
},
// 人员职称情况切换按钮
analysisTitleClick(index) {
this.analysisTitleData = this.analysisData.titleList[
index ? "finish" : "join"
] || [];
this.$forceUpdate();
},
// 与原生交互,获取用户信息
getUserInfo() {
this.$rocNative.getUserInfo &&
this.$rocNative.getUserInfo().then(params => {
this.token = params.userToken;
// cookies.remove("token");
cookies.set("lreporttoken", this.token);
this.setUserToken(this.token);
this.setProjectId(this.projectId);
this.getProjectInfo(this.queryParams);
});
},
// 弹出提示信息一
tipsRankingItemClick() {
this.tipsContent = '在线项目完成天数=完成项目时间-开始参与项目时间'
this.isShowTips = true
},
// 弹出提示信息二
tipsSwiperClick() {
this.tipsContent = '是已获证人数/应参与人数*100%'
this.isShowTips = true
},
// 关闭提示信息
clickTips() {
this.isShowTips = false
},
// 文本截断
shortName: function (value, length = 15, append = '...') {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
}
},
// 映射Store中的Actions
...mapActions({
setProjectId: "setProjectId",
setRegionId: "setRegionId",
setUserToken: "setUserToken",
setProvinceList: "setProvinceList",
setExamTimesList: "setExamTimesList",
setExamScoreList: "setExamScoreList",
setOrgList: "setOrgList",
setAreaDegree: "setAreaDegree"
})
}
};
</script>
<style lang="less" scoped>
.container {
margin: 0 auto;
font-size: 17px;
h1 {
font-size: 36px;
text-align: center;
}
.m1 {
width: 100%;
> div {
width: 100%;
}
}
.mt-10 {
margin-top: 0;
}
}
</style>
......@@ -51,7 +51,6 @@
<CommonTitleWithBtn title="人员学历情况" @btnClick="analysisEduClick"></CommonTitleWithBtn>
<ChartPieEdu :dataList="analysisEduData"></ChartPieEdu>
<CommonSplitLine></CommonSplitLine>
<!-- <CommonTitle title="人员职称情况"></CommonTitle> -->
<CommonTitleWithBtn title="人员职称情况" @btnClick="analysisTitleClick"></CommonTitleWithBtn>
<ChartPieTitle :dataList="analysisTitleData"></ChartPieTitle>
<CommonBottomInfo></CommonBottomInfo>
......@@ -141,7 +140,6 @@ import ChartPie from "@/components/bussiness/charts/chart-pie";
import ChartPieEdu from "@/components/bussiness/charts/chart-pie-edu";
import ChartPieTitle from "@/components/bussiness/charts/chart-pie-title";
import ChartColumnStack from "@/components/bussiness/charts/chart-column-stack";
// import ChartColumnVertical from "@/components/bussiness/charts/chart-column-vertical";
import ChartColumnVerticalTimes from "@/components/bussiness/charts/chart-column-vertical-times";
import ChartColumnVerticalScore from "@/components/bussiness/charts/chart-column-vertical-score";
import ChartColumnVerticalTC from "@/components/bussiness/charts/chart-column-vertical-tc";
......@@ -201,8 +199,6 @@ export default {
tipsContent: '',
areaName: '全部',
orgName: '全部机构',
// :areaTitle="areaTitle"
// :orgTitle="orgTitle"
cIndex: 0,
colors: ["#39AF9A", "#FF9A4B", "#abb7bb", "#76d2d2"],
needBG: true,
......@@ -223,15 +219,8 @@ export default {
costRankList: [],
projectId: "",
token:
"0CFC560350E4499A902C4B02C2683ADE" ||
"A220943B006347799F277CC524EBB662" ||
"B10441890E2940499621C76667675B2D" ||
// "17B31C94D44947829097A953BC7C2732" ||
"A0E52265D31B4D2380C7CFC9E1ACCDCE" ||
"A7F0A8A4BB5C4EC4B78E71261B753C9C" ||
"4281940A6A0C49F69F06BBC9E83DA90D" ||
"A62E9F92365547A29724F21F29BED4F6" ||
"4556EDEAAE134FE1B6E1356BF9C1B8F9",
"BACBEEBBAE2247DBBD7CD0E15FE0CE93" ||
"A220943B006347799F277CC524EBB662",
isOrgStat: false,
// 区域选择通用接口参数
queryParams: {
......@@ -254,10 +243,6 @@ export default {
type: 1
}
},
// examSingleParams: {
// projectId: "",
// hospitalId: ""
// },
echartsData: null,
analysisData: {
eduList: { join: [], finish: []},
......@@ -287,8 +272,8 @@ export default {
containOfficialFlag: 0 // 0: 无正式考考试 1: 有正式考考试
},
courseInfo: {
pCourseTotalTime: 100,
pCourseAvg: 50,
pCourseTotalTime: 0,
pCourseAvg: 0,
pCourseList: []
},
generalExamData: {
......@@ -328,58 +313,40 @@ export default {
areaDegree: "areaDegree"
}),
},
async asyncData() {
asyncData() {
return {};
},
created() {
if (process.client) {
this.projectId =
(this.$router && this.$route.query && this.$route.query.projectId) ||
374;
this.projectId = (this.$router && this.$route.query && this.$route.query.projectId) || 374;
this.queryGDParams.projectId = this.projectId;
this.CNTParams.projectId = this.projectId;
// this.examSingleParams.projectId = this.projectId;
this.queryParams.projectId = this.projectId;
if (this.$rocNative.isWeb) {
this.setUserToken(this.token);
// cookies.remove("token");
cookies.set("lreporttoken", this.token);
this.setProjectId(this.projectId);
} else {
this.getUserInfo();
}
}
// console.log(this.$route)
// console.log(this.$router)
// this.$store.dispatch('searchHospital', { name: '测试' });
},
mounted() {
if (this.$rocNative.isWeb) {
this.getProvinceData(this.queryParams);
this.getProjectInfo(this.queryParams);
}
},
methods: {
// 切换机构人员列表中的tabs
orgDoctorTabChange(index) {
this.queryGDParams.pageCfg.type = index + 1;
this.getGeneralPersonal(this.queryGDParams);
},
async getProvinceData(params) {
// 获取所有tabs
this.getProjectInfo(params);
// await getProvinceList(params).then(res => {
// if (res.code === "000000") {
// this.queryGDParams.regionId = res.data.list[0].id;
// this.CNTParams.regionId = res.data.list[0].id;
// this.setProvinceList(res.data.list);
// this.getHospitalsCNT(this.CNTParams);
// }
// });
},
// 查询用户信息和权限
async getProjectInfo(params) {
await getProjectInfo({ projectId: this.projectId }).then(res => {
getProjectInfo(params) {
getProjectInfo({ projectId: this.projectId }).then(res => {
if (res.code === "000000") {
this.projectInfo = res.data;
getProvinceList(params).then(res => {
......@@ -394,8 +361,19 @@ export default {
});
},
async getHospitalsCNT(params) {
await getHospitalsCNT(params).then(res => {
// 异步延迟调用其它Tabs接口(除了数据概述)
otherInterface() {
setTimeout(() => {
this.getUserAnalysis(this.queryGDParams);
this.projectInfo.existCourse == 1 && this.getGeneralCourse(this.queryGDParams);
this.projectInfo.existExam == 1 && this.getGeneralExam(this.queryGDParams);
this.projectInfo.existEffect == 1 && this.getStudyEffect(this.queryGDParams);
}, 100);
},
// 根据地区查询地区下是否有机构
getHospitalsCNT(params) {
getHospitalsCNT(params).then(res => {
if (res.code === "000000") {
this.hospitalCnt = res.data.hospitalCnt;
this.isSingleOrg = res.data.hospitalCnt === 1;
......@@ -407,17 +385,14 @@ export default {
} else {
this.getGeneralData(this.queryGDParams);
}
this.getGeneralExam(this.queryGDParams);
this.getUserAnalysis(this.queryGDParams);
this.getGeneralCourse(this.queryGDParams);
this.getStudyEffect(this.queryGDParams);
this.otherInterface();
}
});
},
// 请求单个机构下的数据
async getGeneralPersonal(params) {
await getGeneralPersonal(params).then(res => {
// 请求单个机构下的数据(总体概述的数据)
getGeneralPersonal(params) {
getGeneralPersonal(params).then(res => {
if (res.code === "000000") {
this.allData = res.data;
this.studyRankList = this.allData.studyRank || [];
......@@ -434,8 +409,8 @@ export default {
},
// 请求多个机构下的数据
async getGeneralData(queryData) {
await getGeneralData(queryData).then(res => {
getGeneralData(queryData) {
getGeneralData(queryData).then(res => {
if (res.code === "000000") {
this.allData = res.data;
this.studyRankList = this.allData.studyRank || []
......@@ -446,8 +421,8 @@ export default {
},
// 人群分析
async getUserAnalysis(queryData) {
await getUserAnalysis(queryData).then(res => {
getUserAnalysis(queryData) {
getUserAnalysis(queryData).then(res => {
if (res.code === "000000") {
this.analysisData = res.data;
this.analysisEduData = res.data.eduList.join;
......@@ -457,9 +432,9 @@ export default {
},
// 考试分析
async getGeneralExam(queryData) {
getGeneralExam(queryData) {
// 上面三个图标数据
await getGeneralExam(queryData).then(res => {
getGeneralExam(queryData).then(res => {
if (res.code === "000000") {
this.generalExamData = res.data;
this.setExamTimesList(res.data.examTimesList)
......@@ -484,7 +459,7 @@ export default {
}
});
// 下面一个列表数据
await getGeneralExamList(queryData).then(res => {
getGeneralExamList(queryData).then(res => {
if (res.code === "000000") {
this.examInfoList = res.data.examInfoList || []
}
......@@ -492,8 +467,8 @@ export default {
},
// 课程数据
async getGeneralCourse(params) {
await getGeneralCourse(params).then(res => {
getGeneralCourse(params) {
getGeneralCourse(params).then(res => {
if (res.code === "000000") {
this.processDataObj = {
maxDuration: res.data.pCourseTotalTime,
......@@ -508,8 +483,8 @@ export default {
},
// 学习效果分析
async getStudyEffect(params) {
await getStudyEffect(params).then(res => {
getStudyEffect(params) {
getStudyEffect(params).then(res => {
if (res.code === "000000") {
this.studyEffect = res.data;
this.effectCardList[0].count = (res.data.beforeRate * 100).toFixed(1);
......@@ -528,6 +503,8 @@ export default {
// this.setOrgList([]);
// this.setRegionId
},
// 确认选择区域
areaConfirm(selData) {
this.clearParams();
this.queryGDParams.regionId = selData.regionId;
......@@ -535,21 +512,18 @@ export default {
this.getHospitalsCNT(this.CNTParams);
this.isShowArea = false;
this.setAreaDegree(selData.areaDegree);
// orgConfirm
if(selData.townName || selData.countyName || selData.cityName || selData.provinceName) {
this.areaName = this.shortName(selData.townName || selData.countyName || selData.cityName || selData.provinceName, 6)
}
// this.shortName()
console.log(selData)
// this. = hospitalNames[0] || this.orgName
// this.getGeneralData(this.queryGDParams);
},
// 取消选择区域
areaCancel() {
this.isShowArea = false;
},
orgConfirm(selData) {
// this.$toast('res.message');
// 确认选择机构
orgConfirm(selData) {
let hospitalIds = [];
let hospitalNames = [];
let orgName = '';
......@@ -560,7 +534,6 @@ export default {
}
});
// this.queryGDParams.hospitalIdList = hospitalIds
// 如果没有选择机构,则重新获取所有数据
this.isShowOrg = false;
this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6);
......@@ -577,24 +550,29 @@ export default {
this.isSingleOrg = false;
this.getGeneralData(this.queryGDParams);
}
this.getGeneralExam(this.queryGDParams);
this.getUserAnalysis(this.queryGDParams);
this.getGeneralCourse(this.queryGDParams);
this.getStudyEffect(this.queryGDParams);
this.otherInterface();
// setTimeout(() => {
// this.getUserAnalysis(this.queryGDParams);
// this.projectInfo.existCourse == 1 && this.getGeneralCourse(this.queryGDParams);
// this.projectInfo.existExam == 1 && this.getGeneralExam(this.queryGDParams);
// this.projectInfo.existEffect == 1 && this.getStudyEffect(this.queryGDParams);
// }, 100);
},
// 取消选择机构
orgCancel() {
this.isShowOrg = false;
},
// 弹出选择区域控件
areaTabClick() {
if(this.isShowOrg) {
this.isShowOrg = false;
}
this.isShowArea = !this.isShowArea;
},
// 弹出选择机构控件
orgTabClick() {
// if(this.isShowArea) {
// this.isShowArea = false;
// }
if(this.areaDegree !== 3 && this.areaDegree !== 4) {
this.$toast('选择区/县后才可选择机构');
return;
......@@ -606,11 +584,6 @@ export default {
this.isShowOrg = !this.isShowOrg;
},
resizeTheChart() {
if (this.$refs.runTimes_creditChart) {
this.$refs.runTimes_creditChart.resize();
}
},
// 通用跳转页面
gotoPage(subUrl, hasCert) {
......@@ -626,16 +599,15 @@ export default {
}
},
// 人员学历情况切换按钮
analysisEduClick(index) {
// if(index === 0) {
// this.analysisEduData = this.analysisData.eduList && this.analysisData.eduList.join
// }
this.analysisEduData = this.analysisData.eduList[
index ? "finish" : "join"
] || [];
this.$forceUpdate();
},
// 人员职称情况切换按钮
analysisTitleClick(index) {
this.analysisTitleData = this.analysisData.titleList[
index ? "finish" : "join"
......@@ -652,20 +624,28 @@ export default {
cookies.set("lreporttoken", this.token);
this.setUserToken(this.token);
this.setProjectId(this.projectId);
this.getProvinceData(this.queryParams);
this.getProjectInfo(this.queryParams);
});
},
// 弹出提示信息一
tipsRankingItemClick() {
this.tipsContent = '在线项目完成天数=完成项目时间-开始参与项目时间'
this.isShowTips = true
},
// 弹出提示信息二
tipsSwiperClick() {
this.tipsContent = '是已获证人数/应参与人数*100%'
this.isShowTips = true
},
// 关闭提示信息
clickTips() {
this.isShowTips = false
},
// 文本截断
shortName: function (value, length = 15, append = '...') {
if (value && value.length > length) {
return value.substring(0, length) + append
......@@ -673,6 +653,7 @@ export default {
return value
}
},
// 映射Store中的Actions
...mapActions({
setProjectId: "setProjectId",
......@@ -690,9 +671,7 @@ export default {
<style lang="less" scoped>
.container {
// margin-top: 45px;
margin: 0 auto;
// min-height: 100vh;
font-size: 17px;
h1 {
font-size: 36px;
......@@ -703,9 +682,6 @@ export default {
> div {
width: 100%;
}
// img {
// width: 100%;
// }
}
.mt-10 {
margin-top: 0;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册