feature: task

This commit is contained in:
zhuyu 2025-03-22 18:47:00 +08:00
parent 30ecfd1f65
commit a051e4136f
12 changed files with 178 additions and 42 deletions

View File

@ -34,4 +34,38 @@ class Schedule extends Backend
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['admin'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -35,4 +35,38 @@ class Task extends Backend
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['admin'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -10,5 +10,20 @@ return [
'Type 3' => '晚班',
'Date' => '日期',
'Create_time' => '创建时间',
'Update_time' => '编辑时间'
'Update_time' => '编辑时间',
'Admin.id' => 'ID',
'Admin.username' => '用户名',
'Admin.nickname' => '昵称',
'Admin.password' => '密码',
'Admin.salt' => '密码盐',
'Admin.avatar' => '头像',
'Admin.email' => '电子邮箱',
'Admin.mobile' => '手机号码',
'Admin.loginfailure' => '失败次数',
'Admin.logintime' => '登录时间',
'Admin.loginip' => '登录IP',
'Admin.createtime' => '创建时间',
'Admin.updatetime' => '更新时间',
'Admin.token' => 'Session标识',
'Admin.status' => '状态'
];

View File

@ -28,5 +28,20 @@ return [
'Expire_end_time' => '有效期结束时间',
'Complete_time' => '完成时间',
'Create_time' => '创建时间',
'Update_time' => '编辑时间'
'Update_time' => '编辑时间',
'Admin.id' => 'ID',
'Admin.username' => '用户名',
'Admin.nickname' => '昵称',
'Admin.password' => '密码',
'Admin.salt' => '密码盐',
'Admin.avatar' => '头像',
'Admin.email' => '电子邮箱',
'Admin.mobile' => '手机号码',
'Admin.loginfailure' => '失败次数',
'Admin.logintime' => '登录时间',
'Admin.loginip' => '登录IP',
'Admin.createtime' => '创建时间',
'Admin.updatetime' => '更新时间',
'Admin.token' => 'Session标识',
'Admin.status' => '状态'
];

View File

@ -46,4 +46,8 @@ class Schedule extends Model
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -60,4 +60,8 @@ class Task extends Model
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exec_admin_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exec_admin_id" data-rule="required" data-source="exec/admin/index" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="">
<input id="c-exec_admin_id" data-rule="required" data-source="auth/admin/selectpage" data-field="nickname" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exec_admin_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exec_admin_id" data-rule="required" data-source="exec/admin/index" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="{$row.exec_admin_id|htmlentities}">
<input id="c-exec_admin_id" data-rule="required" data-source="auth/admin/selectpage" data-field="nickname" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="{$row.exec_admin_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exec_admin_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exec_admin_id" data-rule="required" data-source="exec/admin/index" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="">
<input id="c-exec_admin_id" data-rule="required" data-source="auth/admin/selectpage" data-field="nickname" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exec_admin_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exec_admin_id" data-rule="required" data-source="exec/admin/index" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="{$row.exec_admin_id|htmlentities}">
<input id="c-exec_admin_id" data-rule="required" data-source="auth/admin/selectpage" data-field="nickname" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="{$row.exec_admin_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -32,6 +32,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'date', title: __('Date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'admin.id', title: __('Admin.id')},
{field: 'admin.username', title: __('Admin.username'), operate: 'LIKE'},
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
{field: 'admin.password', title: __('Admin.password'), operate: 'LIKE'},
{field: 'admin.salt', title: __('Admin.salt'), operate: 'LIKE'},
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'admin.email', title: __('Admin.email'), operate: 'LIKE'},
{field: 'admin.mobile', title: __('Admin.mobile'), operate: 'LIKE'},
{field: 'admin.loginfailure', title: __('Admin.loginfailure')},
{field: 'admin.logintime', title: __('Admin.logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.loginip', title: __('Admin.loginip'), operate: 'LIKE'},
{field: 'admin.createtime', title: __('Admin.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.updatetime', title: __('Admin.updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.token', title: __('Admin.token'), operate: 'LIKE'},
{field: 'admin.status', title: __('Admin.status'), operate: 'LIKE', formatter: Table.api.formatter.status},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]

View File

@ -40,6 +40,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'complete_time', title: __('Complete_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'admin.id', title: __('Admin.id')},
{field: 'admin.username', title: __('Admin.username'), operate: 'LIKE'},
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
{field: 'admin.password', title: __('Admin.password'), operate: 'LIKE'},
{field: 'admin.salt', title: __('Admin.salt'), operate: 'LIKE'},
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'admin.email', title: __('Admin.email'), operate: 'LIKE'},
{field: 'admin.mobile', title: __('Admin.mobile'), operate: 'LIKE'},
{field: 'admin.loginfailure', title: __('Admin.loginfailure')},
{field: 'admin.logintime', title: __('Admin.logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.loginip', title: __('Admin.loginip'), operate: 'LIKE'},
{field: 'admin.createtime', title: __('Admin.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.updatetime', title: __('Admin.updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'admin.token', title: __('Admin.token'), operate: 'LIKE'},
{field: 'admin.status', title: __('Admin.status'), operate: 'LIKE', formatter: Table.api.formatter.status},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]