Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
add69948
authored
Nov 11, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化医师纠错
parent
13b1b812
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
60 deletions
+31
-60
app/Admin/Controllers/DoctorCorrectionController.php
+22
-19
app/Admin/Controllers/InquiryController.php
+5
-8
app/Admin/Repositories/DoctorCorrection.php
+0
-16
app/Models/DoctorCorrection.php
+0
-13
database/migrations/2024_11_07_182705_create_doctor_correction_table.php
+4
-4
No files found.
app/Admin/Controllers/DoctorCorrectionController.php
View file @
add69948
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
namespace
App\Admin\Controllers
;
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\DoctorCorrection
;
use
App\Admin\Repositories\DoctorCorrectionRepository
;
use
App\Models\DoctorCorrectionModel
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
@@ -18,29 +19,31 @@ class DoctorCorrectionController extends AdminController
...
@@ -18,29 +19,31 @@ class DoctorCorrectionController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
DoctorCorrection
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
DoctorCorrection
Repository
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
);
$grid
->
column
(
'doctor_id'
);
$grid
->
column
(
'is_handle'
)
->
switch
();
// $grid->column('doctor_id');
$grid
->
column
(
'doctor_name'
);
$grid
->
column
(
'doctor_name'
);
$grid
->
column
(
'is_handle'
);
$grid
->
column
(
'content'
);
$grid
->
column
(
'content'
);
$grid
->
column
(
'created_at'
);
//
$grid->column('created_at');
$grid
->
column
(
'updated_at'
)
->
sortable
();
//
$grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'doctor_name'
)
->
width
(
3
);
$filter
->
like
(
'doctor_name'
)
->
width
(
3
);
$filter
->
in
(
'is_handle'
)
->
checkbox
(
DoctorCorrectionModel
::
IS_HANDLE_MAP
)
->
width
(
3
);
});
});
// 行按钮控制
// 行按钮控制
$grid
->
disable
DeleteButton
();
// 禁用删除
按钮
$grid
->
disable
Actions
();
// 禁用
按钮
// 工具栏按钮控制
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableCreateButton
();
// 禁用创建按钮
$grid
->
disableBatchActions
();
// 禁用批量操作
});
});
}
}
...
@@ -52,7 +55,7 @@ protected function grid()
...
@@ -52,7 +55,7 @@ protected function grid()
*/
*/
protected
function
detail
(
$id
)
protected
function
detail
(
$id
)
{
{
return
Show
::
make
(
$id
,
new
DoctorCorrection
(),
function
(
Show
$show
)
{
return
Show
::
make
(
$id
,
new
DoctorCorrection
Repository
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'id'
);
$show
->
field
(
'doctor_id'
);
$show
->
field
(
'doctor_id'
);
$show
->
field
(
'doctor_name'
);
$show
->
field
(
'doctor_name'
);
...
@@ -74,15 +77,15 @@ protected function detail($id)
...
@@ -74,15 +77,15 @@ protected function detail($id)
*/
*/
protected
function
form
()
protected
function
form
()
{
{
return
Form
::
make
(
new
DoctorCorrection
(),
function
(
Form
$form
)
{
return
Form
::
make
(
new
DoctorCorrection
Repository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
);
$form
->
display
(
'id'
)
->
width
(
4
)
;
$form
->
text
(
'doctor_id'
);
// $form->text('doctor_id')->readonly()->width(4
);
$form
->
text
(
'doctor_name'
);
$form
->
text
(
'doctor_name'
)
->
readonly
()
->
width
(
4
)
;
$form
->
text
(
'is_handle'
);
$form
->
text
area
(
'content'
)
->
readonly
()
->
width
(
4
);
$form
->
text
(
'content'
);
$form
->
switch
(
'is_handle'
)
->
width
(
4
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'created_at'
)
->
width
(
4
)
;
$form
->
display
(
'updated_at'
);
$form
->
display
(
'updated_at'
)
->
width
(
4
)
;
// 右上角按钮控制
// 右上角按钮控制
$form
->
disableDeleteButton
();
// 去掉删除按钮
$form
->
disableDeleteButton
();
// 去掉删除按钮
...
...
app/Admin/Controllers/InquiryController.php
View file @
add69948
...
@@ -26,15 +26,12 @@ protected function grid()
...
@@ -26,15 +26,12 @@ protected function grid()
$grid
->
column
(
'question'
);
$grid
->
column
(
'question'
);
$grid
->
column
(
'is_common'
)
->
using
(
InquiryModel
::
INQUIRY_COMMON_MAP
);
$grid
->
column
(
'is_common'
)
->
using
(
InquiryModel
::
INQUIRY_COMMON_MAP
);
// 快捷搜索
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
quickSearch
([
'question'
])
->
placeholder
(
'请输入[诊断问题]'
)
->
width
(
25
);
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
// $grid->filter(function (Grid\Filter $filter) {
$filter
->
like
(
'question'
)
->
width
(
3
);
// $filter->panel(); // 更改为 panel 布局
});
// $filter->expand(); // 默认展开搜索框
// $filter->like('question')->width(3);
// });
// 行按钮控制
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
...
...
app/Admin/Repositories/DoctorCorrection.php
deleted
100644 → 0
View file @
13b1b812
<?php
namespace
App\Admin\Repositories
;
use
App\Models\DoctorCorrection
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
DoctorCorrection
extends
EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected
$eloquentClass
=
Model
::
class
;
}
app/Models/DoctorCorrection.php
deleted
100644 → 0
View file @
13b1b812
<?php
namespace
App\Models
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
class
DoctorCorrection
extends
Model
{
use
HasDateTimeFormatter
;
protected
$table
=
'doctor_correction'
;
}
database/migrations/2024_11_07_182705_create_doctor_correction_table.php
View file @
add69948
...
@@ -16,10 +16,10 @@ public function up()
...
@@ -16,10 +16,10 @@ public function up()
Schema
::
create
(
'doctor_correction'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'doctor_correction'
,
function
(
Blueprint
$table
)
{
$table
->
comment
(
'医师'
);
$table
->
comment
(
'医师'
);
$table
->
bigIncrements
(
'id'
);
$table
->
bigIncrements
(
'id'
);
$table
->
integer
(
'doctor_id'
)
->
comment
(
'医师
编号
'
);
$table
->
integer
(
'doctor_id'
)
->
comment
(
'医师
表ID
'
);
$table
->
string
(
'doctor_name'
)
->
default
(
''
)
->
comment
(
'医师姓名'
);
$table
->
string
(
'doctor_name'
)
->
comment
(
'医师姓名'
);
$table
->
tinyInteger
(
'is_handle'
)
->
comment
(
'是否处理
0 待处理 1 已处理
'
);
$table
->
tinyInteger
(
'is_handle'
)
->
comment
(
'是否处理
[0=待处理,1=已处理]
'
);
$table
->
longT
ext
(
'content'
)
->
comment
(
'纠错内容'
);
$table
->
t
ext
(
'content'
)
->
comment
(
'纠错内容'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
$table
->
softDeletes
();
});
});
...
...
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