up.
This commit is contained in:
parent
d281084e1d
commit
28de61792e
@ -17,14 +17,14 @@ class OperateRecordController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function page(): Json
|
public function page(): Json
|
||||||
{
|
{
|
||||||
$model = SysOperateRecord::withSearch([], [
|
$model = SysOperateRecord::withSearch(['createTime', 'contextId', 'location', 'operateUserId'], [
|
||||||
'username' => $this->request->get('username/s', ''),
|
|
||||||
'nickname' => $this->request->get('nickname/s', ''),
|
|
||||||
'loginType' => $this->request->get('loginType/d', 0),
|
|
||||||
'createTime' => [
|
'createTime' => [
|
||||||
$this->request->get('createTimeStart/s', ''),
|
$this->request->get('createTimeStart/s', ''),
|
||||||
$this->request->get('createTimeEnd/s', '')
|
$this->request->get('createTimeEnd/s', '')
|
||||||
],
|
],
|
||||||
|
'contextId' => $this->request->get('contextId/s',''),
|
||||||
|
'location' => $this->request->get('location/s',''),
|
||||||
|
'operateUserId' => $this->request->get('operateUserId/d',0),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$paginate = CurdService::getPaginate($this->request, $model);
|
$paginate = CurdService::getPaginate($this->request, $model);
|
||||||
|
|||||||
@ -20,11 +20,12 @@ class RequestRecordController extends BaseController
|
|||||||
/*
|
/*
|
||||||
* 这里有两个字段数据太大,提到详情里面做查询
|
* 这里有两个字段数据太大,提到详情里面做查询
|
||||||
*/
|
*/
|
||||||
$model = SysRequestRecord::withoutField('request_headers,response_data')->withSearch(['createTime'], [
|
$model = SysRequestRecord::withoutField('request_headers,response_data')->withSearch(['createTime', 'contextId'], [
|
||||||
'createTime' => [
|
'createTime' => [
|
||||||
$this->request->get('createTimeStart/s', ''),
|
$this->request->get('createTimeStart/s', ''),
|
||||||
$this->request->get('createTimeEnd/s', '')
|
$this->request->get('createTimeEnd/s', '')
|
||||||
],
|
],
|
||||||
|
'contextId' => $this->request->get('contextId/s','')
|
||||||
]);
|
]);
|
||||||
$paginate = CurdService::getPaginate($this->request, $model);
|
$paginate = CurdService::getPaginate($this->request, $model);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
@ -31,4 +31,20 @@ class SysOperateRecord extends BaseModel
|
|||||||
$value = array_filter($value);
|
$value = array_filter($value);
|
||||||
count($value) >= 2 && $query->whereBetweenTime('create_time', $value[0], $value[1]);
|
count($value) >= 2 && $query->whereBetweenTime('create_time', $value[0], $value[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function searchContextIdAttr(Query $query, string $value, array $data): void
|
||||||
|
{
|
||||||
|
$value != '' && $query->where('context_id', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function searchLocationAttr(Query $query, string $value, array $data): void
|
||||||
|
{
|
||||||
|
$value != '' && $query->where('location', $value);
|
||||||
|
}
|
||||||
|
public function searchOperateUserIdAttr(Query $query, int $value, array $data): void
|
||||||
|
{
|
||||||
|
$value > 0 && $query->where('operate_user_id', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -19,4 +19,9 @@ class SysRequestRecord extends BaseModel
|
|||||||
$value = array_filter($value);
|
$value = array_filter($value);
|
||||||
count($value) >= 2 && $query->whereBetweenTime('request_time', $value[0], $value[1]);
|
count($value) >= 2 && $query->whereBetweenTime('request_time', $value[0], $value[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function searchContextIdAttr(Query $query, string $value, array $data): void
|
||||||
|
{
|
||||||
|
$value != '' && $query->where('context_id', $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -30,6 +30,8 @@ export interface OperationRecordParam extends PageParam {
|
|||||||
username?: string;
|
username?: string;
|
||||||
/** 操作模块 */
|
/** 操作模块 */
|
||||||
location?: string;
|
location?: string;
|
||||||
|
/** 上下文ID */
|
||||||
|
contextId?: string;
|
||||||
/** 开始时间 */
|
/** 开始时间 */
|
||||||
createTimeStart?: string;
|
createTimeStart?: string;
|
||||||
/** 截至时间 */
|
/** 截至时间 */
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
data: OperationRecord;
|
data: OperationRecord;
|
||||||
}>();
|
}>();
|
||||||
const previewData = computed(() => {
|
const previewData = computed(() => {
|
||||||
return formatJson(props.data);
|
return formatJson(props.data.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 弹窗是否打开 */
|
/** 弹窗是否打开 */
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
<el-form label-width="72px" @keyup.enter="search" @submit.prevent="">
|
<el-form label-width="72px" @keyup.enter="search" @submit.prevent="">
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :lg="6" :md="12" :sm="12" :xs="24">
|
<el-col :lg="6" :md="12" :sm="12" :xs="24">
|
||||||
<el-form-item label="用户账号">
|
<el-form-item label="上下文ID">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
v-model.trim="form.username"
|
v-model.trim="form.contextId"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
/** 表单数据 */
|
/** 表单数据 */
|
||||||
const [form, resetFields] = useFormData<OperationRecordParam>({
|
const [form, resetFields] = useFormData<OperationRecordParam>({
|
||||||
username: '',
|
username: '',
|
||||||
module: ''
|
contextId: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 日期范围 */
|
/** 日期范围 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user