index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <div class="login-body">
  3. <div class="left-pic-container">
  4. <div class="left-pic-content">
  5. <div class="dt small-logo">
  6. <div class="cons">
  7. <img src="/img/login/bim.png" alt="" class="logos">
  8. <img src="/img/login/s1.png" alt="" class="shadow1">
  9. </div>
  10. </div>
  11. <div class="ds small-logo">
  12. <div class="cons">
  13. <img src="/img/login/gis.png" alt="" class="logos">
  14. <img src="/img/login/s1.png" alt="" class="shadow1">
  15. </div>
  16. </div>
  17. <div class="cc small-logo">
  18. <div class="cons">
  19. <img src="/img/login/bd.png" alt="" class="logos">
  20. <img src="/img/login/s1.png" alt="" class="shadow1">
  21. </div>
  22. </div>
  23. <div class="rp small-logo">
  24. <div class="cons">
  25. <img src="/img/login/ca.png" alt="" class="logos">
  26. <img src="/img/login/s1.png" alt="" class="shadow1">
  27. </div>
  28. </div>
  29. <div class="cube1">
  30. <div class="cons">
  31. <img src="/img/login/cube1.png" alt="" class="cubes">
  32. <img src="/img/login/s2.png" alt="" class="shadow2">
  33. </div>
  34. </div>
  35. <div class="cube2">
  36. <div class="cons">
  37. <img src="/img/login/cube2.png" alt="" class="cubes">
  38. <img src="/img/login/s3.png" alt="" class="shadow3">
  39. </div>
  40. </div>
  41. <div class="logo">
  42. <a href="http://hczc.hcxxy.com/" target="_blank">
  43. <div class="a-cons"/>
  44. </a>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="right-container">
  49. <div class="right-title">工程数字档案管理后台</div>
  50. <div class="sign-list">
  51. <h1 class="font-lg" style="margin-top:0">登录</h1>
  52. <userLogin></userLogin>
  53. <div class="remember-password">
  54. <el-checkbox v-model="checkbox" label="记住密码"/>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import userLogin from "./userlogin";
  62. import codeLogin from "./codelogin";
  63. import thirdLogin from "./thirdlogin";
  64. import {mapGetters} from "vuex";
  65. import {dateFormat} from "@/util/date";
  66. import {validatenull} from "@/util/validate";
  67. import topLang from "@/page/index/top/top-lang";
  68. import topColor from "@/page/index/top/top-color";
  69. import {getQueryString, getTopUrl} from "@/util/util";
  70. export default {
  71. name: "login",
  72. components: {
  73. userLogin,
  74. codeLogin,
  75. thirdLogin,
  76. topLang,
  77. topColor
  78. },
  79. data() {
  80. return {
  81. time: "",
  82. activeName: "user",
  83. socialForm: {
  84. tenantId: "000000",
  85. source: "",
  86. code: "",
  87. state: "",
  88. },
  89. checkbox:false,
  90. };
  91. },
  92. watch: {
  93. $route() {
  94. this.handleLogin();
  95. }
  96. },
  97. created() {
  98. this.handleLogin();
  99. this.getTime();
  100. },
  101. mounted() {
  102. },
  103. computed: {
  104. ...mapGetters(["website", "tagWel"])
  105. },
  106. props: [],
  107. methods: {
  108. getTime() {
  109. setInterval(() => {
  110. this.time = dateFormat(new Date());
  111. }, 1000);
  112. },
  113. handleLogin() {
  114. const topUrl = getTopUrl();
  115. const redirectUrl = "/oauth/redirect/";
  116. this.socialForm.source = getQueryString("source");
  117. this.socialForm.code = getQueryString("code");
  118. this.socialForm.state = getQueryString("state");
  119. if (validatenull(this.socialForm.source) && topUrl.includes(redirectUrl)) {
  120. let source = topUrl.split("?")[0];
  121. source = source.split(redirectUrl)[1];
  122. this.socialForm.source = source;
  123. }
  124. if (!validatenull(this.socialForm.source) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) {
  125. const loading = this.$loading({
  126. lock: true,
  127. text: '第三方系统登录中,请稍后。。。',
  128. spinner: "el-icon-loading"
  129. });
  130. this.$store.dispatch("LoginBySocial", this.socialForm).then(() => {
  131. window.location.href = topUrl.split(redirectUrl)[0];
  132. this.$router.push({path: this.tagWel.value});
  133. loading.close();
  134. }).catch(() => {
  135. loading.close();
  136. });
  137. }
  138. }
  139. }
  140. };
  141. </script>
  142. <style lang="scss">
  143. .login-body {
  144. position: relative;
  145. background-color: #F0FBFF;
  146. width: 100%;
  147. height: 100vh;
  148. padding: 50px 0;
  149. min-height: 730px;
  150. .left-logo {
  151. position: absolute;
  152. left: 30px;
  153. top: 30px;
  154. user-select: none;
  155. img {
  156. height: 50px;
  157. }
  158. }
  159. .left-pic-container {
  160. position: absolute;
  161. width: 750px;
  162. left: 10%;
  163. top: 50%;
  164. height: 630px;
  165. margin-top: -315px;
  166. .left-pic-content {
  167. width: 100%;
  168. height: 100%;
  169. position: relative;
  170. background-image: url("/img/login/bg.png");
  171. background-repeat: no-repeat;
  172. background-size: 100%;
  173. background-position: center;
  174. .small-logo {
  175. width: 110px;
  176. position: absolute;
  177. .cons {
  178. height: 160px;
  179. overflow: hidden;
  180. }
  181. .logos {
  182. width: 100%;
  183. margin-top: 30px;
  184. }
  185. .shadow1 {
  186. width: 64px;
  187. position: absolute;
  188. left: 44%;
  189. transform: translateX(-50%);
  190. bottom: -16px;
  191. }
  192. }
  193. .cons {
  194. position: relative;
  195. }
  196. .dt {
  197. left: 166px;
  198. top: 86px;
  199. .logos {
  200. animation: logoAnimate 4s 0.2s infinite alternate forwards;
  201. }
  202. .shadow1 {
  203. animation: logoShadowAnimate 4s 0.2s infinite alternate forwards;
  204. }
  205. }
  206. .ds {
  207. right: 176px;
  208. top: 54px;
  209. .logos {
  210. animation: logoAnimate 2.2s infinite alternate;
  211. }
  212. .shadow1 {
  213. animation: logoShadowAnimate 2.2s infinite alternate;
  214. }
  215. }
  216. .cc {
  217. right: 72px;
  218. bottom: 160px;
  219. .logos {
  220. animation: logoAnimate 2.5s 0.5s infinite alternate;
  221. }
  222. .shadow1 {
  223. animation: logoShadowAnimate 2.5s 0.5s infinite alternate;
  224. }
  225. }
  226. .rp {
  227. left: 290px;
  228. bottom: 76px;
  229. .logos {
  230. animation: logoAnimate 3s 0.9s infinite alternate;
  231. }
  232. .shadow1 {
  233. animation: logoShadowAnimate 3s 0.9s infinite alternate;
  234. }
  235. }
  236. .cubes {
  237. display: block;
  238. width: 100%;
  239. }
  240. .cube1 {
  241. width: 48px;
  242. right: 60px;
  243. top: 180px;
  244. position: absolute;
  245. .cons {
  246. height: 108px;
  247. position: relative;
  248. overflow: hidden;
  249. .cubes {
  250. animation: cube1LogoAnimate 2s infinite alternate;
  251. }
  252. .shadow2 {
  253. position: absolute;
  254. width: 56px;
  255. left: 48%;
  256. transform: translateX(-50%);
  257. bottom: -16px;
  258. animation: cube1ShadowAnimate 2s infinite alternate;
  259. }
  260. }
  261. }
  262. .cube2 {
  263. position: absolute;
  264. width: 56px;
  265. left: 130px;
  266. bottom: 190px;
  267. .cons {
  268. position: relative;
  269. height: 126px;
  270. overflow: hidden;
  271. .cubes {
  272. animation: cube2LogoAnimate 2s 0.3s infinite alternate;
  273. }
  274. .shadow3 {
  275. position: absolute;
  276. width: 64px;
  277. left: 48%;
  278. transform: translateX(-50%);
  279. bottom: -16px;
  280. animation: cube2ShadowAnimate 2s 0.3s infinite alternate;
  281. }
  282. }
  283. }
  284. .logo {
  285. right: 260px;
  286. top: 190px;
  287. width: 150px;
  288. position: absolute;
  289. height: 160px;
  290. cursor: pointer;
  291. .a-cons {
  292. width: 100%;
  293. height: 100%;
  294. }
  295. }
  296. }
  297. }
  298. .right-container {
  299. right: 18.667%;
  300. position: absolute;
  301. background: #ffffff;
  302. border-radius: 16px;
  303. transform: translateY(-50%);
  304. padding: 50px;
  305. width: 92%;
  306. top: 50%;
  307. max-width: 470px;
  308. margin: 0 auto;
  309. box-shadow: 0 21.2px 31.8px 0 rgba(26,26,26,0.12);
  310. .sign-list {
  311. position: relative;
  312. h1 {
  313. font-size: 40px;
  314. line-height: 48px;
  315. margin-bottom: 32px;
  316. }
  317. .title-tab {
  318. overflow: hidden;
  319. padding-bottom: 16px;
  320. div {
  321. float: left;
  322. line-height: 32px;
  323. font-size: 20px;
  324. color: #8C8889;
  325. transition: 0.3s;
  326. position: relative;
  327. padding-top: 16px;
  328. margin-left: 32px;
  329. user-select: none;
  330. &::before {
  331. content: '';
  332. width: 0;
  333. height: 2px;
  334. position: absolute;
  335. left: 50%;
  336. transform: translateX(-50%);
  337. bottom: 0;
  338. background: #1ECC95;
  339. border-radius: 3px;
  340. transition: 0.3s;
  341. }
  342. &:first-child {
  343. margin-left: 0;
  344. }
  345. &:not(.active) {
  346. cursor: pointer;
  347. }
  348. &.active {
  349. color: #353030;
  350. font-weight: bold;
  351. &::before {
  352. width: 100%;
  353. }
  354. }
  355. }
  356. }
  357. .form-box {
  358. position: relative;
  359. .el-input--large {
  360. --el-input-height: 48px;
  361. --el-input-border-radius: 8px;
  362. font-size: 16px;
  363. .el-input__wrapper {
  364. padding: 1px 16px;
  365. }
  366. }
  367. .clickable-text {
  368. color: #686565;
  369. cursor: pointer;
  370. transition: 0.2s;
  371. font-size: 14px;
  372. &:hover {
  373. color: #1ECC95
  374. }
  375. }
  376. .el-button--large {
  377. --el-button-size: 48px;
  378. height: 48px;
  379. padding: 12px 19px;
  380. font-size: 16px;
  381. border: 0;
  382. border-radius: 6px;
  383. background: linear-gradient(90deg,#1fd4af, #1ecc95 100%);
  384. }
  385. }
  386. }
  387. }
  388. }
  389. .right-title{
  390. font-size: 45px;
  391. position: absolute;
  392. top:-80px;
  393. font-weight: bold;
  394. }
  395. .login-submit {
  396. width: 100%;
  397. height: 45px;
  398. border: 1px solid #1ECC95;
  399. background: none;
  400. font-size: 18px;
  401. letter-spacing: 2px;
  402. font-weight: 300;
  403. color: #FFF;
  404. cursor: pointer;
  405. margin-top: 60px;
  406. font-family: "neo";
  407. transition: 0.25s;
  408. background: #1ECC95;
  409. border-color: #1ECC95;
  410. }
  411. .login-submit.el-button--primary:hover {
  412. background: #1ECC95;
  413. border-color: #1ECC95;
  414. color: #FFF;
  415. }
  416. .remember-password{
  417. position: relative;
  418. top:-130px;
  419. .el-checkbox__input.is-checked .el-checkbox__inner{
  420. background-color: #1ECC95;
  421. border-color: #1ECC95;
  422. }
  423. .el-checkbox__input.is-checked+.el-checkbox__label{
  424. color: #1ECC95;
  425. }
  426. }
  427. .login-form{
  428. div.el-form-item:first-child{
  429. display: none;
  430. }
  431. .el-input--small .el-input__inner{
  432. height: 50px;
  433. line-height: 50px;
  434. font-size: 16px;
  435. }
  436. .el-input__prefix{
  437. top: 5px;
  438. }
  439. [class^="icon-"]{
  440. font-size: 20px !important;
  441. }
  442. .el-input__icon{
  443. font-size: 16px !important;
  444. }
  445. }
  446. //动画效果
  447. @keyframes logoAnimate {
  448. 25% {
  449. -webkit-transform: translateY(0);
  450. -moz-transform: translateY(0);
  451. -ms-transform: translateY(0);
  452. -o-transform: translateY(0);
  453. transform: translateY(0);
  454. }
  455. 100% {
  456. -webkit-transform: translateY(-30px);
  457. -moz-transform: translateY(-30px);
  458. -ms-transform: translateY(-30px);
  459. -o-transform: translateY(-30px);
  460. transform: translateY(-30px);
  461. }
  462. }
  463. @keyframes logoShadowAnimate {
  464. 25% {
  465. width: 64px;
  466. margin-bottom: 0;
  467. }
  468. 100% {
  469. width: 30px;
  470. margin-bottom: 20px;
  471. }
  472. }
  473. @keyframes cube1LogoAnimate {
  474. 0% {
  475. -webkit-transform: translateY(0);
  476. -moz-transform: translateY(0);
  477. -ms-transform: translateY(0);
  478. -o-transform: translateY(0);
  479. transform: translateY(0);
  480. }
  481. 100% {
  482. -webkit-transform: translateY(30px);
  483. -moz-transform: translateY(30px);
  484. -ms-transform: translateY(30px);
  485. -o-transform: translateY(30px);
  486. transform: translateY(30px);
  487. }
  488. }
  489. @keyframes cube1ShadowAnimate {
  490. 0% {
  491. width: 20px;
  492. margin-bottom: 20px;
  493. }
  494. 100% {
  495. width: 56px;
  496. }
  497. }
  498. @keyframes cube2LogoAnimate {
  499. 0% {
  500. margin-top: 30px;
  501. }
  502. 100% {
  503. margin-top: 0;
  504. }
  505. }
  506. @keyframes cube2ShadowAnimate {
  507. 0% {
  508. width: 64px;
  509. }
  510. 100% {
  511. width: 30px;
  512. margin-bottom: 20px;
  513. }
  514. }
  515. </style>