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
3ef4d510
authored
Nov 04, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
诊断
parent
eb2c7c99
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
216 additions
and
0 deletions
+216
-0
app/Admin/Controllers/DiagnosiController.php
+90
-0
app/Admin/Controllers/DrugController.php
+4
-0
app/Admin/Repositories/DiagnosiRepository.php
+16
-0
app/Admin/routes.php
+2
-0
app/Models/DiagnosiModel.php
+15
-0
database/migrations/2024_11_04_134643_create_diagnosis_table.php
+35
-0
dcat_admin_ide_helper.php
+40
-0
lang/zh_CN/diagnosi.php
+14
-0
No files found.
app/Admin/Controllers/DiagnosiController.php
0 → 100755
View file @
3ef4d510
<?php
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\DiagnosiRepository
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Show
;
class
DiagnosiController
extends
AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected
function
grid
()
{
return
Grid
::
make
(
new
DiagnosiRepository
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'code'
);
$grid
->
column
(
'content'
);
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'code'
,
'factcontentory'
])
->
placeholder
(
'请输入[诊断/诊断显示/简码]'
)
->
width
(
25
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'content'
)
->
width
(
3
);
});
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
DiagnosiRepository
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
)
->
width
(
4
);
$show
->
field
(
'name'
)
->
width
(
4
);
$show
->
field
(
'content'
)
->
width
(
4
);
$show
->
field
(
'code'
)
->
width
(
4
);
$show
->
field
(
'created_at'
)
->
width
(
4
);
$show
->
field
(
'updated_at'
)
->
width
(
4
);
$show
->
panel
()
->
tools
(
function
(
$tools
)
{
$tools
->
disableDelete
();
// 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected
function
form
()
{
return
Form
::
make
(
new
DiagnosiRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
);
$form
->
text
(
'content'
)
->
width
(
4
);
$form
->
text
(
'code'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
// 右上角按钮控制
$form
->
disableDeleteButton
();
// 去掉删除按钮
});
}
}
app/Admin/Controllers/DrugController.php
View file @
3ef4d510
...
...
@@ -33,6 +33,9 @@ protected function grid()
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'code'
,
'factory'
])
->
placeholder
(
'请输入[药品名称/药品简码/生产厂家]'
)
->
width
(
25
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
...
...
@@ -76,6 +79,7 @@ protected function detail($id)
$show
->
field
(
'tag'
)
->
width
(
4
);
$show
->
field
(
'created_at'
)
->
width
(
4
);
$show
->
field
(
'updated_at'
)
->
width
(
4
);
$show
->
panel
()
->
tools
(
function
(
$tools
)
{
$tools
->
disableDelete
();
// 禁止删除按钮
});
...
...
app/Admin/Repositories/DiagnosiRepository.php
0 → 100755
View file @
3ef4d510
<?php
namespace
App\Admin\Repositories
;
use
App\Models\DiagnosiModel
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
DiagnosiRepository
extends
EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected
$eloquentClass
=
Model
::
class
;
}
app/Admin/routes.php
View file @
3ef4d510
...
...
@@ -16,6 +16,8 @@
// 药品
$router
->
resource
(
'drug'
,
'DrugController'
);
// 诊断
$router
->
resource
(
'diagnosi'
,
'DiagnosiController'
);
// 导入日志
$router
->
resource
(
'/import-log'
,
'Common\ImportLogController'
)
->
names
(
'import-log'
);
...
...
app/Models/DiagnosiModel.php
0 → 100755
View file @
3ef4d510
<?php
namespace
App\Models
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
DiagnosiModel
extends
Model
{
use
HasDateTimeFormatter
;
use
SoftDeletes
;
protected
$table
=
'diagnosis'
;
}
database/migrations/2024_11_04_134643_create_diagnosis_table.php
0 → 100755
View file @
3ef4d510
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateDiagnosisTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'diagnosis'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'name'
)
->
comment
(
'诊断'
);
$table
->
string
(
'content'
)
->
comment
(
'显示内容'
);
$table
->
string
(
'code'
)
->
comment
(
'诊断编码'
);
$table
->
timestamps
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'diagnosis'
);
}
}
dcat_admin_ide_helper.php
View file @
3ef4d510
...
...
@@ -41,6 +41,16 @@
* @property Grid\Column|Collection avatar
* @property Grid\Column|Collection remember_token
* @property Grid\Column|Collection is_block
* @property Grid\Column|Collection code
* @property Grid\Column|Collection unit
* @property Grid\Column|Collection spec
* @property Grid\Column|Collection dosage_form
* @property Grid\Column|Collection factory
* @property Grid\Column|Collection approval_no
* @property Grid\Column|Collection limit_buy_7
* @property Grid\Column|Collection is_rx
* @property Grid\Column|Collection tag
* @property Grid\Column|Collection deleted_at
* @property Grid\Column|Collection uuid
* @property Grid\Column|Collection connection
* @property Grid\Column|Collection queue
...
...
@@ -86,6 +96,16 @@
* @method Grid\Column|Collection avatar(string $label = null)
* @method Grid\Column|Collection remember_token(string $label = null)
* @method Grid\Column|Collection is_block(string $label = null)
* @method Grid\Column|Collection code(string $label = null)
* @method Grid\Column|Collection unit(string $label = null)
* @method Grid\Column|Collection spec(string $label = null)
* @method Grid\Column|Collection dosage_form(string $label = null)
* @method Grid\Column|Collection factory(string $label = null)
* @method Grid\Column|Collection approval_no(string $label = null)
* @method Grid\Column|Collection limit_buy_7(string $label = null)
* @method Grid\Column|Collection is_rx(string $label = null)
* @method Grid\Column|Collection tag(string $label = null)
* @method Grid\Column|Collection deleted_at(string $label = null)
* @method Grid\Column|Collection uuid(string $label = null)
* @method Grid\Column|Collection connection(string $label = null)
* @method Grid\Column|Collection queue(string $label = null)
...
...
@@ -136,6 +156,16 @@ class MiniGrid extends Grid {}
* @property Show\Field|Collection avatar
* @property Show\Field|Collection remember_token
* @property Show\Field|Collection is_block
* @property Show\Field|Collection code
* @property Show\Field|Collection unit
* @property Show\Field|Collection spec
* @property Show\Field|Collection dosage_form
* @property Show\Field|Collection factory
* @property Show\Field|Collection approval_no
* @property Show\Field|Collection limit_buy_7
* @property Show\Field|Collection is_rx
* @property Show\Field|Collection tag
* @property Show\Field|Collection deleted_at
* @property Show\Field|Collection uuid
* @property Show\Field|Collection connection
* @property Show\Field|Collection queue
...
...
@@ -181,6 +211,16 @@ class MiniGrid extends Grid {}
* @method Show\Field|Collection avatar(string $label = null)
* @method Show\Field|Collection remember_token(string $label = null)
* @method Show\Field|Collection is_block(string $label = null)
* @method Show\Field|Collection code(string $label = null)
* @method Show\Field|Collection unit(string $label = null)
* @method Show\Field|Collection spec(string $label = null)
* @method Show\Field|Collection dosage_form(string $label = null)
* @method Show\Field|Collection factory(string $label = null)
* @method Show\Field|Collection approval_no(string $label = null)
* @method Show\Field|Collection limit_buy_7(string $label = null)
* @method Show\Field|Collection is_rx(string $label = null)
* @method Show\Field|Collection tag(string $label = null)
* @method Show\Field|Collection deleted_at(string $label = null)
* @method Show\Field|Collection uuid(string $label = null)
* @method Show\Field|Collection connection(string $label = null)
* @method Show\Field|Collection queue(string $label = null)
...
...
lang/zh_CN/diagnosi.php
0 → 100755
View file @
3ef4d510
<?php
return
[
'labels'
=>
[
'Diagnosi'
=>
'诊断'
,
'diagnosi'
=>
'诊断'
,
],
'fields'
=>
[
'name'
=>
'诊断'
,
'content'
=>
'显示内容'
,
'code'
=>
'诊断简码'
,
],
'options'
=>
[
],
];
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