Branch_d40a2540
yujialong 1 year ago
parent ada18d3c5f
commit 25a23d85d6
  1. 53
      src/pages/achievement/info/course.vue
  2. 50
      src/pages/achievement/info/project.vue
  3. 40
      src/pages/product/list/index.vue

@ -48,11 +48,11 @@
<div class="wrong">
<div class="line">
<span class="jud-name">错误率最高{{ max.projectName }}</span>
<span>参加考试{{ max.itemErrorCount }}&emsp;&emsp;{{ permissions ? `${max.errorTotal}人做错,` : '' }}错误率{{ max.errorRate }}%</span>
<span>参加考试{{ max.numberOfParticipants }}&emsp;&emsp;{{ curTab == 1 ? `${max.itemErrorCount}人做错,` : '' }}错误率{{ max.errorRate }}%</span>
</div>
<div class="line">
<span class="jud-name">错误率最低{{ min.projectName }}</span>
<span>参加考试{{ min.itemErrorCount }}&emsp;&emsp;{{ permissions ? `${min.errorTotal}人做错,` : '' }}错误率{{ min.errorRate }}%</span>
<span>参加考试{{ min.numberOfParticipants }}&emsp;&emsp;{{ curTab == 1 ? `${min.itemErrorCount}人做错,` : '' }}错误率{{ min.errorRate }}%</span>
</div>
</div>
<div class="chart"
@ -523,41 +523,54 @@ export default {
this.$router.push(this.curTab == 1 ? `show?reportId=${row.reportId}` : `project?id=${row.projectId}&projectName=${row.goodsName}&classId=${this.curRow.classId || ''}&workNumber=${row.workNumber || row.userName}`)
},
getChart () { // 线
const data = {}
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
const list = this.listDataAll
const prop = this.curTab == 0 ? 'avgScore' : 'averageScore'
list.map(n => {
if (!data[n[prop]]) {
data[n[prop]] = 1
} else {
data[n[prop]]++
const val = n[prop]
if (val === 0) {
data[0]++;
} else if (val > 0 && val <= 10) {
data[1]++;
} else if (val > 10 && val <= 20) {
data[2]++;
} else if (val > 20 && val <= 30) {
data[3]++;
} else if (val > 30 && val <= 40) {
data[4]++;
} else if (val > 40 && val <= 50) {
data[5]++;
} else if (val > 50 && val <= 60) {
data[6]++;
} else if (val > 60 && val <= 70) {
data[7]++;
} else if (val > 70 && val <= 80) {
data[8]++;
} else if (val > 80 && val <= 90) {
data[9]++;
} else if (val > 90 && val <= 100) {
data[10]++;
}
})
console.log(333, data, Object.keys(data), Object.values(data))
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
name: this.curTab == 1 ? "分数" : "平均分",
type: "category",
boundaryGap: false,
interval: 5,
axisLabel: {
interval: 9,
},
data: Object.keys(data)
interval: 10,
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
},
yAxis: {
name: this.curTab == 1 ? "人数" : '成绩报告数量',
name: "人数",
type: "value",
interval: 10,
axisLabel: {
interval: 9,
},
interval: 1
},
series: [{
data: Object.values(data),
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]

@ -6,7 +6,8 @@
<span class="name">{{ experimentalName }}</span>
</div>
<el-card shadow="hover"
<el-card v-if="classes.length"
shadow="hover"
class="m-b-20 head-card">
<div class="flex-between m-b-20">
<div>
@ -341,7 +342,9 @@ export default {
let { list } = this.permissions ?
await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) :
await this.$post(this.api.myClass)
if (!this.permissions) list = list.slice(1)
//
const i = list.findIndex(e => e.id == 1)
i !== -1 && list.splice(i, 1)
this.classes = list
},
//
@ -502,57 +505,30 @@ export default {
getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0)
const data = {}
const list = this.listDataAll
list.map(n => {
if (!data[n.score]) {
data[n.score] = 1
} else {
data[n.score]++
}
yData[n.score]++
})
let max = Math.max(...Object.values(data))
console.log("🚀 ~ file: project.vue:517 ~ getChart ~ max:", yData)
const x = Array.from({ length: max }, (v, k) => k)
for (let i = 0; i <= max; i++) {
const item = yData.findIndex(e => e == i)
console.log("🚀 ~ file: project.vue:521 ~ getChart ~ item:", item)
}
xData.map(e => {
for (let i = 0; i <= max; i++) {
}
})
// console.log(333, xData, yData, data)
console.log(333, xData, yData)
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
boundaryGap: false,
interval: 5,
axisLabel: {
interval: 5
},
},
yAxis: {
name: "分数",
type: "category",
min: 0,
max: 100,
boundaryGap: false,
interval: 5,
axisLabel: {
interval: 9
interval: 9,
},
data: xData
},
yAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
interval: 5
},
series: [{
data: yData,
type: "line",

@ -57,17 +57,16 @@
@click="catetoryClick(1)">不限</dd>
<div v-for="(item, i) in category"
:key="i"
class="category-item">
<span v-if="!item.val.length"
class="name"
@click="nameClick(i)">{{ item.name }}</span>
:class="['category-item', {active: item.disciplineId == categoryId}]">
<span class="name"
@click="nameClick(item, i)">{{ item.val.length ? item.name : item.categoryName }}</span>
<el-cascader :class="{active: item.disciplineId == categoryId}"
:ref="'category' + i"
v-model="item.val"
:options="item.list"
:props="{ checkStrictly: true }"
placeholder=""
@change="id => categoryChange(id, item)"></el-cascader>
@change="id => categoryChange(id, item, i)"></el-cascader>
</div>
</div>
</dl>
@ -412,6 +411,7 @@ export default {
val: [],
disciplineId: e.disciplineId,
name: e.disciplineName,
categoryName: e.disciplineName,
list
})
}).catch(err => { })
@ -425,10 +425,27 @@ export default {
})
}).catch(err => { })
},
nameClick (i) {
nameClick (item, i) {
this.categoryId = item.disciplineId
this.professionalCategoryId = ''
this.professionalId = ''
this.$refs['category' + i][0].toggleDropDownVisible()
this.clearCategory()
this.initData()
},
//
clearCategory () {
const list = this.category
list.map(e => {
e.val = []
})
},
categoryChange (val, item) {
categoryChange (val, item, i) {
const name = this.$refs['category' + i][0].getCheckedNodes()[0].pathLabels
console.log("🚀 ~ file: index.vue:431 ~ categoryChange ~ val, item:", val, item, name)
item.name = item.categoryName + '/' + name.join('/')
this.clearCategory()
item.val = val
this.categoryId = item.disciplineId
this.professionalCategoryId = val[0] || ''
this.professionalId = val[1] || ''
@ -501,6 +518,7 @@ export default {
this.categoryId = id
this.professionalCategoryId = id
this.professionalId = id
this.clearCategory()
this.initData()
},
//
@ -570,9 +588,10 @@ export default {
}
.texts {
position: absolute;
top: 200px;
top: 50%;
left: 188px;
color: #fff;
transform: translateY(-50%);
}
h6 {
margin-bottom: 25px;
@ -686,6 +705,11 @@ export default {
width: 30px;
}
}
&.active {
.name {
color: #9278ff;
}
}
}
/deep/.el-cascader {
width: auto;

Loading…
Cancel
Save