Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪伟伟
data-collect
Commits
8bc1dbc5
Commit
8bc1dbc5
authored
Jan 15, 2024
by
汪伟伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ee060a49
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
124 deletions
+41
-124
app/Admin/Controllers/TaskController.php
+1
-0
app/Admin/Controllers/TaskReceiveController.php
+3
-0
app/Admin/Controllers/TasksApproveController.php
+33
-12
app/Admin/Extensions/Tools/OrderDetailAction.php
+0
-8
app/Admin/Forms/OrderDetailTc.php
+0
-101
config/filesystems.php
+1
-0
public/uploads/images/ed6b7f0c3e6ff488bafaeb1e810ccf1d.jpg
+0
-0
public/uploads/tinymce/images/f3cb1df997bfdf36806a6180559fda7365a4edbb06e53.png
+0
-0
resources/lang/zh_CN/tasks-approve.php
+2
-2
resources/lang/zh_CN/tasks-receive.php
+1
-1
No files found.
app/Admin/Controllers/TaskController.php
View file @
8bc1dbc5
...
...
@@ -72,6 +72,7 @@ class TaskController extends AdminController
});
$grid
->
disableEditButton
()
->
disableDeleteButton
()
->
disableCreateButton
();
$grid
->
disableBatchDelete
();
$grid
->
tools
(
function
(
Grid\Tools
$tools
)
use
(
$user
){
if
(
$user
->
is_admin
==
0
)
{
$tools
->
append
(
new
BatchReceiveAction
());
//新增批量领取按钮
...
...
app/Admin/Controllers/TaskReceiveController.php
View file @
8bc1dbc5
...
...
@@ -18,6 +18,7 @@ use Dcat\Admin\Widgets\Tab;
class
TaskReceiveController
extends
AdminController
{
protected
$title
=
' '
;
/**
* @return Tab
*/
...
...
@@ -125,6 +126,8 @@ class TaskReceiveController extends AdminController
});
$grid
->
disableBatchDelete
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
// $filter->equal('id');
$filter
->
like
(
'task.name'
,
'指标名称'
);
...
...
app/Admin/Controllers/TasksApproveController.php
View file @
8bc1dbc5
...
...
@@ -10,6 +10,7 @@ use Dcat\Admin\Grid;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Widgets\Tab
;
use
SuperEggs\DcatDistpicker\DcatDistpickerHelper
;
class
TasksApproveController
extends
AdminController
{
...
...
@@ -25,7 +26,9 @@ class TasksApproveController extends AdminController
$tab
->
add
(
'未审核'
,
$this
->
getData
(
0
),
true
,
'a'
);
$tab
->
add
(
'已审核'
,
$this
->
getData
(
1
),
true
,
'b'
);
return
$tab
->
withCard
();
return
$tab
;
}
/**
...
...
@@ -38,6 +41,7 @@ class TasksApproveController extends AdminController
// $taskIds = TasksReceive::query()->where('status',1)->pluck('task_id');
// $model = \App\Models\Task::query()->with(['approves'])->whereIn('id',$taskIds);
// dd($taskIds);
return
Grid
::
make
(
TasksApprove
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Grid
$grid
)
use
(
$status
)
{
if
(
$status
==
0
)
{
$grid
->
model
()
->
where
(
'status'
,
0
)
->
orderBy
(
'task_id'
,
'desc'
);
...
...
@@ -53,7 +57,7 @@ class TasksApproveController extends AdminController
// $grid->column('id')->sortable();
$grid
->
column
(
'task.name'
,
'指标名称'
);
$grid
->
column
(
'task.city_id'
,
'地区'
);
$grid
->
column
(
'task.city_id'
,
'地区'
)
->
distpicker
()
;
$grid
->
column
(
'task.year'
,
'时间'
);
$grid
->
column
(
'task.refer'
,
'参考信源'
);
$grid
->
column
(
'task.price'
,
'单价'
);
...
...
@@ -61,7 +65,7 @@ class TasksApproveController extends AdminController
$grid
->
column
(
'collects.value'
,
'指标值'
);
$grid
->
column
(
'collects.reality_refer'
,
'实际信源'
);
$grid
->
column
(
'collects.refer_level'
,
'信源等级'
);
$grid
->
column
(
'collects.net_img'
,
'截图链接'
);
//
$grid->column('collects.net_img', '截图链接');
if
(
$status
)
{
$grid
->
column
(
'status'
,
'状态'
)
->
display
(
function
(
$statusValue
)
{
//是当前字段的值
return
\App\Models\TasksApprove
::
APPROVE_STATUS_DESC
[
$statusValue
];
...
...
@@ -70,7 +74,7 @@ class TasksApproveController extends AdminController
// $grid->tools('<a class="btn btn-primary disable-outline">测试按钮</a>');
$grid
->
disableEditButton
()
->
disableDeleteButton
()
->
disableCreateButton
()
->
disableFilterButton
()
->
disable
ViewButton
()
->
disable
BatchDelete
();
$grid
->
disableEditButton
()
->
disableDeleteButton
()
->
disableCreateButton
()
->
disableFilterButton
()
->
disableBatchDelete
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
equal
(
'id'
);
...
...
@@ -95,15 +99,32 @@ class TasksApproveController extends AdminController
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
TasksApprove
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'task_id'
);
$show
->
field
(
'user_id'
);
$show
->
field
(
'receive_id'
);
$show
->
field
(
'status'
);
return
Show
::
make
(
$id
,
TasksApprove
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Show
$show
)
{
$show
->
field
(
'user.name'
,
'用户'
);
$show
->
field
(
'task.name'
,
'指标名称'
);
$show
->
field
(
'task.city_id'
,
'地区'
)
->
as
(
function
(
$val
){
return
DcatDistpickerHelper
::
getAreaName
(
$val
);
});
$show
->
field
(
'task.year'
,
'时间'
);
$show
->
field
(
'task.refer'
,
'参考信源'
);
$show
->
field
(
'task.price'
,
'单价'
);
$show
->
field
(
'collects.value'
,
'指标值'
);
$show
->
field
(
'collects.reality_refer'
,
'实际信源'
);
$show
->
field
(
'collects.refer_level'
,
'信源等级'
);
$show
->
field
(
'collects.net_img'
,
'截图链接'
)
->
unescape
();
$show
->
field
(
'status'
,
'状态'
)
->
as
(
function
(
$statusValue
){
// 获取当前行的其他字段
// $username = $this->username;
return
\App\Models\TasksApprove
::
APPROVE_STATUS_DESC
[
$statusValue
];
});
$show
->
field
(
'msg'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
// $show->field('created_at');
// $show->field('updated_at');
$show
->
disableDeleteButton
()
->
disableEditButton
();
});
}
...
...
app/Admin/Extensions/Tools/OrderDetailAction.php
View file @
8bc1dbc5
...
...
@@ -3,15 +3,7 @@
namespace
App\Admin\Extensions\Tools
;
use
App\Admin\Forms\MsgSetting
;
use
App\Admin\Forms\OrderDetailTc
;
use
App\Models\Task
;
use
App\Models\TasksReceive
;
use
Dcat\Admin\Actions\Action
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid\RowAction
;
use
Dcat\Admin\Widgets\Modal
;
use
Illuminate\Http\Request
;
class
OrderDetailAction
extends
RowAction
...
...
app/Admin/Forms/OrderDetailTc.php
deleted
100644 → 0
View file @
ee060a49
<?php
namespace
App\Admin\Forms
;
use
App\Models\TasksApprove
;
use
App\Models\TasksReceive
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Contracts\LazyRenderable
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Traits\LazyWidget
;
use
Dcat\Admin\Widgets\Form
;
class
OrderDetailTc
extends
Form
implements
LazyRenderable
{
use
LazyWidget
;
// 使用异步加载功能
/**
* Handle the form request.
*
* @param array $input
*
* @return mixed
*/
public
function
handle
(
array
$input
)
{
// 获取外部传递参数
$id
=
$this
->
payload
[
'id'
]
??
null
;
// 表单参数
// $msg = $input['msg'] ?? null;
return
$this
->
response
()
->
success
(
'Processed successfully'
)
->
refresh
();
}
/**
* Build a form here.
*/
public
function
form
()
{
// Since v1.6.5 弹出确认弹窗
// $this->confirm('您确定要提交表单吗', 'content');
// $this->text('msg','原因');
return
Grid
::
make
(
\App\Admin\Repositories\TasksReceive
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Grid
$grid
)
{
$user
=
Admin
::
user
();
// dd(trans('admin.view'));//查看
// 在 display 回调中使用
$grid
->
column
(
'序号'
)
->
display
(
function
()
{
return
$this
->
_index
+
1
;
});
if
(
$user
->
is_admin
==
1
)
{
$grid
->
column
(
'user.name'
,
'用户'
);
$grid
->
disableEditButton
();
}
// $grid->column('id')->sortable();
$grid
->
column
(
'task.name'
,
'指标名称'
);
$grid
->
column
(
'task.city_id'
,
'地区'
)
->
distpicker
();
$grid
->
column
(
'task.year'
,
'时间'
);
$grid
->
column
(
'task.refer'
,
'参考信源'
);
$grid
->
column
(
'task.level'
,
'等级'
);
$grid
->
column
(
'task.price'
,
'单价'
);
$grid
->
column
(
'collects.value'
,
'指标值'
);
$grid
->
column
(
'collects.reality_refer'
,
'实际信源'
);
// $grid->column('collects.net_img', '网页截图');
$grid
->
column
(
'status'
,
'状态'
)
->
display
(
function
(
$val
){
return
\App\Models\TasksReceive
::
STATUS_DESC
[
$val
];
});
$grid
->
disableActions
();
});
}
/**
* The data of the form.
*
* @return array
*/
public
function
default
()
{
return
[
// 'name' => 'John Doe',
// 'email' => 'John.Doe@gmail.com',
];
}
}
config/filesystems.php
View file @
8bc1dbc5
...
...
@@ -35,6 +35,7 @@ return [
'root'
=>
public_path
(
'uploads'
),
'visibility'
=>
'public'
,
'url'
=>
env
(
'APP_URL'
)
.
'/uploads'
,
// 'url' => request()->getHost().'/uploads',
],
'local'
=>
[
...
...
public/uploads/images/
f8dbf5f123ebf0049ab5a80f47edc697
.jpg
→
public/uploads/images/
ed6b7f0c3e6ff488bafaeb1e810ccf1d
.jpg
View file @
8bc1dbc5
File moved
public/uploads/tinymce/images/f3cb1df997bfdf36806a6180559fda7365a4edbb06e53.png
0 → 100644
View file @
8bc1dbc5
3.73 KB
resources/lang/zh_CN/tasks-approve.php
View file @
8bc1dbc5
<?php
<?php
return
[
'labels'
=>
[
'TasksApprove'
=>
'
TasksApprove
'
,
'TasksApprove'
=>
''
,
'tasks-approve'
=>
'TasksApprove'
,
],
'fields'
=>
[
...
...
resources/lang/zh_CN/tasks-receive.php
View file @
8bc1dbc5
<?php
return
[
'labels'
=>
[
'TasksReceive'
=>
'
TasksReceive2
'
,
'TasksReceive'
=>
''
,
'tasks-receive'
=>
'TasksReceive3'
,
],
'fields'
=>
[
...
...
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