Commit a4074db88677f07c0c8a33562f006cd0a2e185e1
1 parent
3a9aa32b
使用分析,集团管理元交互
Showing
4 changed files
with
125 additions
and
18 deletions
src/components/charts/barChart.vue
| @@ -116,6 +116,9 @@ export default { | @@ -116,6 +116,9 @@ export default { | ||
| 116 | this.chart?.clear(); | 116 | this.chart?.clear(); |
| 117 | this.chart.setOption(options, true); | 117 | this.chart.setOption(options, true); |
| 118 | }, | 118 | }, |
| 119 | + clearChart(){ | ||
| 120 | + this.chart?.clear(); | ||
| 121 | + }, | ||
| 119 | }, | 122 | }, |
| 120 | }; | 123 | }; |
| 121 | </script> | 124 | </script> |
src/views/standard/analysis/index.vue
| @@ -4,10 +4,22 @@ | @@ -4,10 +4,22 @@ | ||
| 4 | <template slot="title"> | 4 | <template slot="title"> |
| 5 | <span>使用分析</span> | 5 | <span>使用分析</span> |
| 6 | </template> | 6 | </template> |
| 7 | + <template slot="btns"> | ||
| 8 | + <el-tooltip effect="dark" content="导出报表" placement="bottom"> | ||
| 9 | + <el-button | ||
| 10 | + type="primary" | ||
| 11 | + icon="fa fa-cloud-download" | ||
| 12 | + size="mini" | ||
| 13 | + plain | ||
| 14 | + circle | ||
| 15 | + @click="downExc" | ||
| 16 | + ></el-button> | ||
| 17 | + </el-tooltip> | ||
| 18 | + </template> | ||
| 7 | </back-box> | 19 | </back-box> |
| 8 | <div class="page-content"> | 20 | <div class="page-content"> |
| 9 | <ul class="params-box"> | 21 | <ul class="params-box"> |
| 10 | - <li class="item"> | 22 | + <li class="item item3"> |
| 11 | <span class="s-txt">时间段:</span> | 23 | <span class="s-txt">时间段:</span> |
| 12 | <div class="sel-box"> | 24 | <div class="sel-box"> |
| 13 | <div class="d1"> | 25 | <div class="d1"> |
| @@ -54,6 +66,15 @@ | @@ -54,6 +66,15 @@ | ||
| 54 | > | 66 | > |
| 55 | </p> | 67 | </p> |
| 56 | </div> | 68 | </div> |
| 69 | + <el-button | ||
| 70 | + class="btn" | ||
| 71 | + v-if="role == 'ROLE_JITUAN'" | ||
| 72 | + type="primary" | ||
| 73 | + round | ||
| 74 | + size="small" | ||
| 75 | + @click="resetRank" | ||
| 76 | + >使用频率排名</el-button | ||
| 77 | + > | ||
| 57 | </li> | 78 | </li> |
| 58 | <li class="item item2" v-for="(item, index) in query.secGraClaSub"> | 79 | <li class="item item2" v-for="(item, index) in query.secGraClaSub"> |
| 59 | <span class="s-txt">对比项{{ setBigNum(index) }}:</span> | 80 | <span class="s-txt">对比项{{ setBigNum(index) }}:</span> |
| @@ -76,16 +97,22 @@ | @@ -76,16 +97,22 @@ | ||
| 76 | <span class="s-txt"></span> | 97 | <span class="s-txt"></span> |
| 77 | <div class="disflex-b"> | 98 | <div class="disflex-b"> |
| 78 | <el-button | 99 | <el-button |
| 79 | - v-show="query.secGraClaSub.length < 10" | ||
| 80 | - class="btn" | 100 | + class="btn btn-none" |
| 101 | + :class="query.secGraClaSub.length < 10 ? '' : 'active'" | ||
| 81 | icon="el-icon-plus" | 102 | icon="el-icon-plus" |
| 82 | size="small" | 103 | size="small" |
| 83 | round | 104 | round |
| 84 | @click="addQuery" | 105 | @click="addQuery" |
| 85 | >添加对比项</el-button | 106 | >添加对比项</el-button |
| 86 | > | 107 | > |
| 87 | - <el-button class="btn" round size="small" @click="getData" | ||
| 88 | - >确定</el-button | 108 | + <el-button |
| 109 | + v-show="query.secGraClaSub.length" | ||
| 110 | + class="btn" | ||
| 111 | + type="primary" | ||
| 112 | + round | ||
| 113 | + size="small" | ||
| 114 | + @click="getData" | ||
| 115 | + >多项对比</el-button | ||
| 89 | > | 116 | > |
| 90 | </div> | 117 | </div> |
| 91 | </li> | 118 | </li> |
| @@ -99,7 +126,7 @@ | @@ -99,7 +126,7 @@ | ||
| 99 | 126 | ||
| 100 | <script> | 127 | <script> |
| 101 | import barChart from "@/components/charts/barChart"; | 128 | import barChart from "@/components/charts/barChart"; |
| 102 | -import { formatDate } from "@/utils"; | 129 | +import { formatDate, downloadFile } from "@/utils"; |
| 103 | export default { | 130 | export default { |
| 104 | components: { | 131 | components: { |
| 105 | barChart, | 132 | barChart, |
| @@ -180,10 +207,35 @@ export default { | @@ -180,10 +207,35 @@ export default { | ||
| 180 | this.query.startDay = formatDate(new Date(), "yyyy-MM-dd"); | 207 | this.query.startDay = formatDate(new Date(), "yyyy-MM-dd"); |
| 181 | this.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); | 208 | this.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); |
| 182 | } | 209 | } |
| 183 | - this.setDate(4); | 210 | + this.setDate(3); |
| 184 | this._QueryData(); | 211 | this._QueryData(); |
| 185 | }, | 212 | }, |
| 186 | methods: { | 213 | methods: { |
| 214 | + async downExc() { | ||
| 215 | + if (this.exportLoading == true) return; | ||
| 216 | + let query = { | ||
| 217 | + //搜索条件 | ||
| 218 | + startDay: this.query.startDay, | ||
| 219 | + endDay: this.query.endDay, | ||
| 220 | + day: this.query.day, | ||
| 221 | + }; | ||
| 222 | + this.exportLoading = true; | ||
| 223 | + | ||
| 224 | + const exportUsageAnalysis = | ||
| 225 | + this.role != "ROLE_JITUAN" | ||
| 226 | + ? this.$request.exportUsageAnalysis | ||
| 227 | + : this.$request.exportSchoolContrast; | ||
| 228 | + const data = await exportUsageAnalysis({ ...query }); | ||
| 229 | + this.exportLoading = false; | ||
| 230 | + if (data) { | ||
| 231 | + let blob = new Blob([data], { | ||
| 232 | + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
| 233 | + }); | ||
| 234 | + downloadFile("使用分析.xlsx", blob); | ||
| 235 | + } else { | ||
| 236 | + this.$message.error("下载失败"); | ||
| 237 | + } | ||
| 238 | + }, | ||
| 187 | addQuery() { | 239 | addQuery() { |
| 188 | this.query.secGraClaSub.push([]); | 240 | this.query.secGraClaSub.push([]); |
| 189 | this.query.secGraClaSubName.push(""); | 241 | this.query.secGraClaSubName.push(""); |
| @@ -194,7 +246,7 @@ export default { | @@ -194,7 +246,7 @@ export default { | ||
| 194 | })[0]; | 246 | })[0]; |
| 195 | }, | 247 | }, |
| 196 | secGraClaSubChange(event, index) { | 248 | secGraClaSubChange(event, index) { |
| 197 | - console.log(event) | 249 | + console.log(event); |
| 198 | let txt = ""; | 250 | let txt = ""; |
| 199 | let xx = this.filterObj(this.gradeList, event[0]); | 251 | let xx = this.filterObj(this.gradeList, event[0]); |
| 200 | txt += xx.label; | 252 | txt += xx.label; |
| @@ -345,6 +397,17 @@ export default { | @@ -345,6 +397,17 @@ export default { | ||
| 345 | } | 397 | } |
| 346 | return query; | 398 | return query; |
| 347 | }, | 399 | }, |
| 400 | + async resetRank() { | ||
| 401 | + this.query.secGraClaSub = []; | ||
| 402 | + this.query.secGraClaSubName = []; | ||
| 403 | + this.chartData[0].value = []; | ||
| 404 | + this.chartData[1].value = []; | ||
| 405 | + this.xAxis = []; | ||
| 406 | + this.$refs.barChart.clearChart(); | ||
| 407 | + await this._QuerySchool(); | ||
| 408 | + await this._QueryGradeList(); | ||
| 409 | + this._QueryData(); | ||
| 410 | + }, | ||
| 348 | async _QueryData() { | 411 | async _QueryData() { |
| 349 | this.loading = true; | 412 | this.loading = true; |
| 350 | let query = this.setQuery(); | 413 | let query = this.setQuery(); |
| @@ -359,9 +422,9 @@ export default { | @@ -359,9 +422,9 @@ export default { | ||
| 359 | if (status === 0) { | 422 | if (status === 0) { |
| 360 | this.chartData[0].value = []; | 423 | this.chartData[0].value = []; |
| 361 | this.chartData[1].value = []; | 424 | this.chartData[1].value = []; |
| 362 | - this.xAxis = this.query.secGraClaSubName.map(item=>{ | ||
| 363 | - let arr = item.split('/') | ||
| 364 | - return arr[0]+'\n'+ arr.slice(1,arr.length).join('/') | 425 | + this.xAxis = this.query.secGraClaSubName.map((item) => { |
| 426 | + let arr = item.split("/"); | ||
| 427 | + return arr[0] + "\n" + arr.slice(1, arr.length).join("/"); | ||
| 365 | }); | 428 | }); |
| 366 | data?.list.map((item, index) => { | 429 | data?.list.map((item, index) => { |
| 367 | this.chartData[0].value.push(item.periodCount); | 430 | this.chartData[0].value.push(item.periodCount); |
| @@ -482,7 +545,12 @@ export default { | @@ -482,7 +545,12 @@ export default { | ||
| 482 | }, | 545 | }, |
| 483 | async _QuerySchool() { | 546 | async _QuerySchool() { |
| 484 | this.loading = true; | 547 | this.loading = true; |
| 485 | - const { data, status, info } = await this.$request.schoolList(); | 548 | + const { data, status, info } = await this.$request.schoolList({ |
| 549 | + needSort: 1, | ||
| 550 | + day: this.query.day, | ||
| 551 | + startDay: this.query.startDay, | ||
| 552 | + endDay: this.query.endDay, | ||
| 553 | + }); | ||
| 486 | this.loading = false; | 554 | this.loading = false; |
| 487 | if (status === 0) { | 555 | if (status === 0) { |
| 488 | this.schoolList = [...data.list] || []; | 556 | this.schoolList = [...data.list] || []; |
| @@ -511,11 +579,26 @@ div::-webkit-scrollbar-thumb { | @@ -511,11 +579,26 @@ div::-webkit-scrollbar-thumb { | ||
| 511 | display: flex; | 579 | display: flex; |
| 512 | justify-content: space-between; | 580 | justify-content: space-between; |
| 513 | align-items: center; | 581 | align-items: center; |
| 582 | + .btn-none { | ||
| 583 | + border: none; | ||
| 584 | + background: none; | ||
| 585 | + } | ||
| 586 | + .active { | ||
| 587 | + transform: translateX(-999999px); | ||
| 588 | + } | ||
| 589 | +} | ||
| 590 | +.item3 { | ||
| 591 | + .sel-box { | ||
| 592 | + flex: 1; | ||
| 593 | + } | ||
| 514 | } | 594 | } |
| 515 | .sel-box { | 595 | .sel-box { |
| 516 | display: flex; | 596 | display: flex; |
| 517 | align-items: center; | 597 | align-items: center; |
| 518 | flex-wrap: nowrap; | 598 | flex-wrap: nowrap; |
| 599 | + .btn { | ||
| 600 | + margin-left: 100px; | ||
| 601 | + } | ||
| 519 | .sel { | 602 | .sel { |
| 520 | width: 8%; | 603 | width: 8%; |
| 521 | min-width: 160px; | 604 | min-width: 160px; |
| @@ -591,6 +674,9 @@ div::-webkit-scrollbar-thumb { | @@ -591,6 +674,9 @@ div::-webkit-scrollbar-thumb { | ||
| 591 | .item2 { | 674 | .item2 { |
| 592 | width: 50%; | 675 | width: 50%; |
| 593 | } | 676 | } |
| 677 | + .item3 { | ||
| 678 | + padding-right: 100px; | ||
| 679 | + } | ||
| 594 | } | 680 | } |
| 595 | .chart-box { | 681 | .chart-box { |
| 596 | height: 400px; | 682 | height: 400px; |
src/views/standard/setUp/conglomerate.vue
| @@ -86,7 +86,8 @@ | @@ -86,7 +86,8 @@ | ||
| 86 | </div> | 86 | </div> |
| 87 | </div> | 87 | </div> |
| 88 | </div> | 88 | </div> |
| 89 | - <el-dialog :close-on-click-modal="false" | 89 | + <el-dialog |
| 90 | + :close-on-click-modal="false" | ||
| 90 | :title="isAdd ? '添加区域/集团' : '修改区域/集团'" | 91 | :title="isAdd ? '添加区域/集团' : '修改区域/集团'" |
| 91 | :visible.sync="diaCL" | 92 | :visible.sync="diaCL" |
| 92 | width="400" | 93 | width="400" |
| @@ -113,7 +114,12 @@ | @@ -113,7 +114,12 @@ | ||
| 113 | <el-button round @click="diaCL = false">取 消</el-button> | 114 | <el-button round @click="diaCL = false">取 消</el-button> |
| 114 | </div> | 115 | </div> |
| 115 | </el-dialog> | 116 | </el-dialog> |
| 116 | - <el-dialog :close-on-click-modal="false" title="添加管理员" :visible.sync="diaAdmin" width="400"> | 117 | + <el-dialog |
| 118 | + :close-on-click-modal="false" | ||
| 119 | + title="添加管理员" | ||
| 120 | + :visible.sync="diaAdmin" | ||
| 121 | + width="400" | ||
| 122 | + > | ||
| 117 | <el-form | 123 | <el-form |
| 118 | class="form-box" | 124 | class="form-box" |
| 119 | ref="formAdmin" | 125 | ref="formAdmin" |
| @@ -158,7 +164,12 @@ | @@ -158,7 +164,12 @@ | ||
| 158 | <el-button round @click="diaAdmin = false">取 消</el-button> | 164 | <el-button round @click="diaAdmin = false">取 消</el-button> |
| 159 | </div> | 165 | </div> |
| 160 | </el-dialog> | 166 | </el-dialog> |
| 161 | - <el-dialog :close-on-click-modal="false" title="添加学校" :visible.sync="diaSchool" width="400"> | 167 | + <el-dialog |
| 168 | + :close-on-click-modal="false" | ||
| 169 | + title="添加学校" | ||
| 170 | + :visible.sync="diaSchool" | ||
| 171 | + width="400" | ||
| 172 | + > | ||
| 162 | <el-form | 173 | <el-form |
| 163 | class="form-box" | 174 | class="form-box" |
| 164 | ref="formSchool" | 175 | ref="formSchool" |
| @@ -208,7 +219,12 @@ | @@ -208,7 +219,12 @@ | ||
| 208 | <el-button round @click="diaSchool = false">取 消</el-button> | 219 | <el-button round @click="diaSchool = false">取 消</el-button> |
| 209 | </div> | 220 | </div> |
| 210 | </el-dialog> | 221 | </el-dialog> |
| 211 | - <el-dialog :close-on-click-modal="false" title="学校信息修改" :visible.sync="diaSchool2" width="400"> | 222 | + <el-dialog |
| 223 | + :close-on-click-modal="false" | ||
| 224 | + title="学校信息修改" | ||
| 225 | + :visible.sync="diaSchool2" | ||
| 226 | + width="400" | ||
| 227 | + > | ||
| 212 | <el-form | 228 | <el-form |
| 213 | class="form-box" | 229 | class="form-box" |
| 214 | ref="formSchool2" | 230 | ref="formSchool2" |
| @@ -470,6 +486,7 @@ export default { | @@ -470,6 +486,7 @@ export default { | ||
| 470 | this.loading = true; | 486 | this.loading = true; |
| 471 | const { data, status, info } = await this.$request.schoolList({ | 487 | const { data, status, info } = await this.$request.schoolList({ |
| 472 | regionId: this.showId, | 488 | regionId: this.showId, |
| 489 | + needCount: 1, | ||
| 473 | }); | 490 | }); |
| 474 | this.loading = false; | 491 | this.loading = false; |
| 475 | if (status === 0) { | 492 | if (status === 0) { |
src/views/standard/setUp/teacher.vue
| @@ -45,6 +45,7 @@ | @@ -45,6 +45,7 @@ | ||
| 45 | class="sel sel2" | 45 | class="sel sel2" |
| 46 | clearable | 46 | clearable |
| 47 | placeholder="选择范围" | 47 | placeholder="选择范围" |
| 48 | + @change="_QueryData(1)" | ||
| 48 | v-model="query.gradeClassSub" | 49 | v-model="query.gradeClassSub" |
| 49 | :options="gradeClassSubList" | 50 | :options="gradeClassSubList" |
| 50 | :props="{ | 51 | :props="{ |
| @@ -93,9 +94,9 @@ | @@ -93,9 +94,9 @@ | ||
| 93 | @click="_QueryData(3)" | 94 | @click="_QueryData(3)" |
| 94 | ></el-button> | 95 | ></el-button> |
| 95 | </el-input> | 96 | </el-input> |
| 96 | - <el-button class="serach-box" round @click="_QueryData(1)" | 97 | + <!-- <el-button class="serach-box" round @click="_QueryData(4)" |
| 97 | >筛选</el-button | 98 | >筛选</el-button |
| 98 | - > | 99 | + > --> |
| 99 | </div> | 100 | </div> |
| 100 | </div> | 101 | </div> |
| 101 | <p class="total" v-if="teacherList.length"> | 102 | <p class="total" v-if="teacherList.length"> |