up.
This commit is contained in:
parent
d281084e1d
commit
28de61792e
@ -17,14 +17,14 @@ class OperateRecordController extends BaseController
|
||||
*/
|
||||
public function page(): Json
|
||||
{
|
||||
$model = SysOperateRecord::withSearch([], [
|
||||
'username' => $this->request->get('username/s', ''),
|
||||
'nickname' => $this->request->get('nickname/s', ''),
|
||||
'loginType' => $this->request->get('loginType/d', 0),
|
||||
$model = SysOperateRecord::withSearch(['createTime', 'contextId', 'location', 'operateUserId'], [
|
||||
'createTime' => [
|
||||
$this->request->get('createTimeStart/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);
|
||||
|
||||
@ -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' => [
|
||||
$this->request->get('createTimeStart/s', ''),
|
||||
$this->request->get('createTimeEnd/s', '')
|
||||
],
|
||||
'contextId' => $this->request->get('contextId/s','')
|
||||
]);
|
||||
$paginate = CurdService::getPaginate($this->request, $model);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@ -31,4 +31,20 @@ class SysOperateRecord extends BaseModel
|
||||
$value = array_filter($value);
|
||||
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);
|
||||
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;
|
||||
/** 操作模块 */
|
||||
location?: string;
|
||||
/** 上下文ID */
|
||||
contextId?: string;
|
||||
/** 开始时间 */
|
||||
createTimeStart?: string;
|
||||
/** 截至时间 */
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
data: OperationRecord;
|
||||
}>();
|
||||
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-row :gutter="8">
|
||||
<el-col :lg="6" :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="用户账号">
|
||||
<el-form-item label="上下文ID">
|
||||
<el-input
|
||||
clearable
|
||||
v-model.trim="form.username"
|
||||
v-model.trim="form.contextId"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -60,7 +60,7 @@
|
||||
/** 表单数据 */
|
||||
const [form, resetFields] = useFormData<OperationRecordParam>({
|
||||
username: '',
|
||||
module: ''
|
||||
contextId: ''
|
||||
});
|
||||
|
||||
/** 日期范围 */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user