@@ -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",
diff --git a/src/pages/product/list/index.vue b/src/pages/product/list/index.vue
index 50a50a2..5a27f38 100644
--- a/src/pages/product/list/index.vue
+++ b/src/pages/product/list/index.vue
@@ -57,17 +57,16 @@
@click="catetoryClick(1)">不限
- {{ item.name }}
+ :class="['category-item', {active: item.disciplineId == categoryId}]">
+ {{ item.val.length ? item.name : item.categoryName }}
categoryChange(id, item)">
+ @change="id => categoryChange(id, item, i)">
@@ -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;