Commit bc8f9154 by 汪伟伟

任务包

parent c32ddb4c
...@@ -7,12 +7,20 @@ APP_URL=https://data-collect.raisound.com ...@@ -7,12 +7,20 @@ APP_URL=https://data-collect.raisound.com
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=data-collect
DB_USERNAME=root DB_USERNAME=root
DB_HOST=192.168.2.88
DB_DATABASE=data-collect
DB_PORT=3306
DB_PASSWORD=123456 DB_PASSWORD=123456
DB_HOST=172.16.5.27
DB_DATABASE=datacollect
DB_PORT=36007
DB_PASSWORD=Huisheng@12345
BROADCAST_DRIVER=log BROADCAST_DRIVER=log
CACHE_DRIVER=file CACHE_DRIVER=file
FILESYSTEM_DRIVER=local FILESYSTEM_DRIVER=local
......
...@@ -100,6 +100,8 @@ class AlreadyDoneTaskController extends AdminController ...@@ -100,6 +100,8 @@ class AlreadyDoneTaskController extends AdminController
$grid->filter(function (Grid\Filter $filter) { $grid->filter(function (Grid\Filter $filter) {
// $filter->equal('id'); // $filter->equal('id');
$filter->like('task.name', '指标名称'); $filter->like('task.name', '指标名称');
$filter->like('task.year','时间');
$filter->like('task.city_id','地区');
}); });
......
...@@ -81,7 +81,8 @@ class NoDoneTaskController extends AdminController ...@@ -81,7 +81,8 @@ class NoDoneTaskController extends AdminController
$grid->filter(function (Grid\Filter $filter) { $grid->filter(function (Grid\Filter $filter) {
// $filter->equal('id'); // $filter->equal('id');
$filter->like('task.name', '指标名称'); $filter->like('task.name', '指标名称');
$filter->like('task.year','时间');
$filter->like('task.city_id','地区');
}); });
...@@ -148,10 +149,12 @@ class NoDoneTaskController extends AdminController ...@@ -148,10 +149,12 @@ class NoDoneTaskController extends AdminController
TasksCollect::query()->where('receive_id', $id)->update(['is_find' => 0, 'remark' => $remark]); TasksCollect::query()->where('receive_id', $id)->update(['is_find' => 0, 'remark' => $remark]);
$receive->save(); $receive->save();
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录 TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
'tas_id' => $receive->tas_id,
'task_id' => $receive->task_id, 'task_id' => $receive->task_id,
'user_id' => $receive->user_id, 'user_id' => $receive->user_id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
], [ ], [
'tas_id' => $receive->tas_id,
'task_id' => $receive->task_id, 'task_id' => $receive->task_id,
'user_id' => $receive->user_id, 'user_id' => $receive->user_id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
...@@ -162,7 +165,6 @@ class NoDoneTaskController extends AdminController ...@@ -162,7 +165,6 @@ class NoDoneTaskController extends AdminController
->where('id', '!=', $id) ->where('id', '!=', $id)
->where('user_id', (Admin::user())->id) ->where('user_id', (Admin::user())->id)
->where('status', 0) ->where('status', 0)
->orderBy('created_at')
->first(); ->first();
if ($no) { if ($no) {
$url = '/noDone/' . $no->id . '/edit'; $url = '/noDone/' . $no->id . '/edit';
...@@ -255,10 +257,12 @@ class NoDoneTaskController extends AdminController ...@@ -255,10 +257,12 @@ class NoDoneTaskController extends AdminController
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1, 'time' => date('Y-m-d H:i:s')]);//状态更新成已完成 \App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1, 'time' => date('Y-m-d H:i:s')]);//状态更新成已完成
TasksCollect::query()->where('receive_id', $this->id)->update(['is_find' => 1]);//可以找到 TasksCollect::query()->where('receive_id', $this->id)->update(['is_find' => 1]);//可以找到
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录 TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
'tas_id' => $this->tas_id,
'task_id' => $this->task_id, 'task_id' => $this->task_id,
'user_id' => $this->user_id, 'user_id' => $this->user_id,
'receive_id' => $this->id, 'receive_id' => $this->id,
], [ ], [
'tas_id' => $this->tas_id,
'task_id' => $this->task_id, 'task_id' => $this->task_id,
'user_id' => $this->user_id, 'user_id' => $this->user_id,
'receive_id' => $this->id, 'receive_id' => $this->id,
...@@ -268,7 +272,6 @@ class NoDoneTaskController extends AdminController ...@@ -268,7 +272,6 @@ class NoDoneTaskController extends AdminController
->where('id', '!=', $this->id) ->where('id', '!=', $this->id)
->where('user_id', (Admin::user())->id) ->where('user_id', (Admin::user())->id)
->where('status', 0) ->where('status', 0)
->orderBy('created_at', 'desc')
->first(); ->first();
if ($no) { if ($no) {
$url = '/noDone/' . $no->id . '/edit'; $url = '/noDone/' . $no->id . '/edit';
......
<?php
namespace App\Admin\Controllers;
use App\Admin\Extensions\Tools\ListAction;
use App\Admin\Repositories\Tas;
use App\Admin\Services\CityAreaService;
use App\Models\Task;
use App\Models\TasksReceive;
use Dcat\Admin\Actions\Action;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Widgets\Tab;
use Dcat\Admin\Widgets\Table;
use DebugBar\DataCollector\Renderable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
class TasController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
$param = request()->input();
return Grid::make(Tas::with(['tasks'=>fn($q)=>$q->where(function ($que)use($param){
// var_dump($param);
if (!empty($param['tasks']['name'])){
$que->where('name','like',"{$param['tasks']['name']}");
}
if (!empty($param['tasks']['city_id'])){
$que->where('city_id','like',"{$param['tasks']['city_id']}");
}
if (!empty($param['tasks']['year'])){
$que->where('year','like',"{$param['tasks']['year']}");
}
})]), function (Grid $grid) {
// $grid->tableCollapse(false);
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
$grid->model()->orderBy('created_at', 'desc');
// $grid->column('id')->sortable();
$grid->column('name')->expand(function () use ($grid) {//这里要让哪个字段显示下拉,就写哪个字段,没什么要求
$comments = $this->tasks->map(function ($itm) {
return $itm->only(['id', 'name', 'level', 'city_id', 'year', 'refer', 'price']);
})->toArray();
// dd($comments);
foreach ($comments as $key => &$com) {
array_unshift($com, $key + 1);
$com['action'] = '<a style="margin-right: 2%" href="/tasks/' . $com['id'] . '?type=1"><i class=""></i> <span class="text-success">查看 </span></a>
<a style="margin-right: 2%" href="/tasks/' . $com['id'] . '/edit?type=1"><i class=""></i> <span class="text-custom">编辑 </span></a>
<a data-url="/tas/' . $this->id . '?task_id=' . $com['id'] . '" data-message="ID - ' . $com['id'] . '" data-action="delete" data-redirect="/tas" style="cursor: pointer;" class="act-' . $com['id'] . '" href="javascript:void(0)"><i class=""></i> <span class="text-danger">删除</span>  </a>';
unset($com['id']);
}
return new Table([
'序号', '指标名称', '难度等级', '地区', '时间', '信源', '单价', '操作'
], $comments);
});
$grid->column('level');
$grid->column('city_id', '地区');
// $grid->column('province_id');
$grid->column('year', '时间');
$grid->column('refer', '信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
} else {
return $val;
}
});
// $grid->column('guide');
$grid->column('price');
// $grid->column('status');
// $grid->column('num');
// $grid->column('images');
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
// $grid->column('title', '标题')->expand(function () {//这里要让哪个字段显示下拉,就写哪个字段,没什么要求
// dd($this->id);
// $comments = $model->tasks()->get()->map(function ($comment) { //$model->comments() 这个comments()是模型层里的模型关联方法名 take(10)获取十条
// return $comment->only(['id', 'city_id', 'year']); //要展示副表的什么字段就写什么字段
// });
// return new Table(['ID', '地区', '时间'], $comments->toArray());
// });
$grid->disableRowSelector();
$grid->filter(function (Grid\Filter $filter) {
$filter->like('tasks.name','指标名称');
$filter->like('tasks.year','时间');
$filter->like('tasks.city_id','地区');
// $filter->where('name', function ($query) {
// $name = explode(',',str_replace(',',',',$this->input));
//
// $query->whereHas('tasks', function ($query)use ($name) {
// $query->whereIn('name',$name);
// });
//
// }, '指标名称')->placeholder('搜索多个请用逗号隔开,如:指标1,指标2');
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new Tas(), function (Show $show) use ($id){
$show->field('id');
$show->field('name');
$show->field('level');
$show->field('city_id');
$show->field('year');
$show->field('refer');
$show->field('price');
$res = \App\Models\Tas::query()->find($id);
if ($res->images) {
$show->field('images', '参考指南')->image();
} else {
$show->field('guide', '参考指南')->unescape();//不 转义html内容
}
// $show->field('created_at');
// $show->field('updated_at');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new Tas(), function (Form $form) {
$form->display('id');
if ($form->isEditing()) {
$form->text('name','任务包名称')->disable();
$form->select('level')->options([1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5]);
$form->text('city_id', '设置地区')->disable();
$form->text('year', '设置时间')->disable();
} else {
$form->text('name','任务包名称')->placeholder('设置多个请用逗号隔开,如:指标1,指标2')->required();
$form->select('level')->options([1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5])->default(1)->required();
$form->text('city_id', '设置地区')->placeholder('设置多个请用逗号隔开,如:深圳,上海')->required();
$form->text('year', '设置时间')->placeholder('设置多个请用逗号隔开,如:2024,2023')->required();
}
$form->decimal('price', '单价');
$form->text('refer', '参考信源')->required();
$form->editor('guide', '收集指南')->required();
$form->hidden('images');
// $form->display('created_at');
// $form->display('updated_at');
// // 在表单提交前调用
$form->submitted(function (Form $form) {
$start = 'src="';
$end = '" alt';
$pattern = '/' . preg_quote($start) . '(.*?)' . preg_quote($end) . '/';
preg_match_all($pattern, $form->input('guide'), $matches);
$images = '';
foreach ($matches[1] as $v) {
if (filter_var($v, FILTER_VALIDATE_URL) !== false) {//是链接
$images .= $v . ',';
} else {
// 去除Base64字符串开头的"data:"及其后面的逗号
$base64Data = substr($v, strpos($v, ',') + 1);
$path = '/tinymce/images/' . time() . uniqid() . '.png';
Storage::disk('admin')->put($path, base64_decode($base64Data));
$url = Storage::disk('admin')->url($path);
$images .= $url . ',';
}
}
$form->images = $images;
//...
});
// //保存前回调
// $form->saving(function (Form $form) {
// dump($form->year);
//
// });
//保存后回调
$form->saved(function (Form $form) {
$tas = \App\Models\Tas::query()->find($this->id)->toArray();
Task::query()->where('tas_id',$this->id)
->update([
'level'=>$tas['level'],
'price'=>$tas['price'],
'refer'=>$tas['refer'],
'guide'=>$tas['guide'],
'images'=>$tas['images'],
]);
});
});
}
public function store()
{
DB::beginTransaction();
try {
$request = \request();
$param = $request->input();
$name = $param['name'];
$city_id = str_replace(',', ',', $param['city_id']);
$year = str_replace(',', ',', $param['year']);
$param['name'] = explode(',', str_replace(',', ',', $param['name']));
$param['city_id'] = explode(',', $city_id);
$param['year'] = explode(',', $year);
$start = 'src="';
$end = '" alt';
$pattern = '/' . preg_quote($start) . '(.*?)' . preg_quote($end) . '/';
preg_match_all($pattern, $param['guide'], $matches);
$images = '';
foreach ($matches[1] as $v) {
if (filter_var($v, FILTER_VALIDATE_URL) !== false) {//是链接
$images .= $v . ',';
} else {
// 去除Base64字符串开头的"data:"及其后面的逗号
$base64Data = substr($v, strpos($v, ',') + 1);
$path = '/tinymce/images/' . time() . uniqid() . '.png';
Storage::disk('admin')->put($path, base64_decode($base64Data));
$url = Storage::disk('admin')->url($path);
$images .= $url . ',';
}
}
$form = Form::make();
$insertData = [];
foreach ($param['city_id'] as $city) {
foreach ($param['year'] as $y) {
foreach ($param['name'] as $n) {
if (\App\Models\Task::query()
->where('name', $n)
->where('city_id', $city)
->where('year', $y)
->exists()) {
return $form->response()->error('指标名称重复:' . $n . ' ' . $city . ' ' . $y);
}
$insertData[] = [
'name' => $n,
'level' => $param['level'],
'province_id' => '',
'city_id' => $city,
'year' => $y,
'refer' => $param['refer'],
'guide' => $param['guide'],
'price' => $param['price'] ?? 0,
'images' => $images,
];
}
}
}
$tasData = [
'name' => $name,
'level' => $param['level'],
'province_id' => '',
'city_id' => $city_id,
'year' => $year,
'refer' => $param['refer'],
'guide' => $param['guide'],
'price' => $param['price'] ?? 0,
'images' => $images,
];
$tas = \App\Models\Tas::query()->create($tasData);
$tas->tasks()->createMany($insertData);
DB::commit();
return $form->response()->success('操作成功')->redirect('tas');
} catch (\Exception $exception) {
DB::rollBack();
}
}
public function destroy($id)
{
$taskId = request()->input('task_id');
// $idArr = explode(',', $id);
if ($taskId){
if (TasksReceive::query()->where('task_id', $taskId)->exists()) {
$task = \App\Models\Task::query()->find($taskId);
return $this->form()->response()->error('已经有用户领取了任务,不允许删除,任务名称:' . $task->name . ' ' . $task->city_id . ' ' . $task->year);
}
Task::query()->where('id',$taskId)->delete();
return $this->form()->response()->refresh();
}else{
if (TasksReceive::query()->where('tas_id', $id)->exists()) {
// $tas = \App\Models\Tas::query()->find($id);
return $this->form()->response()->error('该任务包已经有用户领取了任务,不允许删除');
}
}
Task::query()->where('tas_id',$id)->delete();
return $this->form()->destroy($id);
}
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Admin\Controllers; namespace App\Admin\Controllers;
use App\Admin\Extensions\Tools\BatchReceiveAction; use App\Admin\Extensions\Tools\BatchReceiveAction;
use App\Admin\Extensions\Tools\ListAction;
use App\Admin\Extensions\Tools\ReceiveAction; use App\Admin\Extensions\Tools\ReceiveAction;
use App\Admin\Repositories\Task; use App\Admin\Repositories\Task;
use App\Admin\Services\CityAreaService; use App\Admin\Services\CityAreaService;
...@@ -45,7 +46,7 @@ class TaskController extends AdminController ...@@ -45,7 +46,7 @@ class TaskController extends AdminController
$grid->addTableClass(['table-text-center']);//设置表格文字居中 $grid->addTableClass(['table-text-center']);//设置表格文字居中
// $grid->title('dasd'); // $grid->title('dasd');
$grid->model()->whereNotIn('id', $exists)->orderBy('created_at','desc'); $grid->model()->whereNotIn('id', $exists)->orderBy('created_at', 'desc');
// dd(Admin::user()->is_admin); // dd(Admin::user()->is_admin);
// dd(trans('admin.view'));//查看 // dd(trans('admin.view'));//查看
...@@ -57,9 +58,7 @@ class TaskController extends AdminController ...@@ -57,9 +58,7 @@ class TaskController extends AdminController
// $grid->column('id')->sortable(); // $grid->column('id')->sortable();
$grid->column('name'); $grid->column('name');
$grid->column('level'); $grid->column('level');
$grid->column('city_id')->display(function ($v) { $grid->column('city_id');
return CityAreaService::getAreaName($v);
});
$grid->column('year'); $grid->column('year');
$grid->column('refer')->display(function ($val) { $grid->column('refer')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接 if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
...@@ -76,6 +75,8 @@ class TaskController extends AdminController ...@@ -76,6 +75,8 @@ class TaskController extends AdminController
$grid->filter(function (Grid\Filter $filter) { $grid->filter(function (Grid\Filter $filter) {
// $filter->equal('id'); // $filter->equal('id');
$filter->like('name'); $filter->like('name');
$filter->like('year');
$filter->like('city_id');
}); });
...@@ -208,6 +209,14 @@ class TaskController extends AdminController ...@@ -208,6 +209,14 @@ class TaskController extends AdminController
// $show->field('status'); // $show->field('status');
// $show->field('created_at'); // $show->field('created_at');
// $show->field('updated_at'); // $show->field('updated_at');
if (\request()->input('type')) {
$show->disableDeleteButton()->disableListButton()->disableEditButton();
$show->tools(function (Show\Tools $tools) {
$tools->append(new ListAction());
});
}
}); });
} }
...@@ -217,12 +226,12 @@ class TaskController extends AdminController ...@@ -217,12 +226,12 @@ class TaskController extends AdminController
// $provinceId = $request->get('q'); // $provinceId = $request->get('q');
$data = json_decode(file_get_contents(base_path('app/china_all_area.json')), true); $data = json_decode(file_get_contents(base_path('app/china_all_area.json')), true);
$city = []; $city = [];
$already = \App\Models\Task::query()->orderBy('created_at','desc')->pluck('city_id')->toArray(); $already = \App\Models\Task::query()->orderBy('created_at', 'desc')->pluck('city_id')->toArray();
$already = array_unique($already); $already = array_unique($already);
foreach ($data['100000'] as $key => $value) { foreach ($data['100000'] as $key => $value) {
if (isset($data[$key])) { if (isset($data[$key])) {
foreach ($data[$key] as $k => $val) { foreach ($data[$key] as $k => $val) {
if (!in_array($k,$already)){ if (!in_array($k, $already)) {
$city[] = [ $city[] = [
'id' => $k, 'id' => $k,
'text' => $val 'text' => $val
...@@ -233,48 +242,60 @@ class TaskController extends AdminController ...@@ -233,48 +242,60 @@ class TaskController extends AdminController
} }
} }
$left = []; $left = [];
foreach ($already as $a){ foreach ($already as $a) {
$left[]=[ $left[] = [
'id'=>$a, 'id' => $a,
'text'=>CityAreaService::getAreaName($a) 'text' => CityAreaService::getAreaName($a)
]; ];
} }
// dd($left,array_merge($left,$city)); // dd($left,array_merge($left,$city));
return array_merge($left,$city); return array_merge($left, $city);
} }
public function edit($id, Content $content)
{
// dd($id,\request()->input('type',0));
return $content
->translation($this->translation())
->title($this->title())
->description($this->description()['edit'] ?? trans('admin.edit'))
->body($this->form(\request()->input('type', 0))->edit($id));
}
/** /**
* Make a form builder. * Make a form builder.
* *
* @return Form * @return Form
*/ */
protected function form() protected function form($type = 0)
{ {
// $data = json_decode(file_get_contents(base_path('app/china_all_area.json')), true); // $data = json_decode(file_get_contents(base_path('app/china_all_area.json')), true);
// $arr = $data['100000']; // $arr = $data['100000'];
return Form::make(new Task(), function (Form $form) { return Form::make(new Task(), function (Form $form) use ($type) {
$form->display('id'); $form->display('id');
$form->text('name')->required(); $form->text('name')->required();
$form->select('level')->options([1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5])->required(); $form->select('level')->options([1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5])->required();
// $form->select('province_id', '省')->options($arr)->loads('city_id', '/getCity');
$form->multipleSelect('city_id', '选择地区')->options('/getCity')->required()->saving(function ($v) { // $form->multipleSelect('city_id', '选择地区')->options('/getCity')->required()->saving(function ($v) {
return $v[0]; // return $v[0];
}); // });
// $form->distpicker([ // $form->distpicker([
// 'province_id' => '省', // 'province_id' => '省',
// 'city_id' => '市', // 'city_id' => '市',
// ], '选择地区')->required(); // ], '选择地区')->required();
$form->multipleSelect('year', '选择时间')->options(function () { // $form->multipleSelect('year', '选择时间')->options(function () {
$year = (int)date('Y'); // $year = (int)date('Y');
for ($i = $year; $i > 1900; $i--) { // for ($i = $year; $i > 1900; $i--) {
$years[$i] = $i; // $years[$i] = $i;
} // }
return $years; // return $years;
})->value(2024)->required(); // })->value(2024)->required();
$form->text('city_id', '选择地区')->required();
$form->text('year', '选择时间')->required();
$form->decimal('price', '单价'); $form->decimal('price', '单价');
$form->text('refer', '参考信源')->required(); $form->text('refer', '参考信源')->required();
$form->editor('guide', '收集指南')->options(['pasteImage' => false])->required(); $form->editor('guide', '收集指南')->options(['pasteImage' => false])->required();
...@@ -284,6 +305,12 @@ class TaskController extends AdminController ...@@ -284,6 +305,12 @@ class TaskController extends AdminController
// $form->display('created_at'); // $form->display('created_at');
// $form->display('updated_at'); // $form->display('updated_at');
if ($type == 1) {
$form->disableListButton()->disableDeleteButton()->disableViewButton();
$form->tools(function (Form\Tools $tools) {
$tools->append(new ListAction());
});
}
// // 在表单提交前调用 // // 在表单提交前调用
$form->submitted(function (Form $form) { $form->submitted(function (Form $form) {
...@@ -314,14 +341,14 @@ class TaskController extends AdminController ...@@ -314,14 +341,14 @@ class TaskController extends AdminController
// dump($form->year); // dump($form->year);
// //
// }); // });
//保存后回调 //保存后回调
// $form->saved(function (Form $form,$id) { $form->saved(function (Form $form) {
//
// $form->images = 12; return $form->response()->redirect('tas');
// dd($id,$form->guide);
//
// });
});
}); });
} }
...@@ -404,7 +431,7 @@ class TaskController extends AdminController ...@@ -404,7 +431,7 @@ class TaskController extends AdminController
foreach ($idArr as $idv) { foreach ($idArr as $idv) {
if (TasksReceive::query()->where('task_id', $idv)->exists()) { if (TasksReceive::query()->where('task_id', $idv)->exists()) {
$task = \App\Models\Task::query()->find($idv); $task = \App\Models\Task::query()->find($idv);
return $this->form()->response()->error('已经有用户领取了任务,不允许删除,任务名称:' . $task->name . ' ' . CityAreaService::getAreaName($task->city_id) . ' ' . $task->year); return $this->form()->response()->error('已经有用户领取了任务,不允许删除,任务名称:' . $task->name . ' ' . $task->city_id . ' ' . $task->year);
} }
} }
......
...@@ -51,18 +51,21 @@ class BatchReceiveAction extends BatchAction ...@@ -51,18 +51,21 @@ class BatchReceiveAction extends BatchAction
if (!$exists && $task->num > 0) { if (!$exists && $task->num > 0) {
$receive = TasksReceive::query()->create([ $receive = TasksReceive::query()->create([
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'area' => CityAreaService::getAreaName($task->city_id), 'area' => $task->city_id,
]); ]);
$task->num -= 1; $task->num -= 1;
$task->save(); $task->save();
TasksCollect::query()->updateOrCreate([//默认新增一条收集数据的记录 TasksCollect::query()->updateOrCreate([//默认新增一条收集数据的记录
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
], [ ], [
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
......
<?php
namespace App\Admin\Extensions\Tools;
use Dcat\Admin\Actions\Response;
use Dcat\Admin\Show\AbstractTool;
use Dcat\Admin\Traits\HasPermissions;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
class ListAction extends AbstractTool
{
/**
* 按钮标题
*
* @return string
*/
protected $title = '
<i class="feather icon-list"></i>列表
';
// /**
// * 处理请求,如果不需要接口处理,请直接删除这个方法
// *
// * @param Request $request
// *
// * @return Response
// */
// public function handle(Request $request)
// {
// // 获取主键
// $key = $this->getKey();
//
// return $this->response()
// ->success('Processed successfully.')
// ->redirect('/');
// }
/**
* 如果只是a标签跳转,则在这里返回跳转链接即可
*
* @return string|void
*/
protected function href()
{
// 获取主键
// $key = $this->getKey();
// 获取当前页其他字段
// $username = $this->parent->model()->username;
return admin_url('tas');
}
// 如果你想自定义动作按钮的HTML,可以重写此方法
public function html()
{
return parent::html();
}
// /**
// * 确认弹窗信息,如不需要可以删除此方法
// *
// * @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 [];
// }
}
...@@ -64,6 +64,7 @@ class ReceiveAction extends RowAction ...@@ -64,6 +64,7 @@ class ReceiveAction extends RowAction
if (!$exists && $task->num > 0) { if (!$exists && $task->num > 0) {
$receive = TasksReceive::query()->create([ $receive = TasksReceive::query()->create([
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'area' => CityAreaService::getAreaName($task->city_id), 'area' => CityAreaService::getAreaName($task->city_id),
...@@ -72,10 +73,12 @@ class ReceiveAction extends RowAction ...@@ -72,10 +73,12 @@ class ReceiveAction extends RowAction
$task->save(); $task->save();
TasksCollect::query()->updateOrCreate([//默认新增一条收集数据的记录 TasksCollect::query()->updateOrCreate([//默认新增一条收集数据的记录
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
], [ ], [
'tas_id' => $task->tas_id,
'task_id' => $id, 'task_id' => $id,
'user_id' => $user->id, 'user_id' => $user->id,
'receive_id' => $receive->id, 'receive_id' => $receive->id,
......
<?php
namespace App\Admin\Repositories;
use App\Models\Tas as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class Tas extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
...@@ -24,7 +24,10 @@ use Dcat\Admin\Show\Field; ...@@ -24,7 +24,10 @@ use Dcat\Admin\Show\Field;
Field::extend('unserialize', \App\Admin\Extensions\UnSerialize::class); Field::extend('unserialize', \App\Admin\Extensions\UnSerialize::class);
\Dcat\Admin\Grid::resolving(function (\Dcat\Admin\Grid $grid) { \Dcat\Admin\Grid::resolving(function (\Dcat\Admin\Grid $grid) {
$grid->tableCollapse(false);
$grid->withBorder(); $grid->withBorder();
// $grid->tableCollapse(false); $grid->addTableClass(['table-text-center']);//设置表格文字居中
}); });
...@@ -13,6 +13,11 @@ Route::group([ ...@@ -13,6 +13,11 @@ Route::group([
], function (Router $router) { ], function (Router $router) {
$router->get('/dashboard', 'HomeController@index'); $router->get('/dashboard', 'HomeController@index');
$router->resource('tas', 'TasController');
$router->resource('tasks', 'TaskController'); $router->resource('tasks', 'TaskController');
$router->get('receive', 'TaskController@receiveIndex'); $router->get('receive', 'TaskController@receiveIndex');
......
...@@ -60,41 +60,41 @@ class Handler extends ExceptionHandler ...@@ -60,41 +60,41 @@ class Handler extends ExceptionHandler
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/ */
public function render($request, Throwable $e) // public function render($request, Throwable $e)
{ // {
$data = function () use ($request, $e) { // $data = function () use ($request, $e) {
try { // try {
$routes = Route::getRoutes(); // $routes = Route::getRoutes();
$routes->match($request);//校验当前路由是否存在 // $routes->match($request);//校验当前路由是否存在
//捕获表单验证异常,改成统一的返回样式 // //捕获表单验证异常,改成统一的返回样式
if ($e instanceof UnauthorizedHttpException) { // if ($e instanceof UnauthorizedHttpException) {
return ['code' => 400401, 'message' => $e->getMessage(), 'data' => null]; // return ['code' => 400401, 'message' => $e->getMessage(), 'data' => null];
} // }
// if ($e instanceof AuthenticationException) { //// if ($e instanceof AuthenticationException) {
// return ['errCode' => 400401, 'errMsg' => $e->getMessage(), 'data' => null]; //// return ['errCode' => 400401, 'errMsg' => $e->getMessage(), 'data' => null];
//// }
// if ($e instanceof ValidationException) {
// $errors = $this->getErrors($e->errors());
// return ['code' => 422, 'message' => $errors, 'data' => null];
// }
// return [
// 'code' => ($e->getCode() != 0) ? $e->getCode() : 400001,
//// 'errMsg' => '文件【' . $e->getFile() . '】的第' . $e->getLine() . '行出现异常,大致是:【' . ($e->getMessage() ?? "error!") . '】',
// 'message' => $e->getMessage(),
// 'data' => null,
// ];
// } catch (NotFoundHttpException $ex) {
// return ['code' => 404, 'message' => '请求地址不存在...', 'data' => null];
// } catch (\Exception $excep) {
// return [
// 'code' => ($excep->getCode() != 0) ? $excep->getCode() : 400002,
// 'message' => $excep->getMessage() ?? "error!",
// 'data' => null,
// ];
// }
// };
// return response()->json($data());//返回json对象用这个方法
//
// } // }
if ($e instanceof ValidationException) {
$errors = $this->getErrors($e->errors());
return ['code' => 422, 'message' => $errors, 'data' => null];
}
return [
'code' => ($e->getCode() != 0) ? $e->getCode() : 400001,
// 'errMsg' => '文件【' . $e->getFile() . '】的第' . $e->getLine() . '行出现异常,大致是:【' . ($e->getMessage() ?? "error!") . '】',
'message' => $e->getMessage(),
'data' => null,
];
} catch (NotFoundHttpException $ex) {
return ['code' => 404, 'message' => '请求地址不存在...', 'data' => null];
} catch (\Exception $excep) {
return [
'code' => ($excep->getCode() != 0) ? $excep->getCode() : 400002,
'message' => $excep->getMessage() ?? "error!",
'data' => null,
];
}
};
return response()->json($data());//返回json对象用这个方法
}
} }
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class Tas extends Model
{
use HasDateTimeFormatter, HasFactory, Notifiable;
protected $table = 'tas';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'level',
'city_id',
'province_id',
'year',
'refer',
'guide',
'price',
'status',
'num',
'images',
'created_at',
'updated_at',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [];
// public function getYearAttribute($value)
// {
// return explode(',', $value);
// }
// public function setYearAttribute($value)
// {
// $this->attributes['year'] = implode(',', $value);
// }
// public function setCityIdAttribute($value)
// {
// $this->attributes['cityId'] = implode(',', $value);
// }
public function tasks()
{
return $this->hasMany(Task::class);
}
}
...@@ -23,6 +23,7 @@ class Task extends Model ...@@ -23,6 +23,7 @@ class Task extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'tas_id',
'name', 'name',
'level', 'level',
'city_id', 'city_id',
...@@ -52,10 +53,10 @@ class Task extends Model ...@@ -52,10 +53,10 @@ class Task extends Model
// return explode(',', $value); // return explode(',', $value);
// } // }
public function setYearAttribute($value) // public function setYearAttribute($value)
{ // {
$this->attributes['year'] = implode(',', $value); // $this->attributes['year'] = implode(',', $value);
} // }
// public function setCityIdAttribute($value) // public function setCityIdAttribute($value)
// { // {
......
...@@ -25,6 +25,7 @@ class TasksApprove extends Model ...@@ -25,6 +25,7 @@ class TasksApprove extends Model
*/ */
protected $fillable = [ protected $fillable = [
'id', 'id',
'tas_id',
'task_id', 'task_id',
'user_id', 'user_id',
'receive_id', 'receive_id',
......
...@@ -18,6 +18,7 @@ class TasksCollect extends Model ...@@ -18,6 +18,7 @@ class TasksCollect extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'tas_id',
'task_id', 'task_id',
'user_id', 'user_id',
'receive_id', 'receive_id',
......
...@@ -26,6 +26,7 @@ class TasksReceive extends Model ...@@ -26,6 +26,7 @@ class TasksReceive extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'tas_id',
'task_id', 'task_id',
'user_id', 'user_id',
'order_id', 'order_id',
......
...@@ -25,7 +25,7 @@ class CreateAdminTables extends Migration ...@@ -25,7 +25,7 @@ class CreateAdminTables extends Migration
{ {
Schema::create($this->config('database.users_table'), function (Blueprint $table) { Schema::create($this->config('database.users_table'), function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->tinyInteger('is_admin')->default(0)->comment('是否是超级管理员'); $table->tinyInteger('is_admin')->default(0)->comment('是否是管理员');
$table->string('username', 120)->unique(); $table->string('username', 120)->unique();
$table->string('password', 80); $table->string('password', 80);
$table->string('name'); $table->string('name');
......
...@@ -15,6 +15,7 @@ class CreateTasksTable extends Migration ...@@ -15,6 +15,7 @@ class CreateTasksTable extends Migration
{ {
Schema::create('tasks', function (Blueprint $table) { Schema::create('tasks', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->bigInteger('tas_id');
$table->string('name')->default('')->comment('指标名称'); $table->string('name')->default('')->comment('指标名称');
$table->integer('level')->default('1')->comment('难度等级'); $table->integer('level')->default('1')->comment('难度等级');
$table->string('city_id')->default('')->comment('市'); $table->string('city_id')->default('')->comment('市');
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->default('')->comment('指标名称');
$table->integer('level')->default('1')->comment('难度等级');
$table->string('city_id')->default('')->comment('市');
$table->string('province_id')->default('')->comment('省');
$table->string('year')->default('')->comment('年份');
$table->string('refer')->nullable()->comment('参考信源');
$table->longText('guide')->nullable()->comment('收集指南');
$table->decimal('price')->default('0.00')->comment('单价');
$table->tinyInteger('status')->default('0')->comment('任务状态');
$table->unsignedInteger('num')->default('2')->comment('可以被领取次数');
$table->longText('images')->nullable()->comment('图片地址url 多个逗号隔开');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tas');
}
}
...@@ -12,7 +12,6 @@ namespace Dcat\Admin { ...@@ -12,7 +12,6 @@ namespace Dcat\Admin {
/** /**
* @property Grid\Column|Collection city_id * @property Grid\Column|Collection city_id
* @property Grid\Column|Collection guide
* @property Grid\Column|Collection created_at * @property Grid\Column|Collection created_at
* @property Grid\Column|Collection detail * @property Grid\Column|Collection detail
* @property Grid\Column|Collection id * @property Grid\Column|Collection id
...@@ -47,6 +46,8 @@ namespace Dcat\Admin { ...@@ -47,6 +46,8 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection uuid * @property Grid\Column|Collection uuid
* @property Grid\Column|Collection email * @property Grid\Column|Collection email
* @property Grid\Column|Collection token * @property Grid\Column|Collection token
* @property Grid\Column|Collection guide
* @property Grid\Column|Collection images
* @property Grid\Column|Collection level * @property Grid\Column|Collection level
* @property Grid\Column|Collection num * @property Grid\Column|Collection num
* @property Grid\Column|Collection price * @property Grid\Column|Collection price
...@@ -57,6 +58,7 @@ namespace Dcat\Admin { ...@@ -57,6 +58,7 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection msg * @property Grid\Column|Collection msg
* @property Grid\Column|Collection receive_id * @property Grid\Column|Collection receive_id
* @property Grid\Column|Collection task_id * @property Grid\Column|Collection task_id
* @property Grid\Column|Collection time
* @property Grid\Column|Collection is_find * @property Grid\Column|Collection is_find
* @property Grid\Column|Collection net_img * @property Grid\Column|Collection net_img
* @property Grid\Column|Collection reality_refer * @property Grid\Column|Collection reality_refer
...@@ -64,15 +66,11 @@ namespace Dcat\Admin { ...@@ -64,15 +66,11 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection remark * @property Grid\Column|Collection remark
* @property Grid\Column|Collection amount * @property Grid\Column|Collection amount
* @property Grid\Column|Collection pay_img * @property Grid\Column|Collection pay_img
* @property Grid\Column|Collection time
* @property Grid\Column|Collection pay_confirm
* @property Grid\Column|Collection user_confirm
* @property Grid\Column|Collection area * @property Grid\Column|Collection area
* @property Grid\Column|Collection order_id * @property Grid\Column|Collection order_id
* @property Grid\Column|Collection email_verified_at * @property Grid\Column|Collection email_verified_at
* *
* @method Grid\Column|Collection city_id(string $label = null) * @method Grid\Column|Collection city_id(string $label = null)
* @method Grid\Column|Collection guide(string $label = null)
* @method Grid\Column|Collection created_at(string $label = null) * @method Grid\Column|Collection created_at(string $label = null)
* @method Grid\Column|Collection detail(string $label = null) * @method Grid\Column|Collection detail(string $label = null)
* @method Grid\Column|Collection id(string $label = null) * @method Grid\Column|Collection id(string $label = null)
...@@ -107,6 +105,8 @@ namespace Dcat\Admin { ...@@ -107,6 +105,8 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection uuid(string $label = null) * @method Grid\Column|Collection uuid(string $label = null)
* @method Grid\Column|Collection email(string $label = null) * @method Grid\Column|Collection email(string $label = null)
* @method Grid\Column|Collection token(string $label = null) * @method Grid\Column|Collection token(string $label = null)
* @method Grid\Column|Collection guide(string $label = null)
* @method Grid\Column|Collection images(string $label = null)
* @method Grid\Column|Collection level(string $label = null) * @method Grid\Column|Collection level(string $label = null)
* @method Grid\Column|Collection num(string $label = null) * @method Grid\Column|Collection num(string $label = null)
* @method Grid\Column|Collection price(string $label = null) * @method Grid\Column|Collection price(string $label = null)
...@@ -117,6 +117,7 @@ namespace Dcat\Admin { ...@@ -117,6 +117,7 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection msg(string $label = null) * @method Grid\Column|Collection msg(string $label = null)
* @method Grid\Column|Collection receive_id(string $label = null) * @method Grid\Column|Collection receive_id(string $label = null)
* @method Grid\Column|Collection task_id(string $label = null) * @method Grid\Column|Collection task_id(string $label = null)
* @method Grid\Column|Collection time(string $label = null)
* @method Grid\Column|Collection is_find(string $label = null) * @method Grid\Column|Collection is_find(string $label = null)
* @method Grid\Column|Collection net_img(string $label = null) * @method Grid\Column|Collection net_img(string $label = null)
* @method Grid\Column|Collection reality_refer(string $label = null) * @method Grid\Column|Collection reality_refer(string $label = null)
...@@ -124,9 +125,6 @@ namespace Dcat\Admin { ...@@ -124,9 +125,6 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection remark(string $label = null) * @method Grid\Column|Collection remark(string $label = null)
* @method Grid\Column|Collection amount(string $label = null) * @method Grid\Column|Collection amount(string $label = null)
* @method Grid\Column|Collection pay_img(string $label = null) * @method Grid\Column|Collection pay_img(string $label = null)
* @method Grid\Column|Collection time(string $label = null)
* @method Grid\Column|Collection pay_confirm(string $label = null)
* @method Grid\Column|Collection user_confirm(string $label = null)
* @method Grid\Column|Collection area(string $label = null) * @method Grid\Column|Collection area(string $label = null)
* @method Grid\Column|Collection order_id(string $label = null) * @method Grid\Column|Collection order_id(string $label = null)
* @method Grid\Column|Collection email_verified_at(string $label = null) * @method Grid\Column|Collection email_verified_at(string $label = null)
...@@ -137,7 +135,6 @@ namespace Dcat\Admin { ...@@ -137,7 +135,6 @@ namespace Dcat\Admin {
/** /**
* @property Show\Field|Collection city_id * @property Show\Field|Collection city_id
* @property Show\Field|Collection guide
* @property Show\Field|Collection created_at * @property Show\Field|Collection created_at
* @property Show\Field|Collection detail * @property Show\Field|Collection detail
* @property Show\Field|Collection id * @property Show\Field|Collection id
...@@ -172,6 +169,8 @@ namespace Dcat\Admin { ...@@ -172,6 +169,8 @@ namespace Dcat\Admin {
* @property Show\Field|Collection uuid * @property Show\Field|Collection uuid
* @property Show\Field|Collection email * @property Show\Field|Collection email
* @property Show\Field|Collection token * @property Show\Field|Collection token
* @property Show\Field|Collection guide
* @property Show\Field|Collection images
* @property Show\Field|Collection level * @property Show\Field|Collection level
* @property Show\Field|Collection num * @property Show\Field|Collection num
* @property Show\Field|Collection price * @property Show\Field|Collection price
...@@ -182,6 +181,7 @@ namespace Dcat\Admin { ...@@ -182,6 +181,7 @@ namespace Dcat\Admin {
* @property Show\Field|Collection msg * @property Show\Field|Collection msg
* @property Show\Field|Collection receive_id * @property Show\Field|Collection receive_id
* @property Show\Field|Collection task_id * @property Show\Field|Collection task_id
* @property Show\Field|Collection time
* @property Show\Field|Collection is_find * @property Show\Field|Collection is_find
* @property Show\Field|Collection net_img * @property Show\Field|Collection net_img
* @property Show\Field|Collection reality_refer * @property Show\Field|Collection reality_refer
...@@ -189,15 +189,11 @@ namespace Dcat\Admin { ...@@ -189,15 +189,11 @@ namespace Dcat\Admin {
* @property Show\Field|Collection remark * @property Show\Field|Collection remark
* @property Show\Field|Collection amount * @property Show\Field|Collection amount
* @property Show\Field|Collection pay_img * @property Show\Field|Collection pay_img
* @property Show\Field|Collection time
* @property Show\Field|Collection pay_confirm
* @property Show\Field|Collection user_confirm
* @property Show\Field|Collection area * @property Show\Field|Collection area
* @property Show\Field|Collection order_id * @property Show\Field|Collection order_id
* @property Show\Field|Collection email_verified_at * @property Show\Field|Collection email_verified_at
* *
* @method Show\Field|Collection city_id(string $label = null) * @method Show\Field|Collection city_id(string $label = null)
* @method Show\Field|Collection guide(string $label = null)
* @method Show\Field|Collection created_at(string $label = null) * @method Show\Field|Collection created_at(string $label = null)
* @method Show\Field|Collection detail(string $label = null) * @method Show\Field|Collection detail(string $label = null)
* @method Show\Field|Collection id(string $label = null) * @method Show\Field|Collection id(string $label = null)
...@@ -232,6 +228,8 @@ namespace Dcat\Admin { ...@@ -232,6 +228,8 @@ namespace Dcat\Admin {
* @method Show\Field|Collection uuid(string $label = null) * @method Show\Field|Collection uuid(string $label = null)
* @method Show\Field|Collection email(string $label = null) * @method Show\Field|Collection email(string $label = null)
* @method Show\Field|Collection token(string $label = null) * @method Show\Field|Collection token(string $label = null)
* @method Show\Field|Collection guide(string $label = null)
* @method Show\Field|Collection images(string $label = null)
* @method Show\Field|Collection level(string $label = null) * @method Show\Field|Collection level(string $label = null)
* @method Show\Field|Collection num(string $label = null) * @method Show\Field|Collection num(string $label = null)
* @method Show\Field|Collection price(string $label = null) * @method Show\Field|Collection price(string $label = null)
...@@ -242,6 +240,7 @@ namespace Dcat\Admin { ...@@ -242,6 +240,7 @@ namespace Dcat\Admin {
* @method Show\Field|Collection msg(string $label = null) * @method Show\Field|Collection msg(string $label = null)
* @method Show\Field|Collection receive_id(string $label = null) * @method Show\Field|Collection receive_id(string $label = null)
* @method Show\Field|Collection task_id(string $label = null) * @method Show\Field|Collection task_id(string $label = null)
* @method Show\Field|Collection time(string $label = null)
* @method Show\Field|Collection is_find(string $label = null) * @method Show\Field|Collection is_find(string $label = null)
* @method Show\Field|Collection net_img(string $label = null) * @method Show\Field|Collection net_img(string $label = null)
* @method Show\Field|Collection reality_refer(string $label = null) * @method Show\Field|Collection reality_refer(string $label = null)
...@@ -249,9 +248,6 @@ namespace Dcat\Admin { ...@@ -249,9 +248,6 @@ namespace Dcat\Admin {
* @method Show\Field|Collection remark(string $label = null) * @method Show\Field|Collection remark(string $label = null)
* @method Show\Field|Collection amount(string $label = null) * @method Show\Field|Collection amount(string $label = null)
* @method Show\Field|Collection pay_img(string $label = null) * @method Show\Field|Collection pay_img(string $label = null)
* @method Show\Field|Collection time(string $label = null)
* @method Show\Field|Collection pay_confirm(string $label = null)
* @method Show\Field|Collection user_confirm(string $label = null)
* @method Show\Field|Collection area(string $label = null) * @method Show\Field|Collection area(string $label = null)
* @method Show\Field|Collection order_id(string $label = null) * @method Show\Field|Collection order_id(string $label = null)
* @method Show\Field|Collection email_verified_at(string $label = null) * @method Show\Field|Collection email_verified_at(string $label = null)
......
...@@ -674,7 +674,7 @@ ...@@ -674,7 +674,7 @@
/** /**
* 设置 Editor.md 的整体主题,主要是工具栏 * 设置 Editor.md 的整体主题,主要是工具栏
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -693,7 +693,7 @@ ...@@ -693,7 +693,7 @@
/** /**
* 设置 CodeMirror(编辑区)的主题 * 设置 CodeMirror(编辑区)的主题
* MsgSetting CodeMirror (Editor area) theme * Setting CodeMirror (Editor area) theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -727,7 +727,7 @@ ...@@ -727,7 +727,7 @@
/** /**
* 设置 Editor.md 的主题 * 设置 Editor.md 的主题
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
......
...@@ -604,7 +604,7 @@ ...@@ -604,7 +604,7 @@
/** /**
* 设置 Editor.md 的整体主题,主要是工具栏 * 设置 Editor.md 的整体主题,主要是工具栏
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -623,7 +623,7 @@ ...@@ -623,7 +623,7 @@
/** /**
* 设置 CodeMirror(编辑区)的主题 * 设置 CodeMirror(编辑区)的主题
* MsgSetting CodeMirror (Editor area) theme * Setting CodeMirror (Editor area) theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -657,7 +657,7 @@ ...@@ -657,7 +657,7 @@
/** /**
* 设置 Editor.md 的主题 * 设置 Editor.md 的主题
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
......
...@@ -592,7 +592,7 @@ ...@@ -592,7 +592,7 @@
/** /**
* 设置 Editor.md 的整体主题,主要是工具栏 * 设置 Editor.md 的整体主题,主要是工具栏
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -611,7 +611,7 @@ ...@@ -611,7 +611,7 @@
/** /**
* 设置 CodeMirror(编辑区)的主题 * 设置 CodeMirror(编辑区)的主题
* MsgSetting CodeMirror (Editor area) theme * Setting CodeMirror (Editor area) theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
/** /**
* 设置 Editor.md 的主题 * 设置 Editor.md 的主题
* MsgSetting Editor.md theme * Setting Editor.md theme
* *
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
......
...@@ -46,7 +46,7 @@ return [ ...@@ -46,7 +46,7 @@ return [
'online' => 'Online', 'online' => 'Online',
'login' => 'Login', 'login' => 'Login',
'logout' => 'Logout', 'logout' => 'Logout',
'setting' => 'MsgSetting', 'setting' => 'Setting',
'name' => 'Name', 'name' => 'Name',
'username' => 'Username', 'username' => 'Username',
'user' => 'User', 'user' => 'User',
......
<?php
return [
'labels' => [
'Tas' => 'Tas',
'tas' => 'Tas',
],
'fields' => [
'name' => '指标名称',
'level' => '难度等级',
'city_id' => '市',
'province_id' => '省',
'year' => '年份',
'refer' => '参考信源',
'guide' => '收集指南',
'price' => '单价',
'status' => '任务状态',
'num' => '可以被领取次数',
'images' => '图片地址url 多个逗号隔开',
],
'options' => [
],
];
<div class="box-footer">
<div class="col-md-2 d-md-block" style="display: none"></div>
<div class="col-md-8">
<div class="btn-group pull-right">
<button class="btn btn-primary submit">
<i class="feather icon-save"></i>
提 交</button>
</div>
{{-- <div class="pull-right d-md-flex" style="margin:10px 15px 0 0;display: none"><div class="d-flex flex-wrap">--}}
{{-- <div class="vs-checkbox-con vs-checkbox-primary" style="margin-right: 16px">--}}
{{-- <input value="1" name="after-save" circle="1" type="checkbox" class=" Dcat_Admin_Widgets_Checkbox">--}}
{{-- <span class="vs-checkbox vs-checkbox-">--}}
{{-- <span class="vs-checkbox--check">--}}
{{-- <i class="vs-icon feather icon-check"></i>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- <span><span class="text-80 text-bold">继续编辑</span></span>--}}
{{-- </div>--}}
{{-- <div class="vs-checkbox-con vs-checkbox-primary" style="margin-right: 16px">--}}
{{-- <input value="3" name="after-save" circle="1" type="checkbox" class=" Dcat_Admin_Widgets_Checkbox">--}}
{{-- <span class="vs-checkbox vs-checkbox-">--}}
{{-- <span class="vs-checkbox--check">--}}
{{-- <i class="vs-icon feather icon-check"></i>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- <span><span class="text-80 text-bold">查看</span></span>--}}
{{-- </div>--}}
{{-- </div></div>--}}
<div class="btn-group pull-left">
<button type="reset" class="btn btn-white"><i class="feather icon-rotate-ccw"></i> 重置</button>
</div>
</div>
</div>
<script>
function jump(id){
remark = document.getElementById('remark-zbd').value
// console.log(remark)
if (remark == ''){
Dcat.error('备注信息不能为空')
}else {
window.location.href = '/notFind/'+id+'?remark='+remark
}
}
</script>
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 to comment