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
3299b342
authored
Nov 16, 2022
by
宁成龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善翻译
parent
6b80ce3e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
app/Admin/Actions/UserAddress/UserAddressCreateAction.php
app/Admin/Actions/UserAddress/UserAddressDeleteAction.php
app/Admin/Actions/UserAddress/UserAddressEditAction.php
app/Admin/Renderable/UserAddress.php
resources/lang/en/user-address.php
app/Admin/Actions/UserAddress/UserAddressCreateAction.php
View file @
3299b342
...
...
@@ -21,16 +21,16 @@ class UserAddressCreateAction extends AbstractTool
protected
$action
;
protected
$htmlClasses
=
[
'btn btn-sm btn-primary'
];
// 注意action的构造方法参数一定要给默认值
public
function
__construct
(
$title
=
null
,
$action
=
1
)
public
function
__construct
()
{
$this
->
title
=
$title
;
$this
->
action
=
$action
;
$this
->
title
=
trans
(
"user-address.labels.create_user_address"
)
;
$this
->
action
=
1
;
}
public
function
render
()
{
$form
=
SaveUserAddressHandle
::
make
([
'user_id'
=>
$this
->
getKey
()]);
$buttonName
=
trans
(
'user.labels.handle'
);
$buttonName
=
trans
(
"user-address.labels.create_user_address"
);
return
Modal
::
make
()
->
lg
()
->
title
(
$this
->
title
)
->
body
(
$form
->
payload
([
'user_id'
=>
$this
->
getKey
()]))
->
onLoad
(
$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">'
.
...
...
app/Admin/Actions/UserAddress/UserAddressDeleteAction.php
View file @
3299b342
...
...
@@ -30,7 +30,7 @@ class UserAddressDeleteAction extends RowAction
*/
public
function
title
()
{
$buttonName
=
"删除"
;
$buttonName
=
trans
(
"user-address.labels.delete_user_address"
)
;
return
$buttonName
;
}
...
...
@@ -54,8 +54,7 @@ class UserAddressDeleteAction extends RowAction
*/
public
function
confirm
()
{
$buttonName
=
"删除"
;
return
[
"是否确认
{
$buttonName
}
?"
];
return
admin_trans
(
"confirm"
);
}
/**
...
...
@@ -73,7 +72,7 @@ class UserAddressDeleteAction extends RowAction
}
catch
(
\Throwable
$e
)
{
return
$this
->
response
()
->
error
(
$e
->
getMessage
());
}
return
$this
->
response
()
->
success
(
'操作成功'
)
->
refresh
();
return
$this
->
response
()
->
success
(
admin_trans
(
"succeeded"
)
)
->
refresh
();
}
/**
...
...
app/Admin/Actions/UserAddress/UserAddressEditAction.php
View file @
3299b342
...
...
@@ -21,16 +21,16 @@ class UserAddressEditAction extends RowAction
protected
$htmlClasses
=
[
'btn btn-sm btn-primary'
];
// 注意action的构造方法参数一定要给默认值
public
function
__construct
(
$title
=
null
,
$action
=
1
)
public
function
__construct
()
{
$this
->
title
=
$title
;
$this
->
action
=
$action
;
$this
->
title
=
trans
(
"user-address.labels.edit_user_address"
)
;
$this
->
action
=
1
;
}
public
function
render
()
{
$form
=
SaveUserAddressHandle
::
make
([
'address_id'
=>
$this
->
getRow
()[
'address_id'
]]);
$buttonName
=
trans
(
'user.labels.handle'
);
$buttonName
=
trans
(
"user-address.labels.edit_user_address"
);
return
Modal
::
make
()
->
lg
()
->
title
(
$this
->
title
)
->
body
(
$form
->
payload
([
'address_id'
=>
$this
->
getRow
()[
'address_id'
]]))
->
onLoad
(
$this
->
getModalScript
())
->
button
(
'<button style="margin-right: 5px" class="btn btn-sm btn-primary">
...
...
app/Admin/Renderable/UserAddress.php
View file @
3299b342
...
...
@@ -33,7 +33,7 @@ class UserAddress extends \Dcat\Admin\Support\LazyRenderable
$grid
->
disableEditButton
();
UserAddressService
::
listField
(
$grid
);
$userAddressCreateAction
=
new
UserAddressCreateAction
(
"新增用户地址"
);
$userAddressCreateAction
=
new
UserAddressCreateAction
();
$userAddressCreateAction
->
setKey
(
$this
->
key
);
$grid
->
tools
([
$userAddressCreateAction
,
...
...
resources/lang/en/user-address.php
View file @
3299b342
...
...
@@ -4,6 +4,9 @@ return [
'labels'
=>
[
'UserAddress'
=>
'UserAddress'
,
'user-address'
=>
'UserAddress'
,
'create_user_address'
=>
'Create user address'
,
'edit_user_address'
=>
'Edit'
,
'delete_user_address'
=>
'Delete'
,
],
'fields'
=>
[
"address_id"
=>
"用户用户地址ID"
,
...
...
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