group.vue 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378
  1. <template>
  2. <div>
  3. <div style="overflow: auto">
  4. <div class="g_d_btnBox">
  5. <!-- <div class="btn_left" v-if="type == 1 || type == 4">
  6. <div @click="setClassid('1')" :class="{ active: classid == '1' }" v-if="!classList.length">全部</div>
  7. <div @click="setClassid(item.id)" :class="{ active: classid == item.id }"
  8. v-for="(item, index) in classList" :key="index">{{ item.name }}</div>
  9. </div>
  10. <div class="btn_left" v-if="type == 2">
  11. <div @click="setClassid('1')" :class="{ active: classid == '1' }" v-if="!classList.length">全部</div>
  12. <div @click="setClassid(item.id)" :class="{ active: classid == item.id }"
  13. v-for="(item, index) in classList" :key="index">{{ item.name }}</div>
  14. </div> -->
  15. <div></div>
  16. <!-- || (courseDetail.course_teacher && courseDetail.course_teacher.indexOf(userid) != -1) -->
  17. <div class="btn_right"
  18. v-if="courseDetail.userid == userid">
  19. <div style="color: rgb(171 171 171); margin: 0 10px 0 0" v-show="false">
  20. 提示:开启【开放选座】,能够自由加入和退出小组。
  21. </div>
  22. <!-- 开放选座 -->
  23. <!-- <div type="primary" v-if="groupJson.islock == 1 && groupJson.group.length" class="returnBtn"
  24. style="background-color: #225bc7" @click="lockChair">
  25. 锁定位置
  26. </div>
  27. <div type="primary" v-else-if="groupJson.group.length" class="returnBtn"
  28. style="background-color: #225bc7" @click="lockChair">
  29. 解锁位置
  30. </div> -->
  31. <div class="group_switch" v-show="false">
  32. <span>开放选座</span>
  33. <el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair"></el-switch>
  34. </div>
  35. <div class="group_switch" v-show="false">
  36. <span>开启分组</span>
  37. <el-switch v-model="isopen" class="switchCss" @change="openChair"></el-switch>
  38. </div>
  39. <div type="primary" @click="updateGroup" class="returnBtn" style="background-color: #225bc7">
  40. 添加分组
  41. </div>
  42. <div type="primary" @click="deleteCourseGroup" class="returnBtn" style="background-color: #225bc7" >
  43. 删除分组
  44. </div>
  45. </div>
  46. <div class="btn_right"
  47. v-else>
  48. <div style="color: rgb(171 171 171); margin: 0 10px 0 0">
  49. 提示:开启【开放选座】,能够自由加入和退出小组。
  50. </div>
  51. <div class="group_switch">
  52. <span>开放选座</span>
  53. <el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair" disabled></el-switch>
  54. </div>
  55. </div>
  56. </div>
  57. <div style="min-height: 250px;">
  58. <div class="g_d_box" v-if="groupJson.group.length && isopen">
  59. <div class="g_d_group" v-for="(g, gindex) in groupJson.group" :key="gindex">
  60. <div class="g_d_group_chair">
  61. <div v-if="groupJson.number > 1">
  62. <span :class="{
  63. isChair:
  64. groupStudent[g.id] &&
  65. groupStudent[g.id][0],
  66. updateChair:
  67. courseDetail.userid == userid &&
  68. groupStudent[g.id] &&
  69. groupStudent[g.id][0] &&
  70. groupJson.islock == 2,
  71. }"><span class="updateChairBtn"
  72. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][0])">修改</span></span><span>{{
  73. groupStudent[g.id] &&
  74. groupStudent[g.id][0]
  75. ? groupStudent[g.id] &&
  76. groupStudent[g.id][0].name
  77. : "空位置" }}</span>
  78. </div>
  79. <div v-if="groupJson.number > 4">
  80. <span :class="{
  81. isChair:
  82. groupStudent[g.id] &&
  83. groupStudent[g.id][4],
  84. updateChair:
  85. courseDetail.userid == userid &&
  86. groupStudent[g.id] &&
  87. groupStudent[g.id][4] &&
  88. groupJson.islock == 2,
  89. }"><span class="updateChairBtn"
  90. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][4])">修改</span></span><span>{{
  91. groupStudent[g.id] &&
  92. groupStudent[g.id][4]
  93. ? groupStudent[g.id] &&
  94. groupStudent[g.id][4].name
  95. : "空位置" }}</span>
  96. </div>
  97. <div v-if="groupJson.number > 8">
  98. <span :class="{
  99. isChair:
  100. groupStudent[g.id] &&
  101. groupStudent[g.id][8],
  102. updateChair:
  103. courseDetail.userid == userid &&
  104. groupStudent[g.id] &&
  105. groupStudent[g.id][8] &&
  106. groupJson.islock == 2,
  107. }"><span class="updateChairBtn"
  108. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][8])">修改</span></span><span>{{
  109. groupStudent[g.id] &&
  110. groupStudent[g.id][8]
  111. ? groupStudent[g.id] &&
  112. groupStudent[g.id][8].name
  113. : "空位置" }}</span>
  114. </div>
  115. </div>
  116. <div class="g_d_group_tableBox">
  117. <div class="g_d_group_chair2">
  118. <div v-if="groupJson.number > 2">
  119. <span :class="{
  120. isChair:
  121. groupStudent[g.id] &&
  122. groupStudent[g.id][2],
  123. updateChair:
  124. courseDetail.userid == userid &&
  125. groupStudent[g.id] &&
  126. groupStudent[g.id][2] &&
  127. groupJson.islock == 2,
  128. }"><span class="updateChairBtn"
  129. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][2])">修改</span></span><span>{{
  130. groupStudent[g.id] &&
  131. groupStudent[g.id][2]
  132. ? groupStudent[g.id] &&
  133. groupStudent[g.id][2].name
  134. : "空位置" }}</span>
  135. </div>
  136. <div v-if="groupJson.number > 6">
  137. <span :class="{
  138. isChair:
  139. groupStudent[g.id] &&
  140. groupStudent[g.id][6],
  141. updateChair:
  142. courseDetail.userid == userid &&
  143. groupStudent[g.id] &&
  144. groupStudent[g.id][6] &&
  145. groupJson.islock == 2,
  146. }"><span class="updateChairBtn"
  147. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][6])">修改</span></span><span>{{
  148. groupStudent[g.id] &&
  149. groupStudent[g.id][6]
  150. ? groupStudent[g.id] &&
  151. groupStudent[g.id][6].name
  152. : "空位置" }}</span>
  153. </div>
  154. </div>
  155. <div class="g_d_group_table">
  156. <div>
  157. {{ g.name }}
  158. </div>
  159. <div>
  160. <!-- && groupJson.islock == 2 -->
  161. <div v-if="courseDetail.userid == userid"
  162. @click="deleteGroupChair(g.id, gindex)">
  163. 移除组员
  164. </div>
  165. <div @click="selectGroup(g.id)"
  166. v-if="groupStudentUid && groupStudentUid[g.id].indexOf(userid) == -1 && courseDetail.userid !== userid">
  167. 加入分组
  168. </div>
  169. <div @click="
  170. exitGroup(groupStudent[g.id] &&
  171. groupStudent[g.id][
  172. groupStudentUid[g.id].indexOf(userid)
  173. ].id)
  174. "
  175. v-else-if="groupStudentUid && groupStudentUid[g.id].indexOf(userid) != -1">
  176. 退出分组
  177. </div>
  178. <div style="margin-top:10px"
  179. v-if="(courseDetail.userid == userid ) && groupStudent[g.id].length < groupJson.number"
  180. @click="addGroupStudent(g.id)">
  181. 添加组员
  182. <!-- || (courseDetail.course_teacher && courseDetail.course_teacher.indexOf(userid) != -1) -->
  183. </div>
  184. </div>
  185. </div>
  186. <div class="g_d_group_chair2">
  187. <div v-if="groupJson.number > 3">
  188. <span :class="{
  189. isChair:
  190. groupStudent[g.id] &&
  191. groupStudent[g.id][3],
  192. updateChair:
  193. courseDetail.userid == userid &&
  194. groupStudent[g.id] &&
  195. groupStudent[g.id][3] &&
  196. groupJson.islock == 2,
  197. }"><span class="updateChairBtn"
  198. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][3])">修改</span></span><span>{{
  199. groupStudent[g.id] &&
  200. groupStudent[g.id][3]
  201. ? groupStudent[g.id] &&
  202. groupStudent[g.id][3].name
  203. : "空位置" }}</span>
  204. </div>
  205. <div v-if="groupJson.number > 7">
  206. <span :class="{
  207. isChair:
  208. groupStudent[g.id] &&
  209. groupStudent[g.id][7],
  210. updateChair:
  211. courseDetail.userid == userid &&
  212. groupStudent[g.id] &&
  213. groupStudent[g.id][7] &&
  214. groupJson.islock == 2,
  215. }"><span class="updateChairBtn"
  216. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][7])">修改</span></span><span>{{
  217. groupStudent[g.id] &&
  218. groupStudent[g.id][7]
  219. ? groupStudent[g.id] &&
  220. groupStudent[g.id][7].name
  221. : "空位置" }}</span>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="g_d_group_chair">
  226. <div v-if="groupJson.number > 1">
  227. <span :class="{
  228. isChair:
  229. groupStudent[g.id] &&
  230. groupStudent[g.id][1],
  231. updateChair:
  232. courseDetail.userid == userid &&
  233. groupStudent[g.id] &&
  234. groupStudent[g.id][1] &&
  235. groupJson.islock == 2,
  236. }"><span class="updateChairBtn"
  237. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][1])">修改</span></span><span>{{
  238. groupStudent[g.id] &&
  239. groupStudent[g.id][1]
  240. ? groupStudent[g.id] &&
  241. groupStudent[g.id][1].name
  242. : "空位置" }}</span>
  243. </div>
  244. <div v-if="groupJson.number > 5">
  245. <span :class="{
  246. isChair:
  247. groupStudent[g.id] &&
  248. groupStudent[g.id][5],
  249. updateChair:
  250. courseDetail.userid == userid &&
  251. groupStudent[g.id] &&
  252. groupStudent[g.id][5] &&
  253. groupJson.islock == 2,
  254. }"><span class="updateChairBtn"
  255. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][5])">修改</span></span><span>{{
  256. groupStudent[g.id] &&
  257. groupStudent[g.id][5]
  258. ? groupStudent[g.id] &&
  259. groupStudent[g.id][5].name
  260. : "空位置" }}</span>
  261. </div>
  262. <div v-if="groupJson.number > 9">
  263. <span :class="{
  264. isChair:
  265. groupStudent[g.id] &&
  266. groupStudent[g.id][9],
  267. updateChair:
  268. courseDetail.userid == userid &&
  269. groupStudent[g.id] &&
  270. groupStudent[g.id][9] &&
  271. groupJson.islock == 2,
  272. }"><span class="updateChairBtn"
  273. @click="updateGroupChair(groupStudent[g.id] && groupStudent[g.id][9])">修改</span></span><span>{{
  274. groupStudent[g.id] &&
  275. groupStudent[g.id][9]
  276. ? groupStudent[g.id] &&
  277. groupStudent[g.id][9].name
  278. : "空位置" }}</span>
  279. </div>
  280. </div>
  281. </div>
  282. </div>
  283. <div v-else-if="!groupJson.group.length" style="text-align: center;">{{ courseDetail.userid == userid ?
  284. "暂无分组,请点击右上角设置分组" :
  285. "老师暂未添加分组" }}</div>
  286. <div v-else-if="!isopen" style="text-align: center;">{{ "已关闭分组" }}</div>
  287. </div>
  288. </div>
  289. <el-dialog title="分组设置" :visible.sync="dialogVisibleGroup2" :append-to-body="true" width="650px"
  290. :before-close="handleClose" class="dialog_diy">
  291. <div class="groupBox">
  292. <div v-if="groupJson2.group" class="groupContent">
  293. <div class="groupTitle">请设置小组数量及名称</div>
  294. <div v-for="(item, index) in groupJson2.group" :key="index" class="groupName">
  295. <span class="groupn">第{{ index + 1 }}组名称:</span>
  296. <el-input v-model="item.name" placeholder="请输入名称..." style="width: 250px"></el-input>
  297. <div class="groupBtn">
  298. <el-button type="primary" size="small" @click="addGroup(index)"
  299. v-if="(groupJson2.group.length - 1) == index">
  300. 添加</el-button>
  301. <el-button type="primary" size="small" @click="deleteGroup(index)"
  302. v-if="groupJson2.group && groupJson2.group.length > 1">删除</el-button>
  303. </div>
  304. </div>
  305. <div class="batch_add_group">
  306. <span>批量添加小组:</span>
  307. <el-input-number v-model="addGroupNum" @change="handleAddGroupNumChange" label="批量添加小组"></el-input-number>
  308. </div>
  309. </div>
  310. <div class="groupContent">
  311. <div class="groupTitle">请设置每组人数</div>
  312. <el-input v-model="groupJson2.number" style="width:150px" placeholder="请输入2-10的数字"
  313. @change="numberPan"></el-input>
  314. </div>
  315. </div>
  316. <span slot="footer" class="dialog-footer">
  317. <el-button @click="dialogVisibleGroup2 = false;addGroupNum=0;">取 消</el-button>
  318. <el-button type="primary" @click="updateGroupJson(2)">确定</el-button>
  319. </span>
  320. </el-dialog>
  321. <el-dialog title="移除组员" :visible.sync="dialogVisibleDeleteGroup" :append-to-body="true" width="350px"
  322. :before-close="handleClose" class="dialog_diy">
  323. <div>
  324. <h2>
  325. {{ this.deleteGroupArray.name }}
  326. </h2>
  327. <div style="color: rgb(171 171 171); margin-top: 10px">
  328. 请选择要删除的组员
  329. </div>
  330. <el-checkbox-group v-model="checkDeleteGroup">
  331. <el-checkbox style="display: flex; margin-top: 20px" v-for="(item, index) in deleteGroupUser"
  332. :label="item.userid" :key="index">{{ item.name }}</el-checkbox>
  333. </el-checkbox-group>
  334. </div>
  335. <span slot="footer" class="dialog-footer">
  336. <el-button @click="dialogVisibleDeleteGroup = false">取 消</el-button>
  337. <el-button type="primary" @click="deleteChair">确定</el-button>
  338. </span>
  339. </el-dialog>
  340. <el-dialog title="修改分组" :visible.sync="dialogVisibleUpdateGroup" :append-to-body="true" width="350px"
  341. :before-close="handleClose" class="dialog_diy">
  342. <div>
  343. <h2>
  344. {{ this.updateGroupUser.name }}
  345. </h2>
  346. <div style="color: rgb(171 171 171); margin-top: 10px">
  347. 请选择要进入的分组
  348. </div>
  349. <el-radio-group v-model="checkChair">
  350. <el-radio style="display: block; margin-top: 20px" v-for="(item, index) in updateGroupArray"
  351. :label="item.id" :key="index">{{ item.name }}</el-radio>
  352. </el-radio-group>
  353. </div>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button @click="dialogVisibleUpdateGroup = false">取 消</el-button>
  356. <el-button type="primary" @click="updateChair">确定</el-button>
  357. </span>
  358. </el-dialog>
  359. <el-dialog title="添加组员" :visible.sync="dialogVisibleMember" :append-to-body="true" width="540px" height="80%"
  360. :before-close="handleClose" class="addNewPP" v-loading="loading">
  361. <div class="people">
  362. <div class="people_top">
  363. <div class="people_top_right">
  364. <div class="people_search">
  365. <el-input placeholder="搜索学生的姓名" v-model="searchTN" @keyup.enter.native="getStudent"></el-input>
  366. <div class="search_img" @click="getStudent">
  367. <img src="../../../../assets/icon/search.png" alt />
  368. </div>
  369. </div>
  370. </div>
  371. <div class="people_nav">选择成员</div>
  372. </div>
  373. <!-- <div class="t_j_box" style="
  374. padding: 20px 0 0 25px;
  375. width: calc(100% - 55px);
  376. margin-left: 25px;
  377. ">
  378. <span>姓名</span>
  379. <span>账号</span>
  380. </div> -->
  381. <!-- <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="classJuri.length">
  382. <el-checkbox v-for="item in classJuri" :key="item.userid" :label="item.userid">
  383. <div class="t_j_box">
  384. <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
  385. <span>{{ item.name ? item.name : "暂无姓名" }}</span>
  386. </el-tooltip>
  387. <el-tooltip placement="top" :content="item.username">
  388. <span>{{ item.username }}</span>
  389. </el-tooltip>
  390. </div>
  391. </el-checkbox>
  392. </el-checkbox-group> -->
  393. <div class="i_box_login2" v-if="classJuri.length">
  394. <div :class="{ active: checkboxList3.indexOf(item.userid) != -1 }" v-for="item in classJuri"
  395. :key="item.userid" :label="item.userid" @click="addGroupUser(item.userid)">
  396. <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
  397. <span>{{ item.name ? item.name : "暂无姓名" }}</span>
  398. </el-tooltip>
  399. </div>
  400. </div>
  401. <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
  402. </div>
  403. <!-- <div style="margin-top: 10px;">
  404. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  405. v-if="page && classJuri.length" style="padding-bottom: 20px"
  406. @current-change="handleCurrentChange"></el-pagination>
  407. </div> -->
  408. <span slot="footer" class="dialog-footer">
  409. <el-button @click="dialogVisibleMember = false">取 消</el-button>
  410. <el-button type="primary" @click="joinGroup2">确定</el-button>
  411. </span>
  412. </el-dialog>
  413. </div>
  414. </template>
  415. <script>
  416. export default {
  417. props: ['cid', 'classList', 'courseDetail', 'userid', "type", "classId", "oid", "people"],
  418. data() {
  419. return {
  420. addGroupNum:0,
  421. groupJson2: {},
  422. classid: "1",
  423. groupid: "",
  424. gid: "",
  425. groupJson: {
  426. group: [],
  427. number: undefined,
  428. islock: 1,
  429. },
  430. islock: false,
  431. isopen: true,
  432. timer: null,
  433. groupStudent: {},
  434. groupStudentUid: {},
  435. allGroupStudentUid: [],
  436. dialogVisibleGroup2: false,
  437. checkDeleteGroup: [],
  438. deleteGroupUser: [],
  439. deleteGroupArray: [],
  440. dialogVisibleDeleteGroup: false,
  441. checkChair: "",
  442. updateGroupArray: [],
  443. updateGroupUser: {},
  444. dialogVisibleUpdateGroup: false,
  445. classJuri: [],
  446. checkboxList3: [],
  447. pageSize: 20,
  448. total: 0,
  449. page: 1,
  450. dialogVisibleMember: false,
  451. searchTN: "",
  452. loading: false,
  453. }
  454. },
  455. methods: {
  456. handleAddGroupNumChange(currentValue, oldValue){
  457. let num = currentValue-oldValue;
  458. if(num>0){
  459. for(let i=0;i<num;i++){
  460. this.groupJson2.group.push({
  461. name: "第" + (this.groupJson2.group.length + 1) + "组",
  462. id: this.guid()
  463. });
  464. }
  465. }else{
  466. num=Math.abs(num);
  467. for(let i=0;i<num;i++){
  468. this.groupJson2.group.pop();
  469. }
  470. }
  471. },
  472. handleClose2(done) {
  473. this.$emit('update:dialogVisibleGroup', false)
  474. done();
  475. },
  476. handleClose(done) {
  477. this.addGroupNum=0;
  478. done();
  479. },
  480. getStudent() {
  481. this.page = 1
  482. this.selectCStudent();
  483. },
  484. handleCurrentChange(val) {
  485. this.page = val;
  486. this.selectCStudent();
  487. },
  488. selectCStudent() {
  489. // let params = {
  490. // cid: this.classid,
  491. // oid: this.oid,
  492. // cn: this.searchTN,
  493. // };
  494. // this.ajax
  495. // .get(this.$store.state.api + "selectSnameByCidGroup", params)
  496. // .then((res) => {
  497. // if (res.data && res.data[0].length) {
  498. // this.classJuri = res.data[0].filter((el) => {
  499. // return this.allGroupStudentUid.indexOf(el.userid) == -1
  500. // });
  501. // }
  502. // })
  503. // .catch((err) => {
  504. // console.error(err);
  505. // });
  506. this.loading = true
  507. let _user = JSON.parse(JSON.stringify(this.people));
  508. if (_user.indexOf(this.userid) == -1) {
  509. _user.push(this.userid);
  510. }
  511. // if(_user.indexOf(this.courseDetail.userid) == -1){
  512. // _user.push(this.courseDetail.userid);
  513. // }
  514. if(_user.indexOf(this.courseDetail.userid) !== -1){
  515. _user.splice(_user.indexOf(this.courseDetail.userid), 1);
  516. }
  517. let params = {
  518. uid: _user.join(","),
  519. };
  520. this.ajax
  521. .get(this.$store.state.api + "getAllUserById", params)
  522. .then((res) => {
  523. this.loading = false
  524. if (res.data && res.data[0].length) {
  525. this.classJuri = res.data[0].filter((el) => {
  526. return this.allGroupStudentUid.indexOf(el.userid) == -1
  527. });
  528. }
  529. })
  530. .catch((err) => {
  531. this.loading = false
  532. console.error(err);
  533. });
  534. },
  535. setClassid(cid) {
  536. this.classid = cid
  537. this.groupid = ''
  538. this.groupJson = {
  539. group: [],
  540. number: undefined,
  541. islock: 1,
  542. }
  543. this.islock = false
  544. this.isopen = true
  545. this.getCourseGroup();
  546. },
  547. guid() {
  548. var _num,
  549. i,
  550. _guid = "";
  551. for (i = 0; i < 32; i++) {
  552. _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
  553. _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
  554. if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
  555. //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  556. _guid += "-";
  557. }
  558. }
  559. return _guid;
  560. },
  561. updateGroup() {
  562. this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
  563. if (!this.groupJson2.group.length) {
  564. this.groupJson2.group.push({
  565. name: "第" + (this.groupJson2.group.length + 1) + "组",
  566. id: this.guid()
  567. });
  568. }
  569. this.dialogVisibleGroup2 = true;
  570. },
  571. deleteCourseGroup() {
  572. this.$confirm(
  573. // "您确定要删除该分组吗? 分组删除后将被清空并且无法恢复。",
  574. "是否确定删除已有分组?删除后分组数据将被清空!",
  575. "提示",
  576. {
  577. confirmButtonText: "确定",
  578. cancelButtonText: "取消",
  579. type: "warning",
  580. }
  581. )
  582. .then(() => {
  583. let params = [{
  584. gid: this.groupid,
  585. }];
  586. this.ajax
  587. .post(this.$store.state.api + "deleteCourseGroup", params)
  588. .then((res) => {
  589. this.groupJson = {
  590. group: [],
  591. number: undefined,
  592. islock: 1,
  593. }
  594. this.islock = false
  595. this.isopen = true
  596. this.$message.success("操作成功");
  597. this.getCourseGroup();
  598. this.$forceUpdate()
  599. })
  600. .catch((err) => {
  601. console.error(err);
  602. });
  603. })
  604. .catch(() => { });
  605. },
  606. addGroup() {
  607. this.groupJson2.group.push({
  608. name: "第" + (this.groupJson2.group.length + 1) + "组",
  609. id: this.guid()
  610. });
  611. },
  612. deleteGroup(i) {
  613. this.groupJson2.group.splice(i, 1);
  614. },
  615. lockChair() {
  616. this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
  617. if (this.groupJson2.isopen == 2) {
  618. this.$message.error("请开启分组后才能开放选座")
  619. this.islock = false
  620. return
  621. } else {
  622. this.groupJson2.islock = this.groupJson2.islock == 1 ? 2 : 1;
  623. }
  624. this.updateGroupJson();
  625. },
  626. numberPan() {
  627. if (/[^\d]/.test(this.groupJson2.number) || this.groupJson2.number < 2 || this.groupJson2.number > 10) {
  628. this.$message.error('请输入2-10的数字')
  629. this.groupJson2.number = ''
  630. }
  631. },
  632. openChair() {
  633. this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
  634. if (!this.groupJson2.isopen) {
  635. this.groupJson2.isopen = 2;
  636. } else {
  637. this.groupJson2.isopen = this.groupJson2.isopen == 1 ? 2 : 1;
  638. }
  639. if (this.groupJson2.isopen == 2) {
  640. this.groupJson2.islock = 2
  641. } else {
  642. this.groupJson2.islock = 1
  643. }
  644. this.updateGroupJson();
  645. },
  646. updateGroupJson(type) {
  647. for (var i = 0; i < this.groupJson2.group.length; i++) {
  648. if (!this.groupJson2.group[i].name) {
  649. this.$message.error("请将信息填写完整!");
  650. return;
  651. }
  652. }
  653. if (!this.groupJson2.number) {
  654. this.$message.error("请将信息填写完整!");
  655. return;
  656. }
  657. for (var i = 0; i < this.groupJson2.group.length; i++) {
  658. if (
  659. this.groupStudentUid[this.groupJson2.group[i].id] && this.groupStudentUid[this.groupJson2.group[i].id].length >
  660. this.groupJson2.number
  661. ) {
  662. this.$message.error("已经有小组比你设置的人数多,请重新设置");
  663. return;
  664. }
  665. }
  666. let params = [
  667. {
  668. cid: this.cid,
  669. group: JSON.stringify(this.groupJson2).replaceAll(/%/g, "%25"),
  670. classid: this.classid,
  671. },
  672. ];
  673. this.ajax
  674. .post(this.$store.state.api + "setCourseGroup", params)
  675. .then((res) => {
  676. if (this.groupJson2.isopen == 1) {
  677. if (type == 2) {
  678. this.$message.success("设置成功");
  679. } else {
  680. this.$message.success("开启分组成功");
  681. }
  682. } else if (this.groupJson2.isopen == 2) {
  683. this.$message.success("关闭分组成功");
  684. }
  685. // 开启分组成功/关闭分组成功
  686. this.dialogVisibleGroup2 = false;
  687. this.groupJson2 = {};
  688. this.getCourseGroup();
  689. this.$forceUpdate();
  690. })
  691. .catch((err) => {
  692. this.$message.error("网络不佳");
  693. console.error(err);
  694. });
  695. },
  696. getCourseGroup(gid) {
  697. let params = {
  698. cid: this.cid,
  699. classid: this.classid,
  700. };
  701. this.ajax
  702. .get(this.$store.state.api + "getCourseGroup", params)
  703. .then((res) => {
  704. if (res.data && res.data[0].length) {
  705. this.groupJson = JSON.parse(res.data[0][0].group);
  706. this.islock = this.groupJson.islock == 1 ? true : false;
  707. if (!this.groupJson.isopen) {
  708. this.isopen = true
  709. } else {
  710. this.isopen = this.groupJson.isopen == 1 ? true : false;
  711. }
  712. this.groupid = res.data[0][0].id;
  713. let groupPerson = res.data[1]
  714. let group = JSON.parse(res.data[0][0].group).group
  715. let groupStudent = {}
  716. let groupStudentUid = {}
  717. for (var i = 0; i < group.length; i++) {
  718. groupStudent[group[i].id] = []
  719. groupStudentUid[group[i].id] = []
  720. for (var j = 0; j < groupPerson.length; j++) {
  721. if (groupPerson[j].groupCid == group[i].id) {
  722. groupStudent[group[i].id].push(groupPerson[j])
  723. groupStudentUid[group[i].id].push(groupPerson[j].userid)
  724. }
  725. }
  726. }
  727. this.allGroupStudentUid = []
  728. for (var j = 0; j < groupPerson.length; j++) {
  729. this.allGroupStudentUid.push(groupPerson[j].userid)
  730. }
  731. this.groupStudent = groupStudent
  732. this.groupStudentUid = groupStudentUid
  733. this.$forceUpdate();
  734. if (gid) {
  735. this.joinGroup(gid)
  736. }
  737. }
  738. })
  739. .catch((err) => {
  740. this.$message.error("网络不佳");
  741. console.error(err);
  742. });
  743. },
  744. updateGroupChair(user) {
  745. this.updateGroupArray = this.groupJson.group.filter((el, index) => {
  746. el.label = index;
  747. return el.id != user.groupCid;
  748. });
  749. this.updateGroupUser = user;
  750. this.dialogVisibleUpdateGroup = true;
  751. },
  752. updateChair() {
  753. if (
  754. this.groupStudent[this.checkChair].length >
  755. this.groupJson.number ||
  756. this.groupStudent[this.checkChair].length ==
  757. this.groupJson.number
  758. ) {
  759. this.$message.error("位置已满,无法加入");
  760. return;
  761. }
  762. let params = [
  763. {
  764. gid: this.groupid,
  765. g: this.checkChair,
  766. uid: this.updateGroupUser.userid,
  767. },
  768. ];
  769. this.ajax
  770. .post(this.$store.state.api + "joinCourseGroup", params)
  771. .then((res) => {
  772. this.$message.success("修改成功");
  773. this.updateGroupUser = {};
  774. this.checkChair = "";
  775. this.updateGroupArray = {};
  776. this.dialogVisibleUpdateGroup = false;
  777. this.getCourseGroup();
  778. })
  779. .catch((err) => {
  780. this.$message.error("网络不佳");
  781. console.error(err);
  782. });
  783. },
  784. deleteGroupChair(gid, gindex) {
  785. this.checkDeleteGroup = [];
  786. this.deleteGroupUser = JSON.parse(
  787. JSON.stringify(this.groupStudent[gid])
  788. );
  789. this.deleteGroupArray = this.groupJson.group[gindex];
  790. this.gid = gid;
  791. this.dialogVisibleDeleteGroup = true;
  792. },
  793. async deleteChair() {
  794. for (let i = 0; i < this.checkDeleteGroup.length; i++) {
  795. const gid =
  796. this.groupStudent[this.gid][
  797. this.groupStudentUid[this.gid].indexOf(
  798. this.checkDeleteGroup[i]
  799. )
  800. ];
  801. let params = [
  802. {
  803. gid: gid.id,
  804. },
  805. ];
  806. var a = await this.deleteChairA(params);
  807. if (i == this.checkDeleteGroup.length - 1) {
  808. this.$message.success("退出成功");
  809. this.dialogVisibleDeleteGroup = false;
  810. this.deleteGroupUser = [];
  811. this.deleteGroupArray = {};
  812. this.gid = "";
  813. this.checkDeleteGroup = [];
  814. this.getCourseGroup();
  815. }
  816. }
  817. },
  818. deleteChairA(params) {
  819. return new Promise((resolve, reject) => {
  820. this.ajax
  821. .post(this.$store.state.api + "exitCourseGroup", params)
  822. .then((res) => {
  823. resolve(1);
  824. })
  825. .catch((err) => {
  826. this.$message.error("网络不佳");
  827. console.error(err);
  828. });
  829. });
  830. },
  831. selectGroup(gid) {
  832. this.getCourseGroup(gid)
  833. },
  834. joinGroup(gid) {
  835. if (this.groupJson.islock == 2) {
  836. this.$message.error("位置已被锁定,无法加入");
  837. return;
  838. }
  839. if (
  840. this.groupStudent[gid].length >
  841. this.groupJson.number ||
  842. this.groupStudent[gid].length == this.groupJson.number
  843. ) {
  844. this.$message.error("位置已满,无法加入");
  845. return;
  846. }
  847. let params = [
  848. {
  849. gid: this.groupid,
  850. g: gid,
  851. uid: this.userid,
  852. },
  853. ];
  854. this.ajax
  855. .post(this.$store.state.api + "joinCourseGroup", params)
  856. .then((res) => {
  857. this.$message.success("加入成功");
  858. this.$emit('getGroup')
  859. this.getCourseGroup();
  860. })
  861. .catch((err) => {
  862. this.$message.error("网络不佳");
  863. console.error(err);
  864. });
  865. },
  866. addGroupUser(uid) {
  867. if (this.checkboxList3.indexOf(uid) == -1) {
  868. this.checkboxList3.push(uid)
  869. } else {
  870. this.checkboxList3.splice(this.checkboxList3.indexOf(uid), 1)
  871. }
  872. },
  873. async joinGroup2() {
  874. if (
  875. this.groupStudent[this.gid].length + this.checkboxList3.length >
  876. this.groupJson.number
  877. ) {
  878. this.$message.error("位置已满,无法加入");
  879. return;
  880. }
  881. for (let i = 0; i < this.checkboxList3.length; i++) {
  882. let params = [
  883. {
  884. gid: this.groupid,
  885. g: this.gid,
  886. uid: this.checkboxList3[i],
  887. },
  888. ];
  889. const res = await this.ajax.post(this.$store.state.api + "joinCourseGroup", params)
  890. if (i == this.checkboxList3.length - 1) {
  891. this.$message.success("加入成功");
  892. this.dialogVisibleMember = false
  893. this.getCourseGroup();
  894. }
  895. }
  896. },
  897. exitGroup(id) {
  898. if (this.groupJson.islock == 2) {
  899. this.$message.error("位置已被锁定,无法退出");
  900. return;
  901. }
  902. let params = [
  903. {
  904. gid: id,
  905. },
  906. ];
  907. this.ajax
  908. .post(this.$store.state.api + "exitCourseGroup", params)
  909. .then((res) => {
  910. this.$message.success("退出成功");
  911. this.$emit('getGroup')
  912. this.getCourseGroup();
  913. })
  914. .catch((err) => {
  915. this.$message.error("网络不佳"); s
  916. console.error(err);
  917. });
  918. },
  919. addGroupStudent(groupid) {
  920. this.gid = groupid
  921. this.page = 1
  922. this.searchTN = ""
  923. this.checkboxList3 = []
  924. this.selectCStudent()
  925. this.getCourseGroup();
  926. this.dialogVisibleMember = true
  927. }
  928. },
  929. watch: {
  930. },
  931. beforeDestory() {
  932. clearInterval(this.timer)
  933. this.timer = null
  934. },
  935. mounted() {
  936. if (this.classList.length) {
  937. if (this.type == 2) {
  938. this.classList = this.classList.filter(el => {
  939. return this.classId.indexOf(el.id) != -1
  940. })
  941. this.classid = this.classList[0].id
  942. } else {
  943. this.classid = this.classList[0].id
  944. }
  945. } else {
  946. this.classid = '1'
  947. }
  948. this.setClassid(this.classid)
  949. this.getCourseGroup();
  950. // if (this.dialogVisibleGroup) {
  951. // this.getCourseGroup();
  952. this.timer = setInterval(() => {
  953. this.getCourseGroup();
  954. }, 5000)
  955. // } else {
  956. // clearInterval(this.timer)
  957. // this.timer = null
  958. // }
  959. }
  960. }
  961. </script>
  962. <style scoped>
  963. .batch_add_group{
  964. margin-top: 15px;
  965. }
  966. .dialog_diy>>>.el-dialog {
  967. margin-top: 10vh !important;
  968. }
  969. .dialog_diy>>>.el-dialog__header {
  970. background: #454545 !important;
  971. padding: 15px 20px;
  972. }
  973. .dialog_diy>>>.el-dialog__title {
  974. color: #fff;
  975. }
  976. .dialog_diy>>>.el-dialog__headerbtn {
  977. top: 19px;
  978. }
  979. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  980. color: #fff;
  981. }
  982. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  983. color: #fff;
  984. }
  985. .dialog_diy>>>.el-dialog__body,
  986. .dialog_diy>>>.el-dialog__footer {
  987. background: #fafafa;
  988. }
  989. .group_workBox {}
  990. .group_workBox+.group_workBox {
  991. margin-top: 20px;
  992. }
  993. .group_box {
  994. padding-bottom: 20px;
  995. border-bottom: 2px solid #f0f0f0;
  996. }
  997. .group_title {
  998. display: flex;
  999. align-items: center;
  1000. justify-content: space-between;
  1001. }
  1002. .group_name {
  1003. background-image: url(../../../../assets/icon/groupN.png);
  1004. width: 220px;
  1005. background-size: 100% 100%;
  1006. height: 67px;
  1007. padding: 0 20px 0 43px;
  1008. box-sizing: border-box;
  1009. line-height: 63px;
  1010. color: #fff;
  1011. overflow: hidden;
  1012. white-space: nowrap;
  1013. text-overflow: ellipsis;
  1014. }
  1015. .group_work {
  1016. width: 100%;
  1017. padding: 0 10px;
  1018. box-sizing: border-box;
  1019. display: flex;
  1020. flex-wrap: wrap;
  1021. }
  1022. .g_d_box {
  1023. display: flex;
  1024. flex-flow: wrap;
  1025. justify-content: space-around;
  1026. }
  1027. .g_d_box .isChair {
  1028. background-image: url(../../../../assets/avatar.png) !important;
  1029. }
  1030. .g_d_group {
  1031. width: 500px;
  1032. margin-bottom: 80px;
  1033. }
  1034. .g_d_group_chair {
  1035. display: flex;
  1036. align-items: center;
  1037. justify-content: center;
  1038. }
  1039. .g_d_group_chair>div+div {
  1040. margin-left: 30px;
  1041. }
  1042. .g_d_group_chair>div,
  1043. .g_d_group_chair2>div {
  1044. display: flex;
  1045. flex-direction: column;
  1046. align-items: center;
  1047. }
  1048. .g_d_group_chair>div>span:nth-child(1),
  1049. .g_d_group_chair2>div>span:nth-child(1) {
  1050. background-image: url(../../../../assets/icon/chair.png);
  1051. width: 50px;
  1052. height: 50px;
  1053. display: block;
  1054. background-size: 100% 100%;
  1055. }
  1056. .g_d_group_tableBox {
  1057. display: flex;
  1058. align-items: center;
  1059. justify-content: center;
  1060. }
  1061. .g_d_group_chair2 {
  1062. display: flex;
  1063. flex-direction: column;
  1064. align-items: center;
  1065. justify-content: center;
  1066. }
  1067. .g_d_group_chair2>div+div {
  1068. margin-top: 10px;
  1069. }
  1070. .g_d_group_table {
  1071. background-image: url(../../../../assets/icon/groupBg.png);
  1072. width: 354px;
  1073. height: 196px;
  1074. background-size: 100% 100%;
  1075. display: flex;
  1076. align-items: center;
  1077. justify-content: center;
  1078. flex-direction: column;
  1079. color: #fff;
  1080. }
  1081. .g_d_group_table>div:nth-child(1) {
  1082. font-size: 24px;
  1083. margin-bottom: 5px;
  1084. }
  1085. .g_d_group_table>div:nth-child(2) div {
  1086. cursor: pointer;
  1087. background: #2e77bf;
  1088. padding: 4px 10px;
  1089. border-radius: 5px;
  1090. }
  1091. .groupBox {}
  1092. .groupContent+.groupContent {
  1093. margin-top: 30px;
  1094. }
  1095. .groupTitle {
  1096. font-size: 24px;
  1097. color: rgb(80, 80, 80);
  1098. margin-bottom: 20px;
  1099. }
  1100. .groupName {
  1101. display: flex;
  1102. align-items: center;
  1103. }
  1104. .groupn {
  1105. font-size: 15px;
  1106. margin-right: 10px;
  1107. }
  1108. .groupName+.groupName {
  1109. margin-top: 15px;
  1110. }
  1111. .groupBtn {
  1112. margin-left: 10px;
  1113. }
  1114. .groupContent>>>.el-input-number.is-without-controls .el-input__inner {
  1115. text-align: left;
  1116. }
  1117. .g_d_btnBox {
  1118. display: flex;
  1119. justify-content: space-between;
  1120. align-items: flex-end;
  1121. margin: 20px 0;
  1122. }
  1123. .btn_left {
  1124. display: flex;
  1125. margin-top: 20px;
  1126. padding: 0px 0 0 30px;
  1127. }
  1128. .btn_left>div {
  1129. cursor: pointer;
  1130. }
  1131. .btn_left>div+div {
  1132. margin-left: 10px;
  1133. }
  1134. .btn_left .active {
  1135. color: #3e88f4;
  1136. border-bottom: 2px solid #2f80f3;
  1137. padding: 0 0 5px;
  1138. }
  1139. .btn_right {
  1140. display: flex;
  1141. align-items: center;
  1142. }
  1143. .updateChair {
  1144. position: relative;
  1145. }
  1146. .updateChairBtn {
  1147. position: absolute;
  1148. width: 50px;
  1149. height: 50px;
  1150. overflow: hidden;
  1151. /* display: flex; */
  1152. align-items: center;
  1153. justify-content: center;
  1154. background: #00000087;
  1155. color: #fff;
  1156. border-radius: 50px;
  1157. display: none;
  1158. cursor: pointer;
  1159. }
  1160. .updateChair:hover .updateChairBtn {
  1161. display: flex;
  1162. }
  1163. .returnBtn {
  1164. background: #499eef;
  1165. width: 65px;
  1166. height: 30px;
  1167. color: #fff;
  1168. text-align: center;
  1169. line-height: 32px;
  1170. margin-right: 20px;
  1171. cursor: pointer;
  1172. border-radius: 5px;
  1173. font-size: 14px;
  1174. }
  1175. .addNewPP>>>.el-dialog__body {
  1176. padding: 5px 20px;
  1177. }
  1178. .people {
  1179. border: 1px solid rgb(229 229 229);
  1180. height: 495px;
  1181. border-radius: 5px;
  1182. width: 100%;
  1183. overflow: auto;
  1184. }
  1185. .people_top {
  1186. display: flex;
  1187. width: 100%;
  1188. /* justify-content: space-between; */
  1189. /* align-items: center; */
  1190. flex-direction: column;
  1191. padding: 10px 25px 0;
  1192. box-sizing: border-box;
  1193. }
  1194. .people_nav,
  1195. .people_top_right {
  1196. /* padding: 20px 0 0 20px; */
  1197. }
  1198. .people_top_right {
  1199. height: 40px;
  1200. margin-bottom: 10px;
  1201. }
  1202. .people_search {
  1203. display: flex;
  1204. position: relative;
  1205. }
  1206. .people_search>>>.el-input__inner {
  1207. /* height: 25px; */
  1208. width: 100%;
  1209. }
  1210. .search_img {
  1211. width: 20px;
  1212. height: 20px;
  1213. position: absolute;
  1214. right: 10px;
  1215. top: 50%;
  1216. transform: translateY(-50%);
  1217. }
  1218. .search_img>img {
  1219. width: 100%;
  1220. height: 100%;
  1221. }
  1222. .people_name {
  1223. display: flex;
  1224. justify-content: flex-start;
  1225. padding: 10px 0 0 25px;
  1226. flex-direction: column;
  1227. flex-wrap: nowrap;
  1228. height: calc(100% - 140px);
  1229. overflow-y: auto;
  1230. overflow-x: hidden;
  1231. flex-direction: column;
  1232. }
  1233. .people_name>>>.el-checkbox {
  1234. width: 100%;
  1235. display: flex;
  1236. align-items: center;
  1237. margin-bottom: 10px;
  1238. }
  1239. .people_name>>>.el-checkbox__label {
  1240. text-overflow: ellipsis;
  1241. overflow: hidden;
  1242. width: 100%;
  1243. }
  1244. .t_j_box {
  1245. display: flex;
  1246. }
  1247. .t_j_box span:nth-child(1) {
  1248. width: 50%;
  1249. overflow: hidden;
  1250. margin-right: 10px;
  1251. text-overflow: ellipsis;
  1252. white-space: nowrap;
  1253. }
  1254. .t_j_box span:nth-child(2) {
  1255. width: 50%;
  1256. overflow: hidden;
  1257. margin-right: 10px;
  1258. text-overflow: ellipsis;
  1259. white-space: nowrap;
  1260. }
  1261. .i_box_login2 {
  1262. height: calc(100% - 80px);
  1263. width: 100%;
  1264. display: flex;
  1265. flex-wrap: wrap;
  1266. overflow: auto;
  1267. padding-bottom: 10px;
  1268. box-sizing: border-box;
  1269. align-content: flex-start;
  1270. padding: 10px 25px 0;
  1271. }
  1272. .i_box_login2>div {
  1273. cursor: pointer;
  1274. width: 80px;
  1275. text-align: center;
  1276. height: 30px;
  1277. line-height: 30px;
  1278. padding: 0 5px;
  1279. overflow: hidden;
  1280. background: rgb(225, 237, 255);
  1281. margin: 10px calc((100% - (80px*5)) / 4) 0 0;
  1282. color: rgb(37 124 255);
  1283. border-radius: 5px;
  1284. box-sizing: border-box;
  1285. }
  1286. .i_box_login2>div:nth-child(5n) {
  1287. margin: 10px 0 0 0;
  1288. }
  1289. .i_box_login2>.active {
  1290. background: rgb(92, 157, 255);
  1291. color: #fff;
  1292. }
  1293. .i_box_login2>div>span {
  1294. width: 100%;
  1295. overflow: hidden;
  1296. white-space: nowrap;
  1297. text-overflow: ellipsis;
  1298. display: block;
  1299. }
  1300. .group_switch {
  1301. margin-right: 10px;
  1302. height: 30px;
  1303. display: flex;
  1304. align-items: center;
  1305. }
  1306. .group_switch>span {
  1307. margin-right: 5px;
  1308. }
  1309. </style>