Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
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
96cc3845
authored
Nov 14, 2022
by
宁成龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善编辑客户页面
parent
30085249
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
27 deletions
app/Admin/Actions/User/UserEditAction.php
app/Admin/Controllers/UserController.php
app/Admin/Renderable/UserDetail.php
app/Admin/Actions/User/UserEditAction.php
View file @
96cc3845
...
@@ -18,7 +18,7 @@ use Dcat\Admin\Grid\RowAction;
...
@@ -18,7 +18,7 @@ use Dcat\Admin\Grid\RowAction;
class
UserEditAction
extends
AbstractTool
class
UserEditAction
extends
AbstractTool
{
{
protected
$action
;
protected
$action
;
protected
$htmlClasses
=
[
'btn btn-
primary btn-sm btn-mini
'
];
protected
$htmlClasses
=
[
'btn btn-
sm btn-primary
'
];
// 注意action的构造方法参数一定要给默认值
// 注意action的构造方法参数一定要给默认值
public
function
__construct
(
$title
=
null
,
$action
=
1
)
public
function
__construct
(
$title
=
null
,
$action
=
1
)
{
{
...
@@ -37,8 +37,9 @@ class UserEditAction extends AbstractTool
...
@@ -37,8 +37,9 @@ class UserEditAction extends AbstractTool
$form
=
EditUserHandle
::
make
([
'key'
=>
$this
->
getKey
()]);
$form
=
EditUserHandle
::
make
([
'key'
=>
$this
->
getKey
()]);
$buttonName
=
trans
(
'user.labels.handle'
);
$buttonName
=
trans
(
'user.labels.handle'
);
return
Modal
::
make
()
->
lg
()
->
title
(
$this
->
title
)
->
body
(
$form
->
payload
([
'key'
=>
$this
->
getKey
()]))
->
onLoad
return
Modal
::
make
()
->
lg
()
->
title
(
$this
->
title
)
->
body
(
$form
->
payload
([
'key'
=>
$this
->
getKey
()]))
->
onLoad
(
$this
->
getModalScript
())
->
button
(
'<button class="btn btn-primary">
(
$this
->
getModalScript
())
->
button
(
'<button style="margin-right: 5px" class="btn btn-sm btn-primary">
<i class="feather icon-check-circle"></i><span class="d-none d-sm-inline" style="margin-left: 5px">'
.
$buttonName
.
'</span>
<i class="feather icon-check-circle"></i> <span class="d-none d-sm-inline" style="margin-left: 5px">'
.
$buttonName
.
'</span>
</button>'
);
</button>'
);
}
}
...
...
app/Admin/Controllers/UserController.php
View file @
96cc3845
...
@@ -130,27 +130,7 @@ class UserController extends AdminController
...
@@ -130,27 +130,7 @@ class UserController extends AdminController
*/
*/
protected
function
form
()
protected
function
form
()
{
{
return
Form
::
make
(
new
User
(),
function
(
Form
$form
)
{
return
Form
::
dialog
(
"测试"
);
$form
->
display
(
'id'
);
// return $form;
$form
->
text
(
'user_sn'
);
$form
->
text
(
'name'
);
$form
->
text
(
'email'
);
$form
->
text
(
'email_verified_at'
);
$form
->
text
(
'password'
);
$form
->
text
(
'phone'
);
$form
->
text
(
'remember_token'
);
$form
->
text
(
'account_properties'
);
$form
->
text
(
'status'
);
$form
->
text
(
'company_name'
);
$form
->
text
(
'first_name'
);
$form
->
text
(
'sale_id'
);
$form
->
text
(
'sale_name'
);
$form
->
text
(
'last_name'
);
$form
->
text
(
'created_time'
);
$form
->
text
(
'update_time'
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
}
}
}
}
app/Admin/Renderable/UserDetail.php
View file @
96cc3845
...
@@ -23,9 +23,8 @@ class UserDetail extends \Dcat\Admin\Support\LazyRenderable
...
@@ -23,9 +23,8 @@ class UserDetail extends \Dcat\Admin\Support\LazyRenderable
->
tools
(
function
(
Show\Tools
$tools
)
{
->
tools
(
function
(
Show\Tools
$tools
)
{
$userEditAction
=
new
UserEditAction
(
"用户编辑"
);
$userEditAction
=
new
UserEditAction
(
"用户编辑"
);
$userEditAction
->
setKey
(
$this
->
key
);
$userEditAction
->
setKey
(
$this
->
key
);
$tools
->
disableEdit
();
$tools
->
disableList
();
$tools
->
disableDelete
();
$tools
->
disableDelete
();
$tools
->
disableEdit
();
$tools
->
append
(
$userEditAction
);
$tools
->
append
(
$userEditAction
);
});
});
$show
->
row
(
function
(
Show\Row
$show
)
{
$show
->
row
(
function
(
Show\Row
$show
)
{
...
...
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