|
@@ -0,0 +1,126 @@
|
|
|
+<template>
|
|
|
+ <div class="page-container iotHardware-hardwareLog">
|
|
|
+ <div class="page-container iotHardwarePage">
|
|
|
+ <div class="page-form-title-box">
|
|
|
+ <el-form :model="queryParams" class="form-box" ref="queryForm"
|
|
|
+ :inline="true" style="width:100%;">
|
|
|
+ <el-form-item label="" prop="logType">
|
|
|
+ <el-select v-model="queryParams.logType" clearable placeholder="请选择类型" style="width: 200px">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in optionList"
|
|
|
+ :key="dict.code"
|
|
|
+ :label="dict.name"
|
|
|
+ :value="dict.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
|
|
|
+ <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="page-content-box">
|
|
|
+ <el-table class="table-box" border :data="dataList">
|
|
|
+ <el-table-column label="类型" prop="logTypeName" width="160" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="请求" prop="reqBody" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p class="clickCopy" @click="clickCopy(scope.row.reqBody)">{{scope.row.reqBody}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="响应" prop="respBody" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p class="clickCopy" @click="clickCopy(scope.row.respBody)">{{scope.row.respBody}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" prop="state" width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.state?'成功':'失败'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="时间" prop="createTime" width="200" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" prop="remark" width="200" show-overflow-tooltip/>
|
|
|
+ </el-table>
|
|
|
+ <pagination :page-sizes="[10, 20, 30, 40]"
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.page"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { iotDeviceLogType,iotDeviceLogList } from "@/api/iotDevice/index";
|
|
|
+ export default {
|
|
|
+ name: 'hardwareLog',
|
|
|
+ props:{
|
|
|
+ hardwareLogPropsData:{},
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ //类型下拉列表数据
|
|
|
+ optionList:[],
|
|
|
+ //查询条件
|
|
|
+ queryParams:{
|
|
|
+ page:1,
|
|
|
+ pageSize:10,
|
|
|
+ logType:null,
|
|
|
+ },
|
|
|
+ dataList:[],
|
|
|
+ total:0,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.initialize();
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ initialize(){
|
|
|
+ this.iotDeviceLogType();
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ iotDeviceLogType(){
|
|
|
+ iotDeviceLogType({}).then(response =>{
|
|
|
+ this.$set(this,'optionList',response.data);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //查询按钮
|
|
|
+ handleQuery(){
|
|
|
+ this.$set(this.queryParams,'page',1);
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //重置按钮
|
|
|
+ resetQuery(){
|
|
|
+ this.$set(this,'dateRange',[])
|
|
|
+ this.$set(this,'queryParams',{
|
|
|
+ page:1,
|
|
|
+ pageSize:10,
|
|
|
+ logType:null,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getList(){
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
+ obj.deviceId = this.hardwareLogPropsData.id;
|
|
|
+ iotDeviceLogList(obj).then(response =>{
|
|
|
+ this.$set(this,'dataList',response.data.records);
|
|
|
+ this.$set(this,'total',response.data.total);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ .iotHardware-hardwareLog{
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+</style>
|