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

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

上级 97a26759
...@@ -56,9 +56,10 @@ export default { ...@@ -56,9 +56,10 @@ export default {
}, },
}, },
filters: { filters: {
// 将秒转换成分钟
convert: function (value, unitName = '分钟') { convert: function (value, unitName = '分钟') {
if(!value) return 0 + unitName; if(!value) return 0;
return Math.ceil(value / 60) return Math.ceil(value / 60);
}, },
}, },
components: { components: {
......
...@@ -59,20 +59,20 @@ export default { ...@@ -59,20 +59,20 @@ export default {
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
z-index: 2110; z-index: 10000001;
font-size: 20px; font-size: 20px;
.mask { .mask {
position: absolute; position: absolute;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 2111; z-index: 10000002;
} }
.content { .content {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
z-index: 2112; z-index: 10000003;
width: 300px; width: 300px;
// height: 185px; // height: 185px;
margin: -150px 0 0 -150px; margin: -150px 0 0 -150px;
......
<!-- Tabs组件 --> <!-- Tabs组件 -->
<template> <template>
<div class="common-process"> <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> </div>
</template> </template>
<script> <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 @@ ...@@ -51,7 +51,6 @@
<CommonTitleWithBtn title="人员学历情况" @btnClick="analysisEduClick"></CommonTitleWithBtn> <CommonTitleWithBtn title="人员学历情况" @btnClick="analysisEduClick"></CommonTitleWithBtn>
<ChartPieEdu :dataList="analysisEduData"></ChartPieEdu> <ChartPieEdu :dataList="analysisEduData"></ChartPieEdu>
<CommonSplitLine></CommonSplitLine> <CommonSplitLine></CommonSplitLine>
<!-- <CommonTitle title="人员职称情况"></CommonTitle> -->
<CommonTitleWithBtn title="人员职称情况" @btnClick="analysisTitleClick"></CommonTitleWithBtn> <CommonTitleWithBtn title="人员职称情况" @btnClick="analysisTitleClick"></CommonTitleWithBtn>
<ChartPieTitle :dataList="analysisTitleData"></ChartPieTitle> <ChartPieTitle :dataList="analysisTitleData"></ChartPieTitle>
<CommonBottomInfo></CommonBottomInfo> <CommonBottomInfo></CommonBottomInfo>
...@@ -141,7 +140,6 @@ import ChartPie from "@/components/bussiness/charts/chart-pie"; ...@@ -141,7 +140,6 @@ import ChartPie from "@/components/bussiness/charts/chart-pie";
import ChartPieEdu from "@/components/bussiness/charts/chart-pie-edu"; import ChartPieEdu from "@/components/bussiness/charts/chart-pie-edu";
import ChartPieTitle from "@/components/bussiness/charts/chart-pie-title"; import ChartPieTitle from "@/components/bussiness/charts/chart-pie-title";
import ChartColumnStack from "@/components/bussiness/charts/chart-column-stack"; 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 ChartColumnVerticalTimes from "@/components/bussiness/charts/chart-column-vertical-times";
import ChartColumnVerticalScore from "@/components/bussiness/charts/chart-column-vertical-score"; import ChartColumnVerticalScore from "@/components/bussiness/charts/chart-column-vertical-score";
import ChartColumnVerticalTC from "@/components/bussiness/charts/chart-column-vertical-tc"; import ChartColumnVerticalTC from "@/components/bussiness/charts/chart-column-vertical-tc";
...@@ -201,8 +199,6 @@ export default { ...@@ -201,8 +199,6 @@ export default {
tipsContent: '', tipsContent: '',
areaName: '全部', areaName: '全部',
orgName: '全部机构', orgName: '全部机构',
// :areaTitle="areaTitle"
// :orgTitle="orgTitle"
cIndex: 0, cIndex: 0,
colors: ["#39AF9A", "#FF9A4B", "#abb7bb", "#76d2d2"], colors: ["#39AF9A", "#FF9A4B", "#abb7bb", "#76d2d2"],
needBG: true, needBG: true,
...@@ -223,15 +219,8 @@ export default { ...@@ -223,15 +219,8 @@ export default {
costRankList: [], costRankList: [],
projectId: "", projectId: "",
token: token:
"0CFC560350E4499A902C4B02C2683ADE" || "BACBEEBBAE2247DBBD7CD0E15FE0CE93" ||
"A220943B006347799F277CC524EBB662" || "A220943B006347799F277CC524EBB662",
"B10441890E2940499621C76667675B2D" ||
// "17B31C94D44947829097A953BC7C2732" ||
"A0E52265D31B4D2380C7CFC9E1ACCDCE" ||
"A7F0A8A4BB5C4EC4B78E71261B753C9C" ||
"4281940A6A0C49F69F06BBC9E83DA90D" ||
"A62E9F92365547A29724F21F29BED4F6" ||
"4556EDEAAE134FE1B6E1356BF9C1B8F9",
isOrgStat: false, isOrgStat: false,
// 区域选择通用接口参数 // 区域选择通用接口参数
queryParams: { queryParams: {
...@@ -254,10 +243,6 @@ export default { ...@@ -254,10 +243,6 @@ export default {
type: 1 type: 1
} }
}, },
// examSingleParams: {
// projectId: "",
// hospitalId: ""
// },
echartsData: null, echartsData: null,
analysisData: { analysisData: {
eduList: { join: [], finish: []}, eduList: { join: [], finish: []},
...@@ -287,8 +272,8 @@ export default { ...@@ -287,8 +272,8 @@ export default {
containOfficialFlag: 0 // 0: 无正式考考试 1: 有正式考考试 containOfficialFlag: 0 // 0: 无正式考考试 1: 有正式考考试
}, },
courseInfo: { courseInfo: {
pCourseTotalTime: 100, pCourseTotalTime: 0,
pCourseAvg: 50, pCourseAvg: 0,
pCourseList: [] pCourseList: []
}, },
generalExamData: { generalExamData: {
...@@ -328,58 +313,40 @@ export default { ...@@ -328,58 +313,40 @@ export default {
areaDegree: "areaDegree" areaDegree: "areaDegree"
}), }),
}, },
async asyncData() { asyncData() {
return {}; return {};
}, },
created() { created() {
if (process.client) { if (process.client) {
this.projectId = this.projectId = (this.$router && this.$route.query && this.$route.query.projectId) || 374;
(this.$router && this.$route.query && this.$route.query.projectId) ||
374;
this.queryGDParams.projectId = this.projectId; this.queryGDParams.projectId = this.projectId;
this.CNTParams.projectId = this.projectId; this.CNTParams.projectId = this.projectId;
// this.examSingleParams.projectId = this.projectId;
this.queryParams.projectId = this.projectId; this.queryParams.projectId = this.projectId;
if (this.$rocNative.isWeb) { if (this.$rocNative.isWeb) {
this.setUserToken(this.token); this.setUserToken(this.token);
// cookies.remove("token");
cookies.set("lreporttoken", this.token); cookies.set("lreporttoken", this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
} else { } else {
this.getUserInfo(); this.getUserInfo();
} }
} }
// console.log(this.$route)
// console.log(this.$router)
// this.$store.dispatch('searchHospital', { name: '测试' }); // this.$store.dispatch('searchHospital', { name: '测试' });
}, },
mounted() { mounted() {
if (this.$rocNative.isWeb) { if (this.$rocNative.isWeb) {
this.getProvinceData(this.queryParams); this.getProjectInfo(this.queryParams);
} }
}, },
methods: { methods: {
// 切换机构人员列表中的tabs
orgDoctorTabChange(index) { orgDoctorTabChange(index) {
this.queryGDParams.pageCfg.type = index + 1; this.queryGDParams.pageCfg.type = index + 1;
this.getGeneralPersonal(this.queryGDParams); 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) { getProjectInfo(params) {
await getProjectInfo({ projectId: this.projectId }).then(res => { getProjectInfo({ projectId: this.projectId }).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.projectInfo = res.data; this.projectInfo = res.data;
getProvinceList(params).then(res => { getProvinceList(params).then(res => {
...@@ -394,8 +361,19 @@ export default { ...@@ -394,8 +361,19 @@ export default {
}); });
}, },
async getHospitalsCNT(params) { // 异步延迟调用其它Tabs接口(除了数据概述)
await getHospitalsCNT(params).then(res => { 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") { if (res.code === "000000") {
this.hospitalCnt = res.data.hospitalCnt; this.hospitalCnt = res.data.hospitalCnt;
this.isSingleOrg = res.data.hospitalCnt === 1; this.isSingleOrg = res.data.hospitalCnt === 1;
...@@ -407,17 +385,14 @@ export default { ...@@ -407,17 +385,14 @@ export default {
} else { } else {
this.getGeneralData(this.queryGDParams); this.getGeneralData(this.queryGDParams);
} }
this.getGeneralExam(this.queryGDParams); this.otherInterface();
this.getUserAnalysis(this.queryGDParams);
this.getGeneralCourse(this.queryGDParams);
this.getStudyEffect(this.queryGDParams);
} }
}); });
}, },
// 请求单个机构下的数据 // 请求单个机构下的数据(总体概述的数据)
async getGeneralPersonal(params) { getGeneralPersonal(params) {
await getGeneralPersonal(params).then(res => { getGeneralPersonal(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.allData = res.data; this.allData = res.data;
this.studyRankList = this.allData.studyRank || []; this.studyRankList = this.allData.studyRank || [];
...@@ -434,8 +409,8 @@ export default { ...@@ -434,8 +409,8 @@ export default {
}, },
// 请求多个机构下的数据 // 请求多个机构下的数据
async getGeneralData(queryData) { getGeneralData(queryData) {
await getGeneralData(queryData).then(res => { getGeneralData(queryData).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.allData = res.data; this.allData = res.data;
this.studyRankList = this.allData.studyRank || [] this.studyRankList = this.allData.studyRank || []
...@@ -446,8 +421,8 @@ export default { ...@@ -446,8 +421,8 @@ export default {
}, },
// 人群分析 // 人群分析
async getUserAnalysis(queryData) { getUserAnalysis(queryData) {
await getUserAnalysis(queryData).then(res => { getUserAnalysis(queryData).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.analysisData = res.data; this.analysisData = res.data;
this.analysisEduData = res.data.eduList.join; this.analysisEduData = res.data.eduList.join;
...@@ -457,9 +432,9 @@ export default { ...@@ -457,9 +432,9 @@ export default {
}, },
// 考试分析 // 考试分析
async getGeneralExam(queryData) { getGeneralExam(queryData) {
// 上面三个图标数据 // 上面三个图标数据
await getGeneralExam(queryData).then(res => { getGeneralExam(queryData).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.generalExamData = res.data; this.generalExamData = res.data;
this.setExamTimesList(res.data.examTimesList) this.setExamTimesList(res.data.examTimesList)
...@@ -484,7 +459,7 @@ export default { ...@@ -484,7 +459,7 @@ export default {
} }
}); });
// 下面一个列表数据 // 下面一个列表数据
await getGeneralExamList(queryData).then(res => { getGeneralExamList(queryData).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.examInfoList = res.data.examInfoList || [] this.examInfoList = res.data.examInfoList || []
} }
...@@ -492,8 +467,8 @@ export default { ...@@ -492,8 +467,8 @@ export default {
}, },
// 课程数据 // 课程数据
async getGeneralCourse(params) { getGeneralCourse(params) {
await getGeneralCourse(params).then(res => { getGeneralCourse(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.processDataObj = { this.processDataObj = {
maxDuration: res.data.pCourseTotalTime, maxDuration: res.data.pCourseTotalTime,
...@@ -508,8 +483,8 @@ export default { ...@@ -508,8 +483,8 @@ export default {
}, },
// 学习效果分析 // 学习效果分析
async getStudyEffect(params) { getStudyEffect(params) {
await getStudyEffect(params).then(res => { getStudyEffect(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.studyEffect = res.data; this.studyEffect = res.data;
this.effectCardList[0].count = (res.data.beforeRate * 100).toFixed(1); this.effectCardList[0].count = (res.data.beforeRate * 100).toFixed(1);
...@@ -528,6 +503,8 @@ export default { ...@@ -528,6 +503,8 @@ export default {
// this.setOrgList([]); // this.setOrgList([]);
// this.setRegionId // this.setRegionId
}, },
// 确认选择区域
areaConfirm(selData) { areaConfirm(selData) {
this.clearParams(); this.clearParams();
this.queryGDParams.regionId = selData.regionId; this.queryGDParams.regionId = selData.regionId;
...@@ -535,21 +512,18 @@ export default { ...@@ -535,21 +512,18 @@ export default {
this.getHospitalsCNT(this.CNTParams); this.getHospitalsCNT(this.CNTParams);
this.isShowArea = false; this.isShowArea = false;
this.setAreaDegree(selData.areaDegree); this.setAreaDegree(selData.areaDegree);
// orgConfirm
if(selData.townName || selData.countyName || selData.cityName || selData.provinceName) { if(selData.townName || selData.countyName || selData.cityName || selData.provinceName) {
this.areaName = this.shortName(selData.townName || selData.countyName || selData.cityName || selData.provinceName, 6) 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() { areaCancel() {
this.isShowArea = false; this.isShowArea = false;
}, },
orgConfirm(selData) {
// this.$toast('res.message');
// 确认选择机构
orgConfirm(selData) {
let hospitalIds = []; let hospitalIds = [];
let hospitalNames = []; let hospitalNames = [];
let orgName = ''; let orgName = '';
...@@ -560,7 +534,6 @@ export default { ...@@ -560,7 +534,6 @@ export default {
} }
}); });
// this.queryGDParams.hospitalIdList = hospitalIds
// 如果没有选择机构,则重新获取所有数据 // 如果没有选择机构,则重新获取所有数据
this.isShowOrg = false; this.isShowOrg = false;
this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6); this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6);
...@@ -577,24 +550,29 @@ export default { ...@@ -577,24 +550,29 @@ export default {
this.isSingleOrg = false; this.isSingleOrg = false;
this.getGeneralData(this.queryGDParams); this.getGeneralData(this.queryGDParams);
} }
this.getGeneralExam(this.queryGDParams); this.otherInterface();
this.getUserAnalysis(this.queryGDParams); // setTimeout(() => {
this.getGeneralCourse(this.queryGDParams); // this.getUserAnalysis(this.queryGDParams);
this.getStudyEffect(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() { orgCancel() {
this.isShowOrg = false; this.isShowOrg = false;
}, },
// 弹出选择区域控件
areaTabClick() { areaTabClick() {
if(this.isShowOrg) { if(this.isShowOrg) {
this.isShowOrg = false; this.isShowOrg = false;
} }
this.isShowArea = !this.isShowArea; this.isShowArea = !this.isShowArea;
}, },
// 弹出选择机构控件
orgTabClick() { orgTabClick() {
// if(this.isShowArea) {
// this.isShowArea = false;
// }
if(this.areaDegree !== 3 && this.areaDegree !== 4) { if(this.areaDegree !== 3 && this.areaDegree !== 4) {
this.$toast('选择区/县后才可选择机构'); this.$toast('选择区/县后才可选择机构');
return; return;
...@@ -606,11 +584,6 @@ export default { ...@@ -606,11 +584,6 @@ export default {
this.isShowOrg = !this.isShowOrg; this.isShowOrg = !this.isShowOrg;
}, },
resizeTheChart() {
if (this.$refs.runTimes_creditChart) {
this.$refs.runTimes_creditChart.resize();
}
},
// 通用跳转页面 // 通用跳转页面
gotoPage(subUrl, hasCert) { gotoPage(subUrl, hasCert) {
...@@ -626,16 +599,15 @@ export default { ...@@ -626,16 +599,15 @@ export default {
} }
}, },
// 人员学历情况切换按钮
analysisEduClick(index) { analysisEduClick(index) {
// if(index === 0) {
// this.analysisEduData = this.analysisData.eduList && this.analysisData.eduList.join
// }
this.analysisEduData = this.analysisData.eduList[ this.analysisEduData = this.analysisData.eduList[
index ? "finish" : "join" index ? "finish" : "join"
] || []; ] || [];
this.$forceUpdate(); this.$forceUpdate();
}, },
// 人员职称情况切换按钮
analysisTitleClick(index) { analysisTitleClick(index) {
this.analysisTitleData = this.analysisData.titleList[ this.analysisTitleData = this.analysisData.titleList[
index ? "finish" : "join" index ? "finish" : "join"
...@@ -652,20 +624,28 @@ export default { ...@@ -652,20 +624,28 @@ export default {
cookies.set("lreporttoken", this.token); cookies.set("lreporttoken", this.token);
this.setUserToken(this.token); this.setUserToken(this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
this.getProvinceData(this.queryParams); this.getProjectInfo(this.queryParams);
}); });
}, },
// 弹出提示信息一
tipsRankingItemClick() { tipsRankingItemClick() {
this.tipsContent = '在线项目完成天数=完成项目时间-开始参与项目时间' this.tipsContent = '在线项目完成天数=完成项目时间-开始参与项目时间'
this.isShowTips = true this.isShowTips = true
}, },
// 弹出提示信息二
tipsSwiperClick() { tipsSwiperClick() {
this.tipsContent = '是已获证人数/应参与人数*100%' this.tipsContent = '是已获证人数/应参与人数*100%'
this.isShowTips = true this.isShowTips = true
}, },
// 关闭提示信息
clickTips() { clickTips() {
this.isShowTips = false this.isShowTips = false
}, },
// 文本截断
shortName: function (value, length = 15, append = '...') { shortName: function (value, length = 15, append = '...') {
if (value && value.length > length) { if (value && value.length > length) {
return value.substring(0, length) + append return value.substring(0, length) + append
...@@ -673,6 +653,7 @@ export default { ...@@ -673,6 +653,7 @@ export default {
return value return value
} }
}, },
// 映射Store中的Actions // 映射Store中的Actions
...mapActions({ ...mapActions({
setProjectId: "setProjectId", setProjectId: "setProjectId",
...@@ -690,9 +671,7 @@ export default { ...@@ -690,9 +671,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.container { .container {
// margin-top: 45px;
margin: 0 auto; margin: 0 auto;
// min-height: 100vh;
font-size: 17px; font-size: 17px;
h1 { h1 {
font-size: 36px; font-size: 36px;
...@@ -703,9 +682,6 @@ export default { ...@@ -703,9 +682,6 @@ export default {
> div { > div {
width: 100%; width: 100%;
} }
// img {
// width: 100%;
// }
} }
.mt-10 { .mt-10 {
margin-top: 0; margin-top: 0;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册