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="wrong">
<div class="line"> <div class="line">
<span class="jud-name">错误率最高{{ max.projectName }}</span> <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>
<div class="line"> <div class="line">
<span class="jud-name">错误率最低{{ min.projectName }}</span> <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> </div>
<div class="chart" <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}`) 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 () { // 线 getChart () { // 线
const data = {} const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
const list = this.listDataAll const list = this.listDataAll
const prop = this.curTab == 0 ? 'avgScore' : 'averageScore' const prop = this.curTab == 0 ? 'avgScore' : 'averageScore'
list.map(n => { list.map(n => {
if (!data[n[prop]]) { const val = n[prop]
data[n[prop]] = 1 if (val === 0) {
} else { data[0]++;
data[n[prop]]++ } 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")); let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({ myChart.setOption({
title: { text: "实验分数分布图" }, title: { text: "实验分数分布图" },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: "分数", name: this.curTab == 1 ? "分数" : "平均分",
type: "category", type: "category",
boundaryGap: false, boundaryGap: false,
interval: 5, interval: 10,
axisLabel: { data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
interval: 9,
},
data: Object.keys(data)
}, },
yAxis: { yAxis: {
name: this.curTab == 1 ? "人数" : '成绩报告数量', name: "人数",
type: "value", type: "value",
interval: 10, interval: 1
axisLabel: {
interval: 9,
},
}, },
series: [{ series: [{
data: Object.values(data), data,
type: "line", type: "line",
areaStyle: {}, areaStyle: {},
color: ["#8191fd"] color: ["#8191fd"]

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

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

Loading…
Cancel
Save