Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
616681de
authored
May 18, 2021
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
x
parent
741b75b1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
298 additions
and
186 deletions
src/assets/css/info/message.less
src/assets/css/info/message.min.css
src/components/menu.vue
src/filters/index.js
src/main.js
src/views/Info/message.vue
src/assets/css/info/message.less
View file @
616681de
...
...
@@ -45,6 +45,32 @@
}
}
}
.up-box{
position: relative;
margin-left: 90px;
padding-top: 37px;
.avatar-uploader{
width: 98px;
height: 34px;
border-radius: 2px;
border: 1px solid #BEC9DF;
overflow: hidden;
line-height: 34px;
font-size: 14px;
color:#646B78;
.iconfont{font-size: 18px;position: relative;top:-1px;margin-left: 10px;}
&:hover,.el-upload--picture-card:hover, .el-upload:focus{
color:#1969F9!important;
border-color: #1969F9!important;
}
}
.imspre{
width:100px;
height:100px;
border-radius: 50px;
margin-bottom: 16px;
}
}
}
}
\ No newline at end of file
src/assets/css/info/message.min.css
View file @
616681de
.messagexk
.message-box
{
background
:
#fff
;
padding
:
20px
;
height
:
calc
(
100vh
-
136px
)}
.messagexk
.message-box
.h3
{
font-size
:
16px
;
color
:
#333
;
font-weight
:
bold
;
position
:
relative
}
.messagexk
.message-box
.h3
::before
{
content
:
""
;
width
:
3px
;
height
:
100%
;
background
:
#1969F9
;
position
:
absolute
;
left
:
-20px
;
top
:
0px
}
.messagexk
.message-box
.el-form
{
float
:
left
;
padding-top
:
35px
}
.messagexk
.message-box
.el-form
.el-form-item__label
{
color
:
#333
}
.messagexk
.message-box
.el-form
.el-input
{
width
:
280px
;
color
:
#333
}
.messagexk
.message-box
.el-form
.el-input.is-disabled
.el-input__inner
{
background
:
#F1F4FA
;
border
:
1px
solid
#F1F4FA
;
color
:
#333
}
.messagexk
.message-box
.el-form
.submits
{
margin-top
:
26px
;
cursor
:
pointer
;
width
:
76px
;
height
:
37px
;
line-height
:
37px
;
background
:
#1969F9
;
border-radius
:
2px
;
font-size
:
14px
;
color
:
#fff
;
text-align
:
center
}
.messagexk
.message-box
.el-form
.submits
:hover
{
background
:
#0050E0
}
\ No newline at end of file
.messagexk
.message-box
{
background
:
#fff
;
padding
:
20px
;
height
:
calc
(
100vh
-
136px
)}
.messagexk
.message-box
.h3
{
font-size
:
16px
;
color
:
#333
;
font-weight
:
bold
;
position
:
relative
}
.messagexk
.message-box
.h3
::before
{
content
:
""
;
width
:
3px
;
height
:
100%
;
background
:
#1969F9
;
position
:
absolute
;
left
:
-20px
;
top
:
0px
}
.messagexk
.message-box
.el-form
{
float
:
left
;
padding-top
:
35px
}
.messagexk
.message-box
.el-form
.el-form-item__label
{
color
:
#333
}
.messagexk
.message-box
.el-form
.el-input
{
width
:
280px
;
color
:
#333
}
.messagexk
.message-box
.el-form
.el-input.is-disabled
.el-input__inner
{
background
:
#F1F4FA
;
border
:
1px
solid
#F1F4FA
;
color
:
#333
}
.messagexk
.message-box
.el-form
.submits
{
margin-top
:
26px
;
cursor
:
pointer
;
width
:
76px
;
height
:
37px
;
line-height
:
37px
;
background
:
#1969F9
;
border-radius
:
2px
;
font-size
:
14px
;
color
:
#fff
;
text-align
:
center
}
.messagexk
.message-box
.el-form
.submits
:hover
{
background
:
#0050E0
}
.messagexk
.message-box
.up-box
{
position
:
relative
;
margin-left
:
90px
;
padding-top
:
37px
}
.messagexk
.message-box
.up-box
.avatar-uploader
{
width
:
98px
;
height
:
34px
;
border-radius
:
2px
;
border
:
1px
solid
#BEC9DF
;
overflow
:
hidden
;
line-height
:
34px
;
font-size
:
14px
;
color
:
#646B78
}
.messagexk
.message-box
.up-box
.avatar-uploader
.iconfont
{
font-size
:
18px
;
position
:
relative
;
top
:
-1px
;
margin-left
:
10px
}
.messagexk
.message-box
.up-box
.avatar-uploader
:hover
,
.messagexk
.message-box
.up-box
.avatar-uploader
.el-upload--picture-card
:hover
,
.messagexk
.message-box
.up-box
.avatar-uploader
.el-upload
:focus
{
color
:
#1969F9
!important
;
border-color
:
#1969F9
!important
}
.messagexk
.message-box
.up-box
.imspre
{
width
:
100px
;
height
:
100px
;
border-radius
:
50px
;
margin-bottom
:
16px
}
\ No newline at end of file
src/components/menu.vue
View file @
616681de
...
...
@@ -8,13 +8,15 @@
<font
class=
"fl"
>
概况
</font>
</a>
<a
class=
"item fl"
:class=
"
{'act':(JSON.stringify(item)==JSON.stringify({path: $route.path,title: $route.meta.title,query:$route.query}))}" @click="tabUrl(item)" v-for="item in tabs">
<a
class=
"item fl"
:class=
"
{'act':(JSON.stringify(item)==JSON.stringify({path: $route.path,title: $route.meta.title,query:$route.query}))}"
@click="tabUrl(item)" v-for="item in tabs">
<font
class=
"fl"
>
{{
item
.
title
}}
</font>
<span
class=
"icon iconfont fl"
@
click
.
stop=
"closetab(item.path)"
>
</span>
</a>
</div>
<div
class=
"user-box fr"
>
<!--
<div
class=
"line"
></div>
<!--
<div
class=
"line"
></div>
<a
class=
"msgh fl"
href=
"#"
>
<span
class=
"icon iconfont"
>
</span>
<font>
55
</font>
...
...
@@ -45,8 +47,8 @@
</div>
<el-menu
class=
"el-menu-vertical-demo"
@
open=
"handleOpen"
active-text-color=
"#1969F9"
router
:default-active=
"$route.path"
:router=
"true"
:unique-opened=
"true"
@
close=
"handleClose"
@
select=
"handleSelect"
>
:default-active=
"$route.path"
:router=
"true"
:unique-opened=
"true"
@
close=
"handleClose"
@
select=
"handleSelect"
>
<el-menu-item
:index=
"'/'"
:class=
"
{'indextab':isIndexTab}">
<template
slot=
"title"
>
<span
class=
"icon iconfont"
>
</span>
...
...
@@ -140,164 +142,178 @@
</template>
<
script
>
import
Vue
from
'vue'
;
import
Util
from
"../tool"
;
import
{
Form
,
FormItem
,
Menu
,
MenuItem
,
Submenu
,
MenuItemGroup
,
Message
,
Dialog
,
Button
}
from
'element-ui'
Vue
.
use
(
Menu
).
use
(
MenuItem
).
use
(
MenuItemGroup
).
use
(
Submenu
).
use
(
Form
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Button
);
export
default
{
name
:
'menus'
,
props
:
{},
created
()
{
this
.
getData
();
},
data
()
{
return
{
userinfo
:
{},
collapse
:
false
,
isIndexTab
:
true
,
tabSure
:
""
,
tabs
:
""
,
dialogVisible
:
false
,
ruleForm
:
{
name
:
''
import
Vue
from
'vue'
;
import
Util
from
"../tool"
;
import
{
Form
,
FormItem
,
Menu
,
MenuItem
,
Submenu
,
MenuItemGroup
,
Message
,
Dialog
,
Button
}
from
'element-ui'
Vue
.
use
(
Menu
).
use
(
MenuItem
).
use
(
MenuItemGroup
).
use
(
Submenu
).
use
(
Form
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Button
);
export
default
{
name
:
'menus'
,
props
:
{},
created
()
{
this
.
getData
();
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入活动名称'
,
trigger
:
'blur'
}
]
}
}
},
watch
:
{
$route
(
to
,
from
)
{
let
tab_arr
=
sessionStorage
.
getItem
(
'tabs'
)
if
(
tab_arr
)
{
this
.
tabs
=
JSON
.
parse
(
tab_arr
);
}
data
()
{
return
{
userinfo
:
{},
collapse
:
false
,
isIndexTab
:
true
,
tabSure
:
""
,
tabs
:
""
,
dialogVisible
:
false
,
ruleForm
:
{
name
:
''
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'请输入活动名称'
,
trigger
:
'blur'
}]
}
}
},
watch
:
{
$route
(
to
,
from
)
{
let
tab_arr
=
sessionStorage
.
getItem
(
'tabs'
)
if
(
tab_arr
)
{
this
.
tabs
=
JSON
.
parse
(
tab_arr
);
}
let
app_
=
document
.
getElementById
(
'app'
);
this
.
collapse
=
false
if
(
this
.
collapse
)
{
app_
.
setAttribute
(
'style'
,
'padding-left:62px'
);
}
else
{
app_
.
setAttribute
(
'style'
,
'padding-left:226px'
);
}
}
},
mounted
()
{
this
.
tabss
(
this
.
$route
.
path
)
},
methods
:
{
getData
()
{
this
.
$http
(
'get'
,
"/api/user/getuserinfo"
).
then
(
res
=>
{
this
.
userinfo
=
res
.
data
;
}).
catch
(
err
=>
{
})
},
tabUrl
(
item
)
{
this
.
$router
.
push
({
path
:
item
.
path
,
query
:
item
.
query
})
},
changePwd
()
{
this
.
dialogVisible
=
true
;
},
tabss
(
lk
)
{
if
(
lk
==
"/"
)
{
this
.
tabSure
=
1
}
if
(
lk
==
"/inquire"
||
lk
==
"/quote"
)
{
this
.
tabSure
=
2
}
if
(
lk
==
"/list"
||
lk
==
"/enter"
)
{
this
.
tabSure
=
3
}
if
(
lk
==
"/goods"
||
lk
==
"/brand"
)
{
this
.
tabSure
=
4
}
if
(
lk
==
"/message"
)
{
this
.
tabSure
=
5
}
let
tab_arr
=
sessionStorage
.
getItem
(
'tabs'
)
if
(
tab_arr
)
{
this
.
tabs
=
JSON
.
parse
(
tab_arr
);
}
},
closetab
(
path
)
{
let
tab_arr
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'tabs'
))
for
(
var
i
=
0
;
i
<
tab_arr
.
length
;
i
++
)
{
if
(
tab_arr
[
i
].
path
==
path
)
{
tab_arr
.
splice
(
i
,
1
);
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tab_arr
));
this
.
tabs
=
tab_arr
;
if
(
path
==
this
.
$route
.
path
)
{
if
(
i
==
0
)
{
let
app_
=
document
.
getElementById
(
'app'
);
this
.
collapse
=
false
if
(
this
.
collapse
)
{
app_
.
setAttribute
(
'style'
,
'padding-left:62px'
);
}
else
{
app_
.
setAttribute
(
'style'
,
'padding-left:226px'
);
}
}
},
mounted
()
{
this
.
tabss
(
this
.
$route
.
path
)
},
methods
:
{
getData
()
{
var
userInfo_
=
sessionStorage
.
getItem
(
'userInfox'
);
if
(
userInfo_
)
{
this
.
userinfo
=
JSON
.
parse
(
userInfo_
);
}
else
{
this
.
$http
(
'get'
,
"/api/user/getuserinfo"
).
then
(
res
=>
{
this
.
userinfo
=
res
.
data
;
if
(
res
.
data
){
sessionStorage
.
setItem
(
'userInfox'
,
JSON
.
stringify
(
res
.
data
));
}
})
}
},
tabUrl
(
item
)
{
this
.
$router
.
push
({
path
:
"/"
,
path
:
item
.
path
,
query
:
item
.
query
})
}
else
{
this
.
$router
.
push
({
path
:
tab_arr
[
i
-
1
].
path
,
},
changePwd
()
{
this
.
dialogVisible
=
true
;
},
tabss
(
lk
)
{
if
(
lk
==
"/"
)
{
this
.
tabSure
=
1
}
if
(
lk
==
"/inquire"
||
lk
==
"/quote"
)
{
this
.
tabSure
=
2
}
if
(
lk
==
"/list"
||
lk
==
"/enter"
)
{
this
.
tabSure
=
3
}
if
(
lk
==
"/goods"
||
lk
==
"/brand"
)
{
this
.
tabSure
=
4
}
if
(
lk
==
"/message"
)
{
this
.
tabSure
=
5
}
let
tab_arr
=
sessionStorage
.
getItem
(
'tabs'
)
if
(
tab_arr
)
{
this
.
tabs
=
JSON
.
parse
(
tab_arr
);
}
},
closetab
(
path
)
{
let
tab_arr
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'tabs'
))
for
(
var
i
=
0
;
i
<
tab_arr
.
length
;
i
++
)
{
if
(
tab_arr
[
i
].
path
==
path
)
{
tab_arr
.
splice
(
i
,
1
);
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tab_arr
));
this
.
tabs
=
tab_arr
;
if
(
path
==
this
.
$route
.
path
)
{
if
(
i
==
0
)
{
this
.
$router
.
push
({
path
:
"/"
,
})
}
else
{
this
.
$router
.
push
({
path
:
tab_arr
[
i
-
1
].
path
,
})
}
}
break
;
}
}
},
zk
()
{
this
.
collapse
=
!
this
.
collapse
;
let
app_
=
document
.
getElementById
(
'app'
);
if
(
this
.
collapse
)
{
app_
.
setAttribute
(
'style'
,
'padding-left:62px'
);
}
else
{
app_
.
setAttribute
(
'style'
,
'padding-left:226px'
);
}
},
handleOpen
(
key
,
keyPath
)
{
if
(
this
.
$route
.
path
==
"/"
)
{
this
.
isIndexTab
=
false
}
},
handleClose
(
key
,
keyPath
)
{
if
(
this
.
$route
.
path
==
"/"
)
{
this
.
isIndexTab
=
true
}
},
handleSelect
(
key
,
keyPath
)
{
this
.
tabss
(
key
)
},
logout
()
{
this
.
$http
(
'POST'
,
"/auth/logout"
).
then
(
res
=>
{
Util
.
delCookie
(
'token'
);
if
(
res
.
err_code
===
0
)
{
window
.
location
.
href
=
'/#/login'
;
sessionStorage
.
removeItem
(
'userInfox'
)
history
.
go
(
0
);
}
else
{
Message
(
res
.
err_msg
);
}
}).
catch
(
err
=>
{
console
.
log
(
err
.
message
);
})
}
}
break
;
}
}
},
zk
()
{
this
.
collapse
=
!
this
.
collapse
;
let
app_
=
document
.
getElementById
(
'app'
);
if
(
this
.
collapse
)
{
app_
.
setAttribute
(
'style'
,
'padding-left:62px'
);
}
else
{
app_
.
setAttribute
(
'style'
,
'padding-left:226px'
);
}
},
handleOpen
(
key
,
keyPath
)
{
if
(
this
.
$route
.
path
==
"/"
)
{
this
.
isIndexTab
=
false
}
},
handleClose
(
key
,
keyPath
)
{
if
(
this
.
$route
.
path
==
"/"
)
{
this
.
isIndexTab
=
true
}
},
handleSelect
(
key
,
keyPath
)
{
this
.
tabss
(
key
)
},
logout
()
{
this
.
$http
(
'POST'
,
"/auth/logout"
).
then
(
res
=>
{
Util
.
delCookie
(
'token'
);
if
(
res
.
err_code
===
0
)
{
window
.
location
.
href
=
'/#/login'
;
history
.
go
(
0
);
}
else
{
Message
(
res
.
err_msg
);
}
}).
catch
(
err
=>
{
console
.
log
(
err
.
message
);
})
}
}
}
</
script
>
<
style
lang=
"less"
>
...
...
src/filters/index.js
View file @
616681de
import
{
dateTimeFormate
,
dateTimeFormate1
}
from
'./formate'
;
import
{
dateTimeFormate
}
from
'./formate'
;
export
default
{
dateTimeFormate
,
dateTimeFormate1
,
};
src/main.js
View file @
616681de
...
...
@@ -40,6 +40,7 @@ router.afterEach((to, from, next) => {
title
:
to
.
meta
.
title
,
query
:
to
.
query
}))
==
-
1
)
{
console
.
log
(
tabOldJson
)
tabOldJson
.
push
({
path
:
to
.
path
,
title
:
to
.
meta
.
title
,
...
...
src/views/Info/message.vue
View file @
616681de
<
template
>
<div
class=
"messagexk pagex"
>
<div
class=
"message-box"
>
<div
class=
"h3"
>
基本信息
</div>
<el-form
:model=
"form"
label-width=
"90px"
>
<el-form-item
label=
"公司名称"
>
<el-input
v-model=
"form.keyword
"
placeholder=
""
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"联系人"
>
<el-input
v-model=
"form.keyword
"
></el-input>
</el-form-item>
<el-form-item
label=
"联系人电话"
>
<el-input
v-model=
"form.keyword
"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"邮箱"
>
<el-input
v-model=
"form.keyword
"
></el-input>
</el-form-item>
<el-form-item
>
<div
class=
"submits
"
>
确认
</div>
</el-form-item>
<div
class=
"messagexk pagex"
>
<div
class=
"message-box"
>
<div
class=
"h3"
>
基本信息
</div>
<el-form
:model=
"userinfo"
label-width=
"90px"
>
<el-form-item
label=
"公司名称"
>
<el-input
v-model=
"userinfo.company_name
"
placeholder=
""
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"联系人"
>
<el-input
v-model=
"userinfo.contacts_name
"
></el-input>
</el-form-item>
<el-form-item
label=
"联系人电话"
>
<el-input
v-model=
"userinfo.mobile
"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"邮箱"
>
<el-input
v-model=
"userinfo.email
"
></el-input>
</el-form-item>
<el-form-item
>
<div
class=
"submits"
@
click=
"submituser
"
>
确认
</div>
</el-form-item>
</el-form>
</div>
<Menu/>
<div
class=
"fl up-box"
>
<img
:src=
"userinfo.avatar"
class=
"imspre"
/>
<el-upload
class=
"avatar-uploader"
:action=
"upUrl"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
:before-upload=
"beforeAvatarUpload"
>
<span
class=
"icon iconfont fl"
>
</span>
<div
class=
"fl"
>
更换头像
</div>
</el-upload>
</div>
</div>
<Menu
/>
</div>
</
template
>
<
script
>
import
Vue
from
'vue'
;
import
Menu
from
"@/components/menu.vue"
;
import
{
NODE_ENVS
}
from
"../../ajax"
;
import
{
Form
,
FormItem
,
Input
,
Message
Upload
,
Message
}
from
'element-ui'
Vue
.
use
(
Form
).
use
(
FormItem
).
use
(
Input
)
Vue
.
use
(
Form
).
use
(
FormItem
).
use
(
Input
)
.
use
(
Upload
)
export
default
{
name
:
"message"
,
data
()
{
return
{
form
:{
keyword
:
""
upUrl
:
NODE_ENVS
+
'/api/user/setavatar'
,
userinfo
:
{
company_name
:
''
,
contacts_name
:
''
,
mobile
:
''
,
email
:
''
,
avatar
:
'http://img.ichunt.com/test/images/ichunt/9f/34/9f349b1400f659e5ad270412d4dbe160.jpg'
}
};
},
watch
:
{},
created
()
{
this
.
getUseInfo
()
},
computed
:
{},
methods
:
{
getUseInfo
()
{
var
userInfo_
=
sessionStorage
.
getItem
(
'userInfox'
);
if
(
userInfo_
)
{
this
.
userinfo
=
JSON
.
parse
(
userInfo_
);
}
else
{
this
.
$http
(
'get'
,
"/api/user/getuserinfo"
).
then
(
res
=>
{
this
.
userinfo
=
res
.
data
;
if
(
res
.
data
)
{
sessionStorage
.
setItem
(
'userInfox'
,
JSON
.
stringify
(
res
.
data
));
}
})
}
},
submituser
()
{
this
.
$http
(
'post'
,
"/api/user/setuserinfo"
,
{
email
:
this
.
userinfo
.
email
,
contacts_name
:
this
.
userinfo
.
contacts_name
}).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
Message
(
"提交成功"
);
sessionStorage
.
removeItem
(
'userInfox'
)
}
else
{
Message
(
res
.
err_msg
);
}
})
},
handleAvatarSuccess
(
res
,
file
)
{
if
(
res
.
err_code
===
0
)
{
Message
(
"设置成功"
)
this
.
userinfo
.
avatar
=
URL
.
createObjectURL
(
file
.
raw
);
sessionStorage
.
removeItem
(
'userInfox'
)
}
else
{
Message
(
res
.
err_msg
);
}
},
beforeAvatarUpload
(
file
)
{
const
isJPG
=
file
.
type
===
'image/jpeg'
||
'image/png'
||
'image/jpg'
||
'image/gif'
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
5
;
if
(
!
isJPG
)
{
this
.
$message
.
error
(
'上传头像图片只能是 JPG、PNG、GIF 格式!'
);
}
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传头像图片大小不能超过 5MB!'
);
}
return
isJPG
&&
isLt2M
;
}
},
components
:
{
...
...
@@ -59,5 +126,5 @@
};
</
script
>
<
style
scoped
>
@import
"../../assets/css/info/message.min.css"
;
@import
"../../assets/css/info/message.min.css"
;
</
style
>
\ No newline at end of file
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