Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
4da7d645
Commit
4da7d645
authored
May 02, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
6c916a78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
230 additions
and
55 deletions
+230
-55
iview-admin/src/router/routers.js
+2
-2
iview-admin/src/view/components/tables/forms/forms.vue
+69
-53
iview-admin/src/view/userinfo/accountinfo_page.vue
+159
-0
No files found.
iview-admin/src/router/routers.js
View file @
4da7d645
...
@@ -64,9 +64,9 @@ export default [
...
@@ -64,9 +64,9 @@ export default [
name
:
'account_info'
,
name
:
'account_info'
,
meta
:
{
meta
:
{
icon
:
'md-clipboard'
,
icon
:
'md-clipboard'
,
title
:
'帐户
信息
'
title
:
'帐户
资料
'
},
},
component
:
()
=>
import
(
'@/view/
roleinfo/role
info_page.vue'
)
component
:
()
=>
import
(
'@/view/
userinfo/account
info_page.vue'
)
},
},
{
{
path
:
'tanents_info'
,
path
:
'tanents_info'
,
...
...
iview-admin/src/view/components/tables/forms/forms.vue
View file @
4da7d645
<
template
>
<
template
>
<div>
<div>
<Card
style=
"height:100%"
>
<Card
style=
"height:100%
;padding-bottom:60px;border-radius:0px
"
>
<p
slot=
"title"
>
<p
slot=
"title"
>
<Icon
type=
"ios-paper-outline"
/>
<Icon
type=
"ios-paper-outline"
/>
{{
forminfo
.
name
}}
{{
forminfo
.
name
}}
...
@@ -11,11 +11,18 @@
...
@@ -11,11 +11,18 @@
<TabPane
label=
"表单信息"
name=
"main"
>
<TabPane
label=
"表单信息"
name=
"main"
>
<template
v-for=
"group in forminfo.main"
>
<template
v-for=
"group in forminfo.main"
>
<Divider
orientation=
"left"
:key=
"group.title"
>
{{
group
.
title
}}
</Divider>
<Divider
orientation=
"left"
:key=
"group.title"
>
{{
group
.
title
}}
</Divider>
<Row
type=
"flex"
justify=
"start"
:key=
"'r'+group.title"
>
<Row
type=
"flex"
justify=
"start"
:key=
"'r'+group.title"
>
<Col
:xs=
"getCols(group.cols)"
:sm=
"getCols(group.cols)"
:md=
"getCols(group.cols)"
:lg=
"getCols(group.cols)"
v-for=
"ctl in group.ctls"
:key=
"ctl.prop"
>
<Col
:xs=
"getCols(group.cols)"
:sm=
"getCols(group.cols)"
:md=
"getCols(group.cols)"
:lg=
"getCols(group.cols)"
v-for=
"ctl in group.ctls"
:key=
"ctl.prop"
>
<FormItem
v-if=
"ctlVisable[ctl.prop]"
:label=
"ctl.label"
:prop=
"ctl.prop"
>
<FormItem
v-if=
"ctlVisable[ctl.prop]"
:label=
"ctl.label"
:prop=
"ctl.prop"
>
<template
v-if=
"ctl.type=='input'"
>
<template
v-if=
"ctl.type=='input'"
>
<input
v-model=
"formModel[ctl.prop]"
>
<input
v-model=
"formModel[ctl.prop]"
:placeholder=
"ctl.placeHolder"
>
</
template
>
</
template
>
<
template
v-if=
"ctl.type=='btn'"
>
<
template
v-if=
"ctl.type=='btn'"
>
<button
:type=
"ctl.btncss"
:icon=
"ctl.icon"
>
{{
ctl
.
label
}}
</button>
<button
:type=
"ctl.btncss"
:icon=
"ctl.icon"
>
{{
ctl
.
label
}}
</button>
...
@@ -82,7 +89,7 @@
...
@@ -82,7 +89,7 @@
</template>
</template>
</TabPane>
</TabPane>
<TabPane
<TabPane
:disabled=
"tabDisabled[lst['bizCode']]"
:disabled=
"tabDisabled[lst['bizCode']]"
v-for=
"lst in forminfo.lists"
v-for=
"lst in forminfo.lists"
:key=
"lst.refBizCode"
:key=
"lst.refBizCode"
:label=
"lst.title"
:label=
"lst.title"
...
@@ -93,10 +100,17 @@
...
@@ -93,10 +100,17 @@
<
template
v-else
v-for=
"group in forminfo.main"
>
<
template
v-else
v-for=
"group in forminfo.main"
>
<Divider
orientation=
"left"
:key=
"group.title"
>
{{
group
.
title
}}
</Divider>
<Divider
orientation=
"left"
:key=
"group.title"
>
{{
group
.
title
}}
</Divider>
<Row
type=
"flex"
justify=
"start"
align=
"top"
:key=
"'r'+group.title"
>
<Row
type=
"flex"
justify=
"start"
align=
"top"
:key=
"'r'+group.title"
>
<Col
:xs=
"getCols(group.cols)"
:sm=
"getCols(group.cols)"
:md=
"getCols(group.cols)"
:lg=
"getCols(group.cols)"
v-for=
"ctl in group.ctls"
:key=
"ctl.prop"
>
<Col
:xs=
"getCols(group.cols)"
:sm=
"getCols(group.cols)"
:md=
"getCols(group.cols)"
:lg=
"getCols(group.cols)"
v-for=
"ctl in group.ctls"
:key=
"ctl.prop"
>
<FormItem
v-if=
"ctlVisable[ctl.prop]"
:label=
"ctl.label"
:prop=
"ctl.prop"
>
<FormItem
v-if=
"ctlVisable[ctl.prop]"
:label=
"ctl.label"
:prop=
"ctl.prop"
>
<template
v-if=
"ctl.type=='input'"
>
<template
v-if=
"ctl.type=='input'"
>
<input
v-model=
"formModel[ctl.prop]"
>
<input
v-model=
"formModel[ctl.prop]"
:placeholder=
"ctl.placeHolder"
:disabled=
"ctl.disabled"
>
</
template
>
</
template
>
<
template
v-if=
"ctl.type=='btn'"
>
<
template
v-if=
"ctl.type=='btn'"
>
<button
:type=
"ctl.btncss"
:icon=
"ctl.icon"
>
{{
ctl
.
label
}}
</button>
<button
:type=
"ctl.btncss"
:icon=
"ctl.icon"
>
{{
ctl
.
label
}}
</button>
...
@@ -213,23 +227,26 @@ export default {
...
@@ -213,23 +227,26 @@ export default {
watch
:
{
watch
:
{
fminfo
(
nf
,
of
)
{
fminfo
(
nf
,
of
)
{
this
.
initFormModel
();
this
.
initFormModel
();
},
forminfo
(
nf
){
this
.
initFormModel
();
}
}
},
},
methods
:
{
methods
:
{
getCols
(
cols
){
getCols
(
cols
)
{
let
cs
=
cols
?
cols
:
2
let
cs
=
cols
?
cols
:
2
;
return
24
/
cs
return
24
/
cs
;
},
},
validate
(
cbk
){
validate
(
cbk
)
{
this
.
$refs
.
ofm
.
validate
(
cbk
)
this
.
$refs
.
ofm
.
validate
(
cbk
);
},
},
activeChildTables
(
vf
){
activeChildTables
(
vf
)
{
Object
.
keys
(
this
.
tabDisabled
).
forEach
(
k
=>
{
Object
.
keys
(
this
.
tabDisabled
).
forEach
(
k
=>
{
this
.
tabDisabled
[
k
]
=
vf
==
false
?
vf
:
true
this
.
tabDisabled
[
k
]
=
vf
==
false
?
vf
:
true
;
})
})
;
},
},
setCtlVisable
(
prop
,
isShow
)
{
setCtlVisable
(
prop
,
isShow
)
{
this
.
ctlVisable
[
prop
]
=
isShow
this
.
ctlVisable
[
prop
]
=
isShow
;
},
},
resetForm
()
{
resetForm
()
{
this
.
$refs
.
ofm
.
resetFields
();
this
.
$refs
.
ofm
.
resetFields
();
...
@@ -245,52 +262,51 @@ export default {
...
@@ -245,52 +262,51 @@ export default {
console
.
log
(
JSON
.
stringify
(
this
.
formModel
));
console
.
log
(
JSON
.
stringify
(
this
.
formModel
));
},
},
initFormModel
()
{
initFormModel
()
{
if
(
this
.
forminfo
.
lists
&&
this
.
forminfo
.
lists
.
length
>
0
)
{
if
(
this
.
forminfo
.
lists
&&
this
.
forminfo
.
lists
.
length
>
0
)
{
this
.
forminfo
.
lists
.
forEach
(
item
=>
{
this
.
forminfo
.
lists
.
forEach
(
item
=>
{
this
.
$set
(
this
.
tabDisabled
,
item
[
'bizCode'
],
true
);
this
.
$set
(
this
.
tabDisabled
,
item
[
"bizCode"
],
true
);
})
});
}
}
if
(
this
.
forminfo
.
main
)
{
this
.
forminfo
.
main
.
forEach
(
m
=>
{
this
.
forminfo
.
main
.
forEach
(
m
=>
{
if
(
!
m
||
!
m
.
ctls
)
{
if
(
!
m
||
!
m
.
ctls
)
{
return
;
return
;
}
m
.
ctls
.
forEach
(
ctl
=>
{
this
.
$set
(
this
.
ctlVisable
,
ctl
.
prop
,
true
);
if
(
ctl
.
rules
)
{
ctl
.
rules
.
forEach
(
r
=>
{
if
(
r
.
validator
)
{
r
.
validator
=
self
[
r
.
validator
];
}
});
this
.
metaRules
[
ctl
.
prop
]
=
ctl
.
rules
;
}
}
if
(
m
.
ctls
.
forEach
(
ctl
=>
{
ctl
.
type
.
indexOf
(
"select"
)
>=
0
||
this
.
$set
(
this
.
ctlVisable
,
ctl
.
prop
,
true
);
ctl
.
type
.
indexOf
(
"checkgroups"
)
>=
0
if
(
ctl
.
rules
)
{
)
{
ctl
.
rules
.
forEach
(
r
=>
{
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
[]);
if
(
r
.
validator
)
{
}
else
{
r
.
validator
=
self
[
r
.
validator
];
console
.
log
(
ctl
.
prop
);
}
if
(
ctl
.
type
==
"switch"
){
});
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
false
)
;
this
.
metaRules
[
ctl
.
prop
]
=
ctl
.
rules
;
}
}
else
if
(
ctl
.
type
==
"number"
)
{
if
(
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
0
);
ctl
.
type
.
indexOf
(
"select"
)
>=
0
||
ctl
.
type
.
indexOf
(
"checkgroups"
)
>=
0
)
{
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
[]);
}
else
{
}
else
{
console
.
log
(
"============="
);
console
.
log
(
ctl
.
prop
);
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
""
);
if
(
ctl
.
type
==
"switch"
)
{
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
false
);
}
else
if
(
ctl
.
type
==
"number"
)
{
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
0
);
}
else
{
console
.
log
(
"============="
);
this
.
$set
(
this
.
formModel
,
ctl
.
prop
,
""
);
}
}
}
}
}
);
});
});
}
);
}
}
}
},
},
created
()
{
created
()
{
this
.
initFormModel
();
this
.
initFormModel
();
},
},
mounted
()
{
mounted
()
{}
}
};
};
</
script
>
</
script
>
...
...
iview-admin/src/view/userinfo/accountinfo_page.vue
0 → 100644
View file @
4da7d645
<
template
>
<div>
<FormAccount
ref=
"uinfo"
:fminfo=
"forminfo"
>
<template
v-slot:default=
"slotProps"
>
<Button
@
click=
"upuserinfo"
>
保存
</Button>
</
template
>
</FormAccount>
<br/>
<FormAccount
ref=
"entinfo"
:fminfo=
"entforminfo"
style=
"height:100%"
>
<
template
v-slot:default=
"slotProps"
>
<Button
@
click=
"upentinfo"
>
保存
</Button>
</
template
>
</FormAccount>
</div>
</template>
<
script
>
import
FormAccount
from
"../components/tables/forms/forms"
;
export
default
{
name
:
"accountinfo_page"
,
data
()
{
return
{
forminfo
:
{
name
:
"用户资料"
,
main
:
[
{
title
:
"基本信息"
,
key
:
"baseinfo"
,
ctls
:
[
{
type
:
"input"
,
label
:
"帐户名称"
,
prop
:
"userName"
,
placeHolder
:
"请输入帐户名"
,
style
:
""
,
disabled
:
true
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"昵称"
,
prop
:
"nickName"
,
placeHolder
:
"请输入昵称"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"邮件地址"
,
prop
:
"mail"
,
placeHolder
:
"请输入邮件"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"upload"
,
label
:
"头像"
,
prop
:
"headUrl"
,
placeHolder
:
"请上传头像"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
}
]
},
{
title
:
"密码修改"
,
key
:
"baseinfo"
,
cols
:
1
,
ctls
:
[
{
type
:
"input"
,
label
:
"新设密码"
,
prop
:
"onepassword"
,
placeHolder
:
"请输入新密码"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"密码确认"
,
prop
:
"repeatpassword"
,
placeHolder
:
"请重新输入新密码"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
]
}
],
lists
:
[]
},
entforminfo
:
{
name
:
"企业资料"
,
main
:
[
{
title
:
"基本信息"
,
key
:
"baseinfo"
,
ctls
:
[
{
type
:
"input"
,
label
:
"企业名称"
,
prop
:
"name"
,
placeHolder
:
"请输入企业名称"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"电话"
,
prop
:
"phone"
,
placeHolder
:
"请输入昵称"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"企业邮件"
,
prop
:
"mail"
,
placeHolder
:
"请输入邮件"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"input"
,
label
:
"地址"
,
prop
:
"mail"
,
placeHolder
:
"请输入邮件"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
},
{
type
:
"upload"
,
label
:
"营业执照"
,
prop
:
"licenseUrl"
,
placeHolder
:
"请上传头像"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]
}
]
}
],
lists
:
[]
}
};
},
components
:
{
FormAccount
},
mount
()
{},
methods
:
{
upuserinfo
(){
},
upentinfo
(){
}
}
};
</
script
>
<
style
>
</
style
>
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