Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
fb799d06
Commit
fb799d06
authored
Mar 28, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
okk
parent
2c1ac014
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
4 deletions
+48
-4
default.vue
layouts/default.vue
+13
-2
index.vue
pages/account/login/index.vue
+1
-0
index.vue
pages/order/quotation/index.vue
+2
-1
index.js
plugins/request/index.js
+2
-0
route.js
plugins/route.js
+0
-1
index.js
store/index.js
+30
-0
No files found.
layouts/default.vue
View file @
fb799d06
...
...
@@ -37,7 +37,6 @@ export default {
watch
:
{
// 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
$route
(
to
,
from
)
{
console
.
warn
(
"to,from"
,
to
,
from
,
menuSider
);
let
path
=
to
.
matched
[
to
.
matched
.
length
-
1
].
path
;
if
(
!
Setting
.
dynamicSiderMenu
)
{
let
headerName
=
getHeaderName
(
path
,
menuSider
);
...
...
@@ -56,8 +55,15 @@ export default {
const
openNames
=
getSiderSubmenu
(
path
,
menuSider
);
this
.
$store
.
commit
(
"admin/menu/setOpenNames"
,
openNames
);
}
}
else
{
let
menus
=
this
.
$store
.
state
.
admin
.
menu
.
sider
console
.
warn
(
menus
);
this
.
$store
.
commit
(
"admin/menu/setActivePath"
,
to
.
path
);
const
openNames
=
getSiderSubmenu
(
path
,
menus
);
console
.
log
(
"openNames"
,
openNames
,
path
)
this
.
$store
.
commit
(
"admin/menu/setOpenNames"
,
openNames
);
}
//
this.appRouteChange(to, from);
this
.
appRouteChange
(
to
,
from
);
}
},
methods
:
{
...
...
@@ -124,6 +130,11 @@ export default {
if
(
name
.
charAt
(
name
.
length
-
1
)
==
"-"
)
{
name
=
name
.
substr
(
0
,
name
.
length
-
1
);
}
datas
.
meta
=
{
auth
:
false
,
title
:
datas
.
title
,
closable
:
true
}
datas
.
name
=
name
;
if
(
datas
.
children
!=
null
)
{
this
.
toMenu
(
datas
.
children
);
...
...
pages/account/login/index.vue
View file @
fb799d06
...
...
@@ -94,6 +94,7 @@ export default {
this
.
$store
.
dispatch
(
"admin/user/set"
,
user
,
{
root
:
true
});
// 用户登录后从持久化数据加载一系列的设置
this
.
$store
.
dispatch
(
"load"
);
this
.
$store
.
commit
(
'setUserInfo'
,
user
);
}
}
};
...
...
pages/order/quotation/index.vue
View file @
fb799d06
...
...
@@ -143,7 +143,8 @@ import PhotosensitiveDetails from './components/photosensitiveDetails.vue' //报
import
MetalQuotationGeneration
from
'./components/metalQuotationGeneration.vue'
//生成报价单弹框
import
PhotosensitiveGeneration
from
'./components/photosensitiveGeneration.vue'
//生成报价单弹框
var
userId
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'userInfo'
)).
userId
var
userId
=
1
;
// var userId = JSON.parse(sessionStorage.getItem('userInfo')).userId
export
default
{
components
:
{
DrawerSet
,
...
...
plugins/request/index.js
View file @
fb799d06
...
...
@@ -24,6 +24,7 @@ function errorLog (err) {
// 打印到控制台
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
util
.
log
.
error
(
'>>>>>> Error >>>>>>'
);
console
.
warn
(
err
.
response
);
console
.
log
(
err
);
}
// 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示
...
...
@@ -133,6 +134,7 @@ service.interceptors.response.use(
}
}
errorLog
(
error
);
// console.warn("Erro:",error)
return
Promise
.
reject
(
error
);
}
);
...
...
plugins/route.js
View file @
fb799d06
...
...
@@ -41,7 +41,6 @@ export default ({
if
(
Setting
.
showProgressBar
)
iView
.
LoadingBar
.
finish
();
// 多页控制 打开新的页面
store
.
dispatch
(
'admin/page/open'
,
to
);
console
.
info
(
"log"
,
to
)
// 更改标题
util
.
title
({
title
:
to
.
meta
.
title
...
...
store/index.js
View file @
fb799d06
...
...
@@ -3,6 +3,7 @@ import Api from '@/plugins/request'
export
const
state
=
()
=>
({
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
userMap
:[],
//所有用户缓存;
})
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
...
...
@@ -13,18 +14,47 @@ export const getters={
return
items
;
}
return
result
;
},
getUser
:
state
=>
key
=>
{
// try{
// if(state.userMap.has(key)){
// return state.userMap.get(key);
// }
// }catch(e){
// console.log(e);
// }
let
user
=
state
.
userMap
.
filter
(
u
=>
{
return
u
.
id
==
key
});
if
(
user
.
length
>
0
){
return
user
[
0
]
}
else
{
return
null
;
}
}
}
export
const
mutations
=
{
increment
(
state
){
state
.
counter
++
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
sessionStorage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
userInfo
));
sessionStorage
.
setItem
(
"token"
,
userInfo
.
token
);
},
addUser
(
state
,
user
){
state
.
userMap
.
push
(
user
);
},
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
},
}
export
const
actions
=
{
async
loadUser
({
commit
},
key
){
let
{
result
}
=
await
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,{
id
:
key
});
console
.
warn
(
"result"
,
result
)
commit
(
"addUser"
,
result
);
},
async
loadDictionary
({
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
result
}
=
await
Api
.
get
(
url
);
...
...
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