changePws.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <template>
  2.  
  3. <div class="box">
  4. <div class="change-top">
  5. <div class="change-box">
  6. <el-select v-model="language.value" class="change-change">
  7. <el-option
  8. v-for="item in options"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value"
  12. >
  13. </el-option>
  14. </el-select>
  15. </div>
  16. <div></div>
  17. <div class="change-text" v-if="language.value == 'ZH'">修改密码</div>
  18. <div class="change-text" v-if="language.value == 'EN'">
  19. Change Password
  20. </div>
  21. <div class="change-text" v-if="language.value == 'FR'">
  22. Changer le mot de passe
  23. </div>
  24. <div class="change-text" v-if="language.value == 'RU'">
  25. Изменить пароль
  26. </div>
  27. <div class="change-pic">
  28. <img src="@/assets/ballot/close-l.png" alt="" />
  29. </div>
  30. </div>
  31. <div class="change-user-info" v-if="language.value == 'ZH'">
  32. <div class="change-item-id">
  33. <div class="change-title">ID:</div>
  34. <el-input v-model="changeList.id" placeholder="请输入ID"></el-input>
  35. </div>
  36. <div class="change-user-id">
  37. <div class="change-title">原密码:</div>
  38. <el-input
  39. v-model="changeList.oldPassword"
  40. placeholder="请输入原密码"
  41. show-password
  42. ></el-input>
  43. </div>
  44. <div class="change-user-pws">
  45. <div class="change-title">新密码:</div>
  46. <el-input
  47. placeholder="请输入新密码"
  48. v-model="changeList.password"
  49. show-password
  50. ></el-input>
  51. </div>
  52. <div class="change-user-yzm">
  53. <div class="change-title">新密码:</div>
  54. <el-input
  55. placeholder="请再次输入新密码"
  56. v-model="changeList.newPassword"
  57. show-password
  58. ></el-input>
  59. </div>
  60. <div class="user-change">密码规则:</div>
  61. <div class="user-long">1.&nbsp;&nbsp;密码长度:8-20位</div>
  62. <div class="user-style">
  63. 2.&nbsp;&nbsp;密码格式:大小写英文字母、数字、符合至少三项混合,并且符合安全规定。
  64. </div>
  65. <div class="user-change-pic" @click="sureChange">保 存</div>
  66. </div>
  67. <div class="change-user-info" v-if="language.value == 'EN'">
  68. <div class="change-item-id">
  69. <div class="change-title-info">ID:</div>
  70. <el-input
  71. v-model="changeList.id"
  72. placeholder="Please enter your login ID"
  73. ></el-input>
  74. </div>
  75. <div class="change-user-id">
  76. <div class="change-title-info">Old password:</div>
  77. <el-input
  78. v-model="changeList.oldPassword"
  79. placeholder="Please enter your old password"
  80. show-password
  81. >
  82. </el-input>
  83. </div>
  84. <div class="change-user-pws">
  85. <div class="change-title-info">New password:</div>
  86. <el-input
  87. placeholder="Please enter your new password"
  88. v-model="changeList.password"
  89. show-password
  90. >
  91. </el-input>
  92. </div>
  93. <div class="change-user-yzm">
  94. <div class="change-title-info">Confirm password:</div>
  95. <el-input
  96. placeholder="Please confirm your new password"
  97. v-model="changeList.newPassword"
  98. show-password
  99. >
  100. </el-input>
  101. </div>
  102. <div class="user-change">Password requirements:</div>
  103. <div class="user-long">
  104. 1.&nbsp;&nbsp;Password length:Between 8 and 20 characters
  105. </div>
  106. <div class="user-style">
  107. 2.&nbsp;&nbsp;Password format:uppercase letters, lowercase letters,
  108. digits, special characters. And your password must meet security
  109. requirements.
  110. </div>
  111. <div class="user-change-pic" @click="sureChange">Save</div>
  112. </div>
  113. <div class="change-user-info" v-if="language.value == 'FR'">
  114. <div class="change-item-id">
  115. <div class="change-title">ID:</div>
  116. <el-input
  117. v-model="changeList.id"
  118. placeholder="Veuillez saisir votre identifiant de connexion"
  119. >
  120. </el-input>
  121. </div>
  122. <div class="change-user-id">
  123. <div class="change-title">Ancien mot de passe:</div>
  124. <el-input
  125. v-model="changeList.oldPassword"
  126. placeholder="Veuillez saisir votre ancien mot de passe"
  127. show-password
  128. ></el-input>
  129. </div>
  130. <div class="change-user-pws">
  131. <div class="change-title">Nouveau mot de passe:</div>
  132. <el-input
  133. placeholder="Veuillez saisir votre nouveau mot de passe"
  134. v-model="changeList.password"
  135. show-password
  136. ></el-input>
  137. </div>
  138. <div class="change-user-yzm">
  139. <div class="change-title">Confirmer le mot de passe:</div>
  140. <el-input
  141. placeholder="Veuillez confirmer votre nouveau mot de passe"
  142. v-model="changeList.newPassword"
  143. show-password
  144. ></el-input>
  145. </div>
  146. <div class="user-change">Mot de passe requis :</div>
  147. <div class="user-long">
  148. 1.&nbsp;&nbsp;Longueur du mot:entre 8 et 20 caractères
  149. </div>
  150. <div class="user-style">
  151. 2.&nbsp;&nbsp;Format du mot de passe: lettres majuscules, lettres
  152. minuscules, chiffres, caractères spéciaux. Et votre mot de passe doit
  153. répondre aux exigences de sécurité.
  154. </div>
  155. <div class="user-change-pic" @click="sureChange">保 存</div>
  156. </div>
  157. <div class="change-user-info" v-if="language.value == 'RU'">
  158. <div class="change-item-id">
  159. <div class="change-title">ID:</div>
  160. <el-input
  161. v-model="changeList.id"
  162. placeholder="Введите ваш логин"
  163. ></el-input>
  164. </div>
  165. <div class="change-user-id">
  166. <div class="change-title">Старый пароль:</div>
  167. <el-input
  168. v-model="changeList.oldPassword"
  169. placeholder="Введите старый пароль"
  170. show-password
  171. ></el-input>
  172. </div>
  173. <div class="change-user-pws">
  174. <div class="change-title">Новый пароль:</div>
  175. <el-input
  176. placeholder="Введите новый пароль"
  177. v-model="changeList.password"
  178. show-password
  179. ></el-input>
  180. </div>
  181. <div class="change-user-yzm">
  182. <div class="change-title">Подтвердить:</div>
  183. <el-input
  184. placeholder="Подтвердить ваш новый пароль"
  185. v-model="changeList.newPassword"
  186. show-password
  187. >
  188. </el-input>
  189. </div>
  190. <div class="user-change">Требования к паролям:</div>
  191. <div class="user-long">
  192. 1.&nbsp;&nbsp;Длина пароля:от 8 до 20 символов
  193. </div>
  194. <div class="user-style">
  195. 2.&nbsp;&nbsp;Формат шифрования:заглавные и строчные буквы, цифры и
  196. специальные символы. Ваш пароль должен соответствовать требованиям к
  197. безопасности
  198. </div>
  199. <div class="user-change-pic" @click="sureChange">Сохранить</div>
  200. </div>
  201. <div class="change-btm-pic">
  202. <img src="@/assets/ballot/未标题-2.png" alt="" />
  203. </div>
  204. </div>
  205. </template>
  206. <script>
  207. import { BallotChanges } from '@/api/ballot/ballot'
  208. export default {
  209. name: 'ballotLogin',
  210. data() {
  211. return {
  212. options: [
  213. {
  214. value: 'ZH',
  215. label: '中文',
  216. },
  217. {
  218. value: 'EN',
  219. label: 'English',
  220. },
  221. {
  222. value: 'FR',
  223. label: 'Français',
  224. },
  225. {
  226. value: 'RU',
  227. label: 'Русский',
  228. },
  229. ],
  230. language: {
  231. value: 'ZH',
  232. },
  233. changeList: {
  234. id: undefined,
  235. oldPassword: undefined,
  236. password: undefined,
  237. newPassword: undefined,
  238. },
  239. }
  240. },
  241. mounted() {},
  242. methods: {
  243. sureChange() {
  244. if (this.changeList.password != this.changeList.newPassword) {
  245. if (this.language.value == 'ZH') {
  246. this.$message.warning('两次密码不一致,请重新输入!')
  247. }
  248. if (this.language.value == 'EN') {
  249. this.$message.warning(
  250. 'The two passwords are not the same, please re-enter!'
  251. )
  252. }
  253. if (this.language.value == 'FR') {
  254. this.$message.warning(
  255. 'Les deux mots de passe ne correspondent pas, veuillez les saisir à nouveau!'
  256. )
  257. } else {
  258. this.$message.warning(
  259. 'Два неверных пароля, пожалуйста, введите снова!'
  260. )
  261. }
  262. } else {
  263. let params = {
  264. id: this.changeList.id,
  265. oldPassword: this.changeList.oldPassword,
  266. password: this.changeList.password,
  267. }
  268. console.log(params)
  269. BallotChanges(params).then((res) => {
  270. console.log(res)
  271. if (this.language.value == 'ZH') {
  272. this.$message.success('修改成功,请重新登录')
  273. }
  274. if (this.language.value == 'EN') {
  275. this.$message.success(
  276. 'If the modification is successful, log in again'
  277. )
  278. }
  279. if (this.language.value == 'FR') {
  280. this.$message.success(
  281. 'Modification réussie, veuillez vous reconnecter'
  282. )
  283. } else {
  284. this.$message.success('Удачная модификация')
  285. }
  286. })
  287. }
  288. },
  289. },
  290. }
  291. </script>
  292. <style scoped>
  293. .box {
  294. margin: 20px auto;
  295. width: 650px;
  296. height: 570px;
  297. background: linear-gradient(0deg, #00b4ff 0%, #094fc0 100%);
  298. box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.5);
  299. overflow: hidden;
  300. }
  301. .change-top {
  302. width: 650px;
  303. height: 81px;
  304. background: #f5f5f5;
  305. border-radius: 4px 4px 0px 0px;
  306. position: relative;
  307. }
  308. .change-change {
  309. width: 120px;
  310. height: 41px;
  311. line-height: 41px;
  312. font-size: 14px;
  313. transform: translateX(30px) translateY(20px);
  314. }
  315. .change-text {
  316. width: 260px;
  317. height: 20px;
  318. text-align: center;
  319. font-size: 20px;
  320. font-family: PingFangSC-Medium, PingFang SC;
  321. font-weight: 500;
  322. color: #262626;
  323. line-height: 20px;
  324. position: absolute;
  325. top: 32px;
  326. left: 191px;
  327. }
  328. .change-pic {
  329. width: 25px;
  330. height: 24px;
  331. text-align: center;
  332. overflow: hidden;
  333. border-radius: 20px;
  334. cursor: pointer;
  335. position: absolute;
  336. top: 32px;
  337. right: 21px;
  338. }
  339. .change-pic > img {
  340. width: 100%;
  341. height: 100%;
  342. }
  343. .change-user-info {
  344. width: 650px;
  345. height: 508px;
  346. padding: 0 40px;
  347. }
  348. .change-item-id {
  349. width: 570px;
  350. height: 51px;
  351. margin-top: 10px;
  352. position: relative;
  353. }
  354. .change-user-id {
  355. width: 570px;
  356. height: 51px;
  357. margin-top: 10px;
  358. position: relative;
  359. }
  360. .change-user-id {
  361. width: 570px;
  362. height: 51px;
  363. margin-top: 10px;
  364. position: relative;
  365. }
  366. .change-user-pws {
  367. width: 570px;
  368. height: 51px;
  369. margin-top: 10px;
  370. position: relative;
  371. }
  372. .change-user-yzm {
  373. width: 570px;
  374. height: 51px;
  375. margin-top: 10px;
  376. position: relative;
  377. }
  378. .change-title {
  379. height: 39px;
  380. line-height: 39px;
  381. z-index: 999;
  382. width: 170px;
  383. font-size: 13px;
  384. text-align: left;
  385. border-radius: 10px;
  386. position: absolute;
  387. top: 0;
  388. left: 8px;
  389. }
  390. .change-title-info {
  391. height: 39px;
  392. line-height: 39px;
  393. z-index: 999;
  394. width: 130px;
  395. text-align: left;
  396. border-radius: 10px;
  397. font-size: 14px;
  398. position: absolute;
  399. top: 0;
  400. left: 8px;
  401. }
  402. .user-change-pic {
  403. width: 570px;
  404. height: 59px;
  405. text-align: center;
  406. line-height: 59px;
  407. cursor: pointer;
  408. font-size: 24px;
  409. color: #fff;
  410. margin-top: 50px;
  411. background: linear-gradient(177deg, #84e2ff 0%, #30ade8 100%);
  412. box-shadow: 0px 2px 4px 0px #097fb0,
  413. inset 0px 3px 3px 0px rgba(194, 235, 255, 0.63);
  414. border-radius: 8px;
  415. }
  416. .user-change {
  417. width: 570px;
  418. height: 16px;
  419. font-size: 16px;
  420. font-family: PingFangSC-Regular, PingFang SC;
  421. font-weight: 400;
  422. color: #333333;
  423. line-height: 16px;
  424. margin-left: 10px;
  425. }
  426. .user-style {
  427. width: 570px;
  428. height: 24px;
  429. font-size: 16px;
  430. margin-top: 10px;
  431. margin-left: 10px;
  432. font-family: PingFangSC-Regular, PingFang SC;
  433. font-weight: 400;
  434. color: #333333;
  435. line-height: 24px;
  436. }
  437. .user-long {
  438. width: 570px;
  439. height: 20px;
  440. font-size: 16px;
  441. margin-top: 10px;
  442. margin-left: 10px;
  443. font-family: PingFangSC-Regular, PingFang SC;
  444. font-weight: 400;
  445. color: #333333;
  446. line-height: 20px;
  447. }
  448. .change-btm-pic {
  449. width: 570px;
  450. position: absolute;
  451. top: 535px;
  452. }
  453. .change-btm-pic > img {
  454. width: 100%;
  455. }
  456. /deep/.change-user-info .el-input__inner {
  457. padding-left: 180px;
  458. background-color: #f5f5f5;
  459. color: #000;
  460. }
  461. </style>