|
@@ -131,8 +131,8 @@
|
|
|
<div class="compare_class">
|
|
|
<div class="compare_user1" style="position: relative">
|
|
|
<div class="compare_user1_out">
|
|
|
- <img v-show="userGender1=='1'" src="../assets/report/man1.png" />
|
|
|
- <img v-show="userGender1=='0'" src="../assets/report/woman1.png" />
|
|
|
+ <img v-show="userGender1 == '1'" src="../assets/report/man1.png" />
|
|
|
+ <img v-show="userGender1 == '0'" src="../assets/report/woman1.png" />
|
|
|
<div class="compare_user1_info">
|
|
|
<div v-if="multipleSelection.length == 2">
|
|
|
姓名:{{ multipleSelection[0].userName }}
|
|
@@ -151,8 +151,8 @@
|
|
|
</div>
|
|
|
<div class="compare_user2">
|
|
|
<div class="compare_user1_out">
|
|
|
- <img v-show="userGender2=='1'" src="../assets/report/man1.png" />
|
|
|
- <img v-show="userGender2=='0'" src="../assets/report/woman1.png" />
|
|
|
+ <img v-show="userGender2 == '1'" src="../assets/report/man1.png" />
|
|
|
+ <img v-show="userGender2 == '0'" src="../assets/report/woman1.png" />
|
|
|
<div class="compare_user1_info">
|
|
|
<div v-if="multipleSelection.length == 2">
|
|
|
姓名:{{ multipleSelection[1].userName }}
|
|
@@ -192,12 +192,21 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div
|
|
|
ref="echarts_ld"
|
|
|
- style="width: 100%; height: 600px; margin-top:20px"
|
|
|
+ style="width: 100%; height: 600px; margin-top: 20px"
|
|
|
></div>
|
|
|
- <div style="text-align: center;font-weight: 700;font-size: 16px;margin-bottom:5px">柱状图维度对比</div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ text-align: center;
|
|
|
+ font-weight: 700;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 柱状图维度对比
|
|
|
+ </div>
|
|
|
<div ref="echarts_zhu" style="width: 100%; height: 600px"></div>
|
|
|
<div class="cpmpare_all" v-if="userData1.length > 0 && userData2.length > 0">
|
|
|
<div v-for="(item, index) in userData1" :key="item.id">
|
|
@@ -429,8 +438,8 @@ export default {
|
|
|
optionTT: {},
|
|
|
|
|
|
userData1: {},
|
|
|
- userGender1:"1",
|
|
|
- userGender2:'1',
|
|
|
+ userGender1: "1",
|
|
|
+ userGender2: "1",
|
|
|
orgName1: "",
|
|
|
orgName2: "",
|
|
|
//用户1的测试用时
|
|
@@ -674,7 +683,9 @@ export default {
|
|
|
|
|
|
//对比方法
|
|
|
isCompare() {
|
|
|
+ console.log(this.multipleSelection);
|
|
|
//判断是否是选了两个用户
|
|
|
+
|
|
|
if (this.multipleSelection.length != 2) {
|
|
|
this.$message({
|
|
|
message: "请选两个进行对比",
|
|
@@ -682,6 +693,25 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.multipleSelection.length == 2) {
|
|
|
+ let has = false;
|
|
|
+ for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
+ if (this.multipleSelection[i].isComplete == "0") {
|
|
|
+ has = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ if (has) {
|
|
|
+ this.$message({
|
|
|
+ message: "选项中不能含有未完成的",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.compareVisible = true;
|
|
|
this.queryDetail1(this.multipleSelection[0].id);
|
|
|
this.queryDetail2(this.multipleSelection[1].id);
|
|
@@ -695,19 +725,29 @@ export default {
|
|
|
if (res && res.code == 200) {
|
|
|
this.useTime1 = res.data.usedTime;
|
|
|
this.orgName1 = res.data.user.orgName;
|
|
|
- this.userGender1=res.data.user.gender
|
|
|
+ this.userGender1 = res.data.user.gender;
|
|
|
let a = res.data.report;
|
|
|
|
|
|
- let listTmp2 =[]
|
|
|
- listTmp2=a.filter((item)=>{
|
|
|
- return item.dimensionName=='总分'||item.dimensionName=='压力'||item.dimensionName=='焦虑'||item.dimensionName=='抑郁'
|
|
|
- })
|
|
|
+ let listTmp2 = [];
|
|
|
+ listTmp2 = a.filter((item) => {
|
|
|
+ return (
|
|
|
+ item.dimensionName == "总分" ||
|
|
|
+ item.dimensionName == "躯体化" ||
|
|
|
+ item.dimensionName == "焦虑" ||
|
|
|
+ item.dimensionName == "抑郁"
|
|
|
+ );
|
|
|
+ });
|
|
|
|
|
|
- let listTmp3 =[]
|
|
|
- listTmp3=a.filter((item)=>{
|
|
|
- return !(item.dimensionName=='压力'||item.dimensionName=='焦虑'||item.dimensionName=='抑郁'||item.dimensionName=='总分')
|
|
|
- })
|
|
|
- this.userData1 = listTmp2.concat(listTmp3)
|
|
|
+ let listTmp3 = [];
|
|
|
+ listTmp3 = a.filter((item) => {
|
|
|
+ return !(
|
|
|
+ item.dimensionName == "躯体化" ||
|
|
|
+ item.dimensionName == "焦虑" ||
|
|
|
+ item.dimensionName == "抑郁" ||
|
|
|
+ item.dimensionName == "总分"
|
|
|
+ );
|
|
|
+ });
|
|
|
+ this.userData1 = listTmp2.concat(listTmp3);
|
|
|
|
|
|
if (this.userData2.length == 0) {
|
|
|
this.formatterDataW(a, false, 1);
|
|
@@ -726,11 +766,11 @@ export default {
|
|
|
if (res && res.code == 200) {
|
|
|
this.useTime2 = res.data.usedTime;
|
|
|
this.orgName2 = res.data.user.orgName;
|
|
|
- this.userGender2=res.data.user.gender
|
|
|
+ this.userGender2 = res.data.user.gender;
|
|
|
let a = res.data.report.filter((item) => {
|
|
|
return item.isIcon == "1";
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
//将设置--四个维度单独取出来
|
|
|
|
|
|
// let listTmp1 =[]
|
|
@@ -738,18 +778,28 @@ export default {
|
|
|
// return item.dimensionName != "总分";
|
|
|
// });
|
|
|
|
|
|
- let listTmp2 =[]
|
|
|
- listTmp2=a.filter((item)=>{
|
|
|
- return item.dimensionName=='总分'||item.dimensionName=='压力'||item.dimensionName=='焦虑'||item.dimensionName=='抑郁'
|
|
|
- })
|
|
|
+ let listTmp2 = [];
|
|
|
+ listTmp2 = a.filter((item) => {
|
|
|
+ return (
|
|
|
+ item.dimensionName == "总分" ||
|
|
|
+ item.dimensionName == "躯体化" ||
|
|
|
+ item.dimensionName == "焦虑" ||
|
|
|
+ item.dimensionName == "抑郁"
|
|
|
+ );
|
|
|
+ });
|
|
|
|
|
|
- let listTmp3 =[]
|
|
|
- listTmp3=a.filter((item)=>{
|
|
|
- return !(item.dimensionName=='压力'||item.dimensionName=='焦虑'||item.dimensionName=='抑郁'||item.dimensionName=='总分')
|
|
|
- })
|
|
|
+ let listTmp3 = [];
|
|
|
+ listTmp3 = a.filter((item) => {
|
|
|
+ return !(
|
|
|
+ item.dimensionName == "躯体化" ||
|
|
|
+ item.dimensionName == "焦虑" ||
|
|
|
+ item.dimensionName == "抑郁" ||
|
|
|
+ item.dimensionName == "总分"
|
|
|
+ );
|
|
|
+ });
|
|
|
// this.reportDataAll=listTmp2.concat(listTmp3)
|
|
|
|
|
|
- this.userData2 = listTmp2.concat(listTmp3)
|
|
|
+ this.userData2 = listTmp2.concat(listTmp3);
|
|
|
// this.userData2 = a;
|
|
|
|
|
|
if (this.userData1.length == 0) {
|
|
@@ -816,6 +866,7 @@ export default {
|
|
|
//选择用户进行对比的方法
|
|
|
handleSelectionChange(val) {
|
|
|
// isComplete
|
|
|
+ this.multipleSelection = val;
|
|
|
//判断里边是否有未完成的
|
|
|
let hasNo = false;
|
|
|
if (val.length > 0) {
|
|
@@ -829,7 +880,7 @@ export default {
|
|
|
if (hasNo) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: "请选已完成的",
|
|
|
+ message: "选项中不能含有未完成的",
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -840,7 +891,6 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- this.multipleSelection = val;
|
|
|
},
|
|
|
searchTarget() {
|
|
|
this.pageNum = 1;
|