Commit 1410e5cdd8229e396f0d92d54335fd3b9e93655f
1 parent
68875fba
即时测随堂问多班汇总逻辑
Showing
2 changed files
with
327 additions
and
228 deletions
src/views/basic/ask/list.vue
@@ -5,56 +5,149 @@ | @@ -5,56 +5,149 @@ | ||
5 | <span>随堂问-数据报表</span> | 5 | <span>随堂问-数据报表</span> |
6 | </template> | 6 | </template> |
7 | <template slot="btns"> | 7 | <template slot="btns"> |
8 | - <el-tooltip v-if="this.role != 'ROLE_PERSONAL' && !code && gdClass" effect="dark" content="已归档试卷" | ||
9 | - placement="bottom"> | ||
10 | - <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button> | 8 | + <el-tooltip |
9 | + v-if="this.role != 'ROLE_PERSONAL' && !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> | ||
11 | </el-tooltip> | 22 | </el-tooltip> |
12 | </template> | 23 | </template> |
13 | </back-box> | 24 | </back-box> |
14 | <div v-show="!isDetail" class="table-box"> | 25 | <div v-show="!isDetail" class="table-box"> |
15 | <div class="table-cont" v-loading="loading"> | 26 | <div class="table-cont" v-loading="loading"> |
16 | <p class="btn-box" v-if="tableData.length"> | 27 | <p class="btn-box" v-if="tableData.length"> |
17 | - <el-button type="primary" round @click="linkToDetail2">查看汇总报表</el-button> | 28 | + <el-button type="primary" round @click="linkToDetail2" |
29 | + >查看汇总报表</el-button | ||
30 | + > | ||
18 | </p> | 31 | </p> |
19 | <div> | 32 | <div> |
20 | - <el-table :data="tableData" border :show-header="total > 0" style="width: 100%" | ||
21 | - @selection-change="handleSelectionChange"> | ||
22 | - <el-table-column type="selection" width="40"></el-table-column> | ||
23 | - <el-table-column prop="subjectName" label="科目" align="center" width="80"></el-table-column> | ||
24 | - <el-table-column prop="title" label="课时名称" align="center"></el-table-column> | ||
25 | - <el-table-column prop="participationRate" label="总参与度" align="center"> <template slot-scope="scoped">{{ | ||
26 | - scoped.row.participationRate }}%</template></el-table-column> | ||
27 | - <el-table-column prop="answerCorrectRate" label="已答总正确率" align="center"><template slot-scope="scoped">{{ | ||
28 | - scoped.row.answerCorrectRate }}%</template> | 33 | + <el-table |
34 | + :data="tableData" | ||
35 | + border | ||
36 | + :show-header="total > 0" | ||
37 | + style="width: 100%" | ||
38 | + > | ||
39 | + <el-table-column align="center" width="48"> | ||
40 | + <template slot-scope="scope"> | ||
41 | + <el-checkbox | ||
42 | + v-model="multipleSelection" | ||
43 | + :label="scope.row.id" | ||
44 | + :disabled="checkboxDisabled(scope.row)" | ||
45 | + ><span></span | ||
46 | + ></el-checkbox> | ||
47 | + </template> | ||
48 | + </el-table-column> | ||
49 | + <el-table-column | ||
50 | + prop="subjectName" | ||
51 | + label="科目" | ||
52 | + align="center" | ||
53 | + width="80" | ||
54 | + ></el-table-column> | ||
55 | + <el-table-column | ||
56 | + prop="title" | ||
57 | + label="课时名称" | ||
58 | + align="center" | ||
59 | + ></el-table-column> | ||
60 | + <el-table-column | ||
61 | + prop="participationRate" | ||
62 | + label="总参与度" | ||
63 | + align="center" | ||
64 | + > | ||
65 | + <template slot-scope="scoped" | ||
66 | + >{{ scoped.row.participationRate }}%</template | ||
67 | + ></el-table-column | ||
68 | + > | ||
69 | + <el-table-column | ||
70 | + prop="answerCorrectRate" | ||
71 | + label="已答总正确率" | ||
72 | + align="center" | ||
73 | + ><template slot-scope="scoped" | ||
74 | + >{{ scoped.row.answerCorrectRate }}%</template | ||
75 | + > | ||
29 | </el-table-column> | 76 | </el-table-column> |
30 | - <el-table-column prop="classCorrectRate" label="班级总正确率" align="center"><template slot-scope="scoped">{{ | ||
31 | - scoped.row.classCorrectRate }}%</template></el-table-column> | ||
32 | - <el-table-column prop="questionNum" label="题目总数" align="center"></el-table-column> | ||
33 | - <el-table-column prop="startTime" label="上课时间" align="center"></el-table-column> | 77 | + <el-table-column |
78 | + prop="classCorrectRate" | ||
79 | + label="班级总正确率" | ||
80 | + align="center" | ||
81 | + ><template slot-scope="scoped" | ||
82 | + >{{ scoped.row.classCorrectRate }}%</template | ||
83 | + ></el-table-column | ||
84 | + > | ||
85 | + <el-table-column | ||
86 | + prop="questionNum" | ||
87 | + label="题目总数" | ||
88 | + align="center" | ||
89 | + ></el-table-column> | ||
90 | + <el-table-column | ||
91 | + prop="startTime" | ||
92 | + label="上课时间" | ||
93 | + align="center" | ||
94 | + ></el-table-column> | ||
34 | <el-table-column label="操作" align="center" width="100"> | 95 | <el-table-column label="操作" align="center" width="100"> |
35 | <template slot-scope="scoped"> | 96 | <template slot-scope="scoped"> |
36 | <template v-if="scoped.row.answerNum == 0"> | 97 | <template v-if="scoped.row.answerNum == 0"> |
37 | - <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="设置答案" placement="top"> | ||
38 | - <el-button type="primary" circle size="mini" icon="fa fa-file-text" | ||
39 | - @click="edit(scoped.row)"></el-button> | 98 | + <el-tooltip |
99 | + v-if="role != 'ROLE_BANZHUREN'" | ||
100 | + effect="dark" | ||
101 | + content="设置答案" | ||
102 | + placement="top" | ||
103 | + > | ||
104 | + <el-button | ||
105 | + type="primary" | ||
106 | + circle | ||
107 | + size="mini" | ||
108 | + icon="fa fa-file-text" | ||
109 | + @click="edit(scoped.row)" | ||
110 | + ></el-button> | ||
40 | </el-tooltip> | 111 | </el-tooltip> |
41 | <template v-else>未设置答案</template> | 112 | <template v-else>未设置答案</template> |
42 | </template> | 113 | </template> |
43 | <el-tooltip v-else effect="dark" content="详情" placement="top"> | 114 | <el-tooltip v-else effect="dark" content="详情" placement="top"> |
44 | - <el-button type="primary" circle size="mini" icon="fa fa-arrow-right" | ||
45 | - @click="linkToDetail(scoped.row, 1)"></el-button> | 115 | + <el-button |
116 | + type="primary" | ||
117 | + circle | ||
118 | + size="mini" | ||
119 | + icon="fa fa-arrow-right" | ||
120 | + @click="linkToDetail(scoped.row, 1)" | ||
121 | + ></el-button> | ||
46 | </el-tooltip> | 122 | </el-tooltip> |
47 | - <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="删除" placement="top"> | ||
48 | - <el-button type="primary" circle size="mini" icon="el-icon-delete" | ||
49 | - @click="remove(scoped.row)"></el-button> | 123 | + <el-tooltip |
124 | + v-if="role != 'ROLE_BANZHUREN'" | ||
125 | + effect="dark" | ||
126 | + content="删除" | ||
127 | + placement="top" | ||
128 | + > | ||
129 | + <el-button | ||
130 | + type="primary" | ||
131 | + circle | ||
132 | + size="mini" | ||
133 | + icon="el-icon-delete" | ||
134 | + @click="remove(scoped.row)" | ||
135 | + ></el-button> | ||
50 | </el-tooltip> | 136 | </el-tooltip> |
51 | </template> | 137 | </template> |
52 | </el-table-column> | 138 | </el-table-column> |
53 | </el-table> | 139 | </el-table> |
54 | </div> | 140 | </div> |
55 | <div class="pagination-box"> | 141 | <div class="pagination-box"> |
56 | - <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total" | ||
57 | - @current-change="changePage" :current-page="page" :page-size="size"> | 142 | + <el-pagination |
143 | + small="" | ||
144 | + layout="total,prev, pager, next" | ||
145 | + :hide-on-single-page="true" | ||
146 | + :total="total" | ||
147 | + @current-change="changePage" | ||
148 | + :current-page="page" | ||
149 | + :page-size="size" | ||
150 | + > | ||
58 | </el-pagination> | 151 | </el-pagination> |
59 | </div> | 152 | </div> |
60 | </div> | 153 | </div> |
@@ -88,38 +181,40 @@ export default { | @@ -88,38 +181,40 @@ export default { | ||
88 | }, | 181 | }, |
89 | computed: { | 182 | computed: { |
90 | isDetail: function () { | 183 | isDetail: function () { |
91 | - let bol = (this.$route.name == "随堂问报表分析") ? true : false | ||
92 | - return bol | ||
93 | - } | 184 | + let bol = this.$route.name == "随堂问报表分析" ? true : false; |
185 | + return bol; | ||
186 | + }, | ||
94 | }, | 187 | }, |
95 | async created() { | 188 | async created() { |
96 | this.code = this.$store.getters.csCode; | 189 | this.code = this.$store.getters.csCode; |
97 | - this.init() | 190 | + this.init(); |
98 | }, | 191 | }, |
99 | watch: { | 192 | watch: { |
100 | "$route.query.params": function (nVal) { | 193 | "$route.query.params": function (nVal) { |
101 | let isFromAskDetail = sessionStorage.getItem("isFromAskDetail"); | 194 | let isFromAskDetail = sessionStorage.getItem("isFromAskDetail"); |
102 | if (!isFromAskDetail && nVal) { | 195 | if (!isFromAskDetail && nVal) { |
103 | - this.init() | 196 | + this.init(); |
104 | } | 197 | } |
105 | - } | 198 | + }, |
106 | }, | 199 | }, |
107 | methods: { | 200 | methods: { |
108 | //初始化 | 201 | //初始化 |
109 | init() { | 202 | init() { |
110 | - const queryData = this.$route.query.params | ||
111 | - queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' | 203 | + const queryData = this.$route.query.params; |
204 | + queryData | ||
205 | + ? (this.query = { ...this.query, ...JSON.parse(queryData) }) | ||
206 | + : ""; | ||
112 | this.role = | 207 | this.role = |
113 | this.$store.getters.info.showRole || | 208 | this.$store.getters.info.showRole || |
114 | this.$store.getters.info.permissions[0].role; | 209 | this.$store.getters.info.permissions[0].role; |
115 | if (this.role != "ROLE_PERSONAL") { | 210 | if (this.role != "ROLE_PERSONAL") { |
116 | - this._QueryGdClass() | ||
117 | - }; | ||
118 | - this.$store.commit('setClasses', this.query.classId) | ||
119 | - this.page = 1 | ||
120 | - this.total = 0 | ||
121 | - this.tableData = [] | ||
122 | - this._QueryData() | 211 | + this._QueryGdClass(); |
212 | + } | ||
213 | + this.$store.commit("setClasses", this.query.classId); | ||
214 | + this.page = 1; | ||
215 | + this.total = 0; | ||
216 | + this.tableData = []; | ||
217 | + this._QueryData(); | ||
123 | }, | 218 | }, |
124 | //归档 | 219 | //归档 |
125 | toArchiving() { | 220 | toArchiving() { |
@@ -127,8 +222,23 @@ export default { | @@ -127,8 +222,23 @@ export default { | ||
127 | path: "/askArchiving", | 222 | path: "/askArchiving", |
128 | }); | 223 | }); |
129 | }, | 224 | }, |
130 | - handleSelectionChange(val) { | ||
131 | - this.multipleSelection = val; | 225 | + // 班主任教学班不能与行政班汇总 |
226 | + checkboxDisabled(obj) { | ||
227 | + if (this.role == "ROLE_BANZHUREN") { | ||
228 | + let id = this.multipleSelection[0] || ""; | ||
229 | + if (id) { | ||
230 | + let classId; | ||
231 | + for (let i = 0; i < this.tableData.length; i++) { | ||
232 | + if (this.tableData[i].id == id) { | ||
233 | + classId = this.tableData[i].classId; | ||
234 | + break; | ||
235 | + } | ||
236 | + } | ||
237 | + return obj.classId == classId ? false : true; | ||
238 | + } else { | ||
239 | + return false; | ||
240 | + } | ||
241 | + } | ||
132 | }, | 242 | }, |
133 | //去详情 | 243 | //去详情 |
134 | linkToDetail(obj, types) { | 244 | linkToDetail(obj, types) { |
@@ -146,21 +256,27 @@ export default { | @@ -146,21 +256,27 @@ export default { | ||
146 | //去详情 | 256 | //去详情 |
147 | linkToDetail2() { | 257 | linkToDetail2() { |
148 | if (this.multipleSelection.length == 0) { | 258 | if (this.multipleSelection.length == 0) { |
149 | - this.$message.warning("未选择课时,请选择~") | ||
150 | - return | 259 | + this.$message.warning("未选择课时,请选择~"); |
260 | + return; | ||
151 | } | 261 | } |
152 | - let subjectArr = [] | ||
153 | - const ids = this.multipleSelection.map(item => { | ||
154 | - subjectArr.push(item.subjectName) | ||
155 | - return item.id | ||
156 | - }) | ||
157 | - subjectArr = [...new Set(subjectArr)] | 262 | + let subjectArr = []; |
263 | + this.tableData.map((item) => { | ||
264 | + if(this.multipleSelection.includes(item.id)){ | ||
265 | + subjectArr.push(item.subjectName); | ||
266 | + } | ||
267 | + }); | ||
268 | + subjectArr = [...new Set(subjectArr)]; | ||
158 | this.$router.push({ | 269 | this.$router.push({ |
159 | path: "/askAnalysis", | 270 | path: "/askAnalysis", |
160 | query: { | 271 | query: { |
161 | - id: JSON.stringify(ids), | ||
162 | - types: this.multipleSelection.length == 1 ? 1 : subjectArr.length == 1 ? 2 : 3, | ||
163 | - subjectNames: subjectArr.join(','), | 272 | + id: JSON.stringify(this.multipleSelection), |
273 | + types: | ||
274 | + this.multipleSelection.length == 1 | ||
275 | + ? 1 | ||
276 | + : subjectArr.length == 1 | ||
277 | + ? 2 | ||
278 | + : 3, | ||
279 | + subjectNames: subjectArr.join(","), | ||
164 | params: this.$route.query.params, | 280 | params: this.$route.query.params, |
165 | className: this.$route.query.className, | 281 | className: this.$route.query.className, |
166 | }, | 282 | }, |
@@ -216,9 +332,10 @@ export default { | @@ -216,9 +332,10 @@ export default { | ||
216 | query[key] = this.query[key]; | 332 | query[key] = this.query[key]; |
217 | } | 333 | } |
218 | } | 334 | } |
219 | - const periodReportList = this.role == "ROLE_PERSONAL" ? | ||
220 | - this.$request.pPhaseInteractiveReport : | ||
221 | - this.$request.periodReportList; | 335 | + const periodReportList = |
336 | + this.role == "ROLE_PERSONAL" | ||
337 | + ? this.$request.pPhaseInteractiveReport | ||
338 | + : this.$request.periodReportList; | ||
222 | const { data, status, info } = await periodReportList({ | 339 | const { data, status, info } = await periodReportList({ |
223 | ...query, | 340 | ...query, |
224 | page: this.page, | 341 | page: this.page, |
@@ -242,11 +359,12 @@ export default { | @@ -242,11 +359,12 @@ export default { | ||
242 | } | 359 | } |
243 | } | 360 | } |
244 | this.exportLoading = true; | 361 | this.exportLoading = true; |
245 | - let exportData = this.role == "ROLE_BANZHUREN" ? | ||
246 | - this.$request.cTExportPhaseInteractiveReport : | ||
247 | - this.role == "ROLE_PERSONAL" ? | ||
248 | - this.$request.pExportPhaseReport : | ||
249 | - this.$request.exportPhaseInteractiveReport; | 362 | + let exportData = |
363 | + this.role == "ROLE_BANZHUREN" | ||
364 | + ? this.$request.cTExportPhaseInteractiveReport | ||
365 | + : this.role == "ROLE_PERSONAL" | ||
366 | + ? this.$request.pExportPhaseReport | ||
367 | + : this.$request.exportPhaseInteractiveReport; | ||
250 | const data = await exportData({ ...query }); | 368 | const data = await exportData({ ...query }); |
251 | this.exportLoading = false; | 369 | this.exportLoading = false; |
252 | if (data) { | 370 | if (data) { |
src/views/basic/test/list.vue
@@ -23,8 +23,8 @@ | @@ -23,8 +23,8 @@ | ||
23 | </template> | 23 | </template> |
24 | </back-box> | 24 | </back-box> |
25 | <div v-show="!isDetail" class="table-box" v-loading="loading"> | 25 | <div v-show="!isDetail" class="table-box" v-loading="loading"> |
26 | - <div v-if="!isMultipleClass"> | ||
27 | - <p class="btn-box"> | 26 | + <div> |
27 | + <p v-if="!isMultipleClass" class="btn-box"> | ||
28 | <el-button type="primary" round @click="linkToDetail2" | 28 | <el-button type="primary" round @click="linkToDetail2" |
29 | >查看汇总报表</el-button | 29 | >查看汇总报表</el-button |
30 | > | 30 | > |
@@ -34,116 +34,153 @@ | @@ -34,116 +34,153 @@ | ||
34 | :max-height="tableMaxHeight" | 34 | :max-height="tableMaxHeight" |
35 | border | 35 | border |
36 | style="width: 100%" | 36 | style="width: 100%" |
37 | - @selection-change="handleSelectionChange" | ||
38 | > | 37 | > |
39 | - <el-table-column width="36" v-if="role == 'ROLE_BANZHUREN'"> | ||
40 | - <template slot-scope="scope"> | ||
41 | - <el-checkbox | ||
42 | - v-model="multipleSelection" | ||
43 | - :label="scope.row.id" | ||
44 | - :disabled="checkboxDisabled(scope.row)" | ||
45 | - ><span></span | ||
46 | - ></el-checkbox> | ||
47 | - </template> | ||
48 | - </el-table-column> | ||
49 | - <el-table-column type="selection" width="40" v-else></el-table-column> | ||
50 | - <el-table-column | ||
51 | - prop="subjectName" | ||
52 | - label="科目" | ||
53 | - align="center" | ||
54 | - ></el-table-column> | ||
55 | - <el-table-column | ||
56 | - prop="className" | ||
57 | - label="班级" | ||
58 | - align="center" | ||
59 | - ></el-table-column> | ||
60 | - <el-table-column | ||
61 | - prop="title" | ||
62 | - label="试卷名称" | ||
63 | - align="center" | ||
64 | - ></el-table-column> | ||
65 | - <el-table-column | ||
66 | - prop="examPaperScore" | ||
67 | - label="卷面分" | ||
68 | - align="center" | ||
69 | - ></el-table-column> | ||
70 | - <el-table-column label="测验人数/班级人数" align="center"> | ||
71 | - <template slot-scope="scoped">{{ | ||
72 | - `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` | ||
73 | - }}</template> | ||
74 | - </el-table-column> | ||
75 | - <el-table-column | ||
76 | - prop="examStartTime" | ||
77 | - label="测验开始时间" | ||
78 | - align="center" | ||
79 | - ></el-table-column> | ||
80 | - <el-table-column label="操作" align="center"> | ||
81 | - <template slot-scope="scoped"> | ||
82 | - <el-tooltip | ||
83 | - v-if="scoped.row.answerNum != 0 || scoped.row.recordStatus != 0" | ||
84 | - effect="dark" | ||
85 | - content="详情" | ||
86 | - placement="top" | ||
87 | - > | 38 | + <template v-if="isMultipleClass"> |
39 | + <el-table-column | ||
40 | + prop="subjectName" | ||
41 | + label="科目" | ||
42 | + align="center" | ||
43 | + ></el-table-column> | ||
44 | + <el-table-column prop="classList" label="班级" align="center"> | ||
45 | + <template slot-scope="scoped"> | ||
46 | + <span v-for="(item, index) in scoped.row.classNames">{{ | ||
47 | + `${index == 0 ? "" : "/"}` + item | ||
48 | + }}</span> | ||
49 | + </template> | ||
50 | + </el-table-column> | ||
51 | + <el-table-column | ||
52 | + prop="title" | ||
53 | + label="试卷名称" | ||
54 | + align="center" | ||
55 | + ></el-table-column> | ||
56 | + <el-table-column | ||
57 | + prop="examPaperScore" | ||
58 | + label="卷面分" | ||
59 | + align="center" | ||
60 | + ></el-table-column> | ||
61 | + <el-table-column label="操作" align="center"> | ||
62 | + <template slot-scope="scoped"> | ||
88 | <el-button | 63 | <el-button |
89 | type="primary" | 64 | type="primary" |
90 | circle | 65 | circle |
91 | size="mini" | 66 | size="mini" |
92 | - icon="fa fa-arrow-right" | ||
93 | - @click="linkTo(scoped.row)" | 67 | + icon="el-icon-arrow-right" |
68 | + @click="linkContrast(scoped.row)" | ||
94 | ></el-button> | 69 | ></el-button> |
95 | - </el-tooltip> | ||
96 | - <template v-if="scoped.row.answerNum == 0"> | 70 | + </template> |
71 | + </el-table-column> | ||
72 | + </template> | ||
73 | + <template v-if="!isMultipleClass"> | ||
74 | + <el-table-column width="48"> | ||
75 | + <template slot-scope="scope"> | ||
76 | + <el-checkbox | ||
77 | + v-model="multipleSelection" | ||
78 | + :label="scope.row.id" | ||
79 | + :disabled="checkboxDisabled(scope.row)" | ||
80 | + ><span></span | ||
81 | + ></el-checkbox> | ||
82 | + </template> | ||
83 | + </el-table-column> | ||
84 | + <el-table-column | ||
85 | + prop="subjectName" | ||
86 | + label="科目" | ||
87 | + align="center" | ||
88 | + ></el-table-column> | ||
89 | + <el-table-column | ||
90 | + prop="className" | ||
91 | + label="班级" | ||
92 | + align="center" | ||
93 | + ></el-table-column> | ||
94 | + <el-table-column | ||
95 | + prop="title" | ||
96 | + label="试卷名称" | ||
97 | + align="center" | ||
98 | + ></el-table-column> | ||
99 | + <el-table-column | ||
100 | + prop="examPaperScore" | ||
101 | + label="卷面分" | ||
102 | + align="center" | ||
103 | + ></el-table-column> | ||
104 | + <el-table-column label="测验人数/班级人数" align="center"> | ||
105 | + <template slot-scope="scoped">{{ | ||
106 | + `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` | ||
107 | + }}</template> | ||
108 | + </el-table-column> | ||
109 | + <el-table-column | ||
110 | + prop="examStartTime" | ||
111 | + label="测验开始时间" | ||
112 | + align="center" | ||
113 | + ></el-table-column> | ||
114 | + <el-table-column label="操作" align="center"> | ||
115 | + <template slot-scope="scoped"> | ||
97 | <el-tooltip | 116 | <el-tooltip |
98 | - v-if="role != 'ROLE_BANZHUREN'" | 117 | + v-if=" |
118 | + scoped.row.answerNum != 0 || scoped.row.recordStatus != 0 | ||
119 | + " | ||
99 | effect="dark" | 120 | effect="dark" |
100 | - content="设置答案" | 121 | + content="详情" |
101 | placement="top" | 122 | placement="top" |
102 | > | 123 | > |
103 | <el-button | 124 | <el-button |
104 | type="primary" | 125 | type="primary" |
105 | circle | 126 | circle |
106 | size="mini" | 127 | size="mini" |
107 | - icon="fa fa-file-text" | ||
108 | - @click="edit(scoped.row)" | 128 | + icon="fa fa-arrow-right" |
129 | + @click="linkTo(scoped.row)" | ||
109 | ></el-button> | 130 | ></el-button> |
110 | </el-tooltip> | 131 | </el-tooltip> |
111 | - <template v-else>未设置答案</template> | ||
112 | - </template> | ||
113 | - <!-- <el-tooltip v-else effect="dark" content="答卷录分" placement="top"> | 132 | + <template v-if="scoped.row.answerNum == 0"> |
133 | + <el-tooltip | ||
134 | + v-if="role != 'ROLE_BANZHUREN'" | ||
135 | + effect="dark" | ||
136 | + content="设置答案" | ||
137 | + placement="top" | ||
138 | + > | ||
139 | + <el-button | ||
140 | + type="primary" | ||
141 | + circle | ||
142 | + size="mini" | ||
143 | + icon="fa fa-file-text" | ||
144 | + @click="edit(scoped.row)" | ||
145 | + ></el-button> | ||
146 | + </el-tooltip> | ||
147 | + <template v-else>未设置答案</template> | ||
148 | + </template> | ||
149 | + <!-- <el-tooltip v-else effect="dark" content="答卷录分" placement="top"> | ||
114 | <el-button type="primary" circle size="mini" @click="openScoreSet(scoped.row)">分</el-button> | 150 | <el-button type="primary" circle size="mini" @click="openScoreSet(scoped.row)">分</el-button> |
115 | </el-tooltip> --> | 151 | </el-tooltip> --> |
116 | - <el-tooltip | ||
117 | - v-else | ||
118 | - effect="dark" | ||
119 | - content="答卷录分" | ||
120 | - placement="top" | ||
121 | - > | ||
122 | - <el-button | ||
123 | - type="primary" | ||
124 | - circle | ||
125 | - size="mini" | ||
126 | - @click="openScoreSet(scoped.row)" | ||
127 | - >分</el-button | 152 | + <el-tooltip |
153 | + v-else | ||
154 | + effect="dark" | ||
155 | + content="答卷录分" | ||
156 | + placement="top" | ||
128 | > | 157 | > |
129 | - </el-tooltip> | ||
130 | - <el-popconfirm | ||
131 | - v-if="role != 'ROLE_BANZHUREN'" | ||
132 | - title="确定删除吗?" | ||
133 | - @confirm="removeReport(scoped.row, scoped.$index)" | ||
134 | - > | ||
135 | - <el-button | ||
136 | - class="remove-test" | ||
137 | - slot="reference" | ||
138 | - type="danger" | ||
139 | - circle | ||
140 | - size="mini" | ||
141 | - icon="el-icon-delete" | ||
142 | - :loading="scoped.row.loading" | ||
143 | - ></el-button> | ||
144 | - </el-popconfirm> | ||
145 | - </template> | ||
146 | - </el-table-column> | 158 | + <el-button |
159 | + type="primary" | ||
160 | + circle | ||
161 | + size="mini" | ||
162 | + @click="openScoreSet(scoped.row)" | ||
163 | + >分</el-button | ||
164 | + > | ||
165 | + </el-tooltip> | ||
166 | + <el-popconfirm | ||
167 | + v-if="role != 'ROLE_BANZHUREN'" | ||
168 | + title="确定删除吗?" | ||
169 | + @confirm="removeReport(scoped.row, scoped.$index)" | ||
170 | + > | ||
171 | + <el-button | ||
172 | + class="remove-test" | ||
173 | + slot="reference" | ||
174 | + type="danger" | ||
175 | + circle | ||
176 | + size="mini" | ||
177 | + icon="el-icon-delete" | ||
178 | + :loading="scoped.row.loading" | ||
179 | + ></el-button> | ||
180 | + </el-popconfirm> | ||
181 | + </template> | ||
182 | + </el-table-column> | ||
183 | + </template> | ||
147 | </el-table> | 184 | </el-table> |
148 | <div class="pagination-box"> | 185 | <div class="pagination-box"> |
149 | <el-pagination | 186 | <el-pagination |
@@ -167,60 +204,6 @@ | @@ -167,60 +204,6 @@ | ||
167 | @closeScoreSet="closeScoreSet" | 204 | @closeScoreSet="closeScoreSet" |
168 | /> | 205 | /> |
169 | </div> | 206 | </div> |
170 | - <div v-else> | ||
171 | - <el-table | ||
172 | - :data="tableData" | ||
173 | - :max-height="tableMaxHeight" | ||
174 | - border | ||
175 | - style="width: 100%" | ||
176 | - > | ||
177 | - <el-table-column | ||
178 | - prop="subjectName" | ||
179 | - label="科目" | ||
180 | - align="center" | ||
181 | - ></el-table-column> | ||
182 | - <el-table-column prop="classList" label="班级" align="center"> | ||
183 | - <template slot-scope="scoped"> | ||
184 | - <span v-for="(item, index) in scoped.row.classNames">{{ | ||
185 | - `${index == 0 ? "" : "/"}` + item | ||
186 | - }}</span> | ||
187 | - </template> | ||
188 | - </el-table-column> | ||
189 | - <el-table-column | ||
190 | - prop="title" | ||
191 | - label="试卷名称" | ||
192 | - align="center" | ||
193 | - ></el-table-column> | ||
194 | - <el-table-column | ||
195 | - prop="examPaperScore" | ||
196 | - label="卷面分" | ||
197 | - align="center" | ||
198 | - ></el-table-column> | ||
199 | - <el-table-column label="操作" align="center"> | ||
200 | - <template slot-scope="scoped"> | ||
201 | - <el-button | ||
202 | - type="primary" | ||
203 | - circle | ||
204 | - size="mini" | ||
205 | - icon="el-icon-arrow-right" | ||
206 | - @click="linkContrast(scoped.row)" | ||
207 | - ></el-button> | ||
208 | - </template> | ||
209 | - </el-table-column> | ||
210 | - </el-table> | ||
211 | - <div class="pagination-box"> | ||
212 | - <el-pagination | ||
213 | - small="" | ||
214 | - layout="total,prev, pager, next" | ||
215 | - :hide-on-single-page="true" | ||
216 | - :total="total" | ||
217 | - @current-change="changePage" | ||
218 | - :current-page="page" | ||
219 | - :page-size="size" | ||
220 | - > | ||
221 | - </el-pagination> | ||
222 | - </div> | ||
223 | - </div> | ||
224 | </div> | 207 | </div> |
225 | <router-view v-show="isDetail"></router-view> | 208 | <router-view v-show="isDetail"></router-view> |
226 | </div> | 209 | </div> |
@@ -380,18 +363,20 @@ export default { | @@ -380,18 +363,20 @@ export default { | ||
380 | }, | 363 | }, |
381 | // 班主任教学班不能与行政班汇总 | 364 | // 班主任教学班不能与行政班汇总 |
382 | checkboxDisabled(obj) { | 365 | checkboxDisabled(obj) { |
383 | - let id = this.multipleSelection[0] || ""; | ||
384 | - if (id) { | ||
385 | - let classId; | ||
386 | - for (let i = 0; i < this.tableData.length; i++) { | ||
387 | - if (this.tableData[i].id == id) { | ||
388 | - classId = this.tableData[i].classId; | ||
389 | - break; | 366 | + if (this.role == "ROLE_BANZHUREN") { |
367 | + let id = this.multipleSelection[0] || ""; | ||
368 | + if (id) { | ||
369 | + let classId; | ||
370 | + for (let i = 0; i < this.tableData.length; i++) { | ||
371 | + if (this.tableData[i].id == id) { | ||
372 | + classId = this.tableData[i].classId; | ||
373 | + break; | ||
374 | + } | ||
390 | } | 375 | } |
376 | + return obj.classId == classId ? false : true; | ||
377 | + } else { | ||
378 | + return false; | ||
391 | } | 379 | } |
392 | - return obj.classId == classId ? false : true; | ||
393 | - } else { | ||
394 | - return false; | ||
395 | } | 380 | } |
396 | }, | 381 | }, |
397 | handleSelectionChange(val) { | 382 | handleSelectionChange(val) { |
@@ -478,17 +463,12 @@ export default { | @@ -478,17 +463,12 @@ export default { | ||
478 | this.loading = false; | 463 | this.loading = false; |
479 | if (status === 0) { | 464 | if (status === 0) { |
480 | if (this.role == "ROLE_BANZHUREN") { | 465 | if (this.role == "ROLE_BANZHUREN") { |
466 | + this.isMultipleClass = false; | ||
481 | this.tableData = (data?.list && [...data?.list]) || []; | 467 | this.tableData = (data?.list && [...data?.list]) || []; |
482 | this.total = data?.count || 0; | 468 | this.total = data?.count || 0; |
483 | } else { | 469 | } else { |
484 | - this.isMultipleClass = true; | ||
485 | - let classArr = []; | ||
486 | - data?.list?.map((item) => { | ||
487 | - if (!classArr.includes(item.classId)) { | ||
488 | - classArr.push(item.classId); | ||
489 | - } | ||
490 | - }); | ||
491 | - if (classArr.length > 1) { | 470 | + if (this.query.classId.length > 1) { |
471 | + this.isMultipleClass = true; | ||
492 | //多班级 | 472 | //多班级 |
493 | let tableObj = {}; | 473 | let tableObj = {}; |
494 | data?.list?.map((item) => { | 474 | data?.list?.map((item) => { |
@@ -528,6 +508,7 @@ export default { | @@ -528,6 +508,7 @@ export default { | ||
528 | } | 508 | } |
529 | }); | 509 | }); |
530 | } else { | 510 | } else { |
511 | + this.isMultipleClass = false; | ||
531 | this.tableData = (data?.list && [...data?.list]) || []; | 512 | this.tableData = (data?.list && [...data?.list]) || []; |
532 | this.total = data?.count || 0; | 513 | this.total = data?.count || 0; |
533 | } | 514 | } |