| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692 |
- <template>
- <div style="width: 100%; overflow: hidden; background-color: white">
- <div class="back-width">
- <div class="title_png"></div>
- <div class="login-body">
- <el-carousel arrow indicator-position="none" height="590px" :interval="20000">
- <el-carousel-item v-for="(img,index) in imgList" :key="index">
- <img style="width: 100%; height: 100%;" v-bind:src="img.url" >
- </el-carousel-item>
- </el-carousel>
- <section class="login">
- <el-card class="box-card" style="background:rgba(255,255,255,0.8)">
- <div slot="header" class="clearfix">
- <i class="el-icon-s-cooperation"></i>
- <span style="font-weight: bold; margin-left: 5px">登录</span>
- <!--<el-button style="float: right; padding: 3px 0" type="text">欢迎使用</el-button>-->
- </div>
- <!--<el-menu size="small"
- :default-active="activeIndex+''"
- @select="handleSelect"
- mode="horizontal">
- <el-menu-item index="0">
- <i class="el-icon-tickets"></i>
- <span><b>登录</b></span>
- </el-menu-item>
- </el-menu>-->
- <el-row :gutter="8">
- <el-col :span="13">
- <el-table :data="noticeList"
- size="mini" highlight-current-row stripe
- style="width: 100%; height: 145px;"
- :row-style="getRowstyle">
- <el-table-column prop="Name" label="通知通告" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-link :href="getDownloadFile(scope.row.FileURL)"target="_blank"type="primary">{{ scope.row.Name }}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="CreateOn"
- label="发布时间"
- width="141">
- <template slot-scope="scope">{{ jstimehandle(scope.row.CreateOn+'') }}</template>
- </el-table-column>
- <el-table-column width="80">
- <template slot-scope="scope"><span style="font-size: 15px; color: #f13f40">{{strnew(scope.row.CreateOn+'') }}</span></template>
- </el-table-column>
- </el-table>
- <router-link style="font-size: 15px; color: black; float: right; padding: 3px 0" :underline="false" :to="'/datadown'">+更多</router-link>
- <el-table :data="fileList"
- size="mini" highlight-current-row stripe
- style="width: 100%; height: 145px;"
- :row-style="getRowstyle">
- <el-table-column prop="Name" label="资料下载" show-overflow-tooltip>
- <template slot-scope="scope">
- <!--<i class="el-icon-caret-right"></i>-->
- <el-link :href="getDownloadFile(scope.row.FileURL)"
- target="_blank"
- type="primary">{{ scope.row.Name }}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="CreateOn"
- label="发布时间"
- width="141">
- <template slot-scope="scope">{{ jstimehandle(scope.row.CreateOn+'') }}</template>
- </el-table-column>
- <el-table-column width="80">
- <template slot-scope="scope"><span style="font-size: 15px; color: #f13f40">{{strnew(scope.row.CreateOn+'') }}</span></template>
- </el-table-column>
- </el-table>
- <router-link style="font-size: 15px;color: black; float: right; padding: 3px 0" :underline="false" :to="'/documentdown'">+更多</router-link>
- </el-col>
- <el-col :span="1" content-position="center">
- <div style="height: 300px; width: 1px; background-color: #cccccc; margin-left: 12px"></div>
- </el-col>
- <el-col :span="9">
- <el-form class="login-form"
- auto-complete="off"
- :model="model"
- :rules="rules"
- ref="user"
- label-position="left">
- <el-form-item style="margin-top:5px"
- label=""
- prop="username">
- <el-input prefix-icon="el-icon-user-solid"
- type="text" style="background:rgba(255,255,255,0.8)"
- v-model="model.username"
- placeholder="请输入用户名">
- <el-select v-model="loginMode"
- slot="append"
- placeholder="登录类型"
- style="width: 125px;">
- <el-option label="PTR认证"
- :value="2"></el-option>
- <el-option label="普通账户"
- :value="1"></el-option>
- </el-select>
- </el-input>
- </el-form-item>
- <el-form-item style="margin-top:20px"
- label=""
- prop="password">
- <el-input type="password"
- prefix-icon="el-icon-s-goods"
- v-model="model.password"
- placeholder="请输入密码" />
- </el-form-item>
- <el-row>
- <el-col :span="16">
- <el-form-item style="margin-top:10px"
- label=""
- prop="verifycode">
- <el-input v-model="model.verifycode"
- prefix-icon="el-icon-view"
- placeholder="请输入验证码"
- @keyup.enter.native="loginall()"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item>
- <div class="identifybox">
- <div @click="refreshCode"
- title="看不清,换一张">
- <s-identify :identifyCode="identifyCode"></s-identify>
- </div>
- <!-- <el-button @click="refreshCode" type='text' class="textbtn">看不清,换一张</el-button> -->
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-button type="primary"
- :loading="loading"
- @click="loginall()">{{ loading ? '登录中...' : '登录系统' }}</el-button>
- <el-row style="margin-top: 5px" :gutter="10">
- <el-col :span="12">
- <router-link :to="'/signup'">
- <el-button type="plain" style="background:rgba(255,255,255,0.8)">注册账号</el-button>
- </router-link>
- </el-col>
- <el-col :span="12">
- <router-link :to="'/passwordback'">
- <el-button type="plain" style="background:rgba(255,255,255,0.8)">忘记密码</el-button>
- </router-link>
- </el-col>
- </el-row>
- </el-form>
- </el-col>
- </el-row>
- </el-card>
- </section>
- </div>
- </div>
- <div >
- <footer class="login-footer" style="color:#A9A9A9;padding-bottom: 30px">
- <span style="font-size: 16px">技术支持:QQ群咨询,除特殊情况外,暂不提供电话支持<br></span>
- <span style="font-size: 16px">推荐使用谷歌浏览器、360浏览器(极速模式)等,Chrome内核浏览器打开本系统</span>
- </footer>
- </div>
- </div>
- </template>
- <script>
- import Vue from 'vue'
- import Component from 'class-component'
- import Sticky from '@/components/Sticky'
- import api from '@/api/rtxservice/rtx'
- import SIdentify from '@/components/VCode.vue'
- @Component({
- data () {
- const validateVerifycode = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请输入验证码'))
- } else if (value !== this.identifyCode) {
- callback(new Error('验证码不正确'))
- } else {
- callback()
- }
- }
- // form model
- // TODO: remove default values
- const model = {
- username: '',
- password: '',
- verifycode: ''
- }
- // form validate rules
- const rules = {
- username: [
- {
- required: true,
- trigger: 'blur',
- message: '请输入用户名'
- }
- ],
- password: [
- {
- required: true,
- trigger: 'blur',
- message: '请输入密码'
- }
- ],
- verifycode: [
- {
- required: true,
- trigger: 'blur',
- validator: validateVerifycode
- }
- ]
- }
- return {
- imgList:[
- {
- url:require('../assets/img/lunbo_1.jpg')
- },{
- url:require('../assets/img/GF002.png')
- },{
- url:require('../assets/img/GF003.png')
- },{
- url:require('../assets/img/lunbo_2.jpg')
- }
- ],
- loginMode: parseInt(process.client ? (window.localStorage.getItem('loginMode') ? window.localStorage.getItem('loginMode') : 2) : 2),
- model: model,
- rules: rules,
- error: null,
- loading: false,
- noticeList: [], // 通知列表
- fileList: [], // 文档列表
- activeName: 'first',
- activeIndex: '0',
- flag: 0,
- identifyCode: '',
- identifyCodes: '1234567890'
- }
- },
- // beforeCreate () {
- // if (process.client) {
- // const myDomain = window.location.host
- // if (myDomain.indexOf('60.30.245.229') > -1) {
- // window.location.href = 'http://60.30.245.229/loginclient/'
- // }
- // }
- // },
- created () {
- this.initNoticeListData()
- this.initFileListData()
- this.identifyCode = ''
- this.makeCode(this.identifyCodes, 4)
- },
- components: {
- Sticky,
- SIdentify
- },
- methods: {
- getRowstyle () {
- return 'background:rgba(255,255,255,0.8)'
- },
- // 生成随机数
- randomNum (min, max) {
- return Math.floor(Math.random() * (max - min) + min)
- },
- // 切换验证码
- refreshCode () {
- this.identifyCode = ''
- this.makeCode(this.identifyCodes, 4)
- },
- // 生成四位随机验证码
- makeCode (o, l) {
- for (let i = 0; i < l; i++) {
- this.identifyCode += this.identifyCodes[this.randomNum(0, this.identifyCodes.length)]
- }
- },
- // 获取通知列表
- initNoticeListData () {
- let _this = this
- // 传递列名
- const params = {
- colName: 'NoticeTab',
- RangeType: '1,3'
- }
- _this.$axios
- .get('/document/getdocumentnameandtimelogin', { params })
- .then(function (response) {
- _this.noticeList = response.data
- })
- .catch(function (error) {
- console.log(error)
- })
- },
- // 获取文件列表
- initFileListData () {
- let _this = this
- // 传递列名
- const params = {
- colName: 'DocTab',
- RangeType: '1,3'
- }
- _this.$axios
- .get('/document/getdocumentnameandtimelogin', { params })
- .then(function (response) {
- _this.fileList = response.data
- })
- .catch(function (error) {
- console.log(error)
- })
- },
- // 下载文件
- DownloadFile (row) {
- let val = row.FileURL
- let urlArr = val.split('|')
- location.href = 'http://' + urlArr[0]
- },
- getDownloadFile (val) {
- let urlArr = val.split('|')
- let retUrl = urlArr[0]
- // 内网服务器专用
- if (process.client && retUrl.indexOf('/upfile') === 0) {
- const myDomain = window.location.host
- retUrl = myDomain + '/' + retUrl
- }
- return 'http://' + retUrl
- },
- // 格式化时间
- jstimehandle (val) {
- if (val === '') {
- return '----'
- } else if (val === '0001-01-01T08:00:00+08:00') {
- return '----'
- } else if (val === '5000-01-01T23:59:59+08:00') {
- return '永久'
- } else {
- val = val.replace('T', ' ')
- return val.substring(0, 10)
- }
- },
- strnew (val) {
- try {
- let b = this.jstimehandle(val).split('-')
- let date = new Date(b[0], b[1], b[2])
- let newdate = new Date()
- if ((newdate - date) / (1000 * 60 * 60 * 24) < 30) {
- return '新'
- } else {
- return ''
- }
- } catch (e) {
- return ''
- }
- },
- handleSelect (key, keyPath) {
- this.activeIndex = key
- },
- isChrome () {
- // 取得浏览器的userAgent字符串
- let userAgent = navigator.userAgent
- // 判断是否Chrome浏览器
- if (userAgent.indexOf('Chrome') > -1) {
- return true
- } else {
- return false
- }
- },
- loginall () {
- if (process.client) {
- window.localStorage.setItem('loginMode', this.loginMode)
- }
- if (this.loginMode === 1) {
- this.login()
- } else {
- this.$refs.user.validate((valid) => {
- if (valid) {
- this.loginptr()
- }
- })
- }
- },
- loginptr () {
- let params = {
- username: this.model.username,
- password: this.model.password
- }
- api
- .rtxLogin(params, this.$axios)
- .then(res => {
- if (res.data.items === 1) {
- this.flag = 1
- this.login()
- } else if (res.data.items === 2) {
- this.flag = 2
- this.login()
- } else if (res.data.items === 3) {
- this.$message.error({
- duration: 10000,
- message: '您无权限登陆本系统'
- })
- } else {
- this.$message.error({
- duration: 10000,
- message: '账号或密码错误'
- })
- }
- this.identifyCode = ''
- this.makeCode(this.identifyCodes, 4)
- })
- .catch(err => {
- this.$message.error({
- duration: 10000,
- message: '账号或密码错误'
- })
- console.error(err)
- this.identifyCode = ''
- this.makeCode(this.identifyCodes, 4)
- })
- }
- }
- })
- export default class Login extends Vue {
- layout () {
- return 'empty'
- }
- login () {
- if (!this.isChrome()) {
- this.$alert(
- '请用谷歌浏览器、360浏览器(极速模式)等,Chrome内核浏览器打开本系统',
- '不支持的浏览器',
- {}
- )
- return false
- }
- this.logging = true
- this.$refs.user.validate(async valid => {
- try {
- if (valid) {
- await this.$store.dispatch('auth/login', {
- fields: {
- username: this.model.username.replace(/(^\s*)|(\s*$)/g, ''),
- password: this.model.password.replace(/(^\s*)|(\s*$)/g, ''),
- flag: this.flag
- }
- })
- if (process.env.appclient === 'lims') {
- this.$router.push(this.$route.query.page || '/')
- } else if (process.env.appclient === 'cellbank') {
- this.$router.push(this.$route.query.page || '/indexdqm')
- } else {
- this.$router.push(this.$route.query.page || '/')
- }
- }
- } catch (e) {
- if (e.response.status === 777) {
- this.$message({
- showClose: true,
- message: '您无权限登录本系统',
- type: 'warning',
- duration: 5000
- })
- } else {
- this.$message({
- showClose: true,
- message: '账号或密码错误',
- type: 'warning',
- duration: 5000
- })
- }
- this.identifyCode = ''
- this.makeCode(this.identifyCodes, 4)
- } finally {
- this.logging = false
- }
- })
- }
- logout () {
- this.$store.dispatch('logout')
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../assets/styles/base/variables";
- .el-form-item {
- margin-bottom: 10px;
- }
- .identifybox {
- margin-top: 12px;
- margin-left: 20px;
- }
- .identifybox:hover {
- cursor: pointer;
- }
- .components-container-my div {
- margin-top: 20px;
- }
- .top-wrapper {
- margin: 0px auto;
- width: 1004px;
- /*text-align: right;
- alignment: right;*/
- flex-direction: row;
- }
- .home-wrapper-my {
- margin: 0px auto;
- width: 1004px;
- flex-direction: column;
- margin-bottom: 45px;
- }
- .foot-wrapper {
- margin: 0px auto;
- width: 1004px;
- display: flex;
- alignment: center;
- align-items: center;
- flex-direction: column;
- }
- .back-width1 {
- background-color: #2f79f6;
- margin: 0px auto;
- left: 0;
- right: 0;
- top: 20px;
- width: 1004px;
- }
- .login-footer1 {
- position: fixed;
- background-color: #34393d;
- font-size: 10px;
- clear: both;
- display: block;
- text-align: center;
- margin: 0px auto;
- bottom: 0px;
- width: 100%;
- }
- /*-----------*/
- .time {
- font-size: 13px;
- color: #999;
- }
- .bottom {
- margin-top: 13px;
- line-height: 12px;
- }
- .button {
- padding: 0;
- float: right;
- }
- .image {
- width: 100%;
- display: block;
- }
- .clearfix:before,
- .clearfix:after {
- display: table;
- content: "";
- }
- .clearfix:after {
- clear: both;
- }
- .back-width {
- position: absolute;
- background-color: white;
- left: 0;
- right: 0;
- top: -135px;
- bottom: 0;
- margin: auto;
- width: 100%;
- height: 675px;
- }
- .title_png {
- background: url("../assets/img/title_login.png");
- font-family: "Open Sans", sans-serif;
- background-repeat: no-repeat;
- background-position: center;
- height: 135px;
- width: 100%;
- }
- .login-body {
- // background: url("../assets/img/gf20190715.png");
- // font-family: "Open Sans", sans-serif;
- // background-repeat: no-repeat;
- // background-position: center;
- // background-color: #0483d8;
- width: 100%;
- height: 580px;
- z-index: -20;
- /*margin: auto;
- left: 0px;
- top: 0px;
- right: 0;
- bottom: 0;
- width: 100%;
- height: calc(100vh - 40px);*/
- }
- .el-carousel{
- width: 100%;
- }
- .login-footer {
- font-size: 10px;
- clear: both;
- display: block;
- text-align: center;
- margin: 0px auto;
- position: absolute;
- bottom: 11px;
- width: 100%;
- a {
- color: $brand-color;
- }
- }
- .login {
- position: relative;
- max-width: 52rem;
- margin: 0 auto; /*水平居中*/
- top: -280px; /*偏移*/
- transform: translateY(-50%);
- font-size: 0.875rem;
- opacity: 1;
- z-index: 200;
- &-header {
- margin-bottom: 1rem;
- .brand {
- margin: 4.5rem 0 3.5rem;
- text-align: center;
- letter-spacing: 0.125rem;
- a {
- margin: 0;
- color: $brand-color;
- font: 300 3rem sans-serif;
- &:hover {
- color: $brand-hover-color;
- text-shadow: 0 0 1rem $brand-hover-color;
- }
- }
- }
- }
- &-form {
- /*margin-bottom: 2.5rem;
- padding: 1.875rem 1.25rem;
- background: $login-form-background;*/
- color: $login-form-color;
- /*.heading {
- margin: 0 0 1rem;
- font-weight: 400;
- font-size: 1.5rem;
- }*/
- .el-button {
- margin-top: 0.5rem;
- width: 100%;
- }
- }
- .el-table,
- .el-table__expanded-cell {
- background-color: rgba(255,255,255,0.8)
- }
- }
- </style>
|