Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
SHR
/
tFIMS
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7a6e640e
authored
Aug 27, 2019
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
aa
1 parent
3c781272
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
425 additions
and
220 deletions
src/layout/header-aside/components/header-user/index.vue
src/layout/header-aside/components/header-user/passwordDialog.vue
src/layout/header-aside/components/header-user/personMsgDialog.vue
src/layout/header-aside/components/personal-panel/index.vue
src/main.js
src/views/person/index.vue
src/layout/header-aside/components/header-user/index.vue
View file @
7a6e640
<
template
>
<
template
>
<div>
<!--
<el-dropdown
size=
"small"
class=
"d2-mr"
>
<!--
<el-dropdown
size=
"small"
class=
"d2-mr"
>
<span
class=
"btn-text"
>
{{
info
.
name
?
`你好 ${info.name
}
`
:
'未登录'
}}
<
/span
>
<span
class=
"btn-text"
>
{{
info
.
name
?
`你好 ${info.name
}
`
:
'未登录'
}}
<
/span
>
<
el
-
dropdown
-
menu
slot
=
"dropdown"
>
<
el
-
dropdown
-
menu
slot
=
"dropdown"
>
...
@@ -13,21 +15,39 @@
...
@@ -13,21 +15,39 @@
<
el
-
popover
ref
=
"popover-personal"
placement
=
"bottom-end"
trigger
=
"hover"
>
<
el
-
popover
ref
=
"popover-personal"
placement
=
"bottom-end"
trigger
=
"hover"
>
<
personal
-
panel
:
user
=
"info"
><
/personal-panel
>
<
personal
-
panel
:
user
=
"info"
><
/personal-panel
>
<
/el-popover
>
<
/el-popover
>
<
/div
>
<
/div
>
<
PersonDetailDialog
:
personDialogVisible
=
"detailVisible"
/>
<
PasswordDialog
:
passwordDialogVisible
=
"passVisible"
/>
<
/div
>
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
mapState
,
mapActions
}
from
'vuex'
import
{
mapState
,
mapActions
}
from
'vuex'
import
PersonalPanel
from
'../personal-panel'
import
PersonalPanel
from
'../personal-panel'
import
PersonDetailDialog
from
'./personMsgDialog'
import
PasswordDialog
from
'./passwordDialog'
export
default
{
export
default
{
components
:{
components
:{
PersonalPanel
PersonalPanel
,
PersonDetailDialog
,
PasswordDialog
}
,
}
,
computed
:
{
computed
:
{
...
mapState
(
'd2admin/user'
,
[
...
mapState
(
'd2admin/user'
,
[
'info'
'info'
])
])
}
,
}
,
data
()
{
return
{
detailVisible
:
false
,
passVisible
:
false
}
}
,
methods
:
{
methods
:
{
...
mapActions
(
'd2admin/account'
,
[
...
mapActions
(
'd2admin/account'
,
[
'logout'
'logout'
...
...
src/layout/header-aside/components/header-user/passwordDialog.vue
0 → 100644
View file @
7a6e640
<!-- 详情弹框 -->
<
template
>
<div
class=
"detail"
>
<el-dialog
title=
"修改密码"
:visible
.
sync=
"passwordDialogVisible"
:before-close=
"handleClose"
width=
"600px"
>
<el-form
label-width=
"120px"
:model=
"info"
status-icon
:rules=
"rules"
ref=
"info"
>
<el-form-item
label=
"用户名:"
prop=
"userName"
>
<el-input
readonly=
"readonly"
v-model=
"info.userName"
></el-input>
</el-form-item>
<el-form-item
label=
"原密码:"
prop=
"oldPassword"
>
<el-input
v-model=
"info.oldPassword"
></el-input>
</el-form-item>
<el-form-item
label=
"新密码:"
prop=
"newPassword"
>
<el-input
v-model=
"info.newPassword"
></el-input>
</el-form-item>
<el-form-item
label=
"确认密码:"
prop=
"surePassword"
>
<el-input
v-model=
"info.surePassword"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"savePassword('info')"
>
保 存
</el-button>
<el-button
@
click=
"passwordDialogVisible = false"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
// import { ctMethods, request } from '@/api'
export
default
{
name
:
'PasswordDialog'
,
components
:
{
},
data
()
{
var
validateOldPass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'请输入旧密码'
));
}
else
{
callback
();
//查询当前用户的密码是否与输入的旧密码一致
}
};
var
validateNewPass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'请输入新密码'
));
}
else
if
(
value
===
this
.
info
.
oldPassword
){
callback
(
new
Error
(
'新密码与旧密码不能一样'
));
}
else
{
callback
();
}
};
var
validateSurePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'请输入确认新密码'
));
}
else
if
(
value
!==
this
.
info
.
newPassword
){
callback
(
new
Error
(
'两次输入密码不一致'
));
}
else
{
callback
();
}
};
return
{
info
:
{
userName
:
''
,
oldPassword
:
''
,
newPassword
:
''
,
surePassword
:
''
},
rules
:
{
oldPassword
:
[
{
validator
:
validateOldPass
,
trigger
:
'blur'
}
],
newPassword
:
[
{
validator
:
validateNewPass
,
trigger
:
'blur'
}
],
surePassword
:
[
{
validator
:
validateSurePass
,
trigger
:
'blur'
}
]
}
}
},
props
:
{
passwordDialogVisible
:
{
type
:
Boolean
,
default
:
false
},
// info: {
// type: Object,
// default: function() {
// return {}
// }
// }
},
watch
:
{
},
mounted
()
{
},
methods
:
{
// getPersonalType() {
// const params = {}
// params.method = ctMethods.GetPersonalType
// request
// .req(params)
// .then(res => {
// this.sendObjList = res.merchantDictList
// })
// .catch(err => {
// console.log(err)
// })
// },
//修改密码
savePassword
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
alert
(
'submit!'
);
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
handleClose
()
{
this
.
passwordDialogVisible
=
false
},
mergePassWord
(
params
)
{
// mergeBg
// .req(params)
// .then(res => {
// this.$message({
// message: '密码已修改',
// type: 'success'
// });
// })
// .catch(err => console.log(err))
},
}
}
</
script
>
<
style
>
.detail
.el-dialog__body
{
padding
:
0
20px
;
}
.detail
.el-select
{
width
:
100%
;
}
.detail
.content
{
overflow-x
:
auto
;
max-height
:
400px
;
}
.detail
.el-checkbox-group
{
display
:
flex
;
overflow-x
:
auto
;
}
.detail
.download
a
{
color
:
#409eff
;
text-decoration
:
underline
;
}
.detail
.el-checkbox__input.is-disabled
+
span
.el-checkbox__label
,
.detail
.el-radio__input.is-disabled
+
span
.el-radio__label
{
color
:
#606266
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
,
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
{
border-color
:
#409eff
;
background
:
#409eff
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
::after
{
border-color
:
#fff
;
}
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
::after
{
background-color
:
#fff
;
}
.detail
.el-radio
:focus:not
(
.is-focus
)
:not
(
:active
)
.el-radio__inner
{
box-shadow
:
0
0
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/layout/header-aside/components/header-user/personMsgDialog.vue
0 → 100644
View file @
7a6e640
<!-- 详情弹框 -->
<
template
>
<div
class=
"detail"
>
<el-dialog
title=
"个人信息"
:visible
.
sync=
"personDialogVisible"
:before-close=
"handleClose"
width=
"600px"
>
<el-form
label-width=
"120px"
:model=
"detail"
>
<el-form-item
label=
"用户名:"
prop=
"userName"
>
<el-input
readonly=
"readonly"
v-model=
"detail.userName"
></el-input>
</el-form-item>
<el-form-item
label=
"姓名:"
prop=
"personName"
>
<el-input
readonly=
"readonly"
v-model=
"detail.personName"
></el-input>
</el-form-item>
<el-form-item
label=
"联系方式:"
prop=
"phone"
>
<el-input
readonly=
"readonly"
v-model=
"detail.phone"
></el-input>
</el-form-item>
<el-form-item
label=
"所属公司:"
prop=
"company"
>
<el-input
readonly=
"readonly"
v-model=
"detail.company"
></el-input>
</el-form-item>
<el-form-item
label=
"部门:"
prop=
"department"
>
<el-input
readonly=
"readonly"
v-model=
"detail.department"
></el-input>
</el-form-item>
<el-form-item
label=
"职务:"
prop=
"duties"
>
<el-input
readonly=
"readonly"
v-model=
"detail.duties"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"personDialogVisible = false"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
// import { ctMethods, request } from '@/api'
export
default
{
name
:
'PersonDetailDialog'
,
components
:
{
},
data
()
{
return
{
detail
:
{
userName
:
'abc123'
,
personName
:
'张三'
,
phone
:
'18511111111'
,
company
:
'长春富通机电设备有限公司'
,
department
:
'售后部'
,
duties
:
'仓库管理'
,
}
}
},
props
:
{
personDialogVisible
:
{
type
:
Boolean
,
default
:
false
},
// detail: {
// type: Object,
// default: function() {
// // return {}
// return {
// userName : 'abc123',
// personName : '张三',
// phone : '18511111111',
// company : '长春富通机电设备有限公司',
// department : '售后部',
// duties : '仓库管理',
// }
// }
// }
},
watch
:
{
// personDialogVisible(val) {
// if (val) {
// this.getPersonalType()
// if (this.detail.merchants && this.detail.merchants.length > 0) {
// this.tableData_sendMerchants.data = this.detail.merchants
// }
// }
// }
},
mounted
()
{
},
methods
:
{
// getPersonalType() {
// const params = {}
// params.method = ctMethods.GetPersonalType
// request
// .req(params)
// .then(res => {
// this.sendObjList = res.merchantDictList
// })
// .catch(err => {
// console.log(err)
// })
// },
handleClose
()
{
this
.
personDialogVisible
=
false
}
}
}
</
script
>
<
style
>
.detail
.el-dialog__body
{
padding
:
0
20px
;
}
.detail
.el-select
{
width
:
100%
;
}
.detail
.content
{
overflow-x
:
auto
;
max-height
:
400px
;
}
.detail
.el-checkbox-group
{
display
:
flex
;
overflow-x
:
auto
;
}
.detail
.download
a
{
color
:
#409eff
;
text-decoration
:
underline
;
}
.detail
.el-checkbox__input.is-disabled
+
span
.el-checkbox__label
,
.detail
.el-radio__input.is-disabled
+
span
.el-radio__label
{
color
:
#606266
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
,
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
{
border-color
:
#409eff
;
background
:
#409eff
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
::after
{
border-color
:
#fff
;
}
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
::after
{
background-color
:
#fff
;
}
.detail
.el-radio
:focus:not
(
.is-focus
)
:not
(
:active
)
.el-radio__inner
{
box-shadow
:
0
0
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/layout/header-aside/components/personal-panel/index.vue
View file @
7a6e640
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</div>
-->
</div>
-->
<div
class=
"main-operation"
>
<div
class=
"main-operation"
>
<span
class=
"main-operation-item"
>
<span
class=
"main-operation-item"
>
<el-button
size=
"small"
icon=
"fa fa-male"
>
个人中心
</el-button>
<el-button
size=
"small"
icon=
"fa fa-male"
@
click=
"openUserMsgDialog()"
>
个人中心
</el-button>
</span>
</span>
<span
class=
"main-operation-item"
>
<span
class=
"main-operation-item"
>
<el-button
size=
"small"
icon=
"fa fa-key"
>
修改密码
</el-button>
<el-button
size=
"small"
icon=
"fa fa-key"
>
修改密码
</el-button>
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
</div>
</div>
<!--备份还原界面-->
<!--备份还原界面-->
<!--
<backup
ref=
"backupDialog"
@
afterRestore=
"afterRestore"
></backup>
-->
<!--
<backup
ref=
"backupDialog"
@
afterRestore=
"afterRestore"
></backup>
-->
</div>
</div>
</
template
>
</
template
>
...
@@ -113,6 +114,11 @@ export default {
...
@@ -113,6 +114,11 @@ export default {
this
.
$api
.
login
.
logout
().
then
((
res
)
=>
{
this
.
$api
.
login
.
logout
().
then
((
res
)
=>
{
}).
catch
(
function
(
res
)
{
}).
catch
(
function
(
res
)
{
})
})
},
//打开个人信息弹出框
openUserMsgDialog
:
function
(){
console
.
log
(
'aaaa'
)
}
}
},
},
mounted
()
{
mounted
()
{
...
...
src/main.js
View file @
7a6e640
...
@@ -7,7 +7,7 @@ import d2Admin from '@/plugin/d2admin'
...
@@ -7,7 +7,7 @@ import d2Admin from '@/plugin/d2admin'
// store
// store
import
store
from
'@/store/index'
import
store
from
'@/store/index'
import
D2Crud
from
'@d2-projects/d2-crud'
//
import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置
// 菜单和路由设置
import
router
from
'./router'
import
router
from
'./router'
// import menuHeader from '@/menu/header'
// import menuHeader from '@/menu/header'
...
@@ -22,7 +22,7 @@ Vue.use(VRM, {
...
@@ -22,7 +22,7 @@ Vue.use(VRM, {
})
})
// 核心插件
// 核心插件
Vue
.
use
(
d2Admin
)
Vue
.
use
(
d2Admin
)
Vue
.
use
(
D2Crud
)
//
Vue.use(D2Crud)
new
Vue
({
new
Vue
({
router
,
router
,
store
,
store
,
...
...
src/views/person/index.vue
deleted
100644 → 0
View file @
3c78127
<!-- 详情弹框 -->
<
template
>
<div
class=
"detail"
>
<gl-dialog
title=
"个人信息"
:visible
.
sync=
"isVisible"
:before-close=
"handleClose"
width=
"600px"
:close-on-click-modal=
"false"
>
<gl-form
label-width=
"120px"
:model=
"detail"
>
<gl-form-item
label=
"用户名:"
prop=
"userName"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.userName"
></gl-input>
</gl-form-item>
<gl-form-item
label=
"姓名:"
prop=
"personName"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.personName"
></gl-input>
</gl-form-item>
<gl-form-item
label=
"联系方式:"
prop=
"phone"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.phone"
></gl-input>
</gl-form-item>
<gl-form-item
label=
"所属公司:"
prop=
"company"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.company"
></gl-input>
</gl-form-item>
<gl-form-item
label=
"部门:"
prop=
"department"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.department"
></gl-input>
</gl-form-item>
<gl-form-item
label=
"职务:"
prop=
"duties"
>
<gl-input
readonly=
"readonly"
v-model=
"detail.duties"
></gl-input>
</gl-form-item>
</gl-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<gl-button
type=
"primary"
@
click=
"isVisible = false"
>
确 定
</gl-button>
</div>
</gl-dialog>
</div>
</
template
>
<
script
>
import
{
ctMethods
,
request
}
from
'@/api'
export
default
{
name
:
'DetailDialog'
,
components
:
{
},
data
()
{
return
{
// readonly: true,
// isEditable: false,
// sendObjList: [],
// checkList: [],
// showTypeList: [{
// label: '弹出框',
// value: 1
// }, {
// label: '置顶消息',
// value: 2
// }],
// tableData_sendMerchants: {
// border: true,
// stripe: true,
// align: 'center',
// height: 200,
// data: [],
// number: {
// label: '序号',
// width: '50px',
// index: index => {
// ++index
// return index < 10 && index > 0 ? '0' + index : index
// }
// },
// column: [
// {
// label: '商户名称',
// prop: 'merchantName',
// width: '250px'
// },
// {
// label: '大区',
// prop: 'regionName'
// },
// {
// label: '省份',
// prop: 'provinceName'
// },
// {
// label: '城市',
// prop: 'cityName'
// }
// ],
// console: { }
// }
}
},
props
:
{
isVisible
:
{
type
:
Boolean
,
default
:
false
},
detail
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
},
diaTitle
:
String
},
watch
:
{
// isVisible(val) {
// if (val) {
// this.getPersonalType()
// if (this.detail.merchants && this.detail.merchants.length > 0) {
// this.tableData_sendMerchants.data = this.detail.merchants
// }
// }
// }
},
mounted
()
{
},
methods
:
{
getPersonalType
()
{
const
params
=
{}
params
.
method
=
ctMethods
.
GetPersonalType
request
.
req
(
params
)
.
then
(
res
=>
{
this
.
sendObjList
=
res
.
merchantDictList
})
.
catch
(
err
=>
{
console
.
log
(
err
)
})
},
handleClose
()
{
this
.
$emit
(
'hideDialog'
)
}
}
}
</
script
>
<
style
>
.detail
.el-dialog__body
{
padding
:
0
20px
;
}
.detail
.el-select
{
width
:
100%
;
}
.detail
.content
{
overflow-x
:
auto
;
max-height
:
400px
;
}
.detail
.el-checkbox-group
{
display
:
flex
;
overflow-x
:
auto
;
}
.detail
.download
a
{
color
:
#409eff
;
text-decoration
:
underline
;
}
.detail
.el-checkbox__input.is-disabled
+
span
.el-checkbox__label
,
.detail
.el-radio__input.is-disabled
+
span
.el-radio__label
{
color
:
#606266
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
,
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
{
border-color
:
#409eff
;
background
:
#409eff
;
}
.detail
.el-checkbox__input.is-disabled.is-checked
.el-checkbox__inner
::after
{
border-color
:
#fff
;
}
.detail
.el-radio__input.is-disabled.is-checked
.el-radio__inner
::after
{
background-color
:
#fff
;
}
.detail
.el-radio
:focus:not
(
.is-focus
)
:not
(
:active
)
.el-radio__inner
{
box-shadow
:
0
0
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment