ManageUser.vue 50 KB

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