各种日志

This commit is contained in:
邱贞招 2024-10-25 11:26:49 +08:00
parent 932d08b7bc
commit eefead233d
6 changed files with 456 additions and 14 deletions

44
src/api/rl/locationLog.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询定位日志列表
export function listLocationLog(query) {
return request({
url: '/system/locationLog/list',
method: 'get',
params: query
})
}
// 查询定位日志详细
export function getLocationLog(locationId) {
return request({
url: '/system/locationLog/' + locationId,
method: 'get'
})
}
// 新增定位日志
export function addLocationLog(data) {
return request({
url: '/system/locationLog',
method: 'post',
data: data
})
}
// 修改定位日志
export function updateLocationLog(data) {
return request({
url: '/system/locationLog',
method: 'put',
data: data
})
}
// 删除定位日志
export function delLocationLog(locationId) {
return request({
url: '/system/locationLog/' + locationId,
method: 'delete'
})
}

View File

@ -100,6 +100,11 @@
<el-table-column label="代理商结余" align="center" prop="afterBalance" />
<el-table-column label="变动金额" align="center" prop="amount" />
<el-table-column label="所属人名称" align="center" prop="ownerName" />
<el-table-column label="所属人类型" align="center" prop="ownerType">
<template slot-scope="scope">
<dict-tag :options="dict.type.rl_user_type" :value="scope.row.ownerType"/>
</template>
</el-table-column>
<!-- <el-table-column label="所属人id" align="center" prop="ownerId" />-->
<el-table-column label="手机号" align="center" prop="ownerPhone" />
<el-table-column label="变动原因" align="center" prop="reason" />
@ -182,7 +187,7 @@ import { listChangeBalance, getChangeBalance, delChangeBalance, addChangeBalance
export default {
name: "ChangeBalance",
dicts: ['rl_change_type', 'rl_business_type'],
dicts: ['rl_change_type', 'rl_business_type','rl_user_type'],
data() {
return {
//

View File

@ -0,0 +1,379 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="mac" prop="mac">
<el-input
v-model="queryParams.mac"
placeholder="请输入mac"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="车辆状态" prop="status">-->
<!-- <el-select v-model="queryParams.status" placeholder="请选择车辆状态" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.rl_device_status"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="锁状态" prop="lockStatus">-->
<!-- <el-select v-model="queryParams.lockStatus" placeholder="请选择锁状态" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.rl_device_lock_status"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:locationLog:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="locationLogList" :default-sort="defaultSort" @sort-change="handleSortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="定位id" align="center" prop="locationId" />
<el-table-column label="mac" align="center" prop="mac" />
<!-- <el-table-column label="onenet接收到的消息" align="center" prop="onenetMsg" />-->
<!-- <el-table-column label="经度" align="center" prop="longitude" />-->
<!-- <el-table-column label="纬度" align="center" prop="latitude" />-->
<el-table-column label="位置" align="center">
<template slot-scope="scope">
<a
:href="`https://uri.amap.com/marker?position=${scope.row.longitude},${scope.row.latitude}`"
target="_blank"
class="link-type">
{{ scope.row.longitude }}, {{ scope.row.latitude }}
</a>
</template>
</el-table-column>
<el-table-column label="onenet消息时间" align="center" prop="at" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.at, '{y}-{m}-{d} {h}:{i}:{s}' ) }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}' ) }}</span>
</template>
</el-table-column>
<!-- 新增列电动车状态电池电压信号强度卫星数量钥匙 -->
<el-table-column label="电动车状态" align="center" prop="status2">
<template slot-scope="scope">
<span>{{ formatStatus(scope.row.status2) }}</span>
</template>
</el-table-column>
<el-table-column label="电池电压" align="center" prop="bat">
<template slot-scope="scope">
<span>{{ formatVoltage(scope.row.bat) }}</span>
</template>
</el-table-column>
<el-table-column label="信号强度" align="center" prop="csq">
<template slot-scope="scope">
<span>{{ scope.row.csq }}</span>
</template>
</el-table-column>
<el-table-column label="卫星数量" align="center" prop="s">
<template slot-scope="scope">
<span>{{ scope.row.s }}</span>
</template>
</el-table-column>
<el-table-column label="钥匙状态" align="center" prop="q">
<template slot-scope="scope">
<span>{{ scope.row.q }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="车辆状态" align="center" prop="status" >-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag-->
<!-- :options="dict.type.rl_device_status"-->
<!-- :value="scope.row.status"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="锁状态" align="center" prop="lockStatus" >-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag-->
<!-- :options="dict.type.rl_device_lock_status"-->
<!-- :value="scope.row.lockStatus"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['system:locationLog:query']"
>详细</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改定位日志对话框 -->
<el-dialog title="命令日志详细" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" label-width="100px">
<el-col :span="12">
<el-form-item label="MAC">{{ form.mac }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SN">{{ form.sn }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经度">{{ form.longitude }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纬度">{{ form.latitude }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="消息">{{ form.onenetMsg }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="消息时间">{{ form.at }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">{{ form.createTime }}</el-form-item>
</el-col>
<!-- 新增字段展示 -->
<el-col :span="12">
<el-form-item label="电动车状态">{{ formatStatus(form.status2) }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电池电压">{{ formatVoltage(form.bat) }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="信号强度">{{ form.csq }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="卫星数量">{{ form.s }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="钥匙状态">{{ form.q }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆状态">
<dict-tag :options="dict.type.rl_device_status" :value="form.status"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="锁状态">
<dict-tag :options="dict.type.rl_device_lock_status" :value="form.lockStatus"/>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listLocationLog, getLocationLog, delLocationLog, addLocationLog, updateLocationLog } from "@/api/rl/locationLog";
export default {
name: "LocationLog",
dicts: ["rl_device_lock_status","rl_device_status"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
locationLogList: [],
defaultSort: {prop: 'createTime', order: 'descending'},
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 20,
mac: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
const mac = this.$route.params && this.$route.params.mac;
if (mac != null) {
this.queryParams.mac = mac;
}
this.getList();
},
methods: {
//
formatStatus(status) {
const statusMap = {
0: '断电',
1: '上电运行',
2: '轮动抱死',
3: '超出区域断电'
};
return statusMap[status] || '未知状态';
},
// '50.1V'
formatVoltage(bat) {
if (bat === null || bat === undefined) return '0.0V';
return (bat / 10).toFixed(1) + 'V';
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 排序触发事件 */
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
/** 查询定位日志列表 */
getList() {
this.loading = true;
listLocationLog(this.queryParams).then(response => {
this.locationLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
locationId: null,
mac: null,
onenetMsg: null,
longitude: null,
latitude: null,
createTime: null,
at: null,
status: null,
lockStatus: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.locationId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加定位日志";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const locationId = row.locationId || this.ids
getLocationLog(locationId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改定位日志";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.locationId != null) {
updateLocationLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addLocationLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const locationIds = row.locationId || this.ids;
this.$modal.confirm('是否确认删除定位日志编号为"' + locationIds + '"的数据项?').then(function() {
return delLocationLog(locationIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/locationLog/export', {
...this.queryParams
}, `locationLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -4,7 +4,7 @@
<el-form-item label="短信类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择短信类型" clearable>
<el-option
v-for="dict in dict.type.et_msg_type"
v-for="dict in dict.type.rl_msg_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -74,13 +74,13 @@
<el-table v-loading="loading" :data="msgLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="短信签名" align="center" prop="signName" />
<el-table-column label="短信类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_msg_type" :value="scope.row.type"/>
<dict-tag :options="dict.type.rl_msg_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="短信签名" align="center" prop="signName" />
<el-table-column label="内容" align="center" prop="content" />
<el-table-column label="内容" align="center" prop="content" width="500"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -132,7 +132,7 @@ import { listMsgLog, getMsgLog, delMsgLog, addMsgLog, updateMsgLog } from "@/api
export default {
name: "MsgLog",
dicts: ['et_msg_type'],
dicts: ['rl_msg_type'],
data() {
return {
//

View File

@ -20,7 +20,7 @@
<el-form-item label="在线状态" prop="onlineStatus">
<el-select v-model="queryParams.onlineStatus" placeholder="请选择在线状态" clearable>
<el-option
v-for="dict in dict.type.as_online_status"
v-for="dict in dict.type.rl_online_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -41,7 +41,7 @@
<el-table-column label="SN" align="center" prop="sn" />
<el-table-column label="在线状态" align="center" prop="onlineStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.as_online_status" :value="scope.row.onlineStatus"/>
<dict-tag :options="dict.type.rl_online_status" :value="scope.row.onlineStatus"/>
</template>
</el-table-column>
<el-table-column label="经度" align="center" prop="longitude" />
@ -78,7 +78,7 @@ import { listOnlineLog, getOnlineLog, delOnlineLog, addOnlineLog, updateOnlineLo
export default {
name: "OnlineLog",
dicts: ['as_online_status'],
dicts: ['rl_online_status'],
data() {
return {
//

View File

@ -97,12 +97,25 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="操作id" align="center" prop="operId" />
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="操作类型" align="center" prop="operType" />
<el-table-column label="操作类型" align="center" prop="operType">
<template slot-scope="scope">
<dict-tag :options="dict.type.rl_order_oper_type" :value="scope.row.operType"/>
</template>
</el-table-column>
<el-table-column label="详情" align="center" prop="details" />
<el-table-column label="订单金额" align="center" prop="amountChange" />
<el-table-column label="订单状态" align="center" prop="statusChange" />
<el-table-column label="操作人" align="center" prop="operUserId" />
<el-table-column label="手机号" align="center" prop="operPhone" />
<el-table-column label="操作前金额" align="center" prop="beforeAmount" />
<el-table-column label="操作后金额" align="center" prop="afterAmount" />
<el-table-column label="操作前状态" align="center" prop="beforeStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.rl_order_status" :value="scope.row.beforeStatus"/>
</template>
</el-table-column>
<el-table-column label="操作后状态" align="center" prop="afterStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.rl_order_status" :value="scope.row.afterStatus"/>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operPhone" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -166,6 +179,7 @@ import { listOrderOper, getOrderOper, delOrderOper, addOrderOper, updateOrderOpe
export default {
name: "OrderOper",
dicts: ['rl_order_oper_type','rl_order_status'],
data() {
return {
//