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
2c481f0b
authored
Nov 03, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
询价列表
parent
1cee324f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
112 additions
and
11 deletions
app/Admin/Actions/Grid/HandleInquiry.php
app/Admin/Controllers/InquiryController.php
app/Admin/Extensions/Show/Textarea.php
app/Admin/Renderable/InquiryDetail.php
app/Admin/bootstrap.php
resources/lang/en/inquiry.php
resources/lang/zh_CN/inquiry.php
app/Admin/Actions/Grid/HandleInquiry.php
0 → 100644
View file @
2c481f0b
<?php
namespace
App\Admin\Actions\Grid
;
use
Dcat\Admin\Actions\Response
;
use
Dcat\Admin\Grid\Tools\AbstractTool
;
use
Dcat\Admin\Traits\HasPermissions
;
use
Illuminate\Contracts\Auth\Authenticatable
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Http\Request
;
class
HandleInquiry
extends
AbstractTool
{
/**
* @return string
*/
protected
$title
=
'Handle'
;
protected
$style
=
'btn btn-primary feather icon-check-square'
;
/**
* Handle the action request.
*
* @param Request $request
*
* @return Response
*/
public
function
handle
(
Request
$request
)
{
dd
(
$this
);
$keys
=
$this
->
getKey
();
dd
(
$request
->
all
());
return
$this
->
response
()
->
success
(
'Processed successfully.'
)
->
redirect
(
'/'
);
}
/**
* @return string|void
*/
protected
function
href
()
{
// return admin_url('auth/users');
}
/**
* @return string|array|void
*/
public
function
confirm
()
{
return
[
'Confirm?'
,
'contents'
];
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected
function
authorize
(
$user
)
:
bool
{
return
true
;
}
/**
* @return array
*/
protected
function
parameters
()
{
return
[];
}
}
app/Admin/Controllers/InquiryController.php
View file @
2c481f0b
...
...
@@ -2,6 +2,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Actions\Grid\HandleInquiry
;
use
App\Admin\Renderable\BarChart
;
use
App\Admin\Renderable\InquiryDetail
;
use
App\Admin\Renderable\PostTable
;
...
...
@@ -41,6 +42,9 @@ class InquiryController extends AdminController
});
$grid
->
tools
(
new
HandleInquiry
(
admin_trans
(
'inquiry.labels.handle'
)));
$grid
->
model
()
->
orderBy
(
'inquiry_id'
,
'desc'
);
$grid
->
column
(
'inquiry_id'
)
->
sortable
();
$grid
->
column
(
'task_type'
)
->
display
(
admin_trans
(
'inquiry.options.task_type.1'
));
...
...
app/Admin/Extensions/Show/Textarea.php
0 → 100644
View file @
2c481f0b
<?php
namespace
App\Admin\Extensions\Show
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Show\AbstractField
;
class
Textarea
extends
AbstractField
{
// 这个属性设置为false则不会转义HTML代码
public
$escape
=
false
;
public
$border
=
false
;
public
function
render
(
$arg
=
''
)
{
Admin
::
script
(
<<<JS
$('.custom-textarea').parent().parent().css('margin-left','-220px');
JS
);
// 返回任意可被渲染的内容
return
"<div class='box box-solid box-default no-margin box-show custom-textarea'><div class='box-body' style='min-height: 150px;'>
$this->value
</div></div>"
;
}
}
app/Admin/Renderable/InquiryDetail.php
View file @
2c481f0b
...
...
@@ -46,7 +46,7 @@ class InquiryDetail extends LazyRenderable
});
$show
->
row
(
function
(
Show\Row
$show
)
{
return
InquiryDetail
::
make
(
);
$show
->
field
(
'remark'
)
->
textarea
(
'remark'
);
});
});
}
...
...
app/Admin/bootstrap.php
View file @
2c481f0b
<?php
use
App\Admin\Extensions\Show\Textarea
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid\Filter
;
use
Dcat\Admin\Layout\Navbar
;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Show\Field
;
/**
* Dcat-admin - admin builder based on Laravel.
...
...
@@ -97,14 +99,10 @@ background: #f2f2f2;
}
.modal-body {
padding: 20px;
padding-left: 20px;
padding-right: 20px;
}
/*.modal-dialog .content-wrapper {*/
/* padding: 0;*/
/* padding-left: -250px;*/
/*}*/
.form-group {
margin-bottom:5px;
}
...
...
@@ -154,6 +152,7 @@ Dcat\Admin\Color::extend('layui-green', [
'link'
=>
'#009688'
,
]);
// 追加菜单
Admin
::
menu
()
->
add
(
include
__DIR__
.
'/menu.php'
,
0
);
...
...
@@ -170,14 +169,10 @@ HTML
if
(
!
Dcat\Admin\Support\Helper
::
isAjaxRequest
())
{
$navbar
->
$method
(
App\Admin\Actions\AdminSetting
::
make
()
->
render
());
}
// $navbar->right(view('admin.navbar-2'));
// 搜索框
$navbar
->
right
(
<<<
HTML
HTML
);
// 下拉面板
// $navbar->right(view('admin.navbar-1'));
});
...
...
@@ -197,3 +192,7 @@ Grid::resolving(function (Grid $grid) {
});
});
//拓展组件
Field
::
extend
(
'textarea'
,
Textarea
::
class
);
resources/lang/en/inquiry.php
View file @
2c481f0b
...
...
@@ -4,6 +4,7 @@ return [
'Inquiry'
=>
'Inquiry'
,
'inquiry'
=>
'Inquiry'
,
'inquiry_detail'
=>
'Inquiry Detail'
,
'handle'
=>
'Handle'
],
'fields'
=>
[
'inquiry_id'
=>
'Id'
,
...
...
resources/lang/zh_CN/inquiry.php
View file @
2c481f0b
...
...
@@ -4,6 +4,7 @@ return [
'Inquiry'
=>
'Inquiry'
,
'inquiry'
=>
'Inquiry'
,
'inquiry_detail'
=>
'询价详情'
,
'handle'
=>
'处理'
],
'fields'
=>
[
'inquiry_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