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
53bf8ceb
authored
Nov 11, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改标签
parent
259dc1bb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
23 deletions
+23
-23
app/Admin/Controllers/DrugTagController.php
+13
-13
app/Admin/Repositories/DrugTagRepository.php
+2
-2
app/Admin/routes.php
+1
-1
app/Models/DrugTagModel.php
+2
-2
database/migrations/2024_11_06_182148_create_tag_table.php
+3
-3
lang/zh_CN/drug-tag.php
+2
-2
No files found.
app/Admin/Controllers/TagController.php
→
app/Admin/Controllers/
Drug
TagController.php
View file @
53bf8ceb
...
...
@@ -2,14 +2,14 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\
Tag
;
use
App\Admin\Repositories\
DrugTagRepository
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Show
;
// 药品标签
class
TagController
extends
AdminController
class
Drug
TagController
extends
AdminController
{
/**
* Make a grid builder.
...
...
@@ -18,7 +18,7 @@ class TagController extends AdminController
*/
protected
function
grid
()
{
return
Grid
::
make
(
new
Tag
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
DrugTagRepository
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
...
...
@@ -48,11 +48,11 @@ protected function grid()
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
Tag
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'tag_name'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
return
Show
::
make
(
$id
,
new
DrugTagRepository
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
)
->
width
(
4
)
;
$show
->
field
(
'tag_name'
)
->
width
(
4
)
;
$show
->
field
(
'created_at'
)
->
width
(
4
)
;
$show
->
field
(
'updated_at'
)
->
width
(
4
)
;
$show
->
panel
()
->
tools
(
function
(
$tools
)
{
$tools
->
disableDelete
();
// 禁止删除按钮
...
...
@@ -67,12 +67,12 @@ protected function detail($id)
*/
protected
function
form
()
{
return
Form
::
make
(
new
Tag
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
);
$form
->
text
(
'tag_name'
);
return
Form
::
make
(
new
DrugTagRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
)
;
$form
->
text
(
'tag_name'
)
->
width
(
4
)
;
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
$form
->
display
(
'created_at'
)
->
width
(
4
)
;
$form
->
display
(
'updated_at'
)
->
width
(
4
)
;
// 右上角按钮控制
$form
->
disableDeleteButton
();
// 去掉删除按钮
...
...
app/Admin/Repositories/
Tag
.php
→
app/Admin/Repositories/
DrugTagRepository
.php
View file @
53bf8ceb
...
...
@@ -2,10 +2,10 @@
namespace
App\Admin\Repositories
;
use
App\Models\
Tag
as
Model
;
use
App\Models\
DrugTagModel
as
Model
;
use
Dcat\Admin\Repositories\EloquentRepository
;
class
Tag
extends
EloquentRepository
class
DrugTagRepository
extends
EloquentRepository
{
/**
* Model.
...
...
app/Admin/routes.php
View file @
53bf8ceb
...
...
@@ -20,7 +20,7 @@
// 药品-药品
$router
->
resource
(
'drug'
,
'DrugController'
);
// 药品-标签
$router
->
resource
(
'
tag'
,
'
TagController'
);
$router
->
resource
(
'
drug-tag'
,
'Drug
TagController'
);
// 问诊-问诊人
$router
->
resource
(
'patient'
,
'PatientController'
);
...
...
app/Models/
Tag
.php
→
app/Models/
DrugTagModel
.php
View file @
53bf8ceb
...
...
@@ -6,10 +6,10 @@
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Tag
extends
Model
class
DrugTagModel
extends
Model
{
use
HasDateTimeFormatter
;
use
SoftDeletes
;
protected
$table
=
'tag'
;
protected
$table
=
'
drug_
tag'
;
}
database/migrations/2024_11_06_182148_create_tag_table.php
View file @
53bf8ceb
...
...
@@ -13,10 +13,10 @@ class CreateTagTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'tag'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'
drug_
tag'
,
function
(
Blueprint
$table
)
{
$table
->
comment
(
'药品标签'
);
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'tag_name'
)
->
default
(
''
)
->
comment
(
'标签名称'
);
$table
->
string
(
'tag_name'
)
->
comment
(
'标签名称'
);
$table
->
timestamps
();
$table
->
softDeletes
();
});
...
...
@@ -29,6 +29,6 @@ public function up()
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'tag'
);
Schema
::
dropIfExists
(
'
drug_
tag'
);
}
}
lang/zh_CN/tag.php
→
lang/zh_CN/
drug-
tag.php
View file @
53bf8ceb
<?php
return
[
'labels'
=>
[
'
Tag'
=>
'Tag
'
,
'
tag'
=>
'Tag
'
,
'
DrugTag'
=>
'药品标签
'
,
'
drug-tag'
=>
'药品标签
'
,
],
'fields'
=>
[
'tag_name'
=>
'标签名称'
,
...
...
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