Compare commits
11 Commits
tab2026020
...
1373b56b94
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1373b56b94 | ||
|
|
23f4390a9b | ||
|
|
1f08afd8d3 | ||
|
|
c64012e4ea | ||
|
|
cffdd0f7ba | ||
| 1ba1186ee2 | |||
| a869e62351 | |||
| 458ac46ca4 | |||
|
|
8ec6582ffc | ||
|
|
7110ba358c | ||
| b6fcf5c32b |
@@ -8,6 +8,14 @@ export function login (data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function logincas (data) {
|
||||
return request({
|
||||
url: 'accessUser/logincas',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function logout () {
|
||||
return request({
|
||||
url: 'accessUser/logout',
|
||||
|
||||
@@ -271,7 +271,6 @@ export default {
|
||||
return { top: top, left: left }
|
||||
},
|
||||
objToOne(obj) {
|
||||
console.log(obj)
|
||||
let tmpData = {}
|
||||
for (let index in obj) {
|
||||
if (typeof obj[index] == 'object' && !this.isArrayFn(obj[index])) {
|
||||
|
||||
@@ -6,7 +6,6 @@ export default router
|
||||
const whiteList = ['/login', '/aj/**', '/el/**', '/bigscreen/viewer', '/excelreport/viewer']
|
||||
// 判断是否需要登录权限 以及是否登录
|
||||
router.beforeEach((to, from, next) => {
|
||||
|
||||
NProgress.start()
|
||||
let token = getToken();
|
||||
let lideeUser = getAccessUser();
|
||||
@@ -18,6 +17,7 @@ router.beforeEach((to, from, next) => {
|
||||
next()
|
||||
}
|
||||
}else {
|
||||
|
||||
if (whiteList.includes(to.path)) {
|
||||
next()
|
||||
}else {
|
||||
|
||||
@@ -250,7 +250,8 @@ export const constantRouterMap = [
|
||||
component: () => import('@/views/bigscreenDesigner/viewer'),
|
||||
hidden: true,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
requireAuth: true,
|
||||
keepAlive: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import axios from 'axios'
|
||||
import { Message, MessageBox } from 'element-ui'
|
||||
import router from '../router'
|
||||
import store from '../store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.BASE_API, // api 的 base_url
|
||||
timeout: 20000 // 请求超时时间
|
||||
timeout: 200000 // 请求超时时间
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
@@ -41,7 +42,13 @@ service.interceptors.response.use(
|
||||
// sessionStorage.clear()
|
||||
// localStorage.clear()
|
||||
localStorage.removeItem('AJReportToken')
|
||||
window.location.href = "/";
|
||||
router.push({
|
||||
path: '/login',
|
||||
query: {
|
||||
redirect: location.hash.substring(1)
|
||||
}
|
||||
})
|
||||
// window.location.href = "/index?redirect=" + location.hash.substring(1);
|
||||
})
|
||||
}
|
||||
else if (res.code !== '200') {
|
||||
|
||||
@@ -259,7 +259,7 @@ export default {
|
||||
},
|
||||
// 列表查询
|
||||
async handleQueryPageList() {
|
||||
debugger
|
||||
|
||||
// 将特殊参数值urlcode处理
|
||||
// 默认的排序
|
||||
if (
|
||||
|
||||
@@ -538,7 +538,10 @@ export default {
|
||||
},
|
||||
handleCollapse(val){
|
||||
this.dialogVisibleDrillDrown=true
|
||||
this.screenData=val.drill_drown_setting?val.drill_drown_setting:this.screenData
|
||||
this.screenData=val.drill_drown_setting?val.drill_drown_setting:{
|
||||
dashboard: { },
|
||||
widgets: []
|
||||
}
|
||||
},
|
||||
// 获取图层数据
|
||||
getLayerData(val) {
|
||||
|
||||
@@ -66,6 +66,14 @@ export const widgetTable = {
|
||||
placeholder: '',
|
||||
value: false
|
||||
},
|
||||
{
|
||||
type: 'el-switch',
|
||||
label: '序号',
|
||||
name: 'isIndex',
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value: false
|
||||
},
|
||||
{
|
||||
type: 'el-input-number',
|
||||
label: '边框宽度',
|
||||
@@ -314,8 +322,44 @@ export const widgetTable = {
|
||||
value: 1
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
],
|
||||
{
|
||||
type: 'el-switch',
|
||||
label: '开启下钻',
|
||||
name: 'is_drill_drown',
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
type: 'el-collapse',
|
||||
label: '下钻配置',
|
||||
name: 'drill_drown_setting',
|
||||
relactiveDom:'is_drill_drown',
|
||||
relactiveDomValue:true,
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value:''
|
||||
},
|
||||
{
|
||||
type: 'el-switch',
|
||||
label: '阅读模式',
|
||||
name: 'is_read_mode',
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
type: 'vue-color',
|
||||
label: '阅读模式颜色',
|
||||
name: 'read_color',
|
||||
relactiveDom:'is_read_mode',
|
||||
relactiveDomValue:true,
|
||||
required: false,
|
||||
placeholder: '',
|
||||
value:''
|
||||
},
|
||||
{
|
||||
type: 'dynamic-add-table',
|
||||
label: '',
|
||||
|
||||
@@ -3,26 +3,43 @@
|
||||
<superslide v-if="hackReset" :options="options" class="txtScroll-top" ref="superslide">
|
||||
<!--表头-->
|
||||
<div class="title">
|
||||
<div
|
||||
v-if="isIndex"
|
||||
:style="[headerTableStyle, tableRowHeight()]">
|
||||
序号
|
||||
</div>
|
||||
<div v-for="(item, index) in header" :key="index"
|
||||
:style="[headerTableStyle, tableFiledWidth(index), tableRowHeight()]">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--数据-->
|
||||
<div class="bd">
|
||||
<div class="bd" @click="handleClick">
|
||||
<ul class="infoList">
|
||||
<li v-for="(item, index) in list" :key="index" :style="tableRowHeight()">
|
||||
<div v-for="(itemChild, idx) in header"
|
||||
<li v-for="(item, index) in list" :key="index" :style="tableRowHeight()">
|
||||
<div
|
||||
v-if="isIndex"
|
||||
:style="[
|
||||
bodyTableStyle,
|
||||
bodyTable(index),
|
||||
tableRowHeight()
|
||||
]"
|
||||
>
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
<div @mouseenter="handleMouseSeen(index, idx)" @mouseleave="handleMouseLeave" v-for="(itemChild, idx) in header"
|
||||
:key="idx"
|
||||
:style="[
|
||||
bodyTableStyle,
|
||||
bodyTable(index),
|
||||
tableFiledWidth(idx),
|
||||
tableReadColor(index, idx),
|
||||
tableRowHeight()
|
||||
]"
|
||||
>
|
||||
{{ item[itemChild.key] }}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -98,10 +115,12 @@ export default {
|
||||
},
|
||||
header: [],
|
||||
list: [],
|
||||
hoverIndex: {},
|
||||
optionsSetUp: {},
|
||||
optionsPosition: {},
|
||||
optionsData: {},
|
||||
flagInter: null,
|
||||
isIndex: false,
|
||||
// 新增导出对话框相关数据
|
||||
exportDialogVisible: false,
|
||||
exporting: false,
|
||||
@@ -131,6 +150,7 @@ export default {
|
||||
},
|
||||
headerTableStyle() {
|
||||
const headStyle = this.optionsSetUp;
|
||||
this.isIndex=headStyle.isIndex
|
||||
return {
|
||||
"text-align": headStyle.textAlignHeader,
|
||||
"font-size": headStyle.fontSizeHeader + "px",
|
||||
@@ -216,6 +236,7 @@ export default {
|
||||
value: {
|
||||
handler(val) {
|
||||
this.optionsSetUp = val.setup;
|
||||
|
||||
this.optionsPosition = val.position;
|
||||
this.optionsData = val.data;
|
||||
this.initData();
|
||||
@@ -238,6 +259,17 @@ export default {
|
||||
window.removeEventListener('resize', this.handleResize);
|
||||
},
|
||||
methods: {
|
||||
handleMouseSeen(index, idx){
|
||||
this.hoverIndex = {index, idx}
|
||||
},
|
||||
handleMouseLeave(){
|
||||
this.hoverIndex = {}
|
||||
},
|
||||
handleClick(){
|
||||
if(!!this.optionsSetUp.is_drill_drown){
|
||||
this.$emit('oepnTheDrillView',this.optionsSetUp.drill_drown_setting)
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.handlerRollFn();
|
||||
this.handlerHead();
|
||||
@@ -341,6 +373,13 @@ export default {
|
||||
}
|
||||
return styleJson;
|
||||
},
|
||||
tableReadColor(index, idx){
|
||||
let styleJson = {};
|
||||
if (this.optionsSetUp.is_read_mode && (this.hoverIndex.index === index || this.hoverIndex.idx === idx)) {
|
||||
styleJson["background-color"] = this.optionsSetUp.read_color;
|
||||
}
|
||||
return styleJson;
|
||||
},
|
||||
// 添加的方法 - 设备类型检测
|
||||
checkDeviceType() {
|
||||
this.screenWidth = window.innerWidth;
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<el-dialog
|
||||
:title="''"
|
||||
class="dialogDrillDrown dialogDrillDrownView" :visible.sync="visiableDrillView">
|
||||
<drill-drown-view :screenData="screenData"></drill-drown-view>
|
||||
</el-dialog>
|
||||
<drill-drown-view :screenData="screenData"></drill-drown-view>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@@ -133,9 +133,9 @@ export default {
|
||||
<style lang="scss">
|
||||
.layout {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
text-align: center;
|
||||
overflow:hidden
|
||||
|
||||
}
|
||||
.dialogDrillDrownView .el-dialog{
|
||||
width:auto;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
|
||||
<template>
|
||||
<div class="login_container">
|
||||
|
||||
<div class="login_contant">
|
||||
<img src="@/assets/images/login.jpg" alt="image" class="login_img" />
|
||||
<el-form
|
||||
@@ -13,28 +11,25 @@
|
||||
label-position="left"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<div class="title_container">
|
||||
智慧大屏
|
||||
</div>
|
||||
<div style="height: 30px;"></div>
|
||||
<div class="title_container">国瑞药业驾驶舱平台</div>
|
||||
<div style="height: 30px"></div>
|
||||
<div class="form_fields">
|
||||
|
||||
<el-form-item prop="loginName">
|
||||
<el-input
|
||||
ref="loginName"
|
||||
v-model="loginForm.loginName"
|
||||
placeholder="用户名"
|
||||
name="loginName"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
autocomplete="on"
|
||||
@focus="setTop('0')"
|
||||
@change="getPsw"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="loginName">
|
||||
<el-input
|
||||
ref="loginName"
|
||||
v-model="loginForm.loginName"
|
||||
placeholder="用户名"
|
||||
name="loginName"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
autocomplete="on"
|
||||
@focus="setTop('0')"
|
||||
@change="getPsw"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<div style="height: 20px;"></div>
|
||||
|
||||
<div style="height: 20px"></div>
|
||||
|
||||
<input
|
||||
name="password"
|
||||
type="password"
|
||||
@@ -62,7 +57,7 @@
|
||||
@keyup.native="checkCapslock"
|
||||
/>
|
||||
<span class="show_pwd" @click="showPwd">
|
||||
<div style="height: 10px;"></div>
|
||||
<div style="height: 10px"></div>
|
||||
<i class="el-icon-view" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
@@ -75,13 +70,13 @@
|
||||
<p>记住密码</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 30px;"></div>
|
||||
<div style="height: 30px"></div>
|
||||
<el-button
|
||||
:loading="loading"
|
||||
type="primary"
|
||||
class="login_btn"
|
||||
@click.native.prevent="handleLogin"
|
||||
>登 录</el-button
|
||||
>登 录</el-button
|
||||
>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -100,13 +95,14 @@
|
||||
import Verify from "@/components/verifition/Verify";
|
||||
import cookies from "js-cookie";
|
||||
import { Decrypt, Encrypt } from "@/utils/index";
|
||||
import { login } from "@/api/login";
|
||||
import { login, logincas } from "@/api/login";
|
||||
import { transPsw } from "@/utils/encrypted";
|
||||
import { setToken, setAccessUser } from "@/utils/auth";
|
||||
import { setToken, getToken, setAccessUser } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
components: {
|
||||
Verify
|
||||
Verify,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -115,11 +111,13 @@ export default {
|
||||
loginForm: {
|
||||
loginName: "",
|
||||
password: "",
|
||||
verifyCode: ""
|
||||
verifyCode: "",
|
||||
},
|
||||
loginRules: {
|
||||
loginName: [{ required: true, message: "用户名必填", trigger: "blur" }],
|
||||
password: [{ required: true, message: "用户密码必填", trigger: "blur" }]
|
||||
password: [
|
||||
{ required: true, message: "用户密码必填", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
passwordType: "password",
|
||||
capsTooltip: false,
|
||||
@@ -127,25 +125,44 @@ export default {
|
||||
redirect: undefined,
|
||||
otherQuery: {},
|
||||
needCaptcha: false,
|
||||
centerDialogVisible: false
|
||||
centerDialogVisible: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
// 监听路由获取上个路由(from)的地址和参数
|
||||
handler: function(route) {
|
||||
handler: function (route) {
|
||||
const query = route.query;
|
||||
if (query) {
|
||||
this.redirect = query.redirect;
|
||||
this.otherQuery = this.getOtherQuery(query);
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.handleLoginFocus();
|
||||
//获取url传参 ticket url
|
||||
const ticket = this.$route.query.ticket;
|
||||
let token = getToken();
|
||||
if (ticket == undefined && token == null) {
|
||||
//跳转统一身份认证
|
||||
var isTs = true;
|
||||
if (isTs) {
|
||||
console.log(this.redirect );
|
||||
window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A8080%2F%23'+this.redirect;
|
||||
// window.location.href = 'http://localhost:8099/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A9528%2F%23'+this.redirect;
|
||||
|
||||
}
|
||||
} else if (ticket != undefined && token == null) {
|
||||
//请求登录
|
||||
this.logincasapi();
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
handleLoginFocus() {
|
||||
if (this.loginForm.loginName === "") {
|
||||
@@ -181,7 +198,7 @@ export default {
|
||||
},
|
||||
// 滑动验证码
|
||||
useVerify() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.verify.show();
|
||||
} else {
|
||||
@@ -198,7 +215,7 @@ export default {
|
||||
},
|
||||
// 登录操作
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
// 登录失败次数过多需要展示滑动验证码
|
||||
@@ -212,11 +229,40 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
async logincasapi() {
|
||||
const ticket = this.$route.query.ticket;
|
||||
const obj = {
|
||||
loginName: ticket,
|
||||
password: "demo",
|
||||
verifyCode: "",
|
||||
};
|
||||
const { code, data } = await logincas(obj);
|
||||
this.loading = false;
|
||||
if (code != "200") return;
|
||||
setToken(data.token);
|
||||
setAccessUser(data);
|
||||
// 选中记住密码时 把密码存到cookie里,时效15天
|
||||
this.rememberPsw &&
|
||||
cookies.set(
|
||||
`u_${this.loginForm.loginName}`,
|
||||
Encrypt(this.loginForm.password),
|
||||
{ expires: 15 }
|
||||
);
|
||||
if (data && data.captcha) {
|
||||
this.needCaptcha = true;
|
||||
} else {
|
||||
this.needCaptcha = false;
|
||||
this.$router.push({
|
||||
path: this.redirect || "/index",
|
||||
query: this.otherQuery,
|
||||
});
|
||||
}
|
||||
},
|
||||
async loginApi() {
|
||||
const obj = {
|
||||
loginName: this.loginForm.loginName,
|
||||
password: transPsw(this.loginForm.password),
|
||||
verifyCode: ""
|
||||
verifyCode: "",
|
||||
};
|
||||
const { code, data } = await login(obj);
|
||||
this.loading = false;
|
||||
@@ -236,7 +282,7 @@ export default {
|
||||
this.needCaptcha = false;
|
||||
this.$router.push({
|
||||
path: this.redirect || "/index",
|
||||
query: this.otherQuery
|
||||
query: this.otherQuery,
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -247,8 +293,8 @@ export default {
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -260,15 +306,14 @@ export default {
|
||||
opacity: 10;
|
||||
background: #fff;
|
||||
}
|
||||
.delete {
|
||||
color: #fff;
|
||||
}
|
||||
.delete {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.login_container {
|
||||
.el-input {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
@@ -345,7 +390,7 @@ export default {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
//height: calc(100% - 60px);
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
.login_img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@@ -359,22 +404,21 @@ export default {
|
||||
min-width: 460px;
|
||||
width: 22%;
|
||||
height: 400px;
|
||||
background-color: #006DD9;
|
||||
background-color: #006dd9;
|
||||
opacity: 0.6;
|
||||
padding: 30px;
|
||||
overflow: hidden;
|
||||
.title_container {
|
||||
position: relative;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
.form_fields {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
|
||||
.show_pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
@@ -427,7 +471,7 @@ export default {
|
||||
.login_btn {
|
||||
min-width: 400px;
|
||||
height: 40px;
|
||||
background: #0BA1F8;
|
||||
background: #0ba1f8;
|
||||
border: none;
|
||||
// border-radius: 10px;
|
||||
font-size: 20px;
|
||||
|
||||
Reference in New Issue
Block a user