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

课程长度样式、选择样式等逻辑

上级 ad565851
<!-- 课程时长统计 -->
<template>
<div>
<ul class="lr-course-times" v-show="maxDuration > avgDuration">
<li>
<p>
课程总时长
<span>(所有课程数 {{totalSize}}门)</span>
</p>
<ProcessBar :processDataObj="processDataObj" :maxValue="maxDuration" :value="maxDuration"></ProcessBar>
</li>
<li>
<p>平均学习时长</p>
<ProcessBar2 barColor="#FFB01A" :maxValue="maxDuration" :value="avgDuration"></ProcessBar2>
</li>
</ul>
<ul class="lr-course-times" v-show="avgDuration > maxDuration">
<li>
<p>
课程总时长
<span>(所有课程数 {{totalSize}}门)</span>
</p>
<ProcessBar :processDataObj="processDataObj" :maxValue="avgDuration" :value="maxDuration"></ProcessBar>
</li>
<li>
<p>平均学习时长</p>
<ProcessBar2 barColor="#FFB01A" :maxValue="avgDuration" :value="avgDuration"></ProcessBar2>
</li>
</ul>
</div>
</template>
<script>
import ProcessBar from "@/components/common/pica-process";
import ProcessBar2 from "@/components/common/pica-process2";
export default {
props: {
totalSize: {
type: Number | String,
default: 0
},
maxDuration: {
type: Number | String,
default: 100
},
avgDuration: {
type: Number | String,
default: 100
},
processDataObj: {
type: Object,
default: () => {
return {
maxValue: 100,
value: 0
}
}
},
},
components: {
ProcessBar,
ProcessBar2
},
methods: {}
};
</script>
<style lang="scss" scoped>
.lr-course-times {
margin: 20px 15px;
li {
margin: 20px 0;
p {
height: 14px;
line-height: 14px;
margin: 6px 0;
font-size: 14px;
color: #676869;
span {
font-size: 14px;
font-weight: 400;
color: #979899;
}
}
}
}
</style>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</li> </li>
<li> <li>
<p>平均学习时长</p> <p>平均学习时长</p>
<ProcessBar barColor="#FFB01A" :maxValue="maxDuration" :value="avgDuration"></ProcessBar> <ProcessBar barColor="#FFB01A" :processDataObj="processDataObj" :maxValue="maxDuration" :value="avgDuration"></ProcessBar>
</li> </li>
</ul> </ul>
<ul class="lr-course-times" v-show="avgDuration > maxDuration"> <ul class="lr-course-times" v-show="avgDuration > maxDuration">
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
课程总时长 课程总时长
<span>(所有课程数 {{totalSize}}门)</span> <span>(所有课程数 {{totalSize}}门)</span>
</p> </p>
<ProcessBar :processDataObj="processDataObj" :maxValue="avgDuration" :value="avgDuration"></ProcessBar> <ProcessBar :processDataObj="processDataObj" :maxValue="avgDuration" :value="maxDuration"></ProcessBar>
</li> </li>
<li> <li>
<p>平均学习时长</p> <p>平均学习时长</p>
<ProcessBar barColor="#FFB01A" :maxValue="avgDuration" :value="maxDuration"></ProcessBar> <ProcessBar barColor="#FFB01A" :processDataObj="processDataObj" :maxValue="avgDuration" :value="avgDuration"></ProcessBar>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
}, },
}, },
components: { components: {
ProcessBar ProcessBar,
}, },
methods: {} methods: {}
}; };
......
...@@ -39,7 +39,12 @@ export default { ...@@ -39,7 +39,12 @@ export default {
areaDegree: 'areaDegree' areaDegree: 'areaDegree'
}), }),
isNotVisible() { isNotVisible() {
return this.orgList.length == 0 || this.areaDegree == 0 || this.areaDegree == 1 || this.areaDegree == 2 if(this.orgList.length == 0 || this.areaDegree == 0 || this.areaDegree == 1 || this.areaDegree == 2) {
return true;
} else {
return false;
}
// return this.orgList.length == 0 || this.areaDegree == 0 || this.areaDegree == 1 || this.areaDegree == 2
} }
}, },
// watch: { // watch: {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
{{ {{
value.provinceName value.provinceName
? value.provinceName ? value.provinceName
: '请选择1' : '请选择'
}} }}
</li> </li>
<li <li
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
:class="{ active: isShowCity }" :class="{ active: isShowCity }"
class="item" class="item"
@click="tabAddressClick(2)" @click="tabAddressClick(2)"
>{{ value.cityName ? value.cityName : '请选择2' }}</li> >{{ value.cityName ? value.cityName : '请选择' }}</li>
<li <li
v-show="value.cityName && rank>2" v-show="value.cityName && rank>2"
:class="{ active: isShowCounty }" :class="{ active: isShowCounty }"
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
@click="tabAddressClick(3)" @click="tabAddressClick(3)"
> >
{{ {{
value.countyName ? value.countyName : '请选择3' value.countyName ? value.countyName : '请选择'
}} }}
</li> </li>
<li <li
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
:class="{ active: isShowTown }" :class="{ active: isShowTown }"
class="item" class="item"
@click="tabAddressClick(4)" @click="tabAddressClick(4)"
>{{ value.townName ? value.townName : '请选择4' }}</li> >{{ value.townName ? value.townName : '请选择' }}</li>
</ul> </ul>
<div class="address-content" @touchmove.stop> <div class="address-content" @touchmove.stop>
<ul v-show="isShowProvince" id="province"> <ul v-show="isShowProvince" id="province">
...@@ -300,12 +300,12 @@ export default { ...@@ -300,12 +300,12 @@ export default {
// 当前选中的样式 // 当前选中的样式
this.areaList.provinceList.map(a => (a.selected = false)); this.areaList.provinceList.map(a => (a.selected = false));
this.areaList.provinceList[idx].selected = true; this.areaList.provinceList[idx].selected = true;
this.setAreaDegree(item.degree)
if(item.degree == 0){ if(item.degree == 0){
return; return;
} }
if(item.degree == 3 || item.degree == 4){ if(item.degree == 3 || item.degree == 4){
// 调用机构接口 // 调用机构接口
this.setAreaDegree(item.degree)
this.getHospitalsByRegionId(this.queryParams); this.getHospitalsByRegionId(this.queryParams);
// return; // return;
} }
...@@ -339,12 +339,12 @@ export default { ...@@ -339,12 +339,12 @@ export default {
// 当前选中的样式 // 当前选中的样式
this.areaList.cityList.map(a => (a.selected = false)); this.areaList.cityList.map(a => (a.selected = false));
this.areaList.cityList[idx].selected = true; this.areaList.cityList[idx].selected = true;
this.setAreaDegree(item.degree)
if(item.degree == 0){ if(item.degree == 0){
return; return;
} }
if(item.degree == 3 || item.degree == 4){ if(item.degree == 3 || item.degree == 4){
// 调用机构接口 // 调用机构接口
this.setAreaDegree(item.degree)
this.getHospitalsByRegionId(this.queryParams); this.getHospitalsByRegionId(this.queryParams);
// return; // return;
} }
...@@ -373,12 +373,12 @@ export default { ...@@ -373,12 +373,12 @@ export default {
// 当前选中的样式 // 当前选中的样式
this.areaList.countyList.map(a => (a.selected = false)); this.areaList.countyList.map(a => (a.selected = false));
this.areaList.countyList[idx].selected = true; this.areaList.countyList[idx].selected = true;
this.setAreaDegree(item.degree)
if(item.degree == 0){ if(item.degree == 0){
return; return;
} }
if(item.degree == 3 || item.degree == 4){ if(item.degree == 3 || item.degree == 4){
// 调用机构接口 // 调用机构接口
this.setAreaDegree(item.degree)
this.getHospitalsByRegionId(this.queryParams); this.getHospitalsByRegionId(this.queryParams);
// return; // return;
} }
...@@ -402,12 +402,12 @@ export default { ...@@ -402,12 +402,12 @@ export default {
this.queryParams.regionId = item.id; this.queryParams.regionId = item.id;
this.value.townName = item.label; this.value.townName = item.label;
this.value.patientAddress = `${this.value.provinceName}${this.value.cityName}${this.value.countyName}${this.value.townName}`; this.value.patientAddress = `${this.value.provinceName}${this.value.cityName}${this.value.countyName}${this.value.townName}`;
this.setAreaDegree(item.degree)
if(item.degree == 0){ if(item.degree == 0){
return; return;
} }
if(item.degree == 3 || item.degree == 4){ if(item.degree == 3 || item.degree == 4){
// 调用机构接口 // 调用机构接口
this.setAreaDegree(item.degree)
this.getHospitalsByRegionId(this.queryParams); this.getHospitalsByRegionId(this.queryParams);
// return; // return;
} }
......
...@@ -35,6 +35,10 @@ export default { ...@@ -35,6 +35,10 @@ export default {
unitName: { unitName: {
type: String, type: String,
default: '分钟' default: '分钟'
},
processWidth: {
type: String,
default: '0px'
} }
}, },
data() { data() {
...@@ -42,12 +46,6 @@ export default { ...@@ -42,12 +46,6 @@ export default {
maxPocessWidth: '0px' maxPocessWidth: '0px'
} }
}, },
// computed: {
// test() {
// }
// },
watch: { watch: {
processDataObj: { processDataObj: {
handler(newVal) { handler(newVal) {
...@@ -55,33 +53,20 @@ export default { ...@@ -55,33 +53,20 @@ export default {
let clientWidth = window.outerWidth || document.body.clientWidth || document.documentElement.clientWidth; let clientWidth = window.outerWidth || document.body.clientWidth || document.documentElement.clientWidth;
let maxWidth = clientWidth - this.valueDescWidth; let maxWidth = clientWidth - this.valueDescWidth;
let ratio = 1; let ratio = 1;
if(this.processDataObj.maxDuration && this.processDataObj.maxDuration < this.processDataObj.avgDuration) { if(this.maxValue && this.maxValue < this.value) {
ratio = this.processDataObj.maxDuration / this.processDataObj.avgDuration; ratio = this.maxValue / this.value;
}
if(!this.processDataObj.maxDuration) {
ratio = 0.01;
} }
this.maxPocessWidth = Math.round(ratio * maxWidth) + 'px' if(this.value && this.maxValue > this.value) {
ratio = this.value / this.maxValue;
}
this.maxPocessWidth = Math.round(ratio * maxWidth) + 'px'
} }
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
// let maxWidth = window.clien
// scrollWidth offsetWidth
// this.$nextTick(() => {
// let clientWidth = window.outerWidth || document.body.clientWidth || document.documentElement.clientWidth;
// let maxWidth = clientWidth - this.valueDescWidth;
// let ratio = 1;
// if(this.value && this.value < this.avgDuration) {
// ratio = this.value / this.avgDuration;
// }
// if(!this.value) {
// ratio = 0.01;
// }
// this.maxPocessWidth = Math.round(ratio * maxWidth) + 'px'
// })
}, },
methods: {} methods: {}
}; };
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<!-- 课程分析 --> <!-- 课程分析 -->
<article v-show="(cIndex === 2) && (projectInfo.existCourse == 1)" style="padding-top: 8px;"> <article v-show="(cIndex === 2) && (projectInfo.existCourse == 1)" style="padding-top: 8px;">
<CourseTimesStat :processDataObj="processDataObj" :totalSize="courseInfo.totalSize" :maxDuration="courseInfo.pCourseTotalTime" :avgDuration="courseInfo.pCourseAvg"></CourseTimesStat> <CourseTimesStat :totalSize="courseInfo.totalSize" :maxDuration="courseInfo.pCourseTotalTime" :avgDuration="courseInfo.pCourseAvg" :processDataObj="processDataObj"></CourseTimesStat>
<CommonSplitLine></CommonSplitLine> <CommonSplitLine></CommonSplitLine>
<CommonTitle title="课程列表"></CommonTitle> <CommonTitle title="课程列表"></CommonTitle>
<CourseTimesList :dataList="courseInfo.pCourseList"></CourseTimesList> <CourseTimesList :dataList="courseInfo.pCourseList"></CourseTimesList>
...@@ -269,9 +269,9 @@ export default { ...@@ -269,9 +269,9 @@ export default {
}, },
projectInfo: { projectInfo: {
certFlag: 0, // 项目证书情况 0:无证;1:单证书;2:多证书 certFlag: 0, // 项目证书情况 0:无证;1:单证书;2:多证书
existCourse: 1, // 是否显示课程分析 1:显示 2:不显示 existCourse: 2, // 是否显示课程分析 1:显示 2:不显示
existEffect: 1, // 是否显示学习效果分析 1:显示 2:不显示 existEffect: 2, // 是否显示学习效果分析 1:显示 2:不显示
existExam: 1, // 是否显示考试分析 1:显示 2:不显示 existExam: 2, // 是否显示考试分析 1:显示 2:不显示
roleType: 0, // 0:普通人 1:内部管理员 2:项目负责人 3:次级负责人 roleType: 0, // 0:普通人 1:内部管理员 2:项目负责人 3:次级负责人
status: 0 // 是否显示查看原始数据 1:显示 2:不显示 status: 0 // 是否显示查看原始数据 1:显示 2:不显示
}, },
......
...@@ -87,6 +87,6 @@ export default { ...@@ -87,6 +87,6 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mt-10 { .mt-10 {
margin-top: -10px !important; margin-top: 10px !important;
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册