Commit 2c481f0b by 杨树贤

询价列表

parent 1cee324f
<?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 [];
}
}
......@@ -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'));
......
<?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>";
}
}
......@@ -46,7 +46,7 @@ class InquiryDetail extends LazyRenderable
});
$show->row(function (Show\Row $show) {
return InquiryDetail::make();
$show->field('remark')->textarea('remark');
});
});
}
......
<?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);
......@@ -4,6 +4,7 @@ return [
'Inquiry' => 'Inquiry',
'inquiry' => 'Inquiry',
'inquiry_detail' => 'Inquiry Detail',
'handle' => 'Handle'
],
'fields' => [
'inquiry_id' => 'Id',
......
......@@ -4,6 +4,7 @@ return [
'Inquiry' => 'Inquiry',
'inquiry' => 'Inquiry',
'inquiry_detail' => '询价详情',
'handle' => '处理'
],
'fields' => [
'inquiry_id' => 'Id',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment