Commit b0cd2598f9811e22b3db7699d5ee57b8872a5d6d
1 parent
1410e5cd
fix:测试问题
Showing
18 changed files
with
2210 additions
and
805 deletions
src/api/apis/apis.js
@@ -1615,15 +1615,6 @@ export default { | @@ -1615,15 +1615,6 @@ export default { | ||
1615 | }); | 1615 | }); |
1616 | }, | 1616 | }, |
1617 | 1617 | ||
1618 | - | ||
1619 | - // 教师/个人版导入备题组卷Word文档 | ||
1620 | - paperWordUpload(data) { | ||
1621 | - return service({ | ||
1622 | - url: setUpUrls.paperWordUpload, | ||
1623 | - method: "POST", | ||
1624 | - data | ||
1625 | - }); | ||
1626 | - }, | ||
1627 | // 删除随堂问报表 | 1618 | // 删除随堂问报表 |
1628 | deletePaperReport(data) { | 1619 | deletePaperReport(data) { |
1629 | return service({ | 1620 | return service({ |
@@ -1632,6 +1623,7 @@ export default { | @@ -1632,6 +1623,7 @@ export default { | ||
1632 | data | 1623 | data |
1633 | }); | 1624 | }); |
1634 | }, | 1625 | }, |
1626 | + | ||
1635 | //删除基站 | 1627 | //删除基站 |
1636 | deleteStation(data) { | 1628 | deleteStation(data) { |
1637 | return service({ | 1629 | return service({ |
@@ -1657,6 +1649,15 @@ export default { | @@ -1657,6 +1649,15 @@ export default { | ||
1657 | responseType: 'arraybuffer', | 1649 | responseType: 'arraybuffer', |
1658 | }); | 1650 | }); |
1659 | }, | 1651 | }, |
1652 | + // 教学班模版下载 | ||
1653 | + tClassAndStudentTemplate(data) { | ||
1654 | + return service({ | ||
1655 | + url: setUpUrls.tClassAndStudentTemplate, | ||
1656 | + method: "POST", | ||
1657 | + data, | ||
1658 | + responseType: 'arraybuffer', | ||
1659 | + }); | ||
1660 | + }, | ||
1660 | //教学班班级名册导出 | 1661 | //教学班班级名册导出 |
1661 | exportTClassAndStudent(data) { | 1662 | exportTClassAndStudent(data) { |
1662 | return service({ | 1663 | return service({ |
@@ -1715,4 +1716,6 @@ export default { | @@ -1715,4 +1716,6 @@ export default { | ||
1715 | data | 1716 | data |
1716 | }); | 1717 | }); |
1717 | }, | 1718 | }, |
1719 | + | ||
1720 | + | ||
1718 | }; | 1721 | }; |
src/api/urls/apis.js
@@ -417,4 +417,15 @@ export default { | @@ -417,4 +417,15 @@ export default { | ||
417 | exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", | 417 | exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", |
418 | //查询即时测多班默认等级列表 | 418 | //查询即时测多班默认等级列表 |
419 | defaultLevels: "/api_html/teaching/defaultLevels", | 419 | defaultLevels: "/api_html/teaching/defaultLevels", |
420 | + //教学班模版下载 | ||
421 | + tClassAndStudentTemplate: "/api_html/school/manager/tClassAndStudentTemplate", | ||
422 | + //教学班导出 | ||
423 | + exportTClassAndStudent: "/api_html/school/manager/exportTClassAndStudent", | ||
424 | + //删除随堂问报表 | ||
425 | + deletePaperReport: "/api_html/teaching/deletePaperReport", | ||
426 | + //获取即时测报表学生名单和题目列表 | ||
427 | + listStudentsAndQuestions: "/api_html/teaching/listStudentsAndQuestions", | ||
428 | + //提交即时测报表分数 | ||
429 | + submitScore: "/api_html/teaching/submitScore", | ||
430 | + | ||
420 | } | 431 | } |
src/components/charts/lineChart.vue
@@ -43,7 +43,7 @@ export default { | @@ -43,7 +43,7 @@ export default { | ||
43 | confine: true, | 43 | confine: true, |
44 | formatter(v) { | 44 | formatter(v) { |
45 | let html = `<p>${v.seriesName}</p>` | 45 | let html = `<p>${v.seriesName}</p>` |
46 | - html += `${v.marker} ${v.name}:${v.value}${that.tooltipFormatter?'%':''}` | 46 | + html += `${v.marker} ${v.name}:${Number(v.value)}${that.tooltipFormatter?'%':''}` |
47 | return html | 47 | return html |
48 | }, | 48 | }, |
49 | }, | 49 | }, |
src/components/charts/pieChart.vue
@@ -8,6 +8,7 @@ export default { | @@ -8,6 +8,7 @@ export default { | ||
8 | props: { | 8 | props: { |
9 | id: String, | 9 | id: String, |
10 | params: Array, | 10 | params: Array, |
11 | + tooltipFormatter:false | ||
11 | }, | 12 | }, |
12 | watch: { | 13 | watch: { |
13 | params: { | 14 | params: { |
@@ -38,7 +39,7 @@ export default { | @@ -38,7 +39,7 @@ export default { | ||
38 | trigger: "item", | 39 | trigger: "item", |
39 | confine: true, | 40 | confine: true, |
40 | formatter(v) { | 41 | formatter(v) { |
41 | - return `${v.marker} ${v.name}:${v.value}` | 42 | + return `${v.marker} ${v.name}:${v.value}${that.tooltipFormatter?'%':''}` |
42 | }, | 43 | }, |
43 | }, | 44 | }, |
44 | legend: { | 45 | legend: { |
src/components/charts/radarChart.vue
@@ -8,6 +8,7 @@ export default { | @@ -8,6 +8,7 @@ export default { | ||
8 | props: { | 8 | props: { |
9 | id: String, | 9 | id: String, |
10 | params: Object, | 10 | params: Object, |
11 | + tooltipFormatter:false | ||
11 | }, | 12 | }, |
12 | watch: { | 13 | watch: { |
13 | params: { | 14 | params: { |
@@ -42,7 +43,7 @@ export default { | @@ -42,7 +43,7 @@ export default { | ||
42 | let oHtml = `<p>${marker}${param.name}</p>` | 43 | let oHtml = `<p>${marker}${param.name}</p>` |
43 | param.value.map((item, index) => { | 44 | param.value.map((item, index) => { |
44 | if (that.params.indicator[index].name) { | 45 | if (that.params.indicator[index].name) { |
45 | - oHtml += `<p>${that.params.indicator[index].name}:${item}</p>` | 46 | + oHtml += `<p>${that.params.indicator[index].name}:${Number(item)}${that.tooltipFormatter?'%':''}</p>` |
46 | } | 47 | } |
47 | }) | 48 | }) |
48 | return oHtml | 49 | return oHtml |
src/components/exportDia.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <el-dialog :close-on-click-modal="false" :visible.sync="diaShow" width="360px" :show-close="false"> | 3 | + <el-dialog |
4 | + :close-on-click-modal="false" | ||
5 | + :visible.sync="diaShow" | ||
6 | + width="360px" | ||
7 | + :show-close="false" | ||
8 | + > | ||
4 | <i class="el-icon-close" @click="closeDia"></i> | 9 | <i class="el-icon-close" @click="closeDia"></i> |
5 | <div v-show="exportType == 1"> | 10 | <div v-show="exportType == 1"> |
6 | <div class="down-item"> | 11 | <div class="down-item"> |
7 | - <p class="tit">是否将学生表现折线图一起导出</p> | 12 | + <p class="tit">是否将学生表现{{ type }}一起导出</p> |
8 | <el-radio-group v-model="downType" @change="changeDownType"> | 13 | <el-radio-group v-model="downType" @change="changeDownType"> |
9 | <el-radio :label="1">不导出</el-radio> | 14 | <el-radio :label="1">不导出</el-radio> |
10 | <el-radio :label="2">导出</el-radio> | 15 | <el-radio :label="2">导出</el-radio> |
@@ -20,27 +25,57 @@ | @@ -20,27 +25,57 @@ | ||
20 | </div> | 25 | </div> |
21 | <ul v-show="exportType == 2"> | 26 | <ul v-show="exportType == 2"> |
22 | <p class="export-tit">选择学生</p> | 27 | <p class="export-tit">选择学生</p> |
23 | - <el-table :data="exportStudent" @selection-change="handleSelectionChange" :max-height="300"> | 28 | + <el-table |
29 | + :data="exportStudent" | ||
30 | + @selection-change="handleSelectionChange" | ||
31 | + :max-height="300" | ||
32 | + > | ||
24 | <el-table-column type="selection"></el-table-column> | 33 | <el-table-column type="selection"></el-table-column> |
25 | - <el-table-column prop="studentName" label="姓名" align="center"></el-table-column> | 34 | + <el-table-column |
35 | + prop="studentName" | ||
36 | + label="姓名" | ||
37 | + align="center" | ||
38 | + ></el-table-column> | ||
26 | <el-table-column label="班名" align="center"> | 39 | <el-table-column label="班名" align="center"> |
27 | <template slot-scope="scoped"> | 40 | <template slot-scope="scoped"> |
28 | <span v-if="scoped.row.classRank || scoped.row.rank">{{ | 41 | <span v-if="scoped.row.classRank || scoped.row.rank">{{ |
29 | - scoped.row.classRank || scoped.row.rank }}</span> | ||
30 | - <span v-else>{{ scoped.row.examList && scoped.row.examList[0].classRank }}</span> | 42 | + scoped.row.classRank || scoped.row.rank |
43 | + }}</span> | ||
44 | + <span v-else>{{ | ||
45 | + scoped.row.examList && scoped.row.examList[0].classRank | ||
46 | + }}</span> | ||
31 | </template> | 47 | </template> |
32 | </el-table-column> | 48 | </el-table-column> |
33 | - <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped"> | ||
34 | - <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{ | ||
35 | - scoped.row.correctRate || scoped.row.scoringRate }}%</span> | ||
36 | - <span v-else>{{ scoped.row.examList && scoped.row.examList[0].score }}</span> | ||
37 | - </template></el-table-column> | 49 | + <el-table-column :label="this.lastLabel" align="center" |
50 | + ><template slot-scope="scoped"> | ||
51 | + <span v-if="!isNaN(scoped.row.correctRate)" | ||
52 | + >{{ scoped.row.correctRate }}%</span | ||
53 | + > | ||
54 | + <span v-else-if="!isNaN(scoped.row.scoringRate)"> | ||
55 | + {{ scoped.row.scoringRate }}% | ||
56 | + </span> | ||
57 | + <span v-else>{{ | ||
58 | + scoped.row.examList && scoped.row.examList[0].score | ||
59 | + }}</span> | ||
60 | + </template></el-table-column | ||
61 | + > | ||
38 | </el-table> | 62 | </el-table> |
39 | </ul> | 63 | </ul> |
40 | <div class="dialog-footer" slot="footer"> | 64 | <div class="dialog-footer" slot="footer"> |
41 | - <el-button v-show="exportType == 2" size="small" type="primary" round @click="exportData(10)">导出前十</el-button> | ||
42 | - <el-button size="small" type="primary" round @click="exportData(0)">确 定</el-button> | ||
43 | - <el-button size="small" type="danger" round @click="cancel">取 消</el-button> | 65 | + <el-button |
66 | + v-show="exportType == 2" | ||
67 | + size="small" | ||
68 | + type="primary" | ||
69 | + round | ||
70 | + @click="exportData(10)" | ||
71 | + >导出前十</el-button | ||
72 | + > | ||
73 | + <el-button size="small" type="primary" round @click="exportData(0)" | ||
74 | + >确 定</el-button | ||
75 | + > | ||
76 | + <el-button size="small" type="danger" round @click="cancel" | ||
77 | + >取 消</el-button | ||
78 | + > | ||
44 | </div> | 79 | </div> |
45 | </el-dialog> | 80 | </el-dialog> |
46 | </div> | 81 | </div> |
@@ -49,64 +84,67 @@ | @@ -49,64 +84,67 @@ | ||
49 | export default { | 84 | export default { |
50 | name: "exportDia", | 85 | name: "exportDia", |
51 | props: { | 86 | props: { |
87 | + type: { | ||
88 | + type: String, | ||
89 | + default: "折线图", | ||
90 | + }, | ||
52 | diaShow: Boolean, | 91 | diaShow: Boolean, |
53 | exportStudent: Array, | 92 | exportStudent: Array, |
54 | lastLabel: { | 93 | lastLabel: { |
55 | type: String, | 94 | type: String, |
56 | - default: '总正确率' | ||
57 | - } | 95 | + default: "总正确率", |
96 | + }, | ||
58 | }, | 97 | }, |
59 | data() { | 98 | data() { |
60 | return { | 99 | return { |
61 | downType: 1, | 100 | downType: 1, |
62 | exportType: 1, | 101 | exportType: 1, |
63 | multipleSelection: [], | 102 | multipleSelection: [], |
64 | - } | 103 | + }; |
65 | }, | 104 | }, |
66 | watch: { | 105 | watch: { |
67 | diaShow: { | 106 | diaShow: { |
68 | handler: function (nVal) { | 107 | handler: function (nVal) { |
69 | if (nVal) { | 108 | if (nVal) { |
70 | - this.downType = 1 | 109 | + this.downType = 1; |
71 | } | 110 | } |
72 | }, | 111 | }, |
73 | - immediate: true | ||
74 | - } | ||
75 | - | 112 | + immediate: true, |
113 | + }, | ||
76 | }, | 114 | }, |
77 | methods: { | 115 | methods: { |
78 | changeDownType() { | 116 | changeDownType() { |
79 | - this.exportType = 1 | 117 | + this.exportType = 1; |
80 | }, | 118 | }, |
81 | handleSelectionChange(val) { | 119 | handleSelectionChange(val) { |
82 | - this.multipleSelection = val | 120 | + this.multipleSelection = val; |
83 | }, | 121 | }, |
84 | exportData(length) { | 122 | exportData(length) { |
85 | - let studentIds = [] | 123 | + let studentIds = []; |
86 | if (length) { | 124 | if (length) { |
87 | - studentIds = this.exportStudent.slice(0, 10).map(item => { | ||
88 | - return item.studentId | ||
89 | - }) | 125 | + studentIds = this.exportStudent.slice(0, 10).map((item) => { |
126 | + return item.studentId; | ||
127 | + }); | ||
90 | } else { | 128 | } else { |
91 | - studentIds = this.multipleSelection.map(item => { | ||
92 | - return item.studentId | ||
93 | - }) | 129 | + studentIds = this.multipleSelection.map((item) => { |
130 | + return item.studentId; | ||
131 | + }); | ||
94 | } | 132 | } |
95 | - this.$emit('exportData', this.downType==1?null:studentIds) | 133 | + this.$emit("exportData", this.downType == 1 ? null : studentIds); |
96 | }, | 134 | }, |
97 | cancel() { | 135 | cancel() { |
98 | if (this.exportType == 2) { | 136 | if (this.exportType == 2) { |
99 | - this.exportType = 1 | 137 | + this.exportType = 1; |
100 | } else { | 138 | } else { |
101 | - this.$emit('cancel') | 139 | + this.$emit("cancel"); |
102 | } | 140 | } |
103 | }, | 141 | }, |
104 | closeDia() { | 142 | closeDia() { |
105 | - this.$emit('cancel') | ||
106 | - this.exportType = 1 | ||
107 | - } | ||
108 | - } | ||
109 | -} | 143 | + this.$emit("cancel"); |
144 | + this.exportType = 1; | ||
145 | + }, | ||
146 | + }, | ||
147 | +}; | ||
110 | </script> | 148 | </script> |
111 | <style lang="scss" scoped> | 149 | <style lang="scss" scoped> |
112 | .el-dialog__wrapper { | 150 | .el-dialog__wrapper { |
src/views/basic/ask/analysis.vue
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | icon="el-icon-printer">打印</el-button> | 38 | icon="el-icon-printer">打印</el-button> |
39 | </p> | 39 | </p> |
40 | </div> | 40 | </div> |
41 | - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" /> | 41 | + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" :type="types==3?'雷达图':'折线图'"/> |
42 | </div> | 42 | </div> |
43 | </div> | 43 | </div> |
44 | </template> | 44 | </template> |
src/views/basic/ask/components/answerQustion.vue
@@ -188,7 +188,7 @@ | @@ -188,7 +188,7 @@ | ||
188 | :xAxis="xAxis" | 188 | :xAxis="xAxis" |
189 | :tooltipFormatter="true" | 189 | :tooltipFormatter="true" |
190 | /> | 190 | /> |
191 | - <RadarChart v-if="types == 3" id="askRadarChart" :params="chartData" /> | 191 | + <RadarChart v-if="types == 3" id="askRadarChart" :params="chartData" :tooltipFormatter="true"/> |
192 | </div> | 192 | </div> |
193 | </el-dialog> | 193 | </el-dialog> |
194 | </div> | 194 | </div> |
src/views/basic/setUp/clazz.vue
@@ -6,14 +6,32 @@ | @@ -6,14 +6,32 @@ | ||
6 | </template> | 6 | </template> |
7 | <template slot="btns" v-if="!code"> | 7 | <template slot="btns" v-if="!code"> |
8 | <el-tooltip effect="dark" content="导入班级名单" placement="bottom"> | 8 | <el-tooltip effect="dark" content="导入班级名单" placement="bottom"> |
9 | - <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | 9 | + <el-button |
10 | + type="primary" | ||
11 | + icon="el-icon-upload2" | ||
12 | + size="mini" | ||
13 | + plain | ||
14 | + circle | ||
15 | + @click="diaUp = true" | ||
16 | + ></el-button> | ||
10 | </el-tooltip> | 17 | </el-tooltip> |
11 | <el-tooltip effect="dark" content="导出班级名单" placement="bottom"> | 18 | <el-tooltip effect="dark" content="导出班级名单" placement="bottom"> |
12 | - <el-button type="primary" icon="el-icon-download" size="mini" plain circle | ||
13 | - @click="exportTeacherExl"></el-button> | 19 | + <el-button |
20 | + type="primary" | ||
21 | + icon="el-icon-download" | ||
22 | + size="mini" | ||
23 | + plain | ||
24 | + circle | ||
25 | + @click="exportTeacherExl" | ||
26 | + ></el-button> | ||
14 | </el-tooltip> | 27 | </el-tooltip> |
15 | <el-tooltip effect="dark" content="分班" placement="bottom"> | 28 | <el-tooltip effect="dark" content="分班" placement="bottom"> |
16 | - <img @click="toArchived" src="../../../assets/images/fenban.png" class="fenban" alt="" /> | 29 | + <img |
30 | + @click="toArchived" | ||
31 | + src="../../../assets/images/fenban.png" | ||
32 | + class="fenban" | ||
33 | + alt="" | ||
34 | + /> | ||
17 | </el-tooltip> | 35 | </el-tooltip> |
18 | </template> | 36 | </template> |
19 | </back-box> | 37 | </back-box> |
@@ -28,17 +46,36 @@ | @@ -28,17 +46,36 @@ | ||
28 | <div class="grade-item" v-for="(item, index) in dataList"> | 46 | <div class="grade-item" v-for="(item, index) in dataList"> |
29 | <p class="h-title"> | 47 | <p class="h-title"> |
30 | <span>{{ item.gradeName }}</span> | 48 | <span>{{ item.gradeName }}</span> |
31 | - <span class="s-num" v-if="item.classList">(共{{ item.classList.length }}个班)</span> | ||
32 | - <el-button class="sub-btn" type="info" size="mini" round plain @click="openSubject(item)">科目管理({{ | ||
33 | - item.subjectNames.length }})</el-button> | 49 | + <span class="s-num" v-if="item.classList" |
50 | + >(共{{ item.classList.length }}个班)</span | ||
51 | + > | ||
52 | + <el-button | ||
53 | + class="sub-btn" | ||
54 | + type="info" | ||
55 | + size="mini" | ||
56 | + round | ||
57 | + plain | ||
58 | + @click="openSubject(item)" | ||
59 | + >科目管理({{ item.subjectNames.length }})</el-button | ||
60 | + > | ||
34 | <span class="txt" v-if="index == 0">拖动班级进行排序</span> | 61 | <span class="txt" v-if="index == 0">拖动班级进行排序</span> |
35 | </p> | 62 | </p> |
36 | - <draggable tag="ul" class="grade-info" v-model="item.classList" @start="start" @end="end(item)" v-bind="{ | ||
37 | - animation: 300, | ||
38 | - }"> | 63 | + <draggable |
64 | + tag="ul" | ||
65 | + class="grade-info" | ||
66 | + v-model="item.classList" | ||
67 | + @start="start" | ||
68 | + @end="end(item)" | ||
69 | + v-bind="{ | ||
70 | + animation: 300, | ||
71 | + }" | ||
72 | + > | ||
39 | <li class="clazz-li" v-for="clazz in item.classList" :key="item.id"> | 73 | <li class="clazz-li" v-for="clazz in item.classList" :key="item.id"> |
40 | <div class="clazz-item"> | 74 | <div class="clazz-item"> |
41 | - <i class="el-icon-edit" @click.stop="setClass(clazz, item.gradeName)"></i> | 75 | + <i |
76 | + class="el-icon-edit" | ||
77 | + @click.stop="setClass(clazz, item.gradeName)" | ||
78 | + ></i> | ||
42 | <p class="clazz-name ellipsis"> | 79 | <p class="clazz-name ellipsis"> |
43 | {{ clazz.className }} | 80 | {{ clazz.className }} |
44 | </p> | 81 | </p> |
@@ -52,7 +89,12 @@ | @@ -52,7 +89,12 @@ | ||
52 | </div> | 89 | </div> |
53 | </div> | 90 | </div> |
54 | </div> | 91 | </div> |
55 | - <el-dialog :close-on-click-modal="false" title="导入班级名单" :visible.sync="diaUp" width="600"> | 92 | + <el-dialog |
93 | + :close-on-click-modal="false" | ||
94 | + title="导入班级名单" | ||
95 | + :visible.sync="diaUp" | ||
96 | + width="600" | ||
97 | + > | ||
56 | <upload :url="url" @upSuccess="upSuccess" fileName="班级名单"> | 98 | <upload :url="url" @upSuccess="upSuccess" fileName="班级名单"> |
57 | <p class="down-txt" slot="down"> | 99 | <p class="down-txt" slot="down"> |
58 | 通过Excel名单导入班级名单,点击 | 100 | 通过Excel名单导入班级名单,点击 |
@@ -63,8 +105,18 @@ | @@ -63,8 +105,18 @@ | ||
63 | <el-button @click="diaUp = false">取 消</el-button> | 105 | <el-button @click="diaUp = false">取 消</el-button> |
64 | </div> | 106 | </div> |
65 | </el-dialog> | 107 | </el-dialog> |
66 | - <el-dialog :close-on-click-modal="false" title="修改班级" :visible.sync="diaClass" width="400"> | ||
67 | - <el-form ref="formClass" :model="formClass" :rules="rulesClass" label-width="160px"> | 108 | + <el-dialog |
109 | + :close-on-click-modal="false" | ||
110 | + title="修改班级" | ||
111 | + :visible.sync="diaClass" | ||
112 | + width="400" | ||
113 | + > | ||
114 | + <el-form | ||
115 | + ref="formClass" | ||
116 | + :model="formClass" | ||
117 | + :rules="rulesClass" | ||
118 | + label-width="160px" | ||
119 | + > | ||
68 | <el-form-item label="所在年级:"> | 120 | <el-form-item label="所在年级:"> |
69 | <span>{{ formClass.gradeName }}</span> | 121 | <span>{{ formClass.gradeName }}</span> |
70 | </el-form-item> | 122 | </el-form-item> |
@@ -80,14 +132,20 @@ | @@ -80,14 +132,20 @@ | ||
80 | </el-form-item> | 132 | </el-form-item> |
81 | <el-form-item label="入学年份:"> | 133 | <el-form-item label="入学年份:"> |
82 | <el-col :span="10"> | 134 | <el-col :span="10"> |
83 | - <el-date-picker v-model="formClass.intoSchoolYear" type="year" placeholder="选择年"> | 135 | + <el-date-picker |
136 | + v-model="formClass.intoSchoolYear" | ||
137 | + type="year" | ||
138 | + placeholder="选择年" | ||
139 | + > | ||
84 | </el-date-picker> | 140 | </el-date-picker> |
85 | </el-col> | 141 | </el-col> |
86 | </el-form-item> | 142 | </el-form-item> |
87 | </el-form> | 143 | </el-form> |
88 | <div class="dialog-footer" slot="footer"> | 144 | <div class="dialog-footer" slot="footer"> |
89 | <el-popconfirm title="确定删除该班级吗?" @confirm="_RemoveClass"> | 145 | <el-popconfirm title="确定删除该班级吗?" @confirm="_RemoveClass"> |
90 | - <el-button class="el-button-del" slot="reference" type="danger">删 除</el-button> | 146 | + <el-button class="el-button-del" slot="reference" type="danger" |
147 | + >删 除</el-button | ||
148 | + > | ||
91 | </el-popconfirm> | 149 | </el-popconfirm> |
92 | <el-button @click="_SaveClass" type="primary">确 定</el-button> | 150 | <el-button @click="_SaveClass" type="primary">确 定</el-button> |
93 | <el-button @click="diaClass = false">取 消</el-button> | 151 | <el-button @click="diaClass = false">取 消</el-button> |
@@ -95,10 +153,13 @@ | @@ -95,10 +153,13 @@ | ||
95 | @confirm="_RemoveClass"> | 153 | @confirm="_RemoveClass"> |
96 | <el-button class="el-button-del" slot="reference" type="danger" plain>删 除</el-button> | 154 | <el-button class="el-button-del" slot="reference" type="danger" plain>删 除</el-button> |
97 | </el-popconfirm> --> | 155 | </el-popconfirm> --> |
98 | - | ||
99 | </div> | 156 | </div> |
100 | </el-dialog> | 157 | </el-dialog> |
101 | - <el-dialog :close-on-click-modal="false" :visible.sync="diaSubject" width="400"> | 158 | + <el-dialog |
159 | + :close-on-click-modal="false" | ||
160 | + :visible.sync="diaSubject" | ||
161 | + width="400" | ||
162 | + > | ||
102 | <p slot="title" class="dia-tit"> | 163 | <p slot="title" class="dia-tit"> |
103 | {{ formClass.gradeName }} | 164 | {{ formClass.gradeName }} |
104 | <span class="tips">(默认科目和已经有任课老师的科目不能删除)</span> | 165 | <span class="tips">(默认科目和已经有任课老师的科目不能删除)</span> |
@@ -107,25 +168,54 @@ | @@ -107,25 +168,54 @@ | ||
107 | <el-form-item label="科目:"> | 168 | <el-form-item label="科目:"> |
108 | <div class="subject-box"> | 169 | <div class="subject-box"> |
109 | <el-checkbox-group v-model="subjectNames"> | 170 | <el-checkbox-group v-model="subjectNames"> |
110 | - <p class="p1" v-for="(item, index) in subjectList" :key="item.default"> | 171 | + <p |
172 | + class="p1" | ||
173 | + v-for="(item, index) in subjectList" | ||
174 | + :key="item.default" | ||
175 | + > | ||
111 | <el-checkbox v-if="!item.checked" :label="item.value">{{ | 176 | <el-checkbox v-if="!item.checked" :label="item.value">{{ |
112 | item.value | 177 | item.value |
113 | }}</el-checkbox> | 178 | }}</el-checkbox> |
114 | - <el-input class="sub-ipt" v-else v-model="item.value" @keyup.enter.native="_EditSub(item)"></el-input> | ||
115 | - <i class="el-icon el-icon-edit" v-show="!item.checked" @click="item.checked = true"></i> | ||
116 | - <i class="el-icon el-icon-check" v-show="item.checked" @click="_EditSub(item)"></i> | 179 | + <el-input |
180 | + class="sub-ipt" | ||
181 | + v-else | ||
182 | + v-model="item.value" | ||
183 | + @keyup.enter.native="_EditSub(item)" | ||
184 | + ></el-input> | ||
185 | + <i | ||
186 | + class="el-icon el-icon-edit" | ||
187 | + v-show="!item.checked" | ||
188 | + @click="item.checked = true" | ||
189 | + ></i> | ||
190 | + <i | ||
191 | + class="el-icon el-icon-check" | ||
192 | + v-show="item.checked" | ||
193 | + @click="_EditSub(item)" | ||
194 | + ></i> | ||
117 | <!-- <i | 195 | <!-- <i |
118 | class="el-icon el-icon-close" | 196 | class="el-icon el-icon-close" |
119 | v-show="item.checked" | 197 | v-show="item.checked" |
120 | @click="resetSub(item)" | 198 | @click="resetSub(item)" |
121 | ></i> --> | 199 | ></i> --> |
122 | - <i v-show="!item.checked" class="el-icon el-icon-delete" @click="_DelSubject(item, index)"></i> | 200 | + <i |
201 | + v-show="!item.checked" | ||
202 | + class="el-icon el-icon-delete" | ||
203 | + @click="_DelSubject(item, index)" | ||
204 | + ></i> | ||
123 | </p> | 205 | </p> |
124 | </el-checkbox-group> | 206 | </el-checkbox-group> |
125 | </div> | 207 | </div> |
126 | <el-col :span="8"> | 208 | <el-col :span="8"> |
127 | - <el-input placeholder="添加科目" v-model.trim="subjectName" maxlength="30"> | ||
128 | - <i slot="suffix" class="el-input__icon el-icon-plus" @click="addSubjectName"></i> | 209 | + <el-input |
210 | + placeholder="添加科目" | ||
211 | + v-model.trim="subjectName" | ||
212 | + maxlength="30" | ||
213 | + > | ||
214 | + <i | ||
215 | + slot="suffix" | ||
216 | + class="el-input__icon el-icon-plus" | ||
217 | + @click="addSubjectName" | ||
218 | + ></i> | ||
129 | </el-input> | 219 | </el-input> |
130 | </el-col> | 220 | </el-col> |
131 | </el-form-item> | 221 | </el-form-item> |
@@ -190,14 +280,14 @@ export default { | @@ -190,14 +280,14 @@ export default { | ||
190 | }, | 280 | }, |
191 | computed: { | 281 | computed: { |
192 | url: function () { | 282 | url: function () { |
193 | - let href = "" | 283 | + let href = ""; |
194 | if (this.type == 0) { | 284 | if (this.type == 0) { |
195 | - href = "/api_html/school/manager/importClassAndStudent" | 285 | + href = "/api_html/school/manager/importClassAndStudent"; |
196 | } else { | 286 | } else { |
197 | - href = "/api_html/school/manager/importTClassAndStudent" | 287 | + href = "/api_html/school/manager/importTClassAndStudent"; |
198 | } | 288 | } |
199 | - return href | ||
200 | - } | 289 | + return href; |
290 | + }, | ||
201 | }, | 291 | }, |
202 | async created() { | 292 | async created() { |
203 | this.code = this.$store.getters.csCode; | 293 | this.code = this.$store.getters.csCode; |
@@ -330,7 +420,7 @@ export default { | @@ -330,7 +420,7 @@ export default { | ||
330 | this.subjectNames.splice(idx, 1, item.value); | 420 | this.subjectNames.splice(idx, 1, item.value); |
331 | item.default = item.value; | 421 | item.default = item.value; |
332 | } else { | 422 | } else { |
333 | - item.value = item.default | 423 | + item.value = item.default; |
334 | this.$message.error(info); | 424 | this.$message.error(info); |
335 | } | 425 | } |
336 | }, | 426 | }, |
@@ -388,9 +478,9 @@ export default { | @@ -388,9 +478,9 @@ export default { | ||
388 | }, | 478 | }, |
389 | async _QueryData() { | 479 | async _QueryData() { |
390 | this.loading = true; | 480 | this.loading = true; |
391 | - this.dataList = [] | 481 | + this.dataList = []; |
392 | let { data, status, info } = await this.$request.classManager({ | 482 | let { data, status, info } = await this.$request.classManager({ |
393 | - type: this.type | 483 | + type: this.type, |
394 | }); | 484 | }); |
395 | this.loading = false; | 485 | this.loading = false; |
396 | if (status === 0) { | 486 | if (status === 0) { |
@@ -417,7 +507,10 @@ export default { | @@ -417,7 +507,10 @@ export default { | ||
417 | }, | 507 | }, |
418 | //班级名单模版下载 | 508 | //班级名单模版下载 |
419 | async downExcel() { | 509 | async downExcel() { |
420 | - const classAndStudentTemplate = this.type == 0 ? this.$request.classAndStudentTemplate : this.$request.tClassAndStudentTemplate | 510 | + const classAndStudentTemplate = |
511 | + this.type == 0 | ||
512 | + ? this.$request.classAndStudentTemplate | ||
513 | + : this.$request.tClassAndStudentTemplate; | ||
421 | let data = await classAndStudentTemplate(); | 514 | let data = await classAndStudentTemplate(); |
422 | if (data && !data.code) { | 515 | if (data && !data.code) { |
423 | let blob = new Blob([data], { | 516 | let blob = new Blob([data], { |
@@ -430,7 +523,10 @@ export default { | @@ -430,7 +523,10 @@ export default { | ||
430 | }, | 523 | }, |
431 | //班级名单下载 | 524 | //班级名单下载 |
432 | async exportTeacherExl() { | 525 | async exportTeacherExl() { |
433 | - const exportClassAndStudent = this.type == 0 ? this.$request.exportClassAndStudent : this.$request.exportTClassAndStudent | 526 | + const exportClassAndStudent = |
527 | + this.type == 0 | ||
528 | + ? this.$request.exportClassAndStudent | ||
529 | + : this.$request.exportTClassAndStudent; | ||
434 | this.loadingDown = true; | 530 | this.loadingDown = true; |
435 | let data = await exportClassAndStudent(); | 531 | let data = await exportClassAndStudent(); |
436 | this.loadingDown = false; | 532 | this.loadingDown = false; |
@@ -473,7 +569,7 @@ export default { | @@ -473,7 +569,7 @@ export default { | ||
473 | 569 | ||
474 | .el-button-del { | 570 | .el-button-del { |
475 | float: left; | 571 | float: left; |
476 | - margin-left:80px | 572 | + margin-left: 80px; |
477 | } | 573 | } |
478 | 574 | ||
479 | .h-title { | 575 | .h-title { |
@@ -587,7 +683,7 @@ export default { | @@ -587,7 +683,7 @@ export default { | ||
587 | } | 683 | } |
588 | } | 684 | } |
589 | 685 | ||
590 | - .is-checked~.el-icon-delete { | 686 | + .is-checked ~ .el-icon-delete { |
591 | display: none; | 687 | display: none; |
592 | } | 688 | } |
593 | } | 689 | } |
src/views/basic/setUp/student.vue
@@ -5,73 +5,160 @@ | @@ -5,73 +5,160 @@ | ||
5 | <span>学生管理</span> | 5 | <span>学生管理</span> |
6 | </template> | 6 | </template> |
7 | <template slot="btns" v-if="role == 'ROLE_XUEXIAO'"> | 7 | <template slot="btns" v-if="role == 'ROLE_XUEXIAO'"> |
8 | - <el-tooltip effect="dark" content="设置答题器" placement="bottom"> | ||
9 | - <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | 8 | + <el-tooltip |
9 | + effect="dark" | ||
10 | + content="设置答题器" | ||
11 | + placement="bottom" | ||
12 | + v-show="query.classType == 0" | ||
13 | + > | ||
14 | + <el-button | ||
15 | + type="primary" | ||
16 | + icon="el-icon-upload2" | ||
17 | + size="mini" | ||
18 | + plain | ||
19 | + circle | ||
20 | + @click="diaUp = true" | ||
21 | + ></el-button> | ||
10 | </el-tooltip> | 22 | </el-tooltip> |
11 | - <el-tooltip v-if="!code && query.classType == 0" effect="dark" content="添加学生" placement="bottom"> | ||
12 | - <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="openAddDia"></el-button> | 23 | + <el-tooltip |
24 | + v-if="!code && query.classType == 0" | ||
25 | + effect="dark" | ||
26 | + content="添加学生" | ||
27 | + placement="bottom" | ||
28 | + > | ||
29 | + <el-button | ||
30 | + type="primary" | ||
31 | + icon="el-icon-plus" | ||
32 | + size="mini" | ||
33 | + plain | ||
34 | + circle | ||
35 | + @click="openAddDia" | ||
36 | + ></el-button> | ||
13 | </el-tooltip> | 37 | </el-tooltip> |
14 | </template> | 38 | </template> |
15 | </back-box> | 39 | </back-box> |
16 | <div class="answer-header"> | 40 | <div class="answer-header"> |
17 | <div class="sel-box"> | 41 | <div class="sel-box"> |
18 | - <el-select class="sel" v-model="query.classType" @change="changeGrade(query.grade)" placeholder="选择类型"> | 42 | + <el-select |
43 | + class="sel" | ||
44 | + v-model="query.classType" | ||
45 | + @change="changeGrade(query.grade)" | ||
46 | + placeholder="选择类型" | ||
47 | + > | ||
19 | <el-option label="行政班" :value="0"></el-option> | 48 | <el-option label="行政班" :value="0"></el-option> |
20 | <el-option label="教学班" :value="1"></el-option> | 49 | <el-option label="教学班" :value="1"></el-option> |
21 | </el-select> | 50 | </el-select> |
22 | - <el-select class="sel" v-model="query.grade" placeholder="选择年级" @change="changeGrade"> | 51 | + <el-select |
52 | + class="sel" | ||
53 | + v-model="query.grade" | ||
54 | + placeholder="选择年级" | ||
55 | + @change="changeGrade" | ||
56 | + > | ||
23 | <el-option disabled label="全部" value=""></el-option> | 57 | <el-option disabled label="全部" value=""></el-option> |
24 | - <el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value"> | 58 | + <el-option |
59 | + v-for="item in gradeList" | ||
60 | + :key="item.value" | ||
61 | + :label="item.label" | ||
62 | + :value="item.value" | ||
63 | + > | ||
25 | </el-option> | 64 | </el-option> |
26 | <el-option label="未分配" :value="80"></el-option> | 65 | <el-option label="未分配" :value="80"></el-option> |
27 | <el-option label="已毕业" :value="81"></el-option> | 66 | <el-option label="已毕业" :value="81"></el-option> |
28 | </el-select> | 67 | </el-select> |
29 | - <el-input placeholder="请输入学生姓名" v-model="query.studentName" class="input-with-select" | ||
30 | - @keyup.enter.native="_QueryData(1)"> | ||
31 | - <el-button slot="append" icon="el-icon-search" @click="_QueryData(1)"></el-button> | 68 | + <el-input |
69 | + placeholder="请输入学生姓名" | ||
70 | + v-model="query.studentName" | ||
71 | + class="input-with-select" | ||
72 | + @keyup.enter.native="_QueryData(1)" | ||
73 | + > | ||
74 | + <el-button | ||
75 | + slot="append" | ||
76 | + icon="el-icon-search" | ||
77 | + @click="_QueryData(1)" | ||
78 | + ></el-button> | ||
32 | </el-input> | 79 | </el-input> |
33 | - <el-input placeholder="请输入学生学号" v-model="query.studentCode" class="input-with-select" | ||
34 | - @keyup.enter.native="_QueryData(2)"> | ||
35 | - <el-button slot="append" icon="el-icon-search" @click="_QueryData(2)"></el-button> | 80 | + <el-input |
81 | + placeholder="请输入学生学号" | ||
82 | + v-model="query.studentCode" | ||
83 | + class="input-with-select" | ||
84 | + @keyup.enter.native="_QueryData(2)" | ||
85 | + > | ||
86 | + <el-button | ||
87 | + slot="append" | ||
88 | + icon="el-icon-search" | ||
89 | + @click="_QueryData(2)" | ||
90 | + ></el-button> | ||
36 | </el-input> | 91 | </el-input> |
37 | </div> | 92 | </div> |
38 | </div> | 93 | </div> |
39 | - <p class="total" v-if="studentList.length && | ||
40 | - (query.grade == 80 || query.grade == 81 || !query.grade) | ||
41 | - "> | 94 | + <p |
95 | + class="total" | ||
96 | + v-if=" | ||
97 | + studentList.length && | ||
98 | + (query.grade == 80 || query.grade == 81 || !query.grade) | ||
99 | + " | ||
100 | + > | ||
42 | 共筛选出{{ studentList.length }}名学生。 | 101 | 共筛选出{{ studentList.length }}名学生。 |
43 | </p> | 102 | </p> |
44 | - <p class="total" v-if="getStuTotal && query.grade && query.grade != 80 && query.grade != 81 | ||
45 | - "> | 103 | + <p |
104 | + class="total" | ||
105 | + v-if=" | ||
106 | + getStuTotal && query.grade && query.grade != 80 && query.grade != 81 | ||
107 | + " | ||
108 | + > | ||
46 | 共筛选出{{ getStuTotal }}名学生。 | 109 | 共筛选出{{ getStuTotal }}名学生。 |
47 | </p> | 110 | </p> |
48 | <div class="page-content"> | 111 | <div class="page-content"> |
49 | <div class="stu-box"> | 112 | <div class="stu-box"> |
50 | - <div class="stu-list" v-show="query.grade && query.grade != 80 && query.grade != 81"> | 113 | + <div |
114 | + class="stu-list" | ||
115 | + v-show="query.grade && query.grade != 80 && query.grade != 81" | ||
116 | + > | ||
51 | <div class="h-title">班级列表</div> | 117 | <div class="h-title">班级列表</div> |
52 | <ul class="stu-ul"> | 118 | <ul class="stu-ul"> |
53 | - <li class="stu-item" v-for="(item, index) in classList" :key="item.id" | ||
54 | - :class="query.classId == item.id ? 'active' : ''" @click="classDetail(item)"> | 119 | + <li |
120 | + class="stu-item" | ||
121 | + v-for="(item, index) in classList" | ||
122 | + :key="item.id" | ||
123 | + :class="query.classId == item.id ? 'active' : ''" | ||
124 | + @click="classDetail(item)" | ||
125 | + > | ||
55 | {{ item.className }}({{ item.studentCount }}) | 126 | {{ item.className }}({{ item.studentCount }}) |
56 | </li> | 127 | </li> |
57 | </ul> | 128 | </ul> |
58 | </div> | 129 | </div> |
59 | <div class="stu-detail" v-loading="loading"> | 130 | <div class="stu-detail" v-loading="loading"> |
60 | - <div class="clazz-detail" v-if="clazzDetail.stationSn && | ||
61 | - query.grade && | ||
62 | - query.grade != 80 && | ||
63 | - query.grade != 81 | ||
64 | - "> | 131 | + <div |
132 | + class="clazz-detail" | ||
133 | + v-if=" | ||
134 | + clazzDetail.stationSn && | ||
135 | + query.grade && | ||
136 | + query.grade != 80 && | ||
137 | + query.grade != 81 | ||
138 | + " | ||
139 | + > | ||
65 | <p>基站SN:{{ clazzDetail.stationSn }}</p> | 140 | <p>基站SN:{{ clazzDetail.stationSn }}</p> |
66 | <p>配对码:{{ clazzDetail.pairingCode }}</p> | 141 | <p>配对码:{{ clazzDetail.pairingCode }}</p> |
67 | <p>频点:{{ clazzDetail.frequency }}</p> | 142 | <p>频点:{{ clazzDetail.frequency }}</p> |
68 | </div> | 143 | </div> |
69 | <ul class="s-ul"> | 144 | <ul class="s-ul"> |
70 | - <li class="s-li" v-for="(item, index) in studentList" :key="item.id"> | ||
71 | - <el-popconfirm v-if="!code" title="确定删除吗?" @confirm="removeStu(item, index, $event)"> | 145 | + <li |
146 | + class="s-li" | ||
147 | + v-for="(item, index) in studentList" | ||
148 | + :key="item.id" | ||
149 | + > | ||
150 | + <el-popconfirm | ||
151 | + v-if="!code" | ||
152 | + title="确定删除吗?" | ||
153 | + @confirm="removeStu(item, index, $event)" | ||
154 | + > | ||
72 | <i class="el-icon-delete" slot="reference"></i> | 155 | <i class="el-icon-delete" slot="reference"></i> |
73 | </el-popconfirm> | 156 | </el-popconfirm> |
74 | - <i class="el-icon-user-solid" v-if="!code && query.grade != 81" @click.stop="openChangeClazz(item)"></i> | 157 | + <i |
158 | + class="el-icon-user-solid" | ||
159 | + v-if="!code && query.grade != 81" | ||
160 | + @click.stop="openChangeClazz(item)" | ||
161 | + ></i> | ||
75 | <div class="s-li-box" @click="sayChange(item)"> | 162 | <div class="s-li-box" @click="sayChange(item)"> |
76 | <p class="name"> | 163 | <p class="name"> |
77 | {{ item.studentName }} | 164 | {{ item.studentName }} |
@@ -80,13 +167,15 @@ | @@ -80,13 +167,15 @@ | ||
80 | <template v-if="item.classList && item.classList.length"> | 167 | <template v-if="item.classList && item.classList.length"> |
81 | <template v-for="(clazz, index) in item.classList"> | 168 | <template v-for="(clazz, index) in item.classList"> |
82 | <span v-if="index == 0"> | 169 | <span v-if="index == 0"> |
83 | - {{ clazz.gradeName }}﹒{{ clazz.className }}</span> | ||
84 | - </template></template> | 170 | + {{ clazz.gradeName }}﹒{{ clazz.className }}</span |
171 | + > | ||
172 | + </template></template | ||
173 | + > | ||
85 | <template v-else> | 174 | <template v-else> |
86 | {{ | 175 | {{ |
87 | item.status == 0 | 176 | item.status == 0 |
88 | - ? "未分配" | ||
89 | - : item.status == 2 | 177 | + ? "未分配" |
178 | + : item.status == 2 | ||
90 | ? "已毕业" | 179 | ? "已毕业" |
91 | : "" | 180 | : "" |
92 | }} | 181 | }} |
@@ -98,15 +187,33 @@ | @@ -98,15 +187,33 @@ | ||
98 | </div> | 187 | </div> |
99 | </li> | 188 | </li> |
100 | </ul> | 189 | </ul> |
101 | - <el-empty :image-size="100" v-if="!studentList.length && loading == false" description="没有更多数据"></el-empty> | 190 | + <el-empty |
191 | + :image-size="100" | ||
192 | + v-if="!studentList.length && loading == false" | ||
193 | + description="没有更多数据" | ||
194 | + ></el-empty> | ||
102 | </div> | 195 | </div> |
103 | </div> | 196 | </div> |
104 | </div> | 197 | </div> |
105 | - <el-dialog :close-on-click-modal="false" title="学生调班" :visible.sync="diaChangeClass" width="400"> | ||
106 | - <el-form class="form-box" ref="formStuCla" :model="formStuCla" :rules="rulesStuCla" label-width="160px"> | 198 | + <el-dialog |
199 | + :close-on-click-modal="false" | ||
200 | + title="学生调班" | ||
201 | + :visible.sync="diaChangeClass" | ||
202 | + width="400" | ||
203 | + > | ||
204 | + <el-form | ||
205 | + class="form-box" | ||
206 | + ref="formStuCla" | ||
207 | + :model="formStuCla" | ||
208 | + :rules="rulesStuCla" | ||
209 | + label-width="160px" | ||
210 | + > | ||
107 | <el-form-item label="学生姓名:"> | 211 | <el-form-item label="学生姓名:"> |
108 | <el-col :span="10"> | 212 | <el-col :span="10"> |
109 | - <el-input v-model="formStuCla.studentName" maxlength="20"></el-input> | 213 | + <el-input |
214 | + v-model="formStuCla.studentName" | ||
215 | + maxlength="20" | ||
216 | + ></el-input> | ||
110 | </el-col> | 217 | </el-col> |
111 | </el-form-item> | 218 | </el-form-item> |
112 | <el-form-item label="当前班级:"> | 219 | <el-form-item label="当前班级:"> |
@@ -114,16 +221,29 @@ | @@ -114,16 +221,29 @@ | ||
114 | </el-form-item> | 221 | </el-form-item> |
115 | <el-form-item label="调到班级:" prop="classId"> | 222 | <el-form-item label="调到班级:" prop="classId"> |
116 | <el-col :span="10"> | 223 | <el-col :span="10"> |
117 | - <el-select class="sel" v-model="formStuCla.classId" placeholder="选择年级"> | 224 | + <el-select |
225 | + class="sel" | ||
226 | + v-model="formStuCla.classId" | ||
227 | + placeholder="选择年级" | ||
228 | + > | ||
118 | <el-option disabled label="请选择" value=""></el-option> | 229 | <el-option disabled label="请选择" value=""></el-option> |
119 | - <el-option v-for="item in classList" :key="item.id" :label="item.className" :value="item.id"> | 230 | + <el-option |
231 | + v-for="item in classList" | ||
232 | + :key="item.id" | ||
233 | + :label="item.className" | ||
234 | + :value="item.id" | ||
235 | + > | ||
120 | </el-option> | 236 | </el-option> |
121 | </el-select> | 237 | </el-select> |
122 | </el-col> | 238 | </el-col> |
123 | </el-form-item> | 239 | </el-form-item> |
124 | <el-form-item label="长学号:" prop="studentCode"> | 240 | <el-form-item label="长学号:" prop="studentCode"> |
125 | <el-col :span="10"> | 241 | <el-col :span="10"> |
126 | - <el-input maxlength="12" placeholder="输入学生长学号" v-model.trim="formStuCla.studentCode" /> | 242 | + <el-input |
243 | + maxlength="12" | ||
244 | + placeholder="输入学生长学号" | ||
245 | + v-model.trim="formStuCla.studentCode" | ||
246 | + /> | ||
127 | </el-col> | 247 | </el-col> |
128 | </el-form-item> | 248 | </el-form-item> |
129 | </el-form> | 249 | </el-form> |
@@ -132,8 +252,17 @@ | @@ -132,8 +252,17 @@ | ||
132 | <el-button @click="diaChangeClass = false">取 消</el-button> | 252 | <el-button @click="diaChangeClass = false">取 消</el-button> |
133 | </div> | 253 | </div> |
134 | </el-dialog> | 254 | </el-dialog> |
135 | - <el-dialog :close-on-click-modal="false" title="调班轨迹" :visible.sync="diaChangeClassTrack" width="400"> | ||
136 | - <el-form :model="formClassTrack" label-width="160px" v-loading="loadingClassLogs"> | 255 | + <el-dialog |
256 | + :close-on-click-modal="false" | ||
257 | + title="调班轨迹" | ||
258 | + :visible.sync="diaChangeClassTrack" | ||
259 | + width="400" | ||
260 | + > | ||
261 | + <el-form | ||
262 | + :model="formClassTrack" | ||
263 | + label-width="160px" | ||
264 | + v-loading="loadingClassLogs" | ||
265 | + > | ||
137 | <el-form-item label="学生姓名:"> | 266 | <el-form-item label="学生姓名:"> |
138 | <span>{{ formClassTrack.studentName }}</span> | 267 | <span>{{ formClassTrack.studentName }}</span> |
139 | </el-form-item> | 268 | </el-form-item> |
@@ -150,19 +279,38 @@ | @@ -150,19 +279,38 @@ | ||
150 | <el-button @click="diaChangeClassTrack = false">关 闭</el-button> | 279 | <el-button @click="diaChangeClassTrack = false">关 闭</el-button> |
151 | </div> | 280 | </div> |
152 | </el-dialog> | 281 | </el-dialog> |
153 | - <el-dialog :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400"> | ||
154 | - <el-form ref="formBox" class="form-box" :model="formStu" :rules="rulesStu" label-width="160px"> | 282 | + <el-dialog |
283 | + :close-on-click-modal="false" | ||
284 | + title="添加学生" | ||
285 | + :visible.sync="diaStu" | ||
286 | + width="400" | ||
287 | + > | ||
288 | + <el-form | ||
289 | + ref="formBox" | ||
290 | + class="form-box" | ||
291 | + :model="formStu" | ||
292 | + :rules="rulesStu" | ||
293 | + label-width="160px" | ||
294 | + > | ||
155 | <el-form-item label="所在班级:"> | 295 | <el-form-item label="所在班级:"> |
156 | <span>{{ formStu.className }}</span> | 296 | <span>{{ formStu.className }}</span> |
157 | </el-form-item> | 297 | </el-form-item> |
158 | <el-form-item label="学生姓名:" prop="studentName"> | 298 | <el-form-item label="学生姓名:" prop="studentName"> |
159 | <el-col :span="10"> | 299 | <el-col :span="10"> |
160 | - <el-input maxlength="30" placeholder="输入学生姓名" v-model.trim="formStu.studentName" /> | 300 | + <el-input |
301 | + maxlength="30" | ||
302 | + placeholder="输入学生姓名" | ||
303 | + v-model.trim="formStu.studentName" | ||
304 | + /> | ||
161 | </el-col> | 305 | </el-col> |
162 | </el-form-item> | 306 | </el-form-item> |
163 | <el-form-item label="长学号:" prop="studentCode"> | 307 | <el-form-item label="长学号:" prop="studentCode"> |
164 | <el-col :span="10"> | 308 | <el-col :span="10"> |
165 | - <el-input maxlength="12" placeholder="输入学生长学号" v-model.trim="formStu.studentCode" /> | 309 | + <el-input |
310 | + maxlength="12" | ||
311 | + placeholder="输入学生长学号" | ||
312 | + v-model.trim="formStu.studentCode" | ||
313 | + /> | ||
166 | </el-col> | 314 | </el-col> |
167 | </el-form-item> | 315 | </el-form-item> |
168 | <el-form-item label="短学号:"> | 316 | <el-form-item label="短学号:"> |
@@ -187,8 +335,19 @@ | @@ -187,8 +335,19 @@ | ||
187 | <el-button @click="diaStu = false">取 消</el-button> | 335 | <el-button @click="diaStu = false">取 消</el-button> |
188 | </div> | 336 | </div> |
189 | </el-dialog> | 337 | </el-dialog> |
190 | - <el-dialog :close-on-click-modal="false" title="学生答题器绑定" :visible.sync="diaUp" width="600"> | ||
191 | - <upload id="downTeacher" :url="url" :params="{ type: query.classType }" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> | 338 | + <el-dialog |
339 | + :close-on-click-modal="false" | ||
340 | + title="学生答题器绑定" | ||
341 | + :visible.sync="diaUp" | ||
342 | + width="600" | ||
343 | + > | ||
344 | + <upload | ||
345 | + id="downTeacher" | ||
346 | + :url="url" | ||
347 | + :params="{ type: query.classType }" | ||
348 | + @upSuccess="upSuccess" | ||
349 | + fileName="学生答题器绑定模板" | ||
350 | + > | ||
192 | <p class="down-txt" slot="down"> | 351 | <p class="down-txt" slot="down"> |
193 | 通过Excel名单导入学生答题器绑定模板,点击 | 352 | 通过Excel名单导入学生答题器绑定模板,点击 |
194 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 353 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
@@ -278,7 +437,6 @@ export default { | @@ -278,7 +437,6 @@ export default { | ||
278 | teacherGradeList: [], | 437 | teacherGradeList: [], |
279 | }, | 438 | }, |
280 | }; | 439 | }; |
281 | - | ||
282 | }, | 440 | }, |
283 | computed: { | 441 | computed: { |
284 | getStuTotal: function () { | 442 | getStuTotal: function () { |
@@ -448,7 +606,7 @@ export default { | @@ -448,7 +606,7 @@ export default { | ||
448 | const { data, status, info } = await this.$request.delStudent({ | 606 | const { data, status, info } = await this.$request.delStudent({ |
449 | type: this.query.classType, | 607 | type: this.query.classType, |
450 | studentId: obj.id, | 608 | studentId: obj.id, |
451 | - classId: this.query.classId | 609 | + classId: this.query.classId, |
452 | }); | 610 | }); |
453 | if (status === 0) { | 611 | if (status === 0) { |
454 | this.$message.success("删除成功"); | 612 | this.$message.success("删除成功"); |
@@ -552,7 +710,7 @@ export default { | @@ -552,7 +710,7 @@ export default { | ||
552 | this.classList = []; | 710 | this.classList = []; |
553 | const { data, status, info } = await this.$request.schoolClassList({ | 711 | const { data, status, info } = await this.$request.schoolClassList({ |
554 | grade: value || this.query.grade, | 712 | grade: value || this.query.grade, |
555 | - type: this.query.classType | 713 | + type: this.query.classType, |
556 | }); | 714 | }); |
557 | if (status === 0) { | 715 | if (status === 0) { |
558 | this.classList = (data.list && [...data?.list]) || []; | 716 | this.classList = (data.list && [...data?.list]) || []; |
@@ -569,7 +727,7 @@ export default { | @@ -569,7 +727,7 @@ export default { | ||
569 | this.classList = []; | 727 | this.classList = []; |
570 | const { data, status, info } = await this.$request.schoolClassList({ | 728 | const { data, status, info } = await this.$request.schoolClassList({ |
571 | grade: value, | 729 | grade: value, |
572 | - type: this.query.classType | 730 | + type: this.query.classType, |
573 | }); | 731 | }); |
574 | if (status === 0) { | 732 | if (status === 0) { |
575 | this.classList = (data.list && [...data?.list]) || []; | 733 | this.classList = (data.list && [...data?.list]) || []; |
src/views/basic/setUp/teacher.vue
@@ -6,41 +6,102 @@ | @@ -6,41 +6,102 @@ | ||
6 | </template> | 6 | </template> |
7 | <template slot="btns" v-if="!code"> | 7 | <template slot="btns" v-if="!code"> |
8 | <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> | 8 | <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> |
9 | - <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> | 9 | + <el-button |
10 | + type="primary" | ||
11 | + icon="el-icon-upload2" | ||
12 | + size="mini" | ||
13 | + plain | ||
14 | + circle | ||
15 | + @click="diaUp = true" | ||
16 | + ></el-button> | ||
10 | </el-tooltip> | 17 | </el-tooltip> |
11 | <el-tooltip effect="dark" content="导出教师名单" placement="bottom"> | 18 | <el-tooltip effect="dark" content="导出教师名单" placement="bottom"> |
12 | - <el-button type="primary" icon="el-icon-download" size="mini" plain circle | ||
13 | - @click="exportTeacherExl"></el-button> | 19 | + <el-button |
20 | + type="primary" | ||
21 | + icon="el-icon-download" | ||
22 | + size="mini" | ||
23 | + plain | ||
24 | + circle | ||
25 | + @click="exportTeacherExl" | ||
26 | + ></el-button> | ||
14 | </el-tooltip> | 27 | </el-tooltip> |
15 | <el-tooltip effect="dark" content="添加教师" placement="bottom"> | 28 | <el-tooltip effect="dark" content="添加教师" placement="bottom"> |
16 | - <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="addTeacherDia"></el-button> | 29 | + <el-button |
30 | + type="primary" | ||
31 | + icon="el-icon-plus" | ||
32 | + size="mini" | ||
33 | + plain | ||
34 | + circle | ||
35 | + @click="addTeacherDia" | ||
36 | + ></el-button> | ||
17 | </el-tooltip> | 37 | </el-tooltip> |
18 | </template> | 38 | </template> |
19 | </back-box> | 39 | </back-box> |
20 | 40 | ||
21 | <div class="answer-header"> | 41 | <div class="answer-header"> |
22 | <div class="sel-box"> | 42 | <div class="sel-box"> |
23 | - <el-select class="sel" v-model="query.classType" @change="changeType" placeholder="选择类型"> | 43 | + <el-select |
44 | + class="sel" | ||
45 | + v-model="query.classType" | ||
46 | + @change="changeType" | ||
47 | + placeholder="选择类型" | ||
48 | + > | ||
24 | <el-option label="行政班" :value="0"></el-option> | 49 | <el-option label="行政班" :value="0"></el-option> |
25 | <el-option label="教学班" :value="1"></el-option> | 50 | <el-option label="教学班" :value="1"></el-option> |
26 | </el-select> | 51 | </el-select> |
27 | - <el-cascader size="small" class="sel sel2" clearable placeholder="选择范围" @change="_QueryData(1)" | ||
28 | - v-model="query.gradeClassSub" :options="gradeClassSubList" :props="{ | 52 | + <el-cascader |
53 | + size="small" | ||
54 | + class="sel sel2" | ||
55 | + clearable | ||
56 | + placeholder="选择范围" | ||
57 | + @change="_QueryData(1)" | ||
58 | + v-model="query.gradeClassSub" | ||
59 | + :options="gradeClassSubList" | ||
60 | + :props="{ | ||
29 | multiple: true, | 61 | multiple: true, |
30 | checkStrictly: true, | 62 | checkStrictly: true, |
31 | - }" collapse-tags :show-all-levels="false"></el-cascader> | ||
32 | - <el-select class="sel" v-model="query.type" @change="_QueryData(4)" placeholder="选择类型"> | 63 | + }" |
64 | + collapse-tags | ||
65 | + :show-all-levels="false" | ||
66 | + ></el-cascader> | ||
67 | + <el-select | ||
68 | + class="sel" | ||
69 | + v-model="query.type" | ||
70 | + @change="_QueryData(4)" | ||
71 | + placeholder="选择类型" | ||
72 | + > | ||
33 | <el-option disabled label="请选择" :value="9"></el-option> | 73 | <el-option disabled label="请选择" :value="9"></el-option> |
34 | <el-option label="已分配任课信息" :value="0"></el-option> | 74 | <el-option label="已分配任课信息" :value="0"></el-option> |
35 | <el-option label="未分配任课信息" :value="1"></el-option> | 75 | <el-option label="未分配任课信息" :value="1"></el-option> |
36 | </el-select> | 76 | </el-select> |
37 | - <el-input placeholder="请输入老师姓名" v-model="query.teacherName" class="input-with-select" maxlength="30" clearable | ||
38 | - @keyup.enter.native="_QueryData(2)"> | ||
39 | - <el-button slot="append" icon="el-icon-search" @click="_QueryData(2)"></el-button> | 77 | + <el-input |
78 | + placeholder="请输入老师姓名" | ||
79 | + v-model="query.teacherName" | ||
80 | + class="input-with-select" | ||
81 | + maxlength="30" | ||
82 | + clearable | ||
83 | + @keyup.enter.native="_QueryData(2)" | ||
84 | + > | ||
85 | + <el-button | ||
86 | + slot="append" | ||
87 | + icon="el-icon-search" | ||
88 | + @click="_QueryData(2)" | ||
89 | + ></el-button> | ||
40 | </el-input> | 90 | </el-input> |
41 | - <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)" placeholder="请输入老师手机号" | ||
42 | - v-model="query.phone" clearable class="input-with-select" @keyup.enter.native="_QueryData(3)"> | ||
43 | - <el-button slot="append" icon="el-icon-search" @click="_QueryData(3)"></el-button> | 91 | + <el-input |
92 | + type="number" | ||
93 | + oninput="if(value.length > 11) value = value.slice(0,11)" | ||
94 | + placeholder="请输入老师手机号" | ||
95 | + v-model="query.phone" | ||
96 | + clearable | ||
97 | + class="input-with-select" | ||
98 | + @keyup.enter.native="_QueryData(3)" | ||
99 | + > | ||
100 | + <el-button | ||
101 | + slot="append" | ||
102 | + icon="el-icon-search" | ||
103 | + @click="_QueryData(3)" | ||
104 | + ></el-button> | ||
44 | </el-input> | 105 | </el-input> |
45 | <!-- <el-button class="serach-box" round @click="_QueryData(4)" | 106 | <!-- <el-button class="serach-box" round @click="_QueryData(4)" |
46 | >筛选</el-button | 107 | >筛选</el-button |
@@ -51,23 +112,50 @@ | @@ -51,23 +112,50 @@ | ||
51 | 共筛选出{{ teacherList.length }}名教师。 | 112 | 共筛选出{{ teacherList.length }}名教师。 |
52 | </p> | 113 | </p> |
53 | <div class="page-content"> | 114 | <div class="page-content"> |
54 | - <el-empty :image-size="100" v-if="!teacherList.length && loading == false" description="没有更多数据"></el-empty> | 115 | + <el-empty |
116 | + :image-size="100" | ||
117 | + v-if="!teacherList.length && loading == false" | ||
118 | + description="没有更多数据" | ||
119 | + ></el-empty> | ||
55 | <div class="teacher-box" v-loading="loading" v-else> | 120 | <div class="teacher-box" v-loading="loading" v-else> |
56 | <div class="teacher-list"> | 121 | <div class="teacher-list"> |
57 | <p class="h-title" v-loading="removeLoading"> | 122 | <p class="h-title" v-loading="removeLoading"> |
58 | - <el-checkbox v-show="showDel" v-model="AllTeacher" :indeterminate="indeterminate" | ||
59 | - @change="handleCheckAllChange">{{ "" | ||
60 | - }}</el-checkbox> | 123 | + <el-checkbox |
124 | + v-show="showDel" | ||
125 | + v-model="AllTeacher" | ||
126 | + :indeterminate="indeterminate" | ||
127 | + @change="handleCheckAllChange" | ||
128 | + >{{ "" }}</el-checkbox | ||
129 | + > | ||
61 | <span class="txt">教师列表</span> | 130 | <span class="txt">教师列表</span> |
62 | - <img v-show="showDel" class="clear" @click="remove" src="../../../assets/images/shuazi.svg" alt=""> | 131 | + <img |
132 | + v-show="showDel" | ||
133 | + class="clear" | ||
134 | + @click="remove" | ||
135 | + src="../../../assets/images/shuazi.svg" | ||
136 | + alt="" | ||
137 | + /> | ||
63 | </p> | 138 | </p> |
64 | - <el-checkbox-group v-model="clearTeacher" @change="handleCheckedChange"> | 139 | + <el-checkbox-group |
140 | + v-model="clearTeacher" | ||
141 | + @change="handleCheckedChange" | ||
142 | + > | ||
65 | <ul class="teacher-ul"> | 143 | <ul class="teacher-ul"> |
66 | - <li class="teacher-item" v-for="item in teacherList" :key="item.id" | ||
67 | - :class="showTId == item.id ? 'active' : ''"> | ||
68 | - <el-checkbox v-show="showDel" :label="item.id">{{ "" }}</el-checkbox> | ||
69 | - <p @click="showTeacher(item)"> {{ item.realName | ||
70 | - }}<template v-if="setClass(item)">({{ setClass(item) }})</template></p> | 144 | + <li |
145 | + class="teacher-item" | ||
146 | + v-for="item in teacherList" | ||
147 | + :key="item.id" | ||
148 | + :class="showTId == item.id ? 'active' : ''" | ||
149 | + > | ||
150 | + <el-checkbox v-show="showDel" :label="item.id">{{ | ||
151 | + "" | ||
152 | + }}</el-checkbox> | ||
153 | + <p @click="showTeacher(item)"> | ||
154 | + {{ item.realName | ||
155 | + }}<template v-if="setClass(item)" | ||
156 | + >({{ setClass(item) }})</template | ||
157 | + > | ||
158 | + </p> | ||
71 | </li> | 159 | </li> |
72 | </ul> | 160 | </ul> |
73 | </el-checkbox-group> | 161 | </el-checkbox-group> |
@@ -75,7 +163,10 @@ | @@ -75,7 +163,10 @@ | ||
75 | <div class="teacher-detail"> | 163 | <div class="teacher-detail"> |
76 | <div class="icon-box" v-if="!code"> | 164 | <div class="icon-box" v-if="!code"> |
77 | <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i> | 165 | <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i> |
78 | - <i class="icon el-icon-circle-plus-outline" @click="editTeacher(2)"></i> | 166 | + <i |
167 | + class="icon el-icon-circle-plus-outline" | ||
168 | + @click="editTeacher(2)" | ||
169 | + ></i> | ||
79 | </div> | 170 | </div> |
80 | <div class="detail-top"> | 171 | <div class="detail-top"> |
81 | <p class="p-item">手机号码:{{ teacherDetail.loginName }}</p> | 172 | <p class="p-item">手机号码:{{ teacherDetail.loginName }}</p> |
@@ -85,18 +176,29 @@ | @@ -85,18 +176,29 @@ | ||
85 | <p class="p-item"> | 176 | <p class="p-item"> |
86 | 性别:{{ | 177 | 性别:{{ |
87 | teacherDetail.sex == 1 | 178 | teacherDetail.sex == 1 |
88 | - ? "男" | ||
89 | - : teacherDetail.sex == 2 | 179 | + ? "男" |
180 | + : teacherDetail.sex == 2 | ||
90 | ? "女" | 181 | ? "女" |
91 | : "未知" | 182 | : "未知" |
92 | }} | 183 | }} |
93 | </p> | 184 | </p> |
94 | </div> | 185 | </div> |
95 | - <div class="grade-box" v-if="teacherDetail.managerList && teacherDetail.managerList.length"> | 186 | + <div |
187 | + class="grade-box" | ||
188 | + v-if="teacherDetail.managerList && teacherDetail.managerList.length" | ||
189 | + > | ||
96 | <p class="h-title">班主任</p> | 190 | <p class="h-title">班主任</p> |
97 | <ul class="grade-info"> | 191 | <ul class="grade-info"> |
98 | - <li class="grade-li" v-for="item in teacherDetail.managerList" :key="item.classId"> | ||
99 | - <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 1)" v-if="!code"> | 192 | + <li |
193 | + class="grade-li" | ||
194 | + v-for="item in teacherDetail.managerList" | ||
195 | + :key="item.classId" | ||
196 | + > | ||
197 | + <el-popconfirm | ||
198 | + title="确定删除吗?" | ||
199 | + @confirm="delTeacherManager(item, 1)" | ||
200 | + v-if="!code" | ||
201 | + > | ||
100 | <i class="el-icon-delete" slot="reference"></i> | 202 | <i class="el-icon-delete" slot="reference"></i> |
101 | </el-popconfirm> | 203 | </el-popconfirm> |
102 | <div class="grade-item"> | 204 | <div class="grade-item"> |
@@ -114,13 +216,25 @@ | @@ -114,13 +216,25 @@ | ||
114 | </li> | 216 | </li> |
115 | </ul> | 217 | </ul> |
116 | </div> | 218 | </div> |
117 | - <div class="grade-box" v-if="teacherDetail.teacherCourseList && | ||
118 | - teacherDetail.teacherCourseList.length | ||
119 | - "> | 219 | + <div |
220 | + class="grade-box" | ||
221 | + v-if=" | ||
222 | + teacherDetail.teacherCourseList && | ||
223 | + teacherDetail.teacherCourseList.length | ||
224 | + " | ||
225 | + > | ||
120 | <p class="h-title">任课老师</p> | 226 | <p class="h-title">任课老师</p> |
121 | <ul class="grade-info"> | 227 | <ul class="grade-info"> |
122 | - <li class="grade-li" v-for="item in teacherDetail.teacherCourseList" :key="item.classId + item.subjectName"> | ||
123 | - <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 2)" v-if="!code"> | 228 | + <li |
229 | + class="grade-li" | ||
230 | + v-for="item in teacherDetail.teacherCourseList" | ||
231 | + :key="item.classId + item.subjectName" | ||
232 | + > | ||
233 | + <el-popconfirm | ||
234 | + title="确定删除吗?" | ||
235 | + @confirm="delTeacherManager(item, 2)" | ||
236 | + v-if="!code" | ||
237 | + > | ||
124 | <i class="el-icon-delete" slot="reference"></i> | 238 | <i class="el-icon-delete" slot="reference"></i> |
125 | </el-popconfirm> | 239 | </el-popconfirm> |
126 | <div class="grade-item"> | 240 | <div class="grade-item"> |
@@ -140,13 +254,25 @@ | @@ -140,13 +254,25 @@ | ||
140 | </li> | 254 | </li> |
141 | </ul> | 255 | </ul> |
142 | </div> | 256 | </div> |
143 | - <div class="grade-box" v-if="teacherDetail.teacherGradeList && | ||
144 | - teacherDetail.teacherGradeList.length | ||
145 | - "> | 257 | + <!-- <div |
258 | + class="grade-box" | ||
259 | + v-if=" | ||
260 | + teacherDetail.teacherGradeList && | ||
261 | + teacherDetail.teacherGradeList.length | ||
262 | + " | ||
263 | + > | ||
146 | <p class="h-title">备课组长</p> | 264 | <p class="h-title">备课组长</p> |
147 | - <ul class="grade-info" v-for="item in teacherDetail.teacherGradeList" :key="item.grade"> | 265 | + <ul |
266 | + class="grade-info" | ||
267 | + v-for="item in teacherDetail.teacherGradeList" | ||
268 | + :key="item.grade" | ||
269 | + > | ||
148 | <li class="grade-li"> | 270 | <li class="grade-li"> |
149 | - <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 3)" v-if="!code"> | 271 | + <el-popconfirm |
272 | + title="确定删除吗?" | ||
273 | + @confirm="delTeacherManager(item, 3)" | ||
274 | + v-if="!code" | ||
275 | + > | ||
150 | <i class="el-icon-delete" slot="reference"></i> | 276 | <i class="el-icon-delete" slot="reference"></i> |
151 | </el-popconfirm> | 277 | </el-popconfirm> |
152 | <div class="grade-item"> | 278 | <div class="grade-item"> |
@@ -156,12 +282,22 @@ | @@ -156,12 +282,22 @@ | ||
156 | </div> | 282 | </div> |
157 | </li> | 283 | </li> |
158 | </ul> | 284 | </ul> |
159 | - </div> | 285 | + </div> --> |
160 | </div> | 286 | </div> |
161 | </div> | 287 | </div> |
162 | </div> | 288 | </div> |
163 | - <el-dialog :close-on-click-modal="false" title="导入教师名单" :visible.sync="diaUp" width="600"> | ||
164 | - <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="教师名单"> | 289 | + <el-dialog |
290 | + :close-on-click-modal="false" | ||
291 | + title="导入教师名单" | ||
292 | + :visible.sync="diaUp" | ||
293 | + width="600" | ||
294 | + > | ||
295 | + <upload | ||
296 | + id="downTeacher" | ||
297 | + :url="url" | ||
298 | + @upSuccess="upSuccess" | ||
299 | + fileName="教师名单" | ||
300 | + > | ||
165 | <p class="down-txt" slot="down"> | 301 | <p class="down-txt" slot="down"> |
166 | 通过Excel名单导入教师名单,点击 | 302 | 通过Excel名单导入教师名单,点击 |
167 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 303 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
@@ -171,42 +307,116 @@ | @@ -171,42 +307,116 @@ | ||
171 | <el-button @click="diaUp = false">取 消</el-button> | 307 | <el-button @click="diaUp = false">取 消</el-button> |
172 | </div> | 308 | </div> |
173 | </el-dialog> | 309 | </el-dialog> |
174 | - <el-dialog :close-on-click-modal="false" :title="isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级' | ||
175 | - " :visible.sync="diaTeacher" width="400" append-to-body> | ||
176 | - <el-form class="form-box" ref="formTeacher" :model="formTeacher" :rules="rulesTeacher" label="" width="160px"> | 310 | + <el-dialog |
311 | + :close-on-click-modal="false" | ||
312 | + :title=" | ||
313 | + isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级' | ||
314 | + " | ||
315 | + :visible.sync="diaTeacher" | ||
316 | + width="400" | ||
317 | + append-to-body | ||
318 | + > | ||
319 | + <el-form | ||
320 | + class="form-box" | ||
321 | + ref="formTeacher" | ||
322 | + :model="formTeacher" | ||
323 | + :rules="rulesTeacher" | ||
324 | + label="" | ||
325 | + width="160px" | ||
326 | + > | ||
177 | <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:"> | 327 | <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:"> |
178 | <span>{{ formTeacher.teacherName }}</span> | 328 | <span>{{ formTeacher.teacherName }}</span> |
179 | </el-form-item> | 329 | </el-form-item> |
180 | - <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="手机号码:" prop="loginName"> | 330 | + <el-form-item |
331 | + v-show="isAdd || (!isAdd && setTercherType == 1)" | ||
332 | + label="手机号码:" | ||
333 | + prop="loginName" | ||
334 | + > | ||
181 | <el-col :span="10"> | 335 | <el-col :span="10"> |
182 | - <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)" | ||
183 | - v-model.trim="formTeacher.loginName" /> | 336 | + <el-input |
337 | + type="number" | ||
338 | + oninput="if(value.length > 11) value = value.slice(0,11)" | ||
339 | + v-model.trim="formTeacher.loginName" | ||
340 | + /> | ||
184 | </el-col> | 341 | </el-col> |
185 | </el-form-item> | 342 | </el-form-item> |
186 | - <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="教师姓名:" prop="teacherName"> | 343 | + <el-form-item |
344 | + v-show="isAdd || (!isAdd && setTercherType == 1)" | ||
345 | + label="教师姓名:" | ||
346 | + prop="teacherName" | ||
347 | + > | ||
187 | <el-col :span="10"> | 348 | <el-col :span="10"> |
188 | <el-input maxlength="30" v-model.trim="formTeacher.teacherName" /> | 349 | <el-input maxlength="30" v-model.trim="formTeacher.teacherName" /> |
189 | </el-col> | 350 | </el-col> |
190 | </el-form-item> | 351 | </el-form-item> |
191 | - <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="性别:" prop="sex"> | 352 | + <el-form-item |
353 | + v-show="isAdd || (!isAdd && setTercherType == 1)" | ||
354 | + label="性别:" | ||
355 | + prop="sex" | ||
356 | + > | ||
192 | <el-radio-group v-model="formTeacher.sex"> | 357 | <el-radio-group v-model="formTeacher.sex"> |
193 | <el-radio :label="1">男</el-radio> | 358 | <el-radio :label="1">男</el-radio> |
194 | <el-radio :label="2">女</el-radio> | 359 | <el-radio :label="2">女</el-radio> |
195 | </el-radio-group> | 360 | </el-radio-group> |
196 | </el-form-item> | 361 | </el-form-item> |
197 | - <el-form-item v-show="isAdd || (!isAdd && setTercherType == 2)" label="教师角色:" prop="roleList"> | ||
198 | - <div class="role-list" v-for="(item, index) in formTeacher.roleList" :key="item.id"> | ||
199 | - <el-select class="sel-c" v-model="item.roleId" placeholder="选择角色" @change="item.classId = []"> | ||
200 | - <el-option v-for="item in teacherRoleList" :key="item.value" :label="item.label" :value="item.value"> | 362 | + <el-form-item |
363 | + v-show="isAdd || (!isAdd && setTercherType == 2)" | ||
364 | + label="教师角色:" | ||
365 | + prop="roleList" | ||
366 | + > | ||
367 | + <div | ||
368 | + class="role-list" | ||
369 | + v-for="(item, index) in formTeacher.roleList" | ||
370 | + :key="item.id" | ||
371 | + > | ||
372 | + <el-select | ||
373 | + class="sel-c" | ||
374 | + v-model="item.roleId" | ||
375 | + placeholder="选择角色" | ||
376 | + @change="item.classId = []" | ||
377 | + > | ||
378 | + <el-option | ||
379 | + v-for="item in teacherRoleList" | ||
380 | + :key="item.value" | ||
381 | + :label="item.label" | ||
382 | + :value="item.value" | ||
383 | + > | ||
201 | </el-option> | 384 | </el-option> |
202 | </el-select> | 385 | </el-select> |
203 | - <el-cascader size="small" v-if="item.roleId == 6" class="sel-t" collapse clearable placeholder="选择年级-班级" | ||
204 | - v-model="item.classId" :options="gradeClassList" :props="{ expandTrigger: 'hover' }"></el-cascader> | ||
205 | - <el-cascader size="small" v-if="item.roleId == 7" class="sel-t teacher-cascader" collapse clearable | ||
206 | - placeholder="选择年级-科目-班级" v-model="item.classId" :options="gradeSubListClass" | ||
207 | - :props="{ expandTrigger: 'hover', multiple: true }" popperClass="cascader-clazz"></el-cascader> | ||
208 | - <el-cascader size="small" v-if="item.roleId == 8" class="sel-t" collapse clearable placeholder="选择年级-科目" | ||
209 | - v-model="item.classId" :options="gradeList" :props="{ expandTrigger: 'hover' }"></el-cascader> | 386 | + <el-cascader |
387 | + size="small" | ||
388 | + v-if="item.roleId == 6" | ||
389 | + class="sel-t" | ||
390 | + collapse | ||
391 | + clearable | ||
392 | + placeholder="选择年级-班级" | ||
393 | + v-model="item.classId" | ||
394 | + :options="gradeClassList" | ||
395 | + :props="{ expandTrigger: 'hover' }" | ||
396 | + ></el-cascader> | ||
397 | + <el-cascader | ||
398 | + size="small" | ||
399 | + v-if="item.roleId == 7" | ||
400 | + class="sel-t teacher-cascader" | ||
401 | + collapse | ||
402 | + clearable | ||
403 | + placeholder="选择年级-科目-班级" | ||
404 | + v-model="item.classId" | ||
405 | + :options="gradeSubListClass" | ||
406 | + :props="{ expandTrigger: 'hover', multiple: true }" | ||
407 | + popperClass="cascader-clazz" | ||
408 | + ></el-cascader> | ||
409 | + <el-cascader | ||
410 | + size="small" | ||
411 | + v-if="item.roleId == 8" | ||
412 | + class="sel-t" | ||
413 | + collapse | ||
414 | + clearable | ||
415 | + placeholder="选择年级-科目" | ||
416 | + v-model="item.classId" | ||
417 | + :options="gradeList" | ||
418 | + :props="{ expandTrigger: 'hover' }" | ||
419 | + ></el-cascader> | ||
210 | <i class="el-icon-close" @click="removeRoleList(index)"></i> | 420 | <i class="el-icon-close" @click="removeRoleList(index)"></i> |
211 | </div> | 421 | </div> |
212 | <p class="add-box"> | 422 | <p class="add-box"> |
@@ -262,10 +472,10 @@ export default { | @@ -262,10 +472,10 @@ export default { | ||
262 | value: 7, | 472 | value: 7, |
263 | label: "任课老师", | 473 | label: "任课老师", |
264 | }, | 474 | }, |
265 | - { | ||
266 | - value: 8, | ||
267 | - label: "备课组长", | ||
268 | - }, | 475 | + // { |
476 | + // value: 8, | ||
477 | + // label: "备课组长", | ||
478 | + // }, | ||
269 | ], | 479 | ], |
270 | teacherRoleList: [ | 480 | teacherRoleList: [ |
271 | //角色 | 481 | //角色 |
@@ -277,10 +487,10 @@ export default { | @@ -277,10 +487,10 @@ export default { | ||
277 | value: 7, | 487 | value: 7, |
278 | label: "任课老师", | 488 | label: "任课老师", |
279 | }, | 489 | }, |
280 | - { | ||
281 | - value: 8, | ||
282 | - label: "备课组长", | ||
283 | - }, | 490 | + // { |
491 | + // value: 8, | ||
492 | + // label: "备课组长", | ||
493 | + // }, | ||
284 | ], | 494 | ], |
285 | teacherDetail: { | 495 | teacherDetail: { |
286 | teacherName: "", | 496 | teacherName: "", |
@@ -301,10 +511,10 @@ export default { | @@ -301,10 +511,10 @@ export default { | ||
301 | }, | 511 | }, |
302 | rulesTeacher: { | 512 | rulesTeacher: { |
303 | teacherName: [ | 513 | teacherName: [ |
304 | - { required: true, message: "请输入联系电话", trigger: "blur" }, | 514 | + { required: true, message: "请输入教师姓名", trigger: "blur" }, |
305 | ], | 515 | ], |
306 | loginName: [ | 516 | loginName: [ |
307 | - { required: true, message: "请输入教师姓名", trigger: "blur" }, | 517 | + { required: true, message: "请输入联系电话", trigger: "blur" }, |
308 | ], | 518 | ], |
309 | sex: [{ required: true, message: "请选择性别", trigger: "blur" }], | 519 | sex: [{ required: true, message: "请选择性别", trigger: "blur" }], |
310 | roleList: [ | 520 | roleList: [ |
@@ -315,17 +525,15 @@ export default { | @@ -315,17 +525,15 @@ export default { | ||
315 | AllTeacher: false, | 525 | AllTeacher: false, |
316 | indeterminate: false, | 526 | indeterminate: false, |
317 | clearTeacher: [], | 527 | clearTeacher: [], |
318 | - removeLoading: false | ||
319 | - | ||
320 | - | 528 | + removeLoading: false, |
321 | }; | 529 | }; |
322 | }, | 530 | }, |
323 | computed: { | 531 | computed: { |
324 | showDel: function () { | 532 | showDel: function () { |
325 | - return !this.query.gradeClassSub.some(item => { | ||
326 | - return item.length > 1 | ||
327 | - }) | ||
328 | - } | 533 | + return !this.query.gradeClassSub.some((item) => { |
534 | + return item.length > 1; | ||
535 | + }); | ||
536 | + }, | ||
329 | }, | 537 | }, |
330 | async created() { | 538 | async created() { |
331 | this.code = this.$store.getters.csCode; | 539 | this.code = this.$store.getters.csCode; |
@@ -335,14 +543,14 @@ export default { | @@ -335,14 +543,14 @@ export default { | ||
335 | }, | 543 | }, |
336 | methods: { | 544 | methods: { |
337 | async changeType() { | 545 | async changeType() { |
338 | - this.query.gradeClassSub = [] | ||
339 | - this.query.type = 0 | ||
340 | - this.query.teacherName = "" | ||
341 | - this.query.phone = "" | 546 | + this.query.gradeClassSub = []; |
547 | + this.query.type = 0; | ||
548 | + this.query.teacherName = ""; | ||
549 | + this.query.phone = ""; | ||
342 | if (this.query.classType === 0) { | 550 | if (this.query.classType === 0) { |
343 | - this.teacherRoleList = [...this.RoleList] | 551 | + this.teacherRoleList = [...this.RoleList]; |
344 | } else { | 552 | } else { |
345 | - this.teacherRoleList = this.RoleList.slice(1, 3) | 553 | + this.teacherRoleList = this.RoleList.slice(1, 3); |
346 | } | 554 | } |
347 | 555 | ||
348 | this._QueryData(6); | 556 | this._QueryData(6); |
@@ -352,8 +560,8 @@ export default { | @@ -352,8 +560,8 @@ export default { | ||
352 | handleCheckAllChange(val) { | 560 | handleCheckAllChange(val) { |
353 | this.clearTeacher = val | 561 | this.clearTeacher = val |
354 | ? this.teacherList.map((item) => { | 562 | ? this.teacherList.map((item) => { |
355 | - return item.id; | ||
356 | - }) | 563 | + return item.id; |
564 | + }) | ||
357 | : []; | 565 | : []; |
358 | this.indeterminate = false; | 566 | this.indeterminate = false; |
359 | }, | 567 | }, |
@@ -366,24 +574,24 @@ export default { | @@ -366,24 +574,24 @@ export default { | ||
366 | //清除教师绑定班级信息 | 574 | //清除教师绑定班级信息 |
367 | async remove() { | 575 | async remove() { |
368 | if (!this.clearTeacher.length) { | 576 | if (!this.clearTeacher.length) { |
369 | - this.$message.warning("请选择要格式化的老师") | ||
370 | - return | 577 | + this.$message.warning("请选择要格式化的老师"); |
578 | + return; | ||
371 | } | 579 | } |
372 | - this.removeLoading = true | ||
373 | - let grades = [] | ||
374 | - this.query.gradeClassSub.map(item => { | 580 | + this.removeLoading = true; |
581 | + let grades = []; | ||
582 | + this.query.gradeClassSub.map((item) => { | ||
375 | if (item.length == 1) { | 583 | if (item.length == 1) { |
376 | if (!grades.includes(item[0])) { | 584 | if (!grades.includes(item[0])) { |
377 | grades.push(item[0]); | 585 | grades.push(item[0]); |
378 | } | 586 | } |
379 | } | 587 | } |
380 | - }) | 588 | + }); |
381 | const { data, status, info } = await this.$request.clearTeacherClasses({ | 589 | const { data, status, info } = await this.$request.clearTeacherClasses({ |
382 | ids: this.clearTeacher, | 590 | ids: this.clearTeacher, |
383 | type: this.query.classType, | 591 | type: this.query.classType, |
384 | - grades: grades | 592 | + grades: grades, |
385 | }); | 593 | }); |
386 | - this.removeLoading = false | 594 | + this.removeLoading = false; |
387 | if (status === 0) { | 595 | if (status === 0) { |
388 | this.$message.success(info); | 596 | this.$message.success(info); |
389 | this._QueryData(); | 597 | this._QueryData(); |
@@ -469,11 +677,11 @@ export default { | @@ -469,11 +677,11 @@ export default { | ||
469 | //添加教师 | 677 | //添加教师 |
470 | addTeacher() { | 678 | addTeacher() { |
471 | if (this.setTercherType == 1) { | 679 | if (this.setTercherType == 1) { |
472 | - delete this.rulesTeacher.roleList | 680 | + delete this.rulesTeacher.roleList; |
473 | } else { | 681 | } else { |
474 | this.rulesTeacher.roleList = [ | 682 | this.rulesTeacher.roleList = [ |
475 | { required: true, message: "请选择角色信息", trigger: "blur" }, | 683 | { required: true, message: "请选择角色信息", trigger: "blur" }, |
476 | - ] | 684 | + ]; |
477 | } | 685 | } |
478 | this.$refs.formTeacher.validate(async (valid) => { | 686 | this.$refs.formTeacher.validate(async (valid) => { |
479 | if (valid) { | 687 | if (valid) { |
@@ -509,7 +717,7 @@ export default { | @@ -509,7 +717,7 @@ export default { | ||
509 | this.$message.error(res.info); | 717 | this.$message.error(res.info); |
510 | } | 718 | } |
511 | } else { | 719 | } else { |
512 | - console.log(valid) | 720 | + console.log(valid); |
513 | this.$message.warning("输入有误请检查!"); | 721 | this.$message.warning("输入有误请检查!"); |
514 | return false; | 722 | return false; |
515 | } | 723 | } |
@@ -733,7 +941,7 @@ export default { | @@ -733,7 +941,7 @@ export default { | ||
733 | query.teacherName.length ? "" : delete query.teacherName; | 941 | query.teacherName.length ? "" : delete query.teacherName; |
734 | query.phone.length ? "" : delete query.phone; | 942 | query.phone.length ? "" : delete query.phone; |
735 | } | 943 | } |
736 | - query.classType = this.query.classType | 944 | + query.classType = this.query.classType; |
737 | return query; | 945 | return query; |
738 | }, | 946 | }, |
739 | async _QueryData(type) { | 947 | async _QueryData(type) { |
@@ -752,7 +960,7 @@ export default { | @@ -752,7 +960,7 @@ export default { | ||
752 | this.loading = true; | 960 | this.loading = true; |
753 | let query = this.setQuery(type); | 961 | let query = this.setQuery(type); |
754 | this.teacherList = []; | 962 | this.teacherList = []; |
755 | - this.clearTeacher = [] | 963 | + this.clearTeacher = []; |
756 | const { data, status, info } = await this.$request.teacherList({ | 964 | const { data, status, info } = await this.$request.teacherList({ |
757 | ...query, | 965 | ...query, |
758 | }); | 966 | }); |
@@ -780,10 +988,10 @@ export default { | @@ -780,10 +988,10 @@ export default { | ||
780 | type: this.query.classType, | 988 | type: this.query.classType, |
781 | }); | 989 | }); |
782 | if (status === 0) { | 990 | if (status === 0) { |
783 | - this.classList = [] | ||
784 | - this.gradeClassList = [] | ||
785 | - this.gradeClassSubList = [] | ||
786 | - this.gradeSubListClass = [] | 991 | + this.classList = []; |
992 | + this.gradeClassList = []; | ||
993 | + this.gradeClassSubList = []; | ||
994 | + this.gradeSubListClass = []; | ||
787 | this.gradeList = | 995 | this.gradeList = |
788 | data.list?.map((item) => { | 996 | data.list?.map((item) => { |
789 | let subList = item.subjectNames?.map((items) => { | 997 | let subList = item.subjectNames?.map((items) => { |
@@ -792,6 +1000,7 @@ export default { | @@ -792,6 +1000,7 @@ export default { | ||
792 | label: items, | 1000 | label: items, |
793 | }; | 1001 | }; |
794 | }); | 1002 | }); |
1003 | + // 学校-年级 | ||
795 | this.gradeClassList.push({ | 1004 | this.gradeClassList.push({ |
796 | value: item.grade, | 1005 | value: item.grade, |
797 | label: item.gradeName, | 1006 | label: item.gradeName, |
@@ -804,36 +1013,82 @@ export default { | @@ -804,36 +1013,82 @@ export default { | ||
804 | }; | 1013 | }; |
805 | }), | 1014 | }), |
806 | }); | 1015 | }); |
807 | - this.gradeClassSubList.push({ | ||
808 | - value: item.grade, | ||
809 | - label: item.gradeName, | ||
810 | - id: item.grade, | ||
811 | - children: item.classList.map((clazz) => { | ||
812 | - return { | ||
813 | - value: clazz.id, | ||
814 | - label: clazz.className, | ||
815 | - id: clazz.id, | ||
816 | - children: [...subList], | ||
817 | - }; | ||
818 | - }), | ||
819 | - }); | ||
820 | - this.gradeSubListClass.push({ | ||
821 | - value: item.grade, | ||
822 | - label: item.gradeName, | ||
823 | - id: item.grade, | ||
824 | - children: item.subjectNames.map((items) => { | 1016 | + |
1017 | + if (this.query.classType == 0) { | ||
1018 | + //学校-年级-科目 | ||
1019 | + this.gradeClassSubList.push({ | ||
1020 | + value: item.grade, | ||
1021 | + label: item.gradeName, | ||
1022 | + id: item.grade, | ||
1023 | + children: item.classList.map((clazz) => { | ||
1024 | + return { | ||
1025 | + value: clazz.id, | ||
1026 | + label: clazz.className, | ||
1027 | + id: clazz.id, | ||
1028 | + children: [...subList], | ||
1029 | + }; | ||
1030 | + }), | ||
1031 | + }); | ||
1032 | + //学校-科目-班级 | ||
1033 | + this.gradeSubListClass.push({ | ||
1034 | + value: item.grade, | ||
1035 | + label: item.gradeName, | ||
1036 | + id: item.grade, | ||
1037 | + children: item.subjectNames.map((items) => { | ||
1038 | + return { | ||
1039 | + value: items, | ||
1040 | + label: items, | ||
1041 | + children: item.classList.map((clazz) => { | ||
1042 | + return { | ||
1043 | + value: clazz.id, | ||
1044 | + label: clazz.className, | ||
1045 | + }; | ||
1046 | + }), | ||
1047 | + }; | ||
1048 | + }), | ||
1049 | + }); | ||
1050 | + } else { | ||
1051 | + let subjectNames = item.classList.map((clazz) => { | ||
825 | return { | 1052 | return { |
826 | - value: items, | ||
827 | - label: items, | ||
828 | - children: item.classList.map((clazz) => { | ||
829 | - return { | 1053 | + value: clazz.subjectName, |
1054 | + label: clazz.subjectName, | ||
1055 | + children: [ | ||
1056 | + { | ||
830 | value: clazz.id, | 1057 | value: clazz.id, |
831 | label: clazz.className, | 1058 | label: clazz.className, |
832 | - }; | ||
833 | - }), | 1059 | + }, |
1060 | + ], | ||
834 | }; | 1061 | }; |
835 | - }), | ||
836 | - }); | 1062 | + }); |
1063 | + | ||
1064 | + //学校-年级-科目 | ||
1065 | + this.gradeClassSubList.push({ | ||
1066 | + value: item.grade, | ||
1067 | + label: item.gradeName, | ||
1068 | + id: item.grade, | ||
1069 | + children: item.classList.map((clazz) => { | ||
1070 | + return { | ||
1071 | + value: clazz.id, | ||
1072 | + label: clazz.className, | ||
1073 | + id: clazz.id, | ||
1074 | + children: [ | ||
1075 | + { | ||
1076 | + value: clazz.subjectName, | ||
1077 | + label: clazz.subjectName, | ||
1078 | + }, | ||
1079 | + ], | ||
1080 | + }; | ||
1081 | + }), | ||
1082 | + }); | ||
1083 | + | ||
1084 | + this.gradeSubListClass.push({ | ||
1085 | + value: item.grade, | ||
1086 | + label: item.gradeName, | ||
1087 | + id: item.grade, | ||
1088 | + children: subjectNames, | ||
1089 | + }); | ||
1090 | + } | ||
1091 | + | ||
837 | let classList = item.classList.map((clazz) => { | 1092 | let classList = item.classList.map((clazz) => { |
838 | return { | 1093 | return { |
839 | value: clazz.id, | 1094 | value: clazz.id, |
@@ -841,8 +1096,8 @@ export default { | @@ -841,8 +1096,8 @@ export default { | ||
841 | grade: item.grade, | 1096 | grade: item.grade, |
842 | gradeName: item.gradeName, | 1097 | gradeName: item.gradeName, |
843 | }; | 1098 | }; |
844 | - }) | ||
845 | - this.classList = this.classList.concat(classList) | 1099 | + }); |
1100 | + this.classList = this.classList.concat(classList); | ||
846 | return { | 1101 | return { |
847 | value: item.grade, | 1102 | value: item.grade, |
848 | label: item.gradeName, | 1103 | label: item.gradeName, |
@@ -933,7 +1188,7 @@ export default { | @@ -933,7 +1188,7 @@ export default { | ||
933 | width: 18px; | 1188 | width: 18px; |
934 | margin-right: 10px; | 1189 | margin-right: 10px; |
935 | cursor: pointer; | 1190 | cursor: pointer; |
936 | - transition: all .3s; | 1191 | + transition: all 0.3s; |
937 | 1192 | ||
938 | &:hover { | 1193 | &:hover { |
939 | transform: scale(1.1); | 1194 | transform: scale(1.1); |
@@ -1001,7 +1256,7 @@ export default { | @@ -1001,7 +1256,7 @@ export default { | ||
1001 | flex-wrap: wrap; | 1256 | flex-wrap: wrap; |
1002 | padding: 20px 20px 0; | 1257 | padding: 20px 20px 0; |
1003 | 1258 | ||
1004 | - &>li { | 1259 | + & > li { |
1005 | margin-right: 20px; | 1260 | margin-right: 20px; |
1006 | margin-bottom: 20px; | 1261 | margin-bottom: 20px; |
1007 | position: relative; | 1262 | position: relative; |
src/views/basic/test/components/multipleSubTest.vue
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | <RadarChart id="radarChart" :params="chartData" /> | 38 | <RadarChart id="radarChart" :params="chartData" /> |
39 | </div> | 39 | </div> |
40 | </el-dialog> | 40 | </el-dialog> |
41 | - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" /> | 41 | + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" type="雷达图"/> |
42 | </div> | 42 | </div> |
43 | </template> | 43 | </template> |
44 | <script> | 44 | <script> |
src/views/basic/test/components/multipleTest.vue
1 | <template> | 1 | <template> |
2 | <div class="table-box" ref="main" v-loading="loading"> | 2 | <div class="table-box" ref="main" v-loading="loading"> |
3 | <div id="print-content"> | 3 | <div id="print-content"> |
4 | - <el-table :max-height="tableMaxHeight" :data="tableData" border style="width: 100%"> | ||
5 | - <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column> | 4 | + <el-table |
5 | + :max-height="tableMaxHeight" | ||
6 | + :data="tableData" | ||
7 | + border | ||
8 | + style="width: 100%" | ||
9 | + > | ||
10 | + <el-table-column | ||
11 | + prop="studentCode" | ||
12 | + label="学号" | ||
13 | + align="center" | ||
14 | + fixed | ||
15 | + ></el-table-column> | ||
6 | <el-table-column prop="studentName" label="姓名" fixed align="center"> | 16 | <el-table-column prop="studentName" label="姓名" fixed align="center"> |
7 | - <template slot-scope="scoped"><span class="click-b" @click="toPortrait(scoped.row)"> | 17 | + <template slot-scope="scoped" |
18 | + ><span class="click-b" @click="toPortrait(scoped.row)"> | ||
8 | {{ scoped.row.studentName }} | 19 | {{ scoped.row.studentName }} |
9 | - </span></template></el-table-column> | ||
10 | - <el-table-column align="center" v-for="(item, index) in answerList" :key="index" :label="item.title"> | ||
11 | - <el-table-column :prop="'score' + index" :label="index == 0 ? '总分' : '成绩'" align="center" | ||
12 | - :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column> | ||
13 | - <el-table-column :prop="'classRank' + index" label="班名" align="center" sortable | ||
14 | - :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column> | 20 | + </span></template |
21 | + ></el-table-column | ||
22 | + > | ||
23 | + <el-table-column | ||
24 | + align="center" | ||
25 | + v-for="(item, index) in answerList" | ||
26 | + :key="index" | ||
27 | + :label="item.title" | ||
28 | + > | ||
29 | + <el-table-column | ||
30 | + :prop="'score' + index" | ||
31 | + :label="index == 0 ? '总分' : '成绩'" | ||
32 | + align="center" | ||
33 | + :class-name="index % 2 == 0 ? 'bg' : ''" | ||
34 | + ></el-table-column> | ||
35 | + <el-table-column | ||
36 | + :prop="'classRank' + index" | ||
37 | + label="班名" | ||
38 | + align="center" | ||
39 | + sortable | ||
40 | + :class-name="index % 2 == 0 ? 'bg' : ''" | ||
41 | + ></el-table-column> | ||
15 | </el-table-column> | 42 | </el-table-column> |
16 | <el-table-column label="查看折线图" align="center"> | 43 | <el-table-column label="查看折线图" align="center"> |
17 | <template slot-scope="scoped"> | 44 | <template slot-scope="scoped"> |
18 | - <el-button @click="openChart(scoped.row)" type="primary" size="mini" circle | ||
19 | - icon="el-icon-arrow-right"></el-button> | 45 | + <el-button |
46 | + @click="openChart(scoped.row)" | ||
47 | + type="primary" | ||
48 | + size="mini" | ||
49 | + circle | ||
50 | + icon="el-icon-arrow-right" | ||
51 | + ></el-button> | ||
20 | </template> | 52 | </template> |
21 | </el-table-column> | 53 | </el-table-column> |
22 | </el-table> | 54 | </el-table> |
23 | </div> | 55 | </div> |
24 | <div class="down"> | 56 | <div class="down"> |
25 | - <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button> | ||
26 | - <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round | ||
27 | - icon="el-icon-printer">打印</el-button> | 57 | + <el-button |
58 | + @click="openDown" | ||
59 | + type="primary" | ||
60 | + plain | ||
61 | + round | ||
62 | + icon="fa fa-cloud-download" | ||
63 | + >导出报表</el-button | ||
64 | + > | ||
65 | + <el-button | ||
66 | + v-if="!this.$store.getters.code" | ||
67 | + @click="print" | ||
68 | + type="primary" | ||
69 | + plain | ||
70 | + round | ||
71 | + icon="el-icon-printer" | ||
72 | + >打印</el-button | ||
73 | + > | ||
28 | </div> | 74 | </div> |
29 | - <el-dialog class="chart-dia" :visible.sync="chartDia" :title="chartTitle" width="800"> | 75 | + <el-dialog |
76 | + class="chart-dia" | ||
77 | + :visible.sync="chartDia" | ||
78 | + :title="chartTitle" | ||
79 | + width="800" | ||
80 | + > | ||
30 | <div class="chart-box"> | 81 | <div class="chart-box"> |
31 | - <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" /> | 82 | + <LineChart |
83 | + id="lineChart" | ||
84 | + :params="chartData" | ||
85 | + :xAxis="xAxis" | ||
86 | + :formatterYAxis="false" | ||
87 | + /> | ||
32 | </div> | 88 | </div> |
33 | </el-dialog> | 89 | </el-dialog> |
34 | - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" | ||
35 | - lastLabel="总分" /> | 90 | + <ExportDia |
91 | + :exportStudent="exportStudent" | ||
92 | + :diaShow="diaShow" | ||
93 | + @cancel="cancel" | ||
94 | + @exportData="exportData" | ||
95 | + lastLabel="总分" | ||
96 | + /> | ||
36 | </div> | 97 | </div> |
37 | <!-- 单科多卷 --> | 98 | <!-- 单科多卷 --> |
38 | </template> | 99 | </template> |
39 | <script> | 100 | <script> |
40 | -import LineChart from "@/components/charts/lineChart" | 101 | +import LineChart from "@/components/charts/lineChart"; |
41 | import { downloadFile, tablePrint } from "@/utils"; | 102 | import { downloadFile, tablePrint } from "@/utils"; |
42 | export default { | 103 | export default { |
43 | components: { LineChart }, | 104 | components: { LineChart }, |
@@ -61,23 +122,23 @@ export default { | @@ -61,23 +122,23 @@ export default { | ||
61 | 122 | ||
62 | //导出相关 | 123 | //导出相关 |
63 | diaShow: false, | 124 | diaShow: false, |
64 | - exportStudent: [] | ||
65 | - } | 125 | + exportStudent: [], |
126 | + }; | ||
66 | }, | 127 | }, |
67 | computed: { | 128 | computed: { |
68 | chartTitle: function () { | 129 | chartTitle: function () { |
69 | - return `${this.studentName}-${this.subjectName}-多课时作答表现图` | ||
70 | - } | 130 | + return `${this.studentName}-${this.subjectName}-多课时作答表现图`; |
131 | + }, | ||
71 | }, | 132 | }, |
72 | created() { | 133 | created() { |
73 | - this.phaseExamReport() | 134 | + this.phaseExamReport(); |
74 | }, | 135 | }, |
75 | mounted() { | 136 | mounted() { |
76 | this.tableMaxHeight = this.$refs.main.offsetHeight; | 137 | this.tableMaxHeight = this.$refs.main.offsetHeight; |
77 | }, | 138 | }, |
78 | methods: { | 139 | methods: { |
79 | print() { | 140 | print() { |
80 | - tablePrint("print-content", this.subjectName + '汇总报表'); | 141 | + tablePrint("print-content", this.subjectName + "汇总报表"); |
81 | }, | 142 | }, |
82 | toPortrait(obj) { | 143 | toPortrait(obj) { |
83 | //暂时不上线 | 144 | //暂时不上线 |
@@ -117,33 +178,32 @@ export default { | @@ -117,33 +178,32 @@ export default { | ||
117 | }, | 178 | }, |
118 | //查看折线图 | 179 | //查看折线图 |
119 | openChart(obj) { | 180 | openChart(obj) { |
120 | - this.studentName = obj.studentName | ||
121 | - this.chartDia = true | ||
122 | - let score = [] | ||
123 | - let classRank = [] | ||
124 | - let avgScore = [] | ||
125 | - const examList = obj.examList.slice(1, obj.examList.length) | ||
126 | - this.xAxis = examList.map(item => { | ||
127 | - score.push(item.score) | ||
128 | - classRank.push(item.classRank) | ||
129 | - avgScore.push(item.avgScore) | ||
130 | - return item.title | ||
131 | - }) | 181 | + this.studentName = obj.studentName; |
182 | + this.chartDia = true; | ||
183 | + let score = []; | ||
184 | + let classRank = []; | ||
185 | + let avgScore = []; | ||
186 | + const examList = obj.examList.slice(1, obj.examList.length); | ||
187 | + this.xAxis = examList.map((item) => { | ||
188 | + score.push(item.score); | ||
189 | + classRank.push(item.classRank); | ||
190 | + avgScore.push(item.avgScore); | ||
191 | + return item.title; | ||
192 | + }); | ||
132 | this.chartData = [ | 193 | this.chartData = [ |
133 | { | 194 | { |
134 | name: "班级排名", | 195 | name: "班级排名", |
135 | - value: classRank | 196 | + value: classRank, |
136 | }, | 197 | }, |
137 | { | 198 | { |
138 | name: "班平均分", | 199 | name: "班平均分", |
139 | - value: avgScore | 200 | + value: avgScore, |
140 | }, | 201 | }, |
141 | { | 202 | { |
142 | name: "个人成绩", | 203 | name: "个人成绩", |
143 | - value: score | 204 | + value: score, |
144 | }, | 205 | }, |
145 | - ] | ||
146 | - | 206 | + ]; |
147 | }, | 207 | }, |
148 | async phaseExamReport() { | 208 | async phaseExamReport() { |
149 | this.loading = true; | 209 | this.loading = true; |
@@ -154,7 +214,7 @@ export default { | @@ -154,7 +214,7 @@ export default { | ||
154 | const { data, status, info } = await phaseExamReport({ | 214 | const { data, status, info } = await phaseExamReport({ |
155 | classId: this.classId, | 215 | classId: this.classId, |
156 | examIds: this.ids, | 216 | examIds: this.ids, |
157 | - subjectName: this.subjectName | 217 | + subjectName: this.subjectName, |
158 | }); | 218 | }); |
159 | this.loading = false; | 219 | this.loading = false; |
160 | if (status === 0) { | 220 | if (status === 0) { |
@@ -188,7 +248,7 @@ export default { | @@ -188,7 +248,7 @@ export default { | ||
188 | }); | 248 | }); |
189 | this.answerList = dataList; | 249 | this.answerList = dataList; |
190 | 250 | ||
191 | - this.exportStudent = [...this.tableData] | 251 | + this.exportStudent = [...this.tableData]; |
192 | } else { | 252 | } else { |
193 | this.$message.error(info); | 253 | this.$message.error(info); |
194 | } | 254 | } |
@@ -203,22 +263,23 @@ export default { | @@ -203,22 +263,23 @@ export default { | ||
203 | async exportData(arr) { | 263 | async exportData(arr) { |
204 | if (this.exportLoading == true) return; | 264 | if (this.exportLoading == true) return; |
205 | this.exportLoading = true; | 265 | this.exportLoading = true; |
206 | - let studentIds = [...arr] | 266 | + let studentIds = arr; |
207 | let query = {}; | 267 | let query = {}; |
208 | - if(studentIds != null){ | 268 | + if (studentIds != null) { |
209 | if (studentIds.length > 0) { | 269 | if (studentIds.length > 0) { |
210 | - query.studentIds = studentIds | 270 | + query.studentIds = studentIds; |
211 | } else { | 271 | } else { |
212 | - query.studentIds = [] | 272 | + query.studentIds = []; |
213 | } | 273 | } |
214 | } | 274 | } |
215 | - const exportPhaseExamReport = this.role == "ROLE_PERSONAL" | ||
216 | - ? this.$request.pExportPhaseExamReport | ||
217 | - : this.$request.exportPhaseExamReport; | 275 | + const exportPhaseExamReport = |
276 | + this.role == "ROLE_PERSONAL" | ||
277 | + ? this.$request.pExportPhaseExamReport | ||
278 | + : this.$request.exportPhaseExamReport; | ||
218 | const data = await exportPhaseExamReport({ | 279 | const data = await exportPhaseExamReport({ |
219 | classId: this.classId, | 280 | classId: this.classId, |
220 | examIds: this.ids, | 281 | examIds: this.ids, |
221 | - ...query | 282 | + ...query, |
222 | }); | 283 | }); |
223 | this.exportLoading = false; | 284 | this.exportLoading = false; |
224 | if (data) { | 285 | if (data) { |
@@ -227,12 +288,12 @@ export default { | @@ -227,12 +288,12 @@ export default { | ||
227 | }); | 288 | }); |
228 | downloadFile("即时测-单科多卷报表.xlsx", blob); | 289 | downloadFile("即时测-单科多卷报表.xlsx", blob); |
229 | this.$message.success("下载成功"); | 290 | this.$message.success("下载成功"); |
230 | - this.cancel() | 291 | + this.cancel(); |
231 | } else { | 292 | } else { |
232 | this.$message.error("下载失败"); | 293 | this.$message.error("下载失败"); |
233 | } | 294 | } |
234 | }, | 295 | }, |
235 | - } | 296 | + }, |
236 | }; | 297 | }; |
237 | </script> | 298 | </script> |
238 | <style lang="scss" scoped> | 299 | <style lang="scss" scoped> |
@@ -247,8 +308,6 @@ export default { | @@ -247,8 +308,6 @@ export default { | ||
247 | justify-content: space-between; | 308 | justify-content: space-between; |
248 | } | 309 | } |
249 | 310 | ||
250 | - | ||
251 | - | ||
252 | .chart-dia { | 311 | .chart-dia { |
253 | .chart-box { | 312 | .chart-box { |
254 | width: 100%; | 313 | width: 100%; |
src/views/basic/test/components/scoreSet.vue
@@ -8,35 +8,109 @@ | @@ -8,35 +8,109 @@ | ||
8 | </div> | 8 | </div> |
9 | <div class="set-content"> | 9 | <div class="set-content"> |
10 | <div class="test-title"> | 10 | <div class="test-title"> |
11 | - <el-button class="import-btn" round @click="diaUp = true">从excel文件导入</el-button> | ||
12 | - <el-button class="save-btn" type="primary" round :loading="loadingSave" @click="_SubmitScore">保存</el-button> | 11 | + <el-button class="import-btn" round @click="diaUp = true" |
12 | + >从excel文件导入</el-button | ||
13 | + > | ||
14 | + <el-button | ||
15 | + class="save-btn" | ||
16 | + type="primary" | ||
17 | + round | ||
18 | + :loading="loadingSave" | ||
19 | + @click="_SubmitScore" | ||
20 | + >保存</el-button | ||
21 | + > | ||
13 | <p class="p1">{{ title }}</p> | 22 | <p class="p1">{{ title }}</p> |
14 | <p class="p2">卷面总分:{{ examScore }}分</p> | 23 | <p class="p2">卷面总分:{{ examScore }}分</p> |
15 | </div> | 24 | </div> |
16 | - <el-table :data="tableData" border style="width: 100%" :max-height="tableMaxHeight"> | ||
17 | - <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column> | ||
18 | - <el-table-column prop="studentName" label="学号" align="center" fixed></el-table-column> | ||
19 | - <el-table-column prop="score" label="总得分" align="center" fixed></el-table-column> | ||
20 | - <el-table-column prop="objectiveScore" label="客观题分" align="center"></el-table-column> | ||
21 | - <el-table-column prop="subjectiveScore" label="主观题分" align="center"></el-table-column> | 25 | + <el-table |
26 | + :data="tableData" | ||
27 | + border | ||
28 | + style="width: 100%" | ||
29 | + :max-height="tableMaxHeight" | ||
30 | + > | ||
31 | + <el-table-column | ||
32 | + prop="studentCode" | ||
33 | + label="学号" | ||
34 | + align="center" | ||
35 | + fixed | ||
36 | + ></el-table-column> | ||
37 | + <el-table-column | ||
38 | + prop="studentName" | ||
39 | + label="学号" | ||
40 | + align="center" | ||
41 | + fixed | ||
42 | + ></el-table-column> | ||
43 | + <el-table-column prop="score" label="总得分" align="center" fixed | ||
44 | + ><template slot-scope="scoped"> | ||
45 | + <el-input | ||
46 | + type="number" | ||
47 | + :min="0" | ||
48 | + v-model="scoped.row.all" | ||
49 | + ></el-input> </template | ||
50 | + ></el-table-column> | ||
51 | + <el-table-column prop="objectiveScore" label="客观题分" align="center" | ||
52 | + ><template slot-scope="scoped"> | ||
53 | + <el-input | ||
54 | + type="number" | ||
55 | + :min="0" | ||
56 | + v-model="scoped.row.object" | ||
57 | + ></el-input> </template | ||
58 | + ></el-table-column> | ||
59 | + <el-table-column prop="subjectiveScore" label="主观题分" align="center"> | ||
60 | + <template slot-scope="scoped"> | ||
61 | + <el-input | ||
62 | + type="number" | ||
63 | + :min="0" | ||
64 | + v-model="scoped.row.subject" | ||
65 | + ></el-input> | ||
66 | + </template> | ||
67 | + </el-table-column> | ||
22 | <!-- <el-table-column v-for="(item, index) in questionList" :key="index" :label="'第' + cNum[index] + '大题'" --> | 68 | <!-- <el-table-column v-for="(item, index) in questionList" :key="index" :label="'第' + cNum[index] + '大题'" --> |
23 | - <el-table-column v-for="(question, index) in questionList" :key="index" :label="'Q' + question.questionId" | ||
24 | - align="center"> | 69 | + <el-table-column |
70 | + v-for="(question, index) in questionList" | ||
71 | + :key="index" | ||
72 | + :label="'Q' + question.questionId" | ||
73 | + align="center" | ||
74 | + > | ||
25 | <template slot-scope="scoped"> | 75 | <template slot-scope="scoped"> |
26 | - <el-input type="number" :min="0" :max="question.questionScore" | ||
27 | - @input="setScore($event, question.questionScore, scoped.row.scoreMap, question.questionId)" | ||
28 | - v-model="scoped.row.scoreMap[question.questionId]"></el-input> | 76 | + <el-input |
77 | + type="number" | ||
78 | + :min="0" | ||
79 | + :max="question.questionScore" | ||
80 | + @input=" | ||
81 | + setScore( | ||
82 | + $event, | ||
83 | + question.questionScore, | ||
84 | + scoped.row.scoreMap, | ||
85 | + question.questionId | ||
86 | + ) | ||
87 | + " | ||
88 | + v-model="scoped.row.scoreMap[question.questionId]" | ||
89 | + ></el-input> | ||
29 | </template> | 90 | </template> |
30 | </el-table-column> | 91 | </el-table-column> |
31 | </el-table> | 92 | </el-table> |
32 | </div> | 93 | </div> |
33 | 94 | ||
34 | - <el-dialog :close-on-click-modal="false" :append-to-body="true" title="答卷录分" :visible.sync="diaUp" width="600px" | ||
35 | - top="120px"> | ||
36 | - <upload :url="url" :examId="id" @upSuccess="upSuccess" fileName="主观题分数" v-loading="loadingDown"> | 95 | + <el-dialog |
96 | + :close-on-click-modal="false" | ||
97 | + :append-to-body="true" | ||
98 | + title="答卷录分" | ||
99 | + :visible.sync="diaUp" | ||
100 | + width="600px" | ||
101 | + top="120px" | ||
102 | + > | ||
103 | + <upload | ||
104 | + :url="url" | ||
105 | + :examId="id" | ||
106 | + @upSuccess="upSuccess" | ||
107 | + fileName="主观题分数" | ||
108 | + v-loading="loadingDown" | ||
109 | + > | ||
37 | <template slot="down"> | 110 | <template slot="down"> |
38 | <p class="down-txt"> | 111 | <p class="down-txt"> |
39 | - 第一步:<el-link type="danger" @click="downExcel">下载模板</el-link>,并编辑完成学生分数。 | 112 | + 第一步:<el-link type="danger" @click="downExcel">下载模板</el-link |
113 | + >,并编辑完成学生分数。 | ||
40 | </p> | 114 | </p> |
41 | <p class="down-txt">第二步:上传完成编辑的模板文件并导入。</p> | 115 | <p class="down-txt">第二步:上传完成编辑的模板文件并导入。</p> |
42 | </template> | 116 | </template> |
@@ -56,9 +130,9 @@ export default { | @@ -56,9 +130,9 @@ export default { | ||
56 | role: String, | 130 | role: String, |
57 | examScore: { | 131 | examScore: { |
58 | type: Number, | 132 | type: Number, |
59 | - default: 0 | 133 | + default: 0, |
60 | }, | 134 | }, |
61 | - diaScoreSet: false | 135 | + diaScoreSet: false, |
62 | }, | 136 | }, |
63 | data() { | 137 | data() { |
64 | return { | 138 | return { |
@@ -70,93 +144,101 @@ export default { | @@ -70,93 +144,101 @@ export default { | ||
70 | tableData: [], | 144 | tableData: [], |
71 | questionList: [], | 145 | questionList: [], |
72 | cNum: cNum, | 146 | cNum: cNum, |
73 | - tableMaxHeight: 300 | ||
74 | - } | 147 | + tableMaxHeight: 300, |
148 | + }; | ||
75 | }, | 149 | }, |
76 | watch: { | 150 | watch: { |
77 | diaScoreSet: { | 151 | diaScoreSet: { |
78 | handler: function (nVal) { | 152 | handler: function (nVal) { |
79 | if (nVal) { | 153 | if (nVal) { |
80 | - this._QueryData() | 154 | + this._QueryData(); |
81 | } | 155 | } |
82 | }, | 156 | }, |
83 | - } | 157 | + }, |
84 | }, | 158 | }, |
85 | methods: { | 159 | methods: { |
86 | setScore(val, max, obj, keys) { | 160 | setScore(val, max, obj, keys) { |
87 | if (val > max) { | 161 | if (val > max) { |
88 | - obj[keys] = max | 162 | + obj[keys] = max; |
89 | } | 163 | } |
90 | }, | 164 | }, |
91 | closeScoreSet() { | 165 | closeScoreSet() { |
92 | - this.$emit('closeScoreSet') | 166 | + this.$emit("closeScoreSet"); |
93 | }, | 167 | }, |
94 | setTableHeight() { | 168 | setTableHeight() { |
95 | this.tableMaxHeight = this.$refs.scoreSet.offsetHeight - 135; | 169 | this.tableMaxHeight = this.$refs.scoreSet.offsetHeight - 135; |
96 | }, | 170 | }, |
97 | async _QueryData() { | 171 | async _QueryData() { |
98 | this.loading = true; | 172 | this.loading = true; |
99 | - const { data, status, info } = await this.$request.listStudentsAndQuestions({ | ||
100 | - examId: this.id | ||
101 | - }); | 173 | + const { data, status, info } = |
174 | + await this.$request.listStudentsAndQuestions({ | ||
175 | + examId: this.id, | ||
176 | + }); | ||
102 | this.loading = false; | 177 | this.loading = false; |
103 | if (status === 0) { | 178 | if (status === 0) { |
104 | - let studentList = data.students || [] | ||
105 | - this.questionList = data?.questionList || [] | ||
106 | - this.tableData = this.questionList.length && studentList.map(item => { | ||
107 | - item.score = 0//总分 | ||
108 | - item.subjectiveScore = 0//主观题分数 | ||
109 | - item.objectiveScore = 0//客观题分数 | ||
110 | - if (!item.scoreMap) item.scoreMap = {}; | ||
111 | - this.questionList.map(question => { | ||
112 | - let keys = question.questionId | ||
113 | - if (!item.scoreMap[keys]) { | ||
114 | - if (item.scoreMap[keys] == 0) { | ||
115 | - item.scoreMap[keys] = 0 | ||
116 | - } else { | ||
117 | - item.scoreMap[keys] = "" | ||
118 | - } | ||
119 | - } else { | ||
120 | - let num = Number(item.scoreMap[keys]) | ||
121 | - item.scoreMap[keys] = num | ||
122 | - item.score += num | ||
123 | - if (question.questionType == 5) { | ||
124 | - item.subjectiveScore += num | ||
125 | - } else { | ||
126 | - item.objectiveScore += num | ||
127 | - } | ||
128 | - } | ||
129 | - }) | ||
130 | - return item | ||
131 | - }) || [] | ||
132 | - this.setTableHeight() | 179 | + let studentList = data.students || []; |
180 | + this.questionList = data?.questionList || []; | ||
181 | + this.tableData = | ||
182 | + (this.questionList.length && | ||
183 | + studentList.map((item) => { | ||
184 | + item.all = item.all || 0; //总分 | ||
185 | + item.object = item.object || 0; //客观题分数 | ||
186 | + item.subject = item.subject || 0; //主观题分数 | ||
187 | + if (!item.scoreMap) item.scoreMap = {}; | ||
188 | + this.questionList.map((question) => { | ||
189 | + let keys = question.questionId; | ||
190 | + if (!item.scoreMap[keys]) { | ||
191 | + if (item.scoreMap[keys] == 0) { | ||
192 | + item.scoreMap[keys] = 0; | ||
193 | + } else { | ||
194 | + item.scoreMap[keys] = ""; | ||
195 | + } | ||
196 | + } else { | ||
197 | + let num = Number(item.scoreMap[keys]); | ||
198 | + item.scoreMap[keys] = num; | ||
199 | + // item.score += num | ||
200 | + // if (question.questionType == 5) { | ||
201 | + // item.subjectiveScore += num | ||
202 | + // } else { | ||
203 | + // item.objectiveScore += num | ||
204 | + // } | ||
205 | + } | ||
206 | + }); | ||
207 | + | ||
208 | + return item; | ||
209 | + })) || | ||
210 | + []; | ||
211 | + this.setTableHeight(); | ||
133 | } else { | 212 | } else { |
134 | this.$message.error(info); | 213 | this.$message.error(info); |
135 | } | 214 | } |
136 | }, | 215 | }, |
137 | async _SubmitScore() { | 216 | async _SubmitScore() { |
138 | this.loadingSave = true; | 217 | this.loadingSave = true; |
139 | - let list = this.tableData.map(item => { | ||
140 | - let scoreMap = {} | 218 | + let list = this.tableData.map((item) => { |
219 | + let scoreMap = {}; | ||
141 | for (let keys in item.scoreMap) { | 220 | for (let keys in item.scoreMap) { |
142 | if (item.scoreMap[keys] !== "") { | 221 | if (item.scoreMap[keys] !== "") { |
143 | - scoreMap[keys] = item.scoreMap[keys] + "" | 222 | + scoreMap[keys] = item.scoreMap[keys] + ""; |
144 | } | 223 | } |
145 | } | 224 | } |
225 | + scoreMap.all = item.all + ""; | ||
226 | + scoreMap.object = item.object + ""; | ||
227 | + scoreMap.subject = item.subject + ""; | ||
146 | return { | 228 | return { |
147 | studentCode: item.studentCode, | 229 | studentCode: item.studentCode, |
148 | scores: scoreMap, | 230 | scores: scoreMap, |
149 | - } | ||
150 | - }) | ||
151 | - console.log(list) | 231 | + }; |
232 | + }); | ||
233 | + console.log(list); | ||
152 | const { data, status, info } = await this.$request.submitScore({ | 234 | const { data, status, info } = await this.$request.submitScore({ |
153 | examId: this.id, | 235 | examId: this.id, |
154 | - list | 236 | + list, |
155 | }); | 237 | }); |
156 | this.loadingSave = false; | 238 | this.loadingSave = false; |
157 | if (status === 0) { | 239 | if (status === 0) { |
158 | - this.$message.success(info) | ||
159 | - this.closeScoreSet() | 240 | + this.$message.success(info); |
241 | + this.closeScoreSet(); | ||
160 | } else { | 242 | } else { |
161 | this.$message.error(info); | 243 | this.$message.error(info); |
162 | } | 244 | } |
@@ -166,7 +248,7 @@ export default { | @@ -166,7 +248,7 @@ export default { | ||
166 | upSuccess(res) { | 248 | upSuccess(res) { |
167 | this.$message.success("导入成功"); | 249 | this.$message.success("导入成功"); |
168 | this.diaUp = false; | 250 | this.diaUp = false; |
169 | - this.closeScoreSet() | 251 | + this.closeScoreSet(); |
170 | }, | 252 | }, |
171 | async downExcel() { | 253 | async downExcel() { |
172 | //模板下载 | 254 | //模板下载 |
@@ -184,8 +266,8 @@ export default { | @@ -184,8 +266,8 @@ export default { | ||
184 | this.$message.error(data.info); | 266 | this.$message.error(data.info); |
185 | } | 267 | } |
186 | }, | 268 | }, |
187 | - } | ||
188 | -} | 269 | + }, |
270 | +}; | ||
189 | </script> | 271 | </script> |
190 | 272 | ||
191 | <style lang="scss" scoped> | 273 | <style lang="scss" scoped> |
src/views/basic/test/index.vue
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <div class="select-box"> | 8 | <div class="select-box"> |
9 | <div class="sel-item sel-item2"> | 9 | <div class="sel-item sel-item2"> |
10 | <span class="sel-label">班级:</span> | 10 | <span class="sel-label">班级:</span> |
11 | - <div class="sel-d" v-if="role == 'ROLE_JIAOSHI'"> | 11 | + <div class="sel-d"> |
12 | <p class="p-all"> | 12 | <p class="p-all"> |
13 | <el-checkbox | 13 | <el-checkbox |
14 | :indeterminate="isIndeterminateClass" | 14 | :indeterminate="isIndeterminateClass" |
@@ -28,21 +28,6 @@ | @@ -28,21 +28,6 @@ | ||
28 | </el-checkbox-group> | 28 | </el-checkbox-group> |
29 | </p> | 29 | </p> |
30 | </div> | 30 | </div> |
31 | - <el-select | ||
32 | - v-if="role == 'ROLE_BANZHUREN'" | ||
33 | - class="sel" | ||
34 | - v-model="query.classId" | ||
35 | - placeholder="选择班级" | ||
36 | - @change="changeclass" | ||
37 | - > | ||
38 | - <el-option | ||
39 | - v-for="item in classList" | ||
40 | - :key="item.value" | ||
41 | - :label="item.label" | ||
42 | - :value="item.value" | ||
43 | - > | ||
44 | - </el-option> | ||
45 | - </el-select> | ||
46 | </div> | 31 | </div> |
47 | <div class="sel-item sel-item2"> | 32 | <div class="sel-item sel-item2"> |
48 | <span class="sel-label">科目:</span> | 33 | <span class="sel-label">科目:</span> |
@@ -257,15 +242,15 @@ export default { | @@ -257,15 +242,15 @@ export default { | ||
257 | label: item.className, | 242 | label: item.className, |
258 | }; | 243 | }; |
259 | }); | 244 | }); |
260 | - if (this.role == "ROLE_BANZHUREN") { | ||
261 | - this.query.classId = this.classList.length | ||
262 | - ? this.classList[0].value | ||
263 | - : ""; | ||
264 | - } else { | ||
265 | - this.classList.length | ||
266 | - ? this.query.classId.push(this.classList[0].value) | ||
267 | - : ""; | ||
268 | - } | 245 | + // if (this.role == "ROLE_BANZHUREN") { |
246 | + // this.query.classId = this.classList.length | ||
247 | + // ? this.classList[0].value | ||
248 | + // : ""; | ||
249 | + // } else { | ||
250 | + this.classList.length | ||
251 | + ? this.query.classId.push(this.classList[0].value) | ||
252 | + : ""; | ||
253 | + // } | ||
269 | } else { | 254 | } else { |
270 | this.$message.error(info); | 255 | this.$message.error(info); |
271 | } | 256 | } |
@@ -309,9 +294,6 @@ export default { | @@ -309,9 +294,6 @@ export default { | ||
309 | return; | 294 | return; |
310 | } | 295 | } |
311 | let query = { ...this.query }; | 296 | let query = { ...this.query }; |
312 | - if (this.role == "ROLE_BANZHUREN") { | ||
313 | - query.classId = [query.classId]; | ||
314 | - } | ||
315 | this.$router.push({ | 297 | this.$router.push({ |
316 | path: "/testList", | 298 | path: "/testList", |
317 | query: { | 299 | query: { |
src/views/basic/test/list.vue
@@ -312,22 +312,27 @@ export default { | @@ -312,22 +312,27 @@ export default { | ||
312 | return; | 312 | return; |
313 | } | 313 | } |
314 | let subjectArr = []; | 314 | let subjectArr = []; |
315 | - const ids = this.multipleSelection.map((item) => { | ||
316 | - subjectArr.push(item.subjectName); | ||
317 | - return item.id; | 315 | + let classIds = ""; |
316 | + let multipleData = []; | ||
317 | + this.tableData.map((item) => { | ||
318 | + if (this.multipleSelection.includes(item.id)) { | ||
319 | + subjectArr.push(item.subjectName); | ||
320 | + multipleData.push(item); | ||
321 | + classIds = item.classId; | ||
322 | + } | ||
318 | }); | 323 | }); |
319 | subjectArr = [...new Set(subjectArr)]; | 324 | subjectArr = [...new Set(subjectArr)]; |
320 | console.log(subjectArr); | 325 | console.log(subjectArr); |
321 | - if (ids.length == 1) { | 326 | + if (this.multipleSelection.length == 1) { |
322 | this.$router.push({ | 327 | this.$router.push({ |
323 | path: "/testAnalysis", | 328 | path: "/testAnalysis", |
324 | query: { | 329 | query: { |
325 | - id: ids[0], | ||
326 | - title: this.multipleSelection[0].title, | ||
327 | - score: this.multipleSelection[0].examPaperScore || 0, | 330 | + id: this.multipleSelection[0], |
331 | + title: this.multipleData[0].title, | ||
332 | + score: this.multipleData[0].examPaperScore || 0, | ||
328 | type: 1, | 333 | type: 1, |
329 | subjectName: subjectArr.join(), | 334 | subjectName: subjectArr.join(), |
330 | - classId: this.query.classId[0], | 335 | + classId: classIds, |
331 | params: this.$route.query.params, | 336 | params: this.$route.query.params, |
332 | }, | 337 | }, |
333 | }); | 338 | }); |
@@ -336,8 +341,8 @@ export default { | @@ -336,8 +341,8 @@ export default { | ||
336 | this.$router.push({ | 341 | this.$router.push({ |
337 | path: "/testAnalysis", | 342 | path: "/testAnalysis", |
338 | query: { | 343 | query: { |
339 | - ids: ids.join(), | ||
340 | - classId: this.query.classId[0], | 344 | + ids: this.multipleSelection.join(), |
345 | + classId: classIds, | ||
341 | type: subjectArr.length == 1 ? 2 : 3, | 346 | type: subjectArr.length == 1 ? 2 : 3, |
342 | subjectName: subjectArr.join(), | 347 | subjectName: subjectArr.join(), |
343 | params: this.$route.query.params, | 348 | params: this.$route.query.params, |
@@ -472,7 +477,7 @@ export default { | @@ -472,7 +477,7 @@ export default { | ||
472 | //多班级 | 477 | //多班级 |
473 | let tableObj = {}; | 478 | let tableObj = {}; |
474 | data?.list?.map((item) => { | 479 | data?.list?.map((item) => { |
475 | - if (tableObj[item.examPaperId]) { | 480 | + if (tableObj[item.examPaperId] && item.examPaperId != 0) { |
476 | // 没有班级考试的添加 | 481 | // 没有班级考试的添加 |
477 | if ( | 482 | if ( |
478 | !tableObj[item.examPaperId].classIds.includes(item.classId) | 483 | !tableObj[item.examPaperId].classIds.includes(item.classId) |
src/views/examinationPaper/add.vue
@@ -7,45 +7,111 @@ | @@ -7,45 +7,111 @@ | ||
7 | </template> | 7 | </template> |
8 | </back-box> | 8 | </back-box> |
9 | <div class="content"> | 9 | <div class="content"> |
10 | - <el-steps :active="step" finish-status="success" simple style="margin: 20px 0"> | 10 | + <el-steps |
11 | + :active="step" | ||
12 | + finish-status="success" | ||
13 | + simple | ||
14 | + style="margin: 20px 0" | ||
15 | + > | ||
11 | <el-step title="基础信息" icon="el-icon-edit"></el-step> | 16 | <el-step title="基础信息" icon="el-icon-edit"></el-step> |
12 | - <el-step v-if="!isUpload" title="题目编辑" icon="el-icon-tickets"></el-step> | 17 | + <el-step |
18 | + v-if="!isUpload" | ||
19 | + title="题目编辑" | ||
20 | + icon="el-icon-tickets" | ||
21 | + ></el-step> | ||
13 | <el-step title="设置答案" icon="el-icon-edit-outline"></el-step> | 22 | <el-step title="设置答案" icon="el-icon-edit-outline"></el-step> |
14 | - <el-step v-if="isUpload" title="试卷预览" icon="el-icon-edit-outline"></el-step> | 23 | + <el-step |
24 | + v-if="isUpload" | ||
25 | + title="试卷预览" | ||
26 | + icon="el-icon-edit-outline" | ||
27 | + ></el-step> | ||
15 | </el-steps> | 28 | </el-steps> |
16 | <div v-show="step == 0"> | 29 | <div v-show="step == 0"> |
17 | - <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> | 30 | + <el-form |
31 | + ref="forms" | ||
32 | + :model="form" | ||
33 | + :rules="formRules" | ||
34 | + label-width="140px" | ||
35 | + > | ||
18 | <el-form-item label="答题卡名称:" prop="title"> | 36 | <el-form-item label="答题卡名称:" prop="title"> |
19 | - <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45" | ||
20 | - show-word-limit> | 37 | + <el-input |
38 | + class="sel2" | ||
39 | + type="text" | ||
40 | + placeholder="请输入答题卡名称" | ||
41 | + v-model.trim="form.title" | ||
42 | + maxlength="50" | ||
43 | + size="45" | ||
44 | + show-word-limit | ||
45 | + > | ||
21 | </el-input> | 46 | </el-input> |
22 | </el-form-item> | 47 | </el-form-item> |
23 | <el-form-item label="测验类型:"> | 48 | <el-form-item label="测验类型:"> |
24 | <el-select v-model="form.tagId" placeholder="选择测验类型"> | 49 | <el-select v-model="form.tagId" placeholder="选择测验类型"> |
25 | <el-option label="--" value=""> </el-option> | 50 | <el-option label="--" value=""> </el-option> |
26 | - <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{ | ||
27 | - item.typeName }}</el-option> | 51 | + <el-option |
52 | + v-for="item in answerTypeList" | ||
53 | + :key="item.id" | ||
54 | + :label="item.typeName" | ||
55 | + :value="item.id" | ||
56 | + >{{ item.typeName }}</el-option | ||
57 | + > | ||
28 | </el-select> | 58 | </el-select> |
29 | - <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button> | 59 | + <el-button |
60 | + class="ml-20" | ||
61 | + type="primary" | ||
62 | + round | ||
63 | + circle | ||
64 | + icon="el-icon-edit" | ||
65 | + @click="openTagDia" | ||
66 | + ></el-button> | ||
30 | </el-form-item> | 67 | </el-form-item> |
31 | - <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName"> | ||
32 | - <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade"> | ||
33 | - <el-option v-for="item in gradeList" :key="item" :label="item" :value="item"> | 68 | + <el-form-item |
69 | + v-if="role != 'ROLE_PERSONAL'" | ||
70 | + label="年级:" | ||
71 | + prop="gradeName" | ||
72 | + > | ||
73 | + <el-select | ||
74 | + class="sel" | ||
75 | + v-model="form.gradeName" | ||
76 | + placeholder="" | ||
77 | + @change="changeGrade" | ||
78 | + > | ||
79 | + <el-option | ||
80 | + v-for="item in gradeList" | ||
81 | + :key="item" | ||
82 | + :label="item" | ||
83 | + :value="item" | ||
84 | + > | ||
34 | </el-option> | 85 | </el-option> |
35 | </el-select> | 86 | </el-select> |
36 | </el-form-item> | 87 | </el-form-item> |
37 | <el-form-item label="科目:" prop="subjectName"> | 88 | <el-form-item label="科目:" prop="subjectName"> |
38 | <el-select class="sel" v-model="form.subjectName" placeholder=""> | 89 | <el-select class="sel" v-model="form.subjectName" placeholder=""> |
39 | - <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{ | ||
40 | - item.label }} | 90 | + <el-option |
91 | + v-for="item in subjectList" | ||
92 | + :key="item.value" | ||
93 | + :label="item.label" | ||
94 | + :value="item.value" | ||
95 | + >{{ item.label }} | ||
41 | </el-option> | 96 | </el-option> |
42 | </el-select> | 97 | </el-select> |
43 | </el-form-item> | 98 | </el-form-item> |
44 | <el-form-item label="考试时长:"> | 99 | <el-form-item label="考试时长:"> |
45 | - <el-input-number size="medium" :min="1" :max="140" :step-strictly="true" :step="1" | ||
46 | - v-model="form.examsDuration" label="考试时长"></el-input-number> | 100 | + <el-input-number |
101 | + size="medium" | ||
102 | + :min="1" | ||
103 | + :max="140" | ||
104 | + :step-strictly="true" | ||
105 | + :step="1" | ||
106 | + v-model="form.examsDuration" | ||
107 | + label="考试时长" | ||
108 | + ></el-input-number> | ||
47 | </el-form-item> | 109 | </el-form-item> |
48 | - <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType"> | 110 | + <el-form-item |
111 | + v-if="role != 'ROLE_PERSONAL'" | ||
112 | + label="分享范围:" | ||
113 | + prop="sharingType" | ||
114 | + > | ||
49 | <el-radio-group v-model="form.sharingType"> | 115 | <el-radio-group v-model="form.sharingType"> |
50 | <el-radio :label="0">任课班级分享</el-radio> | 116 | <el-radio :label="0">任课班级分享</el-radio> |
51 | <el-radio :label="1">全年级分享</el-radio> | 117 | <el-radio :label="1">全年级分享</el-radio> |
@@ -53,24 +119,58 @@ | @@ -53,24 +119,58 @@ | ||
53 | </el-form-item> | 119 | </el-form-item> |
54 | </el-form> | 120 | </el-form> |
55 | <div class="btn-box"> | 121 | <div class="btn-box"> |
56 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | ||
57 | - <el-button type="primary" round @click="isUpload ? setStep2() : setStep1()">下一步</el-button> | 122 | + <el-button type="danger" plain round @click="linkBack" |
123 | + >取消</el-button | ||
124 | + > | ||
125 | + <el-button | ||
126 | + type="primary" | ||
127 | + round | ||
128 | + @click="isUpload ? setStep2() : setStep1()" | ||
129 | + >下一步</el-button | ||
130 | + > | ||
58 | </div> | 131 | </div> |
59 | - <el-dialog :close-on-click-modal="false" title="设置测验类型" :visible.sync="dialogVisible" width="500px"> | 132 | + <el-dialog |
133 | + :close-on-click-modal="false" | ||
134 | + title="设置测验类型" | ||
135 | + :visible.sync="dialogVisible" | ||
136 | + width="500px" | ||
137 | + > | ||
60 | <div class="dia-content"> | 138 | <div class="dia-content"> |
61 | <p class="add-type" v-for="item in tagList" :key="item.id"> | 139 | <p class="add-type" v-for="item in tagList" :key="item.id"> |
62 | <el-row :gutter="10"> | 140 | <el-row :gutter="10"> |
63 | - <el-col :span="18"><el-input v-model="item.typeName" :maxlength="10" | ||
64 | - placeholder="请输入答题卡类型名称"></el-input></el-col> | 141 | + <el-col :span="18" |
142 | + ><el-input | ||
143 | + v-model="item.typeName" | ||
144 | + :maxlength="10" | ||
145 | + placeholder="请输入答题卡类型名称" | ||
146 | + ></el-input | ||
147 | + ></el-col> | ||
65 | <el-col :span="6"> | 148 | <el-col :span="6"> |
66 | <el-tooltip effect="dark" content="保存" placement="top"> | 149 | <el-tooltip effect="dark" content="保存" placement="top"> |
67 | - <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-check" | ||
68 | - @click="editTypeName(item)"></el-button> | 150 | + <el-button |
151 | + class="js-set" | ||
152 | + type="primary" | ||
153 | + size="small" | ||
154 | + round | ||
155 | + circle | ||
156 | + icon="el-icon-check" | ||
157 | + @click="editTypeName(item)" | ||
158 | + ></el-button> | ||
69 | </el-tooltip> | 159 | </el-tooltip> |
70 | <el-tooltip effect="dark" content="删除" placement="right"> | 160 | <el-tooltip effect="dark" content="删除" placement="right"> |
71 | - <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)"> | ||
72 | - <el-button class="js-set" type="danger" size="small" round circle icon="el-icon-delete" | ||
73 | - slot="reference"></el-button> | 161 | + <el-popconfirm |
162 | + title="确定删除这道大题吗?" | ||
163 | + @confirm="removeTypeName(item)" | ||
164 | + > | ||
165 | + <el-button | ||
166 | + class="js-set" | ||
167 | + type="danger" | ||
168 | + size="small" | ||
169 | + round | ||
170 | + circle | ||
171 | + icon="el-icon-delete" | ||
172 | + slot="reference" | ||
173 | + ></el-button> | ||
74 | </el-popconfirm> | 174 | </el-popconfirm> |
75 | </el-tooltip> | 175 | </el-tooltip> |
76 | </el-col> | 176 | </el-col> |
@@ -79,13 +179,25 @@ | @@ -79,13 +179,25 @@ | ||
79 | <p class="add-type"> | 179 | <p class="add-type"> |
80 | <el-row :gutter="10"> | 180 | <el-row :gutter="10"> |
81 | <el-col :span="18"> | 181 | <el-col :span="18"> |
82 | - <el-input type="text" placeholder="请输入答题卡类型名称" v-model.trim="answerTypeName" :maxlength="10"> | 182 | + <el-input |
183 | + type="text" | ||
184 | + placeholder="请输入答题卡类型名称" | ||
185 | + v-model.trim="answerTypeName" | ||
186 | + :maxlength="10" | ||
187 | + > | ||
83 | </el-input> | 188 | </el-input> |
84 | </el-col> | 189 | </el-col> |
85 | <el-col :span="6"> | 190 | <el-col :span="6"> |
86 | <el-tooltip effect="dark" content="添加" placement="right"> | 191 | <el-tooltip effect="dark" content="添加" placement="right"> |
87 | - <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-plus" | ||
88 | - @click="addPaperType"></el-button> | 192 | + <el-button |
193 | + class="js-set" | ||
194 | + type="primary" | ||
195 | + size="small" | ||
196 | + round | ||
197 | + circle | ||
198 | + icon="el-icon-plus" | ||
199 | + @click="addPaperType" | ||
200 | + ></el-button> | ||
89 | </el-tooltip> | 201 | </el-tooltip> |
90 | </el-col> | 202 | </el-col> |
91 | </el-row> | 203 | </el-row> |
@@ -98,17 +210,42 @@ | @@ -98,17 +210,42 @@ | ||
98 | </div> | 210 | </div> |
99 | <template v-if="!isUpload"> | 211 | <template v-if="!isUpload"> |
100 | <div v-show="step == 1"> | 212 | <div v-show="step == 1"> |
101 | - <div class="question-box" v-for="(question, index) in form.questionList" :key="index"> | 213 | + <div |
214 | + class="question-box" | ||
215 | + v-for="(question, index) in form.questionList" | ||
216 | + :key="index" | ||
217 | + > | ||
102 | <p class="question-title"> | 218 | <p class="question-title"> |
103 | - <el-tooltip effect="dark" :content="question.show ? '收起' : '展开'" placement="left"> | ||
104 | - <i class="el-icon-caret-right" :class="question.show ? 'active' : ''" | ||
105 | - @click="question.show = !question.show"></i> | 219 | + <el-tooltip |
220 | + effect="dark" | ||
221 | + :content="question.show ? '收起' : '展开'" | ||
222 | + placement="left" | ||
223 | + > | ||
224 | + <i | ||
225 | + class="el-icon-caret-right" | ||
226 | + :class="question.show ? 'active' : ''" | ||
227 | + @click="question.show = !question.show" | ||
228 | + ></i> | ||
106 | </el-tooltip> | 229 | </el-tooltip> |
107 | <span>{{ setBigNum(index) }}、</span> | 230 | <span>{{ setBigNum(index) }}、</span> |
108 | - <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30" placeholder="填写大题名称"></el-input> | ||
109 | - <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)"> | ||
110 | - <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
111 | - icon="el-icon-delete"></el-button> | 231 | + <el-input |
232 | + class="ipt" | ||
233 | + v-model.trim="question.questionTitle" | ||
234 | + maxlength="30" | ||
235 | + placeholder="填写大题名称" | ||
236 | + ></el-input> | ||
237 | + <el-popconfirm | ||
238 | + title="确定删除这道大题吗?" | ||
239 | + @confirm="form.questionList.splice(index, 1)" | ||
240 | + > | ||
241 | + <el-button | ||
242 | + slot="reference" | ||
243 | + class="delete" | ||
244 | + type="danger" | ||
245 | + size="mini" | ||
246 | + circle | ||
247 | + icon="el-icon-delete" | ||
248 | + ></el-button> | ||
112 | </el-popconfirm> | 249 | </el-popconfirm> |
113 | <span class="m20">共:{{ question.subQuestions?.length }}题</span> | 250 | <span class="m20">共:{{ question.subQuestions?.length }}题</span> |
114 | <span>共:{{ setScore(question) }}分</span> | 251 | <span>共:{{ setScore(question) }}分</span> |
@@ -123,11 +260,18 @@ | @@ -123,11 +260,18 @@ | ||
123 | <div class="qs-options">选项设置</div> | 260 | <div class="qs-options">选项设置</div> |
124 | <div class="qs-set">操作</div> | 261 | <div class="qs-set">操作</div> |
125 | </li> | 262 | </li> |
126 | - <li class="sub-questions" v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> | 263 | + <li |
264 | + class="sub-questions" | ||
265 | + v-for="(subQuestions, indexs) in question.subQuestions" | ||
266 | + :key="indexs" | ||
267 | + > | ||
127 | <div class="qs-num">{{ setNum(index, indexs) }}</div> | 268 | <div class="qs-num">{{ setNum(index, indexs) }}</div> |
128 | <div class="qs-type"> | 269 | <div class="qs-type"> |
129 | - <el-select v-model="subQuestions.questionType" placeholder="选择题目类型" | ||
130 | - @change="changeSubQuestions($event, subQuestions)"> | 270 | + <el-select |
271 | + v-model="subQuestions.questionType" | ||
272 | + placeholder="选择题目类型" | ||
273 | + @change="changeSubQuestions($event, subQuestions)" | ||
274 | + > | ||
131 | <el-option label="单选题" :value="2"></el-option> | 275 | <el-option label="单选题" :value="2"></el-option> |
132 | <el-option label="多选题" :value="3"></el-option> | 276 | <el-option label="多选题" :value="3"></el-option> |
133 | <el-option label="判断题" :value="4"></el-option> | 277 | <el-option label="判断题" :value="4"></el-option> |
@@ -135,54 +279,121 @@ | @@ -135,54 +279,121 @@ | ||
135 | </el-select> | 279 | </el-select> |
136 | </div> | 280 | </div> |
137 | <div class="qs-score"> | 281 | <div class="qs-score"> |
138 | - <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1" | ||
139 | - v-model="subQuestions.score" label="单题分值"></el-input-number> | 282 | + <el-input-number |
283 | + class="number-ipt" | ||
284 | + size="medium" | ||
285 | + :min="1" | ||
286 | + :max="200" | ||
287 | + :precision="2" | ||
288 | + :step="1" | ||
289 | + v-model="subQuestions.score" | ||
290 | + label="单题分值" | ||
291 | + ></el-input-number> | ||
140 | </div> | 292 | </div> |
141 | <div class="qs-partScore"> | 293 | <div class="qs-partScore"> |
142 | <p v-if="subQuestions.questionType != 3">--</p> | 294 | <p v-if="subQuestions.questionType != 3">--</p> |
143 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | ||
144 | - :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" | ||
145 | - label="漏选得分"></el-input-number> | 295 | + <el-input-number |
296 | + class="number-ipt" | ||
297 | + v-else | ||
298 | + size="medium" | ||
299 | + :min="0" | ||
300 | + :precision="2" | ||
301 | + :max="subQuestions.score" | ||
302 | + :step="0.5" | ||
303 | + v-model="subQuestions.partScore" | ||
304 | + label="漏选得分" | ||
305 | + ></el-input-number> | ||
146 | </div> | 306 | </div> |
147 | <div class="qs-options"> | 307 | <div class="qs-options"> |
148 | <p v-if="subQuestions.questionType == 5">--</p> | 308 | <p v-if="subQuestions.questionType == 5">--</p> |
149 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 309 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
150 | - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
151 | - @click="subQuestions.correctAnswer = 1">✓</span> | ||
152 | - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
153 | - @click="subQuestions.correctAnswer = 2">✗</span> | 310 | + <span |
311 | + class="answer-s" | ||
312 | + :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
313 | + @click="subQuestions.correctAnswer = 1" | ||
314 | + >✓</span | ||
315 | + > | ||
316 | + <span | ||
317 | + class="answer-s" | ||
318 | + :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
319 | + @click="subQuestions.correctAnswer = 2" | ||
320 | + >✗</span | ||
321 | + > | ||
154 | </p> | 322 | </p> |
155 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 323 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
156 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) | ||
157 | - ? 'active' | ||
158 | - : '' | ||
159 | - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | 324 | + <span |
325 | + class="answer-s" | ||
326 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
327 | + :class=" | ||
328 | + subQuestions.correctAnswer?.includes(option) | ||
329 | + ? 'active' | ||
330 | + : '' | ||
331 | + " | ||
332 | + :key="option" | ||
333 | + @click="changAnswer(subQuestions, option)" | ||
334 | + >{{ option }}</span | ||
335 | + > | ||
160 | </p> | 336 | </p> |
161 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 337 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
162 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
163 | - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | 338 | + <span |
339 | + class="answer-s" | ||
340 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
341 | + :class=" | ||
342 | + subQuestions.correctAnswer == option ? 'active' : '' | ||
343 | + " | ||
344 | + :key="option" | ||
345 | + @click="subQuestions.correctAnswer = option" | ||
346 | + >{{ option }}</span | ||
347 | + > | ||
164 | </p> | 348 | </p> |
165 | - <p v-if="subQuestions.questionType == 3 || | ||
166 | - subQuestions.questionType == 2 | ||
167 | - " class="answer-box answer-box2"> | ||
168 | - <el-button size="mini" type="primary" icon="el-icon-plus" circle | ||
169 | - @click="addOptions(subQuestions)"></el-button> | ||
170 | - <el-button size="mini" type="primary" icon="el-icon-minus" round circle | ||
171 | - @click="removeOptions(subQuestions)"></el-button> | 349 | + <p |
350 | + v-if=" | ||
351 | + subQuestions.questionType == 3 || | ||
352 | + subQuestions.questionType == 2 | ||
353 | + " | ||
354 | + class="answer-box answer-box2" | ||
355 | + > | ||
356 | + <el-button | ||
357 | + size="mini" | ||
358 | + type="primary" | ||
359 | + icon="el-icon-plus" | ||
360 | + circle | ||
361 | + @click="addOptions(subQuestions)" | ||
362 | + ></el-button> | ||
363 | + <el-button | ||
364 | + size="mini" | ||
365 | + type="primary" | ||
366 | + icon="el-icon-minus" | ||
367 | + round | ||
368 | + circle | ||
369 | + @click="removeOptions(subQuestions)" | ||
370 | + ></el-button> | ||
172 | </p> | 371 | </p> |
173 | </div> | 372 | </div> |
174 | <div class="qs-set"> | 373 | <div class="qs-set"> |
175 | - <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)"> | ||
176 | - <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
177 | - icon="el-icon-delete"></el-button> | 374 | + <el-popconfirm |
375 | + title="确定删除这道题吗?" | ||
376 | + @confirm="delTabData(indexs, index)" | ||
377 | + > | ||
378 | + <el-button | ||
379 | + slot="reference" | ||
380 | + class="delete" | ||
381 | + type="danger" | ||
382 | + size="mini" | ||
383 | + circle | ||
384 | + icon="el-icon-delete" | ||
385 | + ></el-button> | ||
178 | </el-popconfirm> | 386 | </el-popconfirm> |
179 | </div> | 387 | </div> |
180 | </li> | 388 | </li> |
181 | <li class="sub-questions"> | 389 | <li class="sub-questions"> |
182 | <div class="qs-num">添加</div> | 390 | <div class="qs-num">添加</div> |
183 | <div class="qs-type"> | 391 | <div class="qs-type"> |
184 | - <el-select v-model="addSubQuestionsType" placeholder="选择题目类型" | ||
185 | - @change="changeAddSubQuestions($event, question)"> | 392 | + <el-select |
393 | + v-model="addSubQuestionsType" | ||
394 | + placeholder="选择题目类型" | ||
395 | + @change="changeAddSubQuestions($event, question)" | ||
396 | + > | ||
186 | <el-option label="单选题" :value="2"></el-option> | 397 | <el-option label="单选题" :value="2"></el-option> |
187 | <el-option label="多选题" :value="3"></el-option> | 398 | <el-option label="多选题" :value="3"></el-option> |
188 | <el-option label="判断题" :value="4"></el-option> | 399 | <el-option label="判断题" :value="4"></el-option> |
@@ -199,102 +410,216 @@ | @@ -199,102 +410,216 @@ | ||
199 | </div> | 410 | </div> |
200 | <div class="add-box"> | 411 | <div class="add-box"> |
201 | <p class="add-question" @click="openQuestion"> | 412 | <p class="add-question" @click="openQuestion"> |
202 | - <el-button size="mini" type="primary" icon="el-icon-plus" circle></el-button> | 413 | + <el-button |
414 | + size="mini" | ||
415 | + type="primary" | ||
416 | + icon="el-icon-plus" | ||
417 | + circle | ||
418 | + ></el-button> | ||
203 | <span class="s1">添加大题</span> | 419 | <span class="s1">添加大题</span> |
204 | </p> | 420 | </p> |
205 | </div> | 421 | </div> |
206 | <div class="btn-box"> | 422 | <div class="btn-box"> |
207 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 423 | + <el-button type="danger" plain round @click="linkBack" |
424 | + >取消</el-button | ||
425 | + > | ||
208 | <el-button round @click="step = 0">上一步</el-button> | 426 | <el-button round @click="step = 0">上一步</el-button> |
209 | - <el-button :type="form.questionList.length == 0 ? 'info' : 'primary'" round @click="setStep2">下一步</el-button> | 427 | + <el-button |
428 | + :type="form.questionList.length == 0 ? 'info' : 'primary'" | ||
429 | + round | ||
430 | + @click="setStep2" | ||
431 | + >下一步</el-button | ||
432 | + > | ||
210 | </div> | 433 | </div> |
211 | - <el-dialog :close-on-click-modal="false" title="添加大题" :visible.sync="addQuestionVisible" width="600px"> | 434 | + <el-dialog |
435 | + :close-on-click-modal="false" | ||
436 | + title="添加大题" | ||
437 | + :visible.sync="addQuestionVisible" | ||
438 | + width="600px" | ||
439 | + > | ||
212 | <div class="dia-content"> | 440 | <div class="dia-content"> |
213 | - <el-form ref="form" :model="questionForm" :rules="questionFormRules" label-width="100px"> | 441 | + <el-form |
442 | + ref="form" | ||
443 | + :model="questionForm" | ||
444 | + :rules="questionFormRules" | ||
445 | + label-width="100px" | ||
446 | + > | ||
214 | <el-form-item label="标题:"> | 447 | <el-form-item label="标题:"> |
215 | <el-col :span="20"> | 448 | <el-col :span="20"> |
216 | - <el-input v-model.trim="questionForm.questionTitle" maxlength="30" placeholder="输入大题名称"></el-input> | 449 | + <el-input |
450 | + v-model.trim="questionForm.questionTitle" | ||
451 | + maxlength="30" | ||
452 | + placeholder="输入大题名称" | ||
453 | + ></el-input> | ||
217 | </el-col> | 454 | </el-col> |
218 | </el-form-item> | 455 | </el-form-item> |
219 | <el-form-item label="选择题型:"> | 456 | <el-form-item label="选择题型:"> |
220 | - <el-select v-model="questionForm.questionType" placeholder="" @change="setQuestionForm"> | ||
221 | - <el-option v-for="item in questionOptions" :key="item.value" :label="item.label" :value="item.value"> | 457 | + <el-select |
458 | + v-model="questionForm.questionType" | ||
459 | + placeholder="" | ||
460 | + @change="setQuestionForm" | ||
461 | + > | ||
462 | + <el-option | ||
463 | + v-for="item in questionOptions" | ||
464 | + :key="item.value" | ||
465 | + :label="item.label" | ||
466 | + :value="item.value" | ||
467 | + > | ||
222 | </el-option> | 468 | </el-option> |
223 | <el-option label="混合题" :value="6"> </el-option> | 469 | <el-option label="混合题" :value="6"> </el-option> |
224 | </el-select> | 470 | </el-select> |
225 | </el-form-item> | 471 | </el-form-item> |
226 | <el-form-item label="题数:"> | 472 | <el-form-item label="题数:"> |
227 | - <el-input-number v-model="questionForm.number" @change="changeQesNum" :min="1" :max="100" | ||
228 | - :step-strictly="true" :step="1" label="label"></el-input-number> | 473 | + <el-input-number |
474 | + v-model="questionForm.number" | ||
475 | + @change="changeQesNum" | ||
476 | + :min="1" | ||
477 | + :max="100" | ||
478 | + :step-strictly="true" | ||
479 | + :step="1" | ||
480 | + label="label" | ||
481 | + ></el-input-number> | ||
229 | </el-form-item> | 482 | </el-form-item> |
230 | - <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 && | ||
231 | - questionForm.questionType != 5 | ||
232 | - "> | ||
233 | - <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1" | ||
234 | - label="label"></el-input-number> | 483 | + <el-form-item |
484 | + label="选项个数:" | ||
485 | + v-show=" | ||
486 | + questionForm.questionType != 4 && | ||
487 | + questionForm.questionType != 5 | ||
488 | + " | ||
489 | + > | ||
490 | + <el-input-number | ||
491 | + v-model="questionForm.selectNum" | ||
492 | + :min="3" | ||
493 | + :max="10" | ||
494 | + :step-strictly="true" | ||
495 | + :step="1" | ||
496 | + label="label" | ||
497 | + ></el-input-number> | ||
235 | </el-form-item> | 498 | </el-form-item> |
236 | <el-form-item label="单题分数:"> | 499 | <el-form-item label="单题分数:"> |
237 | - <el-input-number v-model="questionForm.score" :min="1" :max="200" :precision="2" :step="1" | ||
238 | - label="label"></el-input-number> | 500 | + <el-input-number |
501 | + v-model="questionForm.score" | ||
502 | + :min="1" | ||
503 | + :max="200" | ||
504 | + :precision="2" | ||
505 | + :step="1" | ||
506 | + label="label" | ||
507 | + ></el-input-number> | ||
239 | </el-form-item> | 508 | </el-form-item> |
240 | - <el-form-item label="漏选得分:" v-if="questionForm.questionType == 3"> | ||
241 | - <el-input-number v-model="questionForm.partScore" :min="0" :max="questionForm.score" :precision="2" | ||
242 | - :step="0.5" label="label"></el-input-number> | 509 | + <el-form-item |
510 | + label="漏选得分:" | ||
511 | + v-if="questionForm.questionType == 3" | ||
512 | + > | ||
513 | + <el-input-number | ||
514 | + v-model="questionForm.partScore" | ||
515 | + :min="0" | ||
516 | + :max="questionForm.score" | ||
517 | + :precision="2" | ||
518 | + :step="0.5" | ||
519 | + label="label" | ||
520 | + ></el-input-number> | ||
243 | </el-form-item> | 521 | </el-form-item> |
244 | - <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 && | ||
245 | - questionForm.questionType != 6 | ||
246 | - "> | 522 | + <el-form-item |
523 | + label="设置答案:" | ||
524 | + v-show=" | ||
525 | + questionForm.questionType != 5 && | ||
526 | + questionForm.questionType != 6 | ||
527 | + " | ||
528 | + > | ||
247 | <div class="qs-options"> | 529 | <div class="qs-options"> |
248 | <p class="ipt"> | 530 | <p class="ipt"> |
249 | - <el-input v-if="questionForm.questionType == 2 || | ||
250 | - questionForm.questionType == 3 || | ||
251 | - questionForm.questionType == 6 | ||
252 | - " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native=" | ||
253 | - keydownAnswer($event, questionForm.questionType, 1) | ||
254 | - " @input=" | ||
255 | - setAllAnswer($event, questionForm.questionType, 1) | ||
256 | - "></el-input> | ||
257 | - <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList" | ||
258 | - readonly=""></el-input> | 531 | + <el-input |
532 | + v-if=" | ||
533 | + questionForm.questionType == 2 || | ||
534 | + questionForm.questionType == 3 || | ||
535 | + questionForm.questionType == 6 | ||
536 | + " | ||
537 | + ref="formAnsIpt2" | ||
538 | + v-model="questionForm.answerList" | ||
539 | + @keydown.native=" | ||
540 | + keydownAnswer($event, questionForm.questionType, 1) | ||
541 | + " | ||
542 | + @input=" | ||
543 | + setAllAnswer($event, questionForm.questionType, 1) | ||
544 | + " | ||
545 | + ></el-input> | ||
546 | + <el-input | ||
547 | + v-if="questionForm.questionType == 4" | ||
548 | + v-model="questionForm.answerList" | ||
549 | + readonly="" | ||
550 | + ></el-input> | ||
259 | </p> | 551 | </p> |
260 | <p class="answer-box"> | 552 | <p class="answer-box"> |
261 | <template v-if="questionForm.questionType == 4"> | 553 | <template v-if="questionForm.questionType == 4"> |
262 | - <span class="answer-s active" @click=" | ||
263 | - questionForm.answerList.length < questionForm.number | ||
264 | - ? (questionForm.answerList += '✓') | ||
265 | - : '' | ||
266 | - ">✓</span> | ||
267 | - <span class="answer-s active" @click=" | ||
268 | - questionForm.answerList.length < questionForm.number | ||
269 | - ? (questionForm.answerList += '✗') | ||
270 | - : '' | ||
271 | - ">✗</span> | 554 | + <span |
555 | + class="answer-s active" | ||
556 | + @click=" | ||
557 | + questionForm.answerList.length < questionForm.number | ||
558 | + ? (questionForm.answerList += '✓') | ||
559 | + : '' | ||
560 | + " | ||
561 | + >✓</span | ||
562 | + > | ||
563 | + <span | ||
564 | + class="answer-s active" | ||
565 | + @click=" | ||
566 | + questionForm.answerList.length < questionForm.number | ||
567 | + ? (questionForm.answerList += '✗') | ||
568 | + : '' | ||
569 | + " | ||
570 | + >✗</span | ||
571 | + > | ||
272 | </template> | 572 | </template> |
273 | <template v-if="questionForm.questionType == 3"> | 573 | <template v-if="questionForm.questionType == 3"> |
274 | <template v-for="(option, opIdx) in rightOptions"> | 574 | <template v-for="(option, opIdx) in rightOptions"> |
275 | - <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" | ||
276 | - @click="setMultiple(questionForm, option, 1)">{{ option }}</span> | 575 | + <span |
576 | + v-if="opIdx < questionForm.selectNum" | ||
577 | + class="answer-s active" | ||
578 | + :key="option" | ||
579 | + @click="setMultiple(questionForm, option, 1)" | ||
580 | + >{{ option }}</span | ||
581 | + > | ||
277 | </template> | 582 | </template> |
278 | - <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span> | 583 | + <span |
584 | + class="answer-s active" | ||
585 | + @click="setMultiple(questionForm, ',', 1)" | ||
586 | + >,</span | ||
587 | + > | ||
279 | </template> | 588 | </template> |
280 | - <template v-if="questionForm.questionType == 2 || | ||
281 | - questionForm.questionType == 6 | ||
282 | - "> | 589 | + <template |
590 | + v-if=" | ||
591 | + questionForm.questionType == 2 || | ||
592 | + questionForm.questionType == 6 | ||
593 | + " | ||
594 | + > | ||
283 | <template v-for="(option, opIdx) in rightOptions"> | 595 | <template v-for="(option, opIdx) in rightOptions"> |
284 | - <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click=" | ||
285 | - questionForm.answerList.length < questionForm.number | ||
286 | - ? (questionForm.answerList += option) | ||
287 | - : '' | ||
288 | - ">{{ option }}</span> | 596 | + <span |
597 | + v-if="opIdx < questionForm.selectNum" | ||
598 | + class="answer-s active" | ||
599 | + :key="option" | ||
600 | + @click=" | ||
601 | + questionForm.answerList.length < | ||
602 | + questionForm.number | ||
603 | + ? (questionForm.answerList += option) | ||
604 | + : '' | ||
605 | + " | ||
606 | + >{{ option }}</span | ||
607 | + > | ||
289 | </template> | 608 | </template> |
290 | </template> | 609 | </template> |
291 | - <span class="answer-s delButton" @click=" | ||
292 | - questionForm.answerList = questionForm.answerList.slice( | ||
293 | - 0, | ||
294 | - -1 | ||
295 | - ) | ||
296 | - ">x</span> | ||
297 | - <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span> | 610 | + <span |
611 | + class="answer-s delButton" | ||
612 | + @click=" | ||
613 | + questionForm.answerList = | ||
614 | + questionForm.answerList.slice(0, -1) | ||
615 | + " | ||
616 | + >x</span | ||
617 | + > | ||
618 | + <span | ||
619 | + class="answer-s ac" | ||
620 | + @click="questionForm.answerList = ''" | ||
621 | + >ac</span | ||
622 | + > | ||
298 | </p> | 623 | </p> |
299 | </div> | 624 | </div> |
300 | </el-form-item> | 625 | </el-form-item> |
@@ -312,15 +637,28 @@ | @@ -312,15 +637,28 @@ | ||
312 | <p class="name">{{ form.title }}</p> | 637 | <p class="name">{{ form.title }}</p> |
313 | <p class="totals">卷面总分:{{ allScore }}分</p> | 638 | <p class="totals">卷面总分:{{ allScore }}分</p> |
314 | </div> | 639 | </div> |
315 | - <div class="question-box" v-for="(question, index) in form.questionList" :key="index"> | 640 | + <div |
641 | + class="question-box" | ||
642 | + v-for="(question, index) in form.questionList" | ||
643 | + :key="index" | ||
644 | + > | ||
316 | <p class="question-title"> | 645 | <p class="question-title"> |
317 | <span>{{ setBigNum(index) }}、</span> | 646 | <span>{{ setBigNum(index) }}、</span> |
318 | <span class="title-txt">{{ question.questionTitle }}</span> | 647 | <span class="title-txt">{{ question.questionTitle }}</span> |
319 | <span class="m20">共:{{ setNums(question.subQuestions) }}题</span> | 648 | <span class="m20">共:{{ setNums(question.subQuestions) }}题</span> |
320 | <span>共:{{ setScore(question) }} 分</span> | 649 | <span>共:{{ setScore(question) }} 分</span> |
321 | - <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)"> | ||
322 | - <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
323 | - icon="el-icon-delete"></el-button> | 650 | + <el-popconfirm |
651 | + title="确定删除这道大题吗?" | ||
652 | + @confirm="form.questionList.splice(index, 1)" | ||
653 | + > | ||
654 | + <el-button | ||
655 | + slot="reference" | ||
656 | + class="delete" | ||
657 | + type="danger" | ||
658 | + size="mini" | ||
659 | + circle | ||
660 | + icon="el-icon-delete" | ||
661 | + ></el-button> | ||
324 | </el-popconfirm> | 662 | </el-popconfirm> |
325 | </p> | 663 | </p> |
326 | <ul class="questions-ul"> | 664 | <ul class="questions-ul"> |
@@ -335,12 +673,21 @@ | @@ -335,12 +673,21 @@ | ||
335 | <div class="qs-upload" v-if="isUpload">知识点</div> | 673 | <div class="qs-upload" v-if="isUpload">知识点</div> |
336 | <div class="qs-set">操作</div> | 674 | <div class="qs-set">操作</div> |
337 | </li> | 675 | </li> |
338 | - <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> | ||
339 | - <p class="set-ans-btn" v-if="subQuestions.qusType && | ||
340 | - subQuestions.subNum && | ||
341 | - subQuestions.subNum > 4 | ||
342 | - "> | ||
343 | - <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button> | 676 | + <li |
677 | + v-for="(subQuestions, indexs) in question.subQuestions" | ||
678 | + :key="indexs" | ||
679 | + > | ||
680 | + <p | ||
681 | + class="set-ans-btn" | ||
682 | + v-if=" | ||
683 | + subQuestions.qusType && | ||
684 | + subQuestions.subNum && | ||
685 | + subQuestions.subNum > 4 | ||
686 | + " | ||
687 | + > | ||
688 | + <el-button type="primary" @click="setFormAns(indexs, index)" | ||
689 | + >批量设置答案</el-button | ||
690 | + > | ||
344 | </p> | 691 | </p> |
345 | <div v-else class="sub-questions"> | 692 | <div v-else class="sub-questions"> |
346 | <div class="qs-num"> | 693 | <div class="qs-num"> |
@@ -348,10 +695,17 @@ | @@ -348,10 +695,17 @@ | ||
348 | </div> | 695 | </div> |
349 | <div class="qs-type"> | 696 | <div class="qs-type"> |
350 | <template v-if="isUpload"> | 697 | <template v-if="isUpload"> |
351 | - <el-select v-model="subQuestions.questionType" placeholder="选择题目类型" | ||
352 | - @change="changeSubQuestions($event, subQuestions)"> | ||
353 | - <el-option v-for="options in questionOptions" :key="options.value" :label="options.label" | ||
354 | - :value="options.value"></el-option> | 698 | + <el-select |
699 | + v-model="subQuestions.questionType" | ||
700 | + placeholder="选择题目类型" | ||
701 | + @change="changeSubQuestions($event, subQuestions)" | ||
702 | + > | ||
703 | + <el-option | ||
704 | + v-for="options in questionOptions" | ||
705 | + :key="options.value" | ||
706 | + :label="options.label" | ||
707 | + :value="options.value" | ||
708 | + ></el-option> | ||
355 | </el-select> | 709 | </el-select> |
356 | </template> | 710 | </template> |
357 | <template v-else> | 711 | <template v-else> |
@@ -359,125 +713,274 @@ | @@ -359,125 +713,274 @@ | ||
359 | </template> | 713 | </template> |
360 | </div> | 714 | </div> |
361 | <div class="qs-score"> | 715 | <div class="qs-score"> |
362 | - <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" | ||
363 | - v-model="subQuestions.score" label="单题分值"></el-input-number> | 716 | + <el-input-number |
717 | + class="number-ipt" | ||
718 | + size="medium" | ||
719 | + :min="1" | ||
720 | + :max="200" | ||
721 | + :precision="2" | ||
722 | + v-model="subQuestions.score" | ||
723 | + label="单题分值" | ||
724 | + ></el-input-number> | ||
364 | </div> | 725 | </div> |
365 | <div class="qs-partScore"> | 726 | <div class="qs-partScore"> |
366 | <p v-if="subQuestions.questionType != 3">--</p> | 727 | <p v-if="subQuestions.questionType != 3">--</p> |
367 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | ||
368 | - :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number> | 728 | + <el-input-number |
729 | + class="number-ipt" | ||
730 | + v-else | ||
731 | + size="medium" | ||
732 | + :min="0" | ||
733 | + :precision="2" | ||
734 | + :max="subQuestions.score" | ||
735 | + :step="0.5" | ||
736 | + v-model="subQuestions.partScore" | ||
737 | + label="漏选得分" | ||
738 | + ></el-input-number> | ||
369 | </div> | 739 | </div> |
370 | <div class="qs-options qs-options2"> | 740 | <div class="qs-options qs-options2"> |
371 | <p v-if="subQuestions.questionType == 5">--</p> | 741 | <p v-if="subQuestions.questionType == 5">--</p> |
372 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 742 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
373 | - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
374 | - @click="subQuestions.correctAnswer = 1">✓</span> | ||
375 | - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
376 | - @click="subQuestions.correctAnswer = 2">✗</span> | 743 | + <span |
744 | + class="answer-s" | ||
745 | + :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
746 | + @click="subQuestions.correctAnswer = 1" | ||
747 | + >✓</span | ||
748 | + > | ||
749 | + <span | ||
750 | + class="answer-s" | ||
751 | + :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
752 | + @click="subQuestions.correctAnswer = 2" | ||
753 | + >✗</span | ||
754 | + > | ||
377 | </p> | 755 | </p> |
378 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 756 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
379 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) | ||
380 | - ? 'active' | ||
381 | - : '' | ||
382 | - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | 757 | + <span |
758 | + class="answer-s" | ||
759 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
760 | + :class=" | ||
761 | + subQuestions.correctAnswer?.includes(option) | ||
762 | + ? 'active' | ||
763 | + : '' | ||
764 | + " | ||
765 | + :key="option" | ||
766 | + @click="changAnswer(subQuestions, option)" | ||
767 | + >{{ option }}</span | ||
768 | + > | ||
383 | </p> | 769 | </p> |
384 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 770 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
385 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
386 | - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | 771 | + <span |
772 | + class="answer-s" | ||
773 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
774 | + :class=" | ||
775 | + subQuestions.correctAnswer == option ? 'active' : '' | ||
776 | + " | ||
777 | + :key="option" | ||
778 | + @click="subQuestions.correctAnswer = option" | ||
779 | + >{{ option }}</span | ||
780 | + > | ||
387 | </p> | 781 | </p> |
388 | - <p v-if="subQuestions.questionType == 3 || | ||
389 | - subQuestions.questionType == 2 | ||
390 | - " class="answer-box answer-box2"> | ||
391 | - <el-button size="mini" type="primary" icon="el-icon-plus" circle | ||
392 | - @click="addOptions(subQuestions)"></el-button> | ||
393 | - <el-button size="mini" type="primary" icon="el-icon-minus" round circle | ||
394 | - @click="removeOptions(subQuestions)"></el-button> | 782 | + <p |
783 | + v-if=" | ||
784 | + subQuestions.questionType == 3 || | ||
785 | + subQuestions.questionType == 2 | ||
786 | + " | ||
787 | + class="answer-box answer-box2" | ||
788 | + > | ||
789 | + <el-button | ||
790 | + size="mini" | ||
791 | + type="primary" | ||
792 | + icon="el-icon-plus" | ||
793 | + circle | ||
794 | + @click="addOptions(subQuestions)" | ||
795 | + ></el-button> | ||
796 | + <el-button | ||
797 | + size="mini" | ||
798 | + type="primary" | ||
799 | + icon="el-icon-minus" | ||
800 | + round | ||
801 | + circle | ||
802 | + @click="removeOptions(subQuestions)" | ||
803 | + ></el-button> | ||
395 | </p> | 804 | </p> |
396 | </div> | 805 | </div> |
397 | <template v-if="isUpload"> | 806 | <template v-if="isUpload"> |
398 | <div class="qs-upload"> | 807 | <div class="qs-upload"> |
399 | <el-popover placement="right" width="600" trigger="click"> | 808 | <el-popover placement="right" width="600" trigger="click"> |
400 | <div class="screenshot-box"> | 809 | <div class="screenshot-box"> |
401 | - <iframe class="screenshot" v-if="subQuestions.screenshot" :src="subQuestions.screenshot"></iframe> | ||
402 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
403 | - @click="openStem(subQuestions, index, indexs, 1)">{{ subQuestions.screenshot ? "重新选择图片" | ||
404 | - : "上传题干" }}</el-button> | 810 | + <iframe |
811 | + class="screenshot" | ||
812 | + v-if="subQuestions.screenshot" | ||
813 | + :src="subQuestions.screenshot" | ||
814 | + ></iframe> | ||
815 | + <p style="textalign: center"> | ||
816 | + <el-button | ||
817 | + type="primary" | ||
818 | + round | ||
819 | + size="mini" | ||
820 | + icon="el-icon-upload" | ||
821 | + @click="openStem(subQuestions, index, indexs, 1)" | ||
822 | + >{{ | ||
823 | + subQuestions.screenshot | ||
824 | + ? "重新选择图片" | ||
825 | + : "上传题干" | ||
826 | + }}</el-button | ||
827 | + > | ||
405 | </p> | 828 | </p> |
406 | </div> | 829 | </div> |
407 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
408 | - icon="el-icon-tickets"></el-button> | 830 | + <el-button |
831 | + slot="reference" | ||
832 | + class="icon-tickets" | ||
833 | + type="primary" | ||
834 | + circle | ||
835 | + size="mini" | ||
836 | + icon="el-icon-tickets" | ||
837 | + ></el-button> | ||
409 | </el-popover> | 838 | </el-popover> |
410 | </div> | 839 | </div> |
411 | <div class="qs-upload"> | 840 | <div class="qs-upload"> |
412 | <el-popover placement="right" width="600" trigger="click"> | 841 | <el-popover placement="right" width="600" trigger="click"> |
413 | <div class="screenshot-box"> | 842 | <div class="screenshot-box"> |
414 | - <iframe class="screenshot" v-if="subQuestions.answerScreenshot" | ||
415 | - :src="subQuestions.answerScreenshot"></iframe> | ||
416 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
417 | - @click="openStem(subQuestions, index, indexs, 2)">{{ subQuestions.answerScreenshot ? "重新选择图片" | ||
418 | - : "上传题目解析" }}</el-button> | 843 | + <iframe |
844 | + class="screenshot" | ||
845 | + v-if="subQuestions.answerScreenshot" | ||
846 | + :src="subQuestions.answerScreenshot" | ||
847 | + ></iframe> | ||
848 | + <p style="textalign: center"> | ||
849 | + <el-button | ||
850 | + type="primary" | ||
851 | + round | ||
852 | + size="mini" | ||
853 | + icon="el-icon-upload" | ||
854 | + @click="openStem(subQuestions, index, indexs, 2)" | ||
855 | + >{{ | ||
856 | + subQuestions.answerScreenshot | ||
857 | + ? "重新选择图片" | ||
858 | + : "上传题目解析" | ||
859 | + }}</el-button | ||
860 | + > | ||
419 | </p> | 861 | </p> |
420 | </div> | 862 | </div> |
421 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
422 | - icon="el-icon-tickets"></el-button> | 863 | + <el-button |
864 | + slot="reference" | ||
865 | + class="icon-tickets" | ||
866 | + type="primary" | ||
867 | + circle | ||
868 | + size="mini" | ||
869 | + icon="el-icon-tickets" | ||
870 | + ></el-button> | ||
423 | </el-popover> | 871 | </el-popover> |
424 | </div> | 872 | </div> |
425 | <div class="qs-upload"> | 873 | <div class="qs-upload"> |
426 | - <el-button type="primary" circle size="mini" icon="el-icon-price-tag" | ||
427 | - @click="openKnowledge(subQuestions, index, indexs)"></el-button> | 874 | + <el-button |
875 | + type="primary" | ||
876 | + circle | ||
877 | + size="mini" | ||
878 | + icon="el-icon-price-tag" | ||
879 | + @click="openKnowledge(subQuestions, index, indexs)" | ||
880 | + ></el-button> | ||
428 | </div> | 881 | </div> |
429 | </template> | 882 | </template> |
430 | <div class="qs-set"> | 883 | <div class="qs-set"> |
431 | - | ||
432 | - <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)"> | ||
433 | - <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
434 | - icon="el-icon-delete"></el-button> | 884 | + <el-popconfirm |
885 | + title="确定删除这道题吗?" | ||
886 | + @confirm="delTabData(indexs, index)" | ||
887 | + > | ||
888 | + <el-button | ||
889 | + slot="reference" | ||
890 | + class="delete" | ||
891 | + type="danger" | ||
892 | + size="mini" | ||
893 | + circle | ||
894 | + icon="el-icon-delete" | ||
895 | + ></el-button> | ||
435 | </el-popconfirm> | 896 | </el-popconfirm> |
436 | </div> | 897 | </div> |
437 | </div> | 898 | </div> |
438 | </li> | 899 | </li> |
439 | </ul> | 900 | </ul> |
440 | </div> | 901 | </div> |
441 | - <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400" | ||
442 | - :modal-append-to-body="false"> | 902 | + <el-dialog |
903 | + :close-on-click-modal="false" | ||
904 | + title="批量设置答案" | ||
905 | + :visible.sync="diaSetAns" | ||
906 | + width="400" | ||
907 | + :modal-append-to-body="false" | ||
908 | + > | ||
443 | <div class="qs-options"> | 909 | <div class="qs-options"> |
444 | <p class="dia-tips"> | 910 | <p class="dia-tips"> |
445 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” | 911 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
446 | </p> | 912 | </p> |
447 | <p>{{ setSubPro(formAns.qusType) }}:</p> | 913 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
448 | <p class="ipt"> | 914 | <p class="ipt"> |
449 | - <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt" v-model="formAns.answerList" | 915 | + <el-input |
916 | + v-if="formAns.qusType == 2 || formAns.qusType == 3" | ||
917 | + ref="formAnsIpt" | ||
918 | + v-model="formAns.answerList" | ||
450 | @keydown.native="keydownAnswer($event, formAns.qusType)" | 919 | @keydown.native="keydownAnswer($event, formAns.qusType)" |
451 | - @input="setAllAnswer($event, formAns.qusType)"></el-input> | ||
452 | - <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input> | 920 | + @input="setAllAnswer($event, formAns.qusType)" |
921 | + ></el-input> | ||
922 | + <el-input | ||
923 | + v-if="formAns.qusType == 4" | ||
924 | + v-model="formAns.answerList" | ||
925 | + readonly="" | ||
926 | + ></el-input> | ||
453 | </p> | 927 | </p> |
454 | <p class="answer-box"> | 928 | <p class="answer-box"> |
455 | <template v-if="formAns.qusType == 4"> | 929 | <template v-if="formAns.qusType == 4"> |
456 | - <span class="answer-s active" @click=" | ||
457 | - formAns.answerList.length < formAns.subNum | ||
458 | - ? (formAns.answerList += '✓') | ||
459 | - : '' | ||
460 | - ">✓</span> | ||
461 | - <span class="answer-s active" @click=" | ||
462 | - formAns.answerList.length < formAns.subNum | ||
463 | - ? (formAns.answerList += '✗') | ||
464 | - : '' | ||
465 | - ">✗</span> | 930 | + <span |
931 | + class="answer-s active" | ||
932 | + @click=" | ||
933 | + formAns.answerList.length < formAns.subNum | ||
934 | + ? (formAns.answerList += '✓') | ||
935 | + : '' | ||
936 | + " | ||
937 | + >✓</span | ||
938 | + > | ||
939 | + <span | ||
940 | + class="answer-s active" | ||
941 | + @click=" | ||
942 | + formAns.answerList.length < formAns.subNum | ||
943 | + ? (formAns.answerList += '✗') | ||
944 | + : '' | ||
945 | + " | ||
946 | + >✗</span | ||
947 | + > | ||
466 | </template> | 948 | </template> |
467 | <template v-if="formAns.qusType == 3"> | 949 | <template v-if="formAns.qusType == 3"> |
468 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" | ||
469 | - @click="setMultiple(formAns, option, 2)">{{ option }}</span> | ||
470 | - <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span> | 950 | + <span |
951 | + class="answer-s active" | ||
952 | + v-for="option in formAns.answerOptions.split(',')" | ||
953 | + :key="option" | ||
954 | + @click="setMultiple(formAns, option, 2)" | ||
955 | + >{{ option }}</span | ||
956 | + > | ||
957 | + <span | ||
958 | + class="answer-s active" | ||
959 | + @click="setMultiple(formAns, ',', 2)" | ||
960 | + >,</span | ||
961 | + > | ||
471 | </template> | 962 | </template> |
472 | <template v-if="formAns.qusType == 2"> | 963 | <template v-if="formAns.qusType == 2"> |
473 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click=" | ||
474 | - formAns.answerList.length < formAns.subNum | ||
475 | - ? (formAns.answerList += option) | ||
476 | - : '' | ||
477 | - ">{{ option }}</span> | 964 | + <span |
965 | + class="answer-s active" | ||
966 | + v-for="option in formAns.answerOptions.split(',')" | ||
967 | + :key="option" | ||
968 | + @click=" | ||
969 | + formAns.answerList.length < formAns.subNum | ||
970 | + ? (formAns.answerList += option) | ||
971 | + : '' | ||
972 | + " | ||
973 | + >{{ option }}</span | ||
974 | + > | ||
478 | </template> | 975 | </template> |
479 | - <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> | ||
480 | - <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> | 976 | + <span |
977 | + class="answer-s delButton" | ||
978 | + @click="formAns.answerList = formAns.answerList.slice(0, -1)" | ||
979 | + >x</span | ||
980 | + > | ||
981 | + <span class="answer-s ac" @click="formAns.answerList = ''" | ||
982 | + >ac</span | ||
983 | + > | ||
481 | </p> | 984 | </p> |
482 | </div> | 985 | </div> |
483 | <div class="dialog-footer" slot="footer"> | 986 | <div class="dialog-footer" slot="footer"> |
@@ -486,14 +989,18 @@ | @@ -486,14 +989,18 @@ | ||
486 | </div> | 989 | </div> |
487 | </el-dialog> | 990 | </el-dialog> |
488 | <div class="btn-box"> | 991 | <div class="btn-box"> |
489 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 992 | + <el-button type="danger" plain round @click="linkBack" |
993 | + >取消</el-button | ||
994 | + > | ||
490 | <template v-if="!isUpload"> | 995 | <template v-if="!isUpload"> |
491 | <el-button round @click="toStep(1)">上一步</el-button> | 996 | <el-button round @click="toStep(1)">上一步</el-button> |
492 | <el-button type="primary" round @click="save">保存</el-button> | 997 | <el-button type="primary" round @click="save">保存</el-button> |
493 | </template> | 998 | </template> |
494 | <template v-else> | 999 | <template v-else> |
495 | <el-button round @click="step = 0">上一步</el-button> | 1000 | <el-button round @click="step = 0">上一步</el-button> |
496 | - <el-button type="primary" round @click="toStep(3)">下一步</el-button> | 1001 | + <el-button type="primary" round @click="toStep(3)" |
1002 | + >下一步</el-button | ||
1003 | + > | ||
497 | </template> | 1004 | </template> |
498 | </div> | 1005 | </div> |
499 | </div> | 1006 | </div> |
@@ -503,29 +1010,57 @@ | @@ -503,29 +1010,57 @@ | ||
503 | </div> | 1010 | </div> |
504 | <div class="question-box"> | 1011 | <div class="question-box"> |
505 | <template v-for="(question, index) in form.questionList"> | 1012 | <template v-for="(question, index) in form.questionList"> |
506 | - <div class="screenshot-box" v-for="(subQuestions, indexs) in question.subQuestions" | ||
507 | - :key="index + '-' + indexs"> | ||
508 | - <iframe class="screenshot" v-if="subQuestions.screenshot" :src="subQuestions.screenshot"></iframe> | 1013 | + <div |
1014 | + class="screenshot-box" | ||
1015 | + v-for="(subQuestions, indexs) in question.subQuestions" | ||
1016 | + :key="index + '-' + indexs" | ||
1017 | + > | ||
1018 | + <iframe | ||
1019 | + class="screenshot" | ||
1020 | + v-if="subQuestions.screenshot" | ||
1021 | + :src="subQuestions.screenshot" | ||
1022 | + ></iframe> | ||
509 | </div> | 1023 | </div> |
510 | </template> | 1024 | </template> |
511 | </div> | 1025 | </div> |
512 | <div class="btn-box"> | 1026 | <div class="btn-box"> |
513 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 1027 | + <el-button type="danger" plain round @click="linkBack" |
1028 | + >取消</el-button | ||
1029 | + > | ||
514 | <el-button round @click="toStep(2)">上一步</el-button> | 1030 | <el-button round @click="toStep(2)">上一步</el-button> |
515 | <el-button type="primary" round @click="save">保存</el-button> | 1031 | <el-button type="primary" round @click="save">保存</el-button> |
516 | </div> | 1032 | </div> |
517 | </div> | 1033 | </div> |
518 | - <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem" | ||
519 | - v-if="dialogStem" width="500"> | 1034 | + <el-dialog |
1035 | + :close-on-click-modal="false" | ||
1036 | + :title="stem.type == 1 ? '上传题干' : '上传题目解析'" | ||
1037 | + :visible.sync="dialogStem" | ||
1038 | + v-if="dialogStem" | ||
1039 | + width="500" | ||
1040 | + > | ||
520 | <div class="upload-box"> | 1041 | <div class="upload-box"> |
521 | <template v-show="stem.type == 1"> | 1042 | <template v-show="stem.type == 1"> |
522 | - <iframe class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"></iframe> | 1043 | + <iframe |
1044 | + class="screenshot" | ||
1045 | + v-if="stem.screenshot" | ||
1046 | + :src="stem.screenshot" | ||
1047 | + ></iframe> | ||
523 | </template> | 1048 | </template> |
524 | <template v-show="stem.type == 2"> | 1049 | <template v-show="stem.type == 2"> |
525 | - <iframe class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"></iframe> | 1050 | + <iframe |
1051 | + class="screenshot" | ||
1052 | + v-if="stem.answerScreenshot" | ||
1053 | + :src="stem.answerScreenshot" | ||
1054 | + ></iframe> | ||
526 | </template> | 1055 | </template> |
527 | - <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError" | ||
528 | - accept="image/*"> | 1056 | + <el-upload |
1057 | + class="upload-demo" | ||
1058 | + :action="uploadUrl" | ||
1059 | + :limit="1" | ||
1060 | + :on-success="upSuccess" | ||
1061 | + :on-error="upError" | ||
1062 | + accept="image/*" | ||
1063 | + > | ||
529 | <el-button size="small" type="primary">选择照片</el-button> | 1064 | <el-button size="small" type="primary">选择照片</el-button> |
530 | </el-upload> | 1065 | </el-upload> |
531 | </div> | 1066 | </div> |
@@ -533,13 +1068,26 @@ | @@ -533,13 +1068,26 @@ | ||
533 | <el-button @click="dialogStem = false">确定</el-button> | 1068 | <el-button @click="dialogStem = false">确定</el-button> |
534 | </div> | 1069 | </div> |
535 | </el-dialog> | 1070 | </el-dialog> |
536 | - <el-dialog :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500"> | 1071 | + <el-dialog |
1072 | + :close-on-click-modal="false" | ||
1073 | + title="知识点" | ||
1074 | + :visible.sync="dialogKnowledge" | ||
1075 | + width="500" | ||
1076 | + > | ||
537 | <div> | 1077 | <div> |
538 | <el-form ref="form" :model="stem" label-width="160px"> | 1078 | <el-form ref="form" :model="stem" label-width="160px"> |
539 | <el-form-item label="知识点:"> | 1079 | <el-form-item label="知识点:"> |
540 | - <el-cascader size="small" filterable :show-all-levels="false" collapse clearable placeholder="选择知识点" | ||
541 | - v-model="stem.knowledge" :options="knowledgeData" | ||
542 | - :props="{ expandTrigger: 'hover', multiple: true }"></el-cascader> | 1080 | + <el-cascader |
1081 | + size="small" | ||
1082 | + filterable | ||
1083 | + :show-all-levels="false" | ||
1084 | + collapse | ||
1085 | + clearable | ||
1086 | + placeholder="选择知识点" | ||
1087 | + v-model="stem.knowledge" | ||
1088 | + :options="knowledgeData" | ||
1089 | + :props="{ expandTrigger: 'hover', multiple: true }" | ||
1090 | + ></el-cascader> | ||
543 | </el-form-item> | 1091 | </el-form-item> |
544 | </el-form> | 1092 | </el-form> |
545 | </div> | 1093 | </div> |
@@ -585,21 +1133,28 @@ export default { | @@ -585,21 +1133,28 @@ export default { | ||
585 | }, | 1133 | }, |
586 | // 知识点列表 根据学段-科目筛选 | 1134 | // 知识点列表 根据学段-科目筛选 |
587 | knowledgeData: function () { | 1135 | knowledgeData: function () { |
588 | - let jsons = [] | 1136 | + let jsons = []; |
589 | if (this.form.gradeName && this.form.subjectName) { | 1137 | if (this.form.gradeName && this.form.subjectName) { |
590 | - let sectionName = "" | ||
591 | - this.gradeClassList.map(item => { | 1138 | + let sectionName = ""; |
1139 | + this.gradeClassList.map((item) => { | ||
592 | if (this.form.gradeName == item.gradeName) { | 1140 | if (this.form.gradeName == item.gradeName) { |
593 | - sectionName = item.sectionName | 1141 | + sectionName = item.sectionName; |
594 | } | 1142 | } |
595 | - }) | ||
596 | - if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { | ||
597 | - if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { | ||
598 | - jsons = this.knowledgeList[sectionName][this.form.subjectName] | 1143 | + }); |
1144 | + if ( | ||
1145 | + sectionName && | ||
1146 | + Object.keys(this.knowledgeList).includes(sectionName) | ||
1147 | + ) { | ||
1148 | + if ( | ||
1149 | + Object.keys(this.knowledgeList[sectionName]).includes( | ||
1150 | + this.form.subjectName | ||
1151 | + ) | ||
1152 | + ) { | ||
1153 | + jsons = this.knowledgeList[sectionName][this.form.subjectName]; | ||
599 | } | 1154 | } |
600 | } | 1155 | } |
601 | } | 1156 | } |
602 | - return jsons | 1157 | + return jsons; |
603 | }, | 1158 | }, |
604 | }, | 1159 | }, |
605 | watch: { | 1160 | watch: { |
@@ -698,12 +1253,14 @@ export default { | @@ -698,12 +1253,14 @@ export default { | ||
698 | //返回列表页参数记录 | 1253 | //返回列表页参数记录 |
699 | listType: 1, | 1254 | listType: 1, |
700 | listShare: 0, | 1255 | listShare: 0, |
701 | - uploadUrl: "/file/uploadImgToHtml" | 1256 | + uploadUrl: "/file/uploadImgToHtml", |
702 | }; | 1257 | }; |
703 | }, | 1258 | }, |
704 | async created() { | 1259 | async created() { |
705 | this.listType = this.$route.query.listType ? this.$route.query.listType : 1; | 1260 | this.listType = this.$route.query.listType ? this.$route.query.listType : 1; |
706 | - this.listShare = this.$route.query.listShare ? this.$route.query.listShare : 0; | 1261 | + this.listShare = this.$route.query.listShare |
1262 | + ? this.$route.query.listShare | ||
1263 | + : 0; | ||
707 | this.type = this.$route.query.type ? this.$route.query.type : 1; | 1264 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
708 | this.role = | 1265 | this.role = |
709 | this.$store.getters.info.showRole || | 1266 | this.$store.getters.info.showRole || |
@@ -714,14 +1271,16 @@ export default { | @@ -714,14 +1271,16 @@ export default { | ||
714 | ]; | 1271 | ]; |
715 | await this._GradeList(); | 1272 | await this._GradeList(); |
716 | } | 1273 | } |
717 | - this.isUpload = this.$route.query.isUpload || false | 1274 | + this.isUpload = this.$route.query.isUpload || false; |
718 | if (this.isUpload) { | 1275 | if (this.isUpload) { |
719 | - let params = this.$route.query.params && JSON.parse(this.$route.query.params) || null | ||
720 | - this.form.title = params?.name | ||
721 | - this.form.id = params?.id | ||
722 | - this.form.examsDuration = params?.examsDuration || 90 | ||
723 | - this.form.sharingType = params?.sharingType || 0 | ||
724 | - this.formatData(params) | 1276 | + let params = |
1277 | + (this.$route.query.params && JSON.parse(this.$route.query.params)) || | ||
1278 | + null; | ||
1279 | + this.form.title = params?.name; | ||
1280 | + this.form.id = params?.id; | ||
1281 | + this.form.examsDuration = params?.examsDuration || 90; | ||
1282 | + this.form.sharingType = params?.sharingType || 0; | ||
1283 | + this.formatData(params); | ||
725 | } | 1284 | } |
726 | await this._QuerySubjectList(this.gradeList[0]); | 1285 | await this._QuerySubjectList(this.gradeList[0]); |
727 | await this._TypeList(); | 1286 | await this._TypeList(); |
@@ -752,10 +1311,14 @@ export default { | @@ -752,10 +1311,14 @@ export default { | ||
752 | if (res && res.status == 0) { | 1311 | if (res && res.status == 0) { |
753 | if (this.stem.type == 1) { | 1312 | if (this.stem.type == 1) { |
754 | this.stem.screenshot = res.data.url; | 1313 | this.stem.screenshot = res.data.url; |
755 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot; | 1314 | + this.form.questionList[this.stem.index].subQuestions[ |
1315 | + this.stem.indexs | ||
1316 | + ].screenshot = this.stem.screenshot; | ||
756 | } else { | 1317 | } else { |
757 | this.stem.answerScreenshot = res.data.url; | 1318 | this.stem.answerScreenshot = res.data.url; |
758 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot; | 1319 | + this.form.questionList[this.stem.index].subQuestions[ |
1320 | + this.stem.indexs | ||
1321 | + ].answerScreenshot = this.stem.answerScreenshot; | ||
759 | } | 1322 | } |
760 | this.$message.success("上传成功"); | 1323 | this.$message.success("上传成功"); |
761 | } else { | 1324 | } else { |
@@ -774,7 +1337,9 @@ export default { | @@ -774,7 +1337,9 @@ export default { | ||
774 | }, | 1337 | }, |
775 | // 选择知识点 | 1338 | // 选择知识点 |
776 | setKnowledge() { | 1339 | setKnowledge() { |
777 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].knowledge = this.stem.knowledge.join("#"); | 1340 | + this.form.questionList[this.stem.index].subQuestions[ |
1341 | + this.stem.indexs | ||
1342 | + ].knowledge = this.stem.knowledge.join("#"); | ||
778 | this.dialogKnowledge = false; | 1343 | this.dialogKnowledge = false; |
779 | }, | 1344 | }, |
780 | //end | 1345 | //end |
@@ -783,7 +1348,7 @@ export default { | @@ -783,7 +1348,7 @@ export default { | ||
783 | linkBack() { | 1348 | linkBack() { |
784 | this.$confirm( | 1349 | this.$confirm( |
785 | (this.type == 2 ? "修改复制的" : "组建的") + | 1350 | (this.type == 2 ? "修改复制的" : "组建的") + |
786 | - "答题卡未保存,确认退出吗?", | 1351 | + "答题卡未保存,确认退出吗?", |
787 | "提示", | 1352 | "提示", |
788 | { | 1353 | { |
789 | confirmButtonText: "取消", | 1354 | confirmButtonText: "取消", |
@@ -796,14 +1361,14 @@ export default { | @@ -796,14 +1361,14 @@ export default { | ||
796 | type: "warning", | 1361 | type: "warning", |
797 | } | 1362 | } |
798 | ) | 1363 | ) |
799 | - .then(() => { }) | 1364 | + .then(() => {}) |
800 | .catch(() => { | 1365 | .catch(() => { |
801 | this.$router.push({ | 1366 | this.$router.push({ |
802 | path: "/examinationPaper", | 1367 | path: "/examinationPaper", |
803 | query: { | 1368 | query: { |
804 | type: this.listType, | 1369 | type: this.listType, |
805 | share: this.listShare, | 1370 | share: this.listShare, |
806 | - } | 1371 | + }, |
807 | }); | 1372 | }); |
808 | }); | 1373 | }); |
809 | }, | 1374 | }, |
@@ -828,8 +1393,8 @@ export default { | @@ -828,8 +1393,8 @@ export default { | ||
828 | }, | 1393 | }, |
829 | //计算题号 | 1394 | //计算题号 |
830 | setNum(index, indexs, sub) { | 1395 | setNum(index, indexs, sub) { |
831 | - let lengths = 0;//所在大题之前的所有小题数量 | ||
832 | - let subIndex = 0;//所在大题的位置 | 1396 | + let lengths = 0; //所在大题之前的所有小题数量 |
1397 | + let subIndex = 0; //所在大题的位置 | ||
833 | for (let i = 0; i < index; i++) { | 1398 | for (let i = 0; i < index; i++) { |
834 | let subArr = this.form.questionList[i].subQuestions.filter((item) => { | 1399 | let subArr = this.form.questionList[i].subQuestions.filter((item) => { |
835 | return !!item.questionType; | 1400 | return !!item.questionType; |
@@ -846,16 +1411,17 @@ export default { | @@ -846,16 +1411,17 @@ export default { | ||
846 | //统计小题数量 | 1411 | //统计小题数量 |
847 | setNums(ques) { | 1412 | setNums(ques) { |
848 | let lengths = 0; | 1413 | let lengths = 0; |
849 | - let subArr = ques?.filter((item) => { | ||
850 | - return !!item.questionType; | ||
851 | - }) || []; | 1414 | + let subArr = |
1415 | + ques?.filter((item) => { | ||
1416 | + return !!item.questionType; | ||
1417 | + }) || []; | ||
852 | lengths = subArr.length; | 1418 | lengths = subArr.length; |
853 | return lengths; | 1419 | return lengths; |
854 | }, | 1420 | }, |
855 | //转换中文大题题号 | 1421 | //转换中文大题题号 |
856 | setBigNum(num) { | 1422 | setBigNum(num) { |
857 | let txt = ""; | 1423 | let txt = ""; |
858 | - let bigNum = [...cNum] | 1424 | + let bigNum = [...cNum]; |
859 | txt = bigNum[num]; | 1425 | txt = bigNum[num]; |
860 | 1426 | ||
861 | return txt; | 1427 | return txt; |
@@ -952,7 +1518,7 @@ export default { | @@ -952,7 +1518,7 @@ export default { | ||
952 | if (this.formAns.endIndex == item.questionIndex) { | 1518 | if (this.formAns.endIndex == item.questionIndex) { |
953 | EndIndex = index; | 1519 | EndIndex = index; |
954 | } | 1520 | } |
955 | - return this.formAns.endIndex == item.questionIndex | 1521 | + return this.formAns.endIndex == item.questionIndex; |
956 | } | 1522 | } |
957 | ); | 1523 | ); |
958 | for (let i = 0; i <= subNum; i++) { | 1524 | for (let i = 0; i <= subNum; i++) { |
@@ -966,8 +1532,8 @@ export default { | @@ -966,8 +1532,8 @@ export default { | ||
966 | this.formAns.answerList[subNum - i] == "✓" | 1532 | this.formAns.answerList[subNum - i] == "✓" |
967 | ? 1 | 1533 | ? 1 |
968 | : this.formAns.answerList[subNum - i] == "✗" | 1534 | : this.formAns.answerList[subNum - i] == "✗" |
969 | - ? 2 | ||
970 | - : ""; | 1535 | + ? 2 |
1536 | + : ""; | ||
971 | } | 1537 | } |
972 | this.form.questionList[this.formAns.listIndex].subQuestions[ | 1538 | this.form.questionList[this.formAns.listIndex].subQuestions[ |
973 | EndIndex - i | 1539 | EndIndex - i |
@@ -1041,7 +1607,7 @@ export default { | @@ -1041,7 +1607,7 @@ export default { | ||
1041 | }, | 1607 | }, |
1042 | toStep(step) { | 1608 | toStep(step) { |
1043 | if (step == 2) { | 1609 | if (step == 2) { |
1044 | - this.setStep2() | 1610 | + this.setStep2(); |
1045 | } else { | 1611 | } else { |
1046 | this.formatQuestionList(); | 1612 | this.formatQuestionList(); |
1047 | this.step = step; | 1613 | this.step = step; |
@@ -1066,7 +1632,8 @@ export default { | @@ -1066,7 +1632,8 @@ export default { | ||
1066 | if (!this.form.questionList.length) { | 1632 | if (!this.form.questionList.length) { |
1067 | this.$message.warning("请添加题目!"); | 1633 | this.$message.warning("请添加题目!"); |
1068 | return; | 1634 | return; |
1069 | - } this.formatQuestionList() | 1635 | + } |
1636 | + this.formatQuestionList(); | ||
1070 | //添加题目ID、序号 | 1637 | //添加题目ID、序号 |
1071 | this.form.questionList.map((item, index) => { | 1638 | this.form.questionList.map((item, index) => { |
1072 | item.questionType = 0; | 1639 | item.questionType = 0; |
@@ -1076,12 +1643,12 @@ export default { | @@ -1076,12 +1643,12 @@ export default { | ||
1076 | }); | 1643 | }); |
1077 | }); | 1644 | }); |
1078 | //整理问题 | 1645 | //整理问题 |
1079 | - this.formateQuestion() | 1646 | + this.formateQuestion(); |
1080 | this.step = 2; | 1647 | this.step = 2; |
1081 | return; | 1648 | return; |
1082 | }, | 1649 | }, |
1083 | formateQuestion() { | 1650 | formateQuestion() { |
1084 | - this.formatQuestionList() | 1651 | + this.formatQuestionList(); |
1085 | this.form.questionList?.map((item) => { | 1652 | this.form.questionList?.map((item) => { |
1086 | let types = [{}]; | 1653 | let types = [{}]; |
1087 | let addndex = 0; | 1654 | let addndex = 0; |
@@ -1197,8 +1764,8 @@ export default { | @@ -1197,8 +1764,8 @@ export default { | ||
1197 | this.questionForm.answerList[i] == "✓" | 1764 | this.questionForm.answerList[i] == "✓" |
1198 | ? 1 | 1765 | ? 1 |
1199 | : this.questionForm.answerList[i] == "✗" | 1766 | : this.questionForm.answerList[i] == "✗" |
1200 | - ? 2 | ||
1201 | - : ""; | 1767 | + ? 2 |
1768 | + : ""; | ||
1202 | } else if (questionsOptions.questionType == 3) { | 1769 | } else if (questionsOptions.questionType == 3) { |
1203 | answer = this.questionForm.answerList.split(",")[i] || ""; | 1770 | answer = this.questionForm.answerList.split(",")[i] || ""; |
1204 | } else if (questionsOptions.questionType == 2) { | 1771 | } else if (questionsOptions.questionType == 2) { |
@@ -1220,9 +1787,9 @@ export default { | @@ -1220,9 +1787,9 @@ export default { | ||
1220 | delTabData(subIndex, index) { | 1787 | delTabData(subIndex, index) { |
1221 | this.form.questionList[index].subQuestions.splice(subIndex, 1); | 1788 | this.form.questionList[index].subQuestions.splice(subIndex, 1); |
1222 | if (this.form.questionList[index].subQuestions.length == 0) { | 1789 | if (this.form.questionList[index].subQuestions.length == 0) { |
1223 | - this.form.questionList.splice(index, 1) | 1790 | + this.form.questionList.splice(index, 1); |
1224 | } | 1791 | } |
1225 | - this.formateQuestion() | 1792 | + this.formateQuestion(); |
1226 | }, | 1793 | }, |
1227 | setScore(question) { | 1794 | setScore(question) { |
1228 | let score = question.subQuestions?.reduce((a, b) => { | 1795 | let score = question.subQuestions?.reduce((a, b) => { |
@@ -1256,7 +1823,9 @@ export default { | @@ -1256,7 +1823,9 @@ export default { | ||
1256 | questionsOptions.selectNum = 0; | 1823 | questionsOptions.selectNum = 0; |
1257 | break; | 1824 | break; |
1258 | } | 1825 | } |
1259 | - question.subQuestions ? question.subQuestions.push(questionsOptions) : question.subQuestions = [(questionsOptions)]; | 1826 | + question.subQuestions |
1827 | + ? question.subQuestions.push(questionsOptions) | ||
1828 | + : (question.subQuestions = [questionsOptions]); | ||
1260 | this.addSubQuestionsType = ""; | 1829 | this.addSubQuestionsType = ""; |
1261 | } | 1830 | } |
1262 | }, | 1831 | }, |
@@ -1286,7 +1855,7 @@ export default { | @@ -1286,7 +1855,7 @@ export default { | ||
1286 | subQuestions.selectNum = 0; | 1855 | subQuestions.selectNum = 0; |
1287 | break; | 1856 | break; |
1288 | } | 1857 | } |
1289 | - this.formateQuestion() | 1858 | + this.formateQuestion(); |
1290 | }, | 1859 | }, |
1291 | //添加选项 | 1860 | //添加选项 |
1292 | addOptions(subQuestions) { | 1861 | addOptions(subQuestions) { |
@@ -1426,7 +1995,7 @@ export default { | @@ -1426,7 +1995,7 @@ export default { | ||
1426 | query: { | 1995 | query: { |
1427 | type: this.listType, | 1996 | type: this.listType, |
1428 | share: this.listShare, | 1997 | share: this.listShare, |
1429 | - } | 1998 | + }, |
1430 | }); | 1999 | }); |
1431 | } else { | 2000 | } else { |
1432 | this.$message.error(info); | 2001 | this.$message.error(info); |
@@ -1473,12 +2042,12 @@ export default { | @@ -1473,12 +2042,12 @@ export default { | ||
1473 | const { data, status, info } = await fetchClassList(); | 2042 | const { data, status, info } = await fetchClassList(); |
1474 | if (status == 0) { | 2043 | if (status == 0) { |
1475 | this.gradeClassList = data.list?.map((item) => { | 2044 | this.gradeClassList = data.list?.map((item) => { |
1476 | - console.log(!this.gradeList.includes(item.gradeName)) | 2045 | + console.log(!this.gradeList.includes(item.gradeName)); |
1477 | if (!this.gradeList.includes(item.gradeName)) { | 2046 | if (!this.gradeList.includes(item.gradeName)) { |
1478 | - this.gradeList.push(item.gradeName) | 2047 | + this.gradeList.push(item.gradeName); |
1479 | } | 2048 | } |
1480 | - return item | ||
1481 | - }) | 2049 | + return item; |
2050 | + }); | ||
1482 | // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; | 2051 | // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; |
1483 | if (this.type != 2) { | 2052 | if (this.type != 2) { |
1484 | this.form.gradeName = this.gradeList[0]; | 2053 | this.form.gradeName = this.gradeList[0]; |
@@ -1502,10 +2071,10 @@ export default { | @@ -1502,10 +2071,10 @@ export default { | ||
1502 | } | 2071 | } |
1503 | const { data, status, info } = await fetchSubjectList({ ...query }); | 2072 | const { data, status, info } = await fetchSubjectList({ ...query }); |
1504 | if (status === 0) { | 2073 | if (status === 0) { |
1505 | - let subjectArr = [] | 2074 | + let subjectArr = []; |
1506 | this.subjectList = | 2075 | this.subjectList = |
1507 | data.subjectNames?.map((item) => { | 2076 | data.subjectNames?.map((item) => { |
1508 | - subjectArr.push(item.subjectName || item) | 2077 | + subjectArr.push(item.subjectName || item); |
1509 | return { | 2078 | return { |
1510 | value: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | 2079 | value: this.role == "ROLE_PERSONAL" ? item.subjectName : item, |
1511 | label: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | 2080 | label: this.role == "ROLE_PERSONAL" ? item.subjectName : item, |
@@ -1539,7 +2108,7 @@ export default { | @@ -1539,7 +2108,7 @@ export default { | ||
1539 | this.form.sharingType = data.sharingType; | 2108 | this.form.sharingType = data.sharingType; |
1540 | } | 2109 | } |
1541 | this.form.tagId = ""; | 2110 | this.form.tagId = ""; |
1542 | - this.formatData(data) | 2111 | + this.formatData(data); |
1543 | } else { | 2112 | } else { |
1544 | this.$message.error(info); | 2113 | this.$message.error(info); |
1545 | } | 2114 | } |
@@ -1585,7 +2154,7 @@ export default { | @@ -1585,7 +2154,7 @@ export default { | ||
1585 | show: false, | 2154 | show: false, |
1586 | }; | 2155 | }; |
1587 | }); | 2156 | }); |
1588 | - } | 2157 | + }, |
1589 | }, | 2158 | }, |
1590 | }; | 2159 | }; |
1591 | </script> | 2160 | </script> |
@@ -1866,7 +2435,7 @@ export default { | @@ -1866,7 +2435,7 @@ export default { | ||
1866 | display: flex; | 2435 | display: flex; |
1867 | border-bottom: 1px solid #e2e2e2; | 2436 | border-bottom: 1px solid #e2e2e2; |
1868 | 2437 | ||
1869 | - &>div { | 2438 | + & > div { |
1870 | min-height: 40px; | 2439 | min-height: 40px; |
1871 | padding: 5px; | 2440 | padding: 5px; |
1872 | flex-shrink: 0; | 2441 | flex-shrink: 0; |
@@ -1931,13 +2500,8 @@ export default { | @@ -1931,13 +2500,8 @@ export default { | ||
1931 | .upload-demo { | 2500 | .upload-demo { |
1932 | text-align: center; | 2501 | text-align: center; |
1933 | } | 2502 | } |
1934 | - | ||
1935 | - .stem-pic { | ||
1936 | - display: block; | ||
1937 | - margin: 0 auto 20px; | ||
1938 | - max-width: 100%; | ||
1939 | - max-height: 200px; | ||
1940 | - object-fit: cover; | 2503 | + .screenshot { |
2504 | + width: 100%; | ||
1941 | } | 2505 | } |
1942 | } | 2506 | } |
1943 | </style> | 2507 | </style> |
1944 | \ No newline at end of file | 2508 | \ No newline at end of file |
src/views/examinationPaper/index.vue
@@ -5,23 +5,59 @@ | @@ -5,23 +5,59 @@ | ||
5 | <span>备题组卷</span> | 5 | <span>备题组卷</span> |
6 | </template> | 6 | </template> |
7 | <template slot="btns"> | 7 | <template slot="btns"> |
8 | - <el-tooltip v-if="!code && gdClass" effect="dark" content="已归档试卷" placement="bottom"> | ||
9 | - <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button> | 8 | + <el-tooltip |
9 | + v-if="!code && gdClass" | ||
10 | + effect="dark" | ||
11 | + content="已归档试卷" | ||
12 | + placement="bottom" | ||
13 | + > | ||
14 | + <el-button | ||
15 | + type="primary" | ||
16 | + icon="fa fa-archive" | ||
17 | + size="mini" | ||
18 | + plain | ||
19 | + circle | ||
20 | + @click="toArchiving" | ||
21 | + ></el-button> | ||
10 | </el-tooltip> | 22 | </el-tooltip> |
11 | </template> | 23 | </template> |
12 | </back-box> | 24 | </back-box> |
13 | <div class="examinationPaper-type"> | 25 | <div class="examinationPaper-type"> |
14 | <el-button-group> | 26 | <el-button-group> |
15 | - <el-button size="large" :type="query.type == 1 ? 'primary' : 'default'" @click="changPaperType(1)">备题</el-button> | ||
16 | - <el-button size="large" :type="query.type == 2 ? 'primary' : 'default'" @click="changPaperType(2)">组卷</el-button> | 27 | + <el-button |
28 | + size="large" | ||
29 | + :type="query.type == 1 ? 'primary' : 'default'" | ||
30 | + @click="changPaperType(1)" | ||
31 | + >备题</el-button | ||
32 | + > | ||
33 | + <el-button | ||
34 | + size="large" | ||
35 | + :type="query.type == 2 ? 'primary' : 'default'" | ||
36 | + @click="changPaperType(2)" | ||
37 | + >组卷</el-button | ||
38 | + > | ||
17 | </el-button-group> | 39 | </el-button-group> |
18 | 40 | ||
19 | <p> | 41 | <p> |
20 | - <el-button v-if="query.type == 1" type="primary" size="mini" icon="el-icon-plus" round @click="diaUp = true"> | ||
21 | - 导入课件</el-button> | ||
22 | - | ||
23 | - <el-dropdown v-if="query.type == 2" trigger="click" @command="handleAdd"> | ||
24 | - <el-button type="primary" size="mini" icon="el-icon-plus" round>添加试卷</el-button> | 42 | + <el-button |
43 | + v-if="query.type == 1" | ||
44 | + type="primary" | ||
45 | + size="mini" | ||
46 | + icon="el-icon-plus" | ||
47 | + round | ||
48 | + @click="diaUp = true" | ||
49 | + > | ||
50 | + 导入课件</el-button | ||
51 | + > | ||
52 | + | ||
53 | + <el-dropdown | ||
54 | + v-if="query.type == 2" | ||
55 | + trigger="click" | ||
56 | + @command="handleAdd" | ||
57 | + > | ||
58 | + <el-button type="primary" size="mini" icon="el-icon-plus" round | ||
59 | + >添加试卷</el-button | ||
60 | + > | ||
25 | <el-dropdown-menu slot="dropdown"> | 61 | <el-dropdown-menu slot="dropdown"> |
26 | <el-dropdown-item :command="1">导入试卷</el-dropdown-item> | 62 | <el-dropdown-item :command="1">导入试卷</el-dropdown-item> |
27 | <el-dropdown-item :command="2">手动创建</el-dropdown-item> | 63 | <el-dropdown-item :command="2">手动创建</el-dropdown-item> |
@@ -31,20 +67,60 @@ | @@ -31,20 +67,60 @@ | ||
31 | </div> | 67 | </div> |
32 | <div class="answer-header"> | 68 | <div class="answer-header"> |
33 | <div class="sel-box"> | 69 | <div class="sel-box"> |
34 | - <el-select class="sel" v-model="query.classId" placeholder="选择班级" @change="changClazz"> | ||
35 | - <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value"> | 70 | + <el-select |
71 | + class="sel" | ||
72 | + v-model="query.classId" | ||
73 | + placeholder="选择班级" | ||
74 | + @change="changClazz" | ||
75 | + > | ||
76 | + <el-option | ||
77 | + v-for="item in classList" | ||
78 | + :key="item.value" | ||
79 | + :label="item.label" | ||
80 | + :value="item.value" | ||
81 | + > | ||
36 | </el-option> | 82 | </el-option> |
37 | </el-select> | 83 | </el-select> |
38 | - <el-select class="sel" v-model="query.subjectName" placeholder="选择科目" @change="getData(false)"> | ||
39 | - <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value"> | 84 | + <el-select |
85 | + class="sel" | ||
86 | + v-model="query.subjectName" | ||
87 | + placeholder="选择科目" | ||
88 | + @change="getData(false)" | ||
89 | + > | ||
90 | + <el-option | ||
91 | + v-for="item in subjectList" | ||
92 | + :key="item.value" | ||
93 | + :label="item.label" | ||
94 | + :value="item.value" | ||
95 | + > | ||
40 | </el-option> | 96 | </el-option> |
41 | </el-select> | 97 | </el-select> |
42 | - <el-select v-if="query.type == 2" class="sel" v-model="query.tagId" placeholder="选择类型" @change="getData(false)"> | ||
43 | - <el-option v-for="item in typeList" :key="item.label" :label="item.label" :value="item.value">{{ item.label }} | 98 | + <el-select |
99 | + v-if="query.type == 2" | ||
100 | + class="sel" | ||
101 | + v-model="query.tagId" | ||
102 | + placeholder="选择类型" | ||
103 | + @change="getData(false)" | ||
104 | + > | ||
105 | + <el-option | ||
106 | + v-for="item in typeList" | ||
107 | + :key="item.label" | ||
108 | + :label="item.label" | ||
109 | + :value="item.value" | ||
110 | + >{{ item.label }} | ||
44 | </el-option> | 111 | </el-option> |
45 | </el-select> | 112 | </el-select> |
46 | - <el-input placeholder="试卷名称" v-model="query.title" class="input-with-select" @keyup.enter.native="getData(true)"> | ||
47 | - <el-button slot="append" icon="el-icon-search" @click="getData(true)"></el-button> | 113 | + <el-input |
114 | + placeholder="试卷名称" | ||
115 | + v-model="query.title" | ||
116 | + class="input-with-select" | ||
117 | + @keyup.enter.native="getData(true)" | ||
118 | + > | ||
119 | + <el-button | ||
120 | + slot="append" | ||
121 | + icon="el-icon-search" | ||
122 | + @click="getData(true)" | ||
123 | + ></el-button> | ||
48 | </el-input> | 124 | </el-input> |
49 | </div> | 125 | </div> |
50 | </div> | 126 | </div> |
@@ -54,10 +130,16 @@ | @@ -54,10 +130,16 @@ | ||
54 | </p> | 130 | </p> |
55 | <div class="content"> | 131 | <div class="content"> |
56 | <p class="tab-box"> | 132 | <p class="tab-box"> |
57 | - <span :class="['tab-s', query.share == 0 ? 'active' : '']" @click="changShare(0)">我自编的 ({{ totalCount.my | ||
58 | - }})</span> | ||
59 | - <span :class="['tab-s', query.share == 1 ? 'active' : '']" @click="changShare(1)">年级共享的 ({{ totalCount.share | ||
60 | - }})</span> | 133 | + <span |
134 | + :class="['tab-s', query.share == 0 ? 'active' : '']" | ||
135 | + @click="changShare(0)" | ||
136 | + >我自编的 ({{ totalCount.my }})</span | ||
137 | + > | ||
138 | + <span | ||
139 | + :class="['tab-s', query.share == 1 ? 'active' : '']" | ||
140 | + @click="changShare(1)" | ||
141 | + >年级共享的 ({{ totalCount.share }})</span | ||
142 | + > | ||
61 | </p> | 143 | </p> |
62 | <ul v-if="tableData && tableData.length" v-loading="loading"> | 144 | <ul v-if="tableData && tableData.length" v-loading="loading"> |
63 | <li class="item" v-for="item in tableData" :key="item.id"> | 145 | <li class="item" v-for="item in tableData" :key="item.id"> |
@@ -79,48 +161,99 @@ | @@ -79,48 +161,99 @@ | ||
79 | </template> | 161 | </template> |
80 | <template v-if="role != 'ROLE_PERSONAL'"> | 162 | <template v-if="role != 'ROLE_PERSONAL'"> |
81 | 授课端同步: | 163 | 授课端同步: |
82 | - <span class="clazz" v-for="(clazzChild, indexs) in item.classList" :key="clazzChild.classId" | ||
83 | - :class="clazzChild.keepStatus == 1 ? 'active' : ''">{{ | ||
84 | - `${clazzChild.className}${indexs != item.classList.length - 1 ? "、" : "" | ||
85 | - }` | 164 | + <span |
165 | + class="clazz" | ||
166 | + v-for="(clazzChild, indexs) in item.classList" | ||
167 | + :key="clazzChild.classId" | ||
168 | + :class="clazzChild.keepStatus == 1 ? 'active' : ''" | ||
169 | + >{{ | ||
170 | + `${clazzChild.className}${ | ||
171 | + indexs != item.classList.length - 1 ? "、" : "" | ||
172 | + }` | ||
86 | }} | 173 | }} |
87 | - <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i></span> | ||
88 | - <el-tooltip effect="dark" content="刷新同步状态" placement="right"> | ||
89 | - <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> | 174 | + <i |
175 | + v-if="clazzChild.keepStatus == 1" | ||
176 | + class="el-icon-success" | ||
177 | + ></i | ||
178 | + ></span> | ||
179 | + <el-tooltip | ||
180 | + effect="dark" | ||
181 | + content="刷新同步状态" | ||
182 | + placement="right" | ||
183 | + > | ||
184 | + <i | ||
185 | + class="icon-refresh el-icon-refresh" | ||
186 | + @click="refreshStic" | ||
187 | + ></i> | ||
90 | </el-tooltip> | 188 | </el-tooltip> |
91 | </template> | 189 | </template> |
92 | </p> | 190 | </p> |
93 | <p class="person"> | 191 | <p class="person"> |
94 | - {{ item.realName }}<em class="s-line">|</em><span class="date">{{ item.modifiedTime }}</span> | 192 | + {{ item.realName }}<em class="s-line">|</em |
193 | + ><span class="date">{{ item.modifiedTime }}</span> | ||
95 | </p> | 194 | </p> |
96 | </div> | 195 | </div> |
97 | <div class="btn-box"> | 196 | <div class="btn-box"> |
98 | <el-tooltip effect="dark" content="修改答案" placement="bottom"> | 197 | <el-tooltip effect="dark" content="修改答案" placement="bottom"> |
99 | - <el-button class="edit" type="primary" size="mini" circle icon="el-icon-edit" | ||
100 | - @click="toEdit(item)"></el-button> | 198 | + <el-button |
199 | + class="edit" | ||
200 | + type="primary" | ||
201 | + size="mini" | ||
202 | + circle | ||
203 | + icon="el-icon-edit" | ||
204 | + @click="toEdit(item)" | ||
205 | + ></el-button> | ||
101 | </el-tooltip> | 206 | </el-tooltip> |
102 | - <el-dropdown trigger="click" @command="handleDropdownClick($event, item)"> | ||
103 | - <el-button type="info" size="mini" circle icon="el-icon-more"></el-button> | 207 | + <el-dropdown |
208 | + trigger="click" | ||
209 | + @command="handleDropdownClick($event, item)" | ||
210 | + > | ||
211 | + <el-button | ||
212 | + type="info" | ||
213 | + size="mini" | ||
214 | + circle | ||
215 | + icon="el-icon-more" | ||
216 | + ></el-button> | ||
104 | <el-dropdown-menu slot="dropdown"> | 217 | <el-dropdown-menu slot="dropdown"> |
105 | - <el-dropdown-item :command="1" | ||
106 | - v-if="userName == item.realName && role != 'ROLE_PERSONAL'">修改分享范围</el-dropdown-item> | 218 | + <el-dropdown-item |
219 | + :command="1" | ||
220 | + v-if="userName == item.realName && role != 'ROLE_PERSONAL'" | ||
221 | + >修改分享范围</el-dropdown-item | ||
222 | + > | ||
107 | <el-dropdown-item :command="2">复制</el-dropdown-item> | 223 | <el-dropdown-item :command="2">复制</el-dropdown-item> |
108 | - <el-dropdown-item v-show="query.share == 0" :command="3">放入回收站</el-dropdown-item> | 224 | + <el-dropdown-item v-show="query.share == 0" :command="3" |
225 | + >放入回收站</el-dropdown-item | ||
226 | + > | ||
109 | </el-dropdown-menu> | 227 | </el-dropdown-menu> |
110 | </el-dropdown> | 228 | </el-dropdown> |
111 | </div> | 229 | </div> |
112 | </li> | 230 | </li> |
113 | </ul> | 231 | </ul> |
114 | <div class="pagination-box"> | 232 | <div class="pagination-box"> |
115 | - <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total" | ||
116 | - @current-change="changePage" :current-page="page" :page-size="size"> | 233 | + <el-pagination |
234 | + small="" | ||
235 | + layout="total,prev, pager, next" | ||
236 | + :hide-on-single-page="true" | ||
237 | + :total="total" | ||
238 | + @current-change="changePage" | ||
239 | + :current-page="page" | ||
240 | + :page-size="size" | ||
241 | + > | ||
117 | </el-pagination> | 242 | </el-pagination> |
118 | </div> | 243 | </div> |
119 | - <el-empty v-if="!loading && tableData.length == 0" content="没有更多数据" :image-size="100"></el-empty> | 244 | + <el-empty |
245 | + v-if="!loading && tableData.length == 0" | ||
246 | + content="没有更多数据" | ||
247 | + :image-size="100" | ||
248 | + ></el-empty> | ||
120 | </div> | 249 | </div> |
121 | 250 | ||
122 | - | ||
123 | - <el-dialog :close-on-click-modal="false" title="选择分享范围" :visible.sync="dialogVisible" width="400px"> | 251 | + <el-dialog |
252 | + :close-on-click-modal="false" | ||
253 | + title="选择分享范围" | ||
254 | + :visible.sync="dialogVisible" | ||
255 | + width="400px" | ||
256 | + > | ||
124 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> | 257 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> |
125 | <el-form-item prop="share" label="分享范围:"> | 258 | <el-form-item prop="share" label="分享范围:"> |
126 | <el-radio-group v-model="shareForm.sharingType"> | 259 | <el-radio-group v-model="shareForm.sharingType"> |
@@ -134,16 +267,33 @@ | @@ -134,16 +267,33 @@ | ||
134 | <el-button @click="dialogVisible = false">取 消</el-button> | 267 | <el-button @click="dialogVisible = false">取 消</el-button> |
135 | </div> | 268 | </div> |
136 | </el-dialog> | 269 | </el-dialog> |
137 | - <el-dialog :close-on-click-modal="false" title="上传word文档" :visible.sync="diaUp" width="600px"> | ||
138 | - <upload :url="url" :params="{ type: query.type }" @upSuccess="upSuccess" fileName="下载"> | 270 | + <el-dialog |
271 | + :close-on-click-modal="false" | ||
272 | + title="上传word文档" | ||
273 | + :visible.sync="diaUp" | ||
274 | + width="600px" | ||
275 | + > | ||
276 | + <upload | ||
277 | + :url="url" | ||
278 | + :params="{ type: query.type }" | ||
279 | + @upSuccess="upSuccess" | ||
280 | + fileName="下载" | ||
281 | + > | ||
139 | <div class="down-box" slot="down"> | 282 | <div class="down-box" slot="down"> |
140 | - <p class="down-head"> <span>第一步:导出菁优网试卷,</span> | ||
141 | - <!-- <el-link type="danger" @click="downExcel">模板下载</el-link> 。 --> | 283 | + <p class="down-head"> |
284 | + <span>第一步:导出菁优网试卷,</span> | ||
285 | + | ||
142 | <span class="img-box"> | 286 | <span class="img-box"> |
143 | - <el-image class="img" :src="examplePic" :preview-src-list="examplePicList"> | 287 | + <el-image |
288 | + class="img" | ||
289 | + :src="examplePic" | ||
290 | + :preview-src-list="examplePicList" | ||
291 | + > | ||
144 | </el-image> | 292 | </el-image> |
145 | 导出选项示例。 | 293 | 导出选项示例。 |
146 | </span> | 294 | </span> |
295 | + 或者 | ||
296 | + <el-link type="primary" @click="downExcel">下载模板</el-link> 。 | ||
147 | </p> | 297 | </p> |
148 | <p>第二步:上传完成编辑好的试卷。</p> | 298 | <p>第二步:上传完成编辑好的试卷。</p> |
149 | </div> | 299 | </div> |
@@ -158,7 +308,7 @@ | @@ -158,7 +308,7 @@ | ||
158 | <script> | 308 | <script> |
159 | import { downloadFile } from "@/utils"; | 309 | import { downloadFile } from "@/utils"; |
160 | import axios from "axios"; | 310 | import axios from "axios"; |
161 | -import example from "@/assets/images/example.jpg" | 311 | +import example from "@/assets/images/example.jpg"; |
162 | export default { | 312 | export default { |
163 | name: "examinationPaper", | 313 | name: "examinationPaper", |
164 | data() { | 314 | data() { |
@@ -195,14 +345,15 @@ export default { | @@ -195,14 +345,15 @@ export default { | ||
195 | size: 20, | 345 | size: 20, |
196 | 346 | ||
197 | // v1.5 | 347 | // v1.5 |
198 | - totalCount: {//数量统计 | 348 | + totalCount: { |
349 | + //数量统计 | ||
199 | my: 0, | 350 | my: 0, |
200 | share: 0, | 351 | share: 0, |
201 | }, | 352 | }, |
202 | - diaUp: false,//上传word弹窗开关 | ||
203 | - url: "/api_html/common/paper/upload",//上传文档地址 | 353 | + diaUp: false, //上传word弹窗开关 |
354 | + url: "/api_html/common/paper/upload", //上传文档地址 | ||
204 | examplePic: example, | 355 | examplePic: example, |
205 | - examplePicList: [example] | 356 | + examplePicList: [example], |
206 | }; | 357 | }; |
207 | }, | 358 | }, |
208 | async created() { | 359 | async created() { |
@@ -213,12 +364,12 @@ export default { | @@ -213,12 +364,12 @@ export default { | ||
213 | this.userName = this.$store.getters.info.name || ""; | 364 | this.userName = this.$store.getters.info.name || ""; |
214 | this.query.type = this.$route.query.type || 1; | 365 | this.query.type = this.$route.query.type || 1; |
215 | this.query.share = this.$route.query.share || 0; | 366 | this.query.share = this.$route.query.share || 0; |
216 | - this._QueryClassList2() | 367 | + this._QueryClassList2(); |
217 | await this._QueryClassList(); | 368 | await this._QueryClassList(); |
218 | if (!this.query.classId) { | 369 | if (!this.query.classId) { |
219 | return; | 370 | return; |
220 | } | 371 | } |
221 | - this._QueryTypeList() | 372 | + this._QueryTypeList(); |
222 | await this._QuerySubjectList(); | 373 | await this._QuerySubjectList(); |
223 | this._QueryData(); | 374 | this._QueryData(); |
224 | }, | 375 | }, |
@@ -246,8 +397,8 @@ export default { | @@ -246,8 +397,8 @@ export default { | ||
246 | ...query, | 397 | ...query, |
247 | listType: this.query.type, | 398 | listType: this.query.type, |
248 | listShare: this.query.share, | 399 | listShare: this.query.share, |
249 | - subjectName: this.query.subjectName | ||
250 | - } | 400 | + subjectName: this.query.subjectName, |
401 | + }, | ||
251 | }; | 402 | }; |
252 | this.$router.push(routerItem); | 403 | this.$router.push(routerItem); |
253 | }, | 404 | }, |
@@ -263,7 +414,7 @@ export default { | @@ -263,7 +414,7 @@ export default { | ||
263 | ...query, | 414 | ...query, |
264 | listType: this.query.type, | 415 | listType: this.query.type, |
265 | listShare: this.query.share, | 416 | listShare: this.query.share, |
266 | - } | 417 | + }, |
267 | }; | 418 | }; |
268 | this.$router.push(routerItem); | 419 | this.$router.push(routerItem); |
269 | }, | 420 | }, |
@@ -272,11 +423,12 @@ export default { | @@ -272,11 +423,12 @@ export default { | ||
272 | path: "/examinationPaperEdit", | 423 | path: "/examinationPaperEdit", |
273 | query: { | 424 | query: { |
274 | paperId: item.id, | 425 | paperId: item.id, |
275 | - paperType: this.query.type | 426 | + paperType: this.query.type, |
276 | }, | 427 | }, |
277 | }); | 428 | }); |
278 | }, | 429 | }, |
279 | - handleDropdownClick(value, item) {//更多 | 430 | + handleDropdownClick(value, item) { |
431 | + //更多 | ||
280 | const that = this; | 432 | const that = this; |
281 | switch (value) { | 433 | switch (value) { |
282 | case 1: | 434 | case 1: |
@@ -300,9 +452,9 @@ export default { | @@ -300,9 +452,9 @@ export default { | ||
300 | } | 452 | } |
301 | }, | 453 | }, |
302 | changPaperType(type) { | 454 | changPaperType(type) { |
303 | - this.query.type = type | ||
304 | - this.query.tagId = "" | ||
305 | - this.changShare(0) | 455 | + this.query.type = type; |
456 | + this.query.tagId = ""; | ||
457 | + this.changShare(0); | ||
306 | }, | 458 | }, |
307 | changePage(page) { | 459 | changePage(page) { |
308 | this.page = page; | 460 | this.page = page; |
@@ -351,22 +503,22 @@ export default { | @@ -351,22 +503,22 @@ export default { | ||
351 | async changClazz() { | 503 | async changClazz() { |
352 | this.page = 1; | 504 | this.page = 1; |
353 | if (this.query.type == 2) { | 505 | if (this.query.type == 2) { |
354 | - await this._QueryTypeList() | 506 | + await this._QueryTypeList(); |
355 | } | 507 | } |
356 | await this._QuerySubjectList(); | 508 | await this._QuerySubjectList(); |
357 | this._QueryData(false); | 509 | this._QueryData(false); |
358 | }, | 510 | }, |
359 | //切换类型 | 511 | //切换类型 |
360 | async changShare(share) { | 512 | async changShare(share) { |
361 | - this.query.share = share | 513 | + this.query.share = share; |
362 | this.page = 1; | 514 | this.page = 1; |
363 | this.$router.replace({ | 515 | this.$router.replace({ |
364 | name: "examinationPaper", | 516 | name: "examinationPaper", |
365 | query: { | 517 | query: { |
366 | type: this.query.type, | 518 | type: this.query.type, |
367 | share: this.query.share, | 519 | share: this.query.share, |
368 | - } | ||
369 | - }) | 520 | + }, |
521 | + }); | ||
370 | this._QueryData(false); | 522 | this._QueryData(false); |
371 | }, | 523 | }, |
372 | // 查找班级 | 524 | // 查找班级 |
@@ -456,7 +608,7 @@ export default { | @@ -456,7 +608,7 @@ export default { | ||
456 | value: "", | 608 | value: "", |
457 | label: "请选择标签", | 609 | label: "请选择标签", |
458 | }); | 610 | }); |
459 | - this.query.tagId = "" | 611 | + this.query.tagId = ""; |
460 | } else { | 612 | } else { |
461 | this.$message.error(info); | 613 | this.$message.error(info); |
462 | } | 614 | } |
@@ -472,7 +624,7 @@ export default { | @@ -472,7 +624,7 @@ export default { | ||
472 | query = { ...this.query }; | 624 | query = { ...this.query }; |
473 | for (let key in query) { | 625 | for (let key in query) { |
474 | if (!query[key] && query[key] !== 0) { | 626 | if (!query[key] && query[key] !== 0) { |
475 | - delete query[key] | 627 | + delete query[key]; |
476 | } | 628 | } |
477 | } | 629 | } |
478 | if (!query.classId) { | 630 | if (!query.classId) { |
@@ -505,7 +657,6 @@ export default { | @@ -505,7 +657,6 @@ export default { | ||
505 | } | 657 | } |
506 | }, | 658 | }, |
507 | 659 | ||
508 | - | ||
509 | //v1.5 | 660 | //v1.5 |
510 | upSuccess(res) { | 661 | upSuccess(res) { |
511 | if (res.status == 0) { | 662 | if (res.status == 0) { |
@@ -518,32 +669,31 @@ export default { | @@ -518,32 +669,31 @@ export default { | ||
518 | duration: 2000, | 669 | duration: 2000, |
519 | }); | 670 | }); |
520 | this.diaUp = false; | 671 | this.diaUp = false; |
521 | - let params = JSON.stringify(res.data) | 672 | + let params = JSON.stringify(res.data); |
522 | if (this.query.type == 2) { | 673 | if (this.query.type == 2) { |
523 | - this.toAdd({ params, isUpload: 1 }) | 674 | + this.toAdd({ params, isUpload: 1 }); |
524 | } else { | 675 | } else { |
525 | - this.toAddQs({ params }) | 676 | + this.toAddQs({ params }); |
526 | } | 677 | } |
527 | } | 678 | } |
528 | }, | 679 | }, |
529 | handleAdd(value) { | 680 | handleAdd(value) { |
530 | if (value == 2) { | 681 | if (value == 2) { |
531 | - this.toAdd() | 682 | + this.toAdd(); |
532 | } else { | 683 | } else { |
533 | - this.diaUp = true | 684 | + this.diaUp = true; |
534 | } | 685 | } |
535 | }, | 686 | }, |
536 | 687 | ||
537 | - | ||
538 | async downExcel() { | 688 | async downExcel() { |
539 | axios("static/试卷模板.docx", { | 689 | axios("static/试卷模板.docx", { |
540 | - responseType: "arraybuffer" | ||
541 | - }).then(res => { | 690 | + responseType: "arraybuffer", |
691 | + }).then((res) => { | ||
542 | let blob = new Blob([res.data], { | 692 | let blob = new Blob([res.data], { |
543 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | 693 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
544 | }); | 694 | }); |
545 | downloadFile("试卷模板.docx", blob); | 695 | downloadFile("试卷模板.docx", blob); |
546 | - }) | 696 | + }); |
547 | }, | 697 | }, |
548 | }, | 698 | }, |
549 | }; | 699 | }; |
@@ -724,7 +874,7 @@ export default { | @@ -724,7 +874,7 @@ export default { | ||
724 | 874 | ||
725 | &.active { | 875 | &.active { |
726 | color: #667ffd; | 876 | color: #667ffd; |
727 | - border-bottom: 1px solid #667ffd | 877 | + border-bottom: 1px solid #667ffd; |
728 | } | 878 | } |
729 | } | 879 | } |
730 | } | 880 | } |
@@ -737,7 +887,7 @@ export default { | @@ -737,7 +887,7 @@ export default { | ||
737 | 887 | ||
738 | .img-box { | 888 | .img-box { |
739 | position: relative; | 889 | position: relative; |
740 | - color: #667ffd; | 890 | + color: #409EFF; |
741 | 891 | ||
742 | .img { | 892 | .img { |
743 | position: absolute; | 893 | position: absolute; |