Commit a37317f42412f394d3886a95f5c527d9639d2c75
1 parent
0a4de034
使用分析,发卡记录
Showing
7 changed files
with
473 additions
and
18 deletions
src/api/apis/apis.js
src/api/urls/apis.js
src/views/analysis/index.vue
| 1 | 1 | <template> |
| 2 | - <div>使用分析</div> | |
| 2 | + <div> | |
| 3 | + <back-box> | |
| 4 | + <template slot="title"> | |
| 5 | + <span>使用分析</span> | |
| 6 | + </template> | |
| 7 | + </back-box> | |
| 8 | + <div class="page-content"> | |
| 9 | + <div class="answer-header"> | |
| 10 | + <div class="sel-box"> | |
| 11 | + <el-select | |
| 12 | + class="sel" | |
| 13 | + v-model="query.gradeName" | |
| 14 | + placeholder="选择年级" | |
| 15 | + @change="_QueryData(1)" | |
| 16 | + > | |
| 17 | + <el-option | |
| 18 | + v-for="item in gradeList" | |
| 19 | + :key="item.value" | |
| 20 | + :label="item.label" | |
| 21 | + :value="item.value" | |
| 22 | + > | |
| 23 | + </el-option> | |
| 24 | + </el-select> | |
| 25 | + <div class="d1"> | |
| 26 | + <el-date-picker | |
| 27 | + v-model="query.startDay" | |
| 28 | + type="date" | |
| 29 | + @change="handleChangeTimeStart" | |
| 30 | + placeholder="选择日期时间" | |
| 31 | + value-format="yyyy-MM-dd" | |
| 32 | + > | |
| 33 | + </el-date-picker> | |
| 34 | + ~ | |
| 35 | + <el-date-picker | |
| 36 | + v-model="query.endDay" | |
| 37 | + type="date" | |
| 38 | + placeholder="选择日期时间" | |
| 39 | + @change="handleChangeTimeEnd" | |
| 40 | + value-format="yyyy-MM-dd" | |
| 41 | + > | |
| 42 | + </el-date-picker> | |
| 43 | + </div> | |
| 44 | + <p class="p1"> | |
| 45 | + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']" | |
| 46 | + >今天</span | |
| 47 | + > | |
| 48 | + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']" | |
| 49 | + >本周</span | |
| 50 | + > | |
| 51 | + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']" | |
| 52 | + >本月</span | |
| 53 | + > | |
| 54 | + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']" | |
| 55 | + >本季度</span | |
| 56 | + > | |
| 57 | + </p> | |
| 58 | + <el-button type="primary" round @click="_QueryData()">筛选</el-button> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <div class="table-box"> | |
| 62 | + <div class="radio-box" v-if="this.$store.getters.info.showRoleName == '集团管理员'"> | |
| 63 | + <el-radio-group v-model="type" @change="changeType"> | |
| 64 | + <el-radio-button :label="1">学校使用对比</el-radio-button> | |
| 65 | + <el-radio-button :label="2">学段使用对比</el-radio-button> | |
| 66 | + </el-radio-group> | |
| 67 | + </div> | |
| 68 | + <el-table | |
| 69 | + :data="tableData" | |
| 70 | + :border="false" | |
| 71 | + style="width: 100%" | |
| 72 | + show-summary | |
| 73 | + > | |
| 74 | + <el-table-column align="center" label="科目" prop="sub"> | |
| 75 | + </el-table-column> | |
| 76 | + <el-table-column | |
| 77 | + align="center" | |
| 78 | + v-for="(item, index) in dataList" | |
| 79 | + :key="index" | |
| 80 | + :label="item.name" | |
| 81 | + > | |
| 82 | + <template> | |
| 83 | + <el-table-column | |
| 84 | + :prop="'keshi' + index" | |
| 85 | + label="课时数" | |
| 86 | + align="center" | |
| 87 | + ></el-table-column> | |
| 88 | + <el-table-column | |
| 89 | + :prop="'celian' + index" | |
| 90 | + label="测练数" | |
| 91 | + align="center" | |
| 92 | + ></el-table-column> | |
| 93 | + </template> | |
| 94 | + </el-table-column> | |
| 95 | + </el-table> | |
| 96 | + <p | |
| 97 | + class="down" | |
| 98 | + v-if="this.$store.getters.info.showRoleName != '集团管理员'" | |
| 99 | + > | |
| 100 | + <el-button plain round icon="fa fa-cloud-download" | |
| 101 | + >导出报表</el-button | |
| 102 | + > | |
| 103 | + </p> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 3 | 107 | </template> |
| 4 | 108 | |
| 5 | 109 | <script> |
| 110 | +import { formatDate } from "@/utils"; | |
| 6 | 111 | export default { |
| 112 | + data() { | |
| 113 | + return { | |
| 114 | + date: "", //今天-本周-本月-本季度 | |
| 115 | + type:1, //集团管理员 表格切换 | |
| 116 | + query: { | |
| 117 | + //搜索条件 | |
| 118 | + gradeName: "", | |
| 119 | + startDay: "", | |
| 120 | + endDay: "", | |
| 121 | + day: "", | |
| 122 | + }, | |
| 123 | + gradeList: [], | |
| 124 | + tableData: [ | |
| 125 | + { | |
| 126 | + sub: "科目一", | |
| 127 | + keshi0: 1, | |
| 128 | + celian0: 1, | |
| 129 | + keshi1: 2, | |
| 130 | + celian1: 2, | |
| 131 | + }, | |
| 132 | + { | |
| 133 | + sub: "科目一", | |
| 134 | + keshi0: 3, | |
| 135 | + celian0: 4, | |
| 136 | + keshi1: 5, | |
| 137 | + celian1: 6, | |
| 138 | + }, | |
| 139 | + ], | |
| 140 | + dataList: [ | |
| 141 | + //table循环用数据 | |
| 142 | + { | |
| 143 | + name: "初一", | |
| 144 | + keshi: 1, | |
| 145 | + celian: 1, | |
| 146 | + }, | |
| 147 | + { | |
| 148 | + name: "初二", | |
| 149 | + keshi: 2, | |
| 150 | + celian: 2, | |
| 151 | + }, | |
| 152 | + ], | |
| 153 | + }; | |
| 154 | + }, | |
| 155 | + created() { | |
| 156 | + this._QueryDataGrade(); | |
| 157 | + // this.setDate(1); | |
| 158 | + let startDay = this.query?.startDay; | |
| 159 | + if (!startDay) { | |
| 160 | + this.query.startDay = new Date(); | |
| 161 | + this.query.endDay = new Date(); | |
| 162 | + } | |
| 163 | + }, | |
| 164 | + methods: { | |
| 165 | + changeType(val){ | |
| 166 | + // this._QueryData(val) | |
| 167 | + }, | |
| 168 | + setDate(index) { | |
| 169 | + const that = this; | |
| 170 | + this.date = index == this.date ? "" : index; | |
| 171 | + let aYear = new Date().getFullYear(); | |
| 172 | + let aMonth = new Date().getMonth() + 1; | |
| 173 | + that.query.day = ""; | |
| 174 | + that.query.startDay = ""; | |
| 175 | + that.query.endDay = ""; | |
| 176 | + switch (index) { | |
| 177 | + case 1: | |
| 178 | + that.query.day = formatDate(new Date(), "yyyy-MM-dd"); | |
| 179 | + that.query.startDay = that.query.day; | |
| 180 | + that.query.endDay = that.query.day; | |
| 181 | + break; | |
| 182 | + case 2: | |
| 183 | + let day = new Date().getDay(); | |
| 184 | + if (day == 0) { | |
| 185 | + //中国式星期天是一周的最后一天 | |
| 186 | + day = 7; | |
| 187 | + } | |
| 188 | + let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day; | |
| 189 | + that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd"); | |
| 190 | + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); | |
| 191 | + break; | |
| 192 | + case 3: | |
| 193 | + aMonth = aMonth < 10 ? "0" + aMonth : aMonth; | |
| 194 | + that.query.startDay = `${aYear}-${aMonth}-01`; | |
| 195 | + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); | |
| 196 | + break; | |
| 197 | + case 4: | |
| 198 | + if (aMonth > 1 && aMonth < 4) { | |
| 199 | + aMonth = "01"; | |
| 200 | + } else if (aMonth > 3 && aMonth < 7) { | |
| 201 | + aMonth = "04"; | |
| 202 | + } else if (aMonth > 6 && aMonth < 10) { | |
| 203 | + aMonth = "07"; | |
| 204 | + } else { | |
| 205 | + aMonth = "10"; | |
| 206 | + } | |
| 7 | 207 | |
| 8 | -} | |
| 208 | + aMonth = aMonth < 10 ? "0" + aMonth : aMonth; | |
| 209 | + that.query.startDay = `${aYear}-${aMonth}-01`; | |
| 210 | + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); | |
| 211 | + break; | |
| 212 | + } | |
| 213 | + this.page = 1; | |
| 214 | + this._QueryData(); | |
| 215 | + }, | |
| 216 | + handleChangeTimeStart(val) { | |
| 217 | + this.query.day = ""; | |
| 218 | + this.date = ""; | |
| 219 | + if (this.query.endDay) { | |
| 220 | + if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) { | |
| 221 | + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置"); | |
| 222 | + this.query.startDay = ""; | |
| 223 | + } | |
| 224 | + } | |
| 225 | + }, | |
| 226 | + handleChangeTimeEnd(val) { | |
| 227 | + this.query.day = ""; | |
| 228 | + this.date = ""; | |
| 229 | + if (this.query.startDay) { | |
| 230 | + if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) { | |
| 231 | + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置"); | |
| 232 | + this.query.endDay = ""; | |
| 233 | + } | |
| 234 | + } | |
| 235 | + }, | |
| 236 | + async _QueryData() { | |
| 237 | + this.loading = true; | |
| 238 | + //多课时对比 | |
| 239 | + let query = {}; | |
| 240 | + for (let key in this.query) { | |
| 241 | + if (this.query[key] != "") { | |
| 242 | + query[key] = this.query[key]; | |
| 243 | + } | |
| 244 | + } | |
| 245 | + const { data, status, info } = await this.$request.fetchQuizList({ | |
| 246 | + ...query, | |
| 247 | + }); | |
| 248 | + this.loading = false; | |
| 249 | + if (status === 0) { | |
| 250 | + } else { | |
| 251 | + this.$message.error(info); | |
| 252 | + } | |
| 253 | + }, | |
| 254 | + async _QueryDataGrade() { | |
| 255 | + //年级数据 | |
| 256 | + const { data, status, info } = await this.$request.gradeList(); | |
| 257 | + if (status === 0) { | |
| 258 | + this.gradeList = | |
| 259 | + data.list?.map((item) => { | |
| 260 | + return { | |
| 261 | + value: item.gradeName, | |
| 262 | + label: item.gradeName, | |
| 263 | + id: item.grade, | |
| 264 | + }; | |
| 265 | + }) || []; | |
| 266 | + this.gradeList.unshift({ | |
| 267 | + value: "", | |
| 268 | + label: "全部", | |
| 269 | + }); | |
| 270 | + this.query.gradeName = this.gradeList[0]?.value; | |
| 271 | + } else { | |
| 272 | + this.$message.error(info); | |
| 273 | + } | |
| 274 | + }, | |
| 275 | + }, | |
| 276 | +}; | |
| 9 | 277 | </script> |
| 10 | 278 | |
| 11 | -<style> | |
| 12 | - | |
| 279 | +<style lang="scss" scoped> | |
| 280 | +.table-box { | |
| 281 | + padding: 0 20px; | |
| 282 | +} | |
| 283 | +.radio-box{ | |
| 284 | + padding-bottom:12px; | |
| 285 | +} | |
| 286 | +.down { | |
| 287 | + padding-top: 20px; | |
| 288 | +} | |
| 13 | 289 | </style> |
| 14 | 290 | \ No newline at end of file | ... | ... |
src/views/card/index.vue
| 1 | 1 | <template> |
| 2 | - <div>发卡管理</div> | |
| 2 | + <div> | |
| 3 | + <back-box> | |
| 4 | + <template slot="title"> | |
| 5 | + <span>发卡记录</span> | |
| 6 | + </template> | |
| 7 | + </back-box> | |
| 8 | + <div class="page-content"> | |
| 9 | + <div class="answer-header"> | |
| 10 | + <div class="sel-box"> | |
| 11 | + <el-cascader | |
| 12 | + class="sel" | |
| 13 | + collapse-tags | |
| 14 | + clearable | |
| 15 | + placeholder="选择班级" | |
| 16 | + v-model="query.classId" | |
| 17 | + :options="gradeList" | |
| 18 | + :props="props" | |
| 19 | + :show-all-levels="false" | |
| 20 | + ></el-cascader> | |
| 21 | + <el-input | |
| 22 | + placeholder="请输入学生姓名" | |
| 23 | + v-model="query.studentName" | |
| 24 | + class="input-with-select" | |
| 25 | + @keyup.enter.native="_QueryData(2)" | |
| 26 | + > | |
| 27 | + <el-button | |
| 28 | + slot="append" | |
| 29 | + icon="el-icon-search" | |
| 30 | + @click="_QueryData(1)" | |
| 31 | + ></el-button> | |
| 32 | + </el-input> | |
| 33 | + <el-input | |
| 34 | + placeholder="请输入学生学号" | |
| 35 | + v-model="query.studentCode" | |
| 36 | + class="input-with-select" | |
| 37 | + @keyup.enter.native="_QueryData(3)" | |
| 38 | + > | |
| 39 | + <el-button | |
| 40 | + slot="append" | |
| 41 | + icon="el-icon-search" | |
| 42 | + @click="_QueryData(2)" | |
| 43 | + ></el-button> | |
| 44 | + </el-input> | |
| 45 | + <el-button type="primary" round @click="_QueryData(1)" | |
| 46 | + >筛选</el-button | |
| 47 | + > | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + <div class="table-box"> | |
| 51 | + <el-table :data="tableData" border style="width: 100%"> | |
| 52 | + <el-table-column | |
| 53 | + align="center" | |
| 54 | + label="答题器编码" | |
| 55 | + prop="sn" | |
| 56 | + ></el-table-column> | |
| 57 | + <el-table-column | |
| 58 | + align="center" | |
| 59 | + label="班级" | |
| 60 | + prop="className" | |
| 61 | + ></el-table-column> | |
| 62 | + <el-table-column | |
| 63 | + align="center" | |
| 64 | + label="学生姓名" | |
| 65 | + prop="studentName" | |
| 66 | + ></el-table-column> | |
| 67 | + <el-table-column | |
| 68 | + align="center" | |
| 69 | + label="学号" | |
| 70 | + prop="studentId" | |
| 71 | + ></el-table-column> | |
| 72 | + <el-table-column | |
| 73 | + align="center" | |
| 74 | + label="类型" | |
| 75 | + prop="type" | |
| 76 | + ></el-table-column> | |
| 77 | + <el-table-column | |
| 78 | + align="center" | |
| 79 | + label="描述" | |
| 80 | + prop="desc" | |
| 81 | + ></el-table-column> | |
| 82 | + <el-table-column | |
| 83 | + align="center" | |
| 84 | + label="操作时间" | |
| 85 | + prop="time" | |
| 86 | + ></el-table-column> | |
| 87 | + </el-table> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + </div> | |
| 3 | 91 | </template> |
| 4 | 92 | |
| 5 | 93 | <script> |
| 6 | 94 | export default { |
| 7 | - | |
| 8 | -} | |
| 95 | + data() { | |
| 96 | + return { | |
| 97 | + props: { multiple: true, checkStrictly: false }, | |
| 98 | + query: { | |
| 99 | + classId: [], | |
| 100 | + studentName: "", | |
| 101 | + studentCode: "", | |
| 102 | + }, | |
| 103 | + gradeList: [], | |
| 104 | + tableData: [ | |
| 105 | + { | |
| 106 | + sn: 2543641, | |
| 107 | + className: "xxx", | |
| 108 | + studentName: "xxxx", | |
| 109 | + studentId: 563456, | |
| 110 | + type: "换卡", | |
| 111 | + desc: "xxxxx", | |
| 112 | + time: "20:00:00", | |
| 113 | + }, | |
| 114 | + ], | |
| 115 | + }; | |
| 116 | + }, | |
| 117 | + created() { | |
| 118 | + this._QueryGradeList(); | |
| 119 | + }, | |
| 120 | + methods: { | |
| 121 | + // 查找班级 | |
| 122 | + async _QueryGradeList() { | |
| 123 | + this.loading = true; | |
| 124 | + const { data, status, info } = await this.$request.gradeList(); | |
| 125 | + console.log(status); | |
| 126 | + if (status === 0) { | |
| 127 | + if (!!data.list) { | |
| 128 | + this.gradeList = | |
| 129 | + data.list?.map((item) => { | |
| 130 | + let gradeList = { | |
| 131 | + value: item.grade, | |
| 132 | + label: item.gradeName, | |
| 133 | + }; | |
| 134 | + gradeList.children = | |
| 135 | + item.classList?.map((items) => { | |
| 136 | + return { | |
| 137 | + value: items.classCode, | |
| 138 | + label: items.className, | |
| 139 | + }; | |
| 140 | + }) || []; | |
| 141 | + return gradeList; | |
| 142 | + }) || []; | |
| 143 | + } | |
| 144 | + } else { | |
| 145 | + this.$message.error(info); | |
| 146 | + } | |
| 147 | + }, | |
| 148 | + async _QueryData(type) { | |
| 149 | + let query = {}; | |
| 150 | + query.gradeName = this.query.gradeName; | |
| 151 | + query.classId = this.query.classId; | |
| 152 | + if (type == 1) { | |
| 153 | + query.classId = this.query.classId; | |
| 154 | + this.query.studentCode = ""; | |
| 155 | + this.query.studentName = ""; | |
| 156 | + } else if (type == 2) { | |
| 157 | + query.studentName = this.query.studentName; | |
| 158 | + this.query.classId = ""; | |
| 159 | + this.query.studentCode = ""; | |
| 160 | + } else if (type == 3) { | |
| 161 | + query.studentCode = this.query.studentCode; | |
| 162 | + this.query.classId = ""; | |
| 163 | + this.query.studentName = ""; | |
| 164 | + } | |
| 165 | + this.loading = true; | |
| 166 | + const { data, status, info } = await this.$request.cardList({ | |
| 167 | + ...query, | |
| 168 | + }); | |
| 169 | + this.loading = false; | |
| 170 | + console.log(status); | |
| 171 | + if (status === 0) { | |
| 172 | + this.tableData = data.list || []; | |
| 173 | + } else { | |
| 174 | + this.$message.error(info); | |
| 175 | + } | |
| 176 | + }, | |
| 177 | + }, | |
| 178 | +}; | |
| 9 | 179 | </script> |
| 10 | 180 | |
| 11 | -<style> | |
| 12 | - | |
| 181 | +<style lang="scss" scoped> | |
| 182 | +.table-box{ | |
| 183 | + padding:0 20px; | |
| 184 | +} | |
| 13 | 185 | </style> |
| 14 | 186 | \ No newline at end of file | ... | ... |
src/views/device/index.vue
| ... | ... | @@ -296,7 +296,7 @@ |
| 296 | 296 | :show-all-levels="false" |
| 297 | 297 | @change="_QueryData(false)" |
| 298 | 298 | ></el-cascader> |
| 299 | - <span class="sel">共选择5个授课端</span> | |
| 299 | + <span class="sel">共选择{{selectionTabIds.length}}个授课端</span> | |
| 300 | 300 | <el-button plan round @click="autoUpDate(false)" |
| 301 | 301 | >开启自动更新</el-button |
| 302 | 302 | > |
| ... | ... | @@ -612,6 +612,7 @@ export default { |
| 612 | 612 | this.loadingUpDate = false; |
| 613 | 613 | if (data && !data.code) { |
| 614 | 614 | this._QueryData(false); |
| 615 | + this.selectionTabIds = [] | |
| 615 | 616 | this.$message.success("开启自动更新成功"); |
| 616 | 617 | } else { |
| 617 | 618 | this.$message.error(data.message); |
| ... | ... | @@ -630,6 +631,7 @@ export default { |
| 630 | 631 | }); |
| 631 | 632 | this.loadingUpDate = false; |
| 632 | 633 | if (data && !data.code) { |
| 634 | + this.selectionTabIds = [] | |
| 633 | 635 | this._QueryData(false); |
| 634 | 636 | this.$message.success("关闭自动更新成功"); |
| 635 | 637 | } else { | ... | ... |
src/views/setUp/student.vue
src/views/setUp/teacher.vue
| ... | ... | @@ -225,7 +225,7 @@ |
| 225 | 225 | :rules="rulesTeacher" |
| 226 | 226 | label-width="160px" |
| 227 | 227 | > |
| 228 | - <el-form-item v-show="isAdd || (!isAdd && setTercherType == 2)" label="教师姓名:"> | |
| 228 | + <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:"> | |
| 229 | 229 | <span>{{formTeacher.teacherName}}</span> |
| 230 | 230 | </el-form-item> |
| 231 | 231 | <el-form-item |
| ... | ... | @@ -426,6 +426,7 @@ export default { |
| 426 | 426 | this.teacherDetail = { ...obj }; |
| 427 | 427 | }, |
| 428 | 428 | editTeacher(type) { |
| 429 | + this.diaTeacher = true; | |
| 429 | 430 | this.setTercherType = type |
| 430 | 431 | this.isAdd = false; |
| 431 | 432 | for (let key in this.teacherDetail) { |
| ... | ... | @@ -436,7 +437,6 @@ export default { |
| 436 | 437 | } |
| 437 | 438 | } |
| 438 | 439 | this.toTeacherForm(); |
| 439 | - this.diaTeacher = true; | |
| 440 | 440 | }, |
| 441 | 441 | addTeacher() { |
| 442 | 442 | //添加教师 |
| ... | ... | @@ -526,12 +526,6 @@ export default { |
| 526 | 526 | //教师角色数据转换为form格式数据 |
| 527 | 527 | this.formTeacher.roleList = []; |
| 528 | 528 | this.formTeacher.managerList?.map((item) => { |
| 529 | - console.log( | |
| 530 | - this.classList.find( | |
| 531 | - (items) => | |
| 532 | - items.value == item.classId || items.label == item.className | |
| 533 | - ) | |
| 534 | - ); | |
| 535 | 529 | this.formTeacher.roleList.push({ |
| 536 | 530 | id: randomWord(true, 16, 20), |
| 537 | 531 | roleId: 6, | ... | ... |