Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
Z
zhxf_vue
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
葛齐林
zhxf_vue
Commits
11907e95
Commit
11907e95
authored
May 10, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
826ccb50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
258 additions
and
295 deletions
+258
-295
App.vue
src/App.vue
+29
-72
page.vue
src/pages/login/page.vue
+116
-110
index.vue
src/pages/ol/kanban/index.vue
+112
-113
index.js
src/plugin/axios/index.js
+1
-0
No files found.
src/App.vue
View file @
11907e95
...
@@ -2,11 +2,7 @@
...
@@ -2,11 +2,7 @@
<div
id=
"app"
>
<div
id=
"app"
>
<router-view
v-if=
"isRouterAlive"
/>
<router-view
v-if=
"isRouterAlive"
/>
<div>
<div>
<div
<div
v-for=
"(item, index) in showList"
:key=
"index"
v-if=
"index
<
4
"
>
v-for=
"(item, index) in showList"
:key=
"index"
v-if=
"index
<
4
&&
ishowAlarm
"
>
<div
:class=
"'tip' + (index + 1)"
>
<div
:class=
"'tip' + (index + 1)"
>
<div
class=
"title"
>
<div
class=
"title"
>
<el-row
:span=
"24"
>
<el-row
:span=
"24"
>
...
@@ -104,7 +100,6 @@ export default {
...
@@ -104,7 +100,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
is3DShow
:
false
,
is3DShow
:
false
,
ishowAlarm
:
true
,
dialogVisible
:
false
,
dialogVisible
:
false
,
isRouterAlive
:
true
,
isRouterAlive
:
true
,
queryDetailVisible
:
false
,
queryDetailVisible
:
false
,
...
@@ -117,10 +112,10 @@ export default {
...
@@ -117,10 +112,10 @@ export default {
watch
:
{},
watch
:
{},
computed
:
{},
computed
:
{},
mounted
()
{
mounted
()
{
//let token = util.cookies.get('token')
this
.
initWebSocket
()
this
.
initWebSocket
()
this
.
initWebSocket2
()
this
.
initWebSocket2
()
this
.
getDateList
()
this
.
getDateList
()
this
.
getDateList2
()
},
},
destroyed
:
function
()
{
destroyed
:
function
()
{
this
.
websocketclose
()
this
.
websocketclose
()
...
@@ -169,24 +164,14 @@ export default {
...
@@ -169,24 +164,14 @@ export default {
},
},
//接收后端返回的数据
//接收后端返回的数据
websocketonmessage
(
e
)
{
websocketonmessage
(
e
)
{
console
.
log
(
'takeover:'
,
sessionStorage
.
getItem
(
'takeover'
))
if
(
sessionStorage
.
getItem
(
'takeover'
)
!=
undefined
&&
sessionStorage
.
getItem
(
'takeover'
)
==
'true'
)
{
this
.
ishowAlarm
=
false
}
else
{
this
.
ishowAlarm
=
true
}
// 在这里使用后端返回的数据,对数据进行处理渲染
// 在这里使用后端返回的数据,对数据进行处理渲染
// this.tipList = []
// this.tipList = []
this
.
showList
=
[]
this
.
showList
=
[]
if
(
if
(
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
!=
undefined
sessionStorage
.
getItem
(
'token'
)
!=
=
undefined
)
{
)
{
// if (util.cookies.get('token') && util.cookies.get('token') != undefined) { //登录才能获取
//登录才能获取
// this.tipList = JSON.parse(e.data)
var
alarmsInfo
=
JSON
.
parse
(
e
.
data
)
var
alarmsInfo
=
JSON
.
parse
(
e
.
data
)
//console.log(alarmsInfo, '-------')
//console.log(alarmsInfo, '-------')
if
(
alarmsInfo
.
status
!=
1
)
{
if
(
alarmsInfo
.
status
!=
1
)
{
...
@@ -206,7 +191,6 @@ export default {
...
@@ -206,7 +191,6 @@ export default {
}
}
}
}
this
.
tipList
.
push
(
alarmsInfo
)
this
.
tipList
.
push
(
alarmsInfo
)
// this.sendMessage(alarmsInfo.resourceCode)
if
(
flag
)
{
if
(
flag
)
{
var
x
=
0
var
x
=
0
var
resourceCode
=
this
.
$store
.
state
.
d2admin
.
bjCode
.
resourceCode
var
resourceCode
=
this
.
$store
.
state
.
d2admin
.
bjCode
.
resourceCode
...
@@ -214,30 +198,19 @@ export default {
...
@@ -214,30 +198,19 @@ export default {
if
(
if
(
resourceCode
&&
resourceCode
&&
resourceCode
.
split
(
'+'
)[
0
]
===
alarmsInfo
.
resourceCode
&&
resourceCode
.
split
(
'+'
)[
0
]
===
alarmsInfo
.
resourceCode
&&
resourceCode
.
split
(
'+'
)[
2
]
===
alarmsInfo
.
lineId
&&
resourceCode
.
split
(
'+'
)[
2
]
===
alarmsInfo
.
stationId
resourceCode
.
split
(
'+'
)[
3
]
===
alarmsInfo
.
stationId
)
{
)
{
x
=
x
=
Number
(
resourceCode
.
substring
(
resourceCode
.
indexOf
(
'+'
)
+
1
))
+
Number
(
resourceCode
.
substring
(
resourceCode
.
indexOf
(
'+'
)
+
1
))
+
1
1
this
.
$store
.
dispatch
(
this
.
$store
.
dispatch
(
'd2admin/bjCode/set'
,
'd2admin/bjCode/set'
,
alarmsInfo
.
resourceCode
+
alarmsInfo
.
resourceCode
+
'+'
+
x
+
'+'
+
alarmsInfo
.
stationId
'+'
+
x
+
'+'
+
alarmsInfo
.
lineId
+
'+'
+
alarmsInfo
.
stationId
)
)
}
else
{
}
else
{
this
.
$store
.
dispatch
(
this
.
$store
.
dispatch
(
'd2admin/bjCode/set'
,
'd2admin/bjCode/set'
,
alarmsInfo
.
resourceCode
+
alarmsInfo
.
resourceCode
+
'+0+'
+
alarmsInfo
.
stationId
'+0+'
+
alarmsInfo
.
lineId
+
'+'
+
alarmsInfo
.
stationId
)
)
}
}
}
}
...
@@ -286,10 +259,6 @@ export default {
...
@@ -286,10 +259,6 @@ export default {
websocketclose
(
e
)
{
websocketclose
(
e
)
{
console
.
log
(
'断开连接'
,
e
)
console
.
log
(
'断开连接'
,
e
)
},
},
send
()
{
this
.
websock
.
send
(
'1'
)
},
// ====================================
// ====================================
//初始化weosocket2
//初始化weosocket2
initWebSocket2
()
{
initWebSocket2
()
{
...
@@ -332,12 +301,10 @@ export default {
...
@@ -332,12 +301,10 @@ export default {
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
!=
undefined
sessionStorage
.
getItem
(
'token'
)
!=
undefined
)
{
)
{
var
paramsInfo
=
JSON
.
parse
(
e
.
data
)
console
.
log
(
'paramsInfo:'
,
paramsInfo
)
// 集合
// 集合
// this.$store.dispatch('d2admin/typeList/set', e.typeList)
this
.
$store
.
dispatch
(
'd2admin/typeList/set'
,
paramsInfo
)
//登录才能获取
// this.tipList = JSON.parse(e.data)
console
.
log
(
'接管数据'
+
e
.
data
)
}
}
},
},
//连接建立失败重连
//连接建立失败重连
...
@@ -349,24 +316,19 @@ export default {
...
@@ -349,24 +316,19 @@ export default {
websocketclose2
(
e
)
{
websocketclose2
(
e
)
{
console
.
log
(
'断开连接2'
,
e
)
console
.
log
(
'断开连接2'
,
e
)
},
},
send2
()
{
this
.
websock
.
send
(
'2'
)
},
//登录后页面刷新的时候获取
//登录后页面刷新的时候获取
getDateList
()
{
getDateList
()
{
this
.
tipList
=
[]
this
.
tipList
=
[]
this
.
showList
=
[]
this
.
showList
=
[]
if
(
if
(
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
!=
undefined
sessionStorage
.
getItem
(
'token'
)
!=
=
undefined
)
{
)
{
this
.
$http
({
this
.
$http
({
url
:
this
.
$http
.
adornUrlAlarm
(
'/alarmsInfo/queryList'
),
url
:
this
.
$http
.
adornUrlAlarm
(
'/alarmsInfo/queryList'
),
method
:
'post'
,
method
:
'post'
,
params
:
this
.
$http
.
adornParams
({
params
:
this
.
$http
.
adornParams
({
status
:
1
,
status
:
1
stationId
:
localStorage
.
getItem
(
'stationId'
)
})
})
}).
then
((
data
)
=>
{
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
if
(
data
&&
data
.
code
===
0
)
{
...
@@ -384,15 +346,28 @@ export default {
...
@@ -384,15 +346,28 @@ export default {
if
(
this
.
showList
)
{
if
(
this
.
showList
)
{
this
.
showList
.
sort
(
this
.
sortBy
(
'occurrenceTime'
,
true
))
this
.
showList
.
sort
(
this
.
sortBy
(
'occurrenceTime'
,
true
))
}
}
// console.log(this.tipList, '-------')
// console.log(this.showList, '-------')
//console.log(this.showList, '1----------1')
this
.
$store
.
dispatch
(
'd2admin/toast/set'
,
this
.
tipList
.
length
)
this
.
$store
.
dispatch
(
'd2admin/toast/set'
,
this
.
tipList
.
length
)
}
}
})
})
}
}
},
},
getDateList2
()
{
if
(
sessionStorage
.
getItem
(
'token'
)
&&
sessionStorage
.
getItem
(
'token'
)
!==
undefined
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrlAlarm
(
'/kanban/getListParam'
),
method
:
'post'
,
params
:
this
.
$http
.
adornParams
({})
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
console
.
log
(
'typeList:'
,
data
.
bean
)
this
.
$store
.
dispatch
(
'd2admin/typeList/set'
,
data
.
bean
)
}
})
}
},
/**数组根据数组对象中的某个属性值进行排序的方法
/**数组根据数组对象中的某个属性值进行排序的方法
* 使用例子:newArray.sort(sortBy('number',false)) //表示根据number属性降序排列;若第二个参数不传递,默认表示升序排序
* 使用例子:newArray.sort(sortBy('number',false)) //表示根据number属性降序排列;若第二个参数不传递,默认表示升序排序
* @param attr 排序的属性 如number属性
* @param attr 排序的属性 如number属性
...
@@ -473,24 +448,6 @@ export default {
...
@@ -473,24 +448,6 @@ export default {
background-color
:
#b9c9e3
!
important
;
background-color
:
#b9c9e3
!
important
;
}
}
// 状态-点
// .danger,
// .success,
// .warning {
// width: 5px;
// height: 5px;
// border-radius: 100%;
// background: #ff3723;
// display: inline-block;
// vertical-align: middle;
// }
// .success {
// background: #42cd00;
// }
// .warning {
// background: #ffa101;
// }
// 弹出框
// 弹出框
.el-dialog__title
{
.el-dialog__title
{
line-height
:
24px
;
line-height
:
24px
;
...
...
src/pages/login/page.vue
View file @
11907e95
...
@@ -36,71 +36,72 @@
...
@@ -36,71 +36,72 @@
/* eslint-disable */
/* eslint-disable */
// 动态背景js
// 动态背景js
// require("particles.js");
// require("particles.js");
import
config
from
"./config/default"
;
import
config
from
'./config/default'
import
{
mapActions
}
from
"vuex"
;
import
{
mapActions
}
from
'vuex'
import
util
from
"@/libs/util.js"
;
import
util
from
'@/libs/util.js'
import
{
getPermissions
}
from
"@/util"
;
import
{
getPermissions
}
from
'@/util'
const
Base64
=
require
(
'js-base64'
).
Base64
const
Base64
=
require
(
'js-base64'
).
Base64
import
httpRequest
from
'@/plugin/axios'
import
httpRequest
from
'@/plugin/axios'
import
bcrypt
from
'@/util/bcrypt.js'
import
bcrypt
from
'@/util/bcrypt.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
loginLoad
:
false
,
loginLoad
:
false
,
// 快速选择用户
// 快速选择用户
dialogVisible
:
false
,
dialogVisible
:
false
,
users
:
[
users
:
[
{
{
name
:
"管理员"
,
name
:
'管理员'
,
username
:
"admin"
,
username
:
'admin'
,
password
:
"admin"
password
:
'admin'
},
},
{
{
name
:
"编辑"
,
name
:
'编辑'
,
username
:
"editor"
,
username
:
'editor'
,
password
:
"editor"
password
:
'editor'
},
},
{
{
name
:
"用户1"
,
name
:
'用户1'
,
username
:
"user1"
,
username
:
'user1'
,
password
:
"user1"
password
:
'user1'
}
}
],
],
// 表单
// 表单
formLogin
:
{
formLogin
:
{
username
:
""
,
username
:
''
,
password
:
""
,
password
:
''
,
remember
:
''
,
remember
:
''
,
uuid
:
""
,
uuid
:
''
,
code
:
"qweqwe"
code
:
'qweqwe'
},
},
// 校验
// 校验
rules
:
{
rules
:
{
username
:
[
username
:
[
{
required
:
true
,
message
:
"请输入用户名"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
],
],
password
:
[{
required
:
true
,
message
:
"请输入密码"
,
trigger
:
"blur"
}],
password
:
[{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
"请输入验证码"
,
trigger
:
"blur"
}]
code
:
[{
required
:
true
,
message
:
'请输入验证码'
,
trigger
:
'blur'
}]
},
},
captchaPath
:
""
captchaPath
:
''
}
;
}
},
},
created
()
{
created
()
{
//this.getCookie();
//this.getCookie();
let
u
=
util
.
cookies
.
get
(
"username"
)
let
u
=
util
.
cookies
.
get
(
'username'
)
let
p
=
util
.
cookies
.
get
(
"password"
)
let
p
=
util
.
cookies
.
get
(
'password'
)
if
(
u
&&
p
)
{
if
(
u
&&
p
)
{
this
.
formLogin
.
username
=
bcrypt
.
decrypt
(
u
);
this
.
formLogin
.
username
=
bcrypt
.
decrypt
(
u
)
this
.
formLogin
.
password
=
bcrypt
.
decrypt
(
p
)
;
this
.
formLogin
.
password
=
bcrypt
.
decrypt
(
p
)
}
}
this
.
getCaptcha
();
this
.
getCaptcha
()
this
.
$parent
.
getDateList
();
this
.
$parent
.
getDateList
()
this
.
$parent
.
getDateList2
()
},
},
mounted
()
{
mounted
()
{
// 初始化例子插件
// 初始化例子插件
//particlesJS("login", config);
//particlesJS("login", config);
},
},
beforeDestroy
()
{
beforeDestroy
()
{
// 销毁 particlesJS
// 销毁 particlesJS
// thanks https://github.com/d2-projects/d2-admin/issues/65
// thanks https://github.com/d2-projects/d2-admin/issues/65
// ref https://github.com/VincentGarreau/particles.js/issues/63
// ref https://github.com/VincentGarreau/particles.js/issues/63
...
@@ -110,44 +111,43 @@ export default {
...
@@ -110,44 +111,43 @@ export default {
//}
//}
},
},
methods
:
{
methods
:
{
...
mapActions
(
"d2admin/account"
,
[
"login"
]),
...
mapActions
(
'd2admin/account'
,
[
'login'
]),
...
mapActions
(
'd2admin/page'
,
[
'closeAll'
]),
...
mapActions
(
'd2admin/page'
,
[
'closeAll'
]),
// getType(){
// getType(){
// let type
// let type
// httpRequest({ url: httpRequest.adornUrl('/sysSystem/getSystem'), method: 'get' }).then((e) => {
// httpRequest({ url: httpRequest.adornUrl('/sysSystem/getSystem'), method: 'get' }).then((e) => {
// console.log(e, '类型')
// console.log(e, '类型')
// })
// })
// return type
// return type
// },
// },
/**
/**
* 获取uuid
* 获取uuid
*/
*/
getUUID
()
{
getUUID
()
{
return
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.
replace
(
/
[
xy
]
/g
,
c
=>
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
(
c
)
=>
{
return
(
c
===
"x"
return
(
c
===
'x'
?
(
Math
.
random
()
*
16
)
|
0
?
(
Math
.
random
()
*
16
)
|
0
:
"r&0x3"
|
"0x8"
:
'r&0x3'
|
'0x8'
).
toString
(
16
)
;
).
toString
(
16
)
})
;
})
},
},
// 获取验证码
// 获取验证码
getCaptcha
()
{
getCaptcha
()
{
this
.
formLogin
.
uuid
=
this
.
getUUID
()
;
this
.
formLogin
.
uuid
=
this
.
getUUID
()
this
.
captchaPath
=
this
.
$http
.
adornUrl
(
this
.
captchaPath
=
this
.
$http
.
adornUrl
(
`/captcha.jpg?uuid=
${
this
.
formLogin
.
uuid
}
`
`/captcha.jpg?uuid=
${
this
.
formLogin
.
uuid
}
`
)
;
)
},
},
/**
/**
* @description 接收选择一个用户快速登录的事件
* @description 接收选择一个用户快速登录的事件
* @param {Object} user 用户信息
* @param {Object} user 用户信息
*/
*/
handleUserBtnClick
(
user
)
{
handleUserBtnClick
(
user
)
{
this
.
formLogin
.
username
=
user
.
username
;
this
.
formLogin
.
username
=
user
.
username
this
.
formLogin
.
password
=
user
.
password
;
this
.
formLogin
.
password
=
user
.
password
this
.
submit
()
;
this
.
submit
()
},
},
/* setCookie(c_name, c_pwd, exdays) {
/* setCookie(c_name, c_pwd, exdays) {
var exdate = new Date();
var exdate = new Date();
...
@@ -180,19 +180,18 @@ export default {
...
@@ -180,19 +180,18 @@ export default {
* @description 提交表单
* @description 提交表单
*/
*/
// 提交登录信息
// 提交登录信息
clearCookie
:
function
()
{
clearCookie
:
function
()
{
util
.
cookies
.
set
(
"username"
,
""
);
util
.
cookies
.
set
(
'username'
,
''
)
util
.
cookies
.
set
(
"password"
,
""
);
util
.
cookies
.
set
(
'password'
,
''
)
},
},
submit
()
{
submit
()
{
// 防止重复提交
// 防止重复提交
if
(
this
.
loginLoad
)
return
if
(
this
.
loginLoad
)
return
// 登录关闭所有tab
// 登录关闭所有tab
this
.
closeAll
()
this
.
closeAll
()
let
u
=
bcrypt
.
encrypt
(
this
.
formLogin
.
username
.
trim
())
let
u
=
bcrypt
.
encrypt
(
this
.
formLogin
.
username
.
trim
())
let
p
=
bcrypt
.
encrypt
(
this
.
formLogin
.
password
.
trim
())
let
p
=
bcrypt
.
encrypt
(
this
.
formLogin
.
password
.
trim
())
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
this
.
$refs
.
loginForm
.
validate
(
(
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// this.login({
// this.login({
// vm: this,
// vm: this,
...
@@ -205,28 +204,28 @@ export default {
...
@@ -205,28 +204,28 @@ export default {
// 获取数据列表
// 获取数据列表
this
.
loginLoad
=
true
this
.
loginLoad
=
true
this
.
$http
({
this
.
$http
({
url
:
this
.
$http
.
authUrl
(
"/oauth/token"
),
url
:
this
.
$http
.
authUrl
(
'/oauth/token'
),
method
:
"post"
,
method
:
'post'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
'Content-Type'
:
'application/x-www-form-urlencoded'
},
},
data
:
{
data
:
{
grant_type
:
"password"
,
grant_type
:
'password'
,
username
:
u
,
username
:
u
,
password
:
p
,
password
:
p
,
scope
:
"all"
scope
:
'all'
}
}
})
})
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
if
(
data
.
access_token
)
{
if
(
data
.
access_token
)
{
// 登录
// 登录
// 注意 这里的演示没有传验证码
// 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码
// 具体需要传递的数据请自行修改代码
util
.
cookies
.
set
(
"authorization"
,
data
.
access_token
);
util
.
cookies
.
set
(
'authorization'
,
data
.
access_token
)
this
.
$http
({
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
"/sys/login"
),
url
:
this
.
$http
.
adornUrl
(
'/sys/login'
),
method
:
"post"
,
method
:
'post'
,
data
:
{
data
:
{
uuid
:
this
.
formLogin
.
uuid
,
uuid
:
this
.
formLogin
.
uuid
,
username
:
u
,
username
:
u
,
...
@@ -234,7 +233,7 @@ export default {
...
@@ -234,7 +233,7 @@ export default {
captcha
:
this
.
formLogin
.
code
captcha
:
this
.
formLogin
.
code
}
}
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
msg
==
'success'
)
{
if
(
res
.
msg
==
'success'
)
{
this
.
$message
.
success
({
this
.
$message
.
success
({
message
:
'登录成功'
,
message
:
'登录成功'
,
...
@@ -249,89 +248,96 @@ export default {
...
@@ -249,89 +248,96 @@ export default {
// util.cookies.set("token", res.token);
// util.cookies.set("token", res.token);
sessionStorage
.
setItem
(
'uuid'
,
res
.
uuid
)
sessionStorage
.
setItem
(
'uuid'
,
res
.
uuid
)
sessionStorage
.
setItem
(
'token'
,
res
.
token
)
sessionStorage
.
setItem
(
'token'
,
res
.
token
)
localStorage
.
setItem
(
"userId"
,
res
.
userId
)
localStorage
.
setItem
(
'userId'
,
res
.
userId
)
// 存储登陆用户权限信息
// 存储登陆用户权限信息
sessionStorage
.
setItem
(
"permissions"
,
res
.
permissions
);
sessionStorage
.
setItem
(
'permissions'
,
res
.
permissions
)
localStorage
.
setItem
(
"sysSystem"
,
res
.
sysSystem
)
localStorage
.
setItem
(
'sysSystem'
,
res
.
sysSystem
)
localStorage
.
setItem
(
"sysSign"
,
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
code
)
localStorage
.
setItem
(
localStorage
.
setItem
(
"stationId"
,
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
code
)
'sysSign'
,
localStorage
.
setItem
(
"lineId"
,
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
lineId
)
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
code
)
localStorage
.
setItem
(
'stationId'
,
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
code
)
localStorage
.
setItem
(
'lineId'
,
JSON
.
parse
(
res
.
sysSystem
||
'{}'
).
lineId
)
//设置被接管
//设置被接管
let
takeover
=
res
.
takeover
let
takeover
=
res
.
takeover
if
(
takeover
&&
takeover
.
status
===
1
)
{
if
(
takeover
&&
takeover
.
status
===
1
)
{
// 弹出提示框
// 弹出提示框
// this.$store.dispatch('d2admin/takeover/setTakeover', takeover)
// this.$store.dispatch('d2admin/takeover/setTakeover', takeover)
}
else
if
(
takeover
&&
takeover
.
status
===
2
)
{
}
else
if
(
takeover
&&
takeover
.
status
===
2
)
{
sessionStorage
.
setItem
(
'takeover'
,
true
)
sessionStorage
.
setItem
(
'takeover'
,
true
)
}
}
// 设置 vuex 用户信息
// 设置 vuex 用户信息
this
.
$store
.
dispatch
(
this
.
$store
.
dispatch
(
"d2admin/user/set"
,
'd2admin/user/set'
,
{
{
name
:
this
.
formLogin
.
username
,
name
:
this
.
formLogin
.
username
,
userName
:
res
.
userName
userName
:
res
.
userName
},
},
{
root
:
true
}
{
root
:
true
}
)
;
)
// 用户登录后从持久化数据加载一系列的设置
// 用户登录后从持久化数据加载一系列的设置
this
.
$store
.
dispatch
(
"d2admin/account/load"
);
this
.
$store
.
dispatch
(
'd2admin/account/load'
)
// 获取最新权限信息
// 获取最新权限信息
getPermissions
()
;
getPermissions
()
// 更新路由 尝试去获取 cookie 里保存的需要重定向的页面完整地址
// 更新路由 尝试去获取 cookie 里保存的需要重定向的页面完整地址
const
path
=
util
.
cookies
.
get
(
"redirect"
);
const
path
=
util
.
cookies
.
get
(
'redirect'
)
// 根据是否存有重定向页面判断如何重定向
// 根据是否存有重定向页面判断如何重定向
this
.
$http
({
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/sys/menu/nav'
),
url
:
this
.
$http
.
adornUrl
(
'/sys/menu/nav'
),
method
:
"get"
method
:
'get'
}).
then
((
e
)
=>
{
}).
then
((
e
)
=>
{
let
url
=
e
.
menuList
[
0
].
list
[
0
].
path
let
url
=
e
.
menuList
[
0
].
list
[
0
].
path
this
.
$router
.
replace
({
path
:
url
})
this
.
$router
.
replace
({
path
:
url
})
})
})
// this.$router.replace(path ? { path } : { name: "index" });
// this.$router.replace(path ? { path } : { name: "index" });
// 删除 cookie 中保存的重定向页面
// 删除 cookie 中保存的重定向页面
util
.
cookies
.
remove
(
"redirect"
);
util
.
cookies
.
remove
(
'redirect'
)
if
(
this
.
formLogin
.
remember
)
{
if
(
this
.
formLogin
.
remember
)
{
//传入账号名,密码,和保存天数3个参数
//传入账号名,密码,和保存天数3个参数
//this.setCookie(this.formLogin.username, this.formLogin.password, 7);
//this.setCookie(this.formLogin.username, this.formLogin.password, 7);
util
.
cookies
.
set
(
"username"
,
u
);
util
.
cookies
.
set
(
'username'
,
u
)
util
.
cookies
.
set
(
"password"
,
p
);
util
.
cookies
.
set
(
'password'
,
p
)
}
else
{
}
else
{
console
.
log
(
"清空Cookie"
);
console
.
log
(
'清空Cookie'
)
//清空Cookie
//清空Cookie
this
.
clearCookie
()
;
this
.
clearCookie
()
}
}
this
.
$parent
.
getDateList
();
this
.
$parent
.
getDateList
()
this
.
$parent
.
getDateList2
()
}
else
{
}
else
{
sessionStorage
.
removeItem
(
"uuid"
)
sessionStorage
.
removeItem
(
'uuid'
)
sessionStorage
.
removeItem
(
"token"
)
sessionStorage
.
removeItem
(
'token'
)
this
.
$message
.
danger
(
'账号或密码错误'
)
this
.
$message
.
danger
(
'账号或密码错误'
)
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
loginLoad
=
false
this
.
loginLoad
=
false
this
.
getCaptcha
()
;
this
.
getCaptcha
()
})
;
})
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
loginLoad
=
false
this
.
loginLoad
=
false
this
.
getCaptcha
()
;
this
.
getCaptcha
()
})
;
})
}
else
{
}
else
{
// 登录表单校验失败
// 登录表单校验失败
// this.$message.error("表单校验失败");
// this.$message.error("表单校验失败");
}
}
})
;
})
}
}
}
}
}
;
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
"./style.scss"
;
@import
'./style.scss'
;
</
style
>
</
style
>
src/pages/ol/kanban/index.vue
View file @
11907e95
...
@@ -39,119 +39,118 @@ export default {
...
@@ -39,119 +39,118 @@ export default {
mapId
:
''
,
mapId
:
''
,
mapList
:
[],
mapList
:
[],
dataList
:
[
dataList
:
[
{
// {
name
:
'喷淋系统'
,
// name: '喷淋系统',
list
:
[
// list: [
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'水流压力'
,
// rightName: '水流压力',
type
:
'slyl'
,
// type: 'slyl',
value
:
'0.319mp'
,
// value: '0.319mp',
scope
:
'参考值:0.2~0.8mp'
// scope: '参考值:0.2~0.8mp'
}
// }
]
// ]
},
// },
{
// {
name
:
'喷淋系统'
,
// name: '喷淋系统',
list
:
[
// list: [
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'一氧化碳'
,
// rightName: '一氧化碳',
type
:
'co'
,
// type: 'co',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'湿度'
,
// rightName: '湿度',
type
:
'sd'
,
// type: 'sd',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'风速'
,
// rightName: '风速',
type
:
'fs'
,
// type: 'fs',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'风速'
,
// rightName: '风速',
type
:
'fs'
,
// type: 'fs',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
}
// }
]
// ]
},
// },
{
// {
name
:
'喷淋系统'
,
// name: '喷淋系统',
list
:
[
// list: [
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'风压'
,
// rightName: '风压',
type
:
'fy'
,
// type: 'fy',
value
:
'0.319mp'
,
// value: '0.319mp',
scope
:
'参考值:0.2~0.8mp'
// scope: '参考值:0.2~0.8mp'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'泵房温度'
,
// rightName: '泵房温度',
type
:
'wd'
,
// type: 'wd',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'水位高度'
,
// rightName: '水位高度',
type
:
'swgd'
,
// type: 'swgd',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'水位高度'
,
// rightName: '水位高度',
type
:
'swgd'
,
// type: 'swgd',
value
:
'22.5℃'
,
// value: '22.5℃',
scope
:
'参考值:0.0~50℃'
// scope: '参考值:0.0~50℃'
}
// }
]
// ]
},
// },
{
// {
name
:
'喷淋系统'
,
// name: '喷淋系统',
list
:
[
// list: [
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'水流压力'
,
// rightName: '水流压力',
type
:
'slyl'
,
// type: 'slyl',
value
:
'0.319mp'
,
// value: '0.319mp',
scope
:
'参考值:0.2~0.8mp'
// scope: '参考值:0.2~0.8mp'
},
// },
{
// {
leftName
:
'喷淋系统'
,
// leftName: '喷淋系统',
rightName
:
'泵房温度'
,
// rightName: '泵房温度',
type
:
'wdh'
,
// type: 'wdh',
value
:
'60.5℃'
,
// value: '60.5℃',
over
:
true
,
// over: true,
// scope: '参考值:0.0~50℃'
scope
:
'参考值:0.0~50℃'
// },
},
// {
{
// leftName: '喷淋系统',
leftName
:
'喷淋系统'
,
// rightName: '水位高度',
rightName
:
'水位高度'
,
// type: 'swgd',
type
:
'swgd'
,
// value: '22.5℃',
value
:
'22.5℃'
,
// scope: '参考值:0.0~50℃'
scope
:
'参考值:0.0~50℃'
// },
},
// {
{
// leftName: '喷淋系统',
leftName
:
'喷淋系统'
,
// rightName: '水位高度',
rightName
:
'水位高度'
,
// type: 'swgd',
type
:
'swgd'
,
// value: '22.5℃',
value
:
'22.5℃'
,
// scope: '参考值:0.0~50℃'
scope
:
'参考值:0.0~50℃'
// }
}
// ]
]
// }
}
]
]
}
}
},
},
...
...
src/plugin/axios/index.js
View file @
11907e95
...
@@ -231,6 +231,7 @@ service.interceptors.response.use(
...
@@ -231,6 +231,7 @@ service.interceptors.response.use(
sessionStorage
.
removeItem
(
'uuid'
)
sessionStorage
.
removeItem
(
'uuid'
)
if
(
this
)
{
if
(
this
)
{
this
.
$parent
.
getDateList
()
this
.
$parent
.
getDateList
()
this
.
$parent
.
getDateList2
()
//清空接管提示框
//清空接管提示框
// this.$store.dispatch('d2admin/takeover/setTakeover', null)
// this.$store.dispatch('d2admin/takeover/setTakeover', null)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment