|
@@ -24,10 +24,10 @@
|
|
|
<!-- 统计维度选择 -->
|
|
<!-- 统计维度选择 -->
|
|
|
<el-col :span="4">
|
|
<el-col :span="4">
|
|
|
<el-form-item label="统计维度">
|
|
<el-form-item label="统计维度">
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryParams.dimension"
|
|
|
|
|
- placeholder="请选择统计维度"
|
|
|
|
|
- @change="handleDimensionChange"
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.dimension"
|
|
|
|
|
+ placeholder="请选择统计维度"
|
|
|
|
|
+ @change="handleDimensionChange"
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
|
<el-option label="个人" :value="1"></el-option>
|
|
<el-option label="个人" :value="1"></el-option>
|
|
@@ -95,9 +95,9 @@
|
|
|
<el-table-column prop="companyName" label="公司名称"/>
|
|
<el-table-column prop="companyName" label="公司名称"/>
|
|
|
<el-table-column prop="deptName" label="部门名称" v-if="showDeptNameColumn" />
|
|
<el-table-column prop="deptName" label="部门名称" v-if="showDeptNameColumn" />
|
|
|
<!-- 根据维度决定是否显示人员姓名 -->
|
|
<!-- 根据维度决定是否显示人员姓名 -->
|
|
|
- <el-table-column prop="companyUserName" label="人员姓名" v-if="showUserNameColumn" />
|
|
|
|
|
|
|
+ <el-table-column prop="companyUserName" label="人员名称" v-if="showUserNameColumn" />
|
|
|
<!-- 更新以下列为新的字段名 -->
|
|
<!-- 更新以下列为新的字段名 -->
|
|
|
- <el-table-column prop="sendCount" label="发送数">
|
|
|
|
|
|
|
+ <el-table-column prop="sendCount" label="发课数">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.sendCount || 0 }}
|
|
{{ scope.row.sendCount || 0 }}
|
|
|
</template>
|
|
</template>
|
|
@@ -282,7 +282,7 @@ export default {
|
|
|
return getSearchDeptInfo({ id: companyId }).then(response => {
|
|
return getSearchDeptInfo({ id: companyId }).then(response => {
|
|
|
const deptData = response.data || [];
|
|
const deptData = response.data || [];
|
|
|
this.deptList = deptData;
|
|
this.deptList = deptData;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果后端直接返回树形结构(第一层数据有children),直接使用
|
|
// 如果后端直接返回树形结构(第一层数据有children),直接使用
|
|
|
// 否则通过buildDeptTree构建树形结构
|
|
// 否则通过buildDeptTree构建树形结构
|
|
|
const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
|
|
const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
|
|
@@ -313,9 +313,9 @@ export default {
|
|
|
deptList.forEach(dept => {
|
|
deptList.forEach(dept => {
|
|
|
// 如果后端返回的数据中已经有children字段且有值,则使用后端的children
|
|
// 如果后端返回的数据中已经有children字段且有值,则使用后端的children
|
|
|
// 否则初始化为空数组
|
|
// 否则初始化为空数组
|
|
|
- deptMap[dept.deptId] = {
|
|
|
|
|
- ...dept,
|
|
|
|
|
- children: (dept.children && dept.children.length > 0) ? dept.children : []
|
|
|
|
|
|
|
+ deptMap[dept.deptId] = {
|
|
|
|
|
+ ...dept,
|
|
|
|
|
+ children: (dept.children && dept.children.length > 0) ? dept.children : []
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -411,7 +411,7 @@ export default {
|
|
|
getSearchDeptInfo({ id: companyId }).then(response => {
|
|
getSearchDeptInfo({ id: companyId }).then(response => {
|
|
|
const deptData = response.data || [];
|
|
const deptData = response.data || [];
|
|
|
this.deptList = deptData;
|
|
this.deptList = deptData;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果后端直接返回树形结构(第一层数据有children),直接使用
|
|
// 如果后端直接返回树形结构(第一层数据有children),直接使用
|
|
|
// 否则通过buildDeptTree构建树形结构
|
|
// 否则通过buildDeptTree构建树形结构
|
|
|
const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
|
|
const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
|
|
@@ -494,11 +494,11 @@ export default {
|
|
|
calculateCompleteRate(row) {
|
|
calculateCompleteRate(row) {
|
|
|
const sendCount = row.sendCount || 0;
|
|
const sendCount = row.sendCount || 0;
|
|
|
const completeNum = row.completeNum || 0;
|
|
const completeNum = row.completeNum || 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (sendCount === 0) {
|
|
if (sendCount === 0) {
|
|
|
return '0%';
|
|
return '0%';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const rate = (completeNum / sendCount * 100).toFixed(2);
|
|
const rate = (completeNum / sendCount * 100).toFixed(2);
|
|
|
return rate + '%';
|
|
return rate + '%';
|
|
|
},
|
|
},
|
|
@@ -507,11 +507,11 @@ export default {
|
|
|
calculateAnswerRate(row) {
|
|
calculateAnswerRate(row) {
|
|
|
const completeNum = row.completeNum || 0;
|
|
const completeNum = row.completeNum || 0;
|
|
|
const answerNum = row.answerNum || 0;
|
|
const answerNum = row.answerNum || 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (completeNum === 0) {
|
|
if (completeNum === 0) {
|
|
|
return '0%';
|
|
return '0%';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const rate = (answerNum / completeNum * 100).toFixed(2);
|
|
const rate = (answerNum / completeNum * 100).toFixed(2);
|
|
|
return rate + '%';
|
|
return rate + '%';
|
|
|
}
|
|
}
|
|
@@ -570,4 +570,4 @@ export default {
|
|
|
padding: 20px 50px;
|
|
padding: 20px 50px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|