group.vue 53 KB

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