SuperAdmin.vue 15 KB

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