SuperAdmin.vue 13 KB

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