ManageUser.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666
  1. <script setup>
  2. import { computed, onMounted, onUnmounted, watch, ref } from "vue";
  3. import { useRouter } from 'vue-router';
  4. import { Search } from '@element-plus/icons-vue';
  5. import { ElMessage } from 'element-plus';
  6. const router = useRouter();
  7. import { schoolTree, schoolAdd, schoolItem, schoolUpdate, schoolDelete } from "../../api/admin/school";
  8. import { userList, userAdd, userDetail, userUpdate, userDelete } from "../../api/admin/user";
  9. // let state = ref({
  10. // optionUserType: [],
  11. // listParams: {
  12. // keyword: '',
  13. // page: 1,
  14. // limit: 5,
  15. // },
  16. // list: [],
  17. // total: 0,
  18. // showDialog: false,
  19. // ids: [],
  20. // showDel: false,
  21. // });
  22. let state = ref({
  23. // 用户类型
  24. "optionUserType": [
  25. {
  26. "name": "老师",
  27. "value" : 0,
  28. },
  29. {
  30. "name": "学生",
  31. "value" : 1,
  32. },
  33. ],
  34. // 用户提交分页查询数据
  35. "listParams": {
  36. // 搜索的内容 账号
  37. "keyword": "",
  38. // 搜索姓名
  39. "nickName": "",
  40. // 用户类型 0 - 老师, 1 - 学生
  41. "userType": 0,
  42. // 第几页
  43. "page": 1,
  44. // 每页显示多少数据
  45. "limit": 5
  46. },
  47. // 具体分页的数据
  48. "list": [
  49. // {
  50. // "id": 661434193309765,
  51. // "level": 0,
  52. // "orgName": "信息论与编码基础教研组",
  53. // "zoneName": null,
  54. // "rolesName": [
  55. // "教师"
  56. // ],
  57. // "createTime": "2025-04-03 10:42:39",
  58. // "name": "教师测试账号",
  59. // "code": null,
  60. // "username": "teacher",
  61. // "phone": null,
  62. // "duty": null,
  63. // "photo": null,
  64. // "orgId": 656844968038469,
  65. // "roles": [
  66. // 661429664665669
  67. // ],
  68. // "email": null,
  69. // "status": 1,
  70. // "type": 1
  71. // },
  72. // {
  73. // "id": 668917601919045,
  74. // "level": 0,
  75. // "orgName": "2025级通讯班",
  76. // "zoneName": null,
  77. // "rolesName": [
  78. // "学生"
  79. // ],
  80. // "createTime": "2025-04-24 14:12:43",
  81. // "name": "刘瑾见",
  82. // "code": "110220",
  83. // "username": "14367845673",
  84. // "phone": null,
  85. // "duty": null,
  86. // "photo": null,
  87. // "orgId": 656845035987013,
  88. // "roles": [
  89. // 661441664479301
  90. // ],
  91. // "email": null,
  92. // "status": 1,
  93. // "type": 0
  94. // },
  95. // {
  96. // "id": 668916601290821,
  97. // "level": 0,
  98. // "orgName": "2025级通讯班",
  99. // "zoneName": null,
  100. // "rolesName": [
  101. // "学生"
  102. // ],
  103. // "createTime": "2025-04-24 14:08:39",
  104. // "name": "王伟",
  105. // "code": "1234525",
  106. // "username": "13234367546",
  107. // "phone": null,
  108. // "duty": null,
  109. // "photo": null,
  110. // "orgId": 656845035987013,
  111. // "roles": [
  112. // 661441664479301
  113. // ],
  114. // "email": null,
  115. // "status": 1,
  116. // "type": 0
  117. // },
  118. // {
  119. // "id": 668923933716550,
  120. // "level": 0,
  121. // "orgName": "2025级通讯班",
  122. // "zoneName": null,
  123. // "rolesName": [
  124. // "学生"
  125. // ],
  126. // "createTime": "2025-04-24 14:38:29",
  127. // "name": "威威",
  128. // "code": "25242345",
  129. // "username": "1431163",
  130. // "phone": null,
  131. // "duty": null,
  132. // "photo": null,
  133. // "orgId": 656845035987013,
  134. // "roles": [
  135. // 661441664479301
  136. // ],
  137. // "email": null,
  138. // "status": 1,
  139. // "type": 0
  140. // },
  141. // {
  142. // "id": 661442553135174,
  143. // "level": 0,
  144. // "orgName": "2025级通讯班",
  145. // "zoneName": null,
  146. // "rolesName": [
  147. // "学生"
  148. // ],
  149. // "createTime": "2025-04-03 11:16:40",
  150. // "name": "学生测试账号",
  151. // "code": null,
  152. // "username": "student",
  153. // "phone": null,
  154. // "duty": null,
  155. // "photo": {
  156. // "name": "sl.jpg",
  157. // "url": "/upload/Files/2025/04/28/0b326e2784ba73f56ef9f40aae86695c.jpg"
  158. // },
  159. // "orgId": 656845035987013,
  160. // "roles": [
  161. // 661441664479301
  162. // ],
  163. // "email": null,
  164. // "status": 1,
  165. // "type": 2
  166. // }
  167. ],
  168. // 用户总数量
  169. "total": 0,
  170. // 是否弹出添加UI
  171. "showDialog": false,
  172. // 当前分页列表,多选的数据
  173. "ids": [],
  174. // 批量删除模态框
  175. "showDel": false,
  176. // 详情模态框
  177. "showDetails": false,
  178. // 更新密码模态框
  179. "showUpdatePwd": false,
  180. });
  181. // 父子级的学校到班级的数据参数
  182. let options = [
  183. // {
  184. // id: 1,
  185. // name: 'Asia',
  186. // children: [
  187. // {
  188. // id: 2,
  189. // name: 'China',
  190. // children: [
  191. // { id: 3, name: 'Beijing' },
  192. // { id: 4, name: 'Shanghai' },
  193. // { id: 5, name: 'Hangzhou' },
  194. // ],
  195. // },
  196. // {
  197. // id: 6,
  198. // name: 'Japan',
  199. // children: [
  200. // { id: 7, name: 'Tokyo' },
  201. // { id: 8, name: 'Osaka' },
  202. // { id: 9, name: 'Kyoto' },
  203. // ],
  204. // },
  205. // {
  206. // id: 10,
  207. // name: 'Korea',
  208. // children: [
  209. // { id: 11, name: 'Seoul' },
  210. // { id: 12, name: 'Busan' },
  211. // { id: 13, name: 'Taegu' },
  212. // ],
  213. // },
  214. // ],
  215. // },
  216. // {
  217. // id: 14,
  218. // name: 'Europe',
  219. // children: [
  220. // {
  221. // id: 15,
  222. // name: 'France',
  223. // children: [
  224. // { id: 16, name: 'Paris' },
  225. // { id: 17, name: 'Marseille' },
  226. // { id: 18, name: 'Lyon' },
  227. // ],
  228. // },
  229. // {
  230. // id: 19,
  231. // name: 'UK',
  232. // children: [
  233. // { id: 20, name: 'London' },
  234. // { id: 21, name: 'Birmingham' },
  235. // { id: 22, name: 'Manchester' },
  236. // ],
  237. // },
  238. // ],
  239. // },
  240. // {
  241. // id: 23,
  242. // name: 'North America',
  243. // children: [
  244. // {
  245. // id: 24,
  246. // name: 'US',
  247. // children: [
  248. // { id: 25, name: 'New York' },
  249. // { id: 26, name: 'Los Angeles' },
  250. // { id: 27, name: 'Washington' },
  251. // ],
  252. // },
  253. // {
  254. // id: 28,
  255. // name: 'Canada',
  256. // children: [
  257. // { id: 29, name: 'Toronto' },
  258. // { id: 30, name: 'Montreal' },
  259. // { id: 31, name: 'Ottawa' },
  260. // ],
  261. // },
  262. // ],
  263. // },
  264. ]
  265. // 用于表单验证规则必须要的对象
  266. let ruleFormRef = ref();
  267. /**
  268. * 添加,最后提交的数据
  269. */
  270. let addParams = ref({
  271. // 账号
  272. "userName": null,
  273. // 0 表示教师,1表示学生
  274. "userType": 0,
  275. // 昵称
  276. "nickName": null,
  277. // 用户分配到的班级数组,可以是多个
  278. "classInfo": [],
  279. // 密码
  280. "password": null,
  281. // 确认密码
  282. "password2": null
  283. });
  284. /**
  285. * 添加,字段相关验证规则
  286. */
  287. let addRules = ref({
  288. userName: [{ required: true, message: '请填写账号', trigger: 'blur' }],
  289. nickName: [{ required: true, message: '请填写姓名', trigger: 'blur' }],
  290. userType: [{ required: true, message: '请选择账号类型', trigger: 'change', }],
  291. classInfo: [{ required: true, message: '请选择班级', trigger: 'change', }],
  292. password: [{ required: true, message: '请填写密码', trigger: 'blur' }],
  293. password2: [{ required: true, message: '请填写确认密码', trigger: 'blur' }],
  294. });
  295. /**
  296. * 详情数据
  297. */
  298. let detailsDb = ref({
  299. "id": null,
  300. // 账号
  301. "userName": null,
  302. // 0 表示教师,1表示学生
  303. "userType": 0,
  304. // 昵称
  305. "nickName": null,
  306. // 用户分配到的班级数组,可以是多个
  307. "classInfo": [],
  308. });
  309. // 用于表单验证规则必须要的对象
  310. let ruleFormRefUpdatePwd = ref();
  311. /**
  312. * 用于更新密码的时候,会用到的参数数据
  313. */
  314. let updatePwdDb = ref({
  315. "id": null,
  316. // 账号
  317. "userName": null,
  318. // 0 表示教师,1表示学生
  319. "userType": null,
  320. // 昵称
  321. "nickName": null,
  322. // 用户分配到的班级数组,可以是多个
  323. "classInfo": [],
  324. // 密码
  325. "password": null,
  326. // 确认密码
  327. "password2": null
  328. });
  329. /**
  330. * 因为这里的接口返回的不是分页的接口,是全部数据,所以这里就记录全部数据
  331. * 后面通过逻辑,来控制分页的显示
  332. */
  333. let pageDb = [];
  334. /**
  335. * 查找分页数据
  336. */
  337. const pageUpdateEvent = () => {
  338. console.log(
  339. "查找分页数据 pageUpdateEvent", state.value.listParams
  340. );
  341. let keyword = state.value.listParams.keyword;
  342. let pageNum = state.value.listParams.page;
  343. let pageSize = state.value.listParams.limit;
  344. let userType = state.value.listParams.userType;
  345. let nickName = state.value.listParams.nickName;
  346. let submit = {
  347. // 第几页
  348. "pageNum": pageNum,
  349. // 每页显示多少数据
  350. "pageSize": pageSize,
  351. // 0 - 老师, 1 - 学生
  352. "userType" : userType,
  353. // 昵称
  354. // "nickName" : "",
  355. "nickName" : nickName,
  356. // 账号
  357. "userName": keyword,
  358. };
  359. userList(submit)
  360. .then(response => {
  361. let dataOld = response?.data?.data;
  362. let data = dataOld?.list;
  363. state.value.total = dataOld.total;
  364. let newList = [];
  365. // 循环数组,一些特殊字段进行处理
  366. for (let i = 0; i < data.length; i++) {
  367. let thisData = data[i];
  368. let newType = thisData["userType"] == 0 ? "老师" : "学生";
  369. thisData["newType"] = newType;
  370. newList.push(thisData);
  371. }
  372. state.value.list = newList;
  373. // console.log(
  374. // "userListEvent response", response, data
  375. // );
  376. // pageDb = [];
  377. // pageDb = data;
  378. // pageDbUpdateEvent();
  379. }).catch(error => {
  380. });
  381. }
  382. // /**
  383. // * 因为接口不是标准的分页接口,是直接返回所有数据的
  384. // * 这里进行单独处理,来展示第几页的数据
  385. // */
  386. // const pageDbUpdateEvent = () => {
  387. // // console.log(
  388. // // "查找分页数据 pageDbUpdateEvent", state.value.listParams, pageDb
  389. // // );
  390. // state.value.total = pageDb.length;
  391. // state.value.list = [];
  392. // let page = state.value.listParams.page;
  393. // let limit = state.value.listParams.limit;
  394. // let keyword = state.value.listParams.keyword;
  395. // // 从第几个数组下标开始
  396. // let indexStart = (page - 1) * limit;
  397. // // 到第几个数组下标结束
  398. // let indexEnd = indexStart + limit - 1;
  399. // for (let i = 0; i < pageDb.length; i++) {
  400. // // 在范围内
  401. // if (i >= indexStart && i <= indexEnd) {
  402. // let thisPageDb = pageDb[i];
  403. // state.value.list.push(thisPageDb);
  404. // }
  405. // }
  406. // }
  407. /**
  408. * 弹出添加UI
  409. */
  410. const btnAddStudent = (formEl) => {
  411. state.value.showDialog = true;
  412. if (!formEl) {
  413. return;
  414. }
  415. formEl.resetFields();
  416. }
  417. /**
  418. * 触发搜索逻辑
  419. */
  420. const btnSearchName = () => {
  421. state.value.listParams.page = 1;
  422. pageUpdateEvent();
  423. }
  424. /**
  425. * 更新选中的班级逻辑
  426. * @param val
  427. */
  428. const classChange = (val) => {
  429. state.value.listParams.page = 1;
  430. pageUpdateEvent();
  431. }
  432. /**
  433. * 上一页,下一页改变
  434. */
  435. const handleSizeChange = (val) => {
  436. // 重新查找分页数据
  437. pageUpdateEvent();
  438. }
  439. /**
  440. * 上一页,下一页改变
  441. */
  442. const handleCurrentChange = (val) => {
  443. // 重新查找分页数据
  444. pageUpdateEvent();
  445. }
  446. /**
  447. * 分页多选,更新多选的相关数据
  448. * @param res
  449. */
  450. const selectionChange = (res) => {
  451. state.value.ids = [];
  452. res.forEach((item) => {
  453. // state.value.ids.push(item.id);
  454. state.value.ids.push(item);
  455. });
  456. console.log("分页多选,更新多选的相关数据", state.value.ids);
  457. }
  458. /**
  459. * 添加 点击提交
  460. * @param formEl
  461. */
  462. const submitForm = async (formEl) => {
  463. if (!formEl) return
  464. await formEl.validate((valid, fields) => {
  465. if (valid) {
  466. // console.log(
  467. // "addParams", addParams.value
  468. // );
  469. let classInfoArray = [];
  470. if (addParams.value.classInfo != null && addParams.value.classInfo != undefined) {
  471. for (let i = 0; i < addParams.value.classInfo.length; i++) {
  472. let thisClassInfo = addParams.value.classInfo[i];
  473. let schoolIdJson = getSchoolIdJson(thisClassInfo);
  474. if (schoolIdJson != null && schoolIdJson != undefined) {
  475. // console.log( "schoolIdJson", schoolIdJson );
  476. // 特殊处理,必须选中的是班级
  477. if (schoolIdJson.type == 3) {
  478. let addJson = {
  479. "id": schoolIdJson.id,
  480. "name": schoolIdJson.name,
  481. "remark": schoolIdJson.remark,
  482. "schoolId": schoolIdJson.schoolId,
  483. };
  484. classInfoArray.push(addJson);
  485. }
  486. }
  487. }
  488. }
  489. let submit = {
  490. // 账号
  491. "userName": addParams.value.userName,
  492. // 0 表示教师,1表示学生
  493. "userType": addParams.value.userType,
  494. // 昵称
  495. "nickName": addParams.value.nickName,
  496. // 用户分配到的班级数组,可以是多个
  497. // "classInfo": [
  498. // // {
  499. // // "id": 0,
  500. // // "name": "",
  501. // // "remark": "",
  502. // // "schoolId": 0
  503. // // }
  504. // ],
  505. "classInfo": classInfoArray,
  506. // 密码
  507. "password": addParams.value.password,
  508. // 确认密码
  509. "password2": addParams.value.password2
  510. };
  511. // console.log(
  512. // "添加账号的相关数据 submit", submit
  513. // );
  514. userAdd(submit)
  515. .then(response => {
  516. let data = response?.data?.data;
  517. // console.log(
  518. // "userAddEvent response", response, data
  519. // );
  520. // 重新查找分页数据
  521. pageUpdateEvent();
  522. // 接口请求完成,隐藏模态框
  523. state.value.showDialog = false;
  524. }).catch(error => {
  525. });
  526. } else {
  527. // console.log('error submit!', fields)
  528. }
  529. })
  530. }
  531. /**
  532. * 更新
  533. * @param formEl
  534. */
  535. const updateForm = async (formEl) => {
  536. if (!formEl) return
  537. await formEl.validate((valid, fields) => {
  538. if (valid) {
  539. // console.log(
  540. // "detailsDb", detailsDb.value
  541. // );
  542. let classInfoArray = [];
  543. if (detailsDb.value.classInfo != null && detailsDb.value.classInfo != undefined) {
  544. for (let i = 0; i < detailsDb.value.classInfo.length; i++) {
  545. let thisClassInfo = detailsDb.value.classInfo[i];
  546. let schoolIdJson = getSchoolIdJson(thisClassInfo);
  547. if (schoolIdJson != null && schoolIdJson != undefined) {
  548. // console.log( "schoolIdJson", schoolIdJson );
  549. // 特殊处理,必须选中的是班级
  550. if (schoolIdJson.type == 3) {
  551. let addJson = {
  552. "id": schoolIdJson.id,
  553. "name": schoolIdJson.name,
  554. "remark": schoolIdJson.remark,
  555. "schoolId": schoolIdJson.schoolId,
  556. };
  557. classInfoArray.push(addJson);
  558. }
  559. }
  560. }
  561. }
  562. let submit = {
  563. "id": detailsDb.value.id,
  564. // 账号
  565. "userName": detailsDb.value.userName,
  566. // 0 表示教师,1表示学生
  567. "userType": detailsDb.value.userType,
  568. // 昵称
  569. "nickName": detailsDb.value.nickName,
  570. // 用户分配到的班级数组,可以是多个【通过测试,班级不可以减少,但是新增多个,则会新增】
  571. "classInfo": classInfoArray,
  572. };
  573. // console.log(
  574. // "submit", submit
  575. // );
  576. userUpdate(submit)
  577. .then(response => {
  578. // let data = response?.data?.data;
  579. // console.log(
  580. // "userUpdateEvent response", response, data
  581. // );
  582. // 重新查找分页数据
  583. pageUpdateEvent();
  584. // 接口请求完成,隐藏模态框
  585. state.value.showDetails = false;
  586. }).catch(error => {
  587. });
  588. } else {
  589. // console.log('error submit!', fields)
  590. }
  591. })
  592. }
  593. /**
  594. * 更新密码
  595. * @param formEl
  596. */
  597. const updatePwdForm = async (formEl) => {
  598. if (!formEl) return
  599. await formEl.validate((valid, fields) => {
  600. if (valid) {
  601. // console.log(
  602. // "updatePwdDb", updatePwdDb.value
  603. // );
  604. let classInfoArray = [];
  605. if (updatePwdDb.value.classInfo != null && updatePwdDb.value.classInfo != undefined) {
  606. for (let i = 0; i < updatePwdDb.value.classInfo.length; i++) {
  607. let thisClassInfo = updatePwdDb.value.classInfo[i];
  608. let schoolIdJson = getSchoolIdJson(thisClassInfo);
  609. if (schoolIdJson != null && schoolIdJson != undefined) {
  610. // console.log( "schoolIdJson", schoolIdJson );
  611. // 特殊处理,必须选中的是班级
  612. if (schoolIdJson.type == 3) {
  613. let addJson = {
  614. "id": schoolIdJson.id,
  615. "name": schoolIdJson.name,
  616. "remark": schoolIdJson.remark,
  617. "schoolId": schoolIdJson.schoolId,
  618. };
  619. classInfoArray.push(addJson);
  620. }
  621. }
  622. }
  623. }
  624. let password = updatePwdDb.value.password;
  625. let password2 = updatePwdDb.value.password2;
  626. let submit = {
  627. "id": updatePwdDb.value.id,
  628. // 账号
  629. "userName": updatePwdDb.value.userName,
  630. // 0 表示教师,1表示学生
  631. "userType": updatePwdDb.value.userType,
  632. // 昵称
  633. "nickName": updatePwdDb.value.nickName,
  634. // 用户分配到的班级数组,可以是多个【通过测试,班级不可以减少,但是新增多个,则会新增】
  635. "classInfo": classInfoArray,
  636. // 密码
  637. "password": password,
  638. // 确认密码
  639. "password2": password2,
  640. };
  641. if (typeof password == 'string' && password.length < 5) {
  642. ElMessage({ type: 'error', message: '密码长度必须大等于6', });
  643. return;
  644. }
  645. if (typeof password2 == 'string' && password2.length < 5) {
  646. ElMessage({ type: 'error', message: '确认密码长度必须大等于6', });
  647. return;
  648. }
  649. if (password != password2) {
  650. ElMessage({ type: 'error', message: '密码和确认密码必须一致', });
  651. return;
  652. }
  653. userUpdate(submit)
  654. .then(response => {
  655. // let data = response?.data?.data;
  656. // console.log(
  657. // "userUpdateEvent response", response, data
  658. // );
  659. // 重新查找分页数据
  660. pageUpdateEvent();
  661. // 接口请求完成,隐藏模态框
  662. state.value.showUpdatePwd = false;
  663. }).catch(error => {
  664. });
  665. } else {
  666. // console.log('error submit!', fields)
  667. }
  668. })
  669. }
  670. /**
  671. * 批量删除,同时也可以处理单个删除逻辑
  672. * delIdArray 批量删除的id值
  673. * 例如
  674. * [ { "id" : "1" }, { "id" : "2" } ]
  675. * callback 全部删除完成,回调
  676. *
  677. */
  678. const idDelAll = (delIdArray, callback) => {
  679. // 删除完成次数
  680. let okNum = 0;
  681. for (let i = 0; i < delIdArray.length; i++) {
  682. let thisDelIdArray = delIdArray[i];
  683. // console.log(
  684. // "thisDelIdArray", thisDelIdArray
  685. // );
  686. let submit = {
  687. "id": thisDelIdArray.id,
  688. };
  689. userDelete(submit)
  690. .then(response => {
  691. // let data = response?.data?.data;
  692. // console.log(
  693. // "userDeleteEvent response", response, data
  694. // );
  695. okNum += 1;
  696. if (okNum >= delIdArray.length) {
  697. callback("yes");
  698. }
  699. }).catch(error => {
  700. });
  701. }
  702. }
  703. /**
  704. * 删除选中分页的某个数据
  705. * @param res
  706. */
  707. const btnDel = (res) => {
  708. // console.log(
  709. // "删除选中分页的某个数据", res
  710. // );
  711. let delIdArray = [
  712. { "id" : res.id }
  713. ];
  714. idDelAll(
  715. delIdArray,
  716. function() {
  717. ElMessage({
  718. type: 'success',
  719. message: '删除成功',
  720. });
  721. // 重新查找分页数据
  722. pageUpdateEvent();
  723. }
  724. );
  725. }
  726. /**
  727. * 弹出批量删除模态框逻辑
  728. */
  729. const btnShowDel = () => {
  730. if (state.value.ids && state.value.ids.length > 0) {
  731. state.value.showDel = true
  732. }
  733. }
  734. /**
  735. * 开始批量删除处理
  736. */
  737. const btnBatchDel = () => {
  738. // console.log(
  739. // "开始批量删除处理", state.value.ids
  740. // );
  741. let delIdArray = [];
  742. for (let i = 0; i < state.value.ids.length; i++) {
  743. let thisIds = state.value.ids[i];
  744. let addJson = { "id" : thisIds.id };
  745. delIdArray.push(addJson);
  746. }
  747. // console.log(
  748. // "btnBatchDel delIdArray ===>", delIdArray
  749. // );
  750. idDelAll(
  751. delIdArray,
  752. function() {
  753. ElMessage({
  754. type: 'success',
  755. message: '删除成功',
  756. });
  757. // 重新查找分页数据
  758. pageUpdateEvent();
  759. // 批量选中的列表重置
  760. state.value.ids = [];
  761. // 隐藏模态框
  762. state.value.showDel = false;
  763. }
  764. );
  765. }
  766. /**
  767. * 弹出指定分页详情
  768. * @param res 当前点击分页的数据参数
  769. * type 类型 ,不传的时候,弹出,编辑, pwd 弹出修改密码
  770. */
  771. const btnDetail = (res, type) => {
  772. console.log('弹出指定分页详情', res, type);
  773. let submit = {
  774. id: res.id,
  775. };
  776. userDetail(submit)
  777. .then(response => {
  778. let data = response?.data?.data;
  779. // console.log(
  780. // "userDetailEvent response", response, data
  781. // );
  782. let classInfoIdArray = [];
  783. if (data.classInfo != null && data.classInfo != undefined) {
  784. for (let i = 0; i < data.classInfo.length; i++) {
  785. let thisClassInfo = data.classInfo[i];
  786. // console.log("thisClassInfo", thisClassInfo);
  787. classInfoIdArray.push(thisClassInfo.id);
  788. }
  789. }
  790. detailsDb.value = {
  791. "id": data.id,
  792. // 账号
  793. "userName": data.userName,
  794. // 0 表示教师,1表示学生
  795. "userType": data.userType,
  796. // 昵称
  797. "nickName": data.nickName,
  798. // 用户分配到的班级数组,可以是多个
  799. "classInfo": classInfoIdArray,
  800. // // 密码
  801. // "password": data.password,
  802. // // 确认密码
  803. // "password2": data.password2
  804. }
  805. updatePwdDb.value = {
  806. "id": data.id,
  807. // 账号
  808. "userName": data.userName,
  809. // 0 表示教师,1表示学生
  810. "userType": data.userType,
  811. // 昵称
  812. "nickName": data.nickName,
  813. // 用户分配到的班级数组,可以是多个
  814. "classInfo": classInfoIdArray,
  815. // 密码
  816. "password": data.password,
  817. // 确认密码
  818. "password2": data.password2
  819. }
  820. // console.log("detailsDb.value", detailsDb.value);
  821. if (type == null || type == undefined) {
  822. state.value.showDetails = true;
  823. }
  824. else if (type == 'pwd') {
  825. state.value.showUpdatePwd = true;
  826. }
  827. }).catch(error => {
  828. });
  829. }
  830. /**
  831. * 记录,学校到班级对应的所有id和json数据
  832. *
  833. */
  834. let schoolIdJson = {};
  835. /**
  836. * 本次遍历的数组
  837. * array
  838. */
  839. const schoolIdJsonUpdateEvent = (array) => {
  840. if (array == null || array == undefined) {
  841. return array;
  842. }
  843. for (let i = 0; i < array.length; i++) {
  844. let objArray = array[i];
  845. let id = objArray.id;
  846. schoolIdJson[id] = objArray;
  847. if (objArray.children != null && objArray.children != undefined) {
  848. let children = objArray.children;
  849. schoolIdJsonUpdateEvent(children);
  850. }
  851. }
  852. }
  853. /**
  854. * 根据id得到对应学校到班级的数据
  855. * id
  856. * 存在返回json数据,否则返回 null
  857. */
  858. const getSchoolIdJson = (id) => {
  859. if (schoolIdJson[id] == null || schoolIdJson[id] == undefined) {
  860. return null;
  861. }
  862. let objJson = schoolIdJson[id];
  863. return objJson;
  864. }
  865. /**
  866. * 获取父子级的树形结构数据
  867. */
  868. const optionsUpdate = () => {
  869. // 先获取所有最顶级的数据
  870. let submit = {
  871. // 默认优先去顶级所有,传 0 。 否则你要看到 学院, 专业 ,班级 的列表,这里固定就传 学院这个的id值
  872. "schoolId" : 0,
  873. };
  874. schoolTree(submit)
  875. .then(response => {
  876. options = [];
  877. let data = response?.data?.data;
  878. options = data;
  879. // console.log(
  880. // "schoolTreeEvent response", response, data
  881. // );
  882. for (let i = 0; i < options.length; i++) {
  883. let thisOptions = options[i];
  884. // console.log(
  885. // "thisOptions", thisOptions
  886. // );
  887. optionsChildrenUpdate(i, thisOptions.id);
  888. }
  889. }).catch(error => {
  890. });
  891. }
  892. /**
  893. * 将对应子级的数据获取
  894. * optionsIndex options 对应的数组下标
  895. * id 当前父级 的id值
  896. */
  897. const optionsChildrenUpdate = (optionsIndex, id) => {
  898. let submit = {
  899. // 默认优先去顶级所有,传 0 。 否则你要看到 学院, 专业 ,班级 的列表,这里固定就传 学院这个的id值
  900. "schoolId" : id,
  901. };
  902. schoolTree(submit)
  903. .then(response => {
  904. let data = response?.data?.data;
  905. // console.log(
  906. // "optionsChildrenUpdate response", data
  907. // );
  908. options[optionsIndex] = data[0];
  909. schoolIdJsonUpdateEvent(options);
  910. // console.log("options ===>", options, schoolIdJson);
  911. }).catch(error => {
  912. });
  913. }
  914. onMounted(function() {
  915. pageUpdateEvent();
  916. optionsUpdate();
  917. });
  918. </script>
  919. <template>
  920. <div class="ManageUser">
  921. <div class="content commonsScrollbar">
  922. <div class="contentTitle">
  923. <div class="contentTitle-line"></div>
  924. <div class="contentTitle-text">账号管理</div>
  925. </div>
  926. <div class="contentRow">
  927. <div class="rowLeft">
  928. <div class="rowSelect">
  929. <el-select
  930. v-model="state.listParams.userType"
  931. clearable
  932. placeholder="账号类型"
  933. size="large"
  934. style="width: 15rem"
  935. @change="classChange"
  936. >
  937. <el-option v-for="item in state.optionUserType" :key="item.value" :label="item.name" :value="item.value" />
  938. </el-select>
  939. </div>
  940. <div class="rowBtn rowBtn1" @click="btnAddStudent(ruleFormRef)">
  941. <img src="./assets/img/manageUser/add.svg" alt="" />
  942. <span class="rowBtn-text rowBtn-text1">添加账号</span>
  943. </div>
  944. <!-- <div class="rowBtn rowBtn2">
  945. <img src="./assets/img/manageUser/download.svg" alt="" />
  946. <span class="rowBtn-text rowBtn-text2">模板下载</span>
  947. </div>
  948. <div class="rowBtn rowBtn1">
  949. <img src="./assets/img/manageUser/import.svg" alt="" />
  950. <span class="rowBtn-text rowBtn-text1">批量导入</span>
  951. </div>
  952. <div class="rowBtn rowBtn1">
  953. <img src="./assets/img/manageUser/export.svg" alt="" />
  954. <span class="rowBtn-text rowBtn-text1">批量导出</span>
  955. </div> -->
  956. <div class="rowBtn rowBtn3" @click="btnShowDel">
  957. <img src="./assets/img/manageUser/delete.svg" alt="" />
  958. <span class="rowBtn-text rowBtn-text3">批量删除</span>
  959. </div>
  960. </div>
  961. <div class="rowRight">
  962. <el-input
  963. class="searchInput"
  964. v-model="state.listParams.keyword"
  965. :prefix-icon="Search"
  966. clearable
  967. placeholder="搜索账号"
  968. @clear="btnSearchName"
  969. />
  970. <el-input
  971. class="searchInput"
  972. v-model="state.listParams.nickName"
  973. :prefix-icon="Search"
  974. clearable
  975. placeholder="搜索姓名"
  976. @clear="btnSearchName"
  977. />
  978. <div class="rowSearch" @click="btnSearchName">搜索</div>
  979. </div>
  980. </div>
  981. <div class="contentTable commonsScrollbar">
  982. <el-table :data="state.list" style="width: 100%" @selection-change="selectionChange">
  983. <el-table-column align="center" type="selection" width="110" />
  984. <el-table-column prop="userName" label="账号" />
  985. <el-table-column prop="nickName" label="姓名" />
  986. <el-table-column prop="newType" label="类型" />
  987. <el-table-column label="操作">
  988. <template #default="scope">
  989. <el-button link type="primary" @click="btnDetail(scope.row)">编辑</el-button>
  990. <el-button link type="primary" @click="btnDetail(scope.row, 'pwd')">修改密码</el-button>
  991. <el-popconfirm :title="`你确定删除${scope.row.userName}吗?`" @confirm="btnDel(scope.row)">
  992. <template #reference>
  993. <el-button link type="danger" style="margin-left: 3rem">移除</el-button>
  994. </template>
  995. </el-popconfirm>
  996. </template>
  997. </el-table-column>
  998. </el-table>
  999. </div>
  1000. <el-pagination
  1001. class="classPagination"
  1002. v-model:current-page="state.listParams.page"
  1003. v-model:page-size="state.listParams.limit"
  1004. :page-sizes="[10, 20, 50, 100]"
  1005. background
  1006. :layout="' ->, total,prev, pager, next, jumper'"
  1007. :total="state.total"
  1008. @size-change="handleSizeChange"
  1009. @current-change="handleCurrentChange"
  1010. >
  1011. </el-pagination>
  1012. </div>
  1013. <!-- 添加模态框 -->
  1014. <el-dialog v-model="state.showDialog" class="dialog">
  1015. <template #header>
  1016. <div class="dialog-title">添加账号</div>
  1017. </template>
  1018. <div class="dialogBody">
  1019. <el-form ref="ruleFormRef" :model="addParams" :rules="addRules">
  1020. <el-form-item label="账号" prop="userName">
  1021. <el-input v-model="addParams.userName" clearable placeholder="请填写账号"></el-input>
  1022. </el-form-item>
  1023. <el-form-item label="姓名" prop="nickName">
  1024. <el-input v-model="addParams.nickName" clearable placeholder="请填写姓名"></el-input>
  1025. </el-form-item>
  1026. <el-form-item label="账号类型" prop="userType">
  1027. <el-select
  1028. v-model="addParams.userType"
  1029. clearable
  1030. placeholder="请选择账号类型"
  1031. size="large"
  1032. >
  1033. <el-option v-for="item in state.optionUserType" :key="item.value" :label="item.name" :value="item.value" />
  1034. </el-select>
  1035. </el-form-item>
  1036. <el-form-item label="班级" prop="classInfo">
  1037. <el-cascader v-model="addParams.classInfo"
  1038. :options="options"
  1039. :props="{
  1040. children: 'children',
  1041. label: 'name',
  1042. value: 'id',
  1043. checkStrictly: false,
  1044. expandTrigger: 'hover',
  1045. emitPath: false,
  1046. multiple: true,
  1047. }"
  1048. clearable placeholder="请选择班级" />
  1049. </el-form-item>
  1050. <el-form-item label="密码" prop="password">
  1051. <el-input v-model="addParams.password" clearable placeholder="请填写密码"></el-input>
  1052. </el-form-item>
  1053. <el-form-item label="确认密码" prop="password2">
  1054. <el-input v-model="addParams.password2" clearable placeholder="请填写确认密码"></el-input>
  1055. </el-form-item>
  1056. </el-form>
  1057. <div class="dialogFoot">
  1058. <el-button color="#EAEAEA" @click="state.showDialog = false" style="margin-right: 0.6rem">取消</el-button>
  1059. <el-button color="#2C68FF" @click="submitForm(ruleFormRef)">确认</el-button>
  1060. </div>
  1061. </div>
  1062. </el-dialog>
  1063. <!-- 详情模态框 -->
  1064. <el-dialog v-model="state.showDetails" class="dialog">
  1065. <template #header>
  1066. <div class="dialog-title">账号详情</div>
  1067. </template>
  1068. <div class="dialogBody">
  1069. <el-form ref="ruleFormRef" :model="detailsDb" :rules="addRules">
  1070. <el-form-item label="账号" prop="userName">
  1071. <el-input v-model="detailsDb.userName" clearable placeholder="请填写账号"></el-input>
  1072. </el-form-item>
  1073. <el-form-item label="姓名" prop="nickName">
  1074. <el-input v-model="detailsDb.nickName" clearable placeholder="请填写姓名"></el-input>
  1075. </el-form-item>
  1076. <el-form-item label="账号类型" prop="userType">
  1077. <el-select
  1078. v-model="detailsDb.userType"
  1079. clearable
  1080. placeholder="请选择账号类型"
  1081. size="large"
  1082. >
  1083. <el-option v-for="item in state.optionUserType" :key="item.value" :label="item.name" :value="item.value" />
  1084. </el-select>
  1085. </el-form-item>
  1086. <el-form-item label="班级" prop="classInfo">
  1087. <el-cascader v-model="detailsDb.classInfo"
  1088. :options="options"
  1089. :props="{
  1090. children: 'children',
  1091. label: 'name',
  1092. value: 'id',
  1093. checkStrictly: false,
  1094. expandTrigger: 'hover',
  1095. emitPath: false,
  1096. multiple: true,
  1097. }"
  1098. clearable placeholder="请选择班级" />
  1099. </el-form-item>
  1100. </el-form>
  1101. <div class="dialogFoot">
  1102. <el-button color="#EAEAEA" @click="state.showDetails = false" style="margin-right: 0.6rem">取消</el-button>
  1103. <el-button color="#2C68FF" @click="updateForm(ruleFormRef)">更新</el-button>
  1104. </div>
  1105. </div>
  1106. </el-dialog>
  1107. <!-- 更新密码模态框 -->
  1108. <el-dialog v-model="state.showUpdatePwd" class="dialog">
  1109. <template #header>
  1110. <div class="dialog-title">账号更新密码</div>
  1111. </template>
  1112. <div class="dialogBody">
  1113. <el-form ref="ruleFormRefUpdatePwd" :model="updatePwdDb" :rules="addRules">
  1114. <el-form-item label="账号" prop="userName">
  1115. <el-input v-model="updatePwdDb.userName" clearable placeholder="请填写账号" disabled ></el-input>
  1116. </el-form-item>
  1117. <el-form-item label="密码" prop="password">
  1118. <el-input v-model="updatePwdDb.password" clearable placeholder="请填写密码"></el-input>
  1119. </el-form-item>
  1120. <el-form-item label="确认密码" prop="password2">
  1121. <el-input v-model="updatePwdDb.password2" clearable placeholder="请填写确认密码"></el-input>
  1122. </el-form-item>
  1123. </el-form>
  1124. <div class="dialogFoot">
  1125. <el-button color="#EAEAEA" @click="state.showUpdatePwd = false" style="margin-right: 0.6rem">取消</el-button>
  1126. <el-button color="#2C68FF" @click="updatePwdForm(ruleFormRefUpdatePwd)">更新密码</el-button>
  1127. </div>
  1128. </div>
  1129. </el-dialog>
  1130. <!-- 用于批量删除模态框 -->
  1131. <el-dialog v-model="state.showDel" width="600" class="del">
  1132. <template #header>
  1133. <div style="display: flex; align-items: center">
  1134. <img class="del-img" src="./assets/img/manageUser/error-line.svg" alt="" />
  1135. <div class="del-name">批量删除</div>
  1136. </div>
  1137. </template>
  1138. <span class="delBody">是否确认批量删除?删除后不可恢复!</span>
  1139. <template #footer>
  1140. <div class="dialog-footer">
  1141. <el-button @click="state.showDel = false">取消</el-button>
  1142. <el-button type="primary" @click="btnBatchDel">删除</el-button>
  1143. </div>
  1144. </template>
  1145. </el-dialog>
  1146. </div>
  1147. </template>
  1148. <style lang="scss" scoped>
  1149. @use './css/commonsScrollbar.scss';
  1150. .ManageUser * {
  1151. -moz-user-select: none;
  1152. -webkit-user-select: none;
  1153. -ms-user-select: none;
  1154. -khtml-user-select: none;
  1155. user-select: none;
  1156. box-sizing:border-box;
  1157. -moz-box-sizing:border-box; /* Firefox */
  1158. -webkit-box-sizing:border-box; /* Safari */
  1159. }
  1160. .ManageUser {
  1161. position: relative;
  1162. z-index: 0;
  1163. width: 100%;
  1164. height: 100%;
  1165. top: 0px;
  1166. left: 0px;
  1167. background-color: #ffffff;
  1168. .content {
  1169. position: relative;
  1170. width: 100%;
  1171. height: 100%;
  1172. border-radius: 1rem;
  1173. background: #ffffff;
  1174. padding: 2rem 4rem 2rem 3rem;
  1175. box-sizing: border-box;
  1176. .contentTitle {
  1177. padding: 0 0.5rem;
  1178. box-sizing: border-box;
  1179. display: flex;
  1180. align-items: center;
  1181. .contentTitle-line {
  1182. width: 0.35rem;
  1183. height: 2rem;
  1184. background: #2c68ff;
  1185. border-radius: 0.85rem;
  1186. }
  1187. .contentTitle-text {
  1188. font-weight: bold;
  1189. font-size: 1.8rem;
  1190. color: #373737;
  1191. margin-left: 1.4rem;
  1192. }
  1193. }
  1194. .contentRow {
  1195. margin-top: 2.8rem;
  1196. padding: 0 1.5rem 0 1rem;
  1197. box-sizing: border-box;
  1198. display: flex;
  1199. align-items: center;
  1200. justify-content: space-between;
  1201. .rowLeft {
  1202. display: flex;
  1203. align-items: center;
  1204. .rowSelect {
  1205. :deep(.el-select__wrapper) {
  1206. height: 3rem;
  1207. font-size: 1.1rem;
  1208. min-height: 0;
  1209. border-radius: 0.57rem;
  1210. }
  1211. }
  1212. .rowBtn {
  1213. cursor: pointer;
  1214. width: 8.8rem;
  1215. height: 3rem;
  1216. border-radius: 0.57rem;
  1217. display: flex;
  1218. align-items: center;
  1219. justify-content: center;
  1220. margin-left: 2rem;
  1221. img {
  1222. width: 1.5rem;
  1223. height: 1.5rem;
  1224. }
  1225. .rowBtn-text {
  1226. font-size: 1.15rem;
  1227. margin-left: 0.7rem;
  1228. }
  1229. .rowBtn-text1 {
  1230. color: #3d7cff;
  1231. }
  1232. .rowBtn-text2 {
  1233. color: #d8a216;
  1234. }
  1235. .rowBtn-text3 {
  1236. color: #e84d4d;
  1237. }
  1238. }
  1239. .rowBtn1 {
  1240. background: #e5eeff;
  1241. &:hover {
  1242. background: #edf3ff;
  1243. }
  1244. }
  1245. .rowBtn2 {
  1246. background: rgba(214, 154, 1, 0.1);
  1247. &:hover {
  1248. background: #f4e5bd;
  1249. }
  1250. }
  1251. .rowBtn3 {
  1252. background: rgba(232, 77, 77, 0.05);
  1253. &:hover {
  1254. background: #fad4d4;
  1255. }
  1256. }
  1257. }
  1258. .rowRight {
  1259. display: flex;
  1260. :deep(.el-input__wrapper) {
  1261. font-size: 1rem;
  1262. border-radius: 0.57rem;
  1263. }
  1264. .rowSearch {
  1265. cursor: pointer;
  1266. width: 3.9rem;
  1267. height: 3rem;
  1268. background: #3d7cff;
  1269. border-radius: 0.57rem;
  1270. font-size: 1.1rem;
  1271. color: #ffffff;
  1272. display: flex;
  1273. align-items: center;
  1274. justify-content: center;
  1275. margin-left: 0.7rem;
  1276. &:hover {
  1277. background: #77a3ff;
  1278. }
  1279. }
  1280. .searchInput {
  1281. width: 17rem;
  1282. height: 3rem;
  1283. margin: 0px 0.5rem 0px 0.5rem;
  1284. }
  1285. }
  1286. }
  1287. .contentTable {
  1288. margin-top: 2.3rem;
  1289. height: 36rem;
  1290. :deep(tr) {
  1291. border-radius: 0.57rem;
  1292. }
  1293. :deep(th) {
  1294. background: #f5f7fa;
  1295. height: 5rem;
  1296. font-size: 1.4rem;
  1297. color: #333746;
  1298. font-weight: 500;
  1299. }
  1300. :deep(td) {
  1301. height: 5rem;
  1302. font-size: 1.2rem;
  1303. color: #333333;
  1304. }
  1305. :deep(.cell) {
  1306. height: 2rem;
  1307. }
  1308. :deep(.el-checkbox) {
  1309. --el-checkbox-input-height: 2rem;
  1310. --el-checkbox-input-width: 2rem;
  1311. --el-checkbox-border-radius: 0.28rem;
  1312. // border: 1px solid #cad2d8;
  1313. }
  1314. :deep(.el-checkbox__inner:after) {
  1315. height: 1.07rem;
  1316. left: 0.64rem;
  1317. top: 0.21rem;
  1318. width: 0.5rem;
  1319. }
  1320. :deep(.el-checkbox__inner::before) {
  1321. top: 0.85rem;
  1322. }
  1323. :deep(.el-button) {
  1324. font-size: 1.2rem;
  1325. }
  1326. :deep(.el-table__inner-wrapper::before) {
  1327. height: 0px;
  1328. }
  1329. }
  1330. :deep(.classPagination) {
  1331. .el-pagination__rightwrapper {
  1332. justify-content: center;
  1333. .el-pagination__total {
  1334. color: #000000;
  1335. }
  1336. .btn-prev,
  1337. .btn-next {
  1338. background: #f7f7f7;
  1339. color: #000000;
  1340. border-radius: 1rem;
  1341. }
  1342. .number {
  1343. background: #f7f7f7;
  1344. color: #000000;
  1345. border-radius: 0.5rem;
  1346. }
  1347. .is-active {
  1348. background: #2c68ff;
  1349. color: #ffffff;
  1350. }
  1351. .el-pagination__jump {
  1352. color: #000000;
  1353. .el-pagination__editor.el-input {
  1354. width: 4.57rem;
  1355. .el-input__wrapper {
  1356. border-radius: 1rem;
  1357. }
  1358. }
  1359. }
  1360. }
  1361. }
  1362. }
  1363. :deep(.dialog) {
  1364. width: 55rem;
  1365. padding: 0;
  1366. border-radius: 1.1rem;
  1367. .el-dialog__header {
  1368. padding: 0px;
  1369. margin: 0px;
  1370. }
  1371. .dialog-title {
  1372. // width: 55rem;
  1373. width: 100%;
  1374. height: 5.9rem;
  1375. background: #2c68ff;
  1376. font-size: 1.8rem;
  1377. color: #ffffff;
  1378. display: flex;
  1379. align-items: center;
  1380. border-radius: 1.1rem 1.1rem 0 0;
  1381. padding-left: 4rem;
  1382. box-sizing: border-box;
  1383. }
  1384. .el-dialog__headerbtn {
  1385. font-size: 1.7rem;
  1386. width: 3.57rem;
  1387. height: 3.57rem;
  1388. top: 1rem;
  1389. right: 1rem;
  1390. .el-dialog__close {
  1391. color: #ffffff;
  1392. font-size: 3.7rem;
  1393. }
  1394. }
  1395. .dialogBody {
  1396. padding: 0.8rem 8rem 3.5rem 6.7rem;
  1397. box-sizing: border-box;
  1398. .el-form-item {
  1399. align-items: center;
  1400. margin-bottom: 2rem;
  1401. }
  1402. .el-form-item__label {
  1403. font-size: 1.2rem;
  1404. color: #000000;
  1405. padding-right: 2rem;
  1406. }
  1407. .el-input {
  1408. // height: 3.7rem;
  1409. // 这里不要限制高度,否则,多级联动多选的时候,样式会有问题,可以限制,最小高度
  1410. min-height: 3.7rem;
  1411. --el-input-bg-color: #efefef;
  1412. font-size: 1.2rem;
  1413. --el-input-border-radius: 0.57rem;
  1414. --el-input-border-color: #efefef;
  1415. --el-input-focus-border-color: #efefef;
  1416. --el-input-hover-border-color: #efefef;
  1417. .el-input__wrapper {
  1418. padding: 0 2rem;
  1419. }
  1420. }
  1421. .el-select {
  1422. .el-select__wrapper {
  1423. height: 3.7rem;
  1424. background-color: #efefef;
  1425. font-size: 1.2rem;
  1426. border-radius: 0.57rem;
  1427. // box-shadow: 0 0 0 1px #efefef inset;
  1428. padding: 0 2rem;
  1429. .el-select__caret {
  1430. color: #555555;
  1431. }
  1432. }
  1433. }
  1434. .dialogFoot {
  1435. display: flex;
  1436. justify-content: end;
  1437. margin-top: 4rem;
  1438. .el-button {
  1439. width: 8.5rem;
  1440. height: 3.2rem;
  1441. border-radius: 0.57rem;
  1442. font-size: 1.2rem;
  1443. }
  1444. }
  1445. .el-cascader {
  1446. width: 100%;
  1447. }
  1448. }
  1449. }
  1450. :deep(.del) {
  1451. .del-img {
  1452. width: 1.5rem;
  1453. height: 1.5rem;
  1454. margin-right: 0.3rem;
  1455. }
  1456. .del-name {
  1457. font-size: 1.2rem;
  1458. color: #e84d4d;
  1459. }
  1460. .el-dialog__body {
  1461. width: 100%;
  1462. height: 10rem;
  1463. display: flex;
  1464. justify-content: center;
  1465. padding-top: 3rem;
  1466. color: #000000;
  1467. box-sizing: border-box;
  1468. font-size: 1.2rem;
  1469. }
  1470. }
  1471. }
  1472. </style>