parent
79135fe511
commit
32d7ae4c3b
@ -0,0 +1,14 @@ |
|||||||
|
import { AxiosPromise } from "axios"; |
||||||
|
import { DeviceLogPageResult } from "@/api/operate-log/types"; |
||||||
|
import request from "@/utils/request"; |
||||||
|
|
||||||
|
export function operateLogPage( |
||||||
|
devId?: number, |
||||||
|
data?: PageQuery |
||||||
|
): AxiosPromise<DeviceLogPageResult> { |
||||||
|
return request({ |
||||||
|
url: `/api/device-log/v1/page/${devId}`, |
||||||
|
method: "POST", |
||||||
|
data, |
||||||
|
}); |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
export interface DeviceLogVO { |
||||||
|
devId?: number; |
||||||
|
operTime?: string; |
||||||
|
operName?: string; |
||||||
|
description?: string; |
||||||
|
paramInfoList?: ParamInfo[]; |
||||||
|
} |
||||||
|
export type DeviceLogPageResult = PageResult<DeviceLogVO[]>; |
||||||
|
export interface ParamInfo { |
||||||
|
parameterName?: string; |
||||||
|
actualValue?: string; |
||||||
|
remarks?: string; |
||||||
|
} |
@ -0,0 +1,113 @@ |
|||||||
|
<template> |
||||||
|
<div class="app-container"> |
||||||
|
<el-card shadow="never"> |
||||||
|
<template #header> |
||||||
|
<div style="display: flex; justify-content: space-between"> |
||||||
|
<div style="font-weight: 700; line-height: 32px; font-size: 14px"> |
||||||
|
设备日志信息列表 |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
<div class="any-table"> |
||||||
|
<el-table :data="tableData" v-loading="loading" max-height="500"> |
||||||
|
<el-table-column |
||||||
|
label="操作名称" |
||||||
|
width="200" |
||||||
|
prop="operName" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="操作时间" |
||||||
|
width="200" |
||||||
|
prop="operTime" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
<el-table-column label="设备操作日志内容" prop="description"> |
||||||
|
<template #default="scope"> |
||||||
|
<div> |
||||||
|
<div style="white-space: pre-line"> |
||||||
|
{{ scope.row.description }} |
||||||
|
</div> |
||||||
|
|
||||||
|
<div v-if="scope.row.paramInfoList != null"> |
||||||
|
<div style="line-height: 32px; font-size: 14px"> |
||||||
|
parameter values : |
||||||
|
</div> |
||||||
|
<div class="any-table param"> |
||||||
|
<el-table |
||||||
|
:data="scope.row.paramInfoList" |
||||||
|
highlight-current-row |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
label="参数名称" |
||||||
|
align="center" |
||||||
|
width="250" |
||||||
|
prop="parameterName" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="实际值" |
||||||
|
align="center" |
||||||
|
width="100" |
||||||
|
prop="actualValue" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="备注" |
||||||
|
align="center" |
||||||
|
prop="remarks" |
||||||
|
/> |
||||||
|
</el-table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-if="total > 0" |
||||||
|
v-model:total="total" |
||||||
|
v-model:page="queryForm.pageNum" |
||||||
|
v-model:limit="queryForm.pageSize" |
||||||
|
@pagination="getData" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</el-card> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script setup lang="ts"> |
||||||
|
import { DeviceLogVO } from "@/api/operate-log/types"; |
||||||
|
import { operateLogPage } from "@/api/operate-log"; |
||||||
|
|
||||||
|
const route = useRoute(); |
||||||
|
let devId: number = parseInt(<string>route.params.devId); |
||||||
|
const tableData = ref<DeviceLogVO[]>([]); |
||||||
|
const total = ref<number>(0); |
||||||
|
const queryForm = ref<PageQuery>({ |
||||||
|
pageNum: 1, |
||||||
|
pageSize: 10, |
||||||
|
}); |
||||||
|
const loading = ref<boolean>(false); |
||||||
|
const getData = () => { |
||||||
|
loading.value = true; |
||||||
|
operateLogPage(devId, queryForm.value) |
||||||
|
.then(({ data }) => { |
||||||
|
tableData.value = data.list; |
||||||
|
total.value = data.total; |
||||||
|
}) |
||||||
|
.finally(() => { |
||||||
|
loading.value = false; |
||||||
|
}); |
||||||
|
}; |
||||||
|
onMounted(() => { |
||||||
|
getData(); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped> |
||||||
|
:deep(.el-card__body) { |
||||||
|
padding: 10px 0 0 0; |
||||||
|
} |
||||||
|
.el-table__body .param { |
||||||
|
font-size: 12px !important; |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue