Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
national_museum_vod
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
qzhxx
national_museum_vod
Commits
ed3e8249
Commit
ed3e8249
authored
Apr 10, 2021
by
xulili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位管理员 新增/编辑
parent
fd1c0a9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
95 deletions
+96
-95
add.vue
src/page/accounts/unitAdminDialog/add.vue
+6
-11
edit.vue
src/page/accounts/unitAdminDialog/edit.vue
+90
-84
No files found.
src/page/accounts/unitAdminDialog/add.vue
View file @
ed3e8249
...
@@ -118,7 +118,7 @@ export default {
...
@@ -118,7 +118,7 @@ export default {
phone
:
""
,
phone
:
""
,
weChat
:
""
,
weChat
:
""
,
email
:
""
,
email
:
""
,
type
:
2
,
//1.用户账号 2.平台单位管理员账号 3.机顶盒账号 4.运维账号
type
:
2
,
//1.用户账号 2.平台单位管理员账号 3.机顶盒账号 4.运维账号
},
},
rules
:
{
rules
:
{
userName
:
[
userName
:
[
...
@@ -176,19 +176,14 @@ export default {
...
@@ -176,19 +176,14 @@ export default {
this
.
$message
.
error
(
"请选择有效期"
);
this
.
$message
.
error
(
"请选择有效期"
);
return
false
;
return
false
;
}
}
if
(
this
.
form
.
telephone
){
user
.
telephone
=
this
.
form
.
telephone
;
}
if
(
!
this
.
form
.
email
)
{
user
.
email
=
this
.
form
.
email
;
}
if
(
!
this
.
form
.
weChat
)
{
user
.
weChat
=
this
.
form
.
weChat
;
}
if
(
!
this
.
form
.
permanent
)
{
if
(
!
this
.
form
.
permanent
)
{
user
.
effectiveDate
=
this
.
form
.
date
[
0
];
user
.
effectiveDate
=
this
.
form
.
date
[
0
];
user
.
exiredDate
=
this
.
form
.
date
[
1
];
user
.
exiredDate
=
this
.
form
.
date
[
1
];
}
}
user
.
telephone
=
this
.
form
.
telephone
||
""
;
user
.
email
=
this
.
form
.
email
||
""
;
user
.
weChat
=
this
.
form
.
weChat
||
""
;
user
.
phone
=
this
.
form
.
phone
;
user
.
permanent
=
this
.
form
.
permanent
;
user
.
permanent
=
this
.
form
.
permanent
;
user
.
userName
=
this
.
form
.
userName
;
user
.
userName
=
this
.
form
.
userName
;
user
.
orgId
=
this
.
form
.
orgId
;
user
.
orgId
=
this
.
form
.
orgId
;
...
...
src/page/accounts/unitAdminDialog/edit.vue
View file @
ed3e8249
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
width=
"720px"
width=
"720px"
:before-close=
"handleClose"
:before-close=
"handleClose"
>
>
<div
class=
"dialog-content"
>
<div
class=
"dialog-content"
>
<el-form
<el-form
ref=
"form"
ref=
"form"
:model=
"form"
:model=
"form"
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
import
{
getOrgListWithOutPage
}
from
"@/config/organ"
;
import
{
getOrgListWithOutPage
}
from
"@/config/organ"
;
export
default
{
export
default
{
data
()
{
data
()
{
var
validateMobilePhone
=
(
rule
,
value
,
callback
)
=>
{
var
validateMobilePhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
""
)
{
if
(
value
===
""
)
{
callback
(
new
Error
(
"手机号不可为空"
));
callback
(
new
Error
(
"手机号不可为空"
));
}
else
{
}
else
{
...
@@ -109,9 +109,9 @@ export default {
...
@@ -109,9 +109,9 @@ export default {
dialogVisible
:
false
,
dialogVisible
:
false
,
organList
:
[],
organList
:
[],
rolesList
:
[],
rolesList
:
[],
id
:
''
,
id
:
""
,
form
:
{
form
:
{
id
:
''
,
id
:
""
,
userName
:
""
,
userName
:
""
,
telephone
:
""
,
telephone
:
""
,
orgId
:
""
,
orgId
:
""
,
...
@@ -120,8 +120,8 @@ export default {
...
@@ -120,8 +120,8 @@ export default {
phone
:
""
,
phone
:
""
,
weChat
:
""
,
weChat
:
""
,
email
:
""
,
email
:
""
,
roleList
:[],
roleList
:
[],
type
:
2
,
//1.用户账号 2.平台单位管理员账号 3.机顶盒账号 4.运维账号
type
:
2
,
//1.用户账号 2.平台单位管理员账号 3.机顶盒账号 4.运维账号
},
},
rules
:
{
rules
:
{
userName
:
[
userName
:
[
...
@@ -133,9 +133,14 @@ export default {
...
@@ -133,9 +133,14 @@ export default {
permanent
:
[
permanent
:
[
{
required
:
true
,
message
:
"请选择账号有效期"
,
trigger
:
"change"
},
{
required
:
true
,
message
:
"请选择账号有效期"
,
trigger
:
"change"
},
],
],
roleList
:
[
roleList
:
[
{
type
:
'array'
,
required
:
true
,
message
:
"请选择账号类型"
,
trigger
:
"change"
},
{
]
type
:
"array"
,
required
:
true
,
message
:
"请选择账号类型"
,
trigger
:
"change"
,
},
],
},
},
};
};
},
},
...
@@ -150,81 +155,82 @@ export default {
...
@@ -150,81 +155,82 @@ export default {
});
});
},
},
// 根据id获取获取详情内容
// 根据id获取获取详情内容
getDetailById
(){
getDetailById
()
{
let
_this
=
this
let
_this
=
this
;
this
.
$https
(
this
.
$https
(
{
{
method
:
"get"
,
method
:
"get"
,
url
:
"tUser/getById"
,
url
:
"tUser/getById"
,
authType
:
this
.
backToken
,
authType
:
this
.
backToken
,
},
},
{
id
:
_this
.
id
}
{
id
:
_this
.
id
}
)
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
status
==
200
){
if
(
res
.
status
==
200
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
let
resData
=
res
.
data
.
data
let
resData
=
res
.
data
.
data
;
for
(
let
key
in
_this
.
form
){
for
(
let
key
in
_this
.
form
)
{
this
.
form
[
key
]
=
resData
[
key
]
this
.
form
[
key
]
=
resData
[
key
];
}
}
if
(
!
this
.
form
.
permanent
){
if
(
!
this
.
form
.
permanent
)
{
this
.
form
.
date
=
[
this
.
form
.
date
=
[
resData
.
effectiveDate
,
resData
.
exiredDate
];
resData
.
effectiveDate
,
}
resData
.
exiredDate
}
else
{
]
_this
.
$message
.
error
(
res
.
data
.
message
);
}
}
}
else
{
}
else
{
_this
.
$message
.
error
(
res
.
data
.
message
);
_this
.
$message
.
error
(
res
.
data
);
}
}
}
else
{
})
_this
.
$message
.
error
(
res
.
data
);
.
catch
((
err
)
=>
{
}
console
.
log
(
err
);
})
});
.
catch
((
err
)
=>
{
console
.
log
(
err
);
});
},
},
// 弹窗关闭
// 弹窗关闭
handleClose
()
{
handleClose
()
{
this
.
$confirm
(
"确认关闭?"
)
this
.
$confirm
(
"确认关闭?"
)
.
then
((
_
)
=>
{
.
then
((
_
)
=>
{
this
.
handleReset
()
this
.
handleReset
()
;
})
})
.
catch
((
_
)
=>
{});
.
catch
((
_
)
=>
{});
},
},
handleReset
()
{
handleReset
()
{
this
.
dialogVisible
=
false
this
.
dialogVisible
=
false
;
this
.
$refs
.
form
.
resetFields
()
this
.
$refs
.
form
.
resetFields
();
this
.
form
=
{
this
.
form
=
{
userName
:
""
,
userName
:
""
,
orgId
:
""
,
orgId
:
""
,
permanent
:
true
,
permanent
:
true
,
date
:
""
,
date
:
""
,
roleList
:
[],
roleList
:
[],
type
:
2
type
:
2
,
}
};
},
},
// 提交
// 提交
handleSubmit
()
{
handleSubmit
()
{
// 校验用户输入值
// 校验用户输入值
let
_this
=
this
let
_this
=
this
;
_this
.
$refs
.
form
.
validate
((
valid
)
=>
{
_this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
let
user
=
{};
let
user
=
{};
if
(
!
_this
.
form
.
permanent
&&
!
_this
.
form
.
date
)
{
if
(
!
_this
.
form
.
permanent
&&
!
_this
.
form
.
date
)
{
_this
.
$message
.
error
(
'请选择有效期'
)
_this
.
$message
.
error
(
"请选择有效期"
);
return
false
return
false
;
}
}
if
(
!
_this
.
form
.
permanent
)
{
if
(
!
_this
.
form
.
permanent
)
{
user
.
effectiveDate
=
_this
.
form
.
date
[
0
];
user
.
effectiveDate
=
_this
.
form
.
date
[
0
];
user
.
exiredDate
=
_this
.
form
.
date
[
1
];
user
.
exiredDate
=
_this
.
form
.
date
[
1
];
}
}
user
.
userName
=
_this
.
form
.
userName
;
user
.
id
=
_this
.
id
;
user
.
orgId
=
_this
.
form
.
orgId
;
user
.
telephone
=
this
.
form
.
telephone
||
""
;
user
.
roleList
=
_this
.
form
.
roleList
user
.
email
=
this
.
form
.
email
||
""
;
user
.
permanent
=
_this
.
form
.
permanent
;
user
.
weChat
=
this
.
form
.
weChat
||
""
;
user
.
id
=
_this
.
id
user
.
phone
=
this
.
form
.
phone
;
user
.
type
=
this
.
form
.
type
user
.
permanent
=
this
.
form
.
permanent
;
user
.
userName
=
this
.
form
.
userName
;
user
.
orgId
=
this
.
form
.
orgId
;
user
.
type
=
this
.
form
.
type
;
this
.
$https
(
this
.
$https
(
{
{
method
:
"put"
,
method
:
"put"
,
...
@@ -234,22 +240,22 @@ export default {
...
@@ -234,22 +240,22 @@ export default {
user
user
)
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
if
(
res
.
status
==
200
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
this
.
$message
({
this
.
$message
({
type
:
"success"
,
type
:
"success"
,
message
:
res
.
data
.
message
,
message
:
res
.
data
.
message
,
});
});
_this
.
dialogVisible
=
false
_this
.
dialogVisible
=
false
;
this
.
$emit
(
'success'
,
true
)
this
.
$emit
(
"success"
,
true
);
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
);
this
.
$message
.
error
(
res
.
data
.
message
);
this
.
$emit
(
'success'
,
false
)
this
.
$emit
(
"success"
,
false
);
}
}
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
);
this
.
$message
.
error
(
res
.
data
);
this
.
$emit
(
'success'
,
false
)
this
.
$emit
(
"success"
,
false
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
console
.
log
(
err
);
console
.
log
(
err
);
...
...
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