SuperAdmin.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <!-- 活动解析 -->
  2. <template>
  3. <div>
  4. <!-- table 表格 -->
  5. <el-row :gutter="20" class="main-items" >
  6. <!--数据监控-->
  7. <el-col :span="20" class="main" :offset="2">
  8. <el-row :gutter="20" class="main-header">
  9. <!--<el-col :span="3">-->
  10. <div class="main-header-item" >注册老师数:{{getManagerList.registerTeacherCount}}人</div>
  11. <!--</el-col>-->
  12. <!--<el-col :span="3">-->
  13. <div class="main-header-item">活跃老师数:{{getManagerList.activeTeacherCount}}人</div>
  14. <!--</el-col>-->
  15. <!--<el-col :span="4">-->
  16. <div class="main-header-item">注册用户数:{{getManagerList.registerUserCount}}人</div>
  17. <!--</el-col>-->
  18. <!--<el-col :span="4">-->
  19. <div class="main-header-item">活跃用户数:{{getManagerList.activeUserCount}}人</div>
  20. <!--</el-col>-->
  21. </el-row>
  22. <el-table
  23. :data="getManagerList.list"
  24. :header-cell-class-name="tableheaderClassName"
  25. :header-cell-style="{
  26. 'background-color': '#F6F7FB',
  27. 'color': '#393939',
  28. 'font-size': '16px'
  29. }"
  30. size="medium"
  31. border
  32. >
  33. <el-table-column
  34. label="小组管理员"
  35. header-align="center"
  36. >
  37. <template slot-scope="scope">
  38. <div class="scope-list">
  39. <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
  40. <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
  41. <span class="scope-name">{{scope.row.name}}</span>
  42. </div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column
  46. prop="groupCount"
  47. label="小组人数"
  48. header-align="center"
  49. >
  50. </el-table-column>
  51. <el-table-column
  52. prop="attendanceRate"
  53. label="老师出勤率"
  54. header-align="center"
  55. ></el-table-column>
  56. <el-table-column
  57. prop="homeworkCount"
  58. label="作业批改总份数"
  59. header-align="center">
  60. </el-table-column>
  61. <el-table-column
  62. prop="homeworkPicCount"
  63. label="作业批改总张数"
  64. header-align="center"
  65. >
  66. </el-table-column>
  67. <el-table-column
  68. prop="avgTime"
  69. label="批改平均用时"
  70. header-align="center"></el-table-column>
  71. <el-table-column
  72. prop="avgMark"
  73. label="家长平均评分"
  74. header-align="center"></el-table-column>
  75. <el-table-column
  76. prop=""
  77. label="是否在线"
  78. header-align="center">
  79. <template slot-scope="scope">
  80. <span v-if="scope.$index==0&&parseInt(getManagerList.pageNo)==1">自己</span>
  81. <span v-if="scope.$index>0&&parseInt(getManagerList.pageNo)==1">{{scope.row.status}}</span>
  82. <span v-if="parseInt(getManagerList.pageNo)>1">{{scope.row.status}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="status" label="" header-align="center" width="250">
  86. <template slot-scope="scope">
  87. <el-button type="success" @click="groupDetail(scope.row.managerId)" >小组详情</el-button>
  88. <el-button type="success" plain @click="isShow(1,scope.row.managerId)" v-if="scope.$index>0">管理员详情</el-button>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- 分页显示 -->
  93. <div class="page-block" v-if="parseInt(getManagerList.pages) > 10">
  94. <el-pagination
  95. background
  96. @size-change="handleSizeChange"
  97. @current-change="pageChange"
  98. :page-sizes="[10, 20, 30, 40]"
  99. layout="total, sizes, prev, pager, next, jumper"
  100. :total= parseInt(getManagerList.pages)
  101. ></el-pagination>
  102. </div>
  103. </el-col>
  104. </el-row>
  105. <!--可分配老师-->
  106. <div class='showModel' @click="allShowModel(1)" v-if="hiddenModel"></div>
  107. <div class='model' v-if="hiddenModel">
  108. <div class='model-text'>
  109. <div class="model-manager">
  110. <div>校区管理员</div>
  111. <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(1)"></div>
  112. </div>
  113. <div class="model-items">
  114. <div class="model-items-first">
  115. <div>
  116. <img :src='BASE_URL+getManagerDetail.imgUrl' alt="" class="model-items-first-img" v-if="getManagerDetail.imgUrl">
  117. <img src="../../assets/img/user.jpg" alt="" v-if="!getManagerDetail.imgUrl" class="model-items-first-img">
  118. <div class="model-items-first-left">
  119. <div>{{getManagerDetail.name}}({{getManagerDetail.status}})</div>
  120. <div class="model-items-first-left-down">{{getManagerDetail.school}}</div>
  121. </div>
  122. </div>
  123. <div>
  124. <div class="closeTeacherID" @click="isShow(2,getManagerDetail.name)">
  125. <span class="el-icon-close">降级</span>
  126. </div>
  127. <!-- <el-button type="danger" plain round @click="isShow(2,getManagerDetail.name)" icon="el-icon-bottom">降级</el-button> -->
  128. </div>
  129. </div>
  130. <div class="model-items-other model-active" >批改科目 : {{getManagerDetail.subject}}</div>
  131. <div class="model-items-other">批改年级 :<span v-for="(v, k) of arrGrade" :key=k class="grade-name" v-show="v">{{v}}</span></div>
  132. <div class="model-items-other model-active"><span>可批改时间:</span> <el-button type="info" round v-for="(v, k) of arrPeriod" :key=k v-show="v">{{v}}</el-button></div>
  133. <div class="model-items-other">手机号 : {{getManagerDetail.phone}}</div>
  134. <div class="model-items-other model-active-last">上次登录时间 : {{getManagerDetail.lastOnlineTime}}</div>
  135. </div>
  136. </div>
  137. </div>
  138. <!--所有未批改作业-->
  139. <div class='showModel' @click="allShowModel(2)" v-if="isPigai"></div>
  140. <div class='model' v-if="isPigai">
  141. <div class='model-text'>
  142. <div class="model-text-items">
  143. <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(2)" class="model-text-items-close"></div>
  144. <div>是否要将{{superName}}老师降级为普通批改老师?</div>
  145. </div>
  146. <div class="model-btn">
  147. <div class="model-btn-items main-gay" @click="Downgrade()">是</div>
  148. <div class="model-btn-items model-grdeen" @click="allShowModel(2)">否</div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </template>
  154. <script>
  155. import { mapGetters, mapActions } from "vuex";
  156. import { IMG_BASE_URL } from '@/ImgConfig'
  157. export default {
  158. components: { },
  159. name: "actvResolveLabel",
  160. props: {},
  161. data() {
  162. return {
  163. BASE_URL:IMG_BASE_URL,
  164. hiddenModel:false,
  165. isPigai:false,
  166. managerId:'',
  167. superName:'',
  168. count:0,
  169. arrPeriod:[],
  170. arrGrade:[],
  171. ItemList: [
  172. {
  173. text:'数据监控'
  174. },
  175. {
  176. text:'当天'
  177. },
  178. {
  179. text:'当月'
  180. },
  181. ],
  182. filters: {
  183. actvNm: "",
  184. actvCrtUserId: "",
  185. actvType: "",
  186. actvSmallType: "",
  187. // 排序
  188. MaxtimeValue:"",
  189. pageNo: 1,
  190. pageSize: 10,
  191. count: 0,
  192. orderField: "",
  193. orderAD: ""
  194. }
  195. };
  196. },
  197. created() {
  198. },
  199. watch: {
  200. InfoTeacherstatues(val, oldVal) {
  201. //普通的watch监听
  202. this.teacherDetailFun();
  203. },
  204. },
  205. computed: {
  206. ...mapGetters(["getUser","getManagerList","getManagerDetail","InfoTeacherstatues"])
  207. },
  208. methods: {
  209. ...mapActions(["setUser"]),
  210. isShow(str,res){
  211. let _this = this;
  212. console.log(str,res)
  213. if (str == 1){
  214. _this.hiddenModel = true;
  215. _this.isPigai = false;
  216. _this.managerId = res;
  217. _this.GetManagerDetail(res)
  218. } else if (str == 2){
  219. _this.isPigai = true;
  220. _this.hiddenModel = false;
  221. _this.superName = res
  222. }
  223. },
  224. //关闭弹框
  225. allShowModel(str) {
  226. let _this = this;
  227. if (str == 1){
  228. _this.hiddenModel = false;
  229. } else if (str == 2){
  230. _this.isPigai = false;
  231. }
  232. },
  233. //时间封装
  234. formatDate: function () {
  235. let date = new Date();
  236. let y = date.getFullYear();
  237. let MM = date.getMonth() + 1;
  238. MM = MM < 10 ? ('0' + MM) : MM;
  239. let d = date.getDate();
  240. d = d < 10 ? ('0' + d) : d;
  241. let h = date.getHours();
  242. h = h < 10 ? ('0' + h) : h;
  243. let m = date.getMinutes();
  244. m = m < 10 ? ('0' + m) : m;
  245. let s = date.getSeconds();
  246. s = s < 10 ? ('0' + s) : s;
  247. return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
  248. },
  249. // 获取超级管理员数据
  250. async SuperManagerList() {
  251. this.$store.dispatch("SuperManagerList", {
  252. maxCreateTime: this.formatDate(),
  253. pageNo: this.filters.pageNo,
  254. pageSize: this.filters.pageSize
  255. });
  256. },
  257. // 查看校区管理员详情
  258. async GetManagerDetail(str) {
  259. this.$store.dispatch("GetManagerDetail", {
  260. managerId: str
  261. });
  262. },
  263. async teacherDetailFun(){
  264. console.log(this.getManagerDetail)
  265. var arr = this.getManagerDetail.grade.split(",");
  266. this.arrPeriod = this.getManagerDetail.period.split(",");
  267. console.log(this.arrPeriod)
  268. var arrList = [];
  269. for (var i in arr) {
  270. if (arr[i] == "一年级" || arr[i] == "二年级") {
  271. arrList.push("1-2年级");
  272. } else if (arr[i] == "三年级" || arr[i] == "四年级") {
  273. arrList.push("3-4年级");
  274. } else if (arr[i] == "五年级" || arr[i] == "六年级") {
  275. arrList.push("5-6年级");
  276. }
  277. }
  278. this.arrGrade = this.uniq(arrList) || [];
  279. },
  280. //校区管理员降级
  281. async Downgrade() {
  282. this.$store.dispatch("Downgrade", {
  283. managerId: this.managerId
  284. });
  285. this.SuperManagerList();
  286. this.allShowModel(2)
  287. },
  288. //小组详情
  289. groupDetail(str){
  290. this.$router.push({
  291. path: "/super/SuperSchoolManager",
  292. query: {
  293. managerId: str
  294. }
  295. })
  296. },
  297. // 表格头部样式
  298. tableheaderClassName({ row, rowIndex }) {
  299. return "table-head-th";
  300. },
  301. cellStyle:function (row, column, rowIndex, columnIndex) {
  302. console.log(row)
  303. if (row.column.label === "小组管理员") {
  304. return 'font-size:30px'
  305. } else {
  306. return ''
  307. }
  308. },
  309. // 分页
  310. pageChange(val) {
  311. this.filters.pageNo = val;
  312. this.SuperManagerList();
  313. },
  314. changeDateSlot(dateSlot) {
  315. if (dateSlot) {
  316. this.filters.startDate = dateSlot[0];
  317. this.filters.endDate = dateSlot[1];
  318. } else {
  319. this.filters.startDate = null;
  320. this.filters.endDate = null;
  321. }
  322. },
  323. actvTypeChange(typeList) {
  324. switch (typeList.length) {
  325. case 1:
  326. this.filters.actvType = typeList[0];
  327. this.filters.actvSmallType = null;
  328. break;
  329. case 2:
  330. this.filters.actvType = null;
  331. this.filters.actvSmallType = typeList[1];
  332. break;
  333. default:
  334. this.filters.actvType = null;
  335. this.filters.actvSmallType = null;
  336. break;
  337. }
  338. },
  339. handleSizeChange(val) {
  340. this.filters.pageSize = val;
  341. this.SuperManagerList();
  342. },
  343. // 排序
  344. sortChange(sort) {
  345. this.filters.orderField = sort.prop;
  346. this.filters.orderAD = sort.order != null ? sort.order : "";
  347. this.itemListReshow();
  348. },
  349. clearSearch() {
  350. this.filters.actvNm = null;
  351. this.filters.actvCrtUserId = null;
  352. this.filters.actvType = null;
  353. this.filters.actvSmallType = null;
  354. this.filtersActvType = [];
  355. this.createDateSlot = null;
  356. },
  357. // 数组去重
  358. uniq(array){
  359. var temp = []; //一个新的临时数组
  360. for (var i = 0; i < array.length; i++){
  361. if (temp.indexOf(array[i]) == -1) {
  362. temp.push(array[i]);
  363. }
  364. }
  365. return temp;
  366. }
  367. },
  368. mounted() {
  369. sessionStorage.setItem('tabIndex',0)
  370. this.SuperManagerList()
  371. }
  372. };
  373. </script>
  374. <!-- Add "scoped" attribute to limit CSS to this component only -->
  375. <style scoped>
  376. .main{
  377. background-color: #fff;
  378. margin-top: 16px;
  379. padding: 0 !important;
  380. border: 1px solid #E1E1E1;
  381. min-height: 980px;
  382. }
  383. el-table{
  384. color: #999999;
  385. font-size: 18px;
  386. }
  387. .main-items{
  388. color: #393939;
  389. /*text-align: center;*/
  390. line-height: 80px;
  391. }
  392. .main-header-item{
  393. font-size: 16px;
  394. color: #7E7E7E;
  395. text-overflow: ellipsis;
  396. /*vertical-align: middle;*/
  397. text-align: center;
  398. display: inline-block;
  399. width: 20%;
  400. }
  401. .input-with-select .el-input-group__prepend {
  402. background-color: #fff;
  403. }
  404. .el-pagination.is-background .el-pager li:not(.disabled).active {
  405. background-color:#52cc60!important;
  406. color: #fff;
  407. }
  408. .table-img{
  409. width:36px;
  410. height:36px;
  411. border-radius:6px;
  412. }
  413. .showModel{
  414. width: 100%;
  415. height: 100%;
  416. position: fixed;
  417. top: 0;
  418. left: 0;
  419. background: #000000;
  420. opacity: 0.2;
  421. overflow: hidden;
  422. z-index: 1000;
  423. color: #fff;
  424. }
  425. .model{
  426. z-index: 1001;
  427. width:40%;
  428. height:auto;
  429. position: fixed;
  430. top: 30%;
  431. left: 30%;
  432. margin:auto;
  433. background: #fff;
  434. border-radius:10px;
  435. text-align: center;
  436. }
  437. .model-items-first{
  438. padding: 0 34px;
  439. display: flex;
  440. justify-content: space-between;
  441. }
  442. .model-items-first-img{
  443. width: 68px;
  444. height: 68px;
  445. border-radius: 8px;
  446. position: relative;
  447. bottom: 20px;
  448. }
  449. .model-items-first-left{
  450. display: inline-block;
  451. color: #393939;
  452. font-size: 24px;
  453. margin-left: 14px;
  454. text-align: left;
  455. }
  456. .model-items-first-left-down{
  457. color: #7E7E7E;
  458. font-size: 18px;
  459. }
  460. .model-text{
  461. background:rgba(255,255,255,1);
  462. border-radius:10px;
  463. }
  464. .model-items-other{
  465. height: 60px;
  466. line-height: 60px;
  467. color: #393939;
  468. font-size: 20px;
  469. text-align: left;
  470. padding: 0 34px;
  471. }
  472. .model-active{
  473. background-color: #F6F7FB;
  474. }
  475. .model-active-last{
  476. border-radius:0 0 10px 10px;
  477. background-color: #F6F7FB;
  478. }
  479. .model-manager{
  480. display: flex;
  481. justify-content: space-between;
  482. margin: 30px;
  483. color: #393939;
  484. font-size: 24px;
  485. }
  486. .model-btn{
  487. display: flex;
  488. justify-content: space-around;
  489. margin-bottom: 44px;
  490. }
  491. .model-btn-items{
  492. width:154px;
  493. height:50px;
  494. line-height: 50px;
  495. text-align: center;
  496. font-size: 18px;
  497. border-radius:4px;
  498. }
  499. .main-gay{
  500. background:rgba(246,247,251,1);
  501. color: #7E7E7E;
  502. }
  503. .model-grdeen{
  504. background-color: #52CC60;
  505. color: #fff;
  506. }
  507. .model-text-items-close{
  508. position: absolute;
  509. top: 10px;
  510. right: 15px;
  511. }
  512. .model-text-items{
  513. position: relative;
  514. color: #000000;
  515. font-size: 24px;
  516. text-align: center;
  517. padding: 40px 0 50px 0;
  518. }
  519. .scope-name{
  520. margin-left: 5%;
  521. color: #393939;
  522. font-size: 13px;
  523. }
  524. .grade-name{
  525. color: #393939;
  526. font-size: 16px;
  527. margin:0 10px;
  528. }
  529. .page-block{
  530. text-align: center !important;
  531. margin-top: 15px;
  532. }
  533. .scope-list{
  534. margin-left: 5%;
  535. text-align: left;
  536. }
  537. .noBorderBottom{
  538. border-bottom: none;
  539. }
  540. .el-table .table-head-th{
  541. background-color:#F6F7FB;
  542. font-size: 16px !important;
  543. color: #393939;
  544. }
  545. .closeTeacherID {
  546. display: inline-block;
  547. height: 40px;
  548. width: 100px;
  549. color: #f56c6c;
  550. background: #fef0f0;
  551. border-color: #fbc4c4;
  552. border-radius: 20px;
  553. font-size: 14px;
  554. line-height: 40px;
  555. cursor: pointer;
  556. border: 1px solid;
  557. }
  558. .closeTeacherID:hover {
  559. color: #fff;
  560. background-color: #f56c6c;
  561. border-color: #f56c6c;
  562. }
  563. </style>