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

单证书情况

上级 73814a85
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
<script> <script>
import { format } from "path"; import { format } from "path";
let vm = null; let vm = null;
let certNameConfig = {
'-1': '未获证人数',
'1': '获优秀人数',
'2': '获良好人数',
'3': '获及格人数',
'4': '获不及格人数',
}
export default { export default {
props: { props: {
id: { id: {
...@@ -24,6 +31,10 @@ export default { ...@@ -24,6 +31,10 @@ export default {
echartsData: { echartsData: {
type: Array, type: Array,
default: () => [] default: () => []
},
certFlag: {
type: String | Number,
default: 1
} }
}, },
data() { data() {
...@@ -43,7 +54,19 @@ export default { ...@@ -43,7 +54,19 @@ export default {
vm.legendData = []; vm.legendData = [];
vm.yAxisData = []; vm.yAxisData = [];
vm.seriesData = []; vm.seriesData = [];
let cData, certList, certLength = 0, certData = []
let cData, certList, certLength = 0, certData = [], certId = 0, certName = '其它';
// 将所有证书名称进行修改
for(let i = 0; i < newVal.length; i ++) {
for(let j = 0; j < newVal[i].certList.length; j ++) {
if(vm.certFlag == 1 && newVal[i].certList[j].id != -1) { // 如果是单证书
newVal[i].certList[j].name = '已获证人数'
} else {
newVal[i].certList[j].name = certNameConfig[newVal[i].certList[j].id];
}
}
}
for(let i = 0; i < newVal.length; i ++){ for(let i = 0; i < newVal.length; i ++){
certData = []; certData = [];
cData = newVal[i]; cData = newVal[i];
...@@ -54,6 +77,20 @@ export default { ...@@ -54,6 +77,20 @@ export default {
certList = cData.certList; certList = cData.certList;
certData.push(certList[j].value); certData.push(certList[j].value);
if(i == 0) { if(i == 0) {
// certId = certList[j].certId
// if(certId == -1) {
// certName = '未获证人数'
// } else if(certId == 1) {
// certName = '获优秀人数'
// } else if(certId == 2) {
// certName = '获良好人数'
// } else if(certId == 3) {
// certName = '获及格人数'
// } else if(certId == 3) {
// certName = '获不及格人数'
// } else {
// certName = '其它'
// }
vm.legendData.push(certList[j].name); vm.legendData.push(certList[j].name);
// vm.yAxisData.push(certList[j].name); // vm.yAxisData.push(certList[j].name);
} }
...@@ -117,7 +154,45 @@ export default { ...@@ -117,7 +154,45 @@ export default {
axisPointer: { axisPointer: {
// 坐标轴指示器,坐标轴触发有效 // 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow' type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter: function (params) {
let relVal = params[0].name + "人数:";
let value = 0;
for (let i = 0, l = params.length; i < l; i++) {
value += params[i].value;
}
relVal += value + "人";
let divList = [];
divList[0] = "<div style='background: #3BA0FF;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #FF9A4B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[3] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[4] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = params.length - 1; j >= 0; j--) {
if(value != 0) {
relVal +=
"<br/>" + divList[j] +
params[j].seriesName +
"占比: " +
(
(100 * parseFloat(params[j].value)) /
parseFloat(value)
).toFixed(1) +
"%";
} else {
relVal +=
"<br/>" + divList[j] +
params[j].seriesName +
"占比: "+ "0%";
}
}
return relVal;
} }
// formatter: "{b}<br/>{a0}: {c0} + {c1}%<br/>{a1}: {c2}%"
// formatter: function(config) {
// console.log('config', config);
// }
}, },
legend: { legend: {
top: 20, top: 20,
......
...@@ -40,7 +40,8 @@ export default { ...@@ -40,7 +40,8 @@ export default {
axisPointer: { axisPointer: {
// 坐标轴指示器,坐标轴触发有效 // 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow' type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
} },
formatter: '{b}分获得人数{c0}人'
}, },
// legend: { // legend: {
// top: 20, // top: 20,
...@@ -85,7 +86,7 @@ export default { ...@@ -85,7 +86,7 @@ export default {
width: 1, width: 1,
type: 'solid' type: 'solid'
} }
   }    },
}, },
xAxis: { xAxis: {
axisTick: false, axisTick: false,
...@@ -97,7 +98,7 @@ export default { ...@@ -97,7 +98,7 @@ export default {
color: "#676869" color: "#676869"
}, },
axisLabel: { axisLabel: {
formatter: "{value}", formatter: "{value}",
textStyle: { textStyle: {
color: "#676869" color: "#676869"
} }
...@@ -108,6 +109,14 @@ export default { ...@@ -108,6 +109,14 @@ export default {
width: 1 width: 1
} }
}, },
label: {
formatter: "{c}%",
// normal: {
// formatter: "{c}%",
// show: true,
// position: "inside"
// }
}
}, },
series: [ series: [
{ {
...@@ -126,7 +135,7 @@ export default { ...@@ -126,7 +135,7 @@ export default {
handler(newVal) { handler(newVal) {
// debugger // debugger
this.xAxisData = newVal.map( item => { this.xAxisData = newVal.map( item => {
return item.timesStr return item.times
}) })
this.seriesData = newVal.map( item => { this.seriesData = newVal.map( item => {
return item.count return item.count
...@@ -145,18 +154,6 @@ export default { ...@@ -145,18 +154,6 @@ export default {
document.body.clientWidth || document.body.clientWidth ||
document.documentElement.clientWidth; document.documentElement.clientWidth;
this.chartWidth = (clientWidth * 0.9).toFixed(1) + 'px'; this.chartWidth = (clientWidth * 0.9).toFixed(1) + 'px';
console.log(clientWidth);
// if (clientWidth <= 320) {
// this.chartWidth = "260px";
// } else if (clientWidth <= 360) {
// this.chartWidth = "320px";
// } else if (clientWidth <= 375) {
// this.chartWidth = "340px";
// } else if (clientWidth <= 414) {
// this.chartWidth = "375px";
// } else {
// this.chartWidth = (clientWidth * 0.8).toFixed(1) + 'px';
// }
} }
}, },
mounted() { mounted() {
......
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
axisPointer: { axisPointer: {
// 坐标轴指示器,坐标轴触发有效 // 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow' type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
} },
formatter: '{b}完成人数{c0}人'
}, },
// legend: { // legend: {
// top: 20, // top: 20,
......
...@@ -10,6 +10,13 @@ import { echartColors } from '@/utils/index' ...@@ -10,6 +10,13 @@ import { echartColors } from '@/utils/index'
let vm = null; let vm = null;
let chartPie = null; let chartPie = null;
let options = null; let options = null;
let certNameConfig = {
'-1': '未获证人数',
'1': '获优秀人数',
'2': '获良好人数',
'3': '获及格人数',
'4': '获不及格人数',
}
export default { export default {
props: { props: {
id: { id: {
...@@ -23,6 +30,10 @@ export default { ...@@ -23,6 +30,10 @@ export default {
{ value: 10, name: "及格证书" }, { value: 10, name: "及格证书" },
{ value: 10, name: "未获证" } { value: 10, name: "未获证" }
] ]
},
certFlag: {
type: String | Number,
default: 1
} }
}, },
data() { data() {
...@@ -37,6 +48,14 @@ export default { ...@@ -37,6 +48,14 @@ export default {
watch: { watch: {
pieData: { pieData: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
// 处理数据
for(let i = 0; i < newValue.length; i ++) {
if(this.certFlag == 1 && newValue[i].certId != -1) {
newValue[i].certName = '已获证人数'
} else {
newValue[i].certName = certNameConfig[newValue[i].certId];
}
}
this.handlePieData(newValue); this.handlePieData(newValue);
this.drawPie(); this.drawPie();
}, },
...@@ -45,9 +64,9 @@ export default { ...@@ -45,9 +64,9 @@ export default {
}, },
mounted() { mounted() {
vm = this; vm = this;
this.legendData = ["优秀证书", "及格证书", "未获证"]; // this.legendData = ["优秀证书", "及格证书", "未获证"];
this.seriesData = vm.pieData; // this.seriesData = vm.pieData;
this.drawPie(); // this.drawPie();
}, },
methods: { methods: {
handlePieData(pieData) { handlePieData(pieData) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<li v-for="(item, index) in certUserList" :key="index"> <li v-for="(item, index) in certUserList" :key="index">
<span>{{(item.doctorName || '- ' ) | shortName}}</span> <span>{{(item.doctorName || '- ' ) | shortName}}</span>
<span>{{(item.departmentName || '- ') | shortName}}</span> <span>{{(item.departmentName || '- ') | shortName}}</span>
<span>成绩 {{item.score || '- '}}</span> <span v-show="containOfficialFlag">成绩 {{item.score || '- '}}</span>
</li> </li>
</ul> </ul>
<ul v-show="cIndex === 1" class="list"> <ul v-show="cIndex === 1" class="list">
...@@ -61,6 +61,10 @@ export default { ...@@ -61,6 +61,10 @@ export default {
certFlag: { certFlag: {
type: String | Number, type: String | Number,
default: 0 default: 0
},
containOfficialFlag: {
type: String | Number,
default: 0
} }
}, },
watch: { watch: {
......
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
console.log('getProvinceData') console.log('getProvinceData')
await getProvinceList(params).then(res => { await getProvinceList(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.areaList.provinceList = res.data.list; this.areaList.provinceList = res.data && res.data.list || [];
console.log(this.areaList.provinceList); console.log(this.areaList.provinceList);
this.areaList.provinceList.map(a => { this.areaList.provinceList.map(a => {
if (a.id == this.value.provinceId) { if (a.id == this.value.provinceId) {
...@@ -221,7 +221,7 @@ export default { ...@@ -221,7 +221,7 @@ export default {
console.log('getCityData') console.log('getCityData')
await getCityList(params).then(res => { await getCityList(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.areaList.cityList = res.data.list; this.areaList.cityList = res.data && res.data.list || [];
if (this.areaList.cityList.length === 0) { if (this.areaList.cityList.length === 0) {
this.isShowProvince = true; this.isShowProvince = true;
this.isShowCity = false; this.isShowCity = false;
...@@ -239,7 +239,7 @@ export default { ...@@ -239,7 +239,7 @@ export default {
console.log('getCountyData') console.log('getCountyData')
await getCountyList(params).then(res => { await getCountyList(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.areaList.countyList = res.data.list; this.areaList.countyList = res.data && res.data.list || [];
if (this.areaList.countyList.length === 0) { if (this.areaList.countyList.length === 0) {
this.isShowProvince = false; this.isShowProvince = false;
this.isShowCity = true; this.isShowCity = true;
...@@ -258,7 +258,7 @@ export default { ...@@ -258,7 +258,7 @@ export default {
console.log('getTownData') console.log('getTownData')
await getTownList(params).then(res => { await getTownList(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.areaList.townList = res.data.list; this.areaList.townList = res.data && res.data.list || [];
if (this.areaList.townList.length === 0) { if (this.areaList.townList.length === 0) {
this.isShowProvince = false; this.isShowProvince = false;
this.isShowCity = false; this.isShowCity = false;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
:noCertUserList="orgDoctorTabData.noCertUserList" :noCertUserList="orgDoctorTabData.noCertUserList"
:noJoinList="orgDoctorTabData.noJoinList" :noJoinList="orgDoctorTabData.noJoinList"
:certFlag="projectInfo.certFlag" :certFlag="projectInfo.certFlag"
:containOfficialFlag="projectInfo.containOfficialFlag"
></OrgDoctorList> ></OrgDoctorList>
</div> </div>
<CommonBottomInfo></CommonBottomInfo> <CommonBottomInfo></CommonBottomInfo>
...@@ -279,7 +280,8 @@ export default { ...@@ -279,7 +280,8 @@ export default {
existEffect: 2, // 是否显示学习效果分析 1:显示 2:不显示 existEffect: 2, // 是否显示学习效果分析 1:显示 2:不显示
existExam: 2, // 是否显示考试分析 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:不显示
containOfficialFlag: 0 // 0: 无正式考考试 1: 有正式考考试
}, },
courseInfo: { courseInfo: {
pCourseTotalTime: 100, pCourseTotalTime: 100,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册